@dxos/app-framework 0.8.1 → 0.8.2-main.2f9c567

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 (283) hide show
  1. package/dist/lib/browser/{app-graph-builder-576BHZC7.mjs → app-graph-builder-FB4NWT25.mjs} +3 -3
  2. package/dist/lib/browser/{chunk-PPIBZ5N4.mjs → chunk-A7XUUTJN.mjs} +4 -4
  3. package/dist/lib/browser/chunk-A7XUUTJN.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-SFPT4Z2C.mjs → chunk-KPRHX73H.mjs} +9 -9
  5. package/dist/lib/browser/chunk-KPRHX73H.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-6AVTZPMT.mjs → chunk-M6UBP7YP.mjs} +204 -173
  7. package/dist/lib/browser/chunk-M6UBP7YP.mjs.map +7 -0
  8. package/dist/lib/browser/index.mjs +8 -6
  9. package/dist/lib/browser/index.mjs.map +1 -1
  10. package/dist/lib/browser/{intent-dispatcher-3Q67MHZZ.mjs → intent-dispatcher-SICNXT2G.mjs} +2 -2
  11. package/dist/lib/browser/{intent-resolver-O763LCLG.mjs → intent-resolver-2K6LNSUE.mjs} +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/{store-URSN7DZI.mjs → store-P4XZF26P.mjs} +2 -2
  14. package/dist/lib/browser/testing/index.mjs +2 -2
  15. package/dist/lib/browser/worker.mjs +3 -1
  16. package/dist/lib/node/{app-graph-builder-JZCSKYPY.cjs → app-graph-builder-5QJ6YDE7.cjs} +28 -28
  17. package/dist/lib/node/{chunk-JUSEAFDU.cjs → chunk-JQMNABMK.cjs} +4 -4
  18. package/dist/lib/node/chunk-JQMNABMK.cjs.map +7 -0
  19. package/dist/lib/node/{chunk-YIFTVCOR.cjs → chunk-LPUJODXZ.cjs} +180 -150
  20. package/dist/lib/node/chunk-LPUJODXZ.cjs.map +7 -0
  21. package/dist/lib/node/{chunk-YNTKVTVX.cjs → chunk-MTROSTO7.cjs} +20 -20
  22. package/dist/lib/node/{chunk-YNTKVTVX.cjs.map → chunk-MTROSTO7.cjs.map} +3 -3
  23. package/dist/lib/node/index.cjs +80 -78
  24. package/dist/lib/node/index.cjs.map +1 -1
  25. package/dist/lib/node/{intent-dispatcher-H334XLFD.cjs → intent-dispatcher-XXFKXEHF.cjs} +8 -8
  26. package/dist/lib/node/{intent-dispatcher-H334XLFD.cjs.map → intent-dispatcher-XXFKXEHF.cjs.map} +2 -2
  27. package/dist/lib/node/{intent-resolver-3F4POWAM.cjs → intent-resolver-ZP6S7QKG.cjs} +12 -12
  28. package/dist/lib/node/meta.json +1 -1
  29. package/dist/lib/node/{store-OFDHTDCB.cjs → store-MALHSPHZ.cjs} +7 -7
  30. package/dist/lib/node/testing/index.cjs +8 -8
  31. package/dist/lib/node/worker.cjs +39 -37
  32. package/dist/lib/node/worker.cjs.map +2 -2
  33. package/dist/lib/node-esm/{app-graph-builder-VYKLSMSZ.mjs → app-graph-builder-2KB5VMTB.mjs} +3 -3
  34. package/dist/lib/node-esm/{chunk-PHOUQACM.mjs → chunk-JUJF5L4G.mjs} +9 -9
  35. package/dist/lib/node-esm/chunk-JUJF5L4G.mjs.map +7 -0
  36. package/dist/lib/node-esm/{chunk-R6A7Z4LU.mjs → chunk-MX6ITPIG.mjs} +4 -4
  37. package/dist/lib/{browser/chunk-PPIBZ5N4.mjs.map → node-esm/chunk-MX6ITPIG.mjs.map} +3 -3
  38. package/dist/lib/node-esm/{chunk-AHKIPS2L.mjs → chunk-OZD32CQN.mjs} +204 -173
  39. package/dist/lib/node-esm/chunk-OZD32CQN.mjs.map +7 -0
  40. package/dist/lib/node-esm/index.mjs +8 -6
  41. package/dist/lib/node-esm/index.mjs.map +1 -1
  42. package/dist/lib/node-esm/{intent-dispatcher-YDE2ONZA.mjs → intent-dispatcher-FF5HNHPQ.mjs} +2 -2
  43. package/dist/lib/node-esm/{intent-resolver-LAGJ7LXM.mjs → intent-resolver-QWIKXIGI.mjs} +3 -3
  44. package/dist/lib/node-esm/meta.json +1 -1
  45. package/dist/lib/node-esm/{store-EYSUVNCS.mjs → store-3NM6AWB4.mjs} +2 -2
  46. package/dist/lib/node-esm/testing/index.mjs +2 -2
  47. package/dist/lib/node-esm/worker.mjs +3 -1
  48. package/dist/types/src/common/capabilities.d.ts +2 -2
  49. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  50. package/dist/types/src/common/collaboration.d.ts +19 -0
  51. package/dist/types/src/common/collaboration.d.ts.map +1 -0
  52. package/dist/types/src/common/file.d.ts +7 -7
  53. package/dist/types/src/common/file.d.ts.map +1 -1
  54. package/dist/types/src/common/index.d.ts +1 -0
  55. package/dist/types/src/common/index.d.ts.map +1 -1
  56. package/dist/types/src/common/layout.d.ts +164 -158
  57. package/dist/types/src/common/layout.d.ts.map +1 -1
  58. package/dist/types/src/common/translations.d.ts +7 -7
  59. package/dist/types/src/common/translations.d.ts.map +1 -1
  60. package/dist/types/src/core/capabilities.d.ts +5 -2
  61. package/dist/types/src/core/capabilities.d.ts.map +1 -1
  62. package/dist/types/src/core/events.d.ts +4 -1
  63. package/dist/types/src/core/events.d.ts.map +1 -1
  64. package/dist/types/src/core/manager.d.ts +8 -8
  65. package/dist/types/src/core/manager.d.ts.map +1 -1
  66. package/dist/types/src/core/plugin.d.ts +2 -1
  67. package/dist/types/src/core/plugin.d.ts.map +1 -1
  68. package/dist/types/src/playground/logger/schema.d.ts +6 -6
  69. package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
  70. package/dist/types/src/plugin-intent/actions.d.ts +14 -14
  71. package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
  72. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +27 -1
  73. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
  74. package/dist/types/src/plugin-intent/intent.d.ts +12 -12
  75. package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
  76. package/dist/types/src/plugin-settings/actions.d.ts +10 -10
  77. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  78. package/package.json +23 -19
  79. package/project.json +2 -1
  80. package/src/App.tsx +2 -2
  81. package/src/common/capabilities.ts +2 -2
  82. package/src/common/collaboration.ts +22 -0
  83. package/src/common/file.ts +7 -7
  84. package/src/common/index.ts +1 -0
  85. package/src/common/layout.ts +159 -128
  86. package/src/common/translations.ts +7 -7
  87. package/src/core/capabilities.ts +9 -5
  88. package/src/core/events.ts +4 -1
  89. package/src/core/manager.test.ts +3 -3
  90. package/src/core/manager.ts +10 -10
  91. package/src/core/plugin.ts +2 -1
  92. package/src/playground/generator/generator.ts +4 -4
  93. package/src/playground/logger/schema.ts +5 -5
  94. package/src/plugin-intent/actions.ts +9 -9
  95. package/src/plugin-intent/intent-dispatcher.test.ts +23 -23
  96. package/src/plugin-intent/intent-dispatcher.ts +18 -2
  97. package/src/plugin-intent/intent.ts +20 -11
  98. package/src/plugin-settings/actions.ts +8 -8
  99. package/typedoc/.nojekyll +1 -0
  100. package/typedoc/assets/hierarchy.js +1 -0
  101. package/typedoc/assets/highlight.css +106 -0
  102. package/typedoc/assets/icons.js +18 -0
  103. package/typedoc/assets/icons.svg +1 -0
  104. package/typedoc/assets/main.js +60 -0
  105. package/typedoc/assets/navigation.js +1 -0
  106. package/typedoc/assets/search.js +1 -0
  107. package/typedoc/assets/style.css +1640 -0
  108. package/typedoc/classes/CollaborationActions.InsertContent.html +460 -0
  109. package/typedoc/classes/ErrorBoundary.html +125 -0
  110. package/typedoc/classes/IntentAction.ShowUndo.html +227 -0
  111. package/typedoc/classes/IntentAction.Track.html +266 -0
  112. package/typedoc/classes/LayoutAction.AddToast.html +265 -0
  113. package/typedoc/classes/LayoutAction.Close.html +382 -0
  114. package/typedoc/classes/LayoutAction.Expose.html +265 -0
  115. package/typedoc/classes/LayoutAction.Open.html +1123 -0
  116. package/typedoc/classes/LayoutAction.RevertWorkspace.html +343 -0
  117. package/typedoc/classes/LayoutAction.ScrollIntoView.html +460 -0
  118. package/typedoc/classes/LayoutAction.Set.html +460 -0
  119. package/typedoc/classes/LayoutAction.SetLayoutMode.html +499 -0
  120. package/typedoc/classes/LayoutAction.SwitchWorkspace.html +265 -0
  121. package/typedoc/classes/LayoutAction.UpdateComplementary.html +616 -0
  122. package/typedoc/classes/LayoutAction.UpdateDialog.html +811 -0
  123. package/typedoc/classes/LayoutAction.UpdateLayout.html +461 -0
  124. package/typedoc/classes/LayoutAction.UpdatePopover.html +1435 -0
  125. package/typedoc/classes/LayoutAction.UpdateSidebar.html +616 -0
  126. package/typedoc/classes/Plugin.html +6 -0
  127. package/typedoc/classes/PluginManager.html +42 -0
  128. package/typedoc/classes/PluginModule.html +18 -0
  129. package/typedoc/classes/PluginsContext.html +25 -0
  130. package/typedoc/classes/SettingsAction.Open.html +226 -0
  131. package/typedoc/classes/SettingsAction.OpenPluginRegistry.html +265 -0
  132. package/typedoc/functions/Events.createStateEvent.html +2 -0
  133. package/typedoc/functions/IntentPlugin.html +1 -0
  134. package/typedoc/functions/SettingsPlugin.html +1 -0
  135. package/typedoc/functions/allOf.html +2 -0
  136. package/typedoc/functions/chain.html +3 -0
  137. package/typedoc/functions/contributes.html +2 -0
  138. package/typedoc/functions/createApp.html +6 -0
  139. package/typedoc/functions/createDispatcher.html +3 -0
  140. package/typedoc/functions/createIntent.html +6 -0
  141. package/typedoc/functions/createResolver.html +2 -0
  142. package/typedoc/functions/createSurface.html +2 -0
  143. package/typedoc/functions/defineCapability.html +2 -0
  144. package/typedoc/functions/defineEvent.html +2 -0
  145. package/typedoc/functions/defineModule.html +2 -0
  146. package/typedoc/functions/definePlugin.html +2 -0
  147. package/typedoc/functions/eventKey.html +2 -0
  148. package/typedoc/functions/getEvents.html +2 -0
  149. package/typedoc/functions/isAllOf.html +2 -0
  150. package/typedoc/functions/isOneOf.html +2 -0
  151. package/typedoc/functions/isSurfaceAvailable.html +2 -0
  152. package/typedoc/functions/lazy.html +2 -0
  153. package/typedoc/functions/oneOf.html +2 -0
  154. package/typedoc/functions/useAppGraph.html +1 -0
  155. package/typedoc/functions/useCapabilities.html +3 -0
  156. package/typedoc/functions/useCapability.html +4 -0
  157. package/typedoc/functions/useIntentDispatcher.html +1 -0
  158. package/typedoc/functions/useIntentResolver.html +1 -0
  159. package/typedoc/functions/useLayout.html +1 -0
  160. package/typedoc/functions/usePluginManager.html +2 -0
  161. package/typedoc/hierarchy.html +1 -0
  162. package/typedoc/index.html +16 -0
  163. package/typedoc/interfaces/LayoutAction.Toast.html +10 -0
  164. package/typedoc/media/LICENSE +8 -0
  165. package/typedoc/modules/Capabilities.html +1 -0
  166. package/typedoc/modules/CollaborationActions.html +1 -0
  167. package/typedoc/modules/Events.html +1 -0
  168. package/typedoc/modules/IntentAction.html +1 -0
  169. package/typedoc/modules/LayoutAction.html +2 -0
  170. package/typedoc/modules/SettingsAction.html +1 -0
  171. package/typedoc/modules.html +1 -0
  172. package/typedoc/types/ActivationEvent.html +8 -0
  173. package/typedoc/types/ActivationEvents.html +2 -0
  174. package/typedoc/types/AnyCapability.html +1 -0
  175. package/typedoc/types/AnyIntent.html +1 -0
  176. package/typedoc/types/AnyIntentChain.html +1 -0
  177. package/typedoc/types/AnyIntentEffectResult.html +1 -0
  178. package/typedoc/types/AnyIntentResolver.html +1 -0
  179. package/typedoc/types/AnyIntentResult.html +1 -0
  180. package/typedoc/types/Capabilities.FileUploader.html +1 -0
  181. package/typedoc/types/Capabilities.IntentResolver.html +1 -0
  182. package/typedoc/types/Capabilities.Layout.html +1 -0
  183. package/typedoc/types/Capabilities.Metadata.html +1 -0
  184. package/typedoc/types/Capabilities.ReactContext.html +1 -0
  185. package/typedoc/types/Capabilities.ReactRoot.html +1 -0
  186. package/typedoc/types/Capabilities.ReactSurface.html +1 -0
  187. package/typedoc/types/Capabilities.Settings.html +4 -0
  188. package/typedoc/types/Capability.html +9 -0
  189. package/typedoc/types/CreateAppOptions.html +9 -0
  190. package/typedoc/types/FileInfo.html +1 -0
  191. package/typedoc/types/Intent.html +14 -0
  192. package/typedoc/types/IntentChain.html +6 -0
  193. package/typedoc/types/IntentContext.html +5 -0
  194. package/typedoc/types/IntentData.html +1 -0
  195. package/typedoc/types/IntentDispatcher.html +2 -0
  196. package/typedoc/types/IntentDispatcherResult.html +2 -0
  197. package/typedoc/types/IntentEffectDefinition.html +2 -0
  198. package/typedoc/types/IntentEffectResult.html +15 -0
  199. package/typedoc/types/IntentParams.html +3 -0
  200. package/typedoc/types/IntentResolver.html +2 -0
  201. package/typedoc/types/IntentResultData.html +1 -0
  202. package/typedoc/types/IntentSchema.html +1 -0
  203. package/typedoc/types/IntentUndo.html +2 -0
  204. package/typedoc/types/InterfaceDef.html +4 -0
  205. package/typedoc/types/Label.html +1 -0
  206. package/typedoc/types/NodeSerializer.html +8 -0
  207. package/typedoc/types/PluginManagerOptions.html +5 -0
  208. package/typedoc/types/PluginMeta.html +21 -0
  209. package/typedoc/types/PromiseIntentDispatcher.html +2 -0
  210. package/typedoc/types/PromiseIntentUndo.html +2 -0
  211. package/typedoc/types/Resource.html +1 -0
  212. package/typedoc/types/ResourceKey.html +1 -0
  213. package/typedoc/types/ResourceLanguage.html +1 -0
  214. package/typedoc/types/SerializedNode.html +4 -0
  215. package/typedoc/types/SurfaceComponent.html +2 -0
  216. package/typedoc/types/SurfaceDefinition.html +2 -0
  217. package/typedoc/types/SurfaceProps.html +4 -0
  218. package/typedoc/variables/Capabilities.AppGraph.html +1 -0
  219. package/typedoc/variables/Capabilities.AppGraphBuilder.html +1 -0
  220. package/typedoc/variables/Capabilities.AppGraphSerializer.html +1 -0
  221. package/typedoc/variables/Capabilities.ArtifactDefinition.html +1 -0
  222. package/typedoc/variables/Capabilities.FileUploader.html +1 -0
  223. package/typedoc/variables/Capabilities.IntentDispatcher.html +1 -0
  224. package/typedoc/variables/Capabilities.IntentResolver.html +1 -0
  225. package/typedoc/variables/Capabilities.Layout.html +1 -0
  226. package/typedoc/variables/Capabilities.Metadata.html +1 -0
  227. package/typedoc/variables/Capabilities.Null.html +1 -0
  228. package/typedoc/variables/Capabilities.PluginManager.html +1 -0
  229. package/typedoc/variables/Capabilities.ReactContext.html +1 -0
  230. package/typedoc/variables/Capabilities.ReactRoot.html +1 -0
  231. package/typedoc/variables/Capabilities.ReactSurface.html +1 -0
  232. package/typedoc/variables/Capabilities.Settings.html +1 -0
  233. package/typedoc/variables/Capabilities.SettingsStore.html +1 -0
  234. package/typedoc/variables/Capabilities.Tools.html +1 -0
  235. package/typedoc/variables/Capabilities.Translations.html +1 -0
  236. package/typedoc/variables/Events.AppGraphReady.html +2 -0
  237. package/typedoc/variables/Events.DispatcherReady.html +2 -0
  238. package/typedoc/variables/Events.LayoutReady.html +1 -0
  239. package/typedoc/variables/Events.SettingsReady.html +2 -0
  240. package/typedoc/variables/Events.SetupAppGraph.html +2 -0
  241. package/typedoc/variables/Events.SetupArtifactDefinition.html +2 -0
  242. package/typedoc/variables/Events.SetupIntentResolver.html +2 -0
  243. package/typedoc/variables/Events.SetupMetadata.html +2 -0
  244. package/typedoc/variables/Events.SetupReactSurface.html +2 -0
  245. package/typedoc/variables/Events.SetupSettings.html +2 -0
  246. package/typedoc/variables/Events.SetupTranslations.html +2 -0
  247. package/typedoc/variables/Events.Startup.html +2 -0
  248. package/typedoc/variables/FileInfoSchema.html +1 -0
  249. package/typedoc/variables/INTENT_ACTION.html +1 -0
  250. package/typedoc/variables/INTENT_PLUGIN.html +1 -0
  251. package/typedoc/variables/LAYOUT_ACTION.html +1 -0
  252. package/typedoc/variables/LAYOUT_PLUGIN.html +1 -0
  253. package/typedoc/variables/Label.html +1 -0
  254. package/typedoc/variables/LayoutAction.Toast.html +1 -0
  255. package/typedoc/variables/LayoutAction.UPDATE_LAYOUT.html +1 -0
  256. package/typedoc/variables/PluginManagerProvider.html +2 -0
  257. package/typedoc/variables/Resource.html +2 -0
  258. package/typedoc/variables/ResourceKey.html +1 -0
  259. package/typedoc/variables/ResourceLanguage.html +1 -0
  260. package/typedoc/variables/SETTINGS_ACTION.html +1 -0
  261. package/typedoc/variables/SETTINGS_ID.html +1 -0
  262. package/typedoc/variables/SETTINGS_KEY.html +1 -0
  263. package/typedoc/variables/SETTINGS_PLUGIN.html +1 -0
  264. package/typedoc/variables/Surface.html +2 -0
  265. package/typedoc/variables/defaultFileTypes.html +1 -0
  266. package/dist/lib/browser/chunk-6AVTZPMT.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-SFPT4Z2C.mjs.map +0 -7
  268. package/dist/lib/node/chunk-JUSEAFDU.cjs.map +0 -7
  269. package/dist/lib/node/chunk-YIFTVCOR.cjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-AHKIPS2L.mjs.map +0 -7
  271. package/dist/lib/node-esm/chunk-PHOUQACM.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-R6A7Z4LU.mjs.map +0 -7
  273. /package/dist/lib/browser/{app-graph-builder-576BHZC7.mjs.map → app-graph-builder-FB4NWT25.mjs.map} +0 -0
  274. /package/dist/lib/browser/{intent-dispatcher-3Q67MHZZ.mjs.map → intent-dispatcher-SICNXT2G.mjs.map} +0 -0
  275. /package/dist/lib/browser/{intent-resolver-O763LCLG.mjs.map → intent-resolver-2K6LNSUE.mjs.map} +0 -0
  276. /package/dist/lib/browser/{store-URSN7DZI.mjs.map → store-P4XZF26P.mjs.map} +0 -0
  277. /package/dist/lib/node/{app-graph-builder-JZCSKYPY.cjs.map → app-graph-builder-5QJ6YDE7.cjs.map} +0 -0
  278. /package/dist/lib/node/{intent-resolver-3F4POWAM.cjs.map → intent-resolver-ZP6S7QKG.cjs.map} +0 -0
  279. /package/dist/lib/node/{store-OFDHTDCB.cjs.map → store-MALHSPHZ.cjs.map} +0 -0
  280. /package/dist/lib/node-esm/{app-graph-builder-VYKLSMSZ.mjs.map → app-graph-builder-2KB5VMTB.mjs.map} +0 -0
  281. /package/dist/lib/node-esm/{intent-dispatcher-YDE2ONZA.mjs.map → intent-dispatcher-FF5HNHPQ.mjs.map} +0 -0
  282. /package/dist/lib/node-esm/{intent-resolver-LAGJ7LXM.mjs.map → intent-resolver-QWIKXIGI.mjs.map} +0 -0
  283. /package/dist/lib/node-esm/{store-EYSUVNCS.mjs.map → store-3NM6AWB4.mjs.map} +0 -0
