@dxos/plugin-registry 0.8.4-main.3f58842 → 0.8.4-main.422d1c7879

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 (161) hide show
  1. package/dist/lib/browser/cli/index.mjs +219 -0
  2. package/dist/lib/browser/cli/index.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +59 -52
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/node-esm/cli/index.mjs +221 -0
  7. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +80 -0
  9. package/dist/lib/node-esm/index.mjs.map +7 -0
  10. package/dist/lib/node-esm/meta.json +1 -0
  11. package/dist/types/src/RegistryPlugin.d.ts +2 -1
  12. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  13. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  14. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  15. package/dist/types/src/capabilities/index.d.ts +6 -3
  16. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  17. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  18. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  19. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  20. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/state.d.ts +7 -0
  22. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  23. package/dist/types/src/cli/commands/disable.d.ts +11 -0
  24. package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
  25. package/dist/types/src/cli/commands/enable.d.ts +11 -0
  26. package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
  27. package/dist/types/src/cli/commands/index.d.ts +3 -0
  28. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  29. package/dist/types/src/cli/commands/list.d.ts +7 -0
  30. package/dist/types/src/cli/commands/list.d.ts.map +1 -0
  31. package/dist/types/src/cli/commands/util.d.ts +11 -0
  32. package/dist/types/src/cli/commands/util.d.ts.map +1 -0
  33. package/dist/types/src/cli/index.d.ts +3 -0
  34. package/dist/types/src/cli/index.d.ts.map +1 -0
  35. package/dist/types/src/cli/plugin.d.ts +3 -0
  36. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  37. package/dist/types/src/cli/storage.d.ts +18 -0
  38. package/dist/types/src/cli/storage.d.ts.map +1 -0
  39. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +22 -0
  40. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
  41. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +42 -0
  42. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
  43. package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
  44. package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
  45. package/dist/types/src/components/PluginList/PluginItem.d.ts +26 -0
  46. package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
  47. package/dist/types/src/components/PluginList/PluginList.d.ts +13 -0
  48. package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
  49. package/dist/types/src/components/PluginList/PluginList.stories.d.ts +41 -0
  50. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
  51. package/dist/types/src/components/PluginList/index.d.ts +2 -0
  52. package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
  53. package/dist/types/src/components/index.d.ts +0 -1
  54. package/dist/types/src/components/index.d.ts.map +1 -1
  55. package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts +8 -0
  56. package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts.map +1 -0
  57. package/dist/types/src/containers/CommunityRegistry/index.d.ts +2 -0
  58. package/dist/types/src/containers/CommunityRegistry/index.d.ts.map +1 -0
  59. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts +4 -0
  60. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -0
  61. package/dist/types/src/containers/LoadPluginDialog/index.d.ts +2 -0
  62. package/dist/types/src/containers/LoadPluginDialog/index.d.ts.map +1 -0
  63. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
  64. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
  65. package/dist/types/src/containers/PluginArticle/index.d.ts +2 -0
  66. package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
  67. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +14 -0
  68. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
  69. package/dist/types/src/containers/PluginRegistry/index.d.ts +2 -0
  70. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
  71. package/dist/types/src/containers/index.d.ts +7 -0
  72. package/dist/types/src/containers/index.d.ts.map +1 -0
  73. package/dist/types/src/hooks/index.d.ts +3 -0
  74. package/dist/types/src/hooks/index.d.ts.map +1 -0
  75. package/dist/types/src/hooks/use-auto-tags.d.ts +20 -0
  76. package/dist/types/src/hooks/use-auto-tags.d.ts.map +1 -0
  77. package/dist/types/src/hooks/use-community-plugins.d.ts +16 -0
  78. package/dist/types/src/hooks/use-community-plugins.d.ts.map +1 -0
  79. package/dist/types/src/meta.d.ts +7 -4
  80. package/dist/types/src/meta.d.ts.map +1 -1
  81. package/dist/types/src/operations/index.d.ts +3 -0
  82. package/dist/types/src/operations/index.d.ts.map +1 -0
  83. package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
  84. package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
  85. package/dist/types/src/translations.d.ts +22 -15
  86. package/dist/types/src/translations.d.ts.map +1 -1
  87. package/dist/types/src/types.d.ts +14 -1
  88. package/dist/types/src/types.d.ts.map +1 -1
  89. package/dist/types/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +65 -37
  91. package/src/RegistryPlugin.tsx +17 -26
  92. package/src/capabilities/app-graph-builder.ts +172 -135
  93. package/src/capabilities/index.ts +9 -4
  94. package/src/capabilities/operation-handler.ts +16 -0
  95. package/src/capabilities/react-surface.tsx +108 -78
  96. package/src/capabilities/state.ts +40 -0
  97. package/src/cli/commands/disable.ts +47 -0
  98. package/src/cli/commands/enable.ts +44 -0
  99. package/src/cli/commands/index.ts +14 -0
  100. package/src/cli/commands/list.ts +41 -0
  101. package/src/cli/commands/util.ts +24 -0
  102. package/src/cli/index.ts +6 -0
  103. package/src/cli/plugin.ts +17 -0
  104. package/src/cli/storage.ts +50 -0
  105. package/src/components/PluginDetail/PluginDetail.stories.tsx +43 -0
  106. package/src/components/PluginDetail/PluginDetail.tsx +106 -0
  107. package/src/components/PluginDetail/index.ts +5 -0
  108. package/src/components/PluginList/PluginItem.tsx +187 -0
  109. package/src/components/PluginList/PluginList.stories.tsx +87 -0
  110. package/src/components/PluginList/PluginList.tsx +29 -0
  111. package/src/components/PluginList/index.ts +5 -0
  112. package/src/components/index.ts +0 -1
  113. package/src/containers/CommunityRegistry/CommunityRegistry.tsx +181 -0
  114. package/src/containers/CommunityRegistry/index.ts +5 -0
  115. package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +86 -0
  116. package/src/containers/LoadPluginDialog/index.ts +5 -0
  117. package/src/containers/PluginArticle/PluginArticle.tsx +72 -0
  118. package/src/containers/PluginArticle/index.ts +5 -0
  119. package/src/containers/PluginRegistry/PluginRegistry.tsx +98 -0
  120. package/src/containers/PluginRegistry/index.ts +5 -0
  121. package/src/containers/index.ts +11 -0
  122. package/src/hooks/index.ts +6 -0
  123. package/src/hooks/use-auto-tags.ts +52 -0
  124. package/src/hooks/use-community-plugins.ts +35 -0
  125. package/src/meta.ts +19 -9
  126. package/src/operations/index.ts +7 -0
  127. package/src/operations/open-plugin-registry.ts +21 -0
  128. package/src/translations.ts +22 -15
  129. package/src/types.ts +30 -1
  130. package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs +0 -161
  131. package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs.map +0 -7
  132. package/dist/lib/browser/chunk-AEBASNOI.mjs +0 -16
  133. package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
  134. package/dist/lib/browser/intent-resolver-W67CIJI3.mjs +0 -23
  135. package/dist/lib/browser/intent-resolver-W67CIJI3.mjs.map +0 -7
  136. package/dist/lib/browser/react-surface-3GNB7AOY.mjs +0 -333
  137. package/dist/lib/browser/react-surface-3GNB7AOY.mjs.map +0 -7
  138. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  139. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  140. package/dist/types/src/components/Icon.stories.d.ts +0 -6
  141. package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
  142. package/dist/types/src/components/PluginDetail.d.ts +0 -9
  143. package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
  144. package/dist/types/src/components/PluginDetail.stories.d.ts +0 -8
  145. package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
  146. package/dist/types/src/components/PluginItem.d.ts +0 -13
  147. package/dist/types/src/components/PluginItem.d.ts.map +0 -1
  148. package/dist/types/src/components/PluginList.d.ts +0 -8
  149. package/dist/types/src/components/PluginList.d.ts.map +0 -1
  150. package/dist/types/src/components/PluginList.stories.d.ts +0 -11
  151. package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
  152. package/dist/types/src/components/RegistryContainer.d.ts +0 -7
  153. package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
  154. package/src/capabilities/intent-resolver.ts +0 -27
  155. package/src/components/Icon.stories.tsx +0 -108
  156. package/src/components/PluginDetail.stories.tsx +0 -45
  157. package/src/components/PluginDetail.tsx +0 -63
  158. package/src/components/PluginItem.tsx +0 -119
  159. package/src/components/PluginList.stories.tsx +0 -82
  160. package/src/components/PluginList.tsx +0 -26
  161. package/src/components/RegistryContainer.tsx +0 -84
