@dxos/plugin-registry 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5

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 (158) 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 +52 -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 +73 -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 +5 -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/cli/commands/disable.d.ts +11 -0
  22. package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
  23. package/dist/types/src/cli/commands/enable.d.ts +11 -0
  24. package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
  25. package/dist/types/src/cli/commands/index.d.ts +3 -0
  26. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  27. package/dist/types/src/cli/commands/list.d.ts +7 -0
  28. package/dist/types/src/cli/commands/list.d.ts.map +1 -0
  29. package/dist/types/src/cli/commands/util.d.ts +11 -0
  30. package/dist/types/src/cli/commands/util.d.ts.map +1 -0
  31. package/dist/types/src/cli/index.d.ts +3 -0
  32. package/dist/types/src/cli/index.d.ts.map +1 -0
  33. package/dist/types/src/cli/plugin.d.ts +3 -0
  34. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  35. package/dist/types/src/cli/storage.d.ts +18 -0
  36. package/dist/types/src/cli/storage.d.ts.map +1 -0
  37. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +11 -0
  38. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
  39. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts +39 -0
  40. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
  41. package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
  42. package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
  43. package/dist/types/src/components/PluginList/PluginItem.d.ts +18 -0
  44. package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
  45. package/dist/types/src/components/PluginList/PluginList.d.ts +13 -0
  46. package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
  47. package/dist/types/src/components/PluginList/PluginList.stories.d.ts +38 -0
  48. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
  49. package/dist/types/src/components/PluginList/index.d.ts +2 -0
  50. package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
  51. package/dist/types/src/components/index.d.ts +0 -1
  52. package/dist/types/src/components/index.d.ts.map +1 -1
  53. package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts +8 -0
  54. package/dist/types/src/containers/CommunityRegistry/CommunityRegistry.d.ts.map +1 -0
  55. package/dist/types/src/containers/CommunityRegistry/index.d.ts +2 -0
  56. package/dist/types/src/containers/CommunityRegistry/index.d.ts.map +1 -0
  57. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts +4 -0
  58. package/dist/types/src/containers/LoadPluginDialog/LoadPluginDialog.d.ts.map +1 -0
  59. package/dist/types/src/containers/LoadPluginDialog/index.d.ts +2 -0
  60. package/dist/types/src/containers/LoadPluginDialog/index.d.ts.map +1 -0
  61. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
  62. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
  63. package/dist/types/src/containers/PluginArticle/index.d.ts +2 -0
  64. package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
  65. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +14 -0
  66. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
  67. package/dist/types/src/containers/PluginRegistry/index.d.ts +2 -0
  68. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
  69. package/dist/types/src/containers/index.d.ts +7 -0
  70. package/dist/types/src/containers/index.d.ts.map +1 -0
  71. package/dist/types/src/hooks/index.d.ts +3 -0
  72. package/dist/types/src/hooks/index.d.ts.map +1 -0
  73. package/dist/types/src/hooks/use-auto-tags.d.ts +20 -0
  74. package/dist/types/src/hooks/use-auto-tags.d.ts.map +1 -0
  75. package/dist/types/src/hooks/use-community-plugins.d.ts +15 -0
  76. package/dist/types/src/hooks/use-community-plugins.d.ts.map +1 -0
  77. package/dist/types/src/meta.d.ts +7 -4
  78. package/dist/types/src/meta.d.ts.map +1 -1
  79. package/dist/types/src/operations/index.d.ts +3 -0
  80. package/dist/types/src/operations/index.d.ts.map +1 -0
  81. package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
  82. package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
  83. package/dist/types/src/translations.d.ts +19 -15
  84. package/dist/types/src/translations.d.ts.map +1 -1
  85. package/dist/types/src/types.d.ts +3 -1
  86. package/dist/types/src/types.d.ts.map +1 -1
  87. package/dist/types/tsconfig.tsbuildinfo +1 -1
  88. package/package.json +63 -34
  89. package/src/RegistryPlugin.tsx +12 -26
  90. package/src/capabilities/app-graph-builder.ts +138 -136
  91. package/src/capabilities/index.ts +8 -4
  92. package/src/capabilities/operation-handler.ts +16 -0
  93. package/src/capabilities/react-surface.tsx +108 -78
  94. package/src/cli/commands/disable.ts +47 -0
  95. package/src/cli/commands/enable.ts +44 -0
  96. package/src/cli/commands/index.ts +14 -0
  97. package/src/cli/commands/list.ts +41 -0
  98. package/src/cli/commands/util.ts +24 -0
  99. package/src/cli/index.ts +6 -0
  100. package/src/cli/plugin.ts +17 -0
  101. package/src/cli/storage.ts +50 -0
  102. package/src/components/PluginDetail/PluginDetail.stories.tsx +43 -0
  103. package/src/components/PluginDetail/PluginDetail.tsx +84 -0
  104. package/src/components/PluginDetail/index.ts +5 -0
  105. package/src/components/PluginList/PluginItem.tsx +152 -0
  106. package/src/components/PluginList/PluginList.stories.tsx +87 -0
  107. package/src/components/PluginList/PluginList.tsx +29 -0
  108. package/src/components/PluginList/index.ts +5 -0
  109. package/src/components/index.ts +0 -1
  110. package/src/containers/CommunityRegistry/CommunityRegistry.tsx +147 -0
  111. package/src/containers/CommunityRegistry/index.ts +5 -0
  112. package/src/containers/LoadPluginDialog/LoadPluginDialog.tsx +85 -0
  113. package/src/containers/LoadPluginDialog/index.ts +5 -0
  114. package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
  115. package/src/containers/PluginArticle/index.ts +5 -0
  116. package/src/containers/PluginRegistry/PluginRegistry.tsx +98 -0
  117. package/src/containers/PluginRegistry/index.ts +5 -0
  118. package/src/containers/index.ts +11 -0
  119. package/src/hooks/index.ts +6 -0
  120. package/src/hooks/use-auto-tags.ts +52 -0
  121. package/src/hooks/use-community-plugins.ts +77 -0
  122. package/src/meta.ts +19 -9
  123. package/src/operations/index.ts +7 -0
  124. package/src/operations/open-plugin-registry.ts +21 -0
  125. package/src/translations.ts +19 -15
  126. package/src/types.ts +14 -1
  127. package/dist/lib/browser/app-graph-builder-6JQNRTEQ.mjs +0 -161
  128. package/dist/lib/browser/app-graph-builder-6JQNRTEQ.mjs.map +0 -7
  129. package/dist/lib/browser/chunk-AEBASNOI.mjs +0 -16
  130. package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
  131. package/dist/lib/browser/intent-resolver-UGDFPMAG.mjs +0 -23
  132. package/dist/lib/browser/intent-resolver-UGDFPMAG.mjs.map +0 -7
  133. package/dist/lib/browser/react-surface-BQPO3F3E.mjs +0 -333
  134. package/dist/lib/browser/react-surface-BQPO3F3E.mjs.map +0 -7
  135. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  136. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  137. package/dist/types/src/components/Icon.stories.d.ts +0 -6
  138. package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
  139. package/dist/types/src/components/PluginDetail.d.ts +0 -9
  140. package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
  141. package/dist/types/src/components/PluginDetail.stories.d.ts +0 -8
  142. package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
  143. package/dist/types/src/components/PluginItem.d.ts +0 -13
  144. package/dist/types/src/components/PluginItem.d.ts.map +0 -1
  145. package/dist/types/src/components/PluginList.d.ts +0 -8
  146. package/dist/types/src/components/PluginList.d.ts.map +0 -1
  147. package/dist/types/src/components/PluginList.stories.d.ts +0 -11
  148. package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
  149. package/dist/types/src/components/RegistryContainer.d.ts +0 -7
  150. package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
  151. package/src/capabilities/intent-resolver.ts +0 -27
  152. package/src/components/Icon.stories.tsx +0 -108
  153. package/src/components/PluginDetail.stories.tsx +0 -46
  154. package/src/components/PluginDetail.tsx +0 -63
  155. package/src/components/PluginItem.tsx +0 -119
  156. package/src/components/PluginList.stories.tsx +0 -83
  157. package/src/components/PluginList.tsx +0 -26
  158. package/src/components/RegistryContainer.tsx +0 -84