@@ -3,12 +3,12 @@ import {
3
3
  SETTINGS_KEY,
4
4
  SETTINGS_PLUGIN,
5
5
  SettingsAction
6
- } from "./chunk-SFPT4Z2C.mjs";
6
+ } from "./chunk-KPRHX73H.mjs";
7
7
  import {
8
8
  Capabilities,
9
9
  contributes,
10
10
  createIntent
11
- } from "./chunk-6AVTZPMT.mjs";
11
+ } from "./chunk-M6UBP7YP.mjs";
12
12
 
13
13
  // packages/sdk/app-framework/src/plugin-settings/app-graph-builder.ts
14
14
  import { createExtension } from "@dxos/app-graph";
@@ -134,4 +134,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
134
134
  export {
135
135
  app_graph_builder_default as default
136
136
  };
137
- //# sourceMappingURL=app-graph-builder-576BHZC7.mjs.map
137
+ //# sourceMappingURL=app-graph-builder-FB4NWT25.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  Capabilities,
3
3
  Events,
4
4
  PluginManager
5
- } from "./chunk-6AVTZPMT.mjs";
5
+ } from "./chunk-M6UBP7YP.mjs";
6
6
 
7
7
  // packages/sdk/app-framework/src/react/PluginManagerProvider.ts
8
8
  import { createContext, useContext } from "react";