package/package.json CHANGED
@@ -1,63 +1,91 @@
1
1
  {
2
2
  "name": "@dxos/plugin-registry",
3
- "version": "0.8.4-main.3f58842",
3
+ "version": "0.8.4-main.422d1c7879",
4
4
  "description": "Braneframe plugin gallery",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": "./src/capabilities/index.ts",
17
+ "#components": "./src/components/index.ts",
18
+ "#containers": "./src/containers/index.ts",
19
+ "#meta": "./src/meta.ts",
20
+ "#operations": "./src/operations/index.ts",
21
+ "#types": "./src/types.ts"
22
+ },
11
23
  "exports": {
12
24
  ".": {
13
- "types": "./dist/types/src/index.d.ts",
14
- "browser": "./dist/lib/browser/index.mjs"
25
+ "source": "./src/index.ts",
26
+ "browser": "./dist/lib/browser/index.mjs",
27
+ "node": "./dist/lib/node-esm/index.mjs",
28
+ "types": "./dist/types/src/index.d.ts"
29
+ },
30
+ "./cli": {
31
+ "source": "./src/cli/index.ts",
32
+ "browser": "./dist/lib/browser/cli/index.mjs",
33
+ "node": "./dist/lib/node-esm/cli/index.mjs",
34
+ "types": "./dist/types/src/cli/index.d.ts"
15
35
  }
16
36
  },