package/package.json CHANGED
@@ -1,18 +1,37 @@
1
1
  {
2
2
  "name": "@dxos/plugin-registry",
3
- "version": "0.8.4-main.f5c0578",
3
+ "version": "0.8.4-main.fcfe5033a5",
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",
@@ -24,41 +43,51 @@
24
43
  "src"
25
44
  ],
26
45
  "dependencies": {
27
- "@preact-signals/safe-react": "^0.9.0",
28
- "@dxos/app-framework": "0.8.4-main.f5c0578",
29
- "@dxos/echo": "0.8.4-main.f5c0578",
30
- "@dxos/echo-schema": "0.8.4-main.f5c0578",
31
- "@dxos/live-object": "0.8.4-main.f5c0578",
32
- "@dxos/invariant": "0.8.4-main.f5c0578",
33
- "@dxos/plugin-graph": "0.8.4-main.f5c0578",
34
- "@dxos/plugin-observability": "0.8.4-main.f5c0578",
35
- "@dxos/react-ui-stack": "0.8.4-main.f5c0578",
36
- "@dxos/util": "0.8.4-main.f5c0578",
37
- "@dxos/react-ui-form": "0.8.4-main.f5c0578"
46
+ "@effect-atom/atom-react": "^0.5.0",
47
+ "@effect/cli": "0.73.2",
48
+ "yaml": "^2.8.2",
49
+ "@dxos/cli-util": "0.8.4-main.fcfe5033a5",
50
+ "@dxos/app-framework": "0.8.4-main.fcfe5033a5",
51
+ "@dxos/client-protocol": "0.8.4-main.fcfe5033a5",
52
+ "@dxos/context": "0.8.4-main.fcfe5033a5",
53
+ "@dxos/app-toolkit": "0.8.4-main.fcfe5033a5",
54
+ "@dxos/echo": "0.8.4-main.fcfe5033a5",
55
+ "@dxos/effect": "0.8.4-main.fcfe5033a5",
56
+ "@dxos/log": "0.8.4-main.fcfe5033a5",
57
+ "@dxos/operation": "0.8.4-main.fcfe5033a5",
58
+ "@dxos/invariant": "0.8.4-main.fcfe5033a5",
59
+ "@dxos/plugin-graph": "0.8.4-main.fcfe5033a5",
60
+ "@dxos/plugin-observability": "0.8.4-main.fcfe5033a5",
61
+ "@dxos/protocols": "0.8.4-main.fcfe5033a5",
62
+ "@dxos/edge-client": "0.8.4-main.fcfe5033a5",
63
+ "@dxos/react-edge-client": "0.8.4-main.fcfe5033a5",
64
+ "@dxos/react-ui-mosaic": "0.8.4-main.fcfe5033a5",
65
+ "@dxos/react-ui-form": "0.8.4-main.fcfe5033a5",
66
+ "@dxos/react-ui-stack": "0.8.4-main.fcfe5033a5",
67
+ "@dxos/util": "0.8.4-main.fcfe5033a5"
38
68
  },