@@ -140,7 +140,7 @@ var useIntentResolver = (module, resolver) => {
140
140
  import { effect } from "@preact/signals-core";
141
141
  import React3, { useEffect as useEffect2, useState } from "react";
142
142
  import { invariant } from "@dxos/invariant";
143
- import { create } from "@dxos/live-object";
143
+ import { live } from "@dxos/live-object";
144
144
 
145
145
  // packages/sdk/app-framework/src/helpers.ts
146
146
  var topologicalSort = (nodes) => {
@@ -190,7 +190,7 @@ var createApp = ({ pluginManager, pluginLoader: _pluginLoader, plugins = [], cor
190
190
  });
191
191
  return plugin;
192
192
  });
193
- const state = create({
193
+ const state = live({
194
194
  ready: false,
195
195
  error: null
196
196
  });
@@ -326,4 +326,4 @@ export {
326
326
  useIntentResolver,
327
327
  createApp
328
328
  };
329
- //# sourceMappingURL=chunk-PPIBZ5N4.mjs.map
329
+ //# sourceMappingURL=chunk-A7XUUTJN.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/react/PluginManagerProvider.ts", "../../../src/react/useCapabilities.ts", "../../../src/react/common.ts", "../../../src/react/ErrorBoundary.tsx", "../../../src/react/Surface.tsx", "../../../src/react/useIntentResolver.ts", "../../../src/App.tsx", "../../../src/helpers.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { raise } from '@dxos/debug';\n\nimport { type PluginManager } from '../core';\n\nconst PluginManagerContext = createContext<PluginManager | undefined>(undefined);\n\n/**\n * Get the plugin manager.\n */\nexport const usePluginManager = (): PluginManager =>\n useContext(PluginManagerContext) ?? raise(new Error('Missing PluginManagerContext'));\n\n/**\n * Context provider for a plugin manager.\n */\nexport const PluginManagerProvider = PluginManagerContext.Provider;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { computed } from '@preact/signals-core';\nimport { useMemo } from 'react';\n\nimport { usePluginManager } from './PluginManagerProvider';\nimport { type InterfaceDef } from '../core';\n\n/**\n * Hook to request capabilities from the plugin context.\n * @returns An array of capabilities.\n */\nexport const useCapabilities = <T, U extends T = T>(\n interfaceDef: InterfaceDef<T>,\n filter?: (capability: T, moduleId: string) => capability is U,\n) => {\n const manager = usePluginManager();\n const signal = useMemo(\n () => computed(() => manager.context.requestCapabilities(interfaceDef, filter)),\n [interfaceDef],\n );\n\n return signal.value;\n};\n\n/**\n * Hook to request a capability from the plugin context.\n * @returns The capability.\n * @throws If no capability is found.\n */\nexport const useCapability = <T, U extends T = T>(\n interfaceDef: InterfaceDef<T>,\n filter?: (capability: T, moduleId: string) => capability is U,\n) => {\n const manager = usePluginManager();\n const signal = useMemo(() => computed(() => manager.context.requestCapability(interfaceDef, filter)), [interfaceDef]);\n return signal.value;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCapability } from './useCapabilities';\nimport { Capabilities } from '../common';\n\nexport const useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);\n\nexport const useAppGraph = () => useCapability(Capabilities.AppGraph);\n\nexport const useLayout = () => useCapability(Capabilities.Layout);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { Component, type FC, type PropsWithChildren } from 'react';\n\ntype Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;\ntype State = { error: Error | undefined };\n\n/**\n * Surface error boundary.\n *\n * For basic usage prefer providing a fallback component to `Surface`.\n *\n * For more information on error boundaries, see:\n * https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary\n */\nexport class ErrorBoundary extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n this.state = { error: undefined };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n override componentDidUpdate(prevProps: Props): void {\n if (prevProps.data !== this.props.data) {\n this.resetError();\n }\n }\n\n override render() {\n if (this.state.error) {\n return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;\n }\n\n return this.props.children;\n }\n\n private resetError() {\n this.setState({ error: undefined });\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { memo, forwardRef, Suspense, useMemo, Fragment } from 'react';\n\nimport { useDefaultValue } from '@dxos/react-hooks';\nimport { byPosition } from '@dxos/util';\n\nimport { ErrorBoundary } from './ErrorBoundary';\nimport { useCapabilities } from './useCapabilities';\nimport { Capabilities, type SurfaceDefinition, type SurfaceProps } from '../common';\nimport { type PluginsContext } from '../core';\n\nconst DEFAULT_PLACEHOLDER = <Fragment />;\n\n/**\n * @internal\n */\nexport const useSurfaces = () => {\n const surfaces = useCapabilities(Capabilities.ReactSurface);\n return useMemo(() => surfaces.flat(), [surfaces]);\n};\n\nconst findCandidates = (surfaces: SurfaceDefinition[], { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n return Object.values(surfaces)\n .filter((definition) =>\n Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role,\n )\n .filter(({ filter }) => (filter ? filter(data ?? {}) : true))\n .toSorted(byPosition);\n};\n\n/**\n * @returns `true` if there is a contributed surface which matches the specified role & data, `false` otherwise.\n */\nexport const isSurfaceAvailable = (context: PluginsContext, { role, data }: Pick<SurfaceProps, 'role' | 'data'>) => {\n const surfaces = context.requestCapabilities(Capabilities.ReactSurface);\n const candidates = findCandidates(surfaces.flat(), { role, data });\n return candidates.length > 0;\n};\n\n/**\n * A surface is a named region of the screen that can be populated by plugins.\n */\nexport const Surface = memo(\n forwardRef<HTMLElement, SurfaceProps>(\n ({ id: _id, role, data: _data, limit, fallback, placeholder = DEFAULT_PLACEHOLDER, ...rest }, forwardedRef) => {\n // TODO(wittjosiah): This will make all surfaces depend on a single signal.\n // This isn't ideal because it means that any change to the data will cause all surfaces to re-render.\n // This effectively means that plugin modules which contribute surfaces need to all be activated at startup.\n // This should be fine for now because it's how it worked prior to capabilities api anyways.\n // In the future, it would be nice to be able to bucket the surface contributions by role.\n const surfaces = useSurfaces();\n const data = useDefaultValue(_data, () => ({}));\n\n // NOTE: Memoizing the candidates makes the surface not re-render based on reactivity within data.\n const definitions = findCandidates(surfaces, { role, data });\n const candidates = limit ? definitions.slice(0, limit) : definitions;\n const nodes = candidates.map(({ component: Component, id }) => (\n <Component ref={forwardedRef} key={id} id={id} role={role} data={data} limit={limit} {...rest} />\n ));\n\n const suspense = <Suspense fallback={placeholder}>{nodes}</Suspense>;\n\n return fallback ? (\n <ErrorBoundary data={data} fallback={fallback}>\n {suspense}\n </ErrorBoundary>\n ) : (\n suspense\n );\n },\n ),\n);\n\nSurface.displayName = 'Surface';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { Capabilities } from '../common';\nimport { type AnyIntentResolver } from '../plugin-intent';\nimport { usePluginManager } from '../react';\n\nexport const useIntentResolver = (module: string, resolver: AnyIntentResolver) => {\n const manager = usePluginManager();\n useEffect(() => {\n manager.context.contributeCapability({\n module,\n interface: Capabilities.IntentResolver,\n implementation: resolver,\n });\n\n return () => manager.context.removeCapability(Capabilities.IntentResolver, resolver);\n }, [module, resolver]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { effect } from '@preact/signals-core';\nimport React, { useEffect, useState, type FC, type PropsWithChildren } from 'react';\n\nimport { invariant } from '@dxos/invariant';\nimport { live } from '@dxos/live-object';\n\nimport { Capabilities, Events } from './common';\nimport { PluginManager, type PluginManagerOptions, type Plugin } from './core';\nimport { topologicalSort } from './helpers';\nimport { ErrorBoundary, PluginManagerProvider, useCapabilities } from './react';\n\nconst ENABLED_KEY = 'dxos.org/app-framework/enabled';\n\nexport type CreateAppOptions = {\n pluginManager?: PluginManager;\n pluginLoader?: PluginManagerOptions['pluginLoader'];\n plugins?: Plugin[];\n core?: string[];\n defaults?: string[];\n placeholder?: FC<{ stage: number }>;\n fallback?: ErrorBoundary['props']['fallback'];\n cacheEnabled?: boolean;\n};\n\n/**\n * Expected usage is for this to be the entrypoint of the application.\n * Initializes plugins and renders the root components.\n *\n * @example\n * const plugins = [LayoutPlugin(), MyPlugin()];\n * const core = [LayoutPluginId];\n * const default = [MyPluginId];\n * const fallback = <div>Initializing Plugins...</div>;\n * const App = createApp({ plugins, core, default, fallback });\n * createRoot(document.getElementById('root')!).render(\n * <StrictMode>\n * <App />\n * </StrictMode>,\n * );\n *\n * @param params.pluginLoader A function which loads new plugins.\n * @param params.plugins All plugins available to the application.\n * @param params.core Core plugins which will always be enabled.\n * @param params.defaults Default plugins are enabled by default but can be disabled by the user.\n * @param params.placeholder Placeholder component to render during startup.\n * @param params.fallback Fallback component to render if an error occurs during startup.\n * @param params.cacheEnabled Whether to cache enabled plugins in localStorage.\n */\nexport const createApp = ({\n pluginManager,\n pluginLoader: _pluginLoader,\n plugins = [],\n core = plugins.map(({ meta }) => meta.id),\n defaults = [],\n placeholder,\n fallback = DefaultFallback,\n cacheEnabled = false,\n}: CreateAppOptions) => {\n // TODO(wittjosiah): Provide a custom plugin loader which supports loading via url.\n const pluginLoader =\n _pluginLoader ??\n ((id: string) => {\n const plugin = plugins.find((plugin) => plugin.meta.id === id);\n invariant(plugin, `Plugin not found: ${id}`);\n return plugin;\n });\n\n const state = live({ ready: false, error: null });\n const cached: string[] = JSON.parse(localStorage.getItem(ENABLED_KEY) ?? '[]');\n const enabled = cacheEnabled && cached.length > 0 ? cached : defaults;\n const manager = pluginManager ?? new PluginManager({ pluginLoader, plugins, core, enabled });\n\n manager.activation.on(({ event, state: _state, error }) => {\n // Once the app is ready the first time, don't show the fallback again.\n if (!state.ready && event === Events.Startup.id) {\n state.ready = _state === 'activated';\n }\n\n if (error && !state.ready && !state.error) {\n state.error = error;\n }\n });\n\n effect(() => {\n cacheEnabled && localStorage.setItem(ENABLED_KEY, JSON.stringify(manager.enabled));\n });\n\n manager.context.contributeCapability({\n interface: Capabilities.PluginManager,\n implementation: manager,\n module: 'dxos.org/app-framework/plugin-manager',\n });\n\n setupDevtools(manager);\n\n // TODO(wittjosiah): Factor out such that this could be called per surface role when attempting to render.\n void manager.activate(Events.SetupReactSurface);\n void manager.activate(Events.Startup);\n\n return () => (\n <ErrorBoundary fallback={fallback}>\n <PluginManagerProvider value={manager}>\n <App placeholder={placeholder} state={state} />\n </PluginManagerProvider>\n </ErrorBoundary>\n );\n};\n\nconst DELAY_PLACEHOLDER = 2_000;\n\nenum LoadingState {\n Loading = 0,\n FadeIn = 1,\n FadeOut = 2,\n Done = 3,\n}\n\n/**\n * To avoid \"flashing\" the placeholder, we wait a period of time before starting the loading animation.\n * If loading completes during this time the placehoder is not shown, otherwise is it displayed for a minimum period of time.\n *\n * States:\n * 0: Loading - Wait for a period of time before starting the loading animation.\n * 1: Fade-in - Display a loading animation.\n * 2: Fade-out - Fade out the loading animation.\n * 3: Done - Remove the placeholder.\n */\nconst useLoading = (state: AppProps['state']) => {\n const [stage, setStage] = useState<LoadingState>(LoadingState.Loading);\n useEffect(() => {\n const i = setInterval(() => {\n setStage((tick) => {\n switch (tick) {\n case LoadingState.Loading:\n if (!state.ready) {\n return LoadingState.FadeIn;\n } else {\n clearInterval(i);\n return LoadingState.Done;\n }\n case LoadingState.FadeIn:\n if (state.ready) {\n return LoadingState.FadeOut;\n }\n break;\n case LoadingState.FadeOut:\n clearInterval(i);\n return LoadingState.Done;\n }\n\n return tick;\n });\n }, DELAY_PLACEHOLDER);\n\n return () => clearInterval(i);\n }, []);\n\n return stage;\n};\n\ntype AppProps = Pick<CreateAppOptions, 'placeholder'> & {\n state: { ready: boolean; error: unknown };\n};\n\nconst App = ({ placeholder: Placeholder, state }: AppProps) => {\n const reactContexts = useCapabilities(Capabilities.ReactContext);\n const reactRoots = useCapabilities(Capabilities.ReactRoot);\n const stage = useLoading(state);\n\n if (state.error) {\n // This triggers the error boundary to provide UI feedback for the startup error.\n throw state.error;\n }\n\n // TODO(wittjosiah): Consider using Suspense instead?\n if (stage < LoadingState.Done) {\n if (!Placeholder) {\n return null;\n }\n\n return <Placeholder stage={stage} />;\n }\n\n const ComposedContext = composeContexts(reactContexts);\n return (\n <ComposedContext>\n {reactRoots.map(({ id, root: Component }) => (\n <Component key={id} />\n ))}\n </ComposedContext>\n );\n};\n\n// Default fallback does not use tailwind or theme.\nconst DefaultFallback = ({ error }: { error: Error }) => {\n return (\n <div style={{ padding: '1rem' }}>\n {/* TODO(wittjosiah): Link to docs for replacing default. */}\n <h1 style={{ fontSize: '1.2rem', fontWeight: 700, margin: '0.5rem 0' }}>{error.message}</h1>\n <pre>{error.stack}</pre>\n </div>\n );\n};\n\nconst composeContexts = (contexts: Capabilities.ReactContext[]) => {\n if (contexts.length === 0) {\n return ({ children }: PropsWithChildren) => <>{children}</>;\n }\n\n return topologicalSort(contexts)\n .map(({ context }) => context)\n .reduce((Acc, Next) => ({ children }) => (\n <Acc>\n <Next>{children}</Next>\n </Acc>\n ));\n};\n\nconst setupDevtools = (manager: PluginManager) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.manager = manager;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\ntype DependencyNode = {\n id: string;\n dependsOn?: string[];\n};\n\n/**\n * Topologically sorts a list of nodes based on their dependencies.\n */\n// TODO(wittjosiah): Factor out?\nexport const topologicalSort = <T extends DependencyNode>(nodes: T[]): T[] => {\n const getDependencies = (nodeId: string, seen = new Set<string>(), path = new Set<string>()): string[] => {\n if (path.has(nodeId)) {\n throw new Error(`Circular dependency detected involving ${nodeId}`);\n }\n if (seen.has(nodeId)) {\n return [];\n }\n\n const node = nodes.find((n) => n.id === nodeId);\n if (!node) {\n throw new Error(`Node ${nodeId} not found but is listed as a dependency`);\n }\n\n const newPath = new Set([...path, nodeId]);\n const newSeen = new Set([...seen, nodeId]);\n\n const dependsOn = node.dependsOn ?? [];\n return [...dependsOn.flatMap((depId) => getDependencies(depId, newSeen, newPath)), nodeId];\n };\n\n // Get all unique dependencies.\n const allDependencies = nodes\n .map((node) => node.id)\n .flatMap((id) => getDependencies(id))\n .filter((id, index, self) => self.indexOf(id) === index);\n\n // Map back to original nodes\n return allDependencies\n .map((id) => nodes.find((node) => node.id === id))\n .filter((node): node is T => node !== undefined);\n};\n"],
5
+ "mappings": ";;;;;;;AAIA,SAASA,eAAeC,kBAAkB;AAE1C,SAASC,aAAa;AAItB,IAAMC,uBAAuBC,cAAyCC,MAAAA;AAK/D,IAAMC,mBAAmB,MAC9BC,WAAWJ,oBAAAA,KAAyBK,MAAM,IAAIC,MAAM,8BAAA,CAAA;AAK/C,IAAMC,wBAAwBP,qBAAqBQ;;;ACjB1D,SAASC,gBAAgB;AACzB,SAASC,eAAe;AASjB,IAAMC,kBAAkB,CAC7BC,cACAC,WAAAA;AAEA,QAAMC,UAAUC,iBAAAA;AAChB,QAAMC,SAASC,QACb,MAAMC,SAAS,MAAMJ,QAAQK,QAAQ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C0C,MAAAA,MAAMJ,QAAAA,CAAAA,CAAAA;AAGf;AAEA,IAAMzC,gBAAgB,CAACjB,YAAAA;AACpB+D,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAAShE,UAAUA;AACzC;",
6
+ "names": ["createContext", "useContext", "raise", "PluginManagerContext", "createContext", "undefined", "usePluginManager", "useContext", "raise", "Error", "PluginManagerProvider", "Provider", "computed", "useMemo", "useCapabilities", "interfaceDef", "filter", "manager", "usePluginManager", "signal", "useMemo", "computed", "context", "requestCapabilities", "value", "useCapability", "requestCapability", "useIntentDispatcher", "useCapability", "Capabilities", "IntentDispatcher", "useAppGraph", "AppGraph", "useLayout", "Layout", "React", "Component", "ErrorBoundary", "Component", "constructor", "props", "state", "error", "undefined", "getDerivedStateFromError", "componentDidUpdate", "prevProps", "data", "resetError", "render", "this", "fallback", "reset", "children", "setState", "React", "memo", "forwardRef", "Suspense", "useMemo", "Fragment", "useDefaultValue", "byPosition", "DEFAULT_PLACEHOLDER", "React", "Fragment", "useSurfaces", "surfaces", "useCapabilities", "Capabilities", "ReactSurface", "useMemo", "flat", "findCandidates", "role", "data", "Object", "values", "filter", "definition", "Array", "isArray", "includes", "toSorted", "byPosition", "isSurfaceAvailable", "context", "requestCapabilities", "candidates", "length", "Surface", "memo", "forwardRef", "id", "_id", "_data", "limit", "fallback", "placeholder", "rest", "forwardedRef", "useDefaultValue", "definitions", "slice", "nodes", "map", "component", "Component", "ref", "key", "suspense", "Suspense", "ErrorBoundary", "displayName", "useEffect", "useIntentResolver", "module", "resolver", "manager", "usePluginManager", "useEffect", "context", "contributeCapability", "interface", "Capabilities", "IntentResolver", "implementation", "removeCapability", "effect", "React", "useEffect", "useState", "invariant", "live", "topologicalSort", "nodes", "getDependencies", "nodeId", "seen", "Set", "path", "has", "Error", "node", "find", "n", "id", "newPath", "newSeen", "dependsOn", "flatMap", "depId", "allDependencies", "map", "filter", "index", "self", "indexOf", "undefined", "ENABLED_KEY", "createApp", "pluginManager", "pluginLoader", "_pluginLoader", "plugins", "core", "map", "meta", "id", "defaults", "placeholder", "fallback", "DefaultFallback", "cacheEnabled", "plugin", "find", "invariant", "state", "live", "ready", "error", "cached", "JSON", "parse", "localStorage", "getItem", "enabled", "length", "manager", "PluginManager", "activation", "on", "event", "_state", "Events", "Startup", "effect", "setItem", "stringify", "context", "contributeCapability", "interface", "Capabilities", "implementation", "module", "setupDevtools", "activate", "SetupReactSurface", "React", "ErrorBoundary", "PluginManagerProvider", "value", "App", "DELAY_PLACEHOLDER", "LoadingState", "useLoading", "stage", "setStage", "useState", "useEffect", "i", "setInterval", "tick", "clearInterval", "Placeholder", "reactContexts", "useCapabilities", "ReactContext", "reactRoots", "ReactRoot", "ComposedContext", "composeContexts", "root", "Component", "key", "div", "style", "padding", "h1", "fontSize", "fontWeight", "margin", "message", "pre", "stack", "contexts", "children", "topologicalSort", "reduce", "Acc", "Next", "globalThis", "composer"]
7
+ }
@@ -1,22 +1,22 @@
1
1
  // packages/sdk/app-framework/src/plugin-settings/actions.ts
2
- import { Schema as S } from "effect";
2
+ import { Schema } from "effect";
3
3
  var SETTINGS_PLUGIN = "dxos.org/plugin/settings";
4
4
  var SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;
5
5
  var SETTINGS_ID = "!dxos:settings";
6
6
  var SETTINGS_KEY = "settings";
7
7
  var SettingsAction;
8
8
  (function(SettingsAction2) {
9
- class Open extends S.TaggedClass()(`${SETTINGS_ACTION}/open`, {
10
- input: S.Struct({
11
- plugin: S.optional(S.String)
9
+ class Open extends Schema.TaggedClass()(`${SETTINGS_ACTION}/open`, {
10
+ input: Schema.Struct({
11
+ plugin: Schema.optional(Schema.String)
12
12
  }),
13
- output: S.Void
13
+ output: Schema.Void
14
14
  }) {
15
15
  }
16
16
  SettingsAction2.Open = Open;
17
- class OpenPluginRegistry extends S.TaggedClass()(`${SETTINGS_ACTION}/open-plugin-registry`, {
18
- input: S.Void,
19
- output: S.Void
17
+ class OpenPluginRegistry extends Schema.TaggedClass()(`${SETTINGS_ACTION}/open-plugin-registry`, {
18
+ input: Schema.Void,
19
+ output: Schema.Void
20
20
  }) {
21
21
  }
22
22
  SettingsAction2.OpenPluginRegistry = OpenPluginRegistry;
@@ -29,4 +29,4 @@ export {
29
29
  SETTINGS_KEY,
30
30
  SettingsAction
31
31
  };
32
- //# sourceMappingURL=chunk-SFPT4Z2C.mjs.map
32
+ //# sourceMappingURL=chunk-KPRHX73H.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugin-settings/actions.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nexport const SETTINGS_PLUGIN = 'dxos.org/plugin/settings';\nexport const SETTINGS_ACTION = `${SETTINGS_PLUGIN}/action`;\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 SETTINGS_ID = '!dxos:settings';\nexport const SETTINGS_KEY = 'settings';\n\nexport namespace SettingsAction {\n export class Open extends Schema.TaggedClass<Open>()(`${SETTINGS_ACTION}/open`, {\n input: Schema.Struct({\n plugin: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class OpenPluginRegistry extends Schema.TaggedClass<OpenPluginRegistry>()(\n `${SETTINGS_ACTION}/open-plugin-registry`,\n {\n input: Schema.Void,\n output: Schema.Void,\n },\n ) {}\n}\n"],
5
+ "mappings": ";AAIA,SAASA,cAAc;AAEhB,IAAMC,kBAAkB;AACxB,IAAMC,kBAAkB,GAAGD,eAAAA;AAG3B,IAAME,cAAc;AACpB,IAAMC,eAAe;;UAEXC,iBAAAA;EACR,MAAMC,aAAaC,OAAOC,YAAW,EAAS,GAAGN,eAAAA,SAAwB;IAC9EO,OAAOF,OAAOG,OAAO;MACnBC,QAAQJ,OAAOK,SAASL,OAAOM,MAAM;IACvC,CAAA;IACAC,QAAQP,OAAOQ;EACjB,CAAA,EAAA;EAAI;kBALST,OAAAA;EAON,MAAMU,2BAA2BT,OAAOC,YAAW,EACxD,GAAGN,eAAAA,yBACH;IACEO,OAAOF,OAAOQ;IACdD,QAAQP,OAAOQ;EACjB,CAAA,EAAA;EACC;kBANUC,qBAAAA;AAOf,GAfiBX,mBAAAA,iBAAAA,CAAAA,EAAAA;",
6
+ "names": ["Schema", "SETTINGS_PLUGIN", "SETTINGS_ACTION", "SETTINGS_ID", "SETTINGS_KEY", "SettingsAction", "Open", "Schema", "TaggedClass", "input", "Struct", "plugin", "optional", "String", "output", "Void", "OpenPluginRegistry"]
7
+ }