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

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 (169) hide show
  1. package/dist/lib/browser/PluginArticle-XBWRL2VJ.mjs +29 -0
  2. package/dist/lib/browser/PluginArticle-XBWRL2VJ.mjs.map +7 -0
  3. package/dist/lib/browser/PluginRegistry-YU7M4VWL.mjs +82 -0
  4. package/dist/lib/browser/PluginRegistry-YU7M4VWL.mjs.map +7 -0
  5. package/dist/lib/browser/app-graph-builder-M6TK7ZTK.mjs +168 -0
  6. package/dist/lib/browser/app-graph-builder-M6TK7ZTK.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-FGKYAUX2.mjs +25 -0
  8. package/dist/lib/browser/chunk-FGKYAUX2.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-Y5BNERPC.mjs +193 -0
  10. package/dist/lib/browser/chunk-Y5BNERPC.mjs.map +7 -0
  11. package/dist/lib/browser/cli/index.mjs +222 -0
  12. package/dist/lib/browser/cli/index.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +29 -31
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/open-plugin-registry-Z3I6SBRQ.mjs +18 -0
  17. package/dist/lib/browser/open-plugin-registry-Z3I6SBRQ.mjs.map +7 -0
  18. package/dist/lib/browser/operation-handler-BLH2Y76R.mjs +16 -0
  19. package/dist/lib/browser/operation-handler-BLH2Y76R.mjs.map +7 -0
  20. package/dist/lib/browser/react-surface-6NL2F2O3.mjs +85 -0
  21. package/dist/lib/browser/react-surface-6NL2F2O3.mjs.map +7 -0
  22. package/dist/lib/node-esm/PluginArticle-FIVZRB45.mjs +30 -0
  23. package/dist/lib/node-esm/PluginArticle-FIVZRB45.mjs.map +7 -0
  24. package/dist/lib/node-esm/PluginRegistry-RHD6ZITD.mjs +83 -0
  25. package/dist/lib/node-esm/PluginRegistry-RHD6ZITD.mjs.map +7 -0
  26. package/dist/lib/node-esm/app-graph-builder-FSZAEWLX.mjs +169 -0
  27. package/dist/lib/node-esm/app-graph-builder-FSZAEWLX.mjs.map +7 -0
  28. package/dist/lib/node-esm/chunk-44X3W2YY.mjs +27 -0
  29. package/dist/lib/node-esm/chunk-44X3W2YY.mjs.map +7 -0
  30. package/dist/lib/node-esm/chunk-576PZRDS.mjs +194 -0
  31. package/dist/lib/node-esm/chunk-576PZRDS.mjs.map +7 -0
  32. package/dist/lib/node-esm/cli/index.mjs +223 -0
  33. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  34. package/dist/lib/node-esm/index.mjs +68 -0
  35. package/dist/lib/node-esm/index.mjs.map +7 -0
  36. package/dist/lib/node-esm/meta.json +1 -0
  37. package/dist/lib/node-esm/open-plugin-registry-4ZDMAWN2.mjs +19 -0
  38. package/dist/lib/node-esm/open-plugin-registry-4ZDMAWN2.mjs.map +7 -0
  39. package/dist/lib/node-esm/operation-handler-FQX7TJYA.mjs +18 -0
  40. package/dist/lib/node-esm/operation-handler-FQX7TJYA.mjs.map +7 -0
  41. package/dist/lib/node-esm/react-surface-FUOA7DZ3.mjs +86 -0
  42. package/dist/lib/node-esm/react-surface-FUOA7DZ3.mjs.map +7 -0
  43. package/dist/types/src/RegistryPlugin.d.ts +2 -1
  44. package/dist/types/src/RegistryPlugin.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  46. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  48. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/index.d.ts +3 -3
  50. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
  52. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
  54. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  56. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  57. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  58. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  59. package/dist/types/src/cli/commands/disable.d.ts +11 -0
  60. package/dist/types/src/cli/commands/disable.d.ts.map +1 -0
  61. package/dist/types/src/cli/commands/enable.d.ts +11 -0
  62. package/dist/types/src/cli/commands/enable.d.ts.map +1 -0
  63. package/dist/types/src/cli/commands/index.d.ts +3 -0
  64. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  65. package/dist/types/src/cli/commands/list.d.ts +7 -0
  66. package/dist/types/src/cli/commands/list.d.ts.map +1 -0
  67. package/dist/types/src/cli/commands/util.d.ts +11 -0
  68. package/dist/types/src/cli/commands/util.d.ts.map +1 -0
  69. package/dist/types/src/cli/index.d.ts +3 -0
  70. package/dist/types/src/cli/index.d.ts.map +1 -0
  71. package/dist/types/src/cli/plugin.d.ts +3 -0
  72. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  73. package/dist/types/src/cli/storage.d.ts +18 -0
  74. package/dist/types/src/cli/storage.d.ts.map +1 -0
  75. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts +15 -0
  76. package/dist/types/src/components/PluginDetail/PluginDetail.d.ts.map +1 -0
  77. package/dist/types/src/components/{PluginDetail.stories.d.ts → PluginDetail/PluginDetail.stories.d.ts} +8 -1
  78. package/dist/types/src/components/PluginDetail/PluginDetail.stories.d.ts.map +1 -0
  79. package/dist/types/src/components/PluginDetail/index.d.ts +2 -0
  80. package/dist/types/src/components/PluginDetail/index.d.ts.map +1 -0
  81. package/dist/types/src/components/{PluginItem.d.ts → PluginList/PluginItem.d.ts} +2 -2
  82. package/dist/types/src/components/PluginList/PluginItem.d.ts.map +1 -0
  83. package/dist/types/src/components/{PluginList.d.ts → PluginList/PluginList.d.ts} +1 -1
  84. package/dist/types/src/components/PluginList/PluginList.d.ts.map +1 -0
  85. package/dist/types/src/components/PluginList/PluginList.stories.d.ts.map +1 -0
  86. package/dist/types/src/components/PluginList/index.d.ts +2 -0
  87. package/dist/types/src/components/PluginList/index.d.ts.map +1 -0
  88. package/dist/types/src/components/index.d.ts +0 -1
  89. package/dist/types/src/components/index.d.ts.map +1 -1
  90. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts +7 -0
  91. package/dist/types/src/containers/PluginArticle/PluginArticle.d.ts.map +1 -0
  92. package/dist/types/src/containers/PluginArticle/index.d.ts +3 -0
  93. package/dist/types/src/containers/PluginArticle/index.d.ts.map +1 -0
  94. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts +14 -0
  95. package/dist/types/src/containers/PluginRegistry/PluginRegistry.d.ts.map +1 -0
  96. package/dist/types/src/containers/PluginRegistry/index.d.ts +3 -0
  97. package/dist/types/src/containers/PluginRegistry/index.d.ts.map +1 -0
  98. package/dist/types/src/containers/index.d.ts +4 -0
  99. package/dist/types/src/containers/index.d.ts.map +1 -0
  100. package/dist/types/src/meta.d.ts +7 -3
  101. package/dist/types/src/meta.d.ts.map +1 -1
  102. package/dist/types/src/operations/index.d.ts +3 -0
  103. package/dist/types/src/operations/index.d.ts.map +1 -0
  104. package/dist/types/src/operations/open-plugin-registry.d.ts +5 -0
  105. package/dist/types/src/operations/open-plugin-registry.d.ts.map +1 -0
  106. package/dist/types/tsconfig.tsbuildinfo +1 -1
  107. package/package.json +50 -32
  108. package/src/RegistryPlugin.tsx +10 -24
  109. package/src/capabilities/app-graph-builder/app-graph-builder.ts +137 -0
  110. package/src/capabilities/app-graph-builder/index.ts +7 -0
  111. package/src/capabilities/index.ts +3 -5
  112. package/src/capabilities/operation-handler/index.ts +11 -0
  113. package/src/capabilities/operation-handler/operation-handler.ts +16 -0
  114. package/src/capabilities/react-surface/index.ts +7 -0
  115. package/src/capabilities/react-surface/react-surface.tsx +88 -0
  116. package/src/cli/commands/disable.ts +47 -0
  117. package/src/cli/commands/enable.ts +44 -0
  118. package/src/cli/commands/index.ts +14 -0
  119. package/src/cli/commands/list.ts +41 -0
  120. package/src/cli/commands/util.ts +24 -0
  121. package/src/cli/index.ts +6 -0
  122. package/src/cli/plugin.ts +17 -0
  123. package/src/cli/storage.ts +50 -0
  124. package/src/components/PluginDetail/PluginDetail.stories.tsx +44 -0
  125. package/src/components/PluginDetail/PluginDetail.tsx +84 -0
  126. package/src/components/PluginDetail/index.ts +5 -0
  127. package/src/components/{PluginItem.tsx → PluginList/PluginItem.tsx} +18 -14
  128. package/src/components/PluginList/PluginList.stories.tsx +87 -0
  129. package/src/components/{PluginList.tsx → PluginList/PluginList.tsx} +2 -2
  130. package/src/components/PluginList/index.ts +5 -0
  131. package/src/components/index.ts +0 -1
  132. package/src/containers/PluginArticle/PluginArticle.tsx +28 -0
  133. package/src/containers/PluginArticle/index.ts +7 -0
  134. package/src/containers/PluginRegistry/PluginRegistry.tsx +94 -0
  135. package/src/containers/PluginRegistry/index.ts +7 -0
  136. package/src/containers/index.ts +8 -0
  137. package/src/meta.ts +14 -7
  138. package/src/operations/index.ts +7 -0
  139. package/src/operations/open-plugin-registry.ts +21 -0
  140. package/dist/lib/browser/app-graph-builder-6CNBP3A4.mjs +0 -162
  141. package/dist/lib/browser/app-graph-builder-6CNBP3A4.mjs.map +0 -7
  142. package/dist/lib/browser/chunk-XPEFEID2.mjs +0 -19
  143. package/dist/lib/browser/chunk-XPEFEID2.mjs.map +0 -7
  144. package/dist/lib/browser/intent-resolver-LKNUYBTN.mjs +0 -23
  145. package/dist/lib/browser/intent-resolver-LKNUYBTN.mjs.map +0 -7
  146. package/dist/lib/browser/react-surface-IGCXOVE2.mjs +0 -359
  147. package/dist/lib/browser/react-surface-IGCXOVE2.mjs.map +0 -7
  148. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  149. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  150. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  151. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  152. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  153. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  154. package/dist/types/src/components/PluginDetail.d.ts +0 -9
  155. package/dist/types/src/components/PluginDetail.d.ts.map +0 -1
  156. package/dist/types/src/components/PluginDetail.stories.d.ts.map +0 -1
  157. package/dist/types/src/components/PluginItem.d.ts.map +0 -1
  158. package/dist/types/src/components/PluginList.d.ts.map +0 -1
  159. package/dist/types/src/components/PluginList.stories.d.ts.map +0 -1
  160. package/dist/types/src/components/RegistryContainer.d.ts +0 -7
  161. package/dist/types/src/components/RegistryContainer.d.ts.map +0 -1
  162. package/src/capabilities/app-graph-builder.ts +0 -156
  163. package/src/capabilities/intent-resolver.ts +0 -27
  164. package/src/capabilities/react-surface.tsx +0 -86
  165. package/src/components/PluginDetail.stories.tsx +0 -45
  166. package/src/components/PluginDetail.tsx +0 -82
  167. package/src/components/PluginList.stories.tsx +0 -80
  168. package/src/components/RegistryContainer.tsx +0 -76
  169. /package/dist/types/src/components/{PluginList.stories.d.ts → PluginList/PluginList.stories.d.ts} +0 -0