39
69
  "devDependencies": {
40
- "@effect-rx/rx-react": "0.38.0",
41
- "@effect/platform": "0.90.2",
42
- "@phosphor-icons/react": "^2.1.5",
43
- "@types/react": "~18.2.0",
44
- "@types/react-dom": "~18.2.0",
45
- "effect": "3.17.7",
46
- "react": "~18.2.0",
47
- "react-dom": "~18.2.0",
48
- "vite": "5.4.7",
49
- "@dxos/random": "0.8.4-main.f5c0578",
50
- "@dxos/react-ui": "0.8.4-main.f5c0578",
51
- "@dxos/react-ui-theme": "0.8.4-main.f5c0578",
52
- "@dxos/storybook-utils": "0.8.4-main.f5c0578"
70
+ "@effect-atom/atom-react": "^0.5.0",
71
+ "@effect/platform": "0.94.4",
72
+ "@types/react": "~19.2.7",
73
+ "@types/react-dom": "~19.2.3",
74
+ "effect": "3.20.0",
75
+ "react": "~19.2.3",
76
+ "react-dom": "~19.2.3",
77
+ "vite": "^7.1.11",
78
+ "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
79
+ "@dxos/ui-theme": "0.8.4-main.fcfe5033a5",
80
+ "@dxos/storybook-utils": "0.8.4-main.fcfe5033a5",
81
+ "@dxos/random": "0.8.4-main.fcfe5033a5"
53
82
  },
