@dxos/plugin-registry 0.8.4-main.b97322e → 0.8.4-main.bcb3aa67d6

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