@dxos/plugin-registry 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

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