@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
@@ -0,0 +1,59 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { useAtomValue } from '@effect-atom/atom-react';
6
+ import * as Effect from 'effect/Effect';
7
+ import React, { useCallback } from 'react';
8
+
9
+ import { useSettingsState, usePluginManager } from '@dxos/app-framework/ui';
10
+ import { type AppCapabilities } from '@dxos/app-toolkit';
11
+ import { runAndForwardErrors } from '@dxos/effect';
12
+
13
+ import { RegistrySettings } from '../../components';
14
+ import { type RegistrySettings as RegistrySettingsType } from '../../types';
15
+
16
+ export type RegistrySettingsContainerProps = {
17
+ subject: AppCapabilities.Settings;
18
+ };
19
+
20
+ /**
21
+ * Wires the {@link RegistrySettings} presentational component to the plugin
22
+ * manager and the settings atom: subscribes to `manager.devPluginIds` for the
23
+ * "currently loaded" indicator and exposes enable/disable callbacks that drive
24
+ * the manager's add/enable/remove flow.
25
+ */
26
+ export const RegistrySettingsContainer = ({ subject }: RegistrySettingsContainerProps) => {
27
+ const manager = usePluginManager();
28
+ const { settings, updateSettings } = useSettingsState<RegistrySettingsType>(subject.atom);
29
+ const activeDevPluginIds = useAtomValue(manager.devPluginIds);
30
+
31
+ const onEnableDev = useCallback(
32
+ async (url: string) => {
33
+ await runAndForwardErrors(
34
+ Effect.gen(function* () {
35
+ const plugin = yield* manager.add(url);
36
+ yield* manager.enable(plugin.meta.id);
37
+ }),
38
+ );
39
+ },
40
+ [manager],
41
+ );
42
+
43
+ const onDisableDev = useCallback(
44
+ async (id: string) => {
45
+ await runAndForwardErrors(manager.remove(id));
46
+ },
47
+ [manager],
48
+ );
49
+
50
+ return (
51
+ <RegistrySettings
52
+ settings={settings}
53
+ onSettingsChange={updateSettings}
54
+ activeDevPluginIds={activeDevPluginIds}
55
+ onEnableDev={onEnableDev}
56
+ onDisableDev={onDisableDev}
57
+ />
58
+ );
59
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export { RegistrySettingsContainer as default } from './RegistrySettingsContainer';
@@ -7,4 +7,6 @@ import { type ComponentType, lazy } from 'react';
7
7
  export { LOAD_PLUGIN_DIALOG } from './LoadPluginDialog/LoadPluginDialog';
8
8
  export const LoadPluginDialog: ComponentType<any> = lazy(() => import('./LoadPluginDialog'));
9
9
  export const PluginArticle: ComponentType<any> = lazy(() => import('./PluginArticle'));
10
- export const PluginRegistry: ComponentType<any> = lazy(() => import('./PluginRegistry'));
10
+ export const PublicRegistryArticle: ComponentType<any> = lazy(() => import('./PublicRegistryArticle'));
11
+ export const RegistryArticle: ComponentType<any> = lazy(() => import('./RegistryArticle'));
12
+ export const RegistrySettingsContainer: ComponentType<any> = lazy(() => import('./RegistrySettingsContainer'));
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export * from './use-auto-tags';
6
+ export * from './use-disable-confirmation';
7
+ export * from './use-registry-plugins';
8
+ export * from './use-update-available';
@@ -0,0 +1,51 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { useMemo } from 'react';
6
+
7
+ import { type Registry, UrlLoader } from '@dxos/app-framework';
8
+
9
+ /**
10
+ * Auto-tags that are derived at display time rather than persisted to `Plugin.Meta`.
11
+ * - `registry`: plugin id appears in the registry catalog manifest.
12
+ * - `local`: plugin was loaded from a `localhost` / `127.0.0.1` / `::1` URL.
13
+ */
14
+ export type AutoTagsMap = Record<string, readonly string[]>;
15
+
16
+ /**
17
+ * Computes the per-plugin-id extra tags the UI should display.
18
+ *
19
+ * Reads the persisted remote-plugin entries synchronously to derive `local`, and
20
+ * adds `registry` for any plugin id found in the supplied registry manifest entries.
21
+ */
22
+ export const useAutoTags = (registryEntries: readonly Registry.Plugin[]): AutoTagsMap =>
23
+ useMemo(() => {
24
+ const byId: Record<string, string[]> = {};
25
+ const addTag = (id: string, tag: string) => {
26
+ const existing = byId[id];
27
+ if (!existing) {
28
+ byId[id] = [tag];
29
+ } else if (!existing.includes(tag)) {
30
+ existing.push(tag);
31
+ }
32
+ };
33
+
34
+ for (const entry of UrlLoader.getRemoteEntries()) {
35
+ if (UrlLoader.isLocalUrl(entry.url)) {
36
+ addTag(entry.id, 'local');
37
+ }
38
+ }
39
+ for (const entry of registryEntries) {
40
+ addTag(entry.id, 'registry');
41
+ }
42
+
43
+ return byId;
44
+ }, [registryEntries]);
45
+
46
+ /**
47
+ * Returns the set of plugin ids known to originate from a remote URL (not bundled).
48
+ * Used to filter the Official/Recommended sections so third-party plugins are excluded.
49
+ */
50
+ export const useRemotePluginIds = (): ReadonlySet<string> =>
51
+ useMemo(() => new Set(UrlLoader.getRemoteEntries().map((entry) => entry.id)), []);
@@ -0,0 +1,58 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { useCallback } from 'react';
6
+
7
+ import { type PluginManager } from '@dxos/app-framework';
8
+ import { useOperationInvoker } from '@dxos/app-framework/ui';
9
+ import { LayoutOperation } from '@dxos/app-toolkit';
10
+
11
+ import { DISABLE_DEPENDENTS_DIALOG } from '#meta';
12
+
13
+ /**
14
+ * Returns `requestDisable(pluginId)` that gates `manager.disable` on a
15
+ * confirmation prompt when the target has currently-enabled dependents.
16
+ *
17
+ * `PluginManager.disable` cascades by default; this hook is the UX safeguard
18
+ * around that. The caller supplies a `dispatch` callback that performs the
19
+ * actual disable (wrapping it with observability or any other side effects).
20
+ * When there are no enabled dependents, dispatch runs immediately; otherwise
21
+ * we open the shared {@link DISABLE_DEPENDENTS_DIALOG} surface — its
22
+ * `onConfirm` runs the dispatch and closes the dialog.
23
+ *
24
+ * Display-name resolution for the dialog is delegated to the registered
25
+ * plugin set (`Plugin.Meta.name`). Per-plugin i18n translations only load
26
+ * when a plugin is activated, so `meta.name` is the only label always
27
+ * available regardless of enabled state.
28
+ */
29
+ export const useDisableConfirmation = (manager: PluginManager.PluginManager, dispatch: (id: string) => void) => {
30
+ const { invokePromise } = useOperationInvoker();
31
+
32
+ return useCallback(
33
+ (pluginId: string): void => {
34
+ const enabledDependents = manager.getDependents(pluginId, { transitive: true, enabledOnly: true });
35
+ if (enabledDependents.length === 0) {
36
+ dispatch(pluginId);
37
+ return;
38
+ }
39
+ const resolveName = (id: string): string =>
40
+ manager.getPlugins().find((plugin) => plugin.meta.id === id)?.meta.name ?? id;
41
+ void invokePromise(LayoutOperation.UpdateDialog, {
42
+ subject: DISABLE_DEPENDENTS_DIALOG,
43
+ state: true,
44
+ type: 'alert',
45
+ props: {
46
+ pluginId,
47
+ dependents: enabledDependents,
48
+ onResolvePluginName: resolveName,
49
+ onConfirm: () => {
50
+ dispatch(pluginId);
51
+ void invokePromise(LayoutOperation.UpdateDialog, { state: false });
52
+ },
53
+ },
54
+ });
55
+ },
56
+ [manager, dispatch, invokePromise],
57
+ );
58
+ };
@@ -0,0 +1,29 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { useAtomValue } from '@effect-atom/atom-react';
6
+
7
+ import { type Registry } from '@dxos/app-framework';
8
+ import { usePluginManager } from '@dxos/app-framework/ui';
9
+
10
+ /**
11
+ * Reads the registry plugin catalog from `manager.pluginRegistry.plugins`.
12
+ * The catalog is loaded once when the plugin manager is constructed (with a
13
+ * provider) so this hook is purely reactive — subscribers re-render as the
14
+ * `{entries, loading, error}` state settles.
15
+ */
16
+ export const useRegistryPlugins = (): Registry.PluginsState => {
17
+ const manager = usePluginManager();
18
+ return useAtomValue(manager.pluginRegistry.plugins);
19
+ };
20
+
21
+ /**
22
+ * Returns the live `Registry.Manager` from the plugin manager so callers can
23
+ * issue `listVersions` / `getPlugin` calls directly. The catalog state itself
24
+ * is best read through {@link useRegistryPlugins} above.
25
+ */
26
+ export const useRegistryPluginProvider = (): Registry.Manager => {
27
+ const manager = usePluginManager();
28
+ return manager.pluginRegistry;
29
+ };
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { type Registry, UrlLoader } from '@dxos/app-framework';
6
+
7
+ /**
8
+ * Returns a set of plugin ids for which the registry has a newer version
9
+ * than what was recorded at install time.
10
+ *
11
+ * Only flags plugins where a version was recorded at install time AND it differs
12
+ * from the catalog's current version. Legacy installs (no version stored) are ignored.
13
+ *
14
+ * NOTE: this is intentionally NOT memoised. The installed-version side of the
15
+ * comparison lives in localStorage and is mutated by `manager.add` /
16
+ * `manager.remove` / `UrlLoader.setInstalledVersion` outside React's view, so a
17
+ * memo keyed on `entries` would happily return stale data for the rest of the
18
+ * session after an update completes (the bug that produced "Update button
19
+ * reappears after Updating…"). The loop is O(catalog size) sync reads — cheap
20
+ * enough to do every render.
21
+ */
22
+ export const useUpdateAvailableIds = (entries: readonly Registry.Plugin[]): ReadonlySet<string> => {
23
+ const ids = new Set<string>();
24
+ for (const entry of entries) {
25
+ const installedVersion = UrlLoader.getInstalledVersion(entry.id);
26
+ if (installedVersion !== undefined && installedVersion !== entry.version) {
27
+ ids.add(entry.id);
28
+ }
29
+ }
30
+ return ids;
31
+ };
package/src/index.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  //
4
4
 
5
5
  export * from './meta';
6
- export * from './RegistryPlugin';
6
+ export * from './storage';
package/src/meta.ts CHANGED
@@ -25,4 +25,9 @@ export const meta: Plugin.Meta = {
25
25
  Plugin management system for discovering, installing, and configuring workspace extensions.
26
26
  Browse available plugins and customize your workspace capabilities.
27
27
  `,
28
+ icon: 'ph--squares-four--regular',
29
+ tags: ['system'],
28
30
  };
31
+
32
+ /** Cascade-disable confirmation dialog surface id. */
33
+ export const DISABLE_DEPENDENTS_DIALOG = `${meta.id}.disable-dependents-dialog`;
@@ -2,6 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { OperationHandlerSet } from '@dxos/operation';
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
6
 
7
7
  export const RegistryOperationHandlerSet = OperationHandlerSet.lazy(() => import('./open-plugin-registry'));
@@ -5,7 +5,7 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
8
- import { Operation } from '@dxos/operation';
8
+ import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { REGISTRY_ID } from '#meta';
11
11
 
package/src/plugin.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const RegistryPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
11
+ export { RegistryOperationHandlerSet } from './operations';
@@ -14,20 +14,60 @@ export const translations = [
14
14
  'details.label': 'Details',
15
15
  'home-page.label': 'Website',
16
16
  'source.label': 'Source',
17
- 'plugin-registry.label': 'Plugin Registry',
18
- 'all-plugins.label': 'All',
17
+ 'plugin-registry.label': 'Plugins',
18
+ 'plugin-settings.label': 'Plugin Settings',
19
+ 'official-plugins.label': 'Official',
19
20
  'installed-plugins.label': 'Enabled',
20
21
  'recommended-plugins.label': 'Recommended',
21
22
  'labs-plugins.label': 'Labs',
22
- 'community-plugins.label': 'Community',
23
+ 'registry-plugins.label': 'Registry',
23
24
  'load-by-url.label': 'Load from URL',
24
25
  'load-by-url-dialog.title': 'Load Plugin from URL',
25
26
  'plugin-url.label': 'Plugin URL',
26
27
  'load-plugin.label': 'Load Plugin',
27
28
  'loading.label': 'Loading...',
29
+ 'filter.label': 'Filter plugins',
30
+ 'filter.placeholder': 'Filter…',
31
+ 'registry.loading.label': 'Loading registry plugins…',
32
+ 'registry.error.label': 'Failed to load registry plugins: {{message}}',
33
+ 'registry.empty.label': 'No registry plugins available.',
34
+ 'dev-plugin.section.title': 'Dev plugin',
35
+ 'dev-plugin.description':
36
+ 'Load a plugin from a local Vite dev server (the `composerPlugin` defaults to port 3967). Composer reattaches it on every reload, surviving HMR — useful when iterating on a community plugin against a live registry version.',
37
+ 'dev-plugin.url.label': 'Manifest URL',
38
+ 'dev-plugin.url.description':
39
+ 'Defaults to the local dev server. Edit if your dev server runs on a different port.',
40
+ 'dev-plugin.toggle.label': 'Dev plugin',
41
+ 'dev-plugin.toggle.description':
42
+ 'Stays on across reloads. If the dev server is offline at boot, a warning is logged and the next reload retries.',
43
+ 'dev-plugin.enable.label': 'Enable',
44
+ 'dev-plugin.disable.label': 'Disable',
45
+ 'dev-plugin.busy.label': 'Loading…',
46
+ 'dev-plugin.not-loaded.message':
47
+ 'Dev plugin is enabled but not currently loaded. Check that the dev server is running, then reload.',
28
48
  'coming-soon.label': 'Coming soon!',
29
49
  'open-plugin-registry.label': 'Open plugin registry',
30
- 'settings.label': 'Settings',
50
+ 'install.label': 'Install',
51
+ 'installing.label': 'Installing…',
52
+ 'uninstall.label': 'Uninstall',
53
+ 'update.label': 'Update',
54
+ 'updating.label': 'Updating…',
55
+ 'versions.label': 'Versions',
56
+ 'installed.label': 'installed',
57
+ 'install-version.label': 'Install version',
58
+ 'failure-badge.label': 'Plugin failure details',
59
+ 'failure-title.label': 'Plugin {{phase}} failed: {{reason}}',
60
+ 'failure-phase-load.label': 'load',
61
+ 'failure-phase-activation.label': 'activation',
62
+ 'failure-reason-timeout.label': 'timed out',
63
+ 'failure-reason-error.label': 'error',
64
+ 'dependencies.label': 'Requires',
65
+ 'dependents.label': 'Required by',
66
+ 'disable-dependents-dialog.title': 'Disable dependent plugins?',
67
+ 'disable-dependents-dialog.description':
68
+ 'Disabling {{plugin}} will also disable the following plugins that depend on it:',
69
+ 'disable-dependents-dialog.confirm.label': 'Disable',
70
+ 'cancel.label': 'Cancel',
31
71
  },
32
72
  },
33
73
  },
package/src/types.ts CHANGED
@@ -2,16 +2,48 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { type Atom } from '@effect-atom/atom-react';
5
6
  import * as Schema from 'effect/Schema';
6
7
 
8
+ import { Capability } from '@dxos/app-framework';
9
+
7
10
  export const RegistrySettingsSchema = Schema.mutable(
8
11
  Schema.Struct({
9
12
  experimental: Schema.optional(Schema.Boolean),
13
+ /**
14
+ * Manifest URL for a plugin served by a local Vite dev server. The
15
+ * registry settings panel pre-fills this with `localhost:3967`; authors
16
+ * iterating on a different port can edit it.
17
+ */
18
+ devPluginUrl: Schema.optional(Schema.String),
19
+ /**
20
+ * When true, the registry plugin attempts to load `devPluginUrl` on every
21
+ * app boot. Failures (dev server offline, manifest 404) are logged and
22
+ * the flag stays on so the next boot retries — the user explicitly turns
23
+ * it off when they're done iterating.
24
+ */
25
+ devPluginEnabled: Schema.optional(Schema.Boolean),
10
26
  }),
11
27
  );
12
28
 
13
29
  export type RegistrySettings = Schema.Schema.Type<typeof RegistrySettingsSchema>;
14
30
 
15
- export const RegistryTagType = Schema.Literal('new', 'beta', 'labs', 'popular', 'featured', 'experimental');
31
+ /**
32
+ * Per-plugin capabilities exposed by `@dxos/plugin-registry`.
33
+ */
34
+ export namespace RegistryCapabilities {
35
+ export const Settings = Capability.make<Atom.Writable<RegistrySettings>>('@dxos/plugin-registry/settings');
36
+ }
37
+
38
+ export const RegistryTagType = Schema.Literal(
39
+ 'new',
40
+ 'beta',
41
+ 'labs',
42
+ 'popular',
43
+ 'featured',
44
+ 'experimental',
45
+ 'registry',
46
+ 'local',
47
+ );
16
48
 
17
49
  export type RegistryTagType = Schema.Schema.Type<typeof RegistryTagType>;
@@ -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,eAAQ,IAAA,CAAA,CAAA;AAE5D,QAAMC,MAAWC,WAAMN,OAAAA;AACvB,QAAMO,SAAS,OAAcC,qBAAcnB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AS8B,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,71 +0,0 @@
1
- // src/meta.ts
2
- import { pinnedWorkspaceId } from "@dxos/app-toolkit";
3
- import { trim } from "@dxos/util";
4
- var REGISTRY_ID = pinnedWorkspaceId("dxos:plugin-registry");
5
- var REGISTRY_KEY = "plugin-registry";
6
- var CATEGORY_SEPARATOR = ">";
7
- var registryCategoryId = (category) => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;
8
- var getPluginPath = (pluginId) => `root/${REGISTRY_ID}/${pluginId}`;
9
- var meta = {
10
- id: "org.dxos.plugin.registry",
11
- name: "Plugins",
12
- description: trim`
13
- Plugin management system for discovering, installing, and configuring workspace extensions.
14
- Browse available plugins and customize your workspace capabilities.
15
- `
16
- };
17
-
18
- // src/RegistryPlugin.tsx
19
- import { Plugin } from "@dxos/app-framework";
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);
63
- export {
64
- REGISTRY_ID,
65
- REGISTRY_KEY,
66
- RegistryPlugin,
67
- getPluginPath,
68
- meta,
69
- registryCategoryId
70
- };
71
- //# 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/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4446},"dist/lib/browser/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":2303},"dist/lib/browser/cli/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13861},"dist/lib/browser/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":7011}}}