17
37
  "types": "dist/types/src/index.d.ts",
18
- "typesVersions": {
19
- "*": {}
20
- },
21
38
  "files": [
22
39
  "dist",
23
40
  "src"
24
41
  ],
25
42
  "dependencies": {
26
- "@preact-signals/safe-react": "^0.9.0",
27
- "@dxos/app-framework": "0.8.4-main.3f58842",
28
- "@dxos/echo": "0.8.4-main.3f58842",
29
- "@dxos/echo-schema": "0.8.4-main.3f58842",
30
- "@dxos/invariant": "0.8.4-main.3f58842",
31
- "@dxos/plugin-graph": "0.8.4-main.3f58842",
32
- "@dxos/live-object": "0.8.4-main.3f58842",
33
- "@dxos/plugin-observability": "0.8.4-main.3f58842",
34
- "@dxos/react-ui-form": "0.8.4-main.3f58842",
35
- "@dxos/react-ui-stack": "0.8.4-main.3f58842",
36
- "@dxos/util": "0.8.4-main.3f58842"
43
+ "@effect-atom/atom-react": "^0.5.0",
44
+ "@effect/cli": "0.73.2",
45
+ "yaml": "^2.8.2",
46
+ "@dxos/app-framework": "0.8.4-main.422d1c7879",
47
+ "@dxos/cli-util": "0.8.4-main.422d1c7879",
48
+ "@dxos/app-toolkit": "0.8.4-main.422d1c7879",
49
+ "@dxos/context": "0.8.4-main.422d1c7879",
50
+ "@dxos/echo": "0.8.4-main.422d1c7879",
51
+ "@dxos/client-protocol": "0.8.4-main.422d1c7879",
52
+ "@dxos/effect": "0.8.4-main.422d1c7879",
53
+ "@dxos/edge-client": "0.8.4-main.422d1c7879",
54
+ "@dxos/operation": "0.8.4-main.422d1c7879",
55
+ "@dxos/invariant": "0.8.4-main.422d1c7879",
56
+ "@dxos/plugin-graph": "0.8.4-main.422d1c7879",
57
+ "@dxos/log": "0.8.4-main.422d1c7879",
58
+ "@dxos/protocols": "0.8.4-main.422d1c7879",
59
+ "@dxos/plugin-observability": "0.8.4-main.422d1c7879",
60
+ "@dxos/react-edge-client": "0.8.4-main.422d1c7879",
61
+ "@dxos/react-ui-form": "0.8.4-main.422d1c7879",
62
+ "@dxos/plugin-client": "0.8.4-main.422d1c7879",
63
+ "@dxos/react-ui-mosaic": "0.8.4-main.422d1c7879",
64
+ "@dxos/react-ui-stack": "0.8.4-main.422d1c7879",
65
+ "@dxos/util": "0.8.4-main.422d1c7879"
37
66
  },
