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

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 (120) hide show
  1. package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs +166 -0
  2. package/dist/lib/browser/app-graph-builder-P3ZGGFAR.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-VOAOTNGS.mjs +19 -0
  4. package/dist/lib/browser/chunk-VOAOTNGS.mjs.map +7 -0
  5. package/dist/lib/browser/cli/index.mjs +223 -0
  6. package/dist/lib/browser/cli/index.mjs.map +7 -0
  7. package/dist/lib/browser/index.mjs +22 -31
  8. package/dist/lib/browser/index.mjs.map +4 -4
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs +24 -0
  11. package/dist/lib/browser/operation-resolver-P5PKLPRT.mjs.map +7 -0
  12. package/dist/lib/browser/react-surface-IIM6T7IA.mjs +337 -0
  13. package/dist/lib/browser/react-surface-IIM6T7IA.mjs.map +7 -0
  14. package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs +167 -0
  15. package/dist/lib/node-esm/app-graph-builder-56JXLOGZ.mjs.map +7 -0
  16. package/dist/lib/node-esm/chunk-SALMIZ2W.mjs +21 -0
  17. package/dist/lib/node-esm/chunk-SALMIZ2W.mjs.map +7 -0
  18. package/dist/lib/node-esm/cli/index.mjs +224 -0
  19. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  20. package/dist/lib/node-esm/index.mjs +63 -0
  21. package/dist/lib/node-esm/index.mjs.map +7 -0
  22. package/dist/lib/node-esm/meta.json +1 -0
  23. package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs +25 -0
  24. package/dist/lib/node-esm/operation-resolver-3ZB5W3T3.mjs.map +7 -0
  25. package/dist/lib/node-esm/react-surface-F67P7RC3.mjs +338 -0
  26. package/dist/lib/node-esm/react-surface-F67P7RC3.mjs.map +7 -0
  27. package/dist/types/src/RegistryPlugin.d.ts +2 -1
  28. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  29. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  30. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  31. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  32. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  33. package/dist/types/src/capabilities/index.d.ts +3 -3
  34. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  35. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  36. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  37. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  38. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  39. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  40. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  41. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  42. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  43. package/dist/types/src/cli/commands/disable.d.ts +11 -0
  44. package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
  45. package/dist/types/src/cli/commands/enable.d.ts +11 -0
  46. package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
  47. package/dist/types/src/cli/commands/index.d.ts +3 -0
  48. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  49. package/dist/types/src/cli/commands/list.d.ts +7 -0
  50. package/dist/types/src/cli/commands/list.d.ts.map +1 -0
  51. package/dist/types/src/cli/commands/util.d.ts +11 -0
  52. package/dist/types/src/cli/commands/util.d.ts.map +1 -0
  53. package/dist/types/src/cli/index.d.ts +3 -0
  54. package/dist/types/src/cli/index.d.ts.map +1 -0
  55. package/dist/types/src/cli/plugin.d.ts +3 -0
  56. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  57. package/dist/types/src/cli/storage.d.ts +18 -0
  58. package/dist/types/src/cli/storage.d.ts.map +1 -0
  59. package/dist/types/src/components/PluginDetail.d.ts +3 -3
  60. package/dist/types/src/components/PluginDetail.d.ts.map +1 -1
  61. package/dist/types/src/components/PluginDetail.stories.d.ts +29 -5
  62. package/dist/types/src/components/PluginDetail.stories.d.ts.map +1 -1
  63. package/dist/types/src/components/PluginItem.d.ts +2 -2
  64. package/dist/types/src/components/PluginItem.d.ts.map +1 -1
  65. package/dist/types/src/components/PluginList.d.ts +1 -1
  66. package/dist/types/src/components/PluginList.d.ts.map +1 -1
  67. package/dist/types/src/components/PluginList.stories.d.ts +31 -8
  68. package/dist/types/src/components/PluginList.stories.d.ts.map +1 -1
  69. package/dist/types/src/components/RegistryContainer.d.ts +4 -3
  70. package/dist/types/src/components/RegistryContainer.d.ts.map +1 -1
  71. package/dist/types/src/meta.d.ts +2 -3
  72. package/dist/types/src/meta.d.ts.map +1 -1
  73. package/dist/types/src/types.d.ts +3 -1
  74. package/dist/types/src/types.d.ts.map +1 -1
  75. package/dist/types/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +49 -34
  77. package/src/RegistryPlugin.tsx +9 -25
  78. package/src/capabilities/app-graph-builder/app-graph-builder.ts +136 -0
  79. package/src/capabilities/app-graph-builder/index.ts +7 -0
  80. package/src/capabilities/index.ts +3 -5
  81. package/src/capabilities/operation-resolver/index.ts +7 -0
  82. package/src/capabilities/operation-resolver/operation-resolver.ts +23 -0
  83. package/src/capabilities/react-surface/index.ts +7 -0
  84. package/src/capabilities/react-surface/react-surface.tsx +99 -0
  85. package/src/cli/commands/disable.ts +47 -0
  86. package/src/cli/commands/enable.ts +44 -0
  87. package/src/cli/commands/index.ts +14 -0
  88. package/src/cli/commands/list.ts +41 -0
  89. package/src/cli/commands/util.ts +24 -0
  90. package/src/cli/index.ts +6 -0
  91. package/src/cli/plugin.ts +16 -0
  92. package/src/cli/storage.ts +57 -0
  93. package/src/components/PluginDetail.stories.tsx +21 -23
  94. package/src/components/PluginDetail.tsx +55 -39
  95. package/src/components/PluginItem.tsx +55 -54
  96. package/src/components/PluginList.stories.tsx +32 -37
  97. package/src/components/PluginList.tsx +3 -5
  98. package/src/components/RegistryContainer.tsx +43 -44
  99. package/src/meta.ts +8 -5
  100. package/src/types.ts +5 -1
  101. package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs +0 -161
  102. package/dist/lib/browser/app-graph-builder-LKQBQDUA.mjs.map +0 -7
  103. package/dist/lib/browser/chunk-AEBASNOI.mjs +0 -16
  104. package/dist/lib/browser/chunk-AEBASNOI.mjs.map +0 -7
  105. package/dist/lib/browser/intent-resolver-W67CIJI3.mjs +0 -23
  106. package/dist/lib/browser/intent-resolver-W67CIJI3.mjs.map +0 -7
  107. package/dist/lib/browser/react-surface-3GNB7AOY.mjs +0 -333
  108. package/dist/lib/browser/react-surface-3GNB7AOY.mjs.map +0 -7
  109. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  110. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  111. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  112. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  113. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  114. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  115. package/dist/types/src/components/Icon.stories.d.ts +0 -6
  116. package/dist/types/src/components/Icon.stories.d.ts.map +0 -1
  117. package/src/capabilities/app-graph-builder.ts +0 -155
  118. package/src/capabilities/intent-resolver.ts +0 -27
  119. package/src/capabilities/react-surface.tsx +0 -90
  120. package/src/components/Icon.stories.tsx +0 -108
