@dxos/app-framework 0.8.4-main.e8ec1fe → 0.8.4-main.ef1bc66f44

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 (472) hide show
  1. package/.storybook/main.mts +1 -1
  2. package/.storybook/preview.mts +2 -2
  3. package/dist/lib/browser/capability-7LE5X2NH.mjs +37 -0
  4. package/dist/lib/browser/capability-7LE5X2NH.mjs.map +7 -0
  5. package/dist/lib/browser/capability-DU35RXMD.mjs +34 -0
  6. package/dist/lib/browser/capability-DU35RXMD.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-4DQMLMGU.mjs +44 -0
  8. package/dist/lib/browser/chunk-4DQMLMGU.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-EIFGKQSA.mjs +170 -0
  10. package/dist/lib/browser/chunk-EIFGKQSA.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-FHQTHCX7.mjs +8 -0
  12. package/dist/lib/browser/chunk-FHQTHCX7.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-IGRQWMWW.mjs +80 -0
  14. package/dist/lib/browser/chunk-IGRQWMWW.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  16. package/dist/lib/browser/chunk-KWP6PKIU.mjs +145 -0
  17. package/dist/lib/browser/chunk-KWP6PKIU.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-NPUEVX42.mjs +34 -0
  19. package/dist/lib/browser/chunk-NPUEVX42.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-PKQT6C53.mjs +47 -0
  21. package/dist/lib/browser/chunk-PKQT6C53.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-WGWEEBUV.mjs +807 -0
  23. package/dist/lib/browser/chunk-WGWEEBUV.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-YAFEA4GV.mjs +1 -0
  25. package/dist/lib/browser/chunk-YZQ6NFG4.mjs +781 -0
  26. package/dist/lib/browser/chunk-YZQ6NFG4.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-ZQO3UZ4R.mjs +77 -0
  28. package/dist/lib/browser/chunk-ZQO3UZ4R.mjs.map +7 -0
  29. package/dist/lib/browser/cli/index.mjs +89 -0
  30. package/dist/lib/browser/cli/index.mjs.map +7 -0
  31. package/dist/lib/browser/common/activation-events.mjs +23 -0
  32. package/dist/lib/browser/common/capabilities.mjs +45 -0
  33. package/dist/lib/browser/core/activation-event.mjs +20 -0
  34. package/dist/lib/browser/core/activation-event.mjs.map +7 -0
  35. package/dist/lib/browser/core/capability.mjs +28 -0
  36. package/dist/lib/browser/core/capability.mjs.map +7 -0
  37. package/dist/lib/browser/core/plugin-manager.mjs +15 -0
  38. package/dist/lib/browser/core/plugin-manager.mjs.map +7 -0
  39. package/dist/lib/browser/core/plugin.mjs +27 -0
  40. package/dist/lib/browser/core/plugin.mjs.map +7 -0
  41. package/dist/lib/browser/index.mjs +88 -121
  42. package/dist/lib/browser/index.mjs.map +4 -4
  43. package/dist/lib/browser/invoker-capability-7QW56NOM.mjs +36 -0
  44. package/dist/lib/browser/invoker-capability-7QW56NOM.mjs.map +7 -0
  45. package/dist/lib/browser/meta.json +1 -1
  46. package/dist/lib/browser/testing/index.mjs +72 -22
  47. package/dist/lib/browser/testing/index.mjs.map +4 -4
  48. package/dist/lib/browser/ui/index.mjs +49 -0
  49. package/dist/lib/browser/ui/index.mjs.map +7 -0
  50. package/dist/lib/node-esm/capability-OSVYGK4X.mjs +38 -0
  51. package/dist/lib/node-esm/capability-OSVYGK4X.mjs.map +7 -0
  52. package/dist/lib/node-esm/capability-SR2EIZFP.mjs +35 -0
  53. package/dist/lib/node-esm/capability-SR2EIZFP.mjs.map +7 -0
  54. package/dist/lib/node-esm/chunk-64IMLAS2.mjs +78 -0
  55. package/dist/lib/node-esm/chunk-64IMLAS2.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-DHSHRYIB.mjs +171 -0
  59. package/dist/lib/node-esm/chunk-DHSHRYIB.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-DZ2XLAGI.mjs +146 -0
  61. package/dist/lib/node-esm/chunk-DZ2XLAGI.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-J2PHTRHC.mjs +45 -0
  65. package/dist/lib/node-esm/chunk-J2PHTRHC.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-JAZVHID3.mjs +35 -0
  67. package/dist/lib/node-esm/chunk-JAZVHID3.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-OQYHRZYF.mjs +81 -0
  69. package/dist/lib/node-esm/chunk-OQYHRZYF.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-UEWJDI2L.mjs +10 -0
  71. package/dist/lib/node-esm/chunk-UEWJDI2L.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs +782 -0
  73. package/dist/lib/node-esm/chunk-VV4YHPQQ.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-XHAKT6UD.mjs +808 -0
  75. package/dist/lib/node-esm/chunk-XHAKT6UD.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs +2 -0
  77. package/dist/lib/node-esm/chunk-Z4TJPSMP.mjs.map +7 -0
  78. package/dist/lib/node-esm/cli/index.mjs +90 -0
  79. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  80. package/dist/lib/node-esm/common/activation-events.mjs +24 -0
  81. package/dist/lib/node-esm/common/activation-events.mjs.map +7 -0
  82. package/dist/lib/node-esm/common/capabilities.mjs +46 -0
  83. package/dist/lib/node-esm/common/capabilities.mjs.map +7 -0
  84. package/dist/lib/node-esm/core/activation-event.mjs +21 -0
  85. package/dist/lib/node-esm/core/activation-event.mjs.map +7 -0
  86. package/dist/lib/node-esm/core/capability.mjs +29 -0
  87. package/dist/lib/node-esm/core/capability.mjs.map +7 -0
  88. package/dist/lib/node-esm/core/plugin-manager.mjs +16 -0
  89. package/dist/lib/node-esm/core/plugin-manager.mjs.map +7 -0
  90. package/dist/lib/node-esm/core/plugin.mjs +28 -0
  91. package/dist/lib/node-esm/core/plugin.mjs.map +7 -0
  92. package/dist/lib/node-esm/index.mjs +88 -121
  93. package/dist/lib/node-esm/index.mjs.map +4 -4
  94. package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs +37 -0
  95. package/dist/lib/node-esm/invoker-capability-CK4AMF2R.mjs.map +7 -0
  96. package/dist/lib/node-esm/meta.json +1 -1
  97. package/dist/lib/node-esm/testing/index.mjs +72 -22
  98. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  99. package/dist/lib/node-esm/ui/index.mjs +50 -0
  100. package/dist/lib/node-esm/ui/index.mjs.map +7 -0
  101. package/dist/types/src/cli/cli.d.ts +39 -0
  102. package/dist/types/src/cli/cli.d.ts.map +1 -0
  103. package/dist/types/src/cli/index.d.ts +2 -0
  104. package/dist/types/src/cli/index.d.ts.map +1 -0
  105. package/dist/types/src/common/activation-events.d.ts +27 -0
  106. package/dist/types/src/common/activation-events.d.ts.map +1 -0
  107. package/dist/types/src/common/capabilities.d.ts +114 -194
  108. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  109. package/dist/types/src/common/index.d.ts +4 -8
  110. package/dist/types/src/common/index.d.ts.map +1 -1
  111. package/dist/types/src/common/operations.d.ts +33 -0
  112. package/dist/types/src/common/operations.d.ts.map +1 -0
  113. package/dist/types/src/common/translations.d.ts +7 -7
  114. package/dist/types/src/common/translations.d.ts.map +1 -1
  115. package/dist/types/src/context.d.ts +5 -0
  116. package/dist/types/src/context.d.ts.map +1 -0
  117. package/dist/types/src/core/{events.d.ts → activation-event.d.ts} +6 -6
  118. package/dist/types/src/core/activation-event.d.ts.map +1 -0
  119. package/dist/types/src/core/capability-manager.d.ts +43 -0
  120. package/dist/types/src/core/capability-manager.d.ts.map +1 -0
  121. package/dist/types/src/core/capability-manager.test.d.ts +2 -0
  122. package/dist/types/src/core/capability-manager.test.d.ts.map +1 -0
  123. package/dist/types/src/core/capability.d.ts +150 -0
  124. package/dist/types/src/core/capability.d.ts.map +1 -0
  125. package/dist/types/src/core/index.d.ts +5 -4
  126. package/dist/types/src/core/index.d.ts.map +1 -1
  127. package/dist/types/src/core/plugin-manager.d.ts +66 -0
  128. package/dist/types/src/core/plugin-manager.d.ts.map +1 -0
  129. package/dist/types/src/core/plugin-manager.test.d.ts +2 -0
  130. package/dist/types/src/core/plugin-manager.test.d.ts.map +1 -0
  131. package/dist/types/src/core/plugin.d.ts +92 -34
  132. package/dist/types/src/core/plugin.d.ts.map +1 -1
  133. package/dist/types/src/index.d.ts +3 -2
  134. package/dist/types/src/index.d.ts.map +1 -1
  135. package/dist/types/src/plugin-operation/OperationPlugin.d.ts +3 -0
  136. package/dist/types/src/plugin-operation/OperationPlugin.d.ts.map +1 -0
  137. package/dist/types/src/plugin-operation/history/capability.d.ts +7 -0
  138. package/dist/types/src/plugin-operation/history/capability.d.ts.map +1 -0
  139. package/dist/types/src/plugin-operation/history/errors.d.ts +5 -0
  140. package/dist/types/src/plugin-operation/history/errors.d.ts.map +1 -0
  141. package/dist/types/src/plugin-operation/history/history-tracker.d.ts +18 -0
  142. package/dist/types/src/plugin-operation/history/history-tracker.d.ts.map +1 -0
  143. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts +2 -0
  144. package/dist/types/src/plugin-operation/history/history-tracker.test.d.ts.map +1 -0
  145. package/dist/types/src/plugin-operation/history/index.d.ts +6 -0
  146. package/dist/types/src/plugin-operation/history/index.d.ts.map +1 -0
  147. package/dist/types/src/plugin-operation/history/types.d.ts +13 -0
  148. package/dist/types/src/plugin-operation/history/types.d.ts.map +1 -0
  149. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts +101 -0
  150. package/dist/types/src/plugin-operation/history/undo-mapping.d.ts.map +1 -0
  151. package/dist/types/src/plugin-operation/history/undo-registry.d.ts +23 -0
  152. package/dist/types/src/plugin-operation/history/undo-registry.d.ts.map +1 -0
  153. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts +2 -0
  154. package/dist/types/src/plugin-operation/history/undo-registry.test.d.ts.map +1 -0
  155. package/dist/types/src/plugin-operation/index.d.ts +3 -0
  156. package/dist/types/src/plugin-operation/index.d.ts.map +1 -0
  157. package/dist/types/src/plugin-operation/invoker-capability.d.ts +6 -0
  158. package/dist/types/src/plugin-operation/invoker-capability.d.ts.map +1 -0
  159. package/dist/types/src/plugin-operation/meta.d.ts +3 -0
  160. package/dist/types/src/plugin-operation/meta.d.ts.map +1 -0
  161. package/dist/types/src/plugin-operation/testing.d.ts +109 -0
  162. package/dist/types/src/plugin-operation/testing.d.ts.map +1 -0
  163. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts +3 -0
  164. package/dist/types/src/plugin-runtime/RuntimePlugin.d.ts.map +1 -0
  165. package/dist/types/src/plugin-runtime/capability.d.ts +6 -0
  166. package/dist/types/src/plugin-runtime/capability.d.ts.map +1 -0
  167. package/dist/types/src/plugin-runtime/index.d.ts +2 -0
  168. package/dist/types/src/plugin-runtime/index.d.ts.map +1 -0
  169. package/dist/types/src/plugin-runtime/meta.d.ts +3 -0
  170. package/dist/types/src/plugin-runtime/meta.d.ts.map +1 -0
  171. package/dist/types/src/testing/index.d.ts +1 -0
  172. package/dist/types/src/testing/index.d.ts.map +1 -1
  173. package/dist/types/src/testing/service.d.ts +8 -0
  174. package/dist/types/src/testing/service.d.ts.map +1 -0
  175. package/dist/types/src/testing/withPluginManager.d.ts +4 -4
  176. package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
  177. package/dist/types/src/ui/components/App.d.ts +8 -0
  178. package/dist/types/src/ui/components/App.d.ts.map +1 -0
  179. package/dist/types/src/ui/components/App.stories.d.ts.map +1 -0
  180. package/dist/types/src/ui/components/DefaultFallback.d.ts.map +1 -0
  181. package/dist/types/src/ui/components/ErrorBoundary.d.ts.map +1 -0
  182. package/dist/types/src/{playground/playground.stories.d.ts → ui/components/PluginManagerContext.stories.d.ts} +5 -3
  183. package/dist/types/src/ui/components/PluginManagerContext.stories.d.ts.map +1 -0
  184. package/dist/types/src/ui/components/PluginManagerProvider.d.ts +10 -0
  185. package/dist/types/src/ui/components/PluginManagerProvider.d.ts.map +1 -0
  186. package/dist/types/src/ui/components/index.d.ts +5 -0
  187. package/dist/types/src/ui/components/index.d.ts.map +1 -0
  188. package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts +12 -0
  189. package/dist/types/src/ui/components/surface/SurfaceComponent.d.ts.map +1 -0
  190. package/dist/types/src/{react/Surface.stories.d.ts → ui/components/surface/SurfaceComponent.stories.d.ts} +1 -1
  191. package/dist/types/src/ui/components/surface/SurfaceComponent.stories.d.ts.map +1 -0
  192. package/dist/types/src/ui/components/surface/SurfaceInfo.d.ts +11 -0
  193. package/dist/types/src/ui/components/surface/SurfaceInfo.d.ts.map +1 -0
  194. package/dist/types/src/ui/components/surface/context.d.ts +5 -0
  195. package/dist/types/src/ui/components/surface/context.d.ts.map +1 -0
  196. package/dist/types/src/ui/components/surface/index.d.ts +5 -0
  197. package/dist/types/src/ui/components/surface/index.d.ts.map +1 -0
  198. package/dist/types/src/ui/components/surface/types.d.ts +94 -0
  199. package/dist/types/src/ui/components/surface/types.d.ts.map +1 -0
  200. package/dist/types/src/ui/hooks/index.d.ts +7 -0
  201. package/dist/types/src/ui/hooks/index.d.ts.map +1 -0
  202. package/dist/types/src/{react → ui/hooks}/useApp.d.ts +12 -6
  203. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -0
  204. package/dist/types/src/ui/hooks/useCapabilities.d.ts +31 -0
  205. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -0
  206. package/dist/types/src/{react → ui/hooks}/useLoading.d.ts +1 -2
  207. package/dist/types/src/ui/hooks/useLoading.d.ts.map +1 -0
  208. package/dist/types/src/ui/hooks/useOperationResolver.d.ts +19 -0
  209. package/dist/types/src/ui/hooks/useOperationResolver.d.ts.map +1 -0
  210. package/dist/types/src/ui/hooks/useSettingsState.d.ts +10 -0
  211. package/dist/types/src/ui/hooks/useSettingsState.d.ts.map +1 -0
  212. package/dist/types/src/ui/hooks/useSurface.d.ts +3 -0
  213. package/dist/types/src/ui/hooks/useSurface.d.ts.map +1 -0
  214. package/dist/types/src/ui/index.d.ts +4 -0
  215. package/dist/types/src/ui/index.d.ts.map +1 -0
  216. package/dist/types/tsconfig.tsbuildinfo +1 -1
  217. package/moon.yml +10 -3
  218. package/package.json +112 -52
  219. package/src/cli/cli.ts +107 -0
  220. package/src/{playground/debug → cli}/index.ts +1 -1
  221. package/src/common/activation-events.ts +44 -0
  222. package/src/common/capabilities.ts +174 -210
  223. package/src/common/index.ts +4 -8
  224. package/src/common/operations.ts +38 -0
  225. package/src/common/translations.ts +17 -9
  226. package/src/context.ts +9 -0
  227. package/src/core/{events.ts → activation-event.ts} +5 -5
  228. package/src/core/capability-manager.test.ts +151 -0
  229. package/src/core/capability-manager.ts +171 -0
  230. package/src/core/capability.ts +236 -0
  231. package/src/core/index.ts +5 -4
  232. package/src/core/plugin-manager.test.ts +845 -0
  233. package/src/core/plugin-manager.ts +696 -0
  234. package/src/core/plugin.ts +221 -39
  235. package/src/index.ts +3 -2
  236. package/src/plugin-operation/OperationPlugin.ts +25 -0
  237. package/src/plugin-operation/history/capability.ts +37 -0
  238. package/src/plugin-operation/history/errors.ts +11 -0
  239. package/src/plugin-operation/history/history-tracker.test.ts +380 -0
  240. package/src/plugin-operation/history/history-tracker.ts +129 -0
  241. package/src/plugin-operation/history/index.ts +9 -0
  242. package/src/plugin-operation/history/types.ts +17 -0
  243. package/src/plugin-operation/history/undo-mapping.ts +135 -0
  244. package/src/plugin-operation/history/undo-registry.test.ts +73 -0
  245. package/src/plugin-operation/history/undo-registry.ts +54 -0
  246. package/src/plugin-operation/index.ts +6 -0
  247. package/src/plugin-operation/invoker-capability.ts +40 -0
  248. package/src/plugin-operation/meta.ts +11 -0
  249. package/src/plugin-operation/testing.ts +174 -0
  250. package/src/plugin-runtime/RuntimePlugin.ts +20 -0
  251. package/src/plugin-runtime/capability.ts +53 -0
  252. package/src/{playground/layout → plugin-runtime}/index.ts +1 -1
  253. package/src/plugin-runtime/meta.ts +11 -0
  254. package/src/testing/index.ts +1 -0
  255. package/src/testing/service.ts +52 -0
  256. package/src/testing/withPluginManager.stories.tsx +7 -7
  257. package/src/testing/withPluginManager.tsx +21 -23
  258. package/src/ui/components/App.stories.tsx +62 -0
  259. package/src/{react → ui/components}/App.tsx +9 -11
  260. package/src/ui/components/PluginManagerContext.stories.tsx +183 -0
  261. package/src/{react → ui/components}/PluginManagerProvider.ts +3 -3
  262. package/src/ui/components/index.ts +8 -0
  263. package/src/{react/Surface.stories.tsx → ui/components/surface/SurfaceComponent.stories.tsx} +36 -19
  264. package/src/ui/components/surface/SurfaceComponent.tsx +262 -0
  265. package/src/ui/components/surface/SurfaceInfo.tsx +107 -0
  266. package/src/ui/components/surface/context.ts +12 -0
  267. package/src/ui/components/surface/index.ts +8 -0
  268. package/src/ui/components/surface/types.ts +119 -0
  269. package/src/ui/hooks/index.ts +10 -0
  270. package/src/ui/hooks/useApp.tsx +215 -0
  271. package/src/ui/hooks/useCapabilities.ts +67 -0
  272. package/src/{react → ui/hooks}/useLoading.tsx +4 -6
  273. package/src/ui/hooks/useOperationResolver.ts +40 -0
  274. package/src/ui/hooks/useSettingsState.ts +26 -0
  275. package/src/ui/hooks/useSurface.ts +13 -0
  276. package/src/ui/index.ts +7 -0
  277. package/tsconfig.json +10 -31
  278. package/.swc/plugins/linux_x86_64_19.0.0/fce1bdb8e20a094e4af08bad09cc81497ed0e2e7c51223b07d371063cca18429.wasmer-v7 +0 -0
  279. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs +0 -138
  280. package/dist/lib/browser/app-graph-builder-OIEZZC45.mjs.map +0 -7
  281. package/dist/lib/browser/chunk-SCPE4ZO2.mjs +0 -35
  282. package/dist/lib/browser/chunk-SCPE4ZO2.mjs.map +0 -7
  283. package/dist/lib/browser/chunk-VFUKEZIN.mjs +0 -483
  284. package/dist/lib/browser/chunk-VFUKEZIN.mjs.map +0 -7
  285. package/dist/lib/browser/chunk-WPW5VVAX.mjs +0 -1651
  286. package/dist/lib/browser/chunk-WPW5VVAX.mjs.map +0 -7
  287. package/dist/lib/browser/intent-dispatcher-LZ4AE66E.mjs +0 -11
  288. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs +0 -39
  289. package/dist/lib/browser/intent-resolver-QVCKRX6G.mjs.map +0 -7
  290. package/dist/lib/browser/react/index.mjs +0 -34
  291. package/dist/lib/browser/store-CNPHOYTJ.mjs +0 -30
  292. package/dist/lib/browser/store-CNPHOYTJ.mjs.map +0 -7
  293. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs +0 -139
  294. package/dist/lib/node-esm/app-graph-builder-EBU4NVWD.mjs.map +0 -7
  295. package/dist/lib/node-esm/chunk-IJOHO66N.mjs +0 -484
  296. package/dist/lib/node-esm/chunk-IJOHO66N.mjs.map +0 -7
  297. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs +0 -1653
  298. package/dist/lib/node-esm/chunk-XJZGUJ3H.mjs.map +0 -7
  299. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs +0 -37
  300. package/dist/lib/node-esm/chunk-ZX63QUGE.mjs.map +0 -7
  301. package/dist/lib/node-esm/intent-dispatcher-MGOJ3CHD.mjs +0 -12
  302. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs +0 -40
  303. package/dist/lib/node-esm/intent-resolver-URF3HN3G.mjs.map +0 -7
  304. package/dist/lib/node-esm/react/index.mjs +0 -35
  305. package/dist/lib/node-esm/store-RK5B4XEL.mjs +0 -31
  306. package/dist/lib/node-esm/store-RK5B4XEL.mjs.map +0 -7
  307. package/dist/types/src/common/collaboration.d.ts +0 -20
  308. package/dist/types/src/common/collaboration.d.ts.map +0 -1
  309. package/dist/types/src/common/events.d.ts +0 -52
  310. package/dist/types/src/common/events.d.ts.map +0 -1
  311. package/dist/types/src/common/file.d.ts +0 -14
  312. package/dist/types/src/common/file.d.ts.map +0 -1
  313. package/dist/types/src/common/graph.d.ts +0 -21
  314. package/dist/types/src/common/graph.d.ts.map +0 -1
  315. package/dist/types/src/common/layout.d.ts +0 -279
  316. package/dist/types/src/common/layout.d.ts.map +0 -1
  317. package/dist/types/src/common/surface.d.ts +0 -68
  318. package/dist/types/src/common/surface.d.ts.map +0 -1
  319. package/dist/types/src/core/capabilities.d.ts +0 -117
  320. package/dist/types/src/core/capabilities.d.ts.map +0 -1
  321. package/dist/types/src/core/capabilities.test.d.ts +0 -2
  322. package/dist/types/src/core/capabilities.test.d.ts.map +0 -1
  323. package/dist/types/src/core/events.d.ts.map +0 -1
  324. package/dist/types/src/core/manager.d.ts +0 -126
  325. package/dist/types/src/core/manager.d.ts.map +0 -1
  326. package/dist/types/src/core/manager.test.d.ts +0 -2
  327. package/dist/types/src/core/manager.test.d.ts.map +0 -1
  328. package/dist/types/src/playground/debug/Debug.d.ts +0 -6
  329. package/dist/types/src/playground/debug/Debug.d.ts.map +0 -1
  330. package/dist/types/src/playground/debug/index.d.ts +0 -2
  331. package/dist/types/src/playground/debug/index.d.ts.map +0 -1
  332. package/dist/types/src/playground/debug/plugin.d.ts +0 -2
  333. package/dist/types/src/playground/debug/plugin.d.ts.map +0 -1
  334. package/dist/types/src/playground/generator/Main.d.ts +0 -6
  335. package/dist/types/src/playground/generator/Main.d.ts.map +0 -1
  336. package/dist/types/src/playground/generator/Toolbar.d.ts +0 -6
  337. package/dist/types/src/playground/generator/Toolbar.d.ts.map +0 -1
  338. package/dist/types/src/playground/generator/generator.d.ts +0 -7
  339. package/dist/types/src/playground/generator/generator.d.ts.map +0 -1
  340. package/dist/types/src/playground/generator/index.d.ts +0 -3
  341. package/dist/types/src/playground/generator/index.d.ts.map +0 -1
  342. package/dist/types/src/playground/generator/plugin.d.ts +0 -2
  343. package/dist/types/src/playground/generator/plugin.d.ts.map +0 -1
  344. package/dist/types/src/playground/layout/Layout.d.ts +0 -8
  345. package/dist/types/src/playground/layout/Layout.d.ts.map +0 -1
  346. package/dist/types/src/playground/layout/index.d.ts +0 -2
  347. package/dist/types/src/playground/layout/index.d.ts.map +0 -1
  348. package/dist/types/src/playground/layout/plugin.d.ts +0 -2
  349. package/dist/types/src/playground/layout/plugin.d.ts.map +0 -1
  350. package/dist/types/src/playground/logger/Toolbar.d.ts +0 -6
  351. package/dist/types/src/playground/logger/Toolbar.d.ts.map +0 -1
  352. package/dist/types/src/playground/logger/index.d.ts +0 -2
  353. package/dist/types/src/playground/logger/index.d.ts.map +0 -1
  354. package/dist/types/src/playground/logger/plugin.d.ts +0 -2
  355. package/dist/types/src/playground/logger/plugin.d.ts.map +0 -1
  356. package/dist/types/src/playground/logger/schema.d.ts +0 -13
  357. package/dist/types/src/playground/logger/schema.d.ts.map +0 -1
  358. package/dist/types/src/playground/playground.stories.d.ts.map +0 -1
  359. package/dist/types/src/plugin-intent/IntentPlugin.d.ts +0 -2
  360. package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +0 -1
  361. package/dist/types/src/plugin-intent/actions.d.ts +0 -36
  362. package/dist/types/src/plugin-intent/actions.d.ts.map +0 -1
  363. package/dist/types/src/plugin-intent/errors.d.ts +0 -16
  364. package/dist/types/src/plugin-intent/errors.d.ts.map +0 -1
  365. package/dist/types/src/plugin-intent/index.d.ts +0 -6
  366. package/dist/types/src/plugin-intent/index.d.ts.map +0 -1
  367. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +0 -139
  368. package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +0 -1
  369. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts +0 -2
  370. package/dist/types/src/plugin-intent/intent-dispatcher.test.d.ts.map +0 -1
  371. package/dist/types/src/plugin-intent/intent.d.ts +0 -63
  372. package/dist/types/src/plugin-intent/intent.d.ts.map +0 -1
  373. package/dist/types/src/plugin-intent/meta.d.ts +0 -3
  374. package/dist/types/src/plugin-intent/meta.d.ts.map +0 -1
  375. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts +0 -2
  376. package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +0 -1
  377. package/dist/types/src/plugin-settings/actions.d.ts +0 -25
  378. package/dist/types/src/plugin-settings/actions.d.ts.map +0 -1
  379. package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -4
  380. package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
  381. package/dist/types/src/plugin-settings/index.d.ts +0 -3
  382. package/dist/types/src/plugin-settings/index.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/meta.d.ts +0 -3
  386. package/dist/types/src/plugin-settings/meta.d.ts.map +0 -1
  387. package/dist/types/src/plugin-settings/store.d.ts +0 -5
  388. package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
  389. package/dist/types/src/plugin-settings/translations.d.ts +0 -11
  390. package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
  391. package/dist/types/src/react/App.d.ts +0 -10
  392. package/dist/types/src/react/App.d.ts.map +0 -1
  393. package/dist/types/src/react/App.stories.d.ts.map +0 -1
  394. package/dist/types/src/react/DefaultFallback.d.ts.map +0 -1
  395. package/dist/types/src/react/ErrorBoundary.d.ts.map +0 -1
  396. package/dist/types/src/react/IntentContext.d.ts +0 -8
  397. package/dist/types/src/react/IntentContext.d.ts.map +0 -1
  398. package/dist/types/src/react/PluginManagerProvider.d.ts +0 -10
  399. package/dist/types/src/react/PluginManagerProvider.d.ts.map +0 -1
  400. package/dist/types/src/react/Surface.d.ts +0 -12
  401. package/dist/types/src/react/Surface.d.ts.map +0 -1
  402. package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
  403. package/dist/types/src/react/common.d.ts +0 -13
  404. package/dist/types/src/react/common.d.ts.map +0 -1
  405. package/dist/types/src/react/index.d.ts +0 -9
  406. package/dist/types/src/react/index.d.ts.map +0 -1
  407. package/dist/types/src/react/types.d.ts +0 -14
  408. package/dist/types/src/react/types.d.ts.map +0 -1
  409. package/dist/types/src/react/useApp.d.ts.map +0 -1
  410. package/dist/types/src/react/useCapabilities.d.ts +0 -13
  411. package/dist/types/src/react/useCapabilities.d.ts.map +0 -1
  412. package/dist/types/src/react/useIntentResolver.d.ts +0 -3
  413. package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
  414. package/dist/types/src/react/useLoading.d.ts.map +0 -1
  415. package/src/common/collaboration.ts +0 -18
  416. package/src/common/events.ts +0 -79
  417. package/src/common/file.ts +0 -22
  418. package/src/common/graph.ts +0 -30
  419. package/src/common/layout.ts +0 -277
  420. package/src/common/surface.ts +0 -88
  421. package/src/core/capabilities.test.ts +0 -136
  422. package/src/core/capabilities.ts +0 -263
  423. package/src/core/manager.test.ts +0 -516
  424. package/src/core/manager.ts +0 -604
  425. package/src/playground/debug/Debug.tsx +0 -39
  426. package/src/playground/debug/plugin.ts +0 -16
  427. package/src/playground/generator/Main.tsx +0 -70
  428. package/src/playground/generator/Toolbar.tsx +0 -47
  429. package/src/playground/generator/generator.ts +0 -48
  430. package/src/playground/generator/index.ts +0 -6
  431. package/src/playground/generator/plugin.ts +0 -22
  432. package/src/playground/layout/Layout.tsx +0 -33
  433. package/src/playground/layout/plugin.ts +0 -18
  434. package/src/playground/logger/Toolbar.tsx +0 -30
  435. package/src/playground/logger/index.ts +0 -5
  436. package/src/playground/logger/plugin.ts +0 -41
  437. package/src/playground/logger/schema.ts +0 -12
  438. package/src/playground/playground.stories.tsx +0 -46
  439. package/src/plugin-intent/IntentPlugin.ts +0 -20
  440. package/src/plugin-intent/actions.ts +0 -31
  441. package/src/plugin-intent/errors.ts +0 -40
  442. package/src/plugin-intent/index.ts +0 -9
  443. package/src/plugin-intent/intent-dispatcher.test.ts +0 -286
  444. package/src/plugin-intent/intent-dispatcher.ts +0 -342
  445. package/src/plugin-intent/intent.ts +0 -154
  446. package/src/plugin-intent/meta.ts +0 -10
  447. package/src/plugin-settings/SettingsPlugin.ts +0 -34
  448. package/src/plugin-settings/actions.ts +0 -25
  449. package/src/plugin-settings/app-graph-builder.ts +0 -160
  450. package/src/plugin-settings/index.ts +0 -6
  451. package/src/plugin-settings/intent-resolver.ts +0 -35
  452. package/src/plugin-settings/meta.ts +0 -10
  453. package/src/plugin-settings/store.ts +0 -33
  454. package/src/plugin-settings/translations.ts +0 -19
  455. package/src/react/App.stories.tsx +0 -33
  456. package/src/react/IntentContext.tsx +0 -35
  457. package/src/react/Surface.tsx +0 -109
  458. package/src/react/common.ts +0 -13
  459. package/src/react/index.ts +0 -14
  460. package/src/react/types.ts +0 -37
  461. package/src/react/useApp.tsx +0 -165
  462. package/src/react/useCapabilities.ts +0 -31
  463. package/src/react/useIntentResolver.ts +0 -22
  464. /package/dist/lib/browser/{intent-dispatcher-LZ4AE66E.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  465. /package/dist/lib/browser/{react/index.mjs.map → chunk-YAFEA4GV.mjs.map} +0 -0
  466. /package/dist/lib/{node-esm/intent-dispatcher-MGOJ3CHD.mjs.map → browser/common/activation-events.mjs.map} +0 -0
  467. /package/dist/lib/{node-esm/react/index.mjs.map → browser/common/capabilities.mjs.map} +0 -0
  468. /package/dist/types/src/{react → ui/components}/App.stories.d.ts +0 -0
  469. /package/dist/types/src/{react → ui/components}/DefaultFallback.d.ts +0 -0
  470. /package/dist/types/src/{react → ui/components}/ErrorBoundary.d.ts +0 -0
  471. /package/src/{react → ui/components}/DefaultFallback.tsx +0 -0
  472. /package/src/{react → ui/components}/ErrorBoundary.tsx +0 -0
@@ -1,7 +1,45 @@
1
- import { type MaybePromise } from '@dxos/util';
2
- import { type AnyCapability, type PluginContext } from './capabilities';
3
- import { type ActivationEvent, type ActivationEvents } from './events';
4
- interface PluginModuleInterface {
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Pipeable from 'effect/Pipeable';
4
+ import type * as ActivationEvent from './activation-event';
5
+ import * as Capability from './capability';
6
+ import type * as PluginManager from './plugin-manager';
7
+ declare const Service_base: Context.TagClass<Service, "@dxos/app-framework/PluginManager", PluginManager.PluginManager>;
8
+ /**
9
+ * Effect Context.Tag for accessing PluginManager via the Effect layer system.
10
+ * This allows lifecycle operations to access the plugin manager without having it passed as an argument.
11
+ */
12
+ export declare class Service extends Service_base {
13
+ }
14
+ /**
15
+ * Activates plugins based on the activation event.
16
+ * Accesses the PluginManager via the Effect layer system.
17
+ * @param event The activation event.
18
+ * @returns Whether the activation was successful.
19
+ */
20
+ export declare const activate: (event: ActivationEvent.ActivationEvent) => Effect.Effect<boolean, Error, Service>;
21
+ /**
22
+ * Re-activates the modules that were activated by the event.
23
+ * Accesses the PluginManager via the Effect layer system.
24
+ * @param event The activation event.
25
+ * @returns Whether the reset was successful.
26
+ */
27
+ export declare const reset: (event: ActivationEvent.ActivationEvent) => Effect.Effect<boolean, Error, Service>;
28
+ /**
29
+ * Identifier denoting a PluginModule.
30
+ */
31
+ export declare const PluginModuleTypeId: unique symbol;
32
+ export type PluginModuleTypeId = typeof PluginModuleTypeId;
33
+ /**
34
+ * Type guard to check if a value is a PluginModule.
35
+ */
36
+ export declare const isPluginModule: (value: unknown) => value is PluginModule;
37
+ /**
38
+ * A unit of containment of modular functionality that can be provided to an application.
39
+ * Activation of a module is async allowing for code to split and loaded lazily.
40
+ */
41
+ export interface PluginModule {
42
+ readonly [PluginModuleTypeId]: PluginModuleTypeId;
5
43
  /**
6
44
  * Unique id of the module.
7
45
  */
@@ -9,41 +47,30 @@ interface PluginModuleInterface {
9
47
  /**
10
48
  * Events for which the module will be activated.
11
49
  */
12
- activatesOn: ActivationEvents;
50
+ activatesOn: ActivationEvent.Events;
13
51
  /**
14
52
  * Events which the plugin depends on being activated.
15
53
  * Plugin is marked as needing reset a plugin activated by a dependent event is removed.
16
54
  * Events are automatically activated before activation of the plugin.
17
55
  */
18
- activatesBefore?: ActivationEvent[];
56
+ activatesBefore?: ActivationEvent.ActivationEvent[];
19
57
  /**
20
58
  * Events which this plugin triggers upon activation.
21
59
  */
22
- activatesAfter?: ActivationEvent[];
60
+ activatesAfter?: ActivationEvent.ActivationEvent[];
23
61
  /**
24
62
  * Called when the module is activated.
25
- * @param context The plugin context.
63
+ * CapabilityManager is accessed via the Effect layer system (Capability.Service).
64
+ * PluginManager is accessed via Plugin.Service.
65
+ * @param props Optional props passed to the module.
26
66
  * @returns The capabilities of the module.
27
67
  */
28
- activate: (context: PluginContext) => MaybePromise<AnyCapability | AnyCapability[]> | Promise<() => Promise<AnyCapability | AnyCapability[]>>;
29
- }
30
- /**
31
- * A unit of containment of modular functionality that can be provided to an application.
32
- * Activation of a module is async allowing for code to split and loaded lazily.
33
- */
34
- export declare class PluginModule implements PluginModuleInterface {
35
- readonly id: PluginModuleInterface['id'];
36
- readonly activatesOn: PluginModuleInterface['activatesOn'];
37
- readonly activatesBefore?: PluginModuleInterface['activatesBefore'];
38
- readonly activatesAfter?: PluginModuleInterface['activatesAfter'];
39
- readonly activate: PluginModuleInterface['activate'];
40
- constructor(options: PluginModuleInterface);
68
+ activate: (props?: any) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service | Service | never>;
41
69
  }
42
- /**
43
- * Helper to define a module.
44
- */
45
- export declare const defineModule: (options: PluginModuleInterface) => PluginModule;
46
- export type PluginMeta = {
70
+ export type PluginModuleOptions = Omit<PluginModule, 'id' | typeof PluginModuleTypeId> & {
71
+ id?: string;
72
+ };
73
+ export type Meta = {
47
74
  /**
48
75
  * Globally unique ID.
49
76
  *
@@ -85,21 +112,52 @@ export type PluginMeta = {
85
112
  */
86
113
  iconHue?: string;
87
114
  };
115
+ /**
116
+ * Identifier denoting a Plugin.
117
+ */
118
+ export declare const PluginTypeId: unique symbol;
119
+ export type PluginTypeId = typeof PluginTypeId;
120
+ /**
121
+ * Type guard to check if a value is a Plugin.
122
+ */
123
+ export declare const isPlugin: (value: unknown) => value is Plugin;
88
124
  /**
89
125
  * A collection of modules that are be enabled/disabled as a unit.
90
126
  * Plugins provide things such as components, state, actions, etc. to the application.
91
127
  */
92
- export declare class Plugin {
93
- readonly meta: PluginMeta;
94
- readonly modules: PluginModule[];
95
- constructor(meta: PluginMeta, modules: PluginModule[]);
128
+ export interface Plugin {
129
+ readonly [PluginTypeId]: PluginTypeId;
130
+ readonly meta: Readonly<Meta>;
131
+ readonly modules: ReadonlyArray<PluginModule>;
132
+ }
133
+ /**
134
+ * Builder interface for creating plugins incrementally.
135
+ */
136
+ export interface PluginBuilder<T = void> extends Pipeable.Pipeable {
137
+ readonly meta: Meta;
138
+ readonly modules: ReadonlyArray<PluginModuleOptions | ((options: T) => PluginModuleOptions)>;
139
+ addModule(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;
96
140
  }
97
- export type PluginFactory<T = void> = ((args: T) => Plugin) & {
98
- meta: PluginMeta;
141
+ /**
142
+ * Creates a new PluginBuilder to start building a plugin.
143
+ */
144
+ export declare const define: <T = void>(meta: Meta) => PluginBuilder<T>;
145
+ /**
146
+ * Adds a module to a plugin builder.
147
+ * Supports both pipeline and direct call styles.
148
+ * Modules can be either PluginModuleOptions or functions that receive options.
149
+ */
150
+ export declare function addModule<T>(moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): (builder: PluginBuilder<T>) => PluginBuilder<T>;
151
+ export declare function addModule<T>(builder: PluginBuilder<T>, moduleOptions: PluginModuleOptions | ((options: T) => PluginModuleOptions)): PluginBuilder<T>;
152
+ export type PluginFactory<T = void> = ((options: T) => Plugin) & {
153
+ meta: Meta;
99
154
  };
100
155
  /**
101
- * Helper to define a plugin.
156
+ * Creates a Plugin from a builder.
157
+ * Supports both pipeline and direct call styles.
158
+ * Always returns a factory function (options: T) => Plugin.
159
+ * When T is void, the function takes no arguments: () => Plugin.
102
160
  */
103
- export declare const definePlugin: <T = void>(meta: PluginMeta, provider: (args: T) => PluginModule[]) => PluginFactory<T>;
161
+ export declare function make<T>(builder: PluginBuilder<T>): PluginFactory<T>;
104
162
  export {};
105
163
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/core/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,qBAAqB;IAC7B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,gBAAgB,CAAC;IAE9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IAEpC;;OAEG;IACH,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,EAAE,CACR,OAAO,EAAE,aAAa,KACnB,YAAY,CAAC,aAAa,GAAG,aAAa,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,aAAa,GAAG,aAAa,EAAE,CAAC,CAAC,CAAC;CAC9G;AAED;;;GAGG;AAEH,qBAAa,YAAa,YAAW,qBAAqB;IACxD,QAAQ,CAAC,EAAE,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC3D,QAAQ,CAAC,eAAe,CAAC,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IACpE,QAAQ,CAAC,cAAc,CAA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context';
2
3
  export * from './core';
3
- export * from './plugin-intent';
4
- export * from './plugin-settings';
4
+ export * from './plugin-operation';
5
+ export * from './plugin-runtime';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '../core';
2
+ export declare const OperationPlugin: Plugin.PluginFactory<void>;
3
+ //# sourceMappingURL=OperationPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationPlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/OperationPlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAO7C,eAAO,MAAM,eAAe,4BAY3B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '../../core';
3
+ import * as HistoryTracker from './history-tracker';
4
+ import * as UndoRegistry from './undo-registry';
5
+ declare const _default: (props?: void | undefined) => Effect.Effect<[Capability.Capability<Capability.InterfaceDef<UndoRegistry.UndoRegistry>>, Capability.Capability<Capability.InterfaceDef<HistoryTracker.HistoryTracker>>], Error, Capability.Service>;
6
+ export default _default;
7
+ //# sourceMappingURL=capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;;AAMhD,wBAkBE"}
@@ -0,0 +1,5 @@
1
+ import { OperationError } from '@dxos/operation';
2
+ export declare class EmptyHistoryError extends OperationError {
3
+ constructor();
4
+ }
5
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBAAa,iBAAkB,SAAQ,cAAc;;CAIpD"}
@@ -0,0 +1,18 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { type OperationInvoker } from '@dxos/operation';
3
+ import type { UndoRegistry } from './undo-registry';
4
+ /**
5
+ * HistoryTracker interface - tracks operation history and provides undo.
6
+ */
7
+ export interface HistoryTracker {
8
+ undo: () => Effect.Effect<void, Error>;
9
+ undoPromise: () => Promise<{
10
+ error?: Error;
11
+ }>;
12
+ canUndo: () => boolean;
13
+ }
14
+ /**
15
+ * Creates a HistoryTracker that subscribes to invocation events and provides undo.
16
+ */
17
+ export declare const make: (invoker: OperationInvoker.OperationInvokerInternal, undoRegistry: UndoRegistry) => HistoryTracker;
18
+ //# sourceMappingURL=history-tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-tracker.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/history-tracker.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQpD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,WAAW,EAAE,MAAM,OAAO,CAAC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAC9C,OAAO,EAAE,MAAM,OAAO,CAAC;CACxB;AAMD;;GAEG;AACH,eAAO,MAAM,IAAI,GACf,SAAS,gBAAgB,CAAC,wBAAwB,EAClD,cAAc,YAAY,KACzB,cAqFF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=history-tracker.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-tracker.test.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/history-tracker.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export * from './errors';
2
+ export * from './types';
3
+ export * as UndoMapping from './undo-mapping';
4
+ export * as UndoRegistry from './undo-registry';
5
+ export * as HistoryTracker from './history-tracker';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Operation } from '@dxos/operation';
2
+ /**
3
+ * History entry stored by HistoryTracker.
4
+ */
5
+ export type HistoryEntry = {
6
+ operation: Operation.Definition<any, any>;
7
+ input: any;
8
+ output: any;
9
+ inverse: Operation.Definition<any, any>;
10
+ inverseInput: any;
11
+ timestamp: number;
12
+ };
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1C,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;IACZ,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxC,YAAY,EAAE,GAAG,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,101 @@
1
+ import type { Operation } from '@dxos/operation';
2
+ /**
3
+ * Label type for translatable text (canonical definition in @dxos/app-toolkit).
4
+ */
5
+ type Label = string | [string, {
6
+ ns: string;
7
+ count?: number;
8
+ defaultValue?: string;
9
+ }];
10
+ /**
11
+ * Extract the input type from an OperationDefinition.
12
+ */
13
+ export type InputOf<T> = T extends Operation.Definition<infer I, any> ? I : never;
14
+ /**
15
+ * Extract the output type from an OperationDefinition.
16
+ */
17
+ export type OutputOf<T> = T extends Operation.Definition<any, infer O> ? O : never;
18
+ /**
19
+ * Message provider for undo toast.
20
+ * Can be a static Label or a function that derives the message from input/output.
21
+ */
22
+ export type MessageProvider<Op extends Operation.Definition<any, any>> = Label | ((input: InputOf<Op>, output: OutputOf<Op>) => Label);
23
+ /**
24
+ * Undo mapping that links a forward operation to its inverse.
25
+ * Type parameters ensure deriveContext has correctly typed arguments.
26
+ *
27
+ * @template Op - The forward operation definition type.
28
+ * @template Inv - The inverse operation definition type.
29
+ */
30
+ export interface UndoMapping<Op extends Operation.Definition<any, any> = Operation.Definition<any, any>, Inv extends Operation.Definition<any, any> = Operation.Definition<any, any>> {
31
+ /** The forward operation. */
32
+ readonly operation: Op;
33
+ /** The inverse operation to invoke for undo. */
34
+ readonly inverse: Inv;
35
+ /**
36
+ * Derives the input for the inverse operation from the forward operation's input and output.
37
+ * @param input - The input that was passed to the forward operation.
38
+ * @param output - The output that was returned by the forward operation.
39
+ * @returns The input to pass to the inverse operation, or undefined to indicate the operation is not undoable.
40
+ */
41
+ readonly deriveContext: (input: InputOf<Op>, output: OutputOf<Op>) => InputOf<Inv> | undefined;
42
+ /**
43
+ * Optional message to show in the undo toast.
44
+ * Can be a static Label or a function that derives the message from input/output.
45
+ */
46
+ readonly message?: MessageProvider<Op>;
47
+ }
48
+ /**
49
+ * Props for creating an UndoMapping.
50
+ */
51
+ export interface UndoMappingProps<Op extends Operation.Definition<any, any>, Inv extends Operation.Definition<any, any>> {
52
+ /** The forward operation. */
53
+ operation: Op;
54
+ /** The inverse operation to invoke for undo. */
55
+ inverse: Inv;
56
+ /**
57
+ * Derives the input for the inverse operation from the forward operation's input and output.
58
+ * Return undefined to indicate the operation is not undoable.
59
+ */
60
+ deriveContext: (input: InputOf<Op>, output: OutputOf<Op>) => InputOf<Inv> | undefined;
61
+ /**
62
+ * Optional message to show in the undo toast.
63
+ * Can be a static Label or a function that derives the message from input/output.
64
+ */
65
+ message?: MessageProvider<Op>;
66
+ }
67
+ /**
68
+ * Creates a type-safe undo mapping.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * // Static message
73
+ * const mapping = UndoMapping.make({
74
+ * operation: DeleteThread,
75
+ * inverse: RestoreThread,
76
+ * deriveContext: (input, output) => ({
77
+ * thread: output.thread,
78
+ * anchor: output.anchor,
79
+ * }),
80
+ * message: ['thread deleted label', { ns: '@dxos/plugin-thread' }],
81
+ * });
82
+ *
83
+ * // Dynamic message based on input/output
84
+ * const mapping = UndoMapping.make({
85
+ * operation: RemoveObjects,
86
+ * inverse: RestoreObjects,
87
+ * deriveContext: (_input, output) => output,
88
+ * message: (input, _output) =>
89
+ * input.objects.length === 1
90
+ * ? ['object deleted label', { ns: getTypename(input.objects[0]) }]
91
+ * : ['objects deleted label', { ns: '@dxos/plugin-space' }],
92
+ * });
93
+ * ```
94
+ */
95
+ export declare const make: <Op extends Operation.Definition<any, any>, Inv extends Operation.Definition<any, any>>(props: UndoMappingProps<Op, Inv>) => UndoMapping<Op, Inv>;
96
+ /**
97
+ * Resolves a message provider to a Label.
98
+ */
99
+ export declare const resolveMessage: <Op extends Operation.Definition<any, any>>(message: MessageProvider<Op> | undefined, input: InputOf<Op>, output: OutputOf<Op>) => Label | undefined;
100
+ export {};
101
+ //# sourceMappingURL=undo-mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-mapping.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/undo-mapping.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,KAAK,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAElF;;GAEG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,IACjE,KAAK,GACL,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC;AAE1D;;;;;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AAI,EAAE,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EACxG,OAAO,gBAAgB,CAAC,EAAE,EAAE,GAAG,CAAC,KAC/B,WAAW,CAAC,EAAE,EAAE,GAAG,CAAU,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,EAAE,SAAS,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EACtE,SAAS,eAAe,CAAC,EAAE,CAAC,GAAG,SAAS,EACxC,OAAO,OAAO,CAAC,EAAE,CAAC,EAClB,QAAQ,QAAQ,CAAC,EAAE,CAAC,KACnB,KAAK,GAAG,SAQV,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { Operation } from '@dxos/operation';
2
+ import type * as UndoMapping from './undo-mapping';
3
+ /**
4
+ * Lookup result from UndoRegistry.
5
+ */
6
+ export type UndoMappingResult = {
7
+ inverse: Operation.Definition<any, any>;
8
+ /** Returns undefined to indicate the operation is not undoable. */
9
+ deriveContext: (input: any, output: any) => any | undefined;
10
+ /** Message provider - may be a static Label or a function. */
11
+ message?: UndoMapping.MessageProvider<Operation.Definition<any, any>>;
12
+ };
13
+ /**
14
+ * UndoRegistry interface - looks up inverse operations.
15
+ */
16
+ export interface UndoRegistry {
17
+ lookup: (operation: Operation.Definition<any, any>) => UndoMappingResult | undefined;
18
+ }
19
+ /**
20
+ * Creates an UndoRegistry that looks up inverse operations.
21
+ */
22
+ export declare const make: (getMappings: () => UndoMapping.UndoMapping[]) => UndoRegistry;
23
+ //# sourceMappingURL=undo-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-registry.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/undo-registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAMnD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACxC,mEAAmE;IACnE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,GAAG,SAAS,CAAC;IAC5D,8DAA8D;IAC9D,OAAO,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;CACvE,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,iBAAiB,GAAG,SAAS,CAAC;CACtF;AAMD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,aAAa,MAAM,WAAW,CAAC,WAAW,EAAE,KAAG,YAgBnE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=undo-registry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-registry.test.d.ts","sourceRoot":"","sources":["../../../../../src/plugin-operation/history/undo-registry.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './history';
2
+ export * from './OperationPlugin';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { OperationInvoker } from '@dxos/operation';
3
+ import { Capability, Plugin } from '../core';
4
+ declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<OperationInvoker.OperationInvoker>>, never, Capability.Service | Plugin.Service>;
5
+ export default _default;
6
+ //# sourceMappingURL=invoker-capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoker-capability.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/invoker-capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;;AAM7C,wBAwBE"}
@@ -0,0 +1,3 @@
1
+ import { type Plugin } from '../core';
2
+ export declare const meta: Plugin.Meta;
3
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAIzB,CAAC"}
@@ -0,0 +1,109 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import * as Schema from 'effect/Schema';
3
+ import { Operation, type OperationInvoker, OperationResolver } from '@dxos/operation';
4
+ export declare const Compute: Omit<{
5
+ readonly schema: {
6
+ readonly input: Schema.Struct<{
7
+ value: typeof Schema.Number;
8
+ }>;
9
+ readonly output: Schema.Struct<{
10
+ value: typeof Schema.Number;
11
+ }>;
12
+ };
13
+ readonly meta: {
14
+ readonly key: "test.compute";
15
+ };
16
+ }, "executionMode"> & import("effect/Pipeable").Pipeable & {
17
+ readonly executionMode: "sync" | "async";
18
+ };
19
+ export declare const HalveCompute: Omit<{
20
+ readonly schema: {
21
+ readonly input: Schema.Struct<{
22
+ value: typeof Schema.Number;
23
+ }>;
24
+ readonly output: Schema.Struct<{
25
+ value: typeof Schema.Number;
26
+ }>;
27
+ };
28
+ readonly meta: {
29
+ readonly key: "test.halve-compute";
30
+ };
31
+ }, "executionMode"> & import("effect/Pipeable").Pipeable & {
32
+ readonly executionMode: "sync" | "async";
33
+ };
34
+ export declare const ToString: Omit<{
35
+ readonly schema: {
36
+ readonly input: Schema.Struct<{
37
+ value: typeof Schema.Number;
38
+ }>;
39
+ readonly output: Schema.Struct<{
40
+ string: typeof Schema.String;
41
+ }>;
42
+ };
43
+ readonly meta: {
44
+ readonly key: "test.to-string";
45
+ };
46
+ }, "executionMode"> & import("effect/Pipeable").Pipeable & {
47
+ readonly executionMode: "sync" | "async";
48
+ };
49
+ export declare const Add: Omit<{
50
+ readonly schema: {
51
+ readonly input: Schema.Tuple2<typeof Schema.Number, typeof Schema.Number>;
52
+ readonly output: typeof Schema.Number;
53
+ };
54
+ readonly meta: {
55
+ readonly key: "test.add";
56
+ };
57
+ }, "executionMode"> & import("effect/Pipeable").Pipeable & {
58
+ readonly executionMode: "sync" | "async";
59
+ };
60
+ export declare const SideEffect: Omit<{
61
+ readonly schema: {
62
+ readonly input: typeof Schema.Void;
63
+ readonly output: typeof Schema.Void;
64
+ };
65
+ readonly meta: {
66
+ readonly key: "test.side-effect";
67
+ };
68
+ }, "executionMode"> & import("effect/Pipeable").Pipeable & {
69
+ readonly executionMode: "sync" | "async";
70
+ };
71
+ export declare const computeHandler: OperationResolver.OperationResolver<{
72
+ readonly value: number;
73
+ }, {
74
+ readonly value: number;
75
+ }, never, Operation.Service>;
76
+ export declare const halveComputeHandler: OperationResolver.OperationResolver<{
77
+ readonly value: number;
78
+ }, {
79
+ readonly value: number;
80
+ }, never, Operation.Service>;
81
+ export declare const toStringHandler: OperationResolver.OperationResolver<{
82
+ readonly value: number;
83
+ }, {
84
+ readonly string: string;
85
+ }, never, Operation.Service>;
86
+ export declare const addHandler: OperationResolver.OperationResolver<readonly [number, number], number, never, Operation.Service>;
87
+ export declare const sideEffectHandler: OperationResolver.OperationResolver<void, void, never, Operation.Service>;
88
+ /**
89
+ * Event collector for testing - provides deterministic event collection using Effect primitives.
90
+ */
91
+ export interface EventCollector {
92
+ /** All collected events. */
93
+ readonly events: OperationInvoker.InvocationEvent[];
94
+ /** Wait until N events have been collected. */
95
+ waitForEvents: (count: number) => Effect.Effect<void>;
96
+ /** Clean up the subscription fiber. */
97
+ dispose: Effect.Effect<void>;
98
+ }
99
+ /**
100
+ * Creates an event collector that subscribes to invoker events.
101
+ * Uses Effect primitives for synchronization.
102
+ */
103
+ export declare const createEventCollector: (invoker: OperationInvoker.OperationInvoker) => Effect.Effect<EventCollector>;
104
+ /**
105
+ * Waits until a condition is true, yielding to the JS event loop between checks.
106
+ * Uses setImmediate to allow other async work to complete.
107
+ */
108
+ export declare const waitUntil: (condition: () => boolean) => Effect.Effect<void>;
109
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/plugin-operation/testing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMtF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;CAMlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAMvB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAMnB,CAAC;AAEH,eAAO,MAAM,GAAG;;;;;;;;;;CAMd,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;CAMrB,CAAC;AAMH,eAAO,MAAM,cAAc;;;;4BAOzB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;4BAG9B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;4BAG1B,CAAC;AAEH,eAAO,MAAM,UAAU,kGAGrB,CAAC;AAEH,eAAO,MAAM,iBAAiB,2EAG5B,CAAC;AAMH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,eAAe,EAAE,CAAC;IACpD,+CAA+C;IAC/C,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtD,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,gBAAgB,CAAC,gBAAgB,KAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAoD1G,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAKnE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '../core';
2
+ export declare const RuntimePlugin: Plugin.PluginFactory<void>;
3
+ //# sourceMappingURL=RuntimePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimePlugin.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/RuntimePlugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,aAAa,4BAQzB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capabilities } from '../common';
3
+ import { Capability, Plugin } from '../core';
4
+ declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.ManagedRuntime>>, Error, Capability.Service | Plugin.Service>;
5
+ export default _default;
6
+ //# sourceMappingURL=capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAoB,YAAY,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;;AAM7C,wBAqCE"}
@@ -0,0 +1,2 @@
1
+ export * from './RuntimePlugin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type Plugin } from '../core';
2
+ export declare const meta: Plugin.Meta;
3
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/plugin-runtime/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAIzB,CAAC"}
@@ -1,2 +1,3 @@
1
+ export * from './service';
1
2
  export * from './withPluginManager';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC"}