38
67
  "devDependencies": {
39
- "@effect-rx/rx-react": "0.38.0",
40
- "@effect/platform": "0.89.0",
41
- "@phosphor-icons/react": "^2.1.5",
42
- "@types/react": "~18.2.0",
43
- "@types/react-dom": "~18.2.0",
44
- "effect": "3.17.0",
45
- "react": "~18.2.0",
46
- "react-dom": "~18.2.0",
47
- "vite": "5.4.7",
48
- "@dxos/random": "0.8.4-main.3f58842",
49
- "@dxos/react-ui-theme": "0.8.4-main.3f58842",
50
- "@dxos/react-ui": "0.8.4-main.3f58842",
51
- "@dxos/storybook-utils": "0.8.4-main.3f58842"
68
+ "@effect-atom/atom-react": "^0.5.0",
69
+ "@effect/platform": "0.94.4",
70
+ "@types/react": "~19.2.7",
71
+ "@types/react-dom": "~19.2.3",
72
+ "effect": "3.20.0",
73
+ "react": "~19.2.3",
74
+ "react-dom": "~19.2.3",
75
+ "vite": "^7.1.11",
76
+ "@dxos/random": "0.8.4-main.422d1c7879",
77
+ "@dxos/react-ui": "0.8.4-main.422d1c7879",
78
+ "@dxos/storybook-utils": "0.8.4-main.422d1c7879",
79
+ "@dxos/ui-theme": "0.8.4-main.422d1c7879"
52
80
  },
53
81
  "peerDependencies": {
54
- "@effect-rx/rx-react": "^0.34.1",
55
- "@effect/platform": "^0.80.12",
56
- "effect": "^3.13.3",
57
- "react": "~18.2.0",
58
- "react-dom": "~18.2.0",
59
- "@dxos/react-ui-theme": "0.8.4-main.3f58842",
60
- "@dxos/react-ui": "0.8.4-main.3f58842"
82
+ "@effect-atom/atom-react": "^0.5.0",
83
+ "@effect/platform": "0.94.4",
84
+ "effect": "3.20.0",
85
+ "react": "~19.2.3",
86
+ "react-dom": "~19.2.3",
87
+ "@dxos/react-ui": "0.8.4-main.422d1c7879",
88
+ "@dxos/ui-theme": "0.8.4-main.422d1c7879"
61
89
  },
62
90
  "publishConfig": {
63
91
  "access": "public"
@@ -2,32 +2,23 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, defineModule, definePlugin, Events } from '@dxos/app-framework';
5
+ import { Plugin } from '@dxos/app-framework';
6
+ import { AppPlugin } from '@dxos/app-toolkit';
7
+ import { ClientEvents } from '@dxos/plugin-client/types';
8
+
9
+ import { AppGraphBuilder, OperationHandler, ReactSurface, RegistryState } from '#capabilities';
10
+ import { meta } from '#meta';
6
11
 