54
83
  "peerDependencies": {
55
- "@effect-rx/rx-react": "^0.34.1",
56
- "@effect/platform": "^0.80.12",
57
- "effect": "^3.13.3",
58
- "react": "~18.2.0",
59
- "react-dom": "~18.2.0",
60
- "@dxos/react-ui": "0.8.4-main.f5c0578",
61
- "@dxos/react-ui-theme": "0.8.4-main.f5c0578"
84
+ "@effect-atom/atom-react": "^0.5.0",
85
+ "@effect/platform": "0.94.4",
86
+ "effect": "3.20.0",
87
+ "react": "~19.2.3",
88
+ "react-dom": "~19.2.3",
89
+ "@dxos/react-ui": "0.8.4-main.fcfe5033a5",
90
+ "@dxos/ui-theme": "0.8.4-main.fcfe5033a5"
62
91
  },
63
92
  "publishConfig": {
64
93
  "access": "public"
@@ -2,32 +2,18 @@
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
+
8
+ import { AppGraphBuilder, OperationHandler, ReactSurface } from '#capabilities';
9
+ import { meta } from '#meta';
6
10
 
7
- import { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';
8
- import { meta } from './meta';
9
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.make,
19
+ );
@@ -2,154 +2,156 @@
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, type PluginContext, SettingsAction, contributes, createIntent } from '@dxos/app-framework';
9
- import { createExtension } from '@dxos/plugin-graph';
7
+ import { Capabilities, Capability } 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';
10
11
 