package/src/meta.ts CHANGED
@@ -2,9 +2,8 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
6
-
7
- export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
8
7
 
9
8
  // TODO(wittjosiah): Deck does not currently support `/` in ids.
10
9
  // TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.
@@ -12,7 +11,11 @@ export const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';
12
11
  export const REGISTRY_ID = '!dxos:plugin-registry';
13
12
  export const REGISTRY_KEY = 'plugin-registry';
14
13
 
15
- export const meta: PluginMeta = {
16
- id: REGISTRY_PLUGIN,
14
+ export const meta: Plugin.Meta = {
15
+ id: 'dxos.org/plugin/registry',
17
16
  name: 'Plugins',
17
+ description: trim`
18
+ Plugin management system for discovering, installing, and configuring workspace extensions.
19
+ Browse available plugins and customize your workspace capabilities.
20
+ `,
18
21
  };
package/src/types.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
7
  export const RegistrySettingsSchema = Schema.mutable(
8
8
  Schema.Struct({
@@ -11,3 +11,7 @@ export const RegistrySettingsSchema = Schema.mutable(
11
11
  );
12
12
 
13
13
  export type RegistrySettings = Schema.Schema.Type<typeof RegistrySettingsSchema>;
14
+
15
+ export const RegistryTagType = Schema.Literal('new', 'beta', 'labs', 'popular', 'featured', 'experimental');
16
+
17
+ export type RegistryTagType = Schema.Schema.Type<typeof RegistryTagType>;
@@ -1,161 +0,0 @@
1
- import {
2
- REGISTRY_ID,
3
- REGISTRY_KEY,
4
- REGISTRY_PLUGIN
5
- } from "./chunk-AEBASNOI.mjs";
6
-
7
- // src/capabilities/app-graph-builder.ts
8
- import { Rx } from "@effect-rx/rx-react";
9
- import { Option, pipe } from "effect";
10
- import { Capabilities, contributes, createIntent, SettingsAction } from "@dxos/app-framework";
11
- import { createExtension } from "@dxos/plugin-graph";
12
- var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
13
- createExtension({
14
- id: REGISTRY_PLUGIN,
15
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
16
- {
17
- id: REGISTRY_PLUGIN,
18
- data: async () => {
19
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
20
- await dispatch(createIntent(SettingsAction.OpenPluginRegistry));
21
- },
22
- properties: {
23
- label: [
24
- "open plugin registry label",
25
- {
26
- ns: REGISTRY_PLUGIN
27
- }
28
- ],
29
- icon: "ph--squares-four--regular",
30
- disposition: "menu"
31
- }
32
- }
33
- ]), Option.getOrElse(() => [])))
34
- }),
35
- createExtension({
36
- id: REGISTRY_PLUGIN,
37
- connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === "root" ? Option.some(node2) : Option.none()), Option.map((node2) => [
38
- {
39
- id: REGISTRY_ID,
40
- type: REGISTRY_PLUGIN,
41
- properties: {
42
- label: [
43
- "plugin registry label",
44
- {
45
- ns: REGISTRY_PLUGIN
46
- }
47
- ],
48
- icon: "ph--squares-four--regular",
49
- disposition: "pin-end",
50
- testId: "treeView.pluginRegistry"
51
- },
52
- nodes: [
53
- {
54
- id: `${REGISTRY_KEY}+all`,
55
- type: "category",
56
- data: `${REGISTRY_KEY}+all`,
57
- properties: {
58
- label: [
59
- "all plugins label",
60
- {
61
- ns: REGISTRY_PLUGIN
62
- }
63
- ],
64
- icon: "ph--squares-four--regular",
65
- key: REGISTRY_KEY,
66
- testId: "pluginRegistry.all"
67
- }
68
- },
69
- {
70
- id: `${REGISTRY_KEY}+installed`,
71
- type: "category",
72
- data: `${REGISTRY_KEY}+installed`,
73
- properties: {
74
- label: [
75
- "installed plugins label",
76
- {
77
- ns: REGISTRY_PLUGIN
78
- }
79
- ],
80
- icon: "ph--check--regular",
81
- key: REGISTRY_KEY,
82
- testId: "pluginRegistry.installed"
83
- }
84
- },
85
- {
86
- id: `${REGISTRY_KEY}+recommended`,
87
- type: "category",
88
- data: `${REGISTRY_KEY}+recommended`,
89
- properties: {
90
- label: [
91
- "recommended plugins label",
92
- {
93
- ns: REGISTRY_PLUGIN
94
- }
95
- ],
96
- icon: "ph--star--regular",
97
- key: REGISTRY_KEY,
98
- testId: "pluginRegistry.recommended"
99
- }
100
- },
101
- {
102
- id: `${REGISTRY_KEY}+labs`,
103
- type: "category",
104
- data: `${REGISTRY_KEY}+labs`,
105
- properties: {
106
- label: [
107
- "labs plugins label",
108
- {
109
- ns: REGISTRY_PLUGIN
110
- }
111
- ],
112
- icon: "ph--flask--regular",
113
- key: REGISTRY_KEY,
114
- testId: "pluginRegistry.labs"
115
- }
116
- }
117
- ]
118
- }
119
- ]), Option.getOrElse(() => [])))
120
- }),
121
- createExtension({
122
- id: `${REGISTRY_PLUGIN}/actions`,
123
- actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => [
124
- {
125
- id: `${REGISTRY_PLUGIN}/load-by-url`,
126
- data: async () => {
127
- },
128
- properties: {
129
- label: [
130
- "load by url label",
131
- {
132
- ns: REGISTRY_PLUGIN
133
- }
134
- ],
135
- icon: "ph--cloud-arrow-down--regular",
136
- disabled: true
137
- }
138
- }
139
- ]), Option.getOrElse(() => [])))
140
- }),
141
- createExtension({
142
- id: `${REGISTRY_PLUGIN}/plugins`,
143
- connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === REGISTRY_ID ? Option.some(node2) : Option.none()), Option.map(() => {
144
- const manager = context.getCapability(Capabilities.PluginManager);
145
- return manager.plugins.map((plugin) => ({
146
- id: plugin.meta.id.replaceAll("/", ":"),
147
- type: "dxos.org/plugin",
148
- data: plugin,
149
- properties: {
150
- label: plugin.meta.name ?? plugin.meta.id,
151
- icon: plugin.meta.icon ?? "ph--circle--regular",
152
- disposition: "hidden"
153
- }
154
- }));
155
- }), Option.getOrElse(() => [])))
156
- })
157
- ]);
158
- export {
159
- app_graph_builder_default as default
160
- };
161
- //# sourceMappingURL=app-graph-builder-LKQBQDUA.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, SettingsAction, type PluginContext } from '@dxos/app-framework';\nimport { createExtension } from '@dxos/plugin-graph';\n\nimport { REGISTRY_ID, REGISTRY_KEY, REGISTRY_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: REGISTRY_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: REGISTRY_PLUGIN,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(SettingsAction.OpenPluginRegistry));\n },\n properties: {\n label: ['open plugin registry label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n disposition: 'menu',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: REGISTRY_PLUGIN,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === 'root' ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: REGISTRY_ID,\n type: REGISTRY_PLUGIN,\n properties: {\n label: ['plugin registry label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n disposition: 'pin-end',\n testId: 'treeView.pluginRegistry',\n },\n nodes: [\n {\n id: `${REGISTRY_KEY}+all`,\n type: 'category',\n data: `${REGISTRY_KEY}+all`,\n properties: {\n label: ['all plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--squares-four--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.all',\n },\n },\n {\n id: `${REGISTRY_KEY}+installed`,\n type: 'category',\n data: `${REGISTRY_KEY}+installed`,\n properties: {\n label: ['installed plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--check--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.installed',\n },\n },\n {\n id: `${REGISTRY_KEY}+recommended`,\n type: 'category',\n data: `${REGISTRY_KEY}+recommended`,\n properties: {\n label: ['recommended plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--star--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.recommended',\n },\n },\n {\n id: `${REGISTRY_KEY}+labs`,\n type: 'category',\n data: `${REGISTRY_KEY}+labs`,\n properties: {\n label: ['labs plugins label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--flask--regular',\n key: REGISTRY_KEY,\n testId: 'pluginRegistry.labs',\n },\n },\n ],\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/actions`,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => [\n {\n id: `${REGISTRY_PLUGIN}/load-by-url`,\n data: async () => {},\n properties: {\n label: ['load by url label', { ns: REGISTRY_PLUGIN }],\n icon: 'ph--cloud-arrow-down--regular',\n disabled: true,\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${REGISTRY_PLUGIN}/plugins`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === REGISTRY_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const manager = context.getCapability(Capabilities.PluginManager);\n return manager.plugins.map((plugin) => ({\n id: plugin.meta.id.replaceAll('/', ':'),\n type: 'dxos.org/plugin',\n data: plugin,\n properties: {\n label: plugin.meta.name ?? plugin.meta.id,\n icon: plugin.meta.icon ?? 'ph--circle--regular',\n disposition: 'hidden',\n },\n }));\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
5
- "mappings": "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",
6
- "names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "SettingsAction", "createExtension", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "REGISTRY_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "some", "none", "map", "data", "dispatchPromise", "dispatch", "getCapability", "IntentDispatcher", "createIntent", "SettingsAction", "OpenPluginRegistry", "properties", "label", "ns", "icon", "disposition", "getOrElse", "connector", "REGISTRY_ID", "type", "testId", "nodes", "REGISTRY_KEY", "key", "disabled", "manager", "PluginManager", "plugins", "plugin", "meta", "replaceAll", "name"]
7
- }
@@ -1,16 +0,0 @@
1
- // src/meta.ts
2
- var REGISTRY_PLUGIN = "dxos.org/plugin/registry";
3
- var REGISTRY_ID = "!dxos:plugin-registry";
4
- var REGISTRY_KEY = "plugin-registry";
5
- var meta = {
6
- id: REGISTRY_PLUGIN,
7
- name: "Plugins"
8
- };
9
-
10
- export {
11
- REGISTRY_PLUGIN,
12
- REGISTRY_ID,
13
- REGISTRY_KEY,
14
- meta
15
- };
16
- //# sourceMappingURL=chunk-AEBASNOI.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const REGISTRY_PLUGIN = 'dxos.org/plugin/registry';\n\n// TODO(wittjosiah): Deck does not currently support `/` in ids.\n// TODO(wittjosiah): This is a hack to prevent the previous deck from being set for pinned items.\n// Ideally this should be worked into the data model in a generic way.\nexport const REGISTRY_ID = '!dxos:plugin-registry';\nexport const REGISTRY_KEY = 'plugin-registry';\n\nexport const meta: PluginMeta = {\n id: REGISTRY_PLUGIN,\n name: 'Plugins',\n};\n"],
5
- "mappings": ";AAMO,IAAMA,kBAAkB;AAKxB,IAAMC,cAAc;AACpB,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIJ;EACJK,MAAM;AACR;",
6
- "names": ["REGISTRY_PLUGIN", "REGISTRY_ID", "REGISTRY_KEY", "meta", "id", "name"]
7
- }
@@ -1,23 +0,0 @@
1
- import {
2
- REGISTRY_ID
3
- } from "./chunk-AEBASNOI.mjs";
4
-
5
- // src/capabilities/intent-resolver.ts
6
- import { contributes, SettingsAction, createResolver, LayoutAction, Capabilities, createIntent } from "@dxos/app-framework";
7
- var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
8
- intent: SettingsAction.OpenPluginRegistry,
9
- resolve: () => {
10
- return {
11
- intents: [
12
- createIntent(LayoutAction.SwitchWorkspace, {
13
- part: "workspace",
14
- subject: REGISTRY_ID
15
- })
16
- ]
17
- };
18
- }
19
- }));
20
- export {
21
- intent_resolver_default as default
22
- };
23
- //# sourceMappingURL=intent-resolver-W67CIJI3.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport {\n contributes,\n SettingsAction,\n createResolver,\n LayoutAction,\n Capabilities,\n createIntent,\n} from '@dxos/app-framework';\n\nimport { REGISTRY_ID } from '../meta';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: SettingsAction.OpenPluginRegistry,\n resolve: () => {\n return {\n intents: [createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: REGISTRY_ID })],\n };\n },\n }),\n );\n"],
5
- "mappings": ";;;;;AAIA,SACEA,aACAC,gBACAC,gBACAC,cACAC,cACAC,oBACK;AAIP,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,eAAeC;EACvBC,SAAS,MAAA;AACP,WAAO;MACLC,SAAS;QAACC,aAAaC,aAAaC,iBAAiB;UAAEC,MAAM;UAAaC,SAASC;QAAY,CAAA;;IACjG;EACF;AACF,CAAA,CAAA;",
6
- "names": ["contributes", "SettingsAction", "createResolver", "LayoutAction", "Capabilities", "createIntent", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "SettingsAction", "OpenPluginRegistry", "resolve", "intents", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "REGISTRY_ID"]
7
- }
@@ -1,333 +0,0 @@
1
- import {
2
- REGISTRY_KEY,
3
- REGISTRY_PLUGIN
4
- } from "./chunk-AEBASNOI.mjs";
5
-
6
- // src/capabilities/react-surface.tsx
7
- import React5, { useCallback as useCallback3, useMemo as useMemo2 } from "react";
8
- import { Capabilities as Capabilities2, contributes, createSurface, Plugin, usePluginManager as usePluginManager2 } from "@dxos/app-framework";
9
- import { StackItem as StackItem2 } from "@dxos/react-ui-stack";
10
-
11
- // src/components/PluginDetail.tsx
12
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
13
- import React from "react";
14
- import { Icon, Input, Link, useTranslation } from "@dxos/react-ui";
15
- import { DeprecatedFormContainer } from "@dxos/react-ui-form";
16
- var PluginDetail = ({ plugin, enabled, onEnable }) => {
17
- var _effect = _useSignals();
18
- try {
19
- const { t } = useTranslation(REGISTRY_PLUGIN);
20
- const { id, name, description, homePage, source, screenshots } = plugin.meta;
21
- return /* @__PURE__ */ React.createElement(DeprecatedFormContainer, {
22
- classNames: "gap-6"
23
- }, /* @__PURE__ */ React.createElement("div", {
24
- role: "none",
25
- className: "flex justify-between items-center"
26
- }, /* @__PURE__ */ React.createElement("p", null, id), /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Switch, {
27
- classNames: "self-center",
28
- checked: enabled,
29
- onClick: onEnable
30
- }))), screenshots && screenshots.length > 0 && /* @__PURE__ */ React.createElement("div", {
31
- role: "none"
32
- }, /* @__PURE__ */ React.createElement("h1", {
33
- className: "text-lg mb-2"
34
- }, "Preview"), /* @__PURE__ */ React.createElement("img", {
35
- src: screenshots[0],
36
- alt: name,
37
- className: "aspect-video object-fit"
38
- })), /* @__PURE__ */ React.createElement("div", {
39
- role: "none"
40
- }, /* @__PURE__ */ React.createElement("p", null, description)), /* @__PURE__ */ React.createElement("div", {
41
- role: "none"
42
- }, /* @__PURE__ */ React.createElement("h1", {
43
- className: "text-lg mb-2"
44
- }, "Resources"), /* @__PURE__ */ React.createElement("div", {
45
- className: "flex gap-2"
46
- }, homePage && /* @__PURE__ */ React.createElement(Link, {
47
- href: homePage,
48
- target: "_blank",
49
- rel: "noreferrer",
50
- classNames: "text-sm text-description"
51
- }, t("home page label"), /* @__PURE__ */ React.createElement(Icon, {
52
- icon: "ph--arrow-square-out--bold",
53
- size: 3,
54
- classNames: "inline-block leading-none mli-1"
55
- })), source && /* @__PURE__ */ React.createElement(Link, {
56
- href: source,
57
- target: "_blank",
58
- rel: "noreferrer",
59
- classNames: "text-sm text-description"
60
- }, t("source label"), /* @__PURE__ */ React.createElement(Icon, {
61
- icon: "ph--arrow-square-out--bold",
62
- size: 3,
63
- classNames: "inline-block leading-none mli-1"
64
- })))));
65
- } finally {
66
- _effect.f();
67
- }
68
- };
69
-
70
- // src/components/PluginList.tsx
71
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
72
- import React3 from "react";
73
- import { List } from "@dxos/react-ui";
74
-
75
- // src/components/PluginItem.tsx
76
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
77
- import React2, { useCallback } from "react";
78
- import { Icon as Icon2, IconButton, Input as Input2, Link as Link2, ListItem, Tag, useTranslation as useTranslation2 } from "@dxos/react-ui";
79
- import { descriptionText, mx } from "@dxos/react-ui-theme";
80
- var PluginItem = ({ plugin, enabled = [], onClick, onChange, hasSettings: _hasSettings, onSettings }) => {
81
- var _effect = _useSignals2();
82
- try {
83
- const { t } = useTranslation2(REGISTRY_PLUGIN);
84
- const { id, name, description, tags, icon = "ph--circle--regular" } = plugin.meta;
85
- const isEnabled = enabled.includes(id);
86
- const inputId = `${id}-input`;
87
- const labelId = `${id}-label`;
88
- const descriptionId = `${id}-description`;
89
- const handleClick = useCallback(() => onClick?.(id), [
90
- id,
91
- onClick
92
- ]);
93
- const handleChange = useCallback((event) => {
94
- event.stopPropagation();
95
- onChange?.(id, !isEnabled);
96
- }, [
97
- id,
98
- isEnabled,
99
- onChange
100
- ]);
101
- const hasSettings = _hasSettings?.(id) ?? false;
102
- const handleSettings = useCallback(() => onSettings?.(id), [
103
- id,
104
- onSettings
105
- ]);
106
- return /* @__PURE__ */ React2.createElement(ListItem.Root, {
107
- key: id,
108
- labelId,
109
- "data-testid": `pluginList.${id}`,
110
- "aria-describedby": descriptionId,
111
- // TODO(burdon): Use Rail vars.
112
- classNames: "is-full bs-full grid grid-cols-[48px_1fr_48px] grid-rows-[40px_1fr_32px] p-1 border border-separator rounded-md"
113
- }, /* @__PURE__ */ React2.createElement("div", {
114
- className: "flex flex-col grow justify-center items-center"
115
- }, /* @__PURE__ */ React2.createElement(Icon2, {
116
- icon,
117
- size: 6,
118
- onClick: handleClick,
119
- classNames: "text-subdued cursor-pointer"
120
- })), /* @__PURE__ */ React2.createElement("div", {
121
- className: "flex items-center overflow-hidden cursor-pointer",
122
- onClick: handleClick
123
- }, /* @__PURE__ */ React2.createElement("span", {
124
- className: "truncate"
125
- }, name ?? id)), /* @__PURE__ */ React2.createElement("div", {
126
- className: "flex justify-center items-center"
127
- }, /* @__PURE__ */ React2.createElement(Input2.Root, {
128
- id: inputId
129
- }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
130
- classNames: "self-center",
131
- checked: isEnabled,
132
- onClick: handleChange
133
- }))), /* @__PURE__ */ React2.createElement("div", null), (description || tags) && /* @__PURE__ */ React2.createElement("div", {
134
- id: descriptionId,
135
- className: "col-span-2 flex flex-col w-full justify-between gap-2 pb-2"
136
- }, /* @__PURE__ */ React2.createElement("div", {
137
- className: "grow"
138
- }, /* @__PURE__ */ React2.createElement("p", {
139
- className: mx(descriptionText, "line-clamp-3 min-w-0 pie-2")
140
- }, description)), tags && tags.length > 0 && /* @__PURE__ */ React2.createElement("div", null, tags.map((tag) => /* @__PURE__ */ React2.createElement(Tag, {
141
- key: tag,
142
- palette: "indigo",
143
- classNames: "text-xs capitalize"
144
- }, tag)))), /* @__PURE__ */ React2.createElement("div", null), /* @__PURE__ */ React2.createElement("div", {
145
- className: "flex gap-2 items-center pie-1"
146
- }, /* @__PURE__ */ React2.createElement(Link2, {
147
- "aria-describedby": descriptionId,
148
- classNames: "text-sm text-description cursor-pointer",
149
- onClick: handleClick
150
- }, t("details label")), /* @__PURE__ */ React2.createElement("div", {
151
- className: "flex-1"
152
- })), /* @__PURE__ */ React2.createElement("div", {
153
- className: "flex justify-center items-center"
154
- }, hasSettings && /* @__PURE__ */ React2.createElement(IconButton, {
155
- "aria-describedby": descriptionId,
156
- classNames: "text-sm text-description cursor-pointer",
157
- icon: "ph--gear--regular",
158
- label: t("settings label"),
159
- iconOnly: true,
160
- size: 4,
161
- onClick: handleSettings
162
- })));
163
- } finally {
164
- _effect.f();
165
- }
166
- };
167
-
168
- // src/components/PluginList.tsx
169
- var PluginList = ({ plugins = [], ...props }) => {
170
- var _effect = _useSignals3();
171
- try {
172
- return /* @__PURE__ */ React3.createElement(List, {
173
- classNames: "grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] auto-rows-[12rem] gap-3 p-3"
174
- }, plugins.map((plugin) => /* @__PURE__ */ React3.createElement("div", {
175
- key: plugin.meta.id,
176
- className: "flex"
177
- }, /* @__PURE__ */ React3.createElement(PluginItem, {
178
- plugin,
179
- ...props
180
- }))));
181
- } finally {
182
- _effect.f();
183
- }
184
- };
185
-
186
- // src/components/RegistryContainer.tsx
187
- import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
188
- import React4, { useCallback as useCallback2, useMemo } from "react";
189
- import { Capabilities, createIntent, LayoutAction, SettingsAction, useCapability, useIntentDispatcher, usePluginManager } from "@dxos/app-framework";
190
- import { ObservabilityAction } from "@dxos/plugin-observability/types";
191
- import { StackItem } from "@dxos/react-ui-stack";
192
- var sortByPluginMeta = ({ meta: { name: a = "" } }, { meta: { name: b = "" } }) => a.localeCompare(b);
193
- var RegistryContainer = ({ id, plugins: _plugins }) => {
194
- var _effect = _useSignals4();
195
- try {
196
- const manager = usePluginManager();
197
- const { dispatchPromise: dispatch } = useIntentDispatcher();
198
- const plugins = useMemo(() => _plugins.sort(sortByPluginMeta), [
199
- _plugins
200
- ]);
201
- const settingsStore = useCapability(Capabilities.SettingsStore);
202
- const handleChange = useCallback2(async (id2, enabled) => {
203
- if (enabled) {
204
- await manager.enable(id2);
205
- } else {
206
- await manager.disable(id2);
207
- }
208
- await dispatch(createIntent(ObservabilityAction.SendEvent, {
209
- name: "plugins.toggle",
210
- properties: {
211
- plugin: id2,
212
- enabled
213
- }
214
- }));
215
- }, [
216
- dispatch,
217
- manager
218
- ]);
219
- const handleClick = useCallback2((pluginId) => dispatch(createIntent(LayoutAction.Open, {
220
- part: "main",
221
- // TODO(wittjosiah): `/` currently is not supported in ids.
222
- subject: [
223
- pluginId.replaceAll("/", ":")
224
- ],
225
- options: {
226
- pivotId: id,
227
- positioning: "end"
228
- }
229
- })), [
230
- dispatch,
231
- id
232
- ]);
233
- const hasSettings = useCallback2((pluginId) => !!settingsStore.getStore(pluginId), [
234
- settingsStore
235
- ]);
236
- const handleSettings = useCallback2((pluginId) => dispatch(createIntent(SettingsAction.Open, {
237
- plugin: pluginId
238
- })), [
239
- dispatch
240
- ]);
241
- return /* @__PURE__ */ React4.createElement(StackItem.Content, {
242
- classNames: "min-bs-0 overflow-y-auto scrollbar-thin contain-layout"
243
- }, /* @__PURE__ */ React4.createElement(PluginList, {
244
- plugins,
245
- enabled: manager.enabled,
246
- onClick: handleClick,
247
- onChange: handleChange,
248
- hasSettings,
249
- onSettings: handleSettings
250
- }));
251
- } finally {
252
- _effect.f();
253
- }
254
- };
255
-
256
- // src/capabilities/react-surface.tsx
257
- var react_surface_default = () => contributes(Capabilities2.ReactSurface, [
258
- createSurface({
259
- id: `${REGISTRY_PLUGIN}/all`,
260
- role: "article",
261
- filter: (data) => data.subject === `${REGISTRY_KEY}+all`,
262
- component: () => {
263
- const manager = usePluginManager2();
264
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)), []);
265
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
266
- id: `${REGISTRY_KEY}+all`,
267
- plugins: filtered
268
- });
269
- }
270
- }),
271
- createSurface({
272
- id: `${REGISTRY_PLUGIN}/installed`,
273
- role: "article",
274
- filter: (data) => data.subject === `${REGISTRY_KEY}+installed`,
275
- component: () => {
276
- const manager = usePluginManager2();
277
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)).filter(({ meta }) => manager.enabled.includes(meta.id)), []);
278
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
279
- id: `${REGISTRY_KEY}+installed`,
280
- plugins: filtered
281
- });
282
- }
283
- }),
284
- createSurface({
285
- id: `${REGISTRY_PLUGIN}/recommended`,
286
- role: "article",
287
- filter: (data) => data.subject === `${REGISTRY_KEY}+recommended`,
288
- component: () => {
289
- const manager = usePluginManager2();
290
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => !manager.core.includes(meta.id)).filter(({ meta }) => !meta.tags?.includes("labs")), []);
291
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
292
- id: `${REGISTRY_KEY}+recommended`,
293
- plugins: filtered
294
- });
295
- }
296
- }),
297
- createSurface({
298
- id: `${REGISTRY_PLUGIN}/labs`,
299
- role: "article",
300
- filter: (data) => data.subject === `${REGISTRY_KEY}+labs`,
301
- component: () => {
302
- const manager = usePluginManager2();
303
- const filtered = useMemo2(() => manager.plugins.filter(({ meta }) => meta.tags?.includes("labs")), []);
304
- return /* @__PURE__ */ React5.createElement(RegistryContainer, {
305
- id: `${REGISTRY_KEY}+labs`,
306
- plugins: filtered
307
- });
308
- }
309
- }),
310
- createSurface({
311
- id: `${REGISTRY_PLUGIN}/plugin-details`,
312
- role: "article",
313
- filter: (data) => data.subject instanceof Plugin,
314
- component: ({ data: { subject } }) => {
315
- const manager = usePluginManager2();
316
- const enabled = manager.enabled.includes(subject.meta.id);
317
- const handleEnable = useCallback3(() => enabled ? manager.disable(subject.meta.id) : manager.enable(subject.meta.id), [
318
- manager,
319
- subject.meta.id,
320
- enabled
321
- ]);
322
- return /* @__PURE__ */ React5.createElement(StackItem2.Content, null, /* @__PURE__ */ React5.createElement(PluginDetail, {
323
- plugin: subject,
324
- enabled,
325
- onEnable: handleEnable
326
- }));
327
- }
328
- })
329
- ]);
330
- export {
331
- react_surface_default as default
332
- };
333
- //# sourceMappingURL=react-surface-3GNB7AOY.mjs.map