@dxos/app-framework 0.8.4-main.ae835ea → 0.8.4-main.bc674ce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/.storybook/main.mts +1 -1
  2. package/.storybook/preview.mts +2 -2
  3. package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs +149 -0
  4. package/dist/lib/browser/app-graph-builder-M2VPYQC6.mjs.map +7 -0
  5. package/dist/lib/browser/capability-7PCNSWBT.mjs +33 -0
  6. package/dist/lib/browser/capability-7PCNSWBT.mjs.map +7 -0
  7. package/dist/lib/browser/capability-KP3PFEXD.mjs +31 -0
  8. package/dist/lib/browser/capability-KP3PFEXD.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-6Y7PZV72.mjs +77 -0
  10. package/dist/lib/browser/chunk-6Y7PZV72.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-7IQHKD4U.mjs +170 -0
  12. package/dist/lib/browser/chunk-7IQHKD4U.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-BLQJSGL3.mjs +732 -0
  14. package/dist/lib/browser/chunk-BLQJSGL3.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-FHQTHCX7.mjs +8 -0
  16. package/dist/lib/browser/chunk-FHQTHCX7.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-FMZN33N4.mjs +807 -0
  18. package/dist/lib/browser/chunk-FMZN33N4.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-H4WPA7U7.mjs +77 -0
  20. package/dist/lib/browser/chunk-H4WPA7U7.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  22. package/dist/lib/browser/chunk-PKQT6C53.mjs +47 -0
  23. package/dist/lib/browser/chunk-PKQT6C53.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-TCLLRCS3.mjs +145 -0
  25. package/dist/lib/browser/chunk-TCLLRCS3.mjs.map +7 -0
  26. package/dist/lib/browser/chunk-XYNO72GQ.mjs +746 -0
  27. package/dist/lib/browser/chunk-XYNO72GQ.mjs.map +7 -0
  28. package/dist/lib/browser/common/index.mjs +38 -0
  29. package/dist/lib/browser/core/activation-event.mjs +20 -0
  30. package/dist/lib/browser/core/capability.mjs +28 -0
  31. package/dist/lib/browser/core/plugin-manager.mjs +15 -0
  32. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  33. package/dist/lib/browser/core/plugin.mjs +27 -0
  34. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  35. package/dist/lib/browser/index.mjs +162 -128
  36. package/dist/lib/browser/index.mjs.map +4 -4
  37. package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs +32 -0
  38. package/dist/lib/browser/invoker-capability-SZRSTHEH.mjs.map +7 -0
  39. package/dist/lib/browser/meta.json +1 -1
  40. package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs +64 -0
  41. package/dist/lib/browser/operation-resolver-6MP2MYOY.mjs.map +7 -0
  42. package/dist/lib/browser/react/index.mjs +46 -0
  43. package/dist/lib/browser/react/index.mjs.map +7 -0
  44. package/dist/lib/browser/testing/index.mjs +68 -22
  45. package/dist/lib/browser/testing/index.mjs.map +4 -4
  46. package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs +150 -0
  47. package/dist/lib/node-esm/app-graph-builder-LROHGJEM.mjs.map +7 -0
  48. package/dist/lib/node-esm/capability-CFLQ2QQU.mjs +34 -0
  49. package/dist/lib/node-esm/capability-CFLQ2QQU.mjs.map +7 -0
  50. package/dist/lib/node-esm/capability-RCUNM2M7.mjs +32 -0
  51. package/dist/lib/node-esm/capability-RCUNM2M7.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-663A54LQ.mjs +171 -0
  53. package/dist/lib/node-esm/chunk-663A54LQ.mjs.map +7 -0
  54. package/dist/lib/node-esm/chunk-6WXBT3EC.mjs +747 -0
  55. package/dist/lib/node-esm/chunk-6WXBT3EC.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-7OWSHPYK.mjs +48 -0
  57. package/dist/lib/node-esm/chunk-7OWSHPYK.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-GQEBIGKD.mjs +733 -0
  59. package/dist/lib/node-esm/chunk-GQEBIGKD.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-GT6OKM5I.mjs +146 -0
  61. package/dist/lib/node-esm/chunk-GT6OKM5I.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  63. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-STMXUEPO.mjs +78 -0
  65. package/dist/lib/node-esm/chunk-STMXUEPO.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-UEWJDI2L.mjs +10 -0
  67. package/dist/lib/node-esm/chunk-UEWJDI2L.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-XR6NMKEP.mjs +78 -0
  69. package/dist/lib/node-esm/chunk-XR6NMKEP.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-XYQTBFPA.mjs +808 -0
  71. package/dist/lib/node-esm/chunk-XYQTBFPA.mjs.map +7 -0
  72. package/dist/lib/node-esm/common/index.mjs +39 -0
  73. package/dist/lib/node-esm/common/index.mjs.map +7 -0
  74. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  75. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  76. package/dist/lib/node-esm/core/capability.mjs +29 -0
  77. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  78. package/dist/lib/node-esm/core/plugin-manager.mjs +16 -0
  79. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  80. package/dist/lib/node-esm/core/plugin.mjs +28 -0
  81. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  82. package/dist/lib/node-esm/index.mjs +162 -128
  83. package/dist/lib/node-esm/index.mjs.map +4 -4
  84. package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs +33 -0
  85. package/dist/lib/node-esm/invoker-capability-PNMA5JOS.mjs.map +7 -0
  86. package/dist/lib/node-esm/meta.json +1 -1
  87. package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs +65 -0
  88. package/dist/lib/node-esm/operation-resolver-7YWDMTNU.mjs.map +7 -0
  89. package/dist/lib/node-esm/react/index.mjs +47 -0
  90. package/dist/lib/node-esm/react/index.mjs.map +7 -0
  91. package/dist/lib/node-esm/testing/index.mjs +68 -22
  92. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  93. package/dist/types/src/cli.d.ts +39 -0
  94. package/dist/types/src/cli.d.ts.map +1 -0
  95. package/dist/types/src/common/activation-event.d.ts +66 -0
  96. package/dist/types/src/common/activation-event.d.ts.map +1 -0
  97. package/dist/types/src/common/capability.d.ts +265 -0
  98. package/dist/types/src/common/capability.d.ts.map +1 -0
  99. package/dist/types/src/common/collaboration.d.ts +23 -17
  100. package/dist/types/src/common/collaboration.d.ts.map +1 -1
  101. package/dist/types/src/common/graph.d.ts +2 -2
  102. package/dist/types/src/common/graph.d.ts.map +1 -1
  103. package/dist/types/src/common/index.d.ts +4 -3
  104. package/dist/types/src/common/index.d.ts.map +1 -1
  105. package/dist/types/src/common/operations.d.ts +380 -0
  106. package/dist/types/src/common/operations.d.ts.map +1 -0
  107. package/dist/types/src/common/plugin.d.ts +201 -0
  108. package/dist/types/src/common/plugin.d.ts.map +1 -0
  109. package/dist/types/src/common/surface.d.ts +48 -13
  110. package/dist/types/src/common/surface.d.ts.map +1 -1
  111. package/dist/types/src/common/translations.d.ts +9 -0
  112. package/dist/types/src/common/translations.d.ts.map +1 -1
  113. package/dist/types/src/context.d.ts +5 -0
  114. package/dist/types/src/context.d.ts.map +1 -0
  115. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +6 -6
  116. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  117. package/dist/types/src/core/capability-manager.d.ts +43 -0
  118. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  119. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  120. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  121. package/dist/types/src/core/capability.d.ts +150 -0
  122. package/dist/types/src/core/capability.d.ts.map +1 -0
  123. package/dist/types/src/core/index.d.ts +5 -4
  124. package/dist/types/src/core/index.d.ts.map +1 -1
  125. package/dist/types/src/core/plugin-manager.d.ts +66 -0
  126. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  127. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  128. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  129. package/dist/types/src/core/plugin.d.ts +92 -34
  130. package/dist/types/src/core/plugin.d.ts.map +1 -1
  131. package/dist/types/src/index.d.ts +5 -4
  132. package/dist/types/src/index.d.ts.map +1 -1
  133. package/dist/types/src/playground/debug/Debug.d.ts +4 -2
  134. package/dist/types/src/playground/debug/Debug.d.ts.map +1 -1
  135. package/dist/types/src/playground/debug/plugin.d.ts +2 -1
  136. package/dist/types/src/playground/debug/plugin.d.ts.map +1 -1
  137. package/dist/types/src/playground/generator/Main.d.ts +4 -2
  138. package/dist/types/src/playground/generator/Main.d.ts.map +1 -1
  139. package/dist/types/src/playground/generator/Toolbar.d.ts +4 -2
  140. package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
  141. package/dist/types/src/playground/generator/generator.d.ts +17 -5
  142. package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
  143. package/dist/types/src/playground/generator/plugin.d.ts +2 -1
  144. package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
  145. package/dist/types/src/playground/layout/Layout.d.ts +4 -2
  146. package/dist/types/src/playground/layout/Layout.d.ts.map +1 -1
  147. package/dist/types/src/playground/layout/plugin.d.ts +2 -1
  148. package/dist/types/src/playground/layout/plugin.d.ts.map +1 -1
  149. package/dist/types/src/playground/logger/Toolbar.d.ts +4 -2
  150. package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
  151. package/dist/types/src/playground/logger/plugin.d.ts +2 -1
  152. package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
  153. package/dist/types/src/playground/logger/schema.d.ts +14 -0
  154. package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
  155. package/dist/types/src/playground/playground.stories.d.ts.map +1 -1
  156. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
  157. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
  158. package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
  159. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
  160. package/dist/types/src/plugin-operation/history/errors.d.ts +5 -0
  161. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
  162. package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
  163. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
  164. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
  165. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
  166. package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
  167. package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
  168. package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
  169. package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
  170. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +93 -0
  171. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
  172. package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
  173. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
  174. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
  175. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
  176. package/dist/types/src/plugin-operation/index.d.ts +3 -0
  177. package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
  178. package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
  179. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
  180. package/dist/types/src/plugin-operation/meta.d.ts +3 -0
  181. package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
  182. package/dist/types/src/plugin-operation/testing.d.ts +109 -0
  183. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
  184. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
  185. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
  186. package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
  187. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
  188. package/dist/types/src/plugin-runtime/index.d.ts +2 -0
  189. package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
  190. package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
  191. package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
  192. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +2 -1
  193. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
  194. package/dist/types/src/plugin-settings/actions.d.ts +36 -0
  195. package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
  196. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +4 -2
  197. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +1 -1
  198. package/dist/types/src/plugin-settings/meta.d.ts +2 -2
  199. package/dist/types/src/plugin-settings/meta.d.ts.map +1 -1
  200. package/dist/types/src/plugin-settings/operation-resolver.d.ts +6 -0
  201. package/dist/types/src/plugin-settings/operation-resolver.d.ts.map +1 -0
  202. package/dist/types/src/react/App.d.ts +8 -0
  203. package/dist/types/src/react/App.d.ts.map +1 -0
  204. package/dist/types/src/react/App.stories.d.ts.map +1 -0
  205. package/dist/types/src/react/DefaultFallback.d.ts.map +1 -0
  206. package/dist/types/src/react/PluginManagerContext.stories.d.ts +13 -0
  207. package/dist/types/src/react/PluginManagerContext.stories.d.ts.map +1 -0
  208. package/dist/types/src/react/PluginManagerProvider.d.ts +2 -2
  209. package/dist/types/src/react/PluginManagerProvider.d.ts.map +1 -1
  210. package/dist/types/src/react/Surface.d.ts +8 -6
  211. package/dist/types/src/react/Surface.d.ts.map +1 -1
  212. package/dist/types/src/react/Surface.stories.d.ts +3 -6
  213. package/dist/types/src/react/Surface.stories.d.ts.map +1 -1
  214. package/dist/types/src/react/SurfaceInfo.d.ts +11 -0
  215. package/dist/types/src/react/SurfaceInfo.d.ts.map +1 -0
  216. package/dist/types/src/react/common.d.ts +13 -12
  217. package/dist/types/src/react/common.d.ts.map +1 -1
  218. package/dist/types/src/react/index.d.ts +3 -1
  219. package/dist/types/src/react/index.d.ts.map +1 -1
  220. package/dist/types/src/react/types.d.ts +12 -0
  221. package/dist/types/src/react/types.d.ts.map +1 -0
  222. package/dist/types/src/{components → react}/useApp.d.ts +7 -6
  223. package/dist/types/src/react/useApp.d.ts.map +1 -0
  224. package/dist/types/src/react/useCapabilities.d.ts +16 -3
  225. package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
  226. package/dist/types/src/{components → react}/useLoading.d.ts +1 -2
  227. package/dist/types/src/react/useLoading.d.ts.map +1 -0
  228. package/dist/types/src/react/useOperationResolver.d.ts +19 -0
  229. package/dist/types/src/react/useOperationResolver.d.ts.map +1 -0
  230. package/dist/types/src/testing/index.d.ts +1 -0
  231. package/dist/types/src/testing/index.d.ts.map +1 -1
  232. package/dist/types/src/testing/service.d.ts +8 -0
  233. package/dist/types/src/testing/service.d.ts.map +1 -0
  234. package/dist/types/src/testing/withPluginManager.d.ts +4 -4
  235. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  236. package/dist/types/tsconfig.tsbuildinfo +1 -1
  237. package/moon.yml +6 -2
  238. package/package.json +101 -45
  239. package/src/cli.ts +107 -0
  240. package/src/common/activation-event.ts +99 -0
  241. package/src/common/capability.ts +343 -0
  242. package/src/common/collaboration.ts +23 -10
  243. package/src/common/graph.ts +2 -2
  244. package/src/common/index.ts +4 -3
  245. package/src/common/operations.ts +412 -0
  246. package/src/common/plugin.ts +364 -0
  247. package/src/common/surface.ts +56 -19
  248. package/src/common/translations.ts +20 -0
  249. package/src/context.ts +9 -0
  250. package/src/core/{events.ts → activation-event.ts} +5 -5
  251. package/src/core/capability-manager.test.ts +151 -0
  252. package/src/core/capability-manager.ts +171 -0
  253. package/src/core/capability.ts +236 -0
  254. package/src/core/index.ts +5 -4
  255. package/src/core/plugin-manager.test.ts +845 -0
  256. package/src/core/plugin-manager.ts +696 -0
  257. package/src/core/plugin.ts +221 -39
  258. package/src/index.ts +5 -4
  259. package/src/playground/debug/Debug.tsx +26 -16
  260. package/src/playground/debug/plugin.ts +8 -8
  261. package/src/playground/generator/Main.tsx +20 -11
  262. package/src/playground/generator/Toolbar.tsx +26 -16
  263. package/src/playground/generator/generator.ts +27 -27
  264. package/src/playground/generator/plugin.ts +11 -12
  265. package/src/playground/layout/Layout.tsx +11 -7
  266. package/src/playground/layout/plugin.ts +8 -8
  267. package/src/playground/logger/Toolbar.tsx +19 -16
  268. package/src/playground/logger/plugin.ts +24 -23
  269. package/src/playground/logger/schema.ts +10 -0
  270. package/src/playground/playground.stories.tsx +14 -6
  271. package/src/plugin-operation/OperationPlugin.ts +25 -0
  272. package/src/plugin-operation/history/capability.ts +37 -0
  273. package/src/plugin-operation/history/errors.ts +11 -0
  274. package/src/plugin-operation/history/history-tracker.test.ts +380 -0
  275. package/src/plugin-operation/history/history-tracker.ts +129 -0
  276. package/src/plugin-operation/history/index.ts +9 -0
  277. package/src/plugin-operation/history/types.ts +17 -0
  278. package/src/plugin-operation/history/undo-mapping.ts +132 -0
  279. package/src/plugin-operation/history/undo-registry.test.ts +73 -0
  280. package/src/plugin-operation/history/undo-registry.ts +54 -0
  281. package/src/plugin-operation/index.ts +6 -0
  282. package/src/plugin-operation/invoker-capability.ts +40 -0
  283. package/src/plugin-operation/meta.ts +11 -0
  284. package/src/plugin-operation/testing.ts +174 -0
  285. package/src/plugin-runtime/RuntimePlugin.ts +20 -0
  286. package/src/plugin-runtime/capability.ts +53 -0
  287. package/src/{components → plugin-runtime}/index.ts +1 -1
  288. package/src/plugin-runtime/meta.ts +11 -0
  289. package/src/plugin-settings/SettingsPlugin.ts +11 -26
  290. package/src/plugin-settings/actions.ts +39 -0
  291. package/src/plugin-settings/app-graph-builder.ts +122 -142
  292. package/src/plugin-settings/meta.ts +2 -2
  293. package/src/plugin-settings/operation-resolver.ts +55 -0
  294. package/src/plugin-settings/translations.ts +1 -1
  295. package/src/react/App.stories.tsx +63 -0
  296. package/src/{components → react}/App.tsx +11 -10
  297. package/src/{components → react}/DefaultFallback.tsx +1 -1
  298. package/src/react/PluginManagerContext.stories.tsx +184 -0
  299. package/src/react/PluginManagerProvider.ts +2 -2
  300. package/src/react/Surface.stories.tsx +91 -51
  301. package/src/react/Surface.tsx +226 -45
  302. package/src/react/SurfaceInfo.tsx +107 -0
  303. package/src/react/common.ts +29 -5
  304. package/src/react/index.ts +5 -1
  305. package/src/react/types.ts +27 -0
  306. package/src/react/useApp.tsx +209 -0
  307. package/src/react/useCapabilities.ts +37 -5
  308. package/src/{components → react}/useLoading.tsx +4 -6
  309. package/src/react/useOperationResolver.ts +40 -0
  310. package/src/testing/index.ts +1 -0
  311. package/src/testing/service.ts +52 -0
  312. package/src/testing/withPluginManager.stories.tsx +5 -5
  313. package/src/testing/withPluginManager.tsx +21 -23
  314. package/tsconfig.json +25 -7
  315. package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
  316. package/dist/lib/browser/app-graph-builder-PSA3RESL.mjs +0 -138
  317. package/dist/lib/browser/app-graph-builder-PSA3RESL.mjs.map +0 -7
  318. package/dist/lib/browser/chunk-2VZ4RF4A.mjs +0 -1608
  319. package/dist/lib/browser/chunk-2VZ4RF4A.mjs.map +0 -7
  320. package/dist/lib/browser/chunk-CPVYIS24.mjs +0 -451
  321. package/dist/lib/browser/chunk-CPVYIS24.mjs.map +0 -7
  322. package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
  323. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
  324. package/dist/lib/browser/intent-dispatcher-BND6IF4U.mjs +0 -11
  325. package/dist/lib/browser/intent-resolver-27FJAJDE.mjs +0 -39
  326. package/dist/lib/browser/intent-resolver-27FJAJDE.mjs.map +0 -7
  327. package/dist/lib/browser/store-F545UOIR.mjs +0 -30
  328. package/dist/lib/browser/store-F545UOIR.mjs.map +0 -7
  329. package/dist/lib/browser/worker.mjs +0 -77
  330. package/dist/lib/node-esm/app-graph-builder-VJGZ6KH7.mjs +0 -139
  331. package/dist/lib/node-esm/app-graph-builder-VJGZ6KH7.mjs.map +0 -7
  332. package/dist/lib/node-esm/chunk-3RRWO5TD.mjs +0 -1610
  333. package/dist/lib/node-esm/chunk-3RRWO5TD.mjs.map +0 -7
  334. package/dist/lib/node-esm/chunk-MN37WUJ2.mjs +0 -452
  335. package/dist/lib/node-esm/chunk-MN37WUJ2.mjs.map +0 -7
  336. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
  337. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
  338. package/dist/lib/node-esm/intent-dispatcher-254AZ6EE.mjs +0 -12
  339. package/dist/lib/node-esm/intent-resolver-NPMOPNFL.mjs +0 -40
  340. package/dist/lib/node-esm/intent-resolver-NPMOPNFL.mjs.map +0 -7
  341. package/dist/lib/node-esm/store-CINC4R4L.mjs +0 -31
  342. package/dist/lib/node-esm/store-CINC4R4L.mjs.map +0 -7
  343. package/dist/lib/node-esm/worker.mjs +0 -78
  344. package/dist/types/src/common/capabilities.d.ts +0 -201
  345. package/dist/types/src/common/capabilities.d.ts.map +0 -1
  346. package/dist/types/src/common/events.d.ts +0 -52
  347. package/dist/types/src/common/events.d.ts.map +0 -1
  348. package/dist/types/src/common/layout.d.ts +0 -279
  349. package/dist/types/src/common/layout.d.ts.map +0 -1
  350. package/dist/types/src/components/App.d.ts +0 -10
  351. package/dist/types/src/components/App.d.ts.map +0 -1
  352. package/dist/types/src/components/App.stories.d.ts.map +0 -1
  353. package/dist/types/src/components/DefaultFallback.d.ts.map +0 -1
  354. package/dist/types/src/components/index.d.ts +0 -2
  355. package/dist/types/src/components/index.d.ts.map +0 -1
  356. package/dist/types/src/components/useApp.d.ts.map +0 -1
  357. package/dist/types/src/components/useLoading.d.ts.map +0 -1
  358. package/dist/types/src/core/capabilities.d.ts +0 -117
  359. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  360. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  361. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  362. package/dist/types/src/core/events.d.ts.map +0 -1
  363. package/dist/types/src/core/manager.d.ts +0 -126
  364. package/dist/types/src/core/manager.d.ts.map +0 -1
  365. package/dist/types/src/core/manager.test.d.ts +0 -2
  366. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  367. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  368. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  369. package/dist/types/src/plugin-intent/actions.d.ts +0 -36
  370. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  371. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  372. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  373. package/dist/types/src/plugin-intent/index.d.ts +0 -6
  374. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  375. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  376. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  377. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  378. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  379. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  380. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  381. package/dist/types/src/plugin-intent/meta.d.ts +0 -3
  382. package/dist/types/src/plugin-intent/meta.d.ts.map +0 -1
  383. package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
  384. package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
  385. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  386. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  387. package/dist/types/src/react/IntentContext.d.ts +0 -8
  388. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  389. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  390. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  391. package/dist/types/src/worker.d.ts +0 -4
  392. package/dist/types/src/worker.d.ts.map +0 -1
  393. package/src/common/capabilities.ts +0 -217
  394. package/src/common/events.ts +0 -79
  395. package/src/common/layout.ts +0 -277
  396. package/src/components/App.stories.tsx +0 -33
  397. package/src/components/useApp.tsx +0 -164
  398. package/src/core/capabilities.test.ts +0 -136
  399. package/src/core/capabilities.ts +0 -263
  400. package/src/core/manager.test.ts +0 -516
  401. package/src/core/manager.ts +0 -604
  402. package/src/plugin-intent/IntentPlugin.ts +0 -20
  403. package/src/plugin-intent/actions.ts +0 -31
  404. package/src/plugin-intent/errors.ts +0 -40
  405. package/src/plugin-intent/index.ts +0 -9
  406. package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
  407. package/src/plugin-intent/intent-dispatcher.ts +0 -337
  408. package/src/plugin-intent/intent.ts +0 -154
  409. package/src/plugin-intent/meta.ts +0 -10
  410. package/src/plugin-settings/intent-resolver.ts +0 -35
  411. package/src/plugin-settings/store.ts +0 -33
  412. package/src/react/IntentContext.tsx +0 -35
  413. package/src/react/useIntentResolver.ts +0 -22
  414. package/src/worker.ts +0 -11
  415. /package/dist/lib/browser/{intent-dispatcher-BND6IF4U.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  416. /package/dist/lib/browser/{worker.mjs.map → common/index.mjs.map} +0 -0
  417. /package/dist/lib/{node-esm/intent-dispatcher-254AZ6EE.mjs.map → browser/core/activation-event.mjs.map} +0 -0
  418. /package/dist/lib/{node-esm/worker.mjs.map → browser/core/capability.mjs.map} +0 -0
  419. /package/dist/types/src/{components → react}/App.stories.d.ts +0 -0
  420. /package/dist/types/src/{components → react}/DefaultFallback.d.ts +0 -0
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { type UseAppOptions } from './useApp';
3
- export type AppProps = Pick<UseAppOptions, 'placeholder' | 'debounce'> & {
4
- state: {
5
- ready: boolean;
6
- error: unknown;
7
- };
8
- };
9
- export declare const App: ({ placeholder: Placeholder, state, debounce }: AppProps) => React.JSX.Element | null;
10
- //# sourceMappingURL=App.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/components/App.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAMtD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,UAAU,CAAC,GAAG;IACvE,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,+CAA+C,QAAQ,6BA2B1E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"App.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/App.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,QAAA,MAAM,IAAI;;;;;;;CAOM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultFallback.d.ts","sourceRoot":"","sources":["../../../../src/components/DefaultFallback.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,sBAgB1D,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './useApp';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useApp.d.ts","sourceRoot":"","sources":["../../../../src/components/useApp.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAmC,MAAM,OAAO,CAAC;AAOxE,OAAO,EAAE,KAAK,MAAM,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,aAAa,EAAyB,MAAM,UAAU,CAAC;AAOhE,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,EAAE,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,MAAM,GAAI,+JAWpB,aAAa,4BAwFf,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLoading.d.ts","sourceRoot":"","sources":["../../../../src/components/useLoading.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,oBAAY,YAAY;IACtB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,IAAI,IAAI;CACT;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAY,iBA4ChE,CAAC"}
@@ -1,117 +0,0 @@
1
- import { type Registry, Rx } from '@effect-rx/rx-react';
2
- import * as Effect from 'effect/Effect';
3
- import { type MaybePromise } from '@dxos/util';
4
- import { type ActivationEvent } from './events';
5
- declare const InterfaceDefTypeId: unique symbol;
6
- /**
7
- * The interface definition of a capability.
8
- */
9
- export type InterfaceDef<T> = {
10
- [InterfaceDefTypeId]: T;
11
- identifier: string;
12
- };
13
- export declare namespace InterfaceDef {
14
- type Implementation<I extends InterfaceDef<any>> = I extends InterfaceDef<infer T> ? T : never;
15
- }
16
- /**
17
- * Helper to define the interface of a capability.
18
- */
19
- export declare const defineCapability: <T>(identifier: string) => InterfaceDef<T>;
20
- /**
21
- * A unique string identifier with a Typescript type associated with it.
22
- * When a capability is contributed to the application an implementation of the interface is provided.
23
- */
24
- export type Capability<T> = {
25
- /**
26
- * The interface definition of the capability.
27
- */
28
- readonly interface: InterfaceDef<T>;
29
- /**
30
- * The implementation of the capability.
31
- */
32
- readonly implementation: T;
33
- /**
34
- * Called when the capability is deactivated.
35
- */
36
- deactivate?: () => MaybePromise<void> | Effect.Effect<void, Error>;
37
- };
38
- export type AnyCapability = Capability<any>;
39
- type PluginsContextOptions = {
40
- registry: Registry.Registry;
41
- activate: (event: ActivationEvent) => Effect.Effect<boolean, Error>;
42
- reset: (event: ActivationEvent) => Effect.Effect<boolean, Error>;
43
- };
44
- /**
45
- * Helper to define the implementation of a capability.
46
- */
47
- export declare const contributes: <I extends InterfaceDef<any>, T = InterfaceDef.Implementation<I>>(interfaceDef: I, implementation: T, deactivate?: Capability<InterfaceDef.Implementation<I>>["deactivate"]) => Capability<I>;
48
- type LoadCapability<T, U> = () => Promise<{
49
- default: (props: T) => MaybePromise<Capability<U>>;
50
- }>;
51
- type LoadCapabilities<T> = () => Promise<{
52
- default: (props: T) => MaybePromise<AnyCapability[]>;
53
- }>;
54
- type LazyCapability<T, U> = (props?: T) => Promise<() => Promise<Capability<U> | AnyCapability[]>>;
55
- /**
56
- * Helper to define a lazily loaded implementation of a capability.
57
- */
58
- export declare const lazy: <T, U>(c: LoadCapability<T, U> | LoadCapabilities<T>) => LazyCapability<T, U>;
59
- /**
60
- * Facilitates the dependency injection between [plugin modules](#pluginmodule) by allowing them contribute and request capabilities from each other.
61
- * It tracks the capabilities that are contributed in an in-memory live object.
62
- * This allows the application to subscribe to this state and incorporate plugins which are added dynamically.
63
- */
64
- export declare class PluginContext {
65
- private readonly _registry;
66
- private readonly _capabilityImpls;
67
- readonly _capabilities: (arg: string) => Rx.Rx<unknown[]>;
68
- readonly _capability: (arg: string) => Rx.Rx<unknown>;
69
- /**
70
- * Activates plugins based on the activation event.
71
- * @param event The activation event.
72
- * @returns Whether the activation was successful.
73
- */
74
- readonly activate: PluginsContextOptions['activate'];
75
- /**
76
- * Re-activates the modules that were activated by the event.
77
- * @param event The activation event.
78
- * @returns Whether the reset was successful.
79
- */
80
- readonly reset: PluginsContextOptions['reset'];
81
- constructor({ registry, activate, reset }: PluginsContextOptions);
82
- /**
83
- * Get the Rx reference to the available capabilities for a given interface.
84
- * Primarily useful for deriving other Rx values based on the capabilities or
85
- * for subscribing to changes in the capabilities.
86
- * @returns An Rx reference to the available capabilities.
87
- */
88
- capabilities<T>(interfaceDef: InterfaceDef<T>): Rx.Rx<T[]>;
89
- /**
90
- * Get the Rx reference to the available capabilities for a given interface.
91
- * Primarily useful for deriving other Rx values based on the capability or
92
- * for subscribing to changes in the capability.
93
- * @returns An Rx reference to the available capability.
94
- * @throws If no capability is found.
95
- */
96
- capability<T>(interfaceDef: InterfaceDef<T>): Rx.Rx<T>;
97
- /**
98
- * Get capabilities from the plugin context.
99
- * @returns An array of capabilities.
100
- */
101
- getCapabilities<T>(interfaceDef: InterfaceDef<T>): T[];
102
- /**
103
- * Requests a single capability from the plugin context.
104
- * @returns The capability.
105
- * @throws If no capability is found.
106
- */
107
- getCapability<T>(interfaceDef: InterfaceDef<T>): T;
108
- /**
109
- * Waits for a capability to be available.
110
- * @returns The capability.
111
- */
112
- waitForCapability<T>(interfaceDef: InterfaceDef<T>): Promise<T>;
113
- activatePromise(event: ActivationEvent): Promise<boolean>;
114
- resetPromise(event: ActivationEvent): Promise<boolean>;
115
- }
116
- export {};
117
- //# sourceMappingURL=capabilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/core/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,QAAA,MAAM,kBAAkB,EAAE,OAAO,MAAyC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,yBAAiB,YAAY,CAAC;IAC5B,KAAY,cAAc,CAAC,CAAC,SAAS,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAA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C,EAAE,CAAC,CAAC,CAAC;IAKtD;;;OAGG;IACH,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;IAItD;;;;OAIG;IACH,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IAIlD;;;OAGG;IACG,iBAAiB,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAiB/D,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzD,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;CAG7D"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=capabilities.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.test.d.ts","sourceRoot":"","sources":["../../../../src/core/capabilities.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/core/events.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,EAAE,YAAY,MAAM,KAC5B,eAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,eAAe,WAAoE,CAAC;AAEpH;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,QAAQ,eAAe,EAAE;;;CAA0C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,QAAQ,eAAe,EAAE;;;CAA0C,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,gBAAgB,KAAG,MAAM,IAAI;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1D,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,QAAQ,gBAAgB,KAAG,MAAM,IAAI;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1D,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,gBAAgB,sBAAkD,CAAC"}
@@ -1,126 +0,0 @@
1
- import { Registry } from '@effect-rx/rx-react';
2
- import { Event } from '@dxos/async';
3
- import { type Live } from '@dxos/live-object';
4
- import { type MaybePromise } from '@dxos/util';
5
- import { PluginContext } from './capabilities';
6
- import { type ActivationEvent } from './events';
7
- import { type Plugin, type PluginModule } from './plugin';
8
- export type PluginManagerOptions = {
9
- pluginLoader: (id: string) => MaybePromise<Plugin>;
10
- plugins?: Plugin[];
11
- core?: string[];
12
- enabled?: string[];
13
- registry?: Registry.Registry;
14
- };
15
- export declare class PluginManager {
16
- readonly activation: Event<{
17
- event: string;
18
- state: "activating" | "activated" | "error";
19
- error?: any;
20
- }>;
21
- readonly context: PluginContext;
22
- readonly registry: Registry.Registry;
23
- private readonly _state;
24
- private readonly _pluginLoader;
25
- private readonly _capabilities;
26
- private readonly _moduleMemoMap;
27
- private readonly _activatingEvents;
28
- private readonly _activatingModules;
29
- constructor({ pluginLoader, plugins, core, enabled, registry, }: PluginManagerOptions);
30
- /**
31
- * Plugins that are currently registered.
32
- *
33
- * @reactive
34
- */
35
- get plugins(): Live<readonly Plugin[]>;
36
- /**
37
- * Ids of plugins that are core and cannot be removed.
38
- *
39
- * @reactive
40
- */
41
- get core(): Live<readonly string[]>;
42
- /**
43
- * Ids of plugins that are currently enabled.
44
- *
45
- * @reactive
46
- */
47
- get enabled(): Live<readonly string[]>;
48
- /**
49
- * Modules of plugins which are currently enabled.
50
- *
51
- * @reactive
52
- */
53
- get modules(): Live<readonly PluginModule[]>;
54
- /**
55
- * Ids of modules which are currently active.
56
- *
57
- * @reactive
58
- */
59
- get active(): Live<readonly string[]>;
60
- /**
61
- * Ids of events which have been fired.
62
- *
63
- * @reactive
64
- */
65
- get eventsFired(): Live<readonly string[]>;
66
- /**
67
- * Ids of modules which are pending reset.
68
- *
69
- * @reactive
70
- */
71
- get pendingReset(): Live<readonly string[]>;
72
- /**
73
- * Adds a plugin to the manager via the plugin loader.
74
- * @param id The id of the plugin.
75
- */
76
- add(id: string): Promise<boolean>;
77
- /**
78
- * Enables a plugin.
79
- * @param id The id of the plugin.
80
- */
81
- enable(id: string): Promise<boolean>;
82
- /**
83
- * Removes a plugin from the manager.
84
- * @param id The id of the plugin.
85
- */
86
- remove(id: string): boolean;
87
- /**
88
- * Disables a plugin.
89
- * @param id The id of the plugin.
90
- */
91
- disable(id: string): Promise<boolean>;
92
- /**
93
- * Activates plugins based on the activation event.
94
- * @param event The activation event.
95
- * @returns Whether the activation was successful.
96
- */
97
- activate(event: ActivationEvent | string): Promise<boolean>;
98
- /**
99
- * Deactivates all of the modules for a plugin.
100
- * @param id The id of the plugin.
101
- * @returns Whether the deactivation was successful.
102
- */
103
- deactivate(id: string): Promise<boolean>;
104
- /**
105
- * Re-activates the modules that were activated by the event.
106
- * @param event The activation event.
107
- * @returns Whether the reset was successful.
108
- */
109
- reset(event: ActivationEvent | string): Promise<boolean>;
110
- private _addPlugin;
111
- private _removePlugin;
112
- private _addModule;
113
- private _removeModule;
114
- private _getPlugin;
115
- private _getActiveModules;
116
- private _getInactiveModules;
117
- private _getActiveModulesByEvent;
118
- private _getInactiveModulesByEvent;
119
- private _setPendingResetByModule;
120
- private _loadModule;
121
- private _contributeCapabilities;
122
- private _deactivate;
123
- private _deactivateModule;
124
- private _reset;
125
- }
126
- //# sourceMappingURL=manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/core/manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAW/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,IAAI,EAAQ,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAsB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,KAAK,eAAe,EAAgC,MAAM,UAAU,CAAC;AAC9E,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAO1D,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;CAC9B,CAAC;AAiBF,qBAAa,aAAa;IACxB,QAAQ,CAAC,UAAU;eAAsB,MAAM;eAAS,YAAY,GAAG,WAAW,GAAG,OAAO;gBAAU,GAAG;OAAM;IAC/G,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAGrC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2B;IAClD,OAAO,CAAC,QAAQ,CAAC,aAAa,C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AAO,CAAC;IAI3D;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxD,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,wBAAwB;IA+HhC,OAAO,CAAC,WAAW,CA4Cf;IAEJ,OAAO,CAAC,uBAAuB;IAU/B,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,iBAAiB;IAmCzB,OAAO,CAAC,MAAM;CAiBf"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=manager.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.test.d.ts","sourceRoot":"","sources":["../../../../src/core/manager.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare const IntentPlugin: import("..").PluginFactory<void>;
2
- //# sourceMappingURL=IntentPlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IntentPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/IntentPlugin.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,YAAY,kCAUvB,CAAC"}
@@ -1,36 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- export declare namespace IntentAction {
3
- const Track_base: Schema.TaggedClass<Track, `${string}/action/track`, {
4
- readonly _tag: Schema.tag<`${string}/action/track`>;
5
- } & {
6
- input: Schema.Struct<{
7
- intents: Schema.Array$<typeof Schema.String>;
8
- error: Schema.optional<typeof Schema.String>;
9
- }>;
10
- output: typeof Schema.Void;
11
- }>;
12
- /**
13
- * Log an intent.
14
- */
15
- export class Track extends Track_base {
16
- }
17
- const ShowUndo_base: Schema.TaggedClass<ShowUndo, `${string}/action/show-undo`, {
18
- readonly _tag: Schema.tag<`${string}/action/show-undo`>;
19
- } & {
20
- input: Schema.Struct<{
21
- message: Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Tuple2<typeof Schema.String, Schema.mutable<Schema.Struct<{
22
- ns: typeof Schema.String;
23
- count: Schema.optional<typeof Schema.Number>;
24
- defaultValue: Schema.optional<typeof Schema.String>;
25
- }>>>>]>;
26
- }>;
27
- output: typeof Schema.Void;
28
- }>;
29
- /**
30
- * Fired after an intent is dispatched if the intent is undoable.
31
- */
32
- export class ShowUndo extends ShowUndo_base {
33
- }
34
- export {};
35
- }
36
- //# sourceMappingURL=actions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,yBAAiB,YAAY,CAAC;;;;;;;;;;IAC5B;;OAEG;IACH,MAAM,OAAO,KAAM,SAAQ,UAMzB;KAAG;;;;;;;;;;;;;IAEL;;OAEG;IACH,MAAM,OAAO,QAAS,SAAQ,aAK5B;KAAG;;CACN"}
@@ -1,16 +0,0 @@
1
- /**
2
- * NOTE: Messages should be sentences (Start with a capital letter and end with a period).
3
- * Errors can optionally include a JSON context object.
4
- */
5
- export declare class BaseError extends Error {
6
- readonly code: string;
7
- readonly context?: Record<string, any> | undefined;
8
- constructor(code: string, message?: string, context?: Record<string, any> | undefined);
9
- }
10
- export declare class NoResolversError extends BaseError {
11
- constructor(action: string);
12
- }
13
- export declare class CycleDetectedError extends BaseError {
14
- constructor(context?: Record<string, any>);
15
- }
16
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/errors.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAEhC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAErB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gBAF7B,IAAI,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,EACP,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAA;CAQzC;AAED,qBAAa,gBAAiB,SAAQ,SAAS;gBACjC,MAAM,EAAE,MAAM;CAG3B;AAGD,qBAAa,kBAAmB,SAAQ,SAAS;gBACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAO1C"}
@@ -1,6 +0,0 @@
1
- export * from './actions';
2
- export * from './errors';
3
- export * from './intent';
4
- export * from './intent-dispatcher';
5
- export * from './IntentPlugin';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -1,139 +0,0 @@
1
- import * as Effect from 'effect/Effect';
2
- import type * as Types from 'effect/Types';
3
- import { type GuardedType, type MaybePromise, type Position } from '@dxos/util';
4
- import { type PluginContext } from '../core';
5
- import { type AnyIntentChain, type Intent, type IntentChain, type IntentData, type IntentParams, type IntentResultData, type IntentSchema, type Label } from './intent';
6
- /**
7
- * The return value of an intent effect.
8
- */
9
- export type IntentEffectResult<Input, Output> = {
10
- /**
11
- * The output of the action that was performed.
12
- *
13
- * If the intent is apart of a chain of intents, the data will be passed to the next intent.
14
- */
15
- data?: Output;
16
- /**
17
- * If provided, the action will be undoable.
18
- */
19
- undoable?: {
20
- /**
21
- * Message to display to the user when indicating that the action can be undone.
22
- */
23
- message: Label;
24
- /**
25
- * Will be merged with the original intent data when firing the undo intent.
26
- */
27
- data?: Partial<Input>;
28
- };
29
- /**
30
- * An error that occurred while performing the action.
31
- *
32
- * If the intent is apart of a chain of intents and an error occurs, the chain will be aborted.
33
- *
34
- * Return caught error instead of throwing to trigger other intent to be triggered prior to returning the error.
35
- */
36
- error?: Error;
37
- /**
38
- * Other intent chains to be triggered.
39
- */
40
- intents?: AnyIntentChain[];
41
- };
42
- export type AnyIntentEffectResult = IntentEffectResult<any, any>;
43
- /**
44
- * The result of an intent dispatcher.
45
- */
46
- export type IntentDispatcherResult<Input, Output> = Pick<IntentEffectResult<Input, Output>, 'data' | 'error'>;
47
- /**
48
- * The implementation of an intent effect.
49
- */
50
- export type IntentEffectDefinition<Input, Output> = (data: Input, undo: boolean) => MaybePromise<IntentEffectResult<Input, Output> | void> | Effect.Effect<IntentEffectResult<Input, Output> | void, Error>;
51
- /**
52
- * Intent resolver to match intents to their effects.
53
- */
54
- export type IntentResolver<Tag extends string, Fields extends IntentParams, Data = IntentData<Fields>> = Readonly<{
55
- /**
56
- * The schema of the intent to be resolved.
57
- */
58
- intent: IntentSchema<Tag, Fields>;
59
- /**
60
- * Hint to determine the order the resolvers are processed if multiple resolvers are defined for the same intent.
61
- * Only one resolver will be used.
62
- */
63
- position?: Position;
64
- /**
65
- * Optional filter to determine if the resolver should be used.
66
- */
67
- filter?: (data: IntentData<Fields>) => data is Data;
68
- /**
69
- * The effect to be performed when the intent is resolved.
70
- */
71
- resolve: IntentEffectDefinition<GuardedType<IntentResolver<Tag, Fields, Data>['filter']>, IntentResultData<Fields>>;
72
- }>;
73
- export type AnyIntentResolver = IntentResolver<any, any, any>;
74
- /**
75
- * Creates an intent resolver to match intents to their effects.
76
- * @param schema Schema of the intent. Must be a tagged class with input and output schemas.
77
- * @param effect Effect to be performed when the intent is resolved.
78
- * @param params.disposition Determines the priority of the resolver when multiple are resolved.
79
- * @param params.filter Optional filter to determine if the resolver should be used.
80
- */
81
- export declare const createResolver: <Tag extends string, Fields extends IntentParams, Data = IntentData<Fields>>(resolver: IntentResolver<Tag, Fields, Data>) => Readonly<{
82
- /**
83
- * The schema of the intent to be resolved.
84
- */
85
- intent: IntentSchema<Tag, Fields>;
86
- /**
87
- * Hint to determine the order the resolvers are processed if multiple resolvers are defined for the same intent.
88
- * Only one resolver will be used.
89
- */
90
- position?: Position;
91
- /**
92
- * Optional filter to determine if the resolver should be used.
93
- */
94
- filter?: ((data: IntentData<Fields>) => data is Data) | undefined;
95
- /**
96
- * The effect to be performed when the intent is resolved.
97
- */
98
- resolve: IntentEffectDefinition<Data, IntentResultData<Fields>>;
99
- }>;
100
- /**
101
- * Invokes intents and returns the result.
102
- */
103
- export type PromiseIntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>) => Promise<Types.Simplify<IntentDispatcherResult<IntentData<Fields>, IntentResultData<Fields>>>>;
104
- /**
105
- * Creates an effect for intents.
106
- */
107
- export type IntentDispatcher = <Fields extends IntentParams>(intent: IntentChain<any, any, any, Fields>, depth?: number) => Effect.Effect<Types.Simplify<Required<IntentDispatcherResult<IntentData<Fields>, IntentResultData<Fields>>>['data']>, Error>;
108
- type IntentResult<Tag extends string, Fields extends IntentParams> = IntentEffectResult<IntentData<Fields>, IntentResultData<Fields>> & {
109
- _intent: Intent<Tag, Fields>;
110
- };
111
- export type AnyIntentResult = IntentResult<any, any>;
112
- /**
113
- * Invokes the most recent undoable intent with undo flags.
114
- */
115
- export type PromiseIntentUndo = () => Promise<IntentDispatcherResult<any, any>>;
116
- /**
117
- * Creates an effect which undoes the last intent.
118
- */
119
- export type IntentUndo = () => Effect.Effect<any, Error>;
120
- export type IntentContext = {
121
- dispatch: IntentDispatcher;
122
- dispatchPromise: PromiseIntentDispatcher;
123
- undo: IntentUndo;
124
- undoPromise: PromiseIntentUndo;
125
- };
126
- /**
127
- * Sets of an intent dispatcher.
128
- *
129
- * @param getResolvers A function that returns an array of available intent resolvers.
130
- * @param params.historyLimit The maximum number of intent results to keep in history.
131
- * @param params.executionLimit The maximum recursion depth of intent chains.
132
- */
133
- export declare const createDispatcher: (getResolvers: () => AnyIntentResolver[], { executionLimit, historyLimit }?: {
134
- executionLimit?: number | undefined;
135
- historyLimit?: number | undefined;
136
- }) => IntentContext;
137
- declare const _default: (context: PluginContext) => import("..").Capability<import("..").InterfaceDef<IntentContext>>;
138
- export default _default;
139
- //# sourceMappingURL=intent-dispatcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-dispatcher.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent-dispatcher.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAc,MAAM,YAAY,CAAC;AAG5F,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,SAAS,CAAC;AAI1D,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,KAAK,EAEX,MAAM,UAAU,CAAC;AAKlB;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,KAAK,EAAE,MAAM,IAAI;IAC9C;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC;QAEf;;WAEG;QACH,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;KACvB,CAAC;IAEF;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,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AAC;AAErD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAQzD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,eAAe,EAAE,uBAAuB,CAAC;IACzC,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,cAAc,MAAM,iBAAiB,EAAE,EACvC;;;CAAuE,KACtE,aA+GF,CAAC;yBAKc,SAAS,aAAa;AAAtC,wBA4BE"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=intent-dispatcher.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-dispatcher.test.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent-dispatcher.test.ts"],"names":[],"mappings":""}
@@ -1,63 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- export type IntentParams = {
3
- readonly input: Schema.Schema.All;
4
- readonly output: Schema.Schema.All;
5
- };
6
- export type IntentData<Fields extends IntentParams> = Schema.Schema.Type<Schema.Struct<Fields>> extends {
7
- readonly input: any;
8
- } ? Schema.Schema.Type<Schema.Struct<Fields>>['input'] : any;
9
- export type IntentResultData<Fields extends IntentParams> = Schema.Schema.Type<Schema.Struct<Fields>> extends {
10
- readonly output: any;
11
- } ? Schema.Schema.Type<Schema.Struct<Fields>>['output'] : any;
12
- export type IntentSchema<Tag extends string, Fields extends IntentParams> = Schema.TaggedClass<any, Tag, Fields>;
13
- /**
14
- * An intent is an abstract description of an operation to be performed.
15
- * Intents allow actions to be performed across plugins.
16
- */
17
- export type Intent<Tag extends string, Fields extends IntentParams> = {
18
- _schema: IntentSchema<Tag, Fields>;
19
- /**
20
- * The id of the intent.
21
- */
22
- id: Tag;
23
- /**
24
- * Any data needed to perform the desired action.
25
- */
26
- data: IntentData<Fields>;
27
- /**
28
- * Whether or not the intent is being undone.
29
- */
30
- undo?: boolean;
31
- };
32
- export type AnyIntent = Intent<any, any>;
33
- /**
34
- * Chain of intents to be executed together.
35
- * The result of each intent is merged into the next intent's input data.
36
- */
37
- export type IntentChain<FirstTag extends string, LastTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams> = {
38
- first: Intent<FirstTag, FirstFields>;
39
- last: Intent<LastTag, LastFields>;
40
- all: AnyIntent[];
41
- };
42
- export type AnyIntentChain = IntentChain<any, any, any, any>;
43
- /**
44
- * Creates a typed intent.
45
- * @param schema Schema of the intent. Must be a tagged class with input and output schemas.
46
- * @param data Data fulfilling the input schema of the intent.
47
- * @param params.plugin Optional plugin ID to send the intent to.
48
- * @param params.undo Optional flag to indicate that the intent is being undone. Generally not set manually.
49
- */
50
- export declare const createIntent: <Tag extends string, Fields extends IntentParams>(schema: IntentSchema<Tag, Fields>, data?: IntentData<Fields>, params?: Pick<AnyIntent, "undo">) => IntentChain<Tag, Tag, Fields, Fields>;
51
- /**
52
- * Chain two intents together.
53
- *
54
- * NOTE: Chaining of intents depends on the data inputs and outputs being structs.
55
- */
56
- export declare const chain: <FirstTag extends string, NextTag extends string, FirstFields extends IntentParams, LastFields extends IntentParams, NextFields extends IntentParams>(schema: IntentSchema<NextTag, NextFields>, data?: Omit<IntentData<NextFields>, keyof IntentResultData<LastFields>>, params?: Pick<AnyIntent, "undo">) => (intent: IntentChain<FirstTag, any, FirstFields, LastFields>) => IntentChain<FirstTag, NextTag, FirstFields, NextFields>;
57
- export declare const Label: Schema.Union<[typeof Schema.String, Schema.mutable<Schema.Tuple2<typeof Schema.String, Schema.mutable<Schema.Struct<{
58
- ns: typeof Schema.String;
59
- count: Schema.optional<typeof Schema.Number>;
60
- defaultValue: Schema.optional<typeof Schema.String>;
61
- }>>>>]>;
62
- export type Label = Schema.Schema.Type<typeof Label>;
63
- //# sourceMappingURL=intent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/intent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,MAAM,SAAS,YAAY,IAChD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAA;CAAE,GACrE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAClD,GAAG,CAAC;AAEV,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,YAAY,IACtD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;CAAE,GACtE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GACnD,GAAG,CAAC;AAEV,MAAM,MAAM,YAAY,CAAC,GAAG,SAAS,MAAM,EAAE,MAAM,SAAS,YAAY,IAAI,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAEjH;;;GAGG;AACH,MAAM,MAAM,MAAM,CAAC,GAAG,SAAS,MA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,EAAE,UAAU,CAAC,EACzC,OAAM,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,gBAAgB,CAAC,UAAU,CAAC,CAAM,EAC3E,SAAQ,IAAI,CAAC,SAAS,EAAE,MAAM,CAAM,MAGpC,QAAQ,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,KAC1D,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAexD,CAAC;AAQJ,eAAO,MAAM,KAAK;;;;OAcjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type PluginMeta } from '@dxos/app-framework';
2
- export declare const meta: PluginMeta;
3
- //# sourceMappingURL=meta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/plugin-intent/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,IAAI,EAAE,UAGlB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { Capabilities } from '../common';
2
- declare const _default: () => import("..").Capability<import("..").InterfaceDef<Capabilities.IntentResolver>>;
3
- export default _default;
4
- //# sourceMappingURL=intent-resolver.d.ts.map