11
- import { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';
12
+ import { REGISTRY_ID, REGISTRY_KEY, registryCategoryId, meta } from '#meta';
12
13
 
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
- },
14
+ import { LOAD_PLUGIN_DIALOG } from '../containers';
15
+
16
+ export default Capability.makeModule(
17
+ Effect.fnUntraced(function* () {
18
+ const capabilities = yield* Capability.Service;
19
+
20
+ const extensions = yield* Effect.all([
21
+ GraphBuilder.createExtension({
22
+ id: 'open-registry',
23
+ match: NodeMatcher.whenRoot,
24
+ actions: () =>
25
+ Effect.succeed([
26
+ {
27
+ id: 'open-registry',
28
+ data: () => Operation.invoke(SettingsOperation.OpenPluginRegistry),
29
+ properties: {
30
+ label: ['open-plugin-registry.label', { ns: meta.id }],
31
+ icon: 'ph--squares-four--regular',
32
+ disposition: 'menu',
34
33
  },
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
- },
34
+ },
35
+ ]),
36
+ }),
37
+ GraphBuilder.createExtension({
38
+ id: 'registry',
39
+ match: NodeMatcher.whenRoot,
40
+ connector: () =>
41
+ Effect.succeed([
42
+ Node.make({
43
+ id: REGISTRY_ID,
44
+ type: meta.id,
45
+ properties: {
46
+ label: ['plugin-registry.label', { ns: meta.id }],
47
+ icon: 'ph--squares-four--regular',
48
+ disposition: 'pin-end',
49
+ testId: 'treeView.pluginRegistry',
50
+ },
51
+ nodes: [
52
+ Node.make({
53
+ id: registryCategoryId('official'),
54
+ type: 'category',
55
+ data: registryCategoryId('official'),
56
+ properties: {
57
+ label: ['official-plugins.label', { ns: meta.id }],
58
+ icon: 'ph--squares-four--regular',
59
+ key: REGISTRY_KEY,
60
+ testId: 'pluginRegistry.official',
68
61
  },
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
- },
62
+ }),
63
+ Node.make({
64
+ id: registryCategoryId('installed'),
65
+ type: 'category',
66
+ data: registryCategoryId('installed'),
67
+ properties: {
68
+ label: ['installed-plugins.label', { ns: meta.id }],
69
+ icon: 'ph--check--regular',
70
+ key: REGISTRY_KEY,
71
+ testId: 'pluginRegistry.installed',
79
72
  },
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
- },
73
+ }),
74
+ Node.make({
75
+ id: registryCategoryId('recommended'),
76
+ type: 'category',
77
+ data: registryCategoryId('recommended'),
78
+ properties: {
79
+ label: ['recommended-plugins.label', { ns: meta.id }],
80
+ icon: 'ph--star--regular',
81
+ key: REGISTRY_KEY,
82
+ testId: 'pluginRegistry.recommended',
90
83
  },
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
- },
84
+ }),
85
+ Node.make({
86
+ id: registryCategoryId('labs'),
87
+ type: 'category',
88
+ data: registryCategoryId('labs'),
89
+ properties: {
90
+ label: ['labs-plugins.label', { ns: meta.id }],
91
+ icon: 'ph--flask--regular',
92
+ key: REGISTRY_KEY,
93
+ testId: 'pluginRegistry.labs',
101
94
  },
102
- ],
103
- },
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
- },
95
+ }),
96
+ Node.make({
97
+ id: registryCategoryId('community'),
98
+ type: 'category',
99
+ data: registryCategoryId('community'),
100
+ properties: {
101
+ label: ['community-plugins.label', { ns: meta.id }],
102
+ icon: 'ph--users-three--regular',
103
+ key: REGISTRY_KEY,
104
+ testId: 'pluginRegistry.community',
105
+ },
106
+ }),
107
+ ],
108
+ }),
109
+ ]),
110
+ }),
111
+ GraphBuilder.createExtension({
112
+ id: 'actions',
113
+ match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
114
+ actions: () =>
115
+ Effect.succeed([
116
+ {
117
+ id: 'load-by-url',
118
+ data: Effect.fnUntraced(function* () {
119
+ yield* Operation.invoke(LayoutOperation.UpdateDialog, {
120
+ subject: LOAD_PLUGIN_DIALOG,
121
+ state: true,
122
+ });
123
+ }),
124
+ properties: {
125
+ label: ['load-by-url.label', { ns: meta.id }],
126
+ icon: 'ph--cloud-arrow-down--regular',
127
+ disposition: 'list-item-primary',
125
128
  },
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',
129
+ },
130
+ ]),
131
+ }),
132
+ GraphBuilder.createExtension({
133
+ id: 'plugins',
134
+ match: NodeMatcher.whenId(`root/${REGISTRY_ID}`),
135
+ connector: () => {
136
+ const manager = capabilities.get(Capabilities.PluginManager);
137
+ return Effect.succeed(
138
+ manager.getPlugins().map((plugin) =>
139
+ Node.make({
140
+ id: plugin.meta.id,
141
+ type: 'org.dxos.plugin',
143
142
  data: plugin,
144
143
  properties: {
145
144
  label: plugin.meta.name ?? plugin.meta.id,
146
145
  icon: plugin.meta.icon ?? 'ph--circle--regular',
147
146
  disposition: 'hidden',
148
147
  },
149
- }));
150
- }),
151
- Option.getOrElse(() => []),
152
- ),
153
- ),
154
- }),
155
- ]);
148
+ }),
149
+ ),
150
+ );
151
+ },
152
+ }),
153
+ ]);
154
+
155
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
156
+ }),
157
+ );
@@ -2,8 +2,12 @@
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'));
@@ -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
+ );