@dxos/plugin-registry 0.8.4-main.406dc2a → 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 -50
  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 -3
  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 +13 -0
  88. package/dist/types/src/types.d.ts.map +1 -1
  89. package/dist/types/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +64 -36
  91. package/src/RegistryPlugin.tsx +16 -24
  92. package/src/capabilities/app-graph-builder.ts +172 -136
  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 -73
  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 -7
  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 +29 -0
  130. package/dist/lib/browser/app-graph-builder-5BKKIS5T.mjs +0 -162
  131. package/dist/lib/browser/app-graph-builder-5BKKIS5T.mjs.map +0 -7
  132. package/dist/lib/browser/chunk-MWZPWWWF.mjs +0 -14
  133. package/dist/lib/browser/chunk-MWZPWWWF.mjs.map +0 -7
  134. package/dist/lib/browser/intent-resolver-RUD6WFGT.mjs +0 -23
  135. package/dist/lib/browser/intent-resolver-RUD6WFGT.mjs.map +0 -7
  136. package/dist/lib/browser/react-surface-FYRVOQGA.mjs +0 -335
  137. package/dist/lib/browser/react-surface-FYRVOQGA.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 -14
  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 -33
  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 -37
  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 -110
  156. package/src/components/PluginDetail.stories.tsx +0 -45
  157. package/src/components/PluginDetail.tsx +0 -65
  158. package/src/components/PluginItem.tsx +0 -119
  159. package/src/components/PluginList.stories.tsx +0 -83
  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.406dc2a",
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
25
  "source": "./src/index.ts",
14
- "types": "./dist/types/src/index.d.ts",
15
- "browser": "./dist/lib/browser/index.mjs"
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"
16
35
  }
17
36
  },
18
37
  "types": "dist/types/src/index.d.ts",
19
- "typesVersions": {
20
- "*": {}
21
- },
22
38
  "files": [
23
39
  "dist",
24
40
  "src"
25
41
  ],
26
42
  "dependencies": {
27
- "@preact-signals/safe-react": "^0.9.0",
28
- "@dxos/app-framework": "0.8.4-main.406dc2a",
29
- "@dxos/echo": "0.8.4-main.406dc2a",
30
- "@dxos/live-object": "0.8.4-main.406dc2a",
31
- "@dxos/invariant": "0.8.4-main.406dc2a",
32
- "@dxos/plugin-graph": "0.8.4-main.406dc2a",
33
- "@dxos/react-ui-form": "0.8.4-main.406dc2a",
34
- "@dxos/react-ui-stack": "0.8.4-main.406dc2a",
35
- "@dxos/util": "0.8.4-main.406dc2a",
36
- "@dxos/plugin-observability": "0.8.4-main.406dc2a"
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.42.4",
40
- "@effect/platform": "0.92.1",
41
- "@phosphor-icons/react": "^2.1.10",
42
- "@types/react": "~19.2.2",
43
- "@types/react-dom": "~19.2.1",
44
- "effect": "3.18.3",
45
- "react": "~19.2.0",
46
- "react-dom": "~19.2.0",
47
- "vite": "7.1.9",
48
- "@dxos/random": "0.8.4-main.406dc2a",
49
- "@dxos/react-ui": "0.8.4-main.406dc2a",
50
- "@dxos/react-ui-theme": "0.8.4-main.406dc2a",
51
- "@dxos/storybook-utils": "0.8.4-main.406dc2a"
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": "^19.0.0",
58
- "react-dom": "^19.0.0",
59
- "@dxos/react-ui": "0.8.4-main.406dc2a",
60
- "@dxos/react-ui-theme": "0.8.4-main.406dc2a"
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,31 +2,23 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, Events, contributes, defineModule, definePlugin } 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 = definePlugin(meta, () => [
12
- defineModule({
13
- id: `${meta.id}/module/translations`,
14
- activatesOn: Events.SetupTranslations,
15
- activate: () => contributes(Capabilities.Translations, translations),
16
- }),
17
- defineModule({
18
- id: `${meta.id}/module/react-surface`,
19
- activatesOn: Events.SetupReactSurface,
20
- activate: ReactSurface,
21
- }),
22
- defineModule({
23
- id: `${meta.id}/module/intent-resolver`,
24
- activatesOn: Events.SetupIntentResolver,
25
- activate: IntentResolver,
26
- }),
27
- defineModule({
28
- id: `${meta.id}/module/app-graph-builder`,
29
- activatesOn: Events.SetupAppGraph,
30
- activate: AppGraphBuilder,
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,
31
22
  }),
32
- ]);
23
+ Plugin.make,
24
+ );
@@ -2,155 +2,191 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import * as Function from 'effect/Function';
7
- import * as Option from 'effect/Option';
5
+ import * as Effect from 'effect/Effect';
8
6
 