@@ -0,0 +1,194 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ meta
4
+ } from "./chunk-44X3W2YY.mjs";
5
+
6
+ // src/components/PluginDetail/PluginDetail.tsx
7
+ import React from "react";
8
+ import { Icon, Input, Link, ScrollArea, useTranslation } from "@dxos/react-ui";
9
+ import { composable, composableProps, getStyles, mx } from "@dxos/ui-theme";
10
+ var PluginDetail = composable(({ plugin, enabled, onEnabledChange, ...props }, forwardedRef) => {
11
+ const { t } = useTranslation(meta.id);
12
+ const { id, name, description, homePage, source, screenshots, icon = "ph--circle--regular", iconHue = "neutral" } = plugin.meta;
13
+ const styles = getStyles(iconHue);
14
+ return /* @__PURE__ */ React.createElement(ScrollArea.Root, {
15
+ ...composableProps(props),
16
+ orientation: "vertical",
17
+ ref: forwardedRef
18
+ }, /* @__PURE__ */ React.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React.createElement("div", {
19
+ role: "none",
20
+ className: "dx-document grid grid-cols-[min-content_1fr] gap-4 p-4"
21
+ }, /* @__PURE__ */ React.createElement("div", {
22
+ role: "none"
23
+ }, /* @__PURE__ */ React.createElement(Icon, {
24
+ classNames: mx("p-1 rounded-md", styles.fill, styles.surfaceText),
25
+ icon,
26
+ size: 14
27
+ })), /* @__PURE__ */ React.createElement("div", {
28
+ role: "none",
29
+ className: "flex flex-col gap-6"
30
+ }, /* @__PURE__ */ React.createElement("div", {
31
+ role: "none",
32
+ className: "grid grid-cols-[1fr_min-content] gap-x-3 w-full pt-1"
33
+ }, /* @__PURE__ */ React.createElement("h2", {
34
+ className: "text-xl"
35
+ }, name), /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Switch, {
36
+ classNames: "self-center",
37
+ checked: enabled,
38
+ onCheckedChange: onEnabledChange
39
+ })), /* @__PURE__ */ React.createElement("p", {
40
+ className: "pt-0.5 text-sm text-description"
41
+ }, id)), /* @__PURE__ */ React.createElement("div", {
42
+ role: "none"
43
+ }, /* @__PURE__ */ React.createElement("p", {
44
+ className: "text-description"
45
+ }, description)), screenshots && screenshots.length > 0 && /* @__PURE__ */ React.createElement("div", {
46
+ role: "none",
47
+ className: "flex flex-col gap-2"
48
+ }, /* @__PURE__ */ React.createElement("h2", null, "Preview"), /* @__PURE__ */ React.createElement("img", {
49
+ src: screenshots[0],
50
+ alt: name,
51
+ className: "aspect-video object-fit"
52
+ })), /* @__PURE__ */ React.createElement("div", {
53
+ role: "none",
54
+ className: "flex flex-col gap-2"
55
+ }, /* @__PURE__ */ React.createElement("h2", null, "Resources"), /* @__PURE__ */ React.createElement("div", {
56
+ className: "flex gap-2"
57
+ }, homePage && /* @__PURE__ */ React.createElement(Link, {
58
+ href: homePage,
59
+ target: "_blank",
60
+ rel: "noreferrer",
61
+ classNames: "text-sm text-description"
62
+ }, t("home page label"), /* @__PURE__ */ React.createElement(Icon, {
63
+ icon: "ph--arrow-square-out--bold",
64
+ size: 3,
65
+ classNames: "inline-block leading-none mx-1"
66
+ })), source && /* @__PURE__ */ React.createElement(Link, {
67
+ href: source,
68
+ target: "_blank",
69
+ rel: "noreferrer",
70
+ classNames: "text-sm text-description"
71
+ }, t("source label"), /* @__PURE__ */ React.createElement(Icon, {
72
+ icon: "ph--arrow-square-out--bold",
73
+ size: 3,
74
+ classNames: "inline-block leading-none mx-1"
75
+ }))))))));
76
+ });
77
+ PluginDetail.displayName = "PluginDetail";
78
+
79
+ // src/components/PluginList/PluginList.tsx
80
+ import React3 from "react";
81
+ import { List } from "@dxos/react-ui";
82
+
83
+ // src/components/PluginList/PluginItem.tsx
84
+ import React2, { useCallback } from "react";
85
+ import { Icon as Icon2, IconButton, Input as Input2, Link as Link2, ListItem, Tag, useTranslation as useTranslation2 } from "@dxos/react-ui";
86
+ import { mx as mx2 } from "@dxos/ui-theme";
87
+ import { getStyles as getStyles2 } from "@dxos/ui-theme";
88
+ var PluginItem = ({ plugin, enabled = [], onClick, onChange, hasSettings: hasSettingsProp, onSettings }) => {
89
+ const { t } = useTranslation2(meta.id);
90
+ const { id, name, description, tags, icon = "ph--circle--regular", iconHue = "neutral" } = plugin.meta;
91
+ const isEnabled = enabled.includes(id);
92
+ const inputId = `${id}-input`;
93
+ const labelId = `${id}-label`;
94
+ const descriptionId = `${id}-description`;
95
+ const handleClick = useCallback(() => onClick?.(id), [
96
+ id,
97
+ onClick
98
+ ]);
99
+ const handleChange = useCallback((event) => {
100
+ event.stopPropagation();
101
+ onChange?.(id, !isEnabled);
102
+ }, [
103
+ id,
104
+ isEnabled,
105
+ onChange
106
+ ]);
107
+ const hasSettings = hasSettingsProp?.(id) ?? false;
108
+ const handleSettings = useCallback(() => onSettings?.(id), [
109
+ id,
110
+ onSettings
111
+ ]);
112
+ const styles = getStyles2(iconHue);
113
+ const gridCols = "grid grid-cols-[5rem_1fr]";
114
+ const gridRows = "grid grid-rows-[40px_1fr_min-content_40px]";
115
+ return /* @__PURE__ */ React2.createElement(ListItem.Root, {
116
+ key: id,
117
+ labelId,
118
+ "data-testid": `pluginList.${id}`,
119
+ "aria-describedby": descriptionId,
120
+ classNames: mx2(gridCols, "h-[14rem] w-full gap-3 pe-2 bg-modal-surface rounded-md overflow-hidden")
121
+ }, /* @__PURE__ */ React2.createElement("div", {
122
+ className: mx2(gridRows, "justify-center rounded-l-md", styles.surface)
123
+ }, /* @__PURE__ */ React2.createElement(Icon2, {
124
+ classNames: mx2("row-start-2 cursor-pointer", styles.surfaceText),
125
+ icon,
126
+ size: 14,
127
+ onClick: handleClick
128
+ })), /* @__PURE__ */ React2.createElement("div", {
129
+ className: mx2(gridRows)
130
+ }, /* @__PURE__ */ React2.createElement("div", {
131
+ className: "flex items-center overflow-hidden cursor-pointer",
132
+ onClick: handleClick
133
+ }, /* @__PURE__ */ React2.createElement("span", {
134
+ className: "text-lg truncate"
135
+ }, name ?? id)), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("p", {
136
+ className: mx2("text-description", "line-clamp-4 min-w-0")
137
+ }, description)), /* @__PURE__ */ React2.createElement("div", {
138
+ className: "flex -ms-0.5 overflow-x-auto scrollbar-none"
139
+ }, tags?.map((tag) => /* @__PURE__ */ React2.createElement(Tag, {
140
+ key: tag,
141
+ palette: tagColors[tag],
142
+ classNames: "text-xs uppercase font-thin"
143
+ }, tag))), /* @__PURE__ */ React2.createElement("div", {
144
+ className: "flex gap-2 items-center text-sm"
145
+ }, /* @__PURE__ */ React2.createElement(IconButton, {
146
+ "aria-describedby": descriptionId,
147
+ classNames: "cursor-pointer",
148
+ icon: "ph--gear--regular",
149
+ label: t("settings label"),
150
+ iconOnly: true,
151
+ size: 4,
152
+ onClick: handleSettings,
153
+ disabled: !hasSettings
154
+ }), /* @__PURE__ */ React2.createElement(Link2, {
155
+ "aria-describedby": descriptionId,
156
+ classNames: "text-description cursor-pointer",
157
+ onClick: handleClick
158
+ }, t("details label")), /* @__PURE__ */ React2.createElement("div", {
159
+ className: "grow"
160
+ }), /* @__PURE__ */ React2.createElement("div", {
161
+ className: "pe-1"
162
+ }, /* @__PURE__ */ React2.createElement(Input2.Root, {
163
+ id: inputId
164
+ }, /* @__PURE__ */ React2.createElement(Input2.Switch, {
165
+ classNames: "self-center",
166
+ checked: isEnabled,
167
+ onClick: handleChange
168
+ }))))));
169
+ };
170
+ var tagColors = {
171
+ new: "rose",
172
+ beta: "teal",
173
+ labs: "blue",
174
+ popular: "green",
175
+ featured: "pink",
176
+ experimental: "amber"
177
+ };
178
+
179
+ // src/components/PluginList/PluginList.tsx
180
+ var PluginList = ({ plugins = [], ...props }) => {
181
+ return /* @__PURE__ */ React3.createElement(List, {
182
+ classNames: "grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] auto-rows-[max-content] gap-4 p-4"
183
+ }, plugins.map((plugin) => /* @__PURE__ */ React3.createElement(PluginItem, {
184
+ key: plugin.meta.id,
185
+ plugin,
186
+ ...props
187
+ })));
188
+ };
189
+
190
+ export {
191
+ PluginDetail,
192
+ PluginList
193
+ };
194
+ //# sourceMappingURL=chunk-576PZRDS.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/PluginDetail/PluginDetail.tsx", "../../../src/components/PluginList/PluginList.tsx", "../../../src/components/PluginList/PluginItem.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { Icon, Input, Link, ScrollArea, useTranslation } from '@dxos/react-ui';\nimport { composable, composableProps, getStyles, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\n\nexport type PluginDetailProps = {\n plugin: Plugin.Plugin;\n enabled?: boolean;\n onEnabledChange?: (enabled: boolean) => void;\n};\n\nexport const PluginDetail = composable<HTMLDivElement, PluginDetailProps>(\n ({ plugin, enabled, onEnabledChange, ...props }, forwardedRef) => {\n const { t } = useTranslation(meta.id);\n const {\n id,\n name,\n description,\n homePage,\n source,\n screenshots,\n icon = 'ph--circle--regular',\n iconHue = 'neutral',\n } = plugin.meta;\n const styles = getStyles(iconHue);\n\n return (\n <ScrollArea.Root {...composableProps(props)} orientation='vertical' ref={forwardedRef}>\n <ScrollArea.Viewport>\n <div role='none' className='dx-document grid grid-cols-[min-content_1fr] gap-4 p-4'>\n <div role='none'>\n <Icon classNames={mx('p-1 rounded-md', styles.fill, styles.surfaceText)} icon={icon} size={14} />\n </div>\n <div role='none' className='flex flex-col gap-6'>\n <div role='none' className='grid grid-cols-[1fr_min-content] gap-x-3 w-full pt-1'>\n <h2 className='text-xl'>{name}</h2>\n <Input.Root>\n <Input.Switch classNames='self-center' checked={enabled} onCheckedChange={onEnabledChange} />\n </Input.Root>\n <p className='pt-0.5 text-sm text-description'>{id}</p>\n </div>\n <div role='none'>\n <p className='text-description'>{description}</p>\n </div>\n {screenshots && screenshots.length > 0 && (\n <div role='none' className='flex flex-col gap-2'>\n <h2>Preview</h2>\n <img src={screenshots[0]} alt={name} className='aspect-video object-fit' />\n </div>\n )}\n <div role='none' className='flex flex-col gap-2'>\n <h2>Resources</h2>\n <div className='flex gap-2'>\n {homePage && (\n <Link href={homePage} target='_blank' rel='noreferrer' classNames='text-sm text-description'>\n {t('home page label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mx-1' />\n </Link>\n )}\n\n {source && (\n <Link href={source} target='_blank' rel='noreferrer' classNames='text-sm text-description'>\n {t('source label')}\n <Icon icon='ph--arrow-square-out--bold' size={3} classNames='inline-block leading-none mx-1' />\n </Link>\n )}\n </div>\n </div>\n </div>\n </div>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n },\n);\n\nPluginDetail.displayName = 'PluginDetail';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { List } from '@dxos/react-ui';\n\nimport { PluginItem, type PluginItemProps } from './PluginItem';\n\nexport type PluginListProps = Omit<PluginItemProps, 'plugin'> & {\n plugins?: readonly Plugin.Plugin[];\n};\n\nexport const PluginList = ({ plugins = [], ...props }: PluginListProps) => {\n return (\n <List classNames='grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] auto-rows-[max-content] gap-4 p-4'>\n {plugins.map((plugin) => (\n <PluginItem key={plugin.meta.id} plugin={plugin} {...props} />\n ))}\n </List>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { type MouseEvent, useCallback } from 'react';\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { type ChromaticPalette, Icon, IconButton, Input, Link, ListItem, Tag, useTranslation } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\nimport { getStyles } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { type RegistryTagType } from '../../types';\n\nexport type PluginItemProps = {\n plugin: Plugin.Plugin;\n installed?: readonly string[];\n enabled?: readonly string[];\n onClick?: (id: string) => void;\n onChange?: (id: string, enabled: boolean) => void;\n hasSettings?: (id: string) => boolean;\n onSettings?: (id: string) => void;\n};\n\nexport const PluginItem = ({\n plugin,\n enabled = [],\n onClick,\n onChange,\n hasSettings: hasSettingsProp,\n onSettings,\n}: PluginItemProps) => {\n const { t } = useTranslation(meta.id);\n const { id, name, description, tags, icon = 'ph--circle--regular', iconHue = 'neutral' } = plugin.meta;\n const isEnabled = enabled.includes(id);\n const inputId = `${id}-input`;\n const labelId = `${id}-label`;\n const descriptionId = `${id}-description`;\n const handleClick = useCallback(() => onClick?.(id), [id, onClick]);\n\n const handleChange = useCallback(\n (event: MouseEvent) => {\n event.stopPropagation();\n onChange?.(id, !isEnabled);\n },\n [id, isEnabled, onChange],\n );\n\n const hasSettings = hasSettingsProp?.(id) ?? false;\n const handleSettings = useCallback(() => onSettings?.(id), [id, onSettings]);\n const styles = getStyles(iconHue);\n const gridCols = 'grid grid-cols-[5rem_1fr]';\n const gridRows = 'grid grid-rows-[40px_1fr_min-content_40px]';\n\n return (\n <ListItem.Root\n key={id}\n labelId={labelId}\n data-testid={`pluginList.${id}`}\n aria-describedby={descriptionId}\n classNames={mx(gridCols, 'h-[14rem] w-full gap-3 pe-2 bg-modal-surface rounded-md overflow-hidden')}\n >\n <div className={mx(gridRows, 'justify-center rounded-l-md', styles.surface)}>\n <Icon\n classNames={mx('row-start-2 cursor-pointer', styles.surfaceText)}\n icon={icon}\n size={14}\n onClick={handleClick}\n />\n </div>\n\n <div className={mx(gridRows)}>\n <div className='flex items-center overflow-hidden cursor-pointer' onClick={handleClick}>\n <span className='text-lg truncate'>{name ?? id}</span>\n </div>\n\n <div>\n <p className={mx('text-description', 'line-clamp-4 min-w-0')}>{description}</p>\n </div>\n\n <div className='flex -ms-0.5 overflow-x-auto scrollbar-none'>\n {tags?.map((tag) => (\n <Tag key={tag} palette={tagColors[tag as RegistryTagType]} classNames='text-xs uppercase font-thin'>\n {tag}\n </Tag>\n ))}\n </div>\n\n <div className='flex gap-2 items-center text-sm'>\n <IconButton\n aria-describedby={descriptionId}\n classNames='cursor-pointer'\n icon='ph--gear--regular'\n label={t('settings label')}\n iconOnly\n size={4}\n onClick={handleSettings}\n disabled={!hasSettings}\n />\n\n <Link aria-describedby={descriptionId} classNames='text-description cursor-pointer' onClick={handleClick}>\n {t('details label')}\n </Link>\n\n <div className='grow' />\n <div className='pe-1'>\n <Input.Root id={inputId}>\n <Input.Switch classNames='self-center' checked={isEnabled} onClick={handleChange} />\n </Input.Root>\n </div>\n </div>\n </div>\n </ListItem.Root>\n );\n};\n\nconst tagColors: Record<RegistryTagType, ChromaticPalette> = {\n new: 'rose',\n beta: 'teal',\n labs: 'blue',\n popular: 'green',\n featured: 'pink',\n experimental: 'amber',\n};\n"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AMkC,IAAI,CAACC,QACV,gBAAAjB,OAAA,cAACkB,KAAAA;IAAIf,KAAKc;IAAKE,SAASC,UAAUH,GAAAA;IAAyBX,YAAW;KACnEW,GAAAA,CAAAA,CAAAA,GAKP,gBAAAjB,OAAA,cAACQ,OAAAA;IAAIC,WAAU;KACb,gBAAAT,OAAA,cAACqB,YAAAA;IACChB,oBAAkBhB;IAClBiB,YAAW;IACXvB,MAAK;IACLuC,OAAO9C,EAAE,gBAAA;IACT+C,UAAAA;IACAV,MAAM;IACN1C,SAASwB;IACT6B,UAAU,CAACnD;MAGb,gBAAA2B,OAAA,cAACyB,OAAAA;IAAKpB,oBAAkBhB;IAAeiB,YAAW;IAAkCnC,SAASmB;KAC1Fd,EAAE,eAAA,CAAA,GAGL,gBAAAwB,OAAA,cAACQ,OAAAA;IAAIC,WAAU;MACf,gBAAAT,OAAA,cAACQ,OAAAA;IAAIC,WAAU;KACb,gBAAAT,OAAA,cAAC0B,OAAMxB,MAAI;IAACvB,IAAIQ;KACd,gBAAAa,OAAA,cAAC0B,OAAMC,QAAM;IAACrB,YAAW;IAAcsB,SAAS3C;IAAWd,SAASqB;;AAOlF;AAEA,IAAM4B,YAAuD;EAC3DS,KAAK;EACLC,MAAM;EACNC,MAAM;EACNC,SAAS;EACTC,UAAU;EACVC,cAAc;AAChB;;;AD5GO,IAAMC,aAAa,CAAC,EAAEC,UAAU,CAAA,GAAI,GAAGC,MAAAA,MAAwB;AACpE,SACE,gBAAAC,OAAA,cAACC,MAAAA;IAAKC,YAAW;KACdJ,QAAQK,IAAI,CAACC,WACZ,gBAAAJ,OAAA,cAACK,YAAAA;IAAWC,KAAKF,OAAOG,KAAKC;IAAIJ;IAAiB,GAAGL;;AAI7D;",
6
+ "names": ["React", "Icon", "Input", "Link", "ScrollArea", "useTranslation", "composable", "composableProps", "getStyles", "mx", "PluginDetail", "composable", "plugin", "enabled", "onEnabledChange", "props", "forwardedRef", "t", "useTranslation", "meta", "id", "name", "description", "homePage", "source", "screenshots", "icon", "iconHue", "styles", "getStyles", "ScrollArea", "Root", "composableProps", "orientation", "ref", "Viewport", "div", "role", "className", "Icon", "classNames", "mx", "fill", "surfaceText", "size", "h2", "Input", "Switch", "checked", "onCheckedChange", "p", "length", "img", "src", "alt", "Link", "href", "target", "rel", "displayName", "React", "List", "React", "useCallback", "Icon", "IconButton", "Input", "Link", "ListItem", "Tag", "useTranslation", "mx", "getStyles", "PluginItem", "plugin", "enabled", "onClick", "onChange", "hasSettings", "hasSettingsProp", "onSettings", "t", "useTranslation", "meta", "id", "name", "description", "tags", "icon", "iconHue", "isEnabled", "includes", "inputId", "labelId", "descriptionId", "handleClick", "useCallback", "handleChange", "event", "stopPropagation", "handleSettings", "styles", "getStyles", "gridCols", "gridRows", "React", "ListItem", "Root", "key", "data-testid", "aria-describedby", "classNames", "mx", "div", "className", "surface", "Icon", "surfaceText", "size", "span", "p", "map", "tag", "Tag", "palette", "tagColors", "IconButton", "label", "iconOnly", "disabled", "Link", "Input", "Switch", "checked", "new", "beta", "labs", "popular", "featured", "experimental", "PluginList", "plugins", "props", "React", "List", "classNames", "map", "plugin", "PluginItem", "key", "meta", "id"]
7
+ }
@@ -0,0 +1,223 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ meta
4
+ } from "../chunk-44X3W2YY.mjs";
5
+
6
+ // src/cli/plugin.ts
7
+ import { Plugin as Plugin4 } from "@dxos/app-framework";
8
+ import { AppPlugin } from "@dxos/app-toolkit";
9
+
10
+ // src/cli/commands/index.ts
11
+ import * as Command4 from "@effect/cli/Command";
12
+
13
+ // src/cli/commands/disable.ts
14
+ import * as Args from "@effect/cli/Args";
15
+ import * as Command from "@effect/cli/Command";
16
+ import * as Console from "effect/Console";
17
+ import * as Effect2 from "effect/Effect";
18
+ import { Plugin } from "@dxos/app-framework";
19
+ import { CommandConfig } from "@dxos/cli-util";
20
+ import { invariant } from "@dxos/invariant";
21
+
22
+ // src/cli/storage.ts
23
+ import * as FileSystem from "@effect/platform/FileSystem";
24
+ import * as Path from "@effect/platform/Path";
25
+ import * as Effect from "effect/Effect";
26
+ import * as Schema from "effect/Schema";
27
+ import * as Yaml from "yaml";
28
+ import { DX_CONFIG } from "@dxos/client-protocol";
29
+ var PluginsSchema = Schema.Array(Schema.String);
30
+ var getPluginsConfigPath = (profile) => `${DX_CONFIG}/plugins/${profile}.yml`;
31
+ var loadEnabledPlugins = Effect.fn(function* ({ profile }) {
32
+ const fs = yield* FileSystem.FileSystem;
33
+ const pluginsPath = getPluginsConfigPath(profile);
34
+ const content = yield* fs.readFileString(pluginsPath).pipe(Effect.catchTag("SystemError", () => Effect.succeed("[]")));
35
+ const raw = Yaml.parse(content);
36
+ const parsed = yield* Schema.decodeUnknown(PluginsSchema)(raw ?? []).pipe(Effect.catchAll(() => Effect.succeed([])));
37
+ return parsed;
38
+ });
39
+ var saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }) {
40
+ const fs = yield* FileSystem.FileSystem;
41
+ const path = yield* Path.Path;
42
+ const pluginsPath = getPluginsConfigPath(profile);
43
+ yield* fs.makeDirectory(path.dirname(pluginsPath), {
44
+ recursive: true
45
+ });
46
+ const encoded = Yaml.stringify(enabled);
47
+ yield* fs.writeFileString(pluginsPath, encoded);
48
+ });
49
+
50
+ // src/cli/commands/disable.ts
51
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-registry/src/cli/commands/disable.ts";
52
+ var handler = Effect2.fn(function* ({ id }) {
53
+ const { json, profile } = yield* CommandConfig;
54
+ const manager = yield* Plugin.Service;
55
+ const plugins = manager.getPlugins();
56
+ const plugin2 = plugins.find((p) => p.meta.id === id);
57
+ invariant(plugin2, `Plugin not found: ${id}`, {
58
+ F: __dxlog_file,
59
+ L: 22,
60
+ S: this,
61
+ A: [
62
+ "plugin",
63
+ "`Plugin not found: ${id}`"
64
+ ]
65
+ });
66
+ const core = manager.getCore();
67
+ invariant(!core.includes(id), `Cannot disable core plugin: ${id}`, {
68
+ F: __dxlog_file,
69
+ L: 25,
70
+ S: this,
71
+ A: [
72
+ "!core.includes(id)",
73
+ "`Cannot disable core plugin: ${id}`"
74
+ ]
75
+ });
76
+ const disabled = yield* manager.disable(id);
77
+ invariant(disabled, `Failed to disable plugin: ${id}`, {
78
+ F: __dxlog_file,
79
+ L: 28,
80
+ S: this,
81
+ A: [
82
+ "disabled",
83
+ "`Failed to disable plugin: ${id}`"
84
+ ]
85
+ });
86
+ const enabledPlugins = manager.getEnabled();
87
+ yield* saveEnabledPlugins({
88
+ profile,
89
+ enabled: [
90
+ ...enabledPlugins
91
+ ]
92
+ });
93
+ if (json) {
94
+ yield* Console.log(JSON.stringify({
95
+ id,
96
+ enabled: false
97
+ }, null, 2));
98
+ } else {
99
+ yield* Console.log(`Plugin "${plugin2.meta.name ?? id}" disabled.`);
100
+ }
101
+ });
102
+ var disable = Command.make("disable", {
103
+ id: Args.text({
104
+ name: "id"
105
+ }).pipe(Args.withDescription("The ID of the plugin to disable."))
106
+ }, handler).pipe(Command.withDescription("Disable a plugin."));
107
+
108
+ // src/cli/commands/enable.ts
109
+ import * as Args2 from "@effect/cli/Args";
110
+ import * as Command2 from "@effect/cli/Command";
111
+ import * as Console2 from "effect/Console";
112
+ import * as Effect3 from "effect/Effect";
113
+ import { Plugin as Plugin2 } from "@dxos/app-framework";
114
+ import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
115
+ import { invariant as invariant2 } from "@dxos/invariant";
116
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-registry/src/cli/commands/enable.ts";
117
+ var handler2 = Effect3.fn(function* ({ id }) {
118
+ const { json, profile } = yield* CommandConfig2;
119
+ const manager = yield* Plugin2.Service;
120
+ const plugins = manager.getPlugins();
121
+ const plugin2 = plugins.find((p) => p.meta.id === id);
122
+ invariant2(plugin2, `Plugin not found: ${id}`, {
123
+ F: __dxlog_file2,
124
+ L: 22,
125
+ S: this,
126
+ A: [
127
+ "plugin",
128
+ "`Plugin not found: ${id}`"
129
+ ]
130
+ });
131
+ const enabled = yield* manager.enable(id);
132
+ invariant2(enabled, `Failed to enable plugin: ${id}`, {
133
+ F: __dxlog_file2,
134
+ L: 25,
135
+ S: this,
136
+ A: [
137
+ "enabled",
138
+ "`Failed to enable plugin: ${id}`"
139
+ ]
140
+ });
141
+ const enabledPlugins = manager.getEnabled();
142
+ yield* saveEnabledPlugins({
143
+ profile,
144
+ enabled: [
145
+ ...enabledPlugins
146
+ ]
147
+ });
148
+ if (json) {
149
+ yield* Console2.log(JSON.stringify({
150
+ id,
151
+ enabled: true
152
+ }, null, 2));
153
+ } else {
154
+ yield* Console2.log(`Plugin "${plugin2.meta.name ?? id}" enabled.`);
155
+ }
156
+ });
157
+ var enable = Command2.make("enable", {
158
+ id: Args2.text({
159
+ name: "id"
160
+ }).pipe(Args2.withDescription("The ID of the plugin to enable."))
161
+ }, handler2).pipe(Command2.withDescription("Enable a plugin."));
162
+
163
+ // src/cli/commands/list.ts
164
+ import * as Command3 from "@effect/cli/Command";
165
+ import * as Console3 from "effect/Console";
166
+ import * as Effect4 from "effect/Effect";
167
+ import { Plugin as Plugin3 } from "@dxos/app-framework";
168
+ import { CommandConfig as CommandConfig3, printList } from "@dxos/cli-util";
169
+
170
+ // src/cli/commands/util.ts
171
+ import { FormBuilder } from "@dxos/cli-util";
172
+ var printPlugin = (plugin2) => {
173
+ const status = plugin2.core ? "core" : plugin2.enabled ? "enabled" : "disabled";
174
+ return FormBuilder.make({
175
+ title: plugin2.name
176
+ }).pipe(FormBuilder.set("id", plugin2.id), FormBuilder.set("status", status), FormBuilder.build);
177
+ };
178
+
179
+ // src/cli/commands/list.ts
180
+ var handler3 = Effect4.fn(function* () {
181
+ const { json } = yield* CommandConfig3;
182
+ const manager = yield* Plugin3.Service;
183
+ const plugins = manager.getPlugins();
184
+ const enabled = manager.getEnabled();
185
+ const core = manager.getCore();
186
+ const formattedPlugins = plugins.map((plugin2) => {
187
+ const isEnabled = enabled.includes(plugin2.meta.id);
188
+ const isCore = core.includes(plugin2.meta.id);
189
+ return {
190
+ id: plugin2.meta.id,
191
+ name: plugin2.meta.name ?? plugin2.meta.id,
192
+ enabled: isEnabled,
193
+ core: isCore
194
+ };
195
+ });
196
+ if (json) {
197
+ yield* Console3.log(JSON.stringify(formattedPlugins, null, 2));
198
+ } else {
199
+ const formatted = formattedPlugins.map(printPlugin);
200
+ yield* Console3.log(printList(formatted));
201
+ }
202
+ });
203
+ var list = Command3.make("list", {}, handler3).pipe(Command3.withDescription("List all available plugins."));
204
+
205
+ // src/cli/commands/index.ts
206
+ var plugin = Command4.make("plugin").pipe(Command4.withDescription("Manage plugins."), Command4.withSubcommands([
207
+ enable,
208
+ disable,
209
+ list
210
+ ]));
211
+
212
+ // src/cli/plugin.ts
213
+ var RegistryPlugin = Plugin4.define(meta).pipe(AppPlugin.addCommandModule({
214
+ commands: [
215
+ plugin
216
+ ]
217
+ }), Plugin4.make);
218
+ export {
219
+ RegistryPlugin,
220
+ loadEnabledPlugins,
221
+ saveEnabledPlugins
222
+ };
223
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/plugin.ts", "../../../../src/cli/commands/index.ts", "../../../../src/cli/commands/disable.ts", "../../../../src/cli/storage.ts", "../../../../src/cli/commands/enable.ts", "../../../../src/cli/commands/list.ts", "../../../../src/cli/commands/util.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { meta } from '../meta';\n\nimport { plugin } from './commands';\n\nexport const RegistryPlugin = Plugin.define(meta).pipe(\n AppPlugin.addCommandModule({\n commands: [plugin],\n }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\n\nimport { disable } from './disable';\nimport { enable } from './enable';\nimport { list } from './list';\n\nexport const plugin: Command.Command<any, any, any, any> = Command.make('plugin').pipe(\n Command.withDescription('Manage plugins.'),\n Command.withSubcommands([enable, disable, list]),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Args from '@effect/cli/Args';\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { CommandConfig } from '@dxos/cli-util';\nimport { invariant } from '@dxos/invariant';\n\nimport { saveEnabledPlugins } from '../storage';\n\nexport const handler = Effect.fn(function* ({ id }: { id: string }) {\n const { json, profile } = yield* CommandConfig;\n const manager = yield* Plugin.Service;\n\n const plugins = manager.getPlugins();\n const plugin = plugins.find((p: Plugin.Plugin) => p.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n\n const core = manager.getCore();\n invariant(!core.includes(id), `Cannot disable core plugin: ${id}`);\n\n const disabled = yield* manager.disable(id);\n invariant(disabled, `Failed to disable plugin: ${id}`);\n\n // Save enabled plugins to storage\n const enabledPlugins = manager.getEnabled();\n yield* saveEnabledPlugins({ profile, enabled: [...enabledPlugins] });\n\n if (json) {\n yield* Console.log(JSON.stringify({ id, enabled: false }, null, 2));\n } else {\n yield* Console.log(`Plugin \"${plugin.meta.name ?? id}\" disabled.`);\n }\n});\n\nexport const disable = Command.make(\n 'disable',\n {\n id: Args.text({ name: 'id' }).pipe(Args.withDescription('The ID of the plugin to disable.')),\n },\n handler,\n).pipe(Command.withDescription('Disable a plugin.'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as FileSystem from '@effect/platform/FileSystem';\nimport * as Path from '@effect/platform/Path';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\nimport * as Yaml from 'yaml';\n\nimport { DX_CONFIG } from '@dxos/client-protocol';\n\n// TODO(wittjosiah): Factor out to app-framework?\n\nconst PluginsSchema = Schema.Array(Schema.String);\n\n/** CLI-only: path to plugins/<profile>.yml (sibling to profile/). */\nconst getPluginsConfigPath = (profile: string) => `${DX_CONFIG}/plugins/${profile}.yml`;\n\n/**\n * Load enabled plugins from plugins/<profile>.yml (sibling to profile/).\n * Returns the list of enabled plugin IDs, or an empty array if the file doesn't exist.\n */\nexport const loadEnabledPlugins = Effect.fn(function* ({ profile }: { profile: string }) {\n const fs = yield* FileSystem.FileSystem;\n const pluginsPath = getPluginsConfigPath(profile);\n\n const content = yield* fs\n .readFileString(pluginsPath)\n .pipe(Effect.catchTag('SystemError', () => Effect.succeed('[]')));\n\n const raw = Yaml.parse(content);\n const parsed = yield* Schema.decodeUnknown(PluginsSchema)(raw ?? []).pipe(\n Effect.catchAll(() => Effect.succeed([] as string[])),\n );\n\n return parsed;\n});\n\n/**\n * Save enabled plugins to plugins/<profile>.yml.\n */\nexport const saveEnabledPlugins = Effect.fn(function* ({ profile, enabled }: { profile: string; enabled: string[] }) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const pluginsPath = getPluginsConfigPath(profile);\n yield* fs.makeDirectory(path.dirname(pluginsPath), { recursive: true });\n const encoded = Yaml.stringify(enabled);\n yield* fs.writeFileString(pluginsPath, encoded);\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Args from '@effect/cli/Args';\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { CommandConfig } from '@dxos/cli-util';\nimport { invariant } from '@dxos/invariant';\n\nimport { saveEnabledPlugins } from '../storage';\n\nexport const handler = Effect.fn(function* ({ id }: { id: string }) {\n const { json, profile } = yield* CommandConfig;\n const manager = yield* Plugin.Service;\n\n const plugins = manager.getPlugins();\n const plugin = plugins.find((p: Plugin.Plugin) => p.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n\n const enabled = yield* manager.enable(id);\n invariant(enabled, `Failed to enable plugin: ${id}`);\n\n // Save enabled plugins to storage\n const enabledPlugins = manager.getEnabled();\n yield* saveEnabledPlugins({ profile, enabled: [...enabledPlugins] });\n\n if (json) {\n yield* Console.log(JSON.stringify({ id, enabled: true }, null, 2));\n } else {\n yield* Console.log(`Plugin \"${plugin.meta.name ?? id}\" enabled.`);\n }\n});\n\nexport const enable = Command.make(\n 'enable',\n {\n id: Args.text({ name: 'id' }).pipe(Args.withDescription('The ID of the plugin to enable.')),\n },\n handler,\n).pipe(Command.withDescription('Enable a plugin.'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Command from '@effect/cli/Command';\nimport * as Console from 'effect/Console';\nimport * as Effect from 'effect/Effect';\n\nimport { Plugin } from '@dxos/app-framework';\nimport { CommandConfig, printList } from '@dxos/cli-util';\n\nimport { type FormattedPlugin, printPlugin } from './util';\n\nexport const handler = Effect.fn(function* () {\n const { json } = yield* CommandConfig;\n const manager = yield* Plugin.Service;\n\n const plugins = manager.getPlugins();\n const enabled = manager.getEnabled();\n const core = manager.getCore();\n\n const formattedPlugins: FormattedPlugin[] = plugins.map((plugin: Plugin.Plugin) => {\n const isEnabled = enabled.includes(plugin.meta.id);\n const isCore = core.includes(plugin.meta.id);\n return {\n id: plugin.meta.id,\n name: plugin.meta.name ?? plugin.meta.id,\n enabled: isEnabled,\n core: isCore,\n };\n });\n\n if (json) {\n yield* Console.log(JSON.stringify(formattedPlugins, null, 2));\n } else {\n const formatted = formattedPlugins.map(printPlugin);\n yield* Console.log(printList(formatted));\n }\n});\n\nexport const list = Command.make('list', {}, handler).pipe(Command.withDescription('List all available plugins.'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FormBuilder } from '@dxos/cli-util';\n\nexport type FormattedPlugin = {\n id: string;\n name: string;\n enabled: boolean;\n core: boolean;\n};\n\n/**\n * Pretty prints a plugin with ANSI colors.\n */\nexport const printPlugin = (plugin: FormattedPlugin) => {\n const status = plugin.core ? 'core' : plugin.enabled ? 'enabled' : 'disabled';\n return FormBuilder.make({ title: plugin.name }).pipe(\n FormBuilder.set('id', plugin.id),\n FormBuilder.set('status', status),\n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AYO,KAAK;AAErB;;;ADVO,IAAMC,WAAiBC,WAAG,aAAA;AAC/B,QAAM,EAAEC,KAAI,IAAK,OAAOC;AACxB,QAAMC,UAAU,OAAOC,QAAOC;AAE9B,QAAMC,UAAUH,QAAQI,WAAU;AAClC,QAAMC,UAAUL,QAAQM,WAAU;AAClC,QAAMC,OAAOP,QAAQQ,QAAO;AAE5B,QAAMC,mBAAsCN,QAAQO,IAAI,CAACC,YAAAA;AACvD,UAAMC,YAAYP,QAAQQ,SAASF,QAAOG,KAAKC,EAAE;AACjD,UAAMC,SAAST,KAAKM,SAASF,QAAOG,KAAKC,EAAE;AAC3C,WAAO;MACLA,IAAIJ,QAAOG,KAAKC;MAChBE,MAAMN,QAAOG,KAAKG,QAAQN,QAAOG,KAAKC;MACtCV,SAASO;MACTL,MAAMS;IACR;EACF,CAAA;AAEA,MAAIlB,MAAM;AACR,WAAeoB,aAAIC,KAAKC,UAAUX,kBAAkB,MAAM,CAAA,CAAA;EAC5D,OAAO;AACL,UAAMY,YAAYZ,iBAAiBC,IAAIY,WAAAA;AACvC,WAAeJ,aAAIK,UAAUF,SAAAA,CAAAA;EAC/B;AACF,CAAA;AAEO,IAAMG,OAAeC,cAAK,QAAQ,CAAC,GAAG7B,QAAAA,EAAS8B,KAAaC,yBAAgB,6BAAA,CAAA;;;AJ9B5E,IAAMC,SAAsDC,cAAK,QAAA,EAAUC,KACxEC,yBAAgB,iBAAA,GAChBC,yBAAgB;EAACC;EAAQC;EAASC;CAAK,CAAA;;;ADD1C,IAAMC,iBAAiBC,QAAOC,OAAOC,IAAAA,EAAMC,KAChDC,UAAUC,iBAAiB;EACzBC,UAAU;IAACC;;AACb,CAAA,GACAP,QAAOQ,IAAI;",
6
+ "names": ["Plugin", "AppPlugin", "Command", "Args", "Command", "Console", "Effect", "Plugin", "CommandConfig", "invariant", "FileSystem", "Path", "Effect", "Schema", "Yaml", "DX_CONFIG", "PluginsSchema", "Array", "String", "getPluginsConfigPath", "profile", "DX_CONFIG", "loadEnabledPlugins", "fn", "fs", "FileSystem", "pluginsPath", "content", "readFileString", "pipe", "catchTag", "succeed", "raw", "parse", "parsed", "decodeUnknown", "catchAll", "saveEnabledPlugins", "enabled", "path", "Path", "makeDirectory", "dirname", "recursive", "encoded", "stringify", "writeFileString", "handler", "fn", "id", "json", "profile", "CommandConfig", "manager", "Plugin", "Service", "plugins", "getPlugins", "plugin", "find", "p", "meta", "invariant", "core", "getCore", "includes", "disabled", "disable", "enabledPlugins", "getEnabled", "saveEnabledPlugins", "enabled", "log", "JSON", "stringify", "name", "make", "text", "pipe", "withDescription", "Args", "Command", "Console", "Effect", "Plugin", "CommandConfig", "invariant", "handler", "fn", "id", "json", "profile", "CommandConfig", "manager", "Plugin", "Service", "plugins", "getPlugins", "plugin", "find", "p", "meta", "invariant", "enabled", "enable", "enabledPlugins", "getEnabled", "saveEnabledPlugins", "log", "JSON", "stringify", "name", "make", "text", "pipe", "withDescription", "Command", "Console", "Effect", "Plugin", "CommandConfig", "printList", "FormBuilder", "printPlugin", "plugin", "status", "core", "enabled", "FormBuilder", "make", "title", "name", "pipe", "set", "id", "build", "handler", "fn", "json", "CommandConfig", "manager", "Plugin", "Service", "plugins", "getPlugins", "enabled", "getEnabled", "core", "getCore", "formattedPlugins", "map", "plugin", "isEnabled", "includes", "meta", "id", "isCore", "name", "log", "JSON", "stringify", "formatted", "printPlugin", "printList", "list", "make", "pipe", "withDescription", "plugin", "make", "pipe", "withDescription", "withSubcommands", "enable", "disable", "list", "RegistryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addCommandModule", "commands", "plugin", "make"]
7
+ }
@@ -0,0 +1,68 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ REGISTRY_ID,
4
+ REGISTRY_KEY,
5
+ getPluginPath,
6
+ meta,
7
+ registryCategoryId
8
+ } from "./chunk-44X3W2YY.mjs";
9
+
10
+ // src/RegistryPlugin.tsx
11
+ import { Plugin } from "@dxos/app-framework";
12
+ import { AppPlugin } from "@dxos/app-toolkit";
13
+
14
+ // src/capabilities/app-graph-builder/index.ts
15
+ import { Capability } from "@dxos/app-framework";
16
+ var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./app-graph-builder-FSZAEWLX.mjs"));
17
+
18
+ // src/capabilities/operation-handler/index.ts
19
+ import { Capability as Capability2 } from "@dxos/app-framework";
20
+ var OperationHandler = Capability2.lazy("OperationHandler", () => import("./operation-handler-FQX7TJYA.mjs"));
21
+
22
+ // src/capabilities/react-surface/index.ts
23
+ import { Capability as Capability3 } from "@dxos/app-framework";
24
+ var ReactSurface = Capability3.lazy("ReactSurface", () => import("./react-surface-FUOA7DZ3.mjs"));
25
+
26
+ // src/translations.ts
27
+ var translations = [
28
+ {
29
+ "en-US": {
30
+ [meta.id]: {
31
+ "plugin name": "Registry",
32
+ "details label": "Details",
33
+ "home page label": "Website",
34
+ "source label": "Source",
35
+ "plugin registry label": "Plugin Registry",
36
+ "all plugins label": "All",
37
+ "installed plugins label": "Enabled",
38
+ "recommended plugins label": "Recommended",
39
+ "labs plugins label": "Labs",
40
+ "community plugins label": "Community",
41
+ "load by url label": "Load by URL (soon)",
42
+ "coming soon label": "Coming soon!",
43
+ "open plugin registry label": "Open plugin registry",
44
+ "settings label": "Settings"
45
+ }
46
+ }
47
+ }
48
+ ];
49
+
50
+ // src/RegistryPlugin.tsx
51
+ var RegistryPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
52
+ activate: AppGraphBuilder
53
+ }), AppPlugin.addOperationHandlerModule({
54
+ activate: OperationHandler
55
+ }), AppPlugin.addSurfaceModule({
56
+ activate: ReactSurface
57
+ }), AppPlugin.addTranslationsModule({
58
+ translations
59
+ }), Plugin.make);
60
+ export {
61
+ REGISTRY_ID,
62
+ REGISTRY_KEY,
63
+ RegistryPlugin,
64
+ getPluginPath,
65
+ meta,
66
+ registryCategoryId
67
+ };
68
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/RegistryPlugin.tsx", "../../../src/capabilities/app-graph-builder/index.ts", "../../../src/capabilities/operation-handler/index.ts", "../../../src/capabilities/react-surface/index.ts", "../../../src/translations.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { AppGraphBuilder, OperationHandler, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const RegistryPlugin = Plugin.define(meta).pipe(\n AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/operation';\n\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Registry',\n 'details label': 'Details',\n 'home page label': 'Website',\n 'source label': 'Source',\n 'plugin registry label': 'Plugin Registry',\n 'all plugins label': 'All',\n 'installed plugins label': 'Enabled',\n 'recommended plugins label': 'Recommended',\n 'labs plugins label': 'Labs',\n 'community plugins label': 'Community',\n 'load by url label': 'Load by URL (soon)',\n 'coming soon label': 'Coming soon!',\n 'open plugin registry label': 'Open plugin registry',\n 'settings label': 'Settings',\n },\n },\n },\n] as const satisfies Resource[];\n"],
5
+ "mappings": ";;;;;;;;;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;;;ACD1B,SAASC,kBAAkB;AAEpB,IAAMC,kBAAkBC,WAAWC,KAAK,mBAAmB,MAAM,OAAO,kCAAA,CAAA;;;ACF/E,SAASC,cAAAA,mBAAkB;AAGpB,IAAMC,mBAAmBC,YAAWC,KACzC,oBACA,MAAM,OAAO,kCAAA,CAAA;;;ACLf,SAASC,cAAAA,mBAAkB;AAEpB,IAAMC,eAAeC,YAAWC,KAAK,gBAAgB,MAAM,OAAO,8BAAA,CAAA;;;ACElE,IAAMC,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,iBAAiB;QACjB,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,qBAAqB;QACrB,2BAA2B;QAC3B,6BAA6B;QAC7B,sBAAsB;QACtB,2BAA2B;QAC3B,qBAAqB;QACrB,qBAAqB;QACrB,8BAA8B;QAC9B,kBAAkB;MACpB;IACF;EACF;;;;AJjBK,IAAMC,iBAAiBC,OAAOC,OAAOC,IAAAA,EAAMC,KAChDC,UAAUC,kBAAkB;EAAEC,UAAUC;AAAgB,CAAA,GACxDH,UAAUI,0BAA0B;EAAEF,UAAUG;AAAiB,CAAA,GACjEL,UAAUM,iBAAiB;EAAEJ,UAAUK;AAAa,CAAA,GACpDP,UAAUQ,sBAAsB;EAAEC;AAAa,CAAA,GAC/Cb,OAAOc,IAAI;",
6
+ "names": ["Plugin", "AppPlugin", "Capability", "AppGraphBuilder", "Capability", "lazy", "Capability", "OperationHandler", "Capability", "lazy", "Capability", "ReactSurface", "Capability", "lazy", "translations", "meta", "id", "RegistryPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addAppGraphModule", "activate", "AppGraphBuilder", "addOperationHandlerModule", "OperationHandler", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "make"]
7
+ }