@dxos/plugin-registry 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29

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 (234) hide show
  1. package/dist/lib/neutral/RegistryPlugin.mjs +27 -0
  2. package/dist/lib/neutral/RegistryPlugin.mjs.map +7 -0
  3. package/dist/lib/{browser/cli/index.mjs → neutral/RegistryPlugin.node.mjs} +28 -97
  4. package/dist/lib/neutral/RegistryPlugin.node.mjs.map +7 -0
  5. package/dist/lib/neutral/chunk-XK2JMH3H.mjs +33 -0
  6. package/dist/lib/neutral/chunk-XK2JMH3H.mjs.map +7 -0
  7. package/dist/lib/{browser/chunk-KMUDYITM.mjs → neutral/chunk-YV7A523U.mjs} +11 -3
  8. package/dist/lib/neutral/chunk-YV7A523U.mjs.map +7 -0
  9. package/dist/lib/neutral/index.mjs +21 -0
  10. package/dist/lib/neutral/index.mjs.map +7 -0
  11. package/dist/lib/neutral/meta.json +1 -0
  12. package/dist/lib/neutral/open-plugin-registry-II735N76.mjs +15 -0
  13. package/dist/lib/neutral/open-plugin-registry-II735N76.mjs.map +7 -0
  14. package/dist/lib/neutral/plugin.mjs +18 -0
  15. package/dist/lib/neutral/plugin.mjs.map +7 -0
  16. package/dist/lib/neutral/translations.mjs +61 -0
  17. package/dist/lib/neutral/translations.mjs.map +7 -0
  18. package/dist/types/src/RegistryPlugin.d.ts +1 -0
  19. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  20. package/dist/types/src/{cli/plugin.d.ts → RegistryPlugin.node.d.ts} +2 -1
  21. package/dist/types/src/RegistryPlugin.node.d.ts.map +1 -0
  22. package/dist/types/src/RegistryPlugin.test.d.ts +2 -0
  23. package/dist/types/src/RegistryPlugin.test.d.ts.map +1 -0
  24. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  25. package/dist/types/src/capabilities/dev-plugin-loader.d.ts +11 -0
  26. package/dist/types/src/capabilities/dev-plugin-loader.d.ts.map +1 -0
  27. package/dist/types/src/capabilities/index.d.ts +15 -3
  28. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  30. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/settings.d.ts +14 -0
  33. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  34. package/dist/types/src/{cli/commands → commands}/disable.d.ts +2 -2
  35. package/dist/types/src/commands/disable.d.ts.map +1 -0
  36. package/dist/types/src/{cli/commands → commands}/enable.d.ts +2 -2
  37. package/dist/types/src/commands/enable.d.ts.map +1 -0
  38. package/dist/types/src/commands/index.d.ts.map +1 -0
  39. package/dist/types/src/commands/list.d.ts +7 -0
  40. package/dist/types/src/commands/list.d.ts.map +1 -0
  41. package/dist/types/src/commands/util.d.ts.map +1 -0
  42. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +39 -2
  43. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -1
  44. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +51 -16
  45. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -1
  46. package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts +20 -0
  47. package/dist/types/src/components/PluginFailureBadge/PluginFailureBadge.d.ts.map +1 -0
  48. package/dist/types/src/components/PluginFailureBadge/index.d.ts +2 -0
  49. package/dist/types/src/components/PluginFailureBadge/index.d.ts.map +1 -0
  50. package/dist/types/src/components/PluginList/PluginItem.d.ts +29 -2
  51. package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -1
  52. package/dist/types/src/components/PluginList/PluginList.d.ts +18 -3
  53. package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -1
  54. package/dist/types/src/components/PluginList/PluginList.stories.d.ts +49 -16
  55. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -1
  56. package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts +18 -0
  57. package/dist/types/src/components/RegistrySettings/RegistrySettings.d.ts.map +1 -0
  58. package/dist/types/src/components/RegistrySettings/index.d.ts +2 -0
  59. package/dist/types/src/components/RegistrySettings/index.d.ts.map +1 -0
  60. package/dist/types/src/components/index.d.ts +2 -0
  61. package/dist/types/src/components/index.d.ts.map +1 -1
  62. package/dist/types/src/containers/BaseRegistryArticle/BaseRegistryArticle.d.ts +20 -0
  63. package/dist/types/src/containers/BaseRegistryArticle/BaseRegistryArticle.d.ts.map +1 -0
  64. package/dist/types/src/containers/BaseRegistryArticle/index.d.ts +2 -0
  65. package/dist/types/src/containers/BaseRegistryArticle/index.d.ts.map +1 -0
  66. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts +4 -0
  67. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -0
  68. package/dist/types/src/containers/LoadPluginDialog/index.d.ts +2 -0
  69. package/dist/types/src/containers/LoadPluginDialog/index.d.ts.map +1 -0
  70. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -1
  71. package/dist/types/src/containers/PluginArticle/index.d.ts +1 -2
  72. package/dist/types/src/containers/PluginArticle/index.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 +5 -1
  86. package/dist/types/src/containers/index.d.ts.map +1 -1
  87. package/dist/types/src/hooks/index.d.ts +4 -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-registry-plugins.d.ts +15 -0
  92. package/dist/types/src/hooks/use-registry-plugins.d.ts.map +1 -0
  93. package/dist/types/src/hooks/use-update-available.d.ts +18 -0
  94. package/dist/types/src/hooks/use-update-available.d.ts.map +1 -0
  95. package/dist/types/src/index.d.ts +1 -1
  96. package/dist/types/src/index.d.ts.map +1 -1
  97. package/dist/types/src/meta.d.ts +3 -1
  98. package/dist/types/src/meta.d.ts.map +1 -1
  99. package/dist/types/src/operations/index.d.ts +3 -0
  100. package/dist/types/src/operations/index.d.ts.map +1 -0
  101. package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
  102. package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
  103. package/dist/types/src/plugin.d.ts +4 -0
  104. package/dist/types/src/plugin.d.ts.map +1 -0
  105. package/dist/types/src/storage.d.ts.map +1 -0
  106. package/dist/types/src/translations.d.ts +48 -16
  107. package/dist/types/src/translations.d.ts.map +1 -1
  108. package/dist/types/src/types.d.ts +30 -1
  109. package/dist/types/src/types.d.ts.map +1 -1
  110. package/dist/types/tsconfig.tsbuildinfo +1 -1
  111. package/package.json +57 -36
  112. package/src/{cli/plugin.ts → RegistryPlugin.node.ts} +3 -1
  113. package/src/RegistryPlugin.test.ts +24 -0
  114. package/src/RegistryPlugin.tsx +13 -5
  115. package/src/capabilities/app-graph-builder.ts +200 -0
  116. package/src/capabilities/dev-plugin-loader.ts +39 -0
  117. package/src/capabilities/index.ts +11 -3
  118. package/src/capabilities/operation-handler.ts +16 -0
  119. package/src/capabilities/react-surface.tsx +136 -0
  120. package/src/capabilities/settings.ts +34 -0
  121. package/src/components/PluginDetail/PluginDetail.stories.tsx +4 -4
  122. package/src/components/PluginDetail/PluginDetail.tsx +175 -60
  123. package/src/components/PluginFailureBadge/PluginFailureBadge.tsx +68 -0
  124. package/src/components/PluginFailureBadge/index.ts +5 -0
  125. package/src/components/PluginList/PluginItem.tsx +116 -14
  126. package/src/components/PluginList/PluginList.stories.tsx +17 -14
  127. package/src/components/PluginList/PluginList.tsx +32 -4
  128. package/src/components/RegistrySettings/RegistrySettings.tsx +120 -0
  129. package/src/components/RegistrySettings/index.ts +5 -0
  130. package/src/components/index.ts +2 -0
  131. package/src/containers/BaseRegistryArticle/BaseRegistryArticle.tsx +163 -0
  132. package/src/containers/BaseRegistryArticle/index.ts +5 -0
  133. package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +87 -0
  134. package/src/containers/LoadPluginDialog/index.ts +5 -0
  135. package/src/containers/PluginArticle/PluginArticle.tsx +317 -9
  136. package/src/containers/PluginArticle/index.ts +1 -3
  137. package/src/containers/PublicRegistryArticle/PublicRegistryArticle.tsx +192 -0
  138. package/src/containers/PublicRegistryArticle/index.ts +5 -0
  139. package/src/containers/RegistryArticle/RegistryArticle.tsx +53 -0
  140. package/src/containers/RegistryArticle/index.ts +5 -0
  141. package/src/containers/RegistrySettingsContainer/RegistrySettingsContainer.tsx +59 -0
  142. package/src/containers/RegistrySettingsContainer/index.ts +5 -0
  143. package/src/containers/index.ts +5 -1
  144. package/src/hooks/index.ts +7 -0
  145. package/src/hooks/use-auto-tags.ts +51 -0
  146. package/src/hooks/use-registry-plugins.ts +29 -0
  147. package/src/hooks/use-update-available.ts +31 -0
  148. package/src/index.ts +1 -1
  149. package/src/meta.ts +10 -1
  150. package/src/operations/index.ts +7 -0
  151. package/src/operations/open-plugin-registry.ts +21 -0
  152. package/src/plugin.ts +11 -0
  153. package/src/translations.ts +52 -15
  154. package/src/types.ts +33 -1
  155. package/dist/lib/browser/PluginArticle-74DKRXJH.mjs +0 -29
  156. package/dist/lib/browser/PluginArticle-74DKRXJH.mjs.map +0 -7
  157. package/dist/lib/browser/PluginRegistry-DORQQ7GM.mjs +0 -78
  158. package/dist/lib/browser/PluginRegistry-DORQQ7GM.mjs.map +0 -7
  159. package/dist/lib/browser/app-graph-builder-AHS5BI4Y.mjs +0 -167
  160. package/dist/lib/browser/app-graph-builder-AHS5BI4Y.mjs.map +0 -7
  161. package/dist/lib/browser/chunk-KMUDYITM.mjs.map +0 -7
  162. package/dist/lib/browser/chunk-QQUG6FNW.mjs +0 -191
  163. package/dist/lib/browser/chunk-QQUG6FNW.mjs.map +0 -7
  164. package/dist/lib/browser/cli/index.mjs.map +0 -7
  165. package/dist/lib/browser/index.mjs +0 -65
  166. package/dist/lib/browser/index.mjs.map +0 -7
  167. package/dist/lib/browser/meta.json +0 -1
  168. package/dist/lib/browser/operation-resolver-PK4B2BZQ.mjs +0 -25
  169. package/dist/lib/browser/operation-resolver-PK4B2BZQ.mjs.map +0 -7
  170. package/dist/lib/browser/react-surface-HPLHM3SK.mjs +0 -85
  171. package/dist/lib/browser/react-surface-HPLHM3SK.mjs.map +0 -7
  172. package/dist/lib/node-esm/PluginArticle-JPVC7NXQ.mjs +0 -30
  173. package/dist/lib/node-esm/PluginArticle-JPVC7NXQ.mjs.map +0 -7
  174. package/dist/lib/node-esm/PluginRegistry-3ZB4DFF7.mjs +0 -79
  175. package/dist/lib/node-esm/PluginRegistry-3ZB4DFF7.mjs.map +0 -7
  176. package/dist/lib/node-esm/app-graph-builder-DBDL5WWF.mjs +0 -168
  177. package/dist/lib/node-esm/app-graph-builder-DBDL5WWF.mjs.map +0 -7
  178. package/dist/lib/node-esm/chunk-ENSNUFQK.mjs +0 -23
  179. package/dist/lib/node-esm/chunk-ENSNUFQK.mjs.map +0 -7
  180. package/dist/lib/node-esm/chunk-II5WBDYI.mjs +0 -192
  181. package/dist/lib/node-esm/chunk-II5WBDYI.mjs.map +0 -7
  182. package/dist/lib/node-esm/cli/index.mjs +0 -223
  183. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  184. package/dist/lib/node-esm/index.mjs +0 -66
  185. package/dist/lib/node-esm/index.mjs.map +0 -7
  186. package/dist/lib/node-esm/meta.json +0 -1
  187. package/dist/lib/node-esm/operation-resolver-CCHN4NBP.mjs +0 -26
  188. package/dist/lib/node-esm/operation-resolver-CCHN4NBP.mjs.map +0 -7
  189. package/dist/lib/node-esm/react-surface-GM64KKI3.mjs +0 -86
  190. package/dist/lib/node-esm/react-surface-GM64KKI3.mjs.map +0 -7
  191. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  192. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  193. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  194. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  195. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  196. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  197. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  198. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  199. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  200. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  201. package/dist/types/src/cli/commands/disable.d.ts.map +0 -1
  202. package/dist/types/src/cli/commands/enable.d.ts.map +0 -1
  203. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  204. package/dist/types/src/cli/commands/list.d.ts +0 -7
  205. package/dist/types/src/cli/commands/list.d.ts.map +0 -1
  206. package/dist/types/src/cli/commands/util.d.ts.map +0 -1
  207. package/dist/types/src/cli/index.d.ts +0 -3
  208. package/dist/types/src/cli/index.d.ts.map +0 -1
  209. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  210. package/dist/types/src/cli/storage.d.ts.map +0 -1
  211. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +0 -8
  212. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +0 -1
  213. package/dist/types/src/containers/PluginRegistry/index.d.ts +0 -3
  214. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +0 -1
  215. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -137
  216. package/src/capabilities/app-graph-builder/index.ts +0 -7
  217. package/src/capabilities/operation-resolver/index.ts +0 -7
  218. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -24
  219. package/src/capabilities/react-surface/index.ts +0 -7
  220. package/src/capabilities/react-surface/react-surface.tsx +0 -88
  221. package/src/cli/index.ts +0 -6
  222. package/src/containers/PluginRegistry/PluginRegistry.tsx +0 -86
  223. package/src/containers/PluginRegistry/index.ts +0 -7
  224. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  225. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  226. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  227. /package/dist/types/src/{cli/commands → commands}/util.d.ts +0 -0
  228. /package/dist/types/src/{cli/storage.d.ts → storage.d.ts} +0 -0
  229. /package/src/{cli/commands → commands}/disable.ts +0 -0
  230. /package/src/{cli/commands → commands}/enable.ts +0 -0
  231. /package/src/{cli/commands → commands}/index.ts +0 -0
  232. /package/src/{cli/commands → commands}/list.ts +0 -0
  233. /package/src/{cli/commands → commands}/util.ts +0 -0
  234. /package/src/{cli/storage.ts → storage.ts} +0 -0
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export * from './use-auto-tags';
6
+ export * from './use-registry-plugins';
7
+ 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,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
@@ -3,11 +3,18 @@
3
3
  //