9
- import { Capabilities, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
10
- 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';
11
12
 
12
- import { REGISTRY_ID, REGISTRY_KEY, meta } from '../meta';
13
+ import { REGISTRY_ID, REGISTRY_KEY, registryCategoryId, meta } from '#meta';
14
+ import { RegistryCapabilities } from '#types';
13
15
 
14
- export default (context: PluginContext) =>
15
- contributes(Capabilities.AppGraphBuilder, [
16
- createExtension({
17
- id: meta.id,
18
- actions: (node) =>
19
- Rx.make((get) =>
20
- Function.pipe(
21
- get(node),
22
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
23
- Option.map((node) => [
24
- {
25
- id: meta.id,
26
- data: async () => {
27
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
28
- await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
29
- },
30
- properties: {
31
- label: ['open plugin registry label', { ns: meta.id }],
32
- icon: 'ph--squares-four--regular',
33
- disposition: 'menu',
34
- },
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',
35
48
  },
36
- ]),
37
- Option.getOrElse(() => []),
38
- ),
39
- ),
40
- }),
41
- createExtension({
42
- id: meta.id,
43
- connector: (node) =>
44
- Rx.make((get) =>
45
- Function.pipe(
46
- get(node),
47
- Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),
48
- Option.map((node) => [
49
- {
50
- id: REGISTRY_ID,
51
- type: meta.id,
52
- properties: {
53
- label: ['plugin registry label', { ns: meta.id }],
54
- icon: 'ph--squares-four--regular',
55
- disposition: 'pin-end',
56
- testId: 'treeView.pluginRegistry',
57
- },
58
- nodes: [
59
- {
60
- id: `${REGISTRY_KEY}+all`,
61
- type: 'category',
62
- data: `${REGISTRY_KEY}+all`,
63
- properties: {
64
- label: ['all plugins label', { ns: meta.id }],
65
- icon: 'ph--squares-four--regular',
66
- key: REGISTRY_KEY,
67
- testId: 'pluginRegistry.all',
68
- },
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',
69
87
  },
70
- {
71
- id: `${REGISTRY_KEY}+installed`,
72
- type: 'category',
73
- data: `${REGISTRY_KEY}+installed`,
74
- properties: {
75
- label: ['installed plugins label', { ns: meta.id }],
76
- icon: 'ph--check--regular',
77
- key: REGISTRY_KEY,
78
- testId: 'pluginRegistry.installed',
79
- },
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',
80
98
  },
81
- {
82
- id: `${REGISTRY_KEY}+recommended`,
83
- type: 'category',
84
- data: `${REGISTRY_KEY}+recommended`,
85
- properties: {
86
- label: ['recommended plugins label', { ns: meta.id }],
87
- icon: 'ph--star--regular',
88
- key: REGISTRY_KEY,
89
- testId: 'pluginRegistry.recommended',
90
- },
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',
91
109
  },
92
- {
93
- id: `${REGISTRY_KEY}+labs`,
94
- type: 'category',
95
- data: `${REGISTRY_KEY}+labs`,
96
- properties: {
97
- label: ['labs plugins label', { ns: meta.id }],
98
- icon: 'ph--flask--regular',
99
- key: REGISTRY_KEY,
100
- testId: 'pluginRegistry.labs',
101
- },
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',
102
120
  },
103
- ],
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',
104
143
  },
105
- ]),
106
- Option.getOrElse(() => []),
107
- ),
108
- ),
109
- }),
110
- createExtension({
111
- id: `${meta.id}/actions`,
112
- actions: (node) =>
113
- Rx.make((get) =>
114
- Function.pipe(
115
- get(node),
116
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
117
- Option.map(() => [
118
- {
119
- id: `${meta.id}/load-by-url`,
120
- data: async () => {},
121
- properties: {
122
- label: ['load by url label', { ns: meta.id }],
123
- icon: 'ph--cloud-arrow-down--regular',
124
- disabled: true,
125
- },
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',
126
164
  },
127
- ]),
128
- Option.getOrElse(() => []),
129
- ),
130
- ),
131
- }),
132
- createExtension({
133
- id: `${meta.id}/plugins`,
134
- connector: (node) =>
135
- Rx.make((get) =>
136
- Function.pipe(
137
- get(node),
138
- Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),
139
- Option.map(() => {
140
- const manager = context.getCapability(Capabilities.PluginManager);
141
- return manager.plugins.map((plugin) => ({
142
- id: plugin.meta.id.replaceAll('/', ':'),
143
- 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',
144
176
  data: plugin,
145
177
  properties: {
146
178
  label: plugin.meta.name ?? plugin.meta.id,
147
179
  icon: plugin.meta.icon ?? 'ph--circle--regular',
148
180
  disposition: 'hidden',
149
181
  },
150
- }));
151
- }),
152
- Option.getOrElse(() => []),
153
- ),
154
- ),
155
- }),
156
- ]);
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
+ );