@dxos/plugin-registry 0.8.4-main.f9ba587 → 0.8.4-main.fcc0d83b33

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