4
4
 
5
5
  import { type Plugin } from '@dxos/app-framework';
6
+ import { pinnedWorkspaceId } from '@dxos/app-toolkit';
6
7
  import { trim } from '@dxos/util';
7
8
 
8
- export const REGISTRY_ID = '!dxos:plugin-registry';
9
+ export const REGISTRY_ID = pinnedWorkspaceId('dxos:plugin-registry');
9
10
  export const REGISTRY_KEY = 'plugin-registry';
10
11
 
12
+ // TODO(wittjosiah): Should this be a special separator or use the standard path separator?
13
+ const CATEGORY_SEPARATOR = '>';
14
+
15
+ /** Build a registry category node ID. */
16
+ export const registryCategoryId = (category: string): string => `${REGISTRY_KEY}${CATEGORY_SEPARATOR}${category}`;
17
+
11
18
  /** Qualified graph path to a specific plugin node. */
12
19
  export const getPluginPath = (pluginId: string): string => `root/${REGISTRY_ID}/${pluginId}`;
13
20
 
@@ -18,4 +25,6 @@ export const meta: Plugin.Meta = {
18
25
  Plugin management system for discovering, installing, and configuring workspace extensions.
19
26
  Browse available plugins and customize your workspace capabilities.
20
27
  `,
28
+ icon: 'ph--squares-four--regular',
29
+ tags: ['system'],
21
30
  };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export const RegistryOperationHandlerSet = OperationHandlerSet.lazy(() => import('./open-plugin-registry'));
@@ -0,0 +1,21 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation, SettingsOperation, getSpacePath } from '@dxos/app-toolkit';
8
+ import { Operation } from '@dxos/compute';
9
+
10
+ import { REGISTRY_ID } from '#meta';
11
+
12
+ const handler: Operation.WithHandler<typeof SettingsOperation.OpenPluginRegistry> =
13
+ SettingsOperation.OpenPluginRegistry.pipe(
14
+ Operation.withHandler(
15
+ Effect.fnUntraced(function* () {
16
+ yield* Operation.invoke(LayoutOperation.SwitchWorkspace, { subject: getSpacePath(REGISTRY_ID) });
17
+ }),
18
+ ),
19
+ );
20
+
21
+ export default handler;
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';
@@ -4,26 +4,63 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'plugin name': 'Registry',
14
- 'details label': 'Details',
15
- 'home page label': 'Website',
16
- 'source label': 'Source',
17
- 'plugin registry label': 'Plugin Registry',
18
- 'all plugins label': 'All',
19
- 'installed plugins label': 'Enabled',
20
- 'recommended plugins label': 'Recommended',
21
- 'labs plugins label': 'Labs',
22
- 'community plugins label': 'Community',
23
- 'load by url label': 'Load by URL (soon)',
24
- 'coming soon label': 'Coming soon!',
25
- 'open plugin registry label': 'Open plugin registry',
26
- 'settings label': 'Settings',
13
+ 'plugin.name': 'Registry',
14
+ 'details.label': 'Details',
15
+ 'home-page.label': 'Website',
16
+ 'source.label': 'Source',
17
+ 'plugin-registry.label': 'Plugins',
18
+ 'plugin-settings.label': 'Plugin Settings',
19
+ 'official-plugins.label': 'Official',
20
+ 'installed-plugins.label': 'Enabled',
21
+ 'recommended-plugins.label': 'Recommended',
22
+ 'labs-plugins.label': 'Labs',
23
+ 'registry-plugins.label': 'Registry',
24
+ 'load-by-url.label': 'Load from URL',
25
+ 'load-by-url-dialog.title': 'Load Plugin from URL',
26
+ 'plugin-url.label': 'Plugin URL',
27
+ 'load-plugin.label': 'Load Plugin',
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.',
48
+ 'coming-soon.label': 'Coming soon!',
49
+ 'open-plugin-registry.label': 'Open plugin registry',
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',
27
64
  },
28
65
  },
29
66
  },
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,29 +0,0 @@
1
- import {
2
- PluginDetail
3
- } from "./chunk-QQUG6FNW.mjs";
4
- import "./chunk-KMUDYITM.mjs";
5
-
6
- // src/containers/PluginArticle/PluginArticle.tsx
7
- import React, { useCallback } from "react";
8
- import { usePluginManager } from "@dxos/app-framework/ui";
9
- import { runAndForwardErrors } from "@dxos/effect";
10
- var PluginArticle = ({ subject: plugin }) => {
11
- const manager = usePluginManager();
12
- const enabled = manager.getEnabled().includes(plugin.meta.id);
13
- const handleEnableChange = useCallback((enabled2) => enabled2 ? runAndForwardErrors(manager.enable(plugin.meta.id)) : runAndForwardErrors(manager.disable(plugin.meta.id)), [
14
- manager,
15
- plugin.meta.id
16
- ]);
17
- return /* @__PURE__ */ React.createElement(PluginDetail, {
18
- plugin,
19
- enabled,
20
- onEnabledChange: handleEnableChange
21
- });
22
- };
23
-
24
- // src/containers/PluginArticle/index.ts
25
- var PluginArticle_default = PluginArticle;
26
- export {
27
- PluginArticle_default as default
28
- };
29
- //# sourceMappingURL=PluginArticle-74DKRXJH.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/containers/PluginArticle/PluginArticle.tsx", "../../../src/containers/PluginArticle/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { usePluginManager } from '@dxos/app-framework/ui';\nimport { runAndForwardErrors } from '@dxos/effect';\n\nimport { PluginDetail } from '../../components';\n\n// TODO(burdon): Convert to ECHO type.\nexport type PluginArticleProps = { subject: Plugin.Plugin };\n\nexport const PluginArticle = ({ subject: plugin }: PluginArticleProps) => {\n const manager = usePluginManager();\n const enabled = manager.getEnabled().includes(plugin.meta.id);\n const handleEnableChange = useCallback(\n (enabled: boolean) =>\n enabled\n ? runAndForwardErrors(manager.enable(plugin.meta.id))\n : runAndForwardErrors(manager.disable(plugin.meta.id)),\n [manager, plugin.meta.id],\n );\n\n return <PluginDetail plugin={plugin} enabled={enabled} onEnabledChange={handleEnableChange} />;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { PluginArticle } from './PluginArticle';\n\nexport default PluginArticle;\n"],
5
- "mappings": ";;;;;;AAIA,OAAOA,SAASC,mBAAmB;AAGnC,SAASC,wBAAwB;AACjC,SAASC,2BAA2B;AAO7B,IAAMC,gBAAgB,CAAC,EAAEC,SAASC,OAAM,MAAsB;AACnE,QAAMC,UAAUC,iBAAAA;AAChB,QAAMC,UAAUF,QAAQG,WAAU,EAAGC,SAASL,OAAOM,KAAKC,EAAE;AAC5D,QAAMC,qBAAqBC,YACzB,CAACN,aACCA,WACIO,oBAAoBT,QAAQU,OAAOX,OAAOM,KAAKC,EAAE,CAAA,IACjDG,oBAAoBT,QAAQW,QAAQZ,OAAOM,KAAKC,EAAE,CAAA,GACxD;IAACN;IAASD,OAAOM,KAAKC;GAAG;AAG3B,SAAO,sBAAA,cAACM,cAAAA;IAAab;IAAgBG;IAAkBW,iBAAiBN;;AAC1E;;;ACrBA,IAAA,wBAAeO;",
6
- "names": ["React", "useCallback", "usePluginManager", "runAndForwardErrors", "PluginArticle", "subject", "plugin", "manager", "usePluginManager", "enabled", "getEnabled", "includes", "meta", "id", "handleEnableChange", "useCallback", "runAndForwardErrors", "enable", "disable", "PluginDetail", "onEnabledChange", "PluginArticle"]
7
- }
@@ -1,78 +0,0 @@
1
- import {
2
- PluginList
3
- } from "./chunk-QQUG6FNW.mjs";
4
- import {
5
- getPluginPath
6
- } from "./chunk-KMUDYITM.mjs";
7
-
8
- // src/containers/PluginRegistry/PluginRegistry.tsx
9
- import { useAtomValue } from "@effect-atom/atom-react";
10
- import * as Effect from "effect/Effect";
11
- import React, { useCallback, useMemo } from "react";
12
- import { useCapabilities, useOperationInvoker, usePluginManager } from "@dxos/app-framework/ui";
13
- import { AppCapabilities, LayoutOperation, SettingsOperation } from "@dxos/app-toolkit";
14
- import { runAndForwardErrors } from "@dxos/effect";
15
- import { ObservabilityOperation } from "@dxos/plugin-observability/types";
16
- import { ScrollArea } from "@dxos/react-ui";
17
- var sortByPluginMeta = ({ meta: { name: a = "" } }, { meta: { name: b = "" } }) => a.localeCompare(b);
18
- var PluginRegistry = ({ id, plugins: pluginsProp }) => {
19
- const manager = usePluginManager();
20
- const { invoke, invokePromise } = useOperationInvoker();
21
- const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [
22
- pluginsProp
23
- ]);
24
- const enabled = useAtomValue(manager.enabled);
25
- const allSettings = useCapabilities(AppCapabilities.Settings);
26
- const handleChange = useCallback((id2, enabled2) => Effect.gen(function* () {
27
- if (enabled2) {
28
- yield* manager.enable(id2);
29
- } else {
30
- yield* manager.disable(id2);
31
- }
32
- yield* invoke(ObservabilityOperation.SendEvent, {
33
- name: "plugins.toggle",
34
- properties: {
35
- plugin: id2,
36
- enabled: enabled2
37
- }
38
- });
39
- }).pipe(runAndForwardErrors), [
40
- invoke,
41
- manager
42
- ]);
43
- const handleClick = useCallback((pluginId) => invokePromise(LayoutOperation.Open, {
44
- subject: [
45
- getPluginPath(pluginId)
46
- ],
47
- pivotId: id,
48
- positioning: "end"
49
- }), [
50
- invokePromise,
51
- id
52
- ]);
53
- const hasSettings = useCallback((pluginId) => allSettings.some((s) => s.prefix === pluginId), [
54
- allSettings
55
- ]);
56
- const handleSettings = useCallback((pluginId) => invokePromise(SettingsOperation.Open, {
57
- plugin: pluginId
58
- }), [
59
- invokePromise
60
- ]);
61
- return /* @__PURE__ */ React.createElement(ScrollArea.Root, {
62
- orientation: "vertical"
63
- }, /* @__PURE__ */ React.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React.createElement(PluginList, {
64
- plugins,
65
- enabled,
66
- onClick: handleClick,
67
- onChange: handleChange,
68
- hasSettings,
69
- onSettings: handleSettings
70
- })));
71
- };
72
-
73
- // src/containers/PluginRegistry/index.ts
74
- var PluginRegistry_default = PluginRegistry;
75
- export {
76
- PluginRegistry_default as default
77
- };
78
- //# sourceMappingURL=PluginRegistry-DORQQ7GM.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/containers/PluginRegistry/PluginRegistry.tsx", "../../../src/containers/PluginRegistry/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { useCapabilities, useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';\nimport { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';\nimport { runAndForwardErrors } from '@dxos/effect';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/types';\nimport { ScrollArea } from '@dxos/react-ui';\n\nimport { PluginList } from '../../components';\nimport { getPluginPath } from '../../meta';\n\nconst sortByPluginMeta = ({ meta: { name: a = '' } }: Plugin.Plugin, { meta: { name: b = '' } }: Plugin.Plugin) =>\n a.localeCompare(b);\n\nexport type PluginRegistryProps = {\n id: string;\n plugins: Plugin.Plugin[];\n};\n\nexport const PluginRegistry = ({ id, plugins: pluginsProp }: PluginRegistryProps) => {\n const manager = usePluginManager();\n const { invoke, invokePromise } = useOperationInvoker();\n const plugins = useMemo(() => pluginsProp.sort(sortByPluginMeta), [pluginsProp]);\n const enabled = useAtomValue(manager.enabled);\n const allSettings = useCapabilities(AppCapabilities.Settings);\n\n // TODO(wittjosiah): Factor out to an intent?\n const handleChange = useCallback(\n (id: string, enabled: boolean) =>\n Effect.gen(function* () {\n if (enabled) {\n yield* manager.enable(id);\n } else {\n yield* manager.disable(id);\n }\n\n yield* invoke(ObservabilityOperation.SendEvent, {\n name: 'plugins.toggle',\n properties: {\n plugin: id,\n enabled,\n },\n });\n }).pipe(runAndForwardErrors),\n [invoke, manager],\n );\n\n const handleClick = useCallback(\n (pluginId: string) =>\n invokePromise(LayoutOperation.Open, {\n subject: [getPluginPath(pluginId)],\n pivotId: id,\n positioning: 'end',\n }),\n [invokePromise, id],\n );\n\n const hasSettings = useCallback((pluginId: string) => allSettings.some((s) => s.prefix === pluginId), [allSettings]);\n\n const handleSettings = useCallback(\n (pluginId: string) => invokePromise(SettingsOperation.Open, { plugin: pluginId }),\n [invokePromise],\n );\n\n return (\n <ScrollArea.Root orientation='vertical'>\n <ScrollArea.Viewport>\n <PluginList\n plugins={plugins}\n enabled={enabled}\n onClick={handleClick}\n onChange={handleChange}\n hasSettings={hasSettings}\n onSettings={handleSettings}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PluginRegistry } from './PluginRegistry';\n\nexport default PluginRegistry;\n"],
5
- "mappings": ";;;;;;;;AAIA,SAASA,oBAAoB;AAC7B,YAAYC,YAAY;AACxB,OAAOC,SAASC,aAAaC,eAAe;AAG5C,SAASC,iBAAiBC,qBAAqBC,wBAAwB;AACvE,SAASC,iBAAiBC,iBAAiBC,yBAAyB;AACpE,SAASC,2BAA2B;AACpC,SAASC,8BAA8B;AACvC,SAASC,kBAAkB;AAK3B,IAAMC,mBAAmB,CAAC,EAAEC,MAAM,EAAEC,MAAMC,IAAI,GAAE,EAAE,GAAmB,EAAEF,MAAM,EAAEC,MAAME,IAAI,GAAE,EAAE,MAC3FD,EAAEE,cAAcD,CAAAA;AAOX,IAAME,iBAAiB,CAAC,EAAEC,IAAIC,SAASC,YAAW,MAAuB;AAC9E,QAAMC,UAAUC,iBAAAA;AAChB,QAAM,EAAEC,QAAQC,cAAa,IAAKC,oBAAAA;AAClC,QAAMN,UAAUO,QAAQ,MAAMN,YAAYO,KAAKhB,gBAAAA,GAAmB;IAACS;GAAY;AAC/E,QAAMQ,UAAUC,aAAaR,QAAQO,OAAO;AAC5C,QAAME,cAAcC,gBAAgBC,gBAAgBC,QAAQ;AAG5D,QAAMC,eAAeC,YACnB,CAACjB,KAAYU,aACJQ,WAAI,aAAA;AACT,QAAIR,UAAS;AACX,aAAOP,QAAQgB,OAAOnB,GAAAA;IACxB,OAAO;AACL,aAAOG,QAAQiB,QAAQpB,GAAAA;IACzB;AAEA,WAAOK,OAAOgB,uBAAuBC,WAAW;MAC9C3B,MAAM;MACN4B,YAAY;QACVC,QAAQxB;QACRU,SAAAA;MACF;IACF,CAAA;EACF,CAAA,EAAGe,KAAKC,mBAAAA,GACV;IAACrB;IAAQF;GAAQ;AAGnB,QAAMwB,cAAcV,YAClB,CAACW,aACCtB,cAAcuB,gBAAgBC,MAAM;IAClCC,SAAS;MAACC,cAAcJ,QAAAA;;IACxBK,SAASjC;IACTkC,aAAa;EACf,CAAA,GACF;IAAC5B;IAAeN;GAAG;AAGrB,QAAMmC,cAAclB,YAAY,CAACW,aAAqBhB,YAAYwB,KAAK,CAACC,MAAMA,EAAEC,WAAWV,QAAAA,GAAW;IAAChB;GAAY;AAEnH,QAAM2B,iBAAiBtB,YACrB,CAACW,aAAqBtB,cAAckC,kBAAkBV,MAAM;IAAEN,QAAQI;EAAS,CAAA,GAC/E;IAACtB;GAAc;AAGjB,SACE,sBAAA,cAACmC,WAAWC,MAAI;IAACC,aAAY;KAC3B,sBAAA,cAACF,WAAWG,UAAQ,MAClB,sBAAA,cAACC,YAAAA;IACC5C;IACAS;IACAoC,SAASnB;IACToB,UAAU/B;IACVmB;IACAa,YAAYT;;AAKtB;;;AC/EA,IAAA,yBAAeU;",
6
- "names": ["useAtomValue", "Effect", "React", "useCallback", "useMemo", "useCapabilities", "useOperationInvoker", "usePluginManager", "AppCapabilities", "LayoutOperation", "SettingsOperation", "runAndForwardErrors", "ObservabilityOperation", "ScrollArea", "sortByPluginMeta", "meta", "name", "a", "b", "localeCompare", "PluginRegistry", "id", "plugins", "pluginsProp", "manager", "usePluginManager", "invoke", "invokePromise", "useOperationInvoker", "useMemo", "sort", "enabled", "useAtomValue", "allSettings", "useCapabilities", "AppCapabilities", "Settings", "handleChange", "useCallback", "gen", "enable", "disable", "ObservabilityOperation", "SendEvent", "properties", "plugin", "pipe", "runAndForwardErrors", "handleClick", "pluginId", "LayoutOperation", "Open", "subject", "getPluginPath", "pivotId", "positioning", "hasSettings", "some", "s", "prefix", "handleSettings", "SettingsOperation", "ScrollArea", "Root", "orientation", "Viewport", "PluginList", "onClick", "onChange", "onSettings", "PluginRegistry"]
7
- }
@@ -1,167 +0,0 @@
1
- import {
2
- REGISTRY_ID,
3
- REGISTRY_KEY,
4
- meta
5
- } from "./chunk-KMUDYITM.mjs";
6
-
7
- // src/capabilities/app-graph-builder/app-graph-builder.ts
8
- import * as Effect from "effect/Effect";
9
- import { Capabilities, Capability } from "@dxos/app-framework";
10
- import { AppCapabilities, SettingsOperation } from "@dxos/app-toolkit";
11
- import { Operation } from "@dxos/operation";
12
- import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
13
- var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
14
- const capabilities = yield* Capability.Service;
15
- const extensions = yield* Effect.all([
16
- GraphBuilder.createExtension({
17
- id: meta.id,
18
- match: NodeMatcher.whenRoot,
19
- actions: () => Effect.succeed([
20
- {
21
- id: meta.id,
22
- data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
23
- properties: {
24
- label: [
25
- "open plugin registry label",
26
- {
27
- ns: meta.id
28
- }
29
- ],
30
- icon: "ph--squares-four--regular",
31
- disposition: "menu"
32
- }
33
- }
34
- ])
35
- }),
36
- GraphBuilder.createExtension({
37
- id: meta.id,
38
- match: NodeMatcher.whenRoot,
39
- connector: () => Effect.succeed([
40
- {
41
- id: REGISTRY_ID,
42
- type: meta.id,
43
- properties: {
44
- label: [
45
- "plugin registry label",
46
- {
47
- ns: meta.id
48
- }
49
- ],
50
- icon: "ph--squares-four--regular",
51
- disposition: "pin-end",
52
- testId: "treeView.pluginRegistry"
53
- },
54
- nodes: [
55
- {
56
- id: `${REGISTRY_KEY}>all`,
57
- type: "category",
58
- data: `${REGISTRY_KEY}>all`,
59
- properties: {
60
- label: [
61
- "all plugins label",
62
- {
63
- ns: meta.id
64
- }
65
- ],
66
- icon: "ph--squares-four--regular",
67
- key: REGISTRY_KEY,
68
- testId: "pluginRegistry.all"
69
- }
70
- },
71
- {
72
- id: `${REGISTRY_KEY}>installed`,
73
- type: "category",
74
- data: `${REGISTRY_KEY}>installed`,
75
- properties: {
76
- label: [
77
- "installed plugins label",
78
- {
79
- ns: meta.id
80
- }
81
- ],
82
- icon: "ph--check--regular",
83
- key: REGISTRY_KEY,
84
- testId: "pluginRegistry.installed"
85
- }
86
- },
87
- {
88
- id: `${REGISTRY_KEY}>recommended`,
89
- type: "category",
90
- data: `${REGISTRY_KEY}>recommended`,
91
- properties: {
92
- label: [
93
- "recommended plugins label",
94
- {
95
- ns: meta.id
96
- }
97
- ],
98
- icon: "ph--star--regular",
99
- key: REGISTRY_KEY,
100
- testId: "pluginRegistry.recommended"
101
- }
102
- },
103
- {
104
- id: `${REGISTRY_KEY}>labs`,
105
- type: "category",
106
- data: `${REGISTRY_KEY}>labs`,
107
- properties: {
108
- label: [
109
- "labs plugins label",
110
- {
111
- ns: meta.id
112
- }
113
- ],
114
- icon: "ph--flask--regular",
115
- key: REGISTRY_KEY,
116
- testId: "pluginRegistry.labs"
117
- }
118
- }
119
- ]
120
- }
121
- ])
122
- }),
123
- GraphBuilder.createExtension({
124
- id: `${meta.id}.actions`,
125
- match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
126
- actions: () => Effect.succeed([
127
- {
128
- id: `${meta.id}.load-by-url`,
129
- data: Effect.fnUntraced(function* () {
130
- }),
131
- properties: {
132
- label: [
133
- "load by url label",
134
- {
135
- ns: meta.id
136
- }
137
- ],
138
- icon: "ph--cloud-arrow-down--regular",
139
- disabled: true
140
- }
141
- }
142
- ])
143
- }),
144
- GraphBuilder.createExtension({
145
- id: `${meta.id}.plugins`,
146
- match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
147
- connector: () => {
148
- const manager = capabilities.get(Capabilities.PluginManager);
149
- return Effect.succeed(manager.getPlugins().map((plugin) => ({
150
- id: plugin.meta.id,
151
- type: "org.dxos.plugin",
152
- data: plugin,
153
- properties: {
154
- label: plugin.meta.name ?? plugin.meta.id,
155
- icon: plugin.meta.icon ?? "ph--circle--regular",
156
- disposition: "hidden"
157
- }
158
- })));
159
- }
160
- })
161
- ]);
162
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
163
- }));
164
- export {
165
- app_graph_builder_default as default
166
- };
167
- //# sourceMappingURL=app-graph-builder-AHS5BI4Y.mjs.map