7
- import { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';
8
- import { meta } from './meta';
9
12
  import { translations } from './translations';
10
13
 
11
- export const RegistryPlugin = () =>
12
- definePlugin(meta, [
13
- defineModule({
14
- id: `${meta.id}/module/translations`,
15
- activatesOn: Events.SetupTranslations,
16
- activate: () => contributes(Capabilities.Translations, translations),
17
- }),
18
- defineModule({
19
- id: `${meta.id}/module/react-surface`,
20
- activatesOn: Events.SetupReactSurface,
21
- activate: ReactSurface,
22
- }),
23
- defineModule({
24
- id: `${meta.id}/module/intent-resolver`,
25
- activatesOn: Events.SetupIntentResolver,
26
- activate: IntentResolver,
27
- }),
28
- defineModule({
29
- id: `${meta.id}/module/app-graph-builder`,
30
- activatesOn: Events.SetupAppGraph,
31
- activate: AppGraphBuilder,
32
- }),
33
- ]);
14
+ export const RegistryPlugin = Plugin.define(meta).pipe(
15
+ AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
16
+ AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
17
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
18
+ AppPlugin.addTranslationsModule({ translations }),
19
+ Plugin.addModule({
20
+ activatesOn: ClientEvents.ClientReady,
21
+ activate: RegistryState,
22
+ }),
23
+ Plugin.make,
24
+ );
@@ -2,154 +2,191 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
5
+ import * as Effect from 'effect/Effect';
7
6
 
8
- import { Capabilities, contributes, createIntent, SettingsAction, type PluginContext } from '@dxos/app-framework';
9
- import { createExtension } from '@dxos/plugin-graph';
7
+ import { Capabilities, Capability, Plugin } from '@dxos/app-framework';
8
+ import { AppCapabilities, LayoutOperation, SettingsOperation } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/operation';
10
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
11
+ import { type PluginEntry } from '@dxos/protocols';
10
12
 
11
- import { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
13
+ import { REGISTRY_ID, REGISTRY_KEY, registryCategoryId, meta } from '#meta';
14
+ import { RegistryCapabilities } from '#types';
12
15
 
13
- export default (context: PluginContext) =>
14
- contributes(Capabilities.AppGraphBuilder, [
15
- createExtension({
16
- id: REGISTRY_PLUGIN,
17
- actions: (node) =>
18
- Rx.make((get) =>
19
- pipe(
20
- get(node),
21
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
22
- Option.map((node) => [
23
- {
24
- id: REGISTRY_PLUGIN,
25
- data: async () => {
26
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
27
- await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
28
- },
29
- properties: {
30
- label: ['open plugin registry label', { ns: REGISTRY_PLUGIN }],
31
- icon: 'ph--squares-four--regular',
32
- disposition: 'menu',
33
- },
16
+ import { LOAD_PLUGIN_DIALOG } from '../containers';
17
+
18
+ /**
19
+ * Turns a community manifest entry into a minimal {@link Plugin.Plugin} so it
20
+ * can be attached as the graph node's `data`. The synthesized plugin has no
21
+ * modules and only exists so the article surface can render details for
22
+ * community plugins that haven't been installed yet.
23
+ */
24
+ const toDisplayPlugin = (entry: PluginEntry): Plugin.Plugin =>
25
+ ({
26
+ [Plugin.PluginTypeId]: Plugin.PluginTypeId,
27
+ meta: entry.meta,
28
+ modules: [],
29
+ }) as Plugin.Plugin;
30
+
31
+ export default Capability.makeModule(
32
+ Effect.fnUntraced(function* () {
33
+ const capabilities = yield* Capability.Service;
34
+
35
+ const extensions = yield* Effect.all([
36
+ GraphBuilder.createExtension({
37
+ id: 'open-registry',
38
+ match: NodeMatcher.whenRoot,
39
+ actions: () =>
40
+ Effect.succeed([
41
+ {
42
+ id: 'open-registry',
43
+ data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
44
+ properties: {
45
+ label: ['open-plugin-registry.label', { ns: meta.id }],
46
+ icon: 'ph--squares-four--regular',
47
+ disposition: 'menu',
34
48
  },
35
- ]),
36
- Option.getOrElse(() => []),
37
- ),
38
- ),
39
- }),
40
- createExtension({
41
- id: REGISTRY_PLUGIN,
42
- connector: (node) =>
43
- Rx.make((get) =>
44
- pipe(
45
- get(node),
46
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
47
- Option.map((node) => [
48
- {
49
- id: REGISTRY_ID,
50
- type: REGISTRY_PLUGIN,
51
- properties: {
52
- label: ['plugin registry label', { ns: REGISTRY_PLUGIN }],
53
- icon: 'ph--squares-four--regular',
54
- disposition: 'pin-end',
55
- testId: 'treeView.pluginRegistry',
56
- },
57
- nodes: [
58
- {
59
- id: `${REGISTRY_KEY}+all`,
60
- type: 'category',
61
- data: `${REGISTRY_KEY}+all`,
62
- properties: {
63
- label: ['all plugins label', { ns: REGISTRY_PLUGIN }],
64
- icon: 'ph--squares-four--regular',
65
- key: REGISTRY_KEY,
66
- testId: 'pluginRegistry.all',
67
- },
49
+ },
50
+ ]),
51
+ }),
52
+ GraphBuilder.createExtension({
53
+ id: 'registry',
54
+ match: NodeMatcher.whenRoot,
55
+ connector: () =>
56
+ Effect.succeed([
57
+ Node.make({
58
+ id: REGISTRY_ID,
59
+ type: meta.id,
60
+ properties: {
61
+ label: ['plugin-registry.label', { ns: meta.id }],
62
+ icon: 'ph--squares-four--regular',
63
+ disposition: 'pin-end',
64
+ testId: 'treeView.pluginRegistry',
65
+ },
66
+ nodes: [
67
+ Node.make({
68
+ id: registryCategoryId('official'),
69
+ type: 'category',
70
+ data: registryCategoryId('official'),
71
+ properties: {
72
+ label: ['official-plugins.label', { ns: meta.id }],
73
+ icon: 'ph--squares-four--regular',
74
+ key: REGISTRY_KEY,
75
+ testId: 'pluginRegistry.official',
76
+ },
77
+ }),
78
+ Node.make({
79
+ id: registryCategoryId('installed'),
80
+ type: 'category',
81
+ data: registryCategoryId('installed'),
82
+ properties: {
83
+ label: ['installed-plugins.label', { ns: meta.id }],
84
+ icon: 'ph--check--regular',
85
+ key: REGISTRY_KEY,
86
+ testId: 'pluginRegistry.installed',
68
87
  },
69
- {
70
- id: `${REGISTRY_KEY}+installed`,
71
- type: 'category',
72
- data: `${REGISTRY_KEY}+installed`,
73
- properties: {
74
- label: ['installed plugins label', { ns: REGISTRY_PLUGIN }],
75
- icon: 'ph--check--regular',
76
- key: REGISTRY_KEY,
77
- testId: 'pluginRegistry.installed',
78
- },
88
+ }),
89
+ Node.make({
90
+ id: registryCategoryId('recommended'),
91
+ type: 'category',
92
+ data: registryCategoryId('recommended'),
93
+ properties: {
94
+ label: ['recommended-plugins.label', { ns: meta.id }],
95
+ icon: 'ph--star--regular',
96
+ key: REGISTRY_KEY,
97
+ testId: 'pluginRegistry.recommended',
79
98
  },
80
- {
81
- id: `${REGISTRY_KEY}+recommended`,
82
- type: 'category',
83
- data: `${REGISTRY_KEY}+recommended`,
84
- properties: {
85
- label: ['recommended plugins label', { ns: REGISTRY_PLUGIN }],
86
- icon: 'ph--star--regular',
87
- key: REGISTRY_KEY,
88
- testId: 'pluginRegistry.recommended',
89
- },
99
+ }),
100
+ Node.make({
101
+ id: registryCategoryId('labs'),
102
+ type: 'category',
103
+ data: registryCategoryId('labs'),
104
+ properties: {
105
+ label: ['labs-plugins.label', { ns: meta.id }],
106
+ icon: 'ph--flask--regular',
107
+ key: REGISTRY_KEY,
108
+ testId: 'pluginRegistry.labs',
90
109
  },
91
- {
92
- id: `${REGISTRY_KEY}+labs`,
93
- type: 'category',
94
- data: `${REGISTRY_KEY}+labs`,
95
- properties: {
96
- label: ['labs plugins label', { ns: REGISTRY_PLUGIN }],
97
- icon: 'ph--flask--regular',
98
- key: REGISTRY_KEY,
99
- testId: 'pluginRegistry.labs',
100
- },
110
+ }),
111
+ Node.make({
112
+ id: registryCategoryId('community'),
113
+ type: 'category',
114
+ data: registryCategoryId('community'),
115
+ properties: {
116
+ label: ['community-plugins.label', { ns: meta.id }],
117
+ icon: 'ph--users-three--regular',
118
+ key: REGISTRY_KEY,
119
+ testId: 'pluginRegistry.community',
101
120
  },
102
- ],
121
+ }),
122
+ ],
123
+ }),
124
+ ]),
125
+ }),
126
+ GraphBuilder.createExtension({
127
+ id: 'actions',
128
+ match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
129
+ actions: () =>
130
+ Effect.succeed([
131
+ {
132
+ id: 'load-by-url',
133
+ data: Effect.fnUntraced(function* () {
134
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
135
+ subject: LOAD_PLUGIN_DIALOG,
136
+ state: true,
137
+ });
138
+ }),
139
+ properties: {
140
+ label: ['load-by-url.label', { ns: meta.id }],
141
+ icon: 'ph--cloud-arrow-down--regular',
142
+ disposition: 'list-item-primary',
103
143
  },
104
- ]),
105
- Option.getOrElse(() => []),
106
- ),
107
- ),
108
- }),
109
- createExtension({
110
- id: `${REGISTRY_PLUGIN}/actions`,
111
- actions: (node) =>
112
- Rx.make((get) =>
113
- pipe(
114
- get(node),
115
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
116
- Option.map(() => [
117
- {
118
- id: `${REGISTRY_PLUGIN}/load-by-url`,
119
- data: async () => {},
120
- properties: {
121
- label: ['load by url label', { ns: REGISTRY_PLUGIN }],
122
- icon: 'ph--cloud-arrow-down--regular',
123
- disabled: true,
124
- },
144
+ },
145
+ ]),
146
+ }),
147
+ GraphBuilder.createExtension({
148
+ id: 'plugins',
149
+ match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
150
+ connector: (_node, get) => {
151
+ const manager = capabilities.get(Capabilities.PluginManager);
152
+ const installedIds = new Set(manager.getPlugins().map((plugin) => plugin.meta.id));
153
+ const stateAtom = capabilities.getAll(RegistryCapabilities.State).at(0);
154
+
155
+ const installedNodes = manager.getPlugins().map((plugin) =>
156
+ Node.make({
157
+ id: plugin.meta.id,
158
+ type: 'org.dxos.plugin',
159
+ data: plugin,
160
+ properties: {
161
+ label: plugin.meta.name ?? plugin.meta.id,
162
+ icon: plugin.meta.icon ?? 'ph--circle--regular',
163
+ disposition: 'hidden',
125
164
  },
126
- ]),
127
- Option.getOrElse(() => []),
128
- ),
129
- ),
130
- }),
131
- createExtension({
132
- id: `${REGISTRY_PLUGIN}/plugins`,
133
- connector: (node) =>
134
- Rx.make((get) =>
135
- pipe(
136
- get(node),
137
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
138
- Option.map(() => {
139
- const manager = context.getCapability(Capabilities.PluginManager);
140
- return manager.plugins.map((plugin) => ({
141
- id: plugin.meta.id.replaceAll('/', ':'),
142
- type: 'dxos.org/plugin',
165
+ }),
166
+ );
167
+
168
+ const communityEntries = stateAtom ? get(stateAtom).entries : [];
169
+ const communityNodes = communityEntries
170
+ .filter((entry) => !installedIds.has(entry.meta.id))
171
+ .map((entry) => {
172
+ const plugin = toDisplayPlugin(entry);
173
+ return Node.make({
174
+ id: plugin.meta.id,
175
+ type: 'org.dxos.plugin',
143
176
  data: plugin,
144
177
  properties: {
145
178
  label: plugin.meta.name ?? plugin.meta.id,
146
179
  icon: plugin.meta.icon ?? 'ph--circle--regular',
147
180
  disposition: 'hidden',
148
181
  },
149
- }));
150
- }),
151
- Option.getOrElse(() => []),
152
- ),
153
- ),
154
- }),
155
- ]);
182
+ });
183
+ });
184
+
185
+ return Effect.succeed([...installedNodes, ...communityNodes]);
186
+ },
187
+ }),
188
+ ]);
189
+
190
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
191
+ }),
192
+ );
@@ -2,8 +2,13 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
5
+ import { Capability } from '@dxos/app-framework';
6
+ import { OperationHandlerSet } from '@dxos/operation';
6
7
 
7
- export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
- export const IntentResolver = lazy(() => import('./intent-resolver'));
9
- export const ReactSurface = lazy(() => import('./react-surface'));
8
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
9
+ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
10
+ 'OperationHandler',
11
+ () => import('./operation-handler'),
12
+ );
13
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
14
+ export const RegistryState = Capability.lazy('RegistryState', () => import('./state'));
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import type { OperationHandlerSet } from '@dxos/operation';
9
+
10
+ import { RegistryOperationHandlerSet } from '#operations';
11
+
12
+ export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
13
+ Effect.fnUntraced(function* () {
14
+ return Capability.contributes(Capabilities.OperationHandler, RegistryOperationHandlerSet);
15
+ }),
16
+ );