@makaio/framework 1.0.0-dev-1779046984397

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 (410) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +363 -0
  3. package/dist/account-identity-Ce1Bwrqi.mjs +1 -0
  4. package/dist/adapter-CbyjCE2d.mjs +1 -0
  5. package/dist/adapters/acp-client/index.d.mts +209 -0
  6. package/dist/adapters/acp-client/index.mjs +1 -0
  7. package/dist/adapters/config/index.d.mts +429 -0
  8. package/dist/adapters/config/index.mjs +1 -0
  9. package/dist/adapters/index.d.mts +4175 -0
  10. package/dist/adapters/index.mjs +11 -0
  11. package/dist/adapters/node.d.mts +263 -0
  12. package/dist/adapters/node.mjs +4 -0
  13. package/dist/adapters/stream-session/index.d.mts +1384 -0
  14. package/dist/adapters/stream-session/index.mjs +1 -0
  15. package/dist/adapters/stream-session/testing/index.d.mts +29 -0
  16. package/dist/adapters/stream-session/testing/index.mjs +1 -0
  17. package/dist/base-orchestrator-9z8TuA5a.d.mts +772 -0
  18. package/dist/bus/index.d.mts +3331 -0
  19. package/dist/bus/index.mjs +1 -0
  20. package/dist/bus-B1seC4M_.mjs +2 -0
  21. package/dist/capability-service-tnpR_TaB.mjs +1 -0
  22. package/dist/chunk-Dc06z0qk.mjs +1 -0
  23. package/dist/chunk-cpUYaJdV.mjs +1 -0
  24. package/dist/cleanEnvForAdapter-DvcIGXTG.mjs +1 -0
  25. package/dist/client-Dh4x4GQN.mjs +1 -0
  26. package/dist/clients/index.d.mts +2786 -0
  27. package/dist/clients/index.mjs +1 -0
  28. package/dist/clients-namespace-B0xAPZ6J.d.mts +332 -0
  29. package/dist/config-namespace-DLSs83zr.d.mts +638 -0
  30. package/dist/config-namespace-MJT8P0Ud.mjs +1 -0
  31. package/dist/contracts/adapter/index.d.mts +3 -0
  32. package/dist/contracts/adapter/index.mjs +1 -0
  33. package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
  34. package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
  35. package/dist/contracts/client/index.d.mts +3 -0
  36. package/dist/contracts/client/index.mjs +1 -0
  37. package/dist/contracts/common/index.d.mts +2 -0
  38. package/dist/contracts/common/index.mjs +1 -0
  39. package/dist/contracts/config/index.d.mts +455 -0
  40. package/dist/contracts/config/index.mjs +1 -0
  41. package/dist/contracts/extension/index.d.mts +3 -0
  42. package/dist/contracts/extension/index.mjs +1 -0
  43. package/dist/contracts/harness/index.d.mts +2 -0
  44. package/dist/contracts/harness/index.mjs +1 -0
  45. package/dist/contracts/host/index.d.mts +2 -0
  46. package/dist/contracts/host/index.mjs +1 -0
  47. package/dist/contracts/index.d.mts +12665 -0
  48. package/dist/contracts/index.mjs +1 -0
  49. package/dist/contracts/model-registry/index.d.mts +2 -0
  50. package/dist/contracts/model-registry/index.mjs +1 -0
  51. package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
  52. package/dist/contracts/native-session-supervisor/index.mjs +1 -0
  53. package/dist/contracts/platform/index.d.mts +2 -0
  54. package/dist/contracts/platform/index.mjs +1 -0
  55. package/dist/contracts/provider/index.d.mts +3 -0
  56. package/dist/contracts/provider/index.mjs +1 -0
  57. package/dist/contracts/session/index.d.mts +3 -0
  58. package/dist/contracts/session/index.mjs +1 -0
  59. package/dist/contracts/shared/index.d.mts +2 -0
  60. package/dist/contracts/shared/index.mjs +1 -0
  61. package/dist/contracts/skill/index.d.mts +2 -0
  62. package/dist/contracts/skill/index.mjs +1 -0
  63. package/dist/contracts/toast/index.d.mts +198 -0
  64. package/dist/contracts/toast/index.mjs +1 -0
  65. package/dist/contracts/variant/index.d.mts +2 -0
  66. package/dist/contracts/variant/index.mjs +1 -0
  67. package/dist/core/index.d.mts +1001 -0
  68. package/dist/core/index.mjs +1 -0
  69. package/dist/credential-ref-DLCsoKVZ.mjs +1 -0
  70. package/dist/cursor-storage-DOQdvo9j.mjs +1 -0
  71. package/dist/definition-DkYy1PZz.mjs +1 -0
  72. package/dist/definition-DtUNiGom.d.mts +158 -0
  73. package/dist/definition-DxvZ9e22.d.mts +376 -0
  74. package/dist/drizzle-CWVVw7Er.mjs +1 -0
  75. package/dist/execution-target-BW_uiBVe.mjs +1 -0
  76. package/dist/extension-COqwS-2Q.mjs +1 -0
  77. package/dist/extension-Cbrl4YGX.mjs +1 -0
  78. package/dist/extension-namespace-zaGKi6Qj.mjs +1 -0
  79. package/dist/handlers-iGKUJ380.mjs +41 -0
  80. package/dist/harness-CEq1Zkf9.mjs +1 -0
  81. package/dist/hooks/index.d.mts +423 -0
  82. package/dist/hooks/index.mjs +1 -0
  83. package/dist/host-CXAUGGN0.mjs +1 -0
  84. package/dist/identity-B_A0mE63.mjs +1 -0
  85. package/dist/index-6lyShOoU.d.mts +225 -0
  86. package/dist/index-7sXlairn2.d.mts +43 -0
  87. package/dist/index-BAKM2GMH2.d.mts +535 -0
  88. package/dist/index-BB419vv-.d.mts +3897 -0
  89. package/dist/index-BJOfdtbw.d.mts +729 -0
  90. package/dist/index-BXP9GK5q.d.mts +1075 -0
  91. package/dist/index-BdPwu6c0.d.mts +1730 -0
  92. package/dist/index-BePI0ckL.d.mts +40 -0
  93. package/dist/index-Bigx81Kr.d.mts +37 -0
  94. package/dist/index-BnNqbx2I.d.mts +134 -0
  95. package/dist/index-Bv15sNLn.d.mts +389 -0
  96. package/dist/index-C-myW_aK.d.mts +412 -0
  97. package/dist/index-C9F3Fc1A.d.mts +2938 -0
  98. package/dist/index-CNxS4Tlu.d.mts +1 -0
  99. package/dist/index-CVA0m1g9.d.mts +995 -0
  100. package/dist/index-C_kS2aqV2.d.mts +438 -0
  101. package/dist/index-Ch3ph52M2.d.mts +40 -0
  102. package/dist/index-CnZOKNjU.d.mts +89 -0
  103. package/dist/index-D1T-PPqF.d.mts +67 -0
  104. package/dist/index-D7T8XCku.d.mts +341 -0
  105. package/dist/index-DBQtpFLE.d.mts +4843 -0
  106. package/dist/index-DEw90pa2.d.mts +183 -0
  107. package/dist/index-DQRsGXb5.d.mts +109 -0
  108. package/dist/index-Dd5s4MSm.d.mts +72 -0
  109. package/dist/index-DubqLGH8.d.mts +1002 -0
  110. package/dist/index-ESSDWIB7.d.mts +11 -0
  111. package/dist/index-N5K1NOYs.d.mts +184 -0
  112. package/dist/index-PdUSmPT2.d.mts +180 -0
  113. package/dist/index-SzSiyG61.d.mts +117 -0
  114. package/dist/index-T0471kWA.d.mts +6760 -0
  115. package/dist/index-WKjrpcA_.d.mts +218 -0
  116. package/dist/index-hapw9_En.d.mts +13592 -0
  117. package/dist/index-iID2R9G1.d.mts +1490 -0
  118. package/dist/kernel/cli/index.d.mts +141 -0
  119. package/dist/kernel/cli/index.mjs +1 -0
  120. package/dist/kernel/cli/schemas.d.mts +63 -0
  121. package/dist/kernel/cli/schemas.mjs +1 -0
  122. package/dist/kernel/extension/index.d.mts +2 -0
  123. package/dist/kernel/extension/index.mjs +1 -0
  124. package/dist/kernel/index.d.mts +296 -0
  125. package/dist/kernel/index.mjs +1 -0
  126. package/dist/kernel/namespace/index.d.mts +2 -0
  127. package/dist/kernel/namespace/index.mjs +1 -0
  128. package/dist/kernel/observability/index.d.mts +2 -0
  129. package/dist/kernel/observability/index.mjs +1 -0
  130. package/dist/kernel/providers/index.d.mts +2 -0
  131. package/dist/kernel/providers/index.mjs +1 -0
  132. package/dist/kernel/window/index.d.mts +2 -0
  133. package/dist/kernel/window/index.mjs +1 -0
  134. package/dist/model-registry-BNzpR6TU.mjs +1 -0
  135. package/dist/model-registry-CIscwC52.mjs +1 -0
  136. package/dist/namespace-0yuzAKlr.mjs +1 -0
  137. package/dist/namespace-8cNguvIp.mjs +1 -0
  138. package/dist/namespace-BK2erxpV.d.mts +921 -0
  139. package/dist/namespace-Bmc7AW4J2.mjs +1 -0
  140. package/dist/namespace-C2ufjgaQ.d.mts +767 -0
  141. package/dist/namespace-C54Oj025.d.mts +159 -0
  142. package/dist/namespace-CCDEOwmW.d.mts +1313 -0
  143. package/dist/namespace-CfEWMXBx.mjs +1 -0
  144. package/dist/namespace-CkLUtc0g.d.mts +580 -0
  145. package/dist/namespace-D5Wrt7YU.mjs +1 -0
  146. package/dist/namespace-DZcuLwEA.d.mts +51 -0
  147. package/dist/namespace-Db-p67Rg.mjs +1 -0
  148. package/dist/namespace-FWx6HxaW.d.mts +611 -0
  149. package/dist/namespace-GLGGcWPH.d.mts +43 -0
  150. package/dist/namespace-N0dfwSg6.mjs +1 -0
  151. package/dist/namespace-O5SNY-LV.d.mts +2226 -0
  152. package/dist/namespace-ZbthBQVt.d.mts +142 -0
  153. package/dist/namespace-bq4Prtzn.d.mts +2046 -0
  154. package/dist/namespace-pNcSglBS.mjs +1 -0
  155. package/dist/namespace-ptv-pw_g.d.mts +3019 -0
  156. package/dist/namespace-xkvVw3hf2.d.mts +189 -0
  157. package/dist/native-session-supervisor-L-UIaEfd.mjs +1 -0
  158. package/dist/node/bus-server/index.d.mts +178 -0
  159. package/dist/node/bus-server/index.mjs +1 -0
  160. package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
  161. package/dist/node/bus-server/server-lifecycle.mjs +1 -0
  162. package/dist/node/machine-identity/index.d.mts +85 -0
  163. package/dist/node/machine-identity/index.mjs +3 -0
  164. package/dist/node/transports/index.d.mts +1752 -0
  165. package/dist/node/transports/index.mjs +2 -0
  166. package/dist/orchestrator-shared-DrjtTXYh.d.mts +249 -0
  167. package/dist/orchestrator-shared-Wv1GI2mW.mjs +1 -0
  168. package/dist/platform-BbSLVg5b.mjs +1 -0
  169. package/dist/profile-4StaDQW0.mjs +1 -0
  170. package/dist/provider-context-CNRQ4d5m.mjs +1 -0
  171. package/dist/providers/index.d.mts +135 -0
  172. package/dist/providers/index.mjs +1 -0
  173. package/dist/providers-Cr4Za8a1.mjs +1 -0
  174. package/dist/providers-namespace-CDwxY_DV.d.mts +583 -0
  175. package/dist/schema-BwzXEtT2.d.mts +837 -0
  176. package/dist/schema-CAw_BqaG.mjs +1 -0
  177. package/dist/schema-introspection-D61TT_7b.mjs +1 -0
  178. package/dist/schema-uSGW-6oM.mjs +1 -0
  179. package/dist/schemas-BXstpWVp.mjs +1 -0
  180. package/dist/schemas-BdMU-gew.d.mts +160 -0
  181. package/dist/schemas-C40ZAJ33.mjs +1 -0
  182. package/dist/schemas-C5xtVqdb.d.mts +46 -0
  183. package/dist/schemas-CGZy_rU6.d.mts +13 -0
  184. package/dist/schemas-CLxtoKFy.mjs +1 -0
  185. package/dist/schemas-Co_sVhzz.mjs +1 -0
  186. package/dist/schemas-D9108Iv1.d.mts +182 -0
  187. package/dist/schemas-DENVYyds.d.mts +463 -0
  188. package/dist/schemas-DbWs_hj8.d.mts +174 -0
  189. package/dist/schemas-Di0XnnMX.d.mts +73 -0
  190. package/dist/schemas-KMA1efQg.d.mts +944 -0
  191. package/dist/schemas-qmn5SWPU.d.mts +312 -0
  192. package/dist/schemas-sshQEF3l.d.mts +237 -0
  193. package/dist/server-lifecycle-Cf_SZ27k.d.mts +160 -0
  194. package/dist/server-lifecycle-DbFwlrTW.mjs +1 -0
  195. package/dist/service-base/index.d.mts +98 -0
  196. package/dist/service-base/index.mjs +1 -0
  197. package/dist/services/adapter-runtime/index.d.mts +4 -0
  198. package/dist/services/adapter-runtime/index.mjs +1 -0
  199. package/dist/services/adapter-runtime/namespace.d.mts +2 -0
  200. package/dist/services/adapter-runtime/namespace.mjs +1 -0
  201. package/dist/services/adapter-runtime/schemas.d.mts +2 -0
  202. package/dist/services/adapter-runtime/schemas.mjs +1 -0
  203. package/dist/services/adapter-subsystem/index.d.mts +3 -0
  204. package/dist/services/adapter-subsystem/index.mjs +1 -0
  205. package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
  206. package/dist/services/adapter-subsystem/namespace.mjs +1 -0
  207. package/dist/services/agent-runtime/index.d.mts +3 -0
  208. package/dist/services/agent-runtime/index.mjs +1 -0
  209. package/dist/services/agent-runtime/namespace.d.mts +2 -0
  210. package/dist/services/agent-runtime/namespace.mjs +1 -0
  211. package/dist/services/agent-runtime/schemas.d.mts +2 -0
  212. package/dist/services/agent-runtime/schemas.mjs +1 -0
  213. package/dist/services/capability/index.d.mts +2 -0
  214. package/dist/services/capability/index.mjs +1 -0
  215. package/dist/services/cli-detection/namespace.d.mts +56 -0
  216. package/dist/services/cli-detection/namespace.mjs +1 -0
  217. package/dist/services/codebase/index.d.mts +3 -0
  218. package/dist/services/codebase/index.mjs +1 -0
  219. package/dist/services/codebase/namespace.d.mts +2 -0
  220. package/dist/services/codebase/namespace.mjs +1 -0
  221. package/dist/services/codebase/schemas.d.mts +2 -0
  222. package/dist/services/codebase/schemas.mjs +1 -0
  223. package/dist/services/compression/index.d.mts +3 -0
  224. package/dist/services/compression/index.mjs +1 -0
  225. package/dist/services/compression/namespace.d.mts +2 -0
  226. package/dist/services/compression/namespace.mjs +1 -0
  227. package/dist/services/compression/schemas.d.mts +2 -0
  228. package/dist/services/compression/schemas.mjs +1 -0
  229. package/dist/services/context-rules/index.d.mts +412 -0
  230. package/dist/services/context-rules/index.mjs +1 -0
  231. package/dist/services/credential-change/index.d.mts +17 -0
  232. package/dist/services/credential-change/index.mjs +1 -0
  233. package/dist/services/definition/index.d.mts +2 -0
  234. package/dist/services/definition/index.mjs +1 -0
  235. package/dist/services/definition/namespace.d.mts +71 -0
  236. package/dist/services/definition/namespace.mjs +1 -0
  237. package/dist/services/definition/schemas.d.mts +38 -0
  238. package/dist/services/definition/schemas.mjs +1 -0
  239. package/dist/services/dialog/namespace.d.mts +105 -0
  240. package/dist/services/dialog/namespace.mjs +1 -0
  241. package/dist/services/dialog/schemas.d.mts +109 -0
  242. package/dist/services/dialog/schemas.mjs +1 -0
  243. package/dist/services/execution-target/index.d.mts +4 -0
  244. package/dist/services/execution-target/index.mjs +1 -0
  245. package/dist/services/execution-target/namespace.d.mts +2 -0
  246. package/dist/services/execution-target/namespace.mjs +1 -0
  247. package/dist/services/execution-target/schemas.d.mts +2 -0
  248. package/dist/services/execution-target/schemas.mjs +1 -0
  249. package/dist/services/filesystem/namespace.d.mts +432 -0
  250. package/dist/services/filesystem/namespace.mjs +1 -0
  251. package/dist/services/filesystem/schemas.d.mts +240 -0
  252. package/dist/services/filesystem/schemas.mjs +1 -0
  253. package/dist/services/harness/index.d.mts +861 -0
  254. package/dist/services/harness/index.mjs +1 -0
  255. package/dist/services/harness/storage/schema.d.mts +424 -0
  256. package/dist/services/harness/storage/schema.mjs +1 -0
  257. package/dist/services/index.d.mts +5703 -0
  258. package/dist/services/index.mjs +1 -0
  259. package/dist/services/local-notification/index.d.mts +25 -0
  260. package/dist/services/local-notification/index.mjs +1 -0
  261. package/dist/services/local-notification/namespace.d.mts +73 -0
  262. package/dist/services/local-notification/namespace.mjs +1 -0
  263. package/dist/services/local-notification/schemas.d.mts +88 -0
  264. package/dist/services/local-notification/schemas.mjs +1 -0
  265. package/dist/services/log-import/browser.d.mts +3 -0
  266. package/dist/services/log-import/browser.mjs +1 -0
  267. package/dist/services/log-import/index.d.mts +275 -0
  268. package/dist/services/log-import/index.mjs +2 -0
  269. package/dist/services/log-import/log-import.d.mts +3 -0
  270. package/dist/services/log-import/log-import.mjs +1 -0
  271. package/dist/services/log-import/namespace.d.mts +327 -0
  272. package/dist/services/log-import/namespace.mjs +1 -0
  273. package/dist/services/log-import/schemas.d.mts +217 -0
  274. package/dist/services/log-import/schemas.mjs +1 -0
  275. package/dist/services/model-registry/index.d.mts +2 -0
  276. package/dist/services/model-registry/index.mjs +1 -0
  277. package/dist/services/preferences/index.d.mts +3 -0
  278. package/dist/services/preferences/index.mjs +1 -0
  279. package/dist/services/preferences/schemas.d.mts +2 -0
  280. package/dist/services/preferences/schemas.mjs +1 -0
  281. package/dist/services/preferences/storage-namespace.d.mts +3 -0
  282. package/dist/services/preferences/storage-namespace.mjs +1 -0
  283. package/dist/services/provider-context/index.d.mts +2 -0
  284. package/dist/services/provider-context/index.mjs +1 -0
  285. package/dist/services/provider-runtime/index.d.mts +136 -0
  286. package/dist/services/provider-runtime/index.mjs +1 -0
  287. package/dist/services/session/handlers/index.d.mts +2 -0
  288. package/dist/services/session/handlers/index.mjs +1 -0
  289. package/dist/services/session/index.d.mts +10 -0
  290. package/dist/services/session/index.mjs +1 -0
  291. package/dist/services/session/messages/namespace.d.mts +2 -0
  292. package/dist/services/session/messages/namespace.mjs +1 -0
  293. package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
  294. package/dist/services/session/orchestrator-testing/index.mjs +1 -0
  295. package/dist/services/session/session-events/namespace.d.mts +2 -0
  296. package/dist/services/session/session-events/namespace.mjs +1 -0
  297. package/dist/services/session/storage/namespace.d.mts +2 -0
  298. package/dist/services/session/storage/namespace.mjs +1 -0
  299. package/dist/services/session/storage/schema.d.mts +2 -0
  300. package/dist/services/session/storage/schema.mjs +1 -0
  301. package/dist/services/session/testing/index.d.mts +35 -0
  302. package/dist/services/session/testing/index.mjs +52 -0
  303. package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
  304. package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
  305. package/dist/services/session/turns/namespace.d.mts +2 -0
  306. package/dist/services/session/turns/namespace.mjs +1 -0
  307. package/dist/services/session-editor/index.d.mts +119 -0
  308. package/dist/services/session-editor/index.mjs +1 -0
  309. package/dist/services/settings/index.d.mts +47 -0
  310. package/dist/services/settings/index.mjs +1 -0
  311. package/dist/services/settings/namespace.d.mts +662 -0
  312. package/dist/services/settings/namespace.mjs +1 -0
  313. package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
  314. package/dist/services/settings/storage/clients-namespace.mjs +1 -0
  315. package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
  316. package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
  317. package/dist/services/settings/storage/index.d.mts +4 -0
  318. package/dist/services/settings/storage/index.mjs +1 -0
  319. package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
  320. package/dist/services/settings/storage/providers-namespace.mjs +1 -0
  321. package/dist/services/tool-approval/index.d.mts +2 -0
  322. package/dist/services/tool-approval/index.mjs +1 -0
  323. package/dist/services/tools/index.d.mts +2 -0
  324. package/dist/services/tools/index.mjs +1 -0
  325. package/dist/services/tray-menu/index.d.mts +4 -0
  326. package/dist/services/tray-menu/index.mjs +1 -0
  327. package/dist/services/tray-menu/namespace.d.mts +2 -0
  328. package/dist/services/tray-menu/namespace.mjs +1 -0
  329. package/dist/services/tray-menu/schemas.d.mts +2 -0
  330. package/dist/services/tray-menu/schemas.mjs +1 -0
  331. package/dist/services/turn/index.d.mts +2 -0
  332. package/dist/services/turn/index.mjs +1 -0
  333. package/dist/services/turn/namespace.d.mts +2 -0
  334. package/dist/services/turn/namespace.mjs +1 -0
  335. package/dist/services/turn/schemas.d.mts +335 -0
  336. package/dist/services/turn/schemas.mjs +1 -0
  337. package/dist/services/worker/index.d.mts +3 -0
  338. package/dist/services/worker/index.mjs +1 -0
  339. package/dist/services/worker/namespace.d.mts +2 -0
  340. package/dist/services/worker/namespace.mjs +1 -0
  341. package/dist/services/worker/schemas.d.mts +2 -0
  342. package/dist/services/worker/schemas.mjs +1 -0
  343. package/dist/session-Do6lDZM4.mjs +123 -0
  344. package/dist/session-lineage-Eev4uo4I.d.mts +65 -0
  345. package/dist/session-piI1R5rP.mjs +1 -0
  346. package/dist/shared-DxHLl9UP.mjs +1 -0
  347. package/dist/shared-schemas-BgQv_tnu.mjs +1 -0
  348. package/dist/skill-CB5h-ZFQ.mjs +1 -0
  349. package/dist/storage/drizzle/client.d.mts +78 -0
  350. package/dist/storage/drizzle/client.mjs +1 -0
  351. package/dist/storage/drizzle/index.d.mts +98 -0
  352. package/dist/storage/drizzle/index.mjs +1 -0
  353. package/dist/storage/handlers/drizzle/index.d.mts +2 -0
  354. package/dist/storage/handlers/drizzle/index.mjs +1 -0
  355. package/dist/storage/handlers/index.d.mts +33 -0
  356. package/dist/storage/handlers/index.mjs +1 -0
  357. package/dist/storage/index.d.mts +192 -0
  358. package/dist/storage/index.mjs +1 -0
  359. package/dist/storage-namespace-ADwyijoe.mjs +1 -0
  360. package/dist/storage-namespace-DAm8iWEj.d.mts +221 -0
  361. package/dist/storage-namespace-definition-CHu2k14q.mjs +1 -0
  362. package/dist/storage-namespace-definition-CJgqyXH1.d.mts +17 -0
  363. package/dist/style.css +3782 -0
  364. package/dist/testing/drizzle-harness.d.mts +130 -0
  365. package/dist/testing/drizzle-harness.mjs +1 -0
  366. package/dist/testing/index.d.mts +106 -0
  367. package/dist/testing/index.mjs +1 -0
  368. package/dist/tool-approval-service-BcBSUZCO.mjs +1 -0
  369. package/dist/tools/index.d.mts +825 -0
  370. package/dist/tools/index.mjs +1 -0
  371. package/dist/tools/testing/index.d.mts +53 -0
  372. package/dist/tools/testing/index.mjs +1 -0
  373. package/dist/tools-CDSgj0ee.mjs +1 -0
  374. package/dist/tray-menu-service-CTXC1Elg.mjs +1 -0
  375. package/dist/types-6WxLfoM3.d.mts +31 -0
  376. package/dist/types-BjToUrHp.d.mts +6619 -0
  377. package/dist/types-CD1LJwPc.d.mts +1009 -0
  378. package/dist/types-Cvrj2ogm.d.mts +305 -0
  379. package/dist/types-DYF5LxZY.d.mts +233 -0
  380. package/dist/types-t295YC6T.d.mts +262 -0
  381. package/dist/types-vNpkAe4Y.d.mts +128 -0
  382. package/dist/ui-components/index.d.mts +2342 -0
  383. package/dist/ui-components/index.mjs +8 -0
  384. package/dist/ui-config-CXmbsqZV.mjs +1 -0
  385. package/dist/ui-hooks/index.d.mts +1805 -0
  386. package/dist/ui-hooks/index.mjs +1 -0
  387. package/dist/ui-kernel/index.d.mts +2793 -0
  388. package/dist/ui-kernel/index.mjs +1 -0
  389. package/dist/ui-kernel/pages/namespace.d.mts +88 -0
  390. package/dist/ui-kernel/pages/namespace.mjs +1 -0
  391. package/dist/ui-kernel/pages/schemas.d.mts +2 -0
  392. package/dist/ui-kernel/pages/schemas.mjs +1 -0
  393. package/dist/ui-views/index.d.mts +487 -0
  394. package/dist/ui-views/index.mjs +30 -0
  395. package/dist/utils/health-probe.d.mts +26 -0
  396. package/dist/utils/health-probe.mjs +1 -0
  397. package/dist/utils/index.d.mts +227 -0
  398. package/dist/utils/index.mjs +2 -0
  399. package/dist/utils/keychain.d.mts +31 -0
  400. package/dist/utils/keychain.mjs +1 -0
  401. package/dist/utils/resolve-package-root.d.mts +12 -0
  402. package/dist/utils/resolve-package-root.mjs +1 -0
  403. package/dist/utils/workspace-root.d.mts +27 -0
  404. package/dist/utils/workspace-root.mjs +2 -0
  405. package/dist/variant-D5kSrL3m.mjs +1 -0
  406. package/dist/version-CjS20oXi.mjs +1 -0
  407. package/dist/visibility-CZu8ooOA.mjs +1 -0
  408. package/dist/window-registry-CUftmDr3.mjs +1 -0
  409. package/dist/window-registry-C_IJmY8_.d.mts +130 -0
  410. package/package.json +346 -0
@@ -0,0 +1,2793 @@
1
+ import { r as PageSurfaceConfig, s as SurfaceId } from "../schemas-BdMU-gew.mjs";
2
+ import * as _$zod from "zod";
3
+ import { z } from "zod";
4
+ import * as _$_makaio_core0 from "@makaio/framework/core";
5
+ import { IMakaioBus } from "@makaio/framework/bus";
6
+ import { UiContextSnapshot, UiNavigationLevel, UiScope } from "@makaio/framework/contracts";
7
+ import { ClientRecord } from "@makaio/framework/services/settings/storage";
8
+ import { ExtensionInfo } from "@makaio/framework/kernel";
9
+ import * as _$zod_v4_core0 from "zod/v4/core";
10
+ import { ComponentType } from "react";
11
+
12
+ //#region ui/kernel/src/widgets/scope-registry.d.ts
13
+ /** Widget scope type declared by the shared UI contribution contract. */
14
+ type WidgetScope = UiScope;
15
+ /**
16
+ * Widget scope definition.
17
+ */
18
+ interface WidgetScopeDefinition {
19
+ /** Display label */
20
+ label: string;
21
+ /** Description for UI */
22
+ description?: string;
23
+ }
24
+ /**
25
+ * Widget scope registry implementation.
26
+ *
27
+ * Manages registration and lookup of widget scopes with subscription support.
28
+ */
29
+ declare class WidgetScopeRegistryImpl {
30
+ private scopes;
31
+ private listeners;
32
+ /**
33
+ * Register a new widget scope.
34
+ * @param scope - Scope identifier declared through `UiScopeMap`.
35
+ * @param definition - Scope definition with label and description
36
+ */
37
+ register(scope: UiScope, definition: WidgetScopeDefinition): void;
38
+ /**
39
+ * Check if a scope is registered.
40
+ * @param scope - Scope identifier to check
41
+ * @returns True if scope exists
42
+ */
43
+ has(scope: UiScope): boolean;
44
+ /**
45
+ * Get all registered scopes.
46
+ * @returns Map of scope identifiers to definitions
47
+ */
48
+ getAll(): Map<UiScope, WidgetScopeDefinition>;
49
+ /**
50
+ * Subscribe to scope registry changes.
51
+ * @param listener - Callback function when scopes change
52
+ * @returns Unsubscribe function
53
+ */
54
+ subscribe(listener: () => void): () => void;
55
+ private notify;
56
+ }
57
+ /**
58
+ * Global widget scope registry instance.
59
+ */
60
+ declare const widgetScopeRegistry: WidgetScopeRegistryImpl;
61
+ /**
62
+ * Returns true when a widget's `scope` (single value or array) matches
63
+ * `targetScope`. When `includeAny` is true (the default), widgets scoped
64
+ * to `'any'` also match — matching the canonical "available everywhere"
65
+ * semantics used across surfaces.
66
+ *
67
+ * Hooks and other snapshot consumers can call this predicate directly instead
68
+ * of re-implementing the same single-value-vs-array and `'any'` matching
69
+ * rules locally.
70
+ * @param scope - The widget's `scope` field (single value or array).
71
+ * @param targetScope - The scope being looked up.
72
+ * @param includeAny - When true, widgets scoped `'any'` also match. Defaults to true.
73
+ * @returns Whether the widget's scope matches `targetScope`.
74
+ */
75
+ declare function widgetMatchesScope(scope: WidgetScope | readonly WidgetScope[], targetScope: WidgetScope, includeAny?: boolean): boolean;
76
+ //#endregion
77
+ //#region ui/kernel/src/utils/component-types.d.ts
78
+ /**
79
+ * Structural component contract accepted by kernel registries.
80
+ * @typeParam TProps - Props accepted by the component.
81
+ */
82
+ type ComponentLike<TProps extends object = Record<string, unknown>> = ComponentType<TProps>;
83
+ /**
84
+ * Shared icon component props used by kernel-tier contracts.
85
+ */
86
+ interface IconComponentProps {
87
+ size?: number;
88
+ className?: string;
89
+ }
90
+ /**
91
+ * Structural icon component contract for navigation/page metadata.
92
+ */
93
+ type IconComponentLike = ComponentLike<IconComponentProps>;
94
+ /**
95
+ * Lazy-loaded component module shape.
96
+ * @typeParam TProps - Props accepted by the default-exported component.
97
+ */
98
+ interface LazyComponentModule<TProps extends object = Record<string, unknown>> {
99
+ default: ComponentLike<TProps>;
100
+ }
101
+ //#endregion
102
+ //#region ui/kernel/src/widgets/types.d.ts
103
+ /** Framework fallback context when no host has selected a narrower context. */
104
+ declare const DEFAULT_WIDGET_UI_CONTEXT: UiContextSnapshot;
105
+ /**
106
+ * Values for widget size
107
+ * 'small' | 'medium' | 'large' | 'full-width'
108
+ */
109
+ type WidgetSize = 'small' | 'medium' | 'large' | 'full-width';
110
+ /**
111
+ * Props passed to all widget components
112
+ */
113
+ interface WidgetProps<TConfig = Record<string, unknown>> {
114
+ /** Current size of the widget */
115
+ size: WidgetSize;
116
+ /** Widget instance configuration */
117
+ config: TConfig;
118
+ /** Callback to update configuration */
119
+ updateConfig: (config: Partial<TConfig>) => void;
120
+ /** Active host UI context for this widget surface. */
121
+ uiContext: UiContextSnapshot;
122
+ }
123
+ /**
124
+ * Context passed to a widget's custom activation handler.
125
+ *
126
+ * Provides everything the handler needs to perform side-effects: the bus for
127
+ * further RPCs and the identity of the widget instance that was activated.
128
+ */
129
+ interface WidgetActivationContext {
130
+ /** The MakaioBus instance for emitting events or issuing RPCs. */
131
+ bus: IMakaioBus;
132
+ /** Widget definition ID (same as `WidgetDefinition.id`). */
133
+ widgetId: string;
134
+ /** Widget instance ID within the current layout. */
135
+ instanceId: string;
136
+ }
137
+ /**
138
+ * Declarative activation behaviour for a widget.
139
+ *
140
+ * When a user clicks an activatable widget tile, the `WidgetGrid` evaluates
141
+ * these fields in order:
142
+ *
143
+ * 1. `pageId` — Opens the named Page in the current window via
144
+ * `usePageOverlayStore.openPage`.
145
+ * 2. `windowId` — Creates or focuses a named window via the
146
+ * `host.window.create` RPC.
147
+ * 3. `onActivate` — Runs a custom async handler with full bus access.
148
+ *
149
+ * All three may be present; all will execute. Omit fields that are not needed.
150
+ */
151
+ interface WidgetActivation {
152
+ /**
153
+ * Page ID to open in the current window when the widget is activated.
154
+ *
155
+ * The Page's `mode` field determines how it is presented (e.g. `'sheet'`
156
+ * for a fullscreen overlay). The `WidgetGrid` calls
157
+ * `usePageOverlayStore.getState().openPage(pageId)`.
158
+ */
159
+ pageId?: string;
160
+ /**
161
+ * Window registration ID (format: `packageName:windowId`) to create or
162
+ * focus when the widget is activated.
163
+ *
164
+ * The `WidgetGrid` issues a `host.window.create` RPC with this value as
165
+ * the `registrationId`.
166
+ */
167
+ windowId?: string;
168
+ /**
169
+ * Custom activation handler called after declarative activation (if any).
170
+ *
171
+ * Receives a {@link WidgetActivationContext} with the bus, widgetId, and
172
+ * instanceId. Runs after `pageId`/`windowId` activation so it can react to
173
+ * the side-effects they produce.
174
+ * @param ctx - Activation context with bus access and widget identity.
175
+ * @returns A promise that resolves when the handler is complete.
176
+ */
177
+ onActivate?: (ctx: WidgetActivationContext) => Promise<void>;
178
+ }
179
+ /**
180
+ * Definition of a widget available in the system
181
+ */
182
+ interface WidgetDefinition<TConfig = Record<string, unknown>> {
183
+ /** Unique identifier for the widget type */
184
+ id: string;
185
+ /** Display name */
186
+ name: string;
187
+ /** Description shown in palette */
188
+ description?: string;
189
+ /**
190
+ * Scope(s) where this widget can be used
191
+ * - Single scope: 'global' or any host-registered scope
192
+ * - Multiple scopes: ['global', '<host-scope>'] (Available in both contexts)
193
+ */
194
+ scope: WidgetScope | WidgetScope[];
195
+ /**
196
+ * React component implementing the widget.
197
+ * Must accept WidgetProps.
198
+ */
199
+ component: ComponentLike<WidgetProps<TConfig>>;
200
+ /**
201
+ * Supported sizes. First one is default.
202
+ */
203
+ supportedSizes: WidgetSize[];
204
+ /**
205
+ * Default size when added
206
+ */
207
+ defaultSize: WidgetSize;
208
+ /**
209
+ * Optional size hint for the `'tray'` scope. If provided, `useTrayLayout`
210
+ * uses this instead of `defaultSize` to choose the tray placement height.
211
+ * Use this when a widget should render compactly in the tray (e.g. a
212
+ * single-row status indicator) while remaining full-size on a dashboard.
213
+ */
214
+ trayDefaultSize?: WidgetSize;
215
+ /**
216
+ * Default configuration
217
+ */
218
+ defaultConfig?: TConfig;
219
+ /**
220
+ * Whether multiple instances of this widget are allowed
221
+ */
222
+ allowMultiple?: boolean;
223
+ /**
224
+ * Optional activation behaviour when the user clicks the widget tile.
225
+ *
226
+ * When present, the `WidgetGrid` renders the tile with a pointer cursor and
227
+ * executes the declarative steps defined here on click (outside edit mode).
228
+ * See {@link WidgetActivation} for the full dispatch sequence.
229
+ */
230
+ activate?: WidgetActivation;
231
+ }
232
+ /**
233
+ * Erase the config type parameter for heterogeneous widget storage.
234
+ *
235
+ * `WidgetDefinition<TConfig>` is invariant in `TConfig`: `WidgetProps` has
236
+ * `TConfig` in both covariant (`config`) and contravariant (`updateConfig`)
237
+ * positions, so no single generic instantiation can accept all concrete
238
+ * `WidgetDefinition<T>`. TypeScript lacks existential types, which is why the
239
+ * registry keeps one explicit variance-boundary helper here.
240
+ *
241
+ * This generic utility provides a single, documented variance boundary.
242
+ * TypeScript infers `T` from each call site — callers are fully type-safe.
243
+ * At runtime, config values always flow as `Record<string, unknown>` through
244
+ * the registry → layout → render pipeline.
245
+ * @param definition - Concretely-typed widget definition
246
+ * @returns The same definition typed for rendering with erased config
247
+ */
248
+ declare function eraseWidgetConfig<T extends Record<string, unknown>>(definition: WidgetDefinition<T>): WidgetDefinition;
249
+ /**
250
+ * Active widget instance in a layout
251
+ */
252
+ interface WidgetInstance {
253
+ /** Unique ID for this widget instance */
254
+ instanceId: string;
255
+ /** ID of the widget definition */
256
+ widgetId: string;
257
+ /** Current size */
258
+ size: WidgetSize;
259
+ /** Instance specific configuration */
260
+ config?: Record<string, unknown>;
261
+ }
262
+ /**
263
+ * Identifiers for standard layout slots
264
+ */
265
+ type WidgetSlotId = 'main' | 'sidebar-left' | 'sidebar-right' | 'bottom';
266
+ /**
267
+ * State of a single widget slot
268
+ */
269
+ interface WidgetSlotState {
270
+ /** ID of the slot */
271
+ id: WidgetSlotId;
272
+ /** Widgets currently in this slot */
273
+ widgets: WidgetInstance[];
274
+ }
275
+ /**
276
+ * Widget placement in a grid.
277
+ *
278
+ * `size` is the semantic size used for default layout definitions and widget
279
+ * palette drops. After a user resize, `w` and `h` store the actual grid
280
+ * dimensions and take precedence over `SIZE_MAPPING[size]` for rendering.
281
+ * The semantic `size` is re-derived from `w`/`h` for the widget's responsive
282
+ * rendering prop.
283
+ */
284
+ interface WidgetPlacement {
285
+ instanceId: string;
286
+ widgetId: string;
287
+ col: number;
288
+ row: number;
289
+ size: WidgetSize;
290
+ /** Grid width in columns. When absent, derived from `size` via SIZE_MAPPING. */
291
+ w?: number;
292
+ /** Grid height in rows. When absent, derived from `size` via SIZE_MAPPING. */
293
+ h?: number;
294
+ config?: Record<string, unknown>;
295
+ /** When true, the placement is non-removable and non-draggable regardless of edit mode. */
296
+ locked?: boolean;
297
+ }
298
+ /**
299
+ * Persisted widget layout
300
+ */
301
+ interface WidgetLayout {
302
+ version: 1;
303
+ placements: WidgetPlacement[];
304
+ }
305
+ /**
306
+ * Runtime validator for persisted widget placements.
307
+ * @param value - Candidate placement payload.
308
+ * @returns True when the payload matches the widget placement contract.
309
+ */
310
+ declare function isWidgetPlacement(value: unknown): value is WidgetPlacement;
311
+ /**
312
+ * Runtime validator for persisted widget layouts.
313
+ * @param value - Candidate layout payload.
314
+ * @returns True when the payload matches the widget layout contract.
315
+ */
316
+ declare function isWidgetLayout(value: unknown): value is WidgetLayout;
317
+ //#endregion
318
+ //#region ui/kernel/src/utils/RegistryBase.d.ts
319
+ /**
320
+ * RegistryBase - Base class for implementing registries with subscription support
321
+ *
322
+ * Provides:
323
+ * - Map-based storage for items
324
+ * - Subscription mechanism for notifications
325
+ * - Protected methods for mutation notifications
326
+ *
327
+ * Subclasses define their own public API while using the base infrastructure.
328
+ * @packageDocumentation
329
+ */
330
+ /**
331
+ * Base class for registries with subscription support.
332
+ *
333
+ * Provides storage and notification infrastructure.
334
+ * Subclasses are free to define their own public API without
335
+ * signature constraints.
336
+ * @example
337
+ * ```ts
338
+ * class MyRegistry extends RegistryBase<string, MyType> {
339
+ * public register(item: MyType): void {
340
+ * this.items.set(item.id, item);
341
+ * this.notify();
342
+ * }
343
+ *
344
+ * public get(id: string): MyType | undefined {
345
+ * return this.items.get(id);
346
+ * }
347
+ * }
348
+ * ```
349
+ */
350
+ declare class RegistryBase<TKey, TValue> {
351
+ /**
352
+ * Internal storage map.
353
+ * Subclasses can access this directly to implement their API.
354
+ */
355
+ protected items: Map<TKey, TValue>;
356
+ /**
357
+ * Internal set of subscription listeners.
358
+ */
359
+ private listeners;
360
+ /**
361
+ * Subscribe to registry mutations.
362
+ * @param listener - Callback to invoke on mutations
363
+ * @returns Unsubscribe function
364
+ * @example
365
+ * ```ts
366
+ * const unsubscribe = registry.subscribe(() => {
367
+ * console.log('Registry changed');
368
+ * });
369
+ * ```
370
+ */
371
+ subscribe(listener: () => void): () => void;
372
+ /**
373
+ * Notify all subscribers of a mutation.
374
+ *
375
+ * Iterates all listeners unconditionally so that a throwing listener cannot
376
+ * prevent delivery to subsequent subscribers. The first error encountered is
377
+ * re-thrown after the full iteration completes.
378
+ * @example
379
+ * ```ts
380
+ * public register(item: MyType): void {
381
+ * this.items.set(item.id, item);
382
+ * this.notify(); // Notify subscribers
383
+ * }
384
+ * ```
385
+ */
386
+ protected notify(): void;
387
+ /**
388
+ * Check if an item is registered.
389
+ * @param key - Item key
390
+ * @returns True if item exists
391
+ */
392
+ has(key: TKey): boolean;
393
+ /**
394
+ * Get number of registered items.
395
+ * @returns Count of items
396
+ */
397
+ size(): number;
398
+ }
399
+ //#endregion
400
+ //#region ui/kernel/src/widgets/WidgetRegistry.d.ts
401
+ /**
402
+ * Registry for managing widget definitions.
403
+ *
404
+ * Extends {@link RegistryBase} for Map-based storage and subscription support.
405
+ * Domain-specific methods handle scoped queries, cache invalidation, and
406
+ * duplicate-safe registration semantics.
407
+ */
408
+ declare class WidgetRegistry extends RegistryBase<string, WidgetDefinition> {
409
+ private cachedAll;
410
+ /**
411
+ * Register a widget definition.
412
+ *
413
+ * Returns `false` without throwing when the widget ID is already present,
414
+ * preserving idempotent registration semantics.
415
+ * @param definition - Concretely-typed widget definition
416
+ * @returns `true` when this call acquired the widget ID; `false` on duplicate
417
+ */
418
+ register<TConfig extends Record<string, unknown>>(definition: WidgetDefinition<TConfig>): boolean;
419
+ /**
420
+ * Register multiple widget definitions at once.
421
+ * @param definitions - Array of widget definitions to register
422
+ */
423
+ registerAll(definitions: readonly WidgetDefinition[]): void;
424
+ /**
425
+ * Get a single widget definition by ID.
426
+ * @param widgetId - Widget identifier
427
+ * @returns Widget definition or `undefined` if not registered
428
+ */
429
+ get(widgetId: string): WidgetDefinition | undefined;
430
+ /**
431
+ * Get all registered widget definitions.
432
+ *
433
+ * Result is cached and invalidated on any mutation. The returned array is
434
+ * frozen to prevent callers from mutating the registry's internal cache.
435
+ * @returns Frozen snapshot array of all widget definitions
436
+ */
437
+ getAll(): ReadonlyArray<WidgetDefinition>;
438
+ /**
439
+ * Get widget definitions available in a given scope.
440
+ * @param scope - Target scope to filter by
441
+ * @param includeAny - When `true` (default), also include widgets with `"any"` scope
442
+ * @returns Filtered array of widget definitions
443
+ */
444
+ getByScope(scope: WidgetScope, includeAny?: boolean): WidgetDefinition[];
445
+ /**
446
+ * Unregister a widget by ID.
447
+ * @param widgetId - Widget identifier to remove
448
+ * @returns `true` when the widget existed and was removed; `false` otherwise
449
+ */
450
+ unregister(widgetId: string): boolean;
451
+ /**
452
+ * Remove all registered widget definitions.
453
+ *
454
+ * No-ops silently when the registry is already empty.
455
+ */
456
+ clear(): void;
457
+ }
458
+ /** Global widget registry instance */
459
+ declare const widgetRegistry: WidgetRegistry;
460
+ //#endregion
461
+ //#region ui/kernel/src/widgets/schemas.d.ts
462
+ /**
463
+ * Widget definition schema.
464
+ *
465
+ * Note: `component` is `z.unknown()` because React components are not
466
+ * serializable. This matches the capability pattern where providers
467
+ * use `z.unknown()`. The bus is same-process so serialization isn't needed.
468
+ * @param id - Unique widget identifier
469
+ * @param name - Display name
470
+ * @param scope - Where this widget can appear
471
+ * @param description - Short description (optional)
472
+ * @param supportedSizes - Array of supported sizes
473
+ * @param defaultSize - Default size when added to a slot
474
+ * @param component - React component to render (non-serializable)
475
+ * @param defaultConfig - Default configuration (optional)
476
+ * @param allowMultiple - Whether multiple instances are allowed
477
+ */
478
+ declare const WidgetDefinitionSchema: z.ZodObject<{
479
+ id: z.ZodString;
480
+ name: z.ZodString;
481
+ scope: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
482
+ description: z.ZodOptional<z.ZodString>;
483
+ supportedSizes: z.ZodArray<z.ZodEnum<{
484
+ small: "small";
485
+ medium: "medium";
486
+ large: "large";
487
+ "full-width": "full-width";
488
+ }>>;
489
+ defaultSize: z.ZodEnum<{
490
+ small: "small";
491
+ medium: "medium";
492
+ large: "large";
493
+ "full-width": "full-width";
494
+ }>;
495
+ component: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
496
+ defaultConfig: z.ZodOptional<z.ZodUnknown>;
497
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
498
+ activate: z.ZodOptional<z.ZodObject<{
499
+ pageId: z.ZodOptional<z.ZodString>;
500
+ windowId: z.ZodOptional<z.ZodString>;
501
+ onActivate: z.ZodOptional<z.ZodUnknown & z.ZodType<Function, unknown, z.core.$ZodTypeInternals<Function, unknown>>>;
502
+ }, z.core.$strip>>;
503
+ }, z.core.$strip>;
504
+ /**
505
+ * Unregister payload schema.
506
+ */
507
+ declare const UnregisterSchema: z.ZodObject<{
508
+ widgetId: z.ZodString;
509
+ }, z.core.$strip>;
510
+ /**
511
+ * Widget activated payload schema.
512
+ *
513
+ * Emitted when a user clicks an activatable widget (one that has an `activate`
514
+ * field on its `WidgetDefinition`). This is a renderer-scoped local event and
515
+ * is never forwarded to transports.
516
+ * @param widgetId - The widget definition ID
517
+ * @param instanceId - The specific widget instance ID within the layout
518
+ */
519
+ declare const ActivatedPayloadSchema: z.ZodObject<{
520
+ widgetId: z.ZodString;
521
+ instanceId: z.ZodString;
522
+ }, z.core.$strip>;
523
+ /**
524
+ * List request/response schemas.
525
+ */
526
+ declare const ListRequestSchema: z.ZodObject<{
527
+ scope: z.ZodOptional<z.ZodString>;
528
+ }, z.core.$strip>;
529
+ declare const ListResponseSchema: z.ZodObject<{
530
+ widgets: z.ZodArray<z.ZodObject<{
531
+ id: z.ZodString;
532
+ name: z.ZodString;
533
+ scope: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
534
+ description: z.ZodOptional<z.ZodString>;
535
+ supportedSizes: z.ZodArray<z.ZodEnum<{
536
+ small: "small";
537
+ medium: "medium";
538
+ large: "large";
539
+ "full-width": "full-width";
540
+ }>>;
541
+ defaultSize: z.ZodEnum<{
542
+ small: "small";
543
+ medium: "medium";
544
+ large: "large";
545
+ "full-width": "full-width";
546
+ }>;
547
+ component: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
548
+ defaultConfig: z.ZodOptional<z.ZodUnknown>;
549
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
550
+ activate: z.ZodOptional<z.ZodObject<{
551
+ pageId: z.ZodOptional<z.ZodString>;
552
+ windowId: z.ZodOptional<z.ZodString>;
553
+ onActivate: z.ZodOptional<z.ZodUnknown & z.ZodType<Function, unknown, z.core.$ZodTypeInternals<Function, unknown>>>;
554
+ }, z.core.$strip>>;
555
+ }, z.core.$strip>>;
556
+ }, z.core.$strip>;
557
+ /**
558
+ * Widget domain schemas.
559
+ *
560
+ * Subjects for widget-related bus communication.
561
+ * Each key becomes a subject identifier as: `widget.{key}`
562
+ *
563
+ * All widget subjects are marked as local because widget definitions contain
564
+ * React components which cannot be serialized for transport (SharedWorker, WebSocket).
565
+ * @example
566
+ * ```typescript
567
+ * // List all global widgets
568
+ * const result = await bus.request(WidgetSubjects.list, {
569
+ * scope: 'global',
570
+ * });
571
+ * ```
572
+ */
573
+ declare const WidgetSchemas: {
574
+ /**
575
+ * Register a widget.
576
+ *
577
+ * Subject: `widget.register`
578
+ * Type: Local event (fire-and-forget, never sent to transports)
579
+ * Purpose: Plugins or built-in widgets emit this to register themselves.
580
+ * @example
581
+ * ```typescript
582
+ * bus.emit(WidgetSubjects.register, {
583
+ * id: 'project-picker',
584
+ * name: 'Project Picker',
585
+ * scope: 'global',
586
+ * supportedSizes: ['small', 'medium'],
587
+ * defaultSize: 'medium',
588
+ * component: ProjectPickerComponent,
589
+ * });
590
+ * ```
591
+ */
592
+ register: _$_makaio_core0.LocalSubjectSchema<z.ZodObject<{
593
+ id: z.ZodString;
594
+ name: z.ZodString;
595
+ scope: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
596
+ description: z.ZodOptional<z.ZodString>;
597
+ supportedSizes: z.ZodArray<z.ZodEnum<{
598
+ small: "small";
599
+ medium: "medium";
600
+ large: "large";
601
+ "full-width": "full-width";
602
+ }>>;
603
+ defaultSize: z.ZodEnum<{
604
+ small: "small";
605
+ medium: "medium";
606
+ large: "large";
607
+ "full-width": "full-width";
608
+ }>;
609
+ component: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
610
+ defaultConfig: z.ZodOptional<z.ZodUnknown>;
611
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
612
+ activate: z.ZodOptional<z.ZodObject<{
613
+ pageId: z.ZodOptional<z.ZodString>;
614
+ windowId: z.ZodOptional<z.ZodString>;
615
+ onActivate: z.ZodOptional<z.ZodUnknown & z.ZodType<Function, unknown, z.core.$ZodTypeInternals<Function, unknown>>>;
616
+ }, z.core.$strip>>;
617
+ }, z.core.$strip>>;
618
+ /**
619
+ * Unregister a widget.
620
+ *
621
+ * Subject: `widget.unregister`
622
+ * Type: Local event (fire-and-forget, never sent to transports)
623
+ * Purpose: Remove a widget from the registry by ID.
624
+ * @param widgetId - Widget ID to unregister
625
+ * @example
626
+ * ```typescript
627
+ * bus.emit(WidgetSubjects.unregister, {
628
+ * widgetId: 'project-picker',
629
+ * });
630
+ * ```
631
+ */
632
+ unregister: _$_makaio_core0.LocalSubjectSchema<z.ZodObject<{
633
+ widgetId: z.ZodString;
634
+ }, z.core.$strip>>;
635
+ /**
636
+ * List all registered widgets.
637
+ *
638
+ * Subject: `widget.list`
639
+ * Type: Local request (RPC, never sent to transports)
640
+ * Purpose: Query available widgets, optionally filtered by scope.
641
+ * @param scope - Widget scope to filter by (optional)
642
+ * @returns Array of widget definitions
643
+ * @example
644
+ * ```typescript
645
+ * // List all widgets
646
+ * const allWidgets = await bus.request(WidgetSubjects.list, {});
647
+ *
648
+ * // List only global widgets
649
+ * const globalWidgets = await bus.request(WidgetSubjects.list, {
650
+ * scope: 'global',
651
+ * });
652
+ * ```
653
+ */
654
+ list: _$_makaio_core0.LocalSubjectSchema<{
655
+ request: z.ZodObject<{
656
+ scope: z.ZodOptional<z.ZodString>;
657
+ }, z.core.$strip>;
658
+ response: z.ZodObject<{
659
+ widgets: z.ZodArray<z.ZodObject<{
660
+ id: z.ZodString;
661
+ name: z.ZodString;
662
+ scope: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
663
+ description: z.ZodOptional<z.ZodString>;
664
+ supportedSizes: z.ZodArray<z.ZodEnum<{
665
+ small: "small";
666
+ medium: "medium";
667
+ large: "large";
668
+ "full-width": "full-width";
669
+ }>>;
670
+ defaultSize: z.ZodEnum<{
671
+ small: "small";
672
+ medium: "medium";
673
+ large: "large";
674
+ "full-width": "full-width";
675
+ }>;
676
+ component: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
677
+ defaultConfig: z.ZodOptional<z.ZodUnknown>;
678
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
679
+ activate: z.ZodOptional<z.ZodObject<{
680
+ pageId: z.ZodOptional<z.ZodString>;
681
+ windowId: z.ZodOptional<z.ZodString>;
682
+ onActivate: z.ZodOptional<z.ZodUnknown & z.ZodType<Function, unknown, z.core.$ZodTypeInternals<Function, unknown>>>;
683
+ }, z.core.$strip>>;
684
+ }, z.core.$strip>>;
685
+ }, z.core.$strip>;
686
+ }>;
687
+ /**
688
+ * Emitted when a user activates a widget by clicking it.
689
+ *
690
+ * Subject: `widget.activated`
691
+ * Type: Local event (fire-and-forget, never sent to transports)
692
+ * Purpose: Signals that a widget with an `activate` field was clicked.
693
+ * Consumers (e.g. analytics, debug tooling) can subscribe to this event
694
+ * to observe widget activation without coupling to the grid implementation.
695
+ * @param widgetId - The widget definition ID
696
+ * @param instanceId - The widget instance ID within the layout
697
+ * @example
698
+ * ```typescript
699
+ * bus.on(WidgetSubjects.activated, (ctx) => {
700
+ * console.log(`Widget activated: ${ctx.payload.widgetId}`);
701
+ * });
702
+ * ```
703
+ */
704
+ activated: _$_makaio_core0.LocalSubjectSchema<z.ZodObject<{
705
+ widgetId: z.ZodString;
706
+ instanceId: z.ZodString;
707
+ }, z.core.$strip>>;
708
+ };
709
+ /**
710
+ * Raw (unwrapped) schemas for direct validation in tests.
711
+ *
712
+ * Use these for schema validation tests. For bus communication,
713
+ * use WidgetSubjects from namespace.ts.
714
+ * @internal
715
+ */
716
+ declare const WidgetRawSchemas: {
717
+ readonly register: z.ZodObject<{
718
+ id: z.ZodString;
719
+ name: z.ZodString;
720
+ scope: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
721
+ description: z.ZodOptional<z.ZodString>;
722
+ supportedSizes: z.ZodArray<z.ZodEnum<{
723
+ small: "small";
724
+ medium: "medium";
725
+ large: "large";
726
+ "full-width": "full-width";
727
+ }>>;
728
+ defaultSize: z.ZodEnum<{
729
+ small: "small";
730
+ medium: "medium";
731
+ large: "large";
732
+ "full-width": "full-width";
733
+ }>;
734
+ component: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
735
+ defaultConfig: z.ZodOptional<z.ZodUnknown>;
736
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
737
+ activate: z.ZodOptional<z.ZodObject<{
738
+ pageId: z.ZodOptional<z.ZodString>;
739
+ windowId: z.ZodOptional<z.ZodString>;
740
+ onActivate: z.ZodOptional<z.ZodUnknown & z.ZodType<Function, unknown, z.core.$ZodTypeInternals<Function, unknown>>>;
741
+ }, z.core.$strip>>;
742
+ }, z.core.$strip>;
743
+ readonly unregister: z.ZodObject<{
744
+ widgetId: z.ZodString;
745
+ }, z.core.$strip>;
746
+ readonly list: {
747
+ readonly request: z.ZodObject<{
748
+ scope: z.ZodOptional<z.ZodString>;
749
+ }, z.core.$strip>;
750
+ readonly response: z.ZodObject<{
751
+ widgets: z.ZodArray<z.ZodObject<{
752
+ id: z.ZodString;
753
+ name: z.ZodString;
754
+ scope: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
755
+ description: z.ZodOptional<z.ZodString>;
756
+ supportedSizes: z.ZodArray<z.ZodEnum<{
757
+ small: "small";
758
+ medium: "medium";
759
+ large: "large";
760
+ "full-width": "full-width";
761
+ }>>;
762
+ defaultSize: z.ZodEnum<{
763
+ small: "small";
764
+ medium: "medium";
765
+ large: "large";
766
+ "full-width": "full-width";
767
+ }>;
768
+ component: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
769
+ defaultConfig: z.ZodOptional<z.ZodUnknown>;
770
+ allowMultiple: z.ZodOptional<z.ZodBoolean>;
771
+ activate: z.ZodOptional<z.ZodObject<{
772
+ pageId: z.ZodOptional<z.ZodString>;
773
+ windowId: z.ZodOptional<z.ZodString>;
774
+ onActivate: z.ZodOptional<z.ZodUnknown & z.ZodType<Function, unknown, z.core.$ZodTypeInternals<Function, unknown>>>;
775
+ }, z.core.$strip>>;
776
+ }, z.core.$strip>>;
777
+ }, z.core.$strip>;
778
+ };
779
+ readonly activated: z.ZodObject<{
780
+ widgetId: z.ZodString;
781
+ instanceId: z.ZodString;
782
+ }, z.core.$strip>;
783
+ };
784
+ /**
785
+ * Type exports for external use.
786
+ *
787
+ * These types are inferred from the Zod schemas and provide
788
+ * type safety when working with widget-related bus messages.
789
+ */
790
+ type WidgetDefinitionPayload = z.infer<typeof WidgetDefinitionSchema>;
791
+ type UnregisterPayload = z.infer<typeof UnregisterSchema>;
792
+ type ListWidgetsRequest = z.infer<typeof ListRequestSchema>;
793
+ type ListWidgetsResponse = z.infer<typeof ListResponseSchema>;
794
+ /** Payload of the `widget.activated` event. */
795
+ type WidgetActivatedPayload = z.infer<typeof ActivatedPayloadSchema>;
796
+ //#endregion
797
+ //#region ui/kernel/src/widgets/namespace.d.ts
798
+ declare const WidgetNamespace: _$_makaio_core0.BusNamespaceDefinition<"widget", {
799
+ register: _$_makaio_core0.LocalSubjectSchema<_$zod.ZodObject<{
800
+ id: _$zod.ZodString;
801
+ name: _$zod.ZodString;
802
+ scope: _$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>]>;
803
+ description: _$zod.ZodOptional<_$zod.ZodString>;
804
+ supportedSizes: _$zod.ZodArray<_$zod.ZodEnum<{
805
+ small: "small";
806
+ medium: "medium";
807
+ large: "large";
808
+ "full-width": "full-width";
809
+ }>>;
810
+ defaultSize: _$zod.ZodEnum<{
811
+ small: "small";
812
+ medium: "medium";
813
+ large: "large";
814
+ "full-width": "full-width";
815
+ }>;
816
+ component: _$zod.ZodUnknown & _$zod.ZodType<{} | null, unknown, _$zod_v4_core0.$ZodTypeInternals<{} | null, unknown>>;
817
+ defaultConfig: _$zod.ZodOptional<_$zod.ZodUnknown>;
818
+ allowMultiple: _$zod.ZodOptional<_$zod.ZodBoolean>;
819
+ activate: _$zod.ZodOptional<_$zod.ZodObject<{
820
+ pageId: _$zod.ZodOptional<_$zod.ZodString>;
821
+ windowId: _$zod.ZodOptional<_$zod.ZodString>;
822
+ onActivate: _$zod.ZodOptional<_$zod.ZodUnknown & _$zod.ZodType<Function, unknown, _$zod_v4_core0.$ZodTypeInternals<Function, unknown>>>;
823
+ }, _$zod_v4_core0.$strip>>;
824
+ }, _$zod_v4_core0.$strip>>;
825
+ unregister: _$_makaio_core0.LocalSubjectSchema<_$zod.ZodObject<{
826
+ widgetId: _$zod.ZodString;
827
+ }, _$zod_v4_core0.$strip>>;
828
+ list: _$_makaio_core0.LocalSubjectSchema<{
829
+ request: _$zod.ZodObject<{
830
+ scope: _$zod.ZodOptional<_$zod.ZodString>;
831
+ }, _$zod_v4_core0.$strip>;
832
+ response: _$zod.ZodObject<{
833
+ widgets: _$zod.ZodArray<_$zod.ZodObject<{
834
+ id: _$zod.ZodString;
835
+ name: _$zod.ZodString;
836
+ scope: _$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>]>;
837
+ description: _$zod.ZodOptional<_$zod.ZodString>;
838
+ supportedSizes: _$zod.ZodArray<_$zod.ZodEnum<{
839
+ small: "small";
840
+ medium: "medium";
841
+ large: "large";
842
+ "full-width": "full-width";
843
+ }>>;
844
+ defaultSize: _$zod.ZodEnum<{
845
+ small: "small";
846
+ medium: "medium";
847
+ large: "large";
848
+ "full-width": "full-width";
849
+ }>;
850
+ component: _$zod.ZodUnknown & _$zod.ZodType<{} | null, unknown, _$zod_v4_core0.$ZodTypeInternals<{} | null, unknown>>;
851
+ defaultConfig: _$zod.ZodOptional<_$zod.ZodUnknown>;
852
+ allowMultiple: _$zod.ZodOptional<_$zod.ZodBoolean>;
853
+ activate: _$zod.ZodOptional<_$zod.ZodObject<{
854
+ pageId: _$zod.ZodOptional<_$zod.ZodString>;
855
+ windowId: _$zod.ZodOptional<_$zod.ZodString>;
856
+ onActivate: _$zod.ZodOptional<_$zod.ZodUnknown & _$zod.ZodType<Function, unknown, _$zod_v4_core0.$ZodTypeInternals<Function, unknown>>>;
857
+ }, _$zod_v4_core0.$strip>>;
858
+ }, _$zod_v4_core0.$strip>>;
859
+ }, _$zod_v4_core0.$strip>;
860
+ }>;
861
+ activated: _$_makaio_core0.LocalSubjectSchema<_$zod.ZodObject<{
862
+ widgetId: _$zod.ZodString;
863
+ instanceId: _$zod.ZodString;
864
+ }, _$zod_v4_core0.$strip>>;
865
+ }>;
866
+ declare const WidgetSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubjectDefinitions<"widget", {
867
+ register: _$_makaio_core0.LocalSubjectSchema<_$zod.ZodObject<{
868
+ id: _$zod.ZodString;
869
+ name: _$zod.ZodString;
870
+ scope: _$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>]>;
871
+ description: _$zod.ZodOptional<_$zod.ZodString>;
872
+ supportedSizes: _$zod.ZodArray<_$zod.ZodEnum<{
873
+ small: "small";
874
+ medium: "medium";
875
+ large: "large";
876
+ "full-width": "full-width";
877
+ }>>;
878
+ defaultSize: _$zod.ZodEnum<{
879
+ small: "small";
880
+ medium: "medium";
881
+ large: "large";
882
+ "full-width": "full-width";
883
+ }>;
884
+ component: _$zod.ZodUnknown & _$zod.ZodType<{} | null, unknown, _$zod_v4_core0.$ZodTypeInternals<{} | null, unknown>>;
885
+ defaultConfig: _$zod.ZodOptional<_$zod.ZodUnknown>;
886
+ allowMultiple: _$zod.ZodOptional<_$zod.ZodBoolean>;
887
+ activate: _$zod.ZodOptional<_$zod.ZodObject<{
888
+ pageId: _$zod.ZodOptional<_$zod.ZodString>;
889
+ windowId: _$zod.ZodOptional<_$zod.ZodString>;
890
+ onActivate: _$zod.ZodOptional<_$zod.ZodUnknown & _$zod.ZodType<Function, unknown, _$zod_v4_core0.$ZodTypeInternals<Function, unknown>>>;
891
+ }, _$zod_v4_core0.$strip>>;
892
+ }, _$zod_v4_core0.$strip>>;
893
+ unregister: _$_makaio_core0.LocalSubjectSchema<_$zod.ZodObject<{
894
+ widgetId: _$zod.ZodString;
895
+ }, _$zod_v4_core0.$strip>>;
896
+ list: _$_makaio_core0.LocalSubjectSchema<{
897
+ request: _$zod.ZodObject<{
898
+ scope: _$zod.ZodOptional<_$zod.ZodString>;
899
+ }, _$zod_v4_core0.$strip>;
900
+ response: _$zod.ZodObject<{
901
+ widgets: _$zod.ZodArray<_$zod.ZodObject<{
902
+ id: _$zod.ZodString;
903
+ name: _$zod.ZodString;
904
+ scope: _$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodArray<_$zod.ZodString>]>;
905
+ description: _$zod.ZodOptional<_$zod.ZodString>;
906
+ supportedSizes: _$zod.ZodArray<_$zod.ZodEnum<{
907
+ small: "small";
908
+ medium: "medium";
909
+ large: "large";
910
+ "full-width": "full-width";
911
+ }>>;
912
+ defaultSize: _$zod.ZodEnum<{
913
+ small: "small";
914
+ medium: "medium";
915
+ large: "large";
916
+ "full-width": "full-width";
917
+ }>;
918
+ component: _$zod.ZodUnknown & _$zod.ZodType<{} | null, unknown, _$zod_v4_core0.$ZodTypeInternals<{} | null, unknown>>;
919
+ defaultConfig: _$zod.ZodOptional<_$zod.ZodUnknown>;
920
+ allowMultiple: _$zod.ZodOptional<_$zod.ZodBoolean>;
921
+ activate: _$zod.ZodOptional<_$zod.ZodObject<{
922
+ pageId: _$zod.ZodOptional<_$zod.ZodString>;
923
+ windowId: _$zod.ZodOptional<_$zod.ZodString>;
924
+ onActivate: _$zod.ZodOptional<_$zod.ZodUnknown & _$zod.ZodType<Function, unknown, _$zod_v4_core0.$ZodTypeInternals<Function, unknown>>>;
925
+ }, _$zod_v4_core0.$strip>>;
926
+ }, _$zod_v4_core0.$strip>>;
927
+ }, _$zod_v4_core0.$strip>;
928
+ }>;
929
+ activated: _$_makaio_core0.LocalSubjectSchema<_$zod.ZodObject<{
930
+ widgetId: _$zod.ZodString;
931
+ instanceId: _$zod.ZodString;
932
+ }, _$zod_v4_core0.$strip>>;
933
+ }>, "widget">;
934
+ //#endregion
935
+ //#region ui/kernel/src/widgets/tray-layout.d.ts
936
+ /**
937
+ * Derive a read-only `WidgetLayout` for the tray surface.
938
+ *
939
+ * Ordering contract:
940
+ * 1. Placements whose `widgetId` appears in `lockedWidgetIds` come first, in
941
+ * the order they appear in `lockedWidgetIds`. These receive `locked: true`.
942
+ * 2. All other tray-scoped widgets follow in their registration order.
943
+ *
944
+ * All placements default to `w: TRAY_GRID_COLS` (full tray width). The row
945
+ * height `h` is derived from the widget's `trayDefaultSize` (if set) or
946
+ * `defaultSize`.
947
+ * @param allWidgets - Stable widget registry snapshot in registration order.
948
+ * @param lockedWidgetIds - Widget IDs pinned at the top of the tray.
949
+ * @returns Derived tray layout with deterministic placement order.
950
+ */
951
+ declare function deriveTrayLayout(allWidgets: readonly WidgetDefinition[], lockedWidgetIds?: readonly string[]): WidgetLayout;
952
+ //#endregion
953
+ //#region ui/kernel/src/widgets/register.d.ts
954
+ /**
955
+ * Register a widget with the widget system.
956
+ *
957
+ * Registers the widget in the local registry and emits a local bus event for
958
+ * any active observers.
959
+ * @param bus - Bus instance
960
+ * @param definition - Widget definition including component
961
+ * @returns `true` when this call acquired the widget ID
962
+ */
963
+ declare function registerWidget(bus: IMakaioBus, definition: WidgetDefinition): boolean;
964
+ /**
965
+ * Register multiple widgets at once.
966
+ * @param bus - Bus instance
967
+ * @param definitions - Array of widget definitions
968
+ * @returns IDs that were newly registered by this call
969
+ */
970
+ declare function registerWidgets(bus: IMakaioBus, definitions: readonly WidgetDefinition[]): string[];
971
+ /**
972
+ * Unregister a widget by ID.
973
+ * @param bus - Bus instance
974
+ * @param widgetId - Widget ID to unregister
975
+ * @returns `true` when the widget existed and was removed
976
+ */
977
+ declare function unregisterWidget(bus: IMakaioBus, widgetId: string): boolean;
978
+ //#endregion
979
+ //#region ui/kernel/src/widgets/subscriptions.d.ts
980
+ /**
981
+ * Subscribe to widget bus events.
982
+ *
983
+ * Wires bus events to the internal widget registry.
984
+ * Call once at app startup after bus is ready.
985
+ * @param bus - Bus instance
986
+ * @returns Cleanup function to unsubscribe all handlers
987
+ */
988
+ declare function subscribeToWidgetEvents(bus: IMakaioBus): () => void;
989
+ //#endregion
990
+ //#region ui/kernel/src/navigation/types.d.ts
991
+ /**
992
+ * Navigation hierarchy level.
993
+ *
994
+ * Host products extend the available levels through `UiNavigationLevelMap`.
995
+ * Framework-owned levels are `root` and `any`.
996
+ */
997
+ type NavigationLevel = UiNavigationLevel;
998
+ /**
999
+ * Navigation action - what happens when a target is selected.
1000
+ *
1001
+ * The `focus` action uses a plain `string` focus context identifier.
1002
+ * (The `FocusContextId` branded type is intentionally not used at the kernel
1003
+ * tier — plain strings keep this tier portable across focus-context implementations.)
1004
+ */
1005
+ type NavigationAction = {
1006
+ type: 'focus';
1007
+ focusContext: string;
1008
+ } | {
1009
+ type: 'page';
1010
+ pageId: string;
1011
+ } | {
1012
+ type: 'command';
1013
+ commandId: string;
1014
+ } | {
1015
+ type: 'callback';
1016
+ handler: () => void;
1017
+ } | {
1018
+ type: 'external';
1019
+ url: string;
1020
+ };
1021
+ /**
1022
+ * Extensible navigation group map.
1023
+ *
1024
+ * Plugins extend via module augmentation:
1025
+ * ```typescript
1026
+ * declare module '@makaio/framework/ui-kernel' {
1027
+ * interface NavigationGroupMap {
1028
+ * 'my-plugin-section': true;
1029
+ * }
1030
+ * }
1031
+ * ```
1032
+ */
1033
+ interface NavigationGroupMap {
1034
+ /** Workspace-switching pages (Dashboard, Chat, Git) */
1035
+ navigate: true;
1036
+ /** Analytics and reporting pages */
1037
+ analytics: true;
1038
+ /** Quick-access overlay pages (Settings, Projects, Sessions) */
1039
+ 'quick-access': true;
1040
+ }
1041
+ /**
1042
+ * Navigation group identifier.
1043
+ * Type-safe via declaration merging of NavigationGroupMap.
1044
+ */
1045
+ type NavigationGroup = keyof NavigationGroupMap;
1046
+ /**
1047
+ * Navigation target - an item that appears in navigation UI.
1048
+ *
1049
+ * Registered via NavigationRegistry and queried by navigation components
1050
+ * (KaiTrigger hover, Quick Prompt suggestions, breadcrumb dropdowns).
1051
+ */
1052
+ interface NavigationTarget {
1053
+ /** Unique identifier */
1054
+ id: string;
1055
+ /** Display label */
1056
+ label: string;
1057
+ /** Optional description for autocomplete/tooltips */
1058
+ description?: string;
1059
+ /** Icon component (lucide-react style) */
1060
+ icon?: IconComponentLike;
1061
+ /** Navigation level where this target is available */
1062
+ level: NavigationLevel;
1063
+ /** What happens on navigation */
1064
+ action: NavigationAction;
1065
+ /** Keyboard shortcut hint (display only, actual binding is separate) */
1066
+ shortcut?: string;
1067
+ /** Order in navigation list (lower = first, default = 50) */
1068
+ order?: number;
1069
+ /** Group for visual separation */
1070
+ group?: NavigationGroup;
1071
+ /**
1072
+ * Dynamic visibility condition.
1073
+ * Called when building navigation list - return false to hide.
1074
+ */
1075
+ when?: () => boolean;
1076
+ /**
1077
+ * Whether this target is currently active/selected.
1078
+ * Called when rendering - return true to show active state.
1079
+ */
1080
+ isActive?: () => boolean;
1081
+ }
1082
+ /**
1083
+ * Options for querying navigation targets.
1084
+ */
1085
+ interface NavigationQueryOptions {
1086
+ /** Filter by navigation level (includes 'any' targets) */
1087
+ level?: NavigationLevel;
1088
+ /** Filter by group */
1089
+ group?: NavigationGroup;
1090
+ /** Include targets where when() returns false */
1091
+ includeHidden?: boolean;
1092
+ }
1093
+ //#endregion
1094
+ //#region ui/kernel/src/pages/page-definition-types.d.ts
1095
+ /**
1096
+ * Navigation level where a page is available.
1097
+ *
1098
+ * Host products extend the available levels through `UiNavigationLevelMap`.
1099
+ * Framework-owned levels are `root` and `any`.
1100
+ */
1101
+ type PageLevel = UiNavigationLevel;
1102
+ /**
1103
+ * Page mode determines UI behavior when navigating to a page.
1104
+ *
1105
+ * - `switch`: Changes workspace focus. Page content takes over the main workspace area.
1106
+ * Appears in sidebar "Navigate" section. Example: Home, Status, Chat pages.
1107
+ *
1108
+ * - `peek`: Opens as a constrained overlay that preserves workspace state underneath.
1109
+ * Small modal (~800px). Example: Future pickers, quick-reference lookups.
1110
+ *
1111
+ * - `cover`: Legacy full-viewport overlay mode. Kept during the transition
1112
+ * for existing registered pages.
1113
+ *
1114
+ * - `sheet`: Opens as a full-viewport sheet overlay that preserves workspace
1115
+ * state underneath. New fullscreen overlays should use this mode.
1116
+ */
1117
+ type PageMode = 'switch' | 'peek' | 'cover' | 'sheet';
1118
+ /**
1119
+ * Check if a page mode uses the overlay system (pageOverlayStore).
1120
+ *
1121
+ * `peek`, `cover`, and `sheet` modes open via the overlay store, while
1122
+ * `switch` changes workspace focus. This helper centralizes the mode
1123
+ * classification to avoid duplicating mode checks.
1124
+ * @param mode - The page mode to check
1125
+ * @returns True if the mode opens an overlay (peek, cover, or sheet)
1126
+ */
1127
+ declare function isOverlayMode(mode: PageMode): boolean;
1128
+ /**
1129
+ * Props passed to all page components when rendered.
1130
+ *
1131
+ * This standardized interface ensures consistency across all page implementations,
1132
+ * whether built-in or plugin-provided.
1133
+ */
1134
+ interface PageComponentProps {
1135
+ /**
1136
+ * Optional CSS class name for the page container.
1137
+ * Applied to the root element of the page for custom styling.
1138
+ */
1139
+ className?: string;
1140
+ /**
1141
+ * Internal route within the page (for peek mode with sub-navigation).
1142
+ *
1143
+ * Example: For Settings page, this might be 'appearance' or 'extensions/example'
1144
+ * to navigate to specific settings sections.
1145
+ *
1146
+ * Defaults to null (no internal route, show default page view).
1147
+ */
1148
+ internalRoute?: string | null;
1149
+ /**
1150
+ * Callback for internal navigation within the page.
1151
+ *
1152
+ * Pages call this when user navigates between sub-sections (tabs, panels, etc.)
1153
+ * to update the URL and maintain navigation history.
1154
+ * @param route - The new internal route path
1155
+ */
1156
+ onNavigate?: (route: string) => void;
1157
+ }
1158
+ /**
1159
+ * Unified page definition — single source of truth for page identity,
1160
+ * navigation behavior, and rendering.
1161
+ *
1162
+ * Pages are defined as pure data in `web/pages` and registered into
1163
+ * PageDefinitionRegistry at app startup. This replaces hardcoded page
1164
+ * mappings and navigation targets.
1165
+ * @example
1166
+ * ```typescript
1167
+ * import { Settings } from 'lucide-react';
1168
+ *
1169
+ * export const settingsPageDefinition: PageDefinition = {
1170
+ * id: 'settings',
1171
+ * name: 'Settings',
1172
+ * description: 'Application settings and configuration',
1173
+ * icon: Settings,
1174
+ * mode: 'peek',
1175
+ * level: 'any',
1176
+ * component: () => import('@makaio/framework/ui-views').then(m => ({ default: m.SettingsView })),
1177
+ * group: 'quick-access',
1178
+ * order: 100,
1179
+ * shortcut: '⌘,',
1180
+ * };
1181
+ * ```
1182
+ */
1183
+ interface PageDefinition {
1184
+ /**
1185
+ * Unique page identifier.
1186
+ *
1187
+ * Built-in pages use simple IDs: 'settings', 'sessions', 'home'
1188
+ * Plugin pages use namespaced IDs: 'plugin-name:page-id'
1189
+ * @example 'settings'
1190
+ * @example 'example-plugin:details'
1191
+ */
1192
+ id: string;
1193
+ /**
1194
+ * Display name for sidebar, slash command, overlay title.
1195
+ *
1196
+ * Keep concise (1-2 words) for sidebar display.
1197
+ * @example 'Settings'
1198
+ * @example 'Runtime Status'
1199
+ */
1200
+ name: string;
1201
+ /**
1202
+ * Description for autocomplete tooltips and slash command suggestions.
1203
+ *
1204
+ * Shown in Quick Prompt suggestions and sidebar tooltips.
1205
+ * One sentence describing what the page does.
1206
+ * @example 'Application settings and configuration'
1207
+ */
1208
+ description?: string;
1209
+ /**
1210
+ * Icon component for sidebar and command palette.
1211
+ *
1212
+ * Use lucide-react icons directly (sync import).
1213
+ * Icons are tree-shaken and tiny, no need for lazy loading.
1214
+ * @example Settings (from 'lucide-react')
1215
+ */
1216
+ icon?: IconComponentLike;
1217
+ /**
1218
+ * Page mode determines navigation behavior.
1219
+ *
1220
+ * - `switch`: Takes over workspace, shows in "Navigate" section
1221
+ * - `peek`: Small overlay preserving state, shows in "Quick Access" section
1222
+ * - `cover`: Legacy full-viewport overlay mode
1223
+ * - `sheet`: Full-viewport sheet overlay preserving workspace state
1224
+ */
1225
+ mode: PageMode;
1226
+ /**
1227
+ * Navigation level where this page is available.
1228
+ *
1229
+ * Pages with `level: 'any'` are always available.
1230
+ * Pages with specific levels only appear when that context is active.
1231
+ *
1232
+ * The query system automatically includes 'any' pages when filtering by level.
1233
+ * @example 'any' - Settings available everywhere
1234
+ * @example 'root' - Root shell pages
1235
+ */
1236
+ level: PageLevel;
1237
+ /**
1238
+ * Lazy-loaded page component for code splitting.
1239
+ *
1240
+ * Must return a module with a default export that accepts PageComponentProps.
1241
+ * Use dynamic import for automatic code splitting.
1242
+ * @example
1243
+ * ```typescript
1244
+ * () => import('./SettingsView.js').then(m => (\{ default: m.SettingsView \}))
1245
+ * ```
1246
+ */
1247
+ component: () => Promise<LazyComponentModule<PageComponentProps>>;
1248
+ /**
1249
+ * Display order in sidebar (lower = first).
1250
+ *
1251
+ * Applied automatically during registration if omitted (defaults to 50).
1252
+ */
1253
+ order?: number;
1254
+ /**
1255
+ * Navigation group for sidebar visual organization.
1256
+ *
1257
+ * Groups create visual separation in navigation UI.
1258
+ * Applied automatically during registration if omitted (defaults to 'navigate').
1259
+ */
1260
+ group?: NavigationGroup;
1261
+ /**
1262
+ * Keyboard shortcut hint (display-only).
1263
+ *
1264
+ * Shown in sidebar and tooltips. Actual keyboard binding
1265
+ * is registered separately through the keybinding system.
1266
+ * @example '⌘,' - Command+Comma for Settings
1267
+ * @example '⌘S' - Command+S for Search
1268
+ */
1269
+ shortcut?: string;
1270
+ /**
1271
+ * Dynamic visibility condition.
1272
+ *
1273
+ * Called when building navigation lists. Return false to hide
1274
+ * the page from sidebar and command palette.
1275
+ *
1276
+ * Use for feature flags, permission checks, or context-dependent availability.
1277
+ * @returns True to show the page, false to hide it
1278
+ * @example
1279
+ * ```typescript
1280
+ * () => featureFlags.pageEnabled
1281
+ * ```
1282
+ */
1283
+ when?: () => boolean;
1284
+ /**
1285
+ * Whether this page is currently active/selected.
1286
+ *
1287
+ * Called when rendering sidebar to show active indicator.
1288
+ * Used for visual feedback of current page.
1289
+ * @returns True to show active state, false otherwise
1290
+ * @example
1291
+ * ```typescript
1292
+ * () => focusStore.getState().activeFocus.id === 'settings'
1293
+ * ```
1294
+ */
1295
+ isActive?: () => boolean;
1296
+ /**
1297
+ * Focus context identifier for switch-mode pages.
1298
+ *
1299
+ * When set, switching to this page sets the active focus context.
1300
+ * Only relevant for mode='switch' pages.
1301
+ * Plain string (not a branded FocusContextId) for kernel-tier portability.
1302
+ * @example 'chat' - Switching to chat page activates chat focus context
1303
+ * @example 'settings' - Switching to settings page activates settings focus context
1304
+ */
1305
+ focusContext?: string;
1306
+ /**
1307
+ * Extract the active section ID from an internal route.
1308
+ *
1309
+ * Used by PageCoverView to highlight the active sidebar entry
1310
+ * when the page has registered sections in PageSectionRegistry.
1311
+ * Return null for overview/non-section routes.
1312
+ * @param internalRoute - The current internal route (e.g., '/settings/relay')
1313
+ * @returns Section ID if route maps to a section, null otherwise
1314
+ * @example
1315
+ * ```typescript
1316
+ * // Settings page: /settings/relay → 'relay', /settings/adapters/openai → null
1317
+ * parseSectionId: (route) => {
1318
+ * if (!route) return null;
1319
+ * const match = route.match(/^\/settings\/([^/]+)$/);
1320
+ * return match?.[1] ?? null;
1321
+ * }
1322
+ * ```
1323
+ */
1324
+ parseSectionId?: (internalRoute: string | null) => string | null;
1325
+ /**
1326
+ * Surface visibility configuration.
1327
+ *
1328
+ * Controls which rendering surfaces (web, mobile, electron) can display this page.
1329
+ * Uses either explicit surface IDs or capability requirements.
1330
+ * - Omitted: available on every surface (backward-compatible default)
1331
+ * - `{ surfaces: ['web'] }`: web only
1332
+ * - `{ surfaces: ['mobile'] }`: mobile only
1333
+ * - `{ requiredCapabilities: ['dom'] }`: any surface with DOM access
1334
+ * @example
1335
+ * ```typescript
1336
+ * { surfaces: ['web', 'electron'] } // Web and desktop only
1337
+ * ```
1338
+ * @example
1339
+ * ```typescript
1340
+ * { requiredCapabilities: ['touch'] } // Touch-capable surfaces
1341
+ * ```
1342
+ */
1343
+ surface?: PageSurfaceConfig;
1344
+ /**
1345
+ * Which Electron window(s) this page appears in, identified by qualified
1346
+ * registration ID (`{packageName}:{windowId}`).
1347
+ *
1348
+ * When omitted or `undefined`, the page is visible in all windows.
1349
+ * Accepts a single ID or an array for pages shared across multiple windows.
1350
+ * @example
1351
+ * ```typescript
1352
+ * windowId: 'makaio.workspace-window:main' // Only in workspace windows
1353
+ * ```
1354
+ * @example
1355
+ * ```typescript
1356
+ * windowId: ['makaio.workspace-window:main', 'makaio.chat:main'] // Multiple windows
1357
+ * ```
1358
+ */
1359
+ windowId?: string | string[];
1360
+ }
1361
+ /**
1362
+ * Query options for filtering page definitions.
1363
+ *
1364
+ * All filters are optional and combine with AND logic.
1365
+ * Level filter automatically includes pages with level='any'.
1366
+ */
1367
+ interface PageDefinitionQueryOptions {
1368
+ /**
1369
+ * Filter by page mode.
1370
+ * @example
1371
+ * ```typescript
1372
+ * \{ mode: 'peek' \} // Only overlay pages
1373
+ * ```
1374
+ */
1375
+ mode?: PageMode;
1376
+ /**
1377
+ * Filter by navigation level.
1378
+ * Automatically includes pages with level='any'.
1379
+ * @example
1380
+ * ```typescript
1381
+ * \{ level: 'root' \} // Root and 'any' pages
1382
+ * ```
1383
+ */
1384
+ level?: PageLevel;
1385
+ /**
1386
+ * Filter by navigation group.
1387
+ * @example
1388
+ * ```typescript
1389
+ * \{ group: 'quick-access' \} // Only quick access pages
1390
+ * ```
1391
+ */
1392
+ group?: NavigationGroup;
1393
+ /**
1394
+ * Filter by rendering surface.
1395
+ *
1396
+ * When set, only pages available on this surface are returned.
1397
+ * Pages with `surface` omitted are always included (available everywhere).
1398
+ * Pages that declare only `requiredCapabilities` are excluded — a SurfaceId
1399
+ * alone is not sufficient to evaluate capability requirements. Use
1400
+ * `isPageVisibleOnSurface(page, surfaceDeclaration)` at the surface runtime to
1401
+ * include capability-gated pages with their full capability set.
1402
+ * @example
1403
+ * ```typescript
1404
+ * \{ surface: 'mobile' \} // Pages available on mobile
1405
+ * ```
1406
+ */
1407
+ surface?: SurfaceId;
1408
+ /**
1409
+ * Include pages where when() returns false.
1410
+ *
1411
+ * Defaults to false (hidden pages excluded from results).
1412
+ */
1413
+ includeHidden?: boolean;
1414
+ }
1415
+ //#endregion
1416
+ //#region ui/kernel/src/pages/types.d.ts
1417
+ /**
1418
+ * Normalized slot identifiers.
1419
+ * Pages pick from this vocabulary - they don't invent custom names.
1420
+ */
1421
+ type SlotId = 'main' | 'sidebar-left' | 'sidebar-right' | 'detail-panel' | 'bottom-panel' | 'widget-zone';
1422
+ /**
1423
+ * Slot definition - how a content area behaves.
1424
+ * All slots are grids with dynamic column calculation.
1425
+ */
1426
+ interface SlotDefinition {
1427
+ /** Normalized slot identifier */
1428
+ id: SlotId;
1429
+ /** Human-readable name for UI (e.g., "Main Content", "Details Panel") */
1430
+ name: string;
1431
+ /** Which widget sizes this slot accepts - used for compatibility filtering */
1432
+ acceptsSizes: WidgetSize[];
1433
+ /**
1434
+ * Minimum width per column in pixels.
1435
+ * Drives dynamic column count: cols = floor(width / minColumnWidth)
1436
+ */
1437
+ minColumnWidth: number;
1438
+ /** Maximum columns (cap for very wide slots) */
1439
+ maxColumns: number;
1440
+ /** Whether slot can be collapsed by user */
1441
+ collapsible?: boolean;
1442
+ /** Default collapsed state */
1443
+ defaultCollapsed?: boolean;
1444
+ }
1445
+ /**
1446
+ * Content that can be placed in a slot.
1447
+ * References widgets/views by ID - actual components resolved at runtime.
1448
+ */
1449
+ type SlotContent = {
1450
+ type: 'view';
1451
+ viewId: string;
1452
+ props?: Record<string, unknown>;
1453
+ } | {
1454
+ type: 'widget';
1455
+ widgetId: string;
1456
+ config?: Record<string, unknown>;
1457
+ };
1458
+ /**
1459
+ * Content placement with mandatory flag and optional position.
1460
+ */
1461
+ interface SlotPlacement {
1462
+ /**
1463
+ * Stable unique identifier for this placement instance.
1464
+ * Used as React key and for layout persistence.
1465
+ */
1466
+ instanceId: string;
1467
+ /** What to render */
1468
+ content: SlotContent;
1469
+ /** If true, user cannot remove this from the slot */
1470
+ mandatory: boolean;
1471
+ /**
1472
+ * Initial position in grid (col, row).
1473
+ * If omitted, auto-placed by grid layout engine.
1474
+ */
1475
+ position?: {
1476
+ col: number;
1477
+ row: number;
1478
+ };
1479
+ }
1480
+ /**
1481
+ * Map of slot IDs to placements.
1482
+ */
1483
+ type SlotPlacementMap = Partial<Record<SlotId, SlotPlacement[]>>;
1484
+ /**
1485
+ * Page declaration - registered by core or extensions.
1486
+ * Declarative definition of a page's structure and default content.
1487
+ */
1488
+ interface PageDeclaration {
1489
+ /**
1490
+ * Unique page identifier.
1491
+ * Framework pages: 'dashboard', 'settings'
1492
+ * Plugin pages: 'plugin-name:page-id' (namespaced)
1493
+ */
1494
+ id: string;
1495
+ /** Human-readable name */
1496
+ name: string;
1497
+ /** Description shown in page listings */
1498
+ description?: string;
1499
+ /**
1500
+ * Navigation level where this page is available.
1501
+ * - `'root'`: Only at the framework root level
1502
+ * - `'any'`: Available at all levels — matched by every `getByLevel()` query
1503
+ * - Host-specific levels are added through `UiNavigationLevelMap`
1504
+ * declaration merging.
1505
+ *
1506
+ * If omitted, the page matches every level query when `includeAny` is true
1507
+ * (equivalent to setting `level: 'any'`).
1508
+ */
1509
+ level?: PageLevel;
1510
+ /**
1511
+ * Route path (for URL-based routing in web/ui).
1512
+ * Built-in: '/git', '/dashboard'
1513
+ * Plugin: '/extensions/<plugin-name>/<route>'
1514
+ * Optional - pages can exist without routes (focus-based only)
1515
+ */
1516
+ route?: string;
1517
+ /**
1518
+ * Widget scope for this page context.
1519
+ * Determines which widgets are available for the active UI context.
1520
+ * Hosts and extensions add domain scopes through `UiScopeMap` declaration merging.
1521
+ */
1522
+ scope: WidgetScope;
1523
+ /** Slots this page provides - uses normalized SlotId vocabulary */
1524
+ slots: SlotDefinition[];
1525
+ /** Default content per slot */
1526
+ defaultContent: SlotPlacementMap;
1527
+ /** Page-level icon for navigation (lazy-loaded) */
1528
+ icon?: () => Promise<LazyComponentModule<Pick<IconComponentProps, 'size'>>>;
1529
+ /** Page-level layout constraints */
1530
+ layout?: {
1531
+ /** Minimum page width before horizontal scroll */minWidth?: number;
1532
+ };
1533
+ }
1534
+ //#endregion
1535
+ //#region ui/kernel/src/extensions/types.d.ts
1536
+ /**
1537
+ * Props passed to the shell's root layout component.
1538
+ */
1539
+ interface ShellProps {
1540
+ /** Bus instance for handler registration and event emission. */
1541
+ bus: IMakaioBus;
1542
+ }
1543
+ /**
1544
+ * Shell contribution — provides the workspace chrome.
1545
+ *
1546
+ * An extension that supplies this takes over the root layout of the renderer.
1547
+ * Only one extension should provide a shell; if multiple do, last-wins.
1548
+ */
1549
+ interface ShellContribution {
1550
+ /**
1551
+ * Root layout component — replaces the shell's content area entirely.
1552
+ * Receives {@link ShellProps} from the host renderer.
1553
+ */
1554
+ component: ComponentLike<ShellProps>;
1555
+ }
1556
+ /**
1557
+ * Returned by an extension's browser entry point factory.
1558
+ *
1559
+ * Every field is optional; an extension declares only the surfaces it contributes.
1560
+ * The browser loader merges contributions from all loaded extensions in load order.
1561
+ */
1562
+ interface ExtensionBrowserContribution {
1563
+ /**
1564
+ * Workspace chrome — the root layout component.
1565
+ *
1566
+ * Only one extension should provide this. If multiple do, last-wins.
1567
+ * The framework loader renders its own fallback shell when no extension
1568
+ * provides workspace chrome.
1569
+ */
1570
+ shell?: ShellContribution;
1571
+ /** Slot-based page layout declarations registered into {@link pageRegistry}. */
1572
+ pages?: PageDeclaration[];
1573
+ /** Navigable page definitions registered into {@link pageDefinitionRegistry}. */
1574
+ pageDefinitions?: PageDefinition[];
1575
+ /** Standard widget contributions. */
1576
+ widgets?: readonly WidgetDefinition[];
1577
+ /** Called on extension unload to release browser-side resources. */
1578
+ destroy?: () => void;
1579
+ }
1580
+ /**
1581
+ * Runtime context passed to an extension browser factory.
1582
+ */
1583
+ interface ExtensionBrowserFactoryContext {
1584
+ /** Browser bus instance owned by the loader surface. */
1585
+ bus: IMakaioBus;
1586
+ }
1587
+ /**
1588
+ * Browser entry point shape — the default export of extension browser bundles.
1589
+ *
1590
+ * The browser loader calls this factory once per page load to obtain the
1591
+ * extension's UI contributions.
1592
+ * @param context - Runtime context supplied by the browser loader.
1593
+ * @returns Browser UI contribution for this extension.
1594
+ */
1595
+ type ExtensionBrowserFactory = (context: ExtensionBrowserFactoryContext) => ExtensionBrowserContribution;
1596
+ //#endregion
1597
+ //#region ui/kernel/src/extensions/browser-factory-registry.d.ts
1598
+ /**
1599
+ * Register a browser factory for an extension.
1600
+ *
1601
+ * Throws if a different factory is already registered for `extensionName`.
1602
+ * Re-registering the identical factory reference is a no-op (idempotent).
1603
+ * The name is trimmed before use; `' acme.ext '` and `'acme.ext'` refer to
1604
+ * the same entry. These hot-reload and bundler-fallback invariants are locked
1605
+ * down in browser-factory-registry.test.ts.
1606
+ * @param extensionName - Canonical extension name from the extension manifest.
1607
+ * @param factory - Browser contribution factory for that extension.
1608
+ * @throws Error if `extensionName` is empty or whitespace-only.
1609
+ * @throws Error if `factory` is not a function.
1610
+ * @throws Error if a different factory is already registered for this extension name.
1611
+ */
1612
+ declare function registerExtensionBrowserFactory(extensionName: string, factory: ExtensionBrowserFactory): void;
1613
+ /**
1614
+ * Unregister a browser factory for an extension.
1615
+ *
1616
+ * The name is trimmed before use; `' acme.ext '` and `'acme.ext'` refer to
1617
+ * the same entry.
1618
+ * @param extensionName - Canonical extension name from the extension manifest.
1619
+ * @throws Error if `extensionName` is empty or whitespace-only.
1620
+ */
1621
+ declare function unregisterExtensionBrowserFactory(extensionName: string): void;
1622
+ /**
1623
+ * Clear all registered browser factories.
1624
+ *
1625
+ * Exposed for test isolation and hot-reload-like teardown flows where the
1626
+ * process outlives a single extension load cycle.
1627
+ */
1628
+ declare function clearExtensionBrowserFactories(): void;
1629
+ /**
1630
+ * Read a registered browser factory for an extension.
1631
+ *
1632
+ * The name is trimmed before use; `' acme.ext '` and `'acme.ext'` refer to
1633
+ * the same entry.
1634
+ * @param extensionName - Canonical extension name from the extension manifest.
1635
+ * @returns The registered browser factory, if any.
1636
+ * @throws Error if `extensionName` is empty or whitespace-only.
1637
+ */
1638
+ declare function getRegisteredExtensionBrowserFactory(extensionName: string): ExtensionBrowserFactory | undefined;
1639
+ //#endregion
1640
+ //#region ui/kernel/src/extensions/browser-factory-resolution.d.ts
1641
+ /**
1642
+ * Result of resolving an extension browser factory from module and registry sources.
1643
+ */
1644
+ type ExtensionBrowserFactoryResolution = {
1645
+ readonly kind: 'resolved';
1646
+ readonly factory: ExtensionBrowserFactory;
1647
+ } | {
1648
+ readonly kind: 'invalid';
1649
+ readonly reason: string;
1650
+ };
1651
+ /**
1652
+ * Resolve an extension browser factory from the imported module default export
1653
+ * and the registry fallback populated during module evaluation.
1654
+ *
1655
+ * The default export remains the primary contract. The registry is a fallback
1656
+ * seam for environments where the bundler strips the runtime-loaded chunk's
1657
+ * export while still evaluating the module side effect that registered it.
1658
+ * @param moduleDefault - Imported module default export.
1659
+ * @param registeredFactory - Registry fallback for the extension, if any.
1660
+ * @returns A resolved factory or an explicit invalid reason for logging.
1661
+ */
1662
+ declare function resolveExtensionBrowserFactory(moduleDefault: unknown, registeredFactory: ExtensionBrowserFactory | undefined): ExtensionBrowserFactoryResolution;
1663
+ //#endregion
1664
+ //#region ui/kernel/src/extensions/cleanup-stack.d.ts
1665
+ /**
1666
+ * Cleanup-stack helper for browser extension registration.
1667
+ *
1668
+ * Registrations are treated as transactional stacks: when a later step fails,
1669
+ * already-registered resources are unwound in reverse order.
1670
+ * @packageDocumentation
1671
+ */
1672
+ /**
1673
+ * Runs all cleanup callbacks in reverse registration order.
1674
+ *
1675
+ * Errors are logged and suppressed so teardown continues for the remaining
1676
+ * callbacks.
1677
+ * @param cleanups - Registered cleanup callbacks.
1678
+ * @param scope - Log prefix describing the failing teardown scope.
1679
+ */
1680
+ declare function runCleanupsInReverse(cleanups: ReadonlyArray<() => void>, scope: string): void;
1681
+ //#endregion
1682
+ //#region ui/kernel/src/extensions/registration-utils.d.ts
1683
+ /**
1684
+ * Register framework-level extension UI contributions.
1685
+ *
1686
+ * Phase 1 of the framework UI split keeps the contribution contract narrow but
1687
+ * fully functional: page declarations populate the page registry, page
1688
+ * definitions populate the page definition registry, and widgets are mirrored
1689
+ * through the widget bus-backed registration flow.
1690
+ *
1691
+ * Registration is treated as transactional: if a later step throws, already-
1692
+ * registered items are unwound in reverse order before the error propagates.
1693
+ *
1694
+ * The returned `unregisterAll` function tears down all successful registrations
1695
+ * in reverse order (last-registered first), matching standard stack-teardown
1696
+ * conventions. Callers must invoke it exactly once when the extension unloads.
1697
+ * @param bus - Bus used to publish widget registration events.
1698
+ * @param extensionName - Unique extension name for diagnostics.
1699
+ * @param contribution - Browser contribution returned by the extension factory.
1700
+ * @returns A single cleanup function that undoes all successful registrations in reverse order.
1701
+ */
1702
+ declare function registerExtensionUI(bus: IMakaioBus, extensionName: string, contribution: ExtensionBrowserContribution): () => void;
1703
+ //#endregion
1704
+ //#region ui/kernel/src/extensions/shell-style.d.ts
1705
+ /**
1706
+ * Shared shell fallback styling constants.
1707
+ *
1708
+ * These inline values are intentionally kept outside the theme pipeline so the
1709
+ * boot splash and empty/error fallback UI render before extension chrome loads.
1710
+ * They mirror ui-theme tokens because boot UI can render before renderer CSS
1711
+ * has loaded.
1712
+ * @packageDocumentation
1713
+ */
1714
+ /** Background colour for shell-level fallback and boot-splash UI. */
1715
+ declare const SHELL_BG_COLOR = "#0d1117";
1716
+ /** Text colour for shell-level fallback and boot-splash UI. */
1717
+ declare const SHELL_TEXT_COLOR = "#e9eaed";
1718
+ /** Font stack for shell-level fallback and boot-splash UI. */
1719
+ declare const SHELL_FONT_FAMILY = "system-ui, sans-serif";
1720
+ //#endregion
1721
+ //#region ui/kernel/src/runtime/wait-for-runtime-ready.d.ts
1722
+ /**
1723
+ * Result produced when the runtime readiness promise settles.
1724
+ *
1725
+ * - `'ready'` — runtime booted successfully
1726
+ * - `'cancelled'` — waiter was cleaned up before readiness (e.g. React unmount)
1727
+ * - `'timeout'` — runtime did not become ready within the allowed window
1728
+ */
1729
+ type RuntimeReadyWaitResult = 'ready' | 'cancelled' | 'timeout';
1730
+ /**
1731
+ * Readiness waiter handle for runtime boot synchronisation.
1732
+ */
1733
+ interface RuntimeReadyWaiter {
1734
+ /**
1735
+ * Cancel the waiter and resolve the `ready` promise with `'cancelled'`.
1736
+ *
1737
+ * Idempotent — safe to call multiple times.
1738
+ */
1739
+ cleanup: () => void;
1740
+ /**
1741
+ * Promise that resolves when the runtime is ready, the waiter is cancelled,
1742
+ * or the timeout window expires.
1743
+ *
1744
+ * Resolves with `'ready'`, `'cancelled'`, or `'timeout'`. May reject if the
1745
+ * readiness probe itself fails (e.g. transport error) — callers should
1746
+ * wrap in try/catch.
1747
+ */
1748
+ ready: Promise<RuntimeReadyWaitResult>;
1749
+ }
1750
+ /**
1751
+ * Wait for the Makaio runtime to finish booting.
1752
+ *
1753
+ * Subscribes to `kernel.ready` before probing `kernel.isReady` so callers do
1754
+ * not miss the one-shot event while the RPC is in flight. When the readiness
1755
+ * RPC is unavailable, this falls back to the event path for pre-boot callers.
1756
+ *
1757
+ * A timeout ensures the waiter never hangs indefinitely — if the runtime does
1758
+ * not become ready within `timeoutMs`, the promise resolves with `'timeout'`
1759
+ * so the caller can show an error UI instead of spinning forever.
1760
+ *
1761
+ * Cleanup is idempotent — `bus.on()` returns an unsubscribe function that is
1762
+ * safe to call multiple times. Both the event handler and the RPC success path
1763
+ * call `cleanup()`, and the consumer may call it again on unmount; all three
1764
+ * are no-ops after the first invocation.
1765
+ * @param bus - Bus used for readiness queries and subscriptions.
1766
+ * @param timeoutMs - Maximum wait before resolving `'timeout'`. Defaults to 30 s.
1767
+ * @returns Cleanup for the ready listener and a promise that resolves at readiness.
1768
+ */
1769
+ declare function createRuntimeReadyWaiter(bus: IMakaioBus, timeoutMs?: number): RuntimeReadyWaiter;
1770
+ //#endregion
1771
+ //#region ui/kernel/src/pages/page-section-types.d.ts
1772
+ /**
1773
+ * Props passed to all page section components.
1774
+ *
1775
+ * Page sections use these props for navigation and styling.
1776
+ */
1777
+ interface PageSectionProps {
1778
+ /**
1779
+ * Navigate back to the parent page's overview.
1780
+ * Call this when user clicks back or cancels.
1781
+ */
1782
+ onNavigateBack: () => void;
1783
+ /**
1784
+ * Navigate to another path within the parent page.
1785
+ * @param path - Path to navigate to
1786
+ */
1787
+ onNavigate: (path: string) => void;
1788
+ /** Optional CSS class name for styling */
1789
+ className?: string;
1790
+ }
1791
+ /**
1792
+ * Status types for page sections.
1793
+ * Discriminated union for type-safe status badge rendering.
1794
+ */
1795
+ type PageSectionStatus = {
1796
+ type: 'connected';
1797
+ label?: string;
1798
+ } | {
1799
+ type: 'connecting';
1800
+ label?: string;
1801
+ } | {
1802
+ type: 'disconnected';
1803
+ label?: string;
1804
+ } | {
1805
+ type: 'warning';
1806
+ label: string;
1807
+ } | {
1808
+ type: 'error';
1809
+ label: string;
1810
+ } | {
1811
+ type: 'not-configured';
1812
+ } | {
1813
+ type: 'configured';
1814
+ count?: number;
1815
+ };
1816
+ /**
1817
+ * Definition of a page section available in the system.
1818
+ *
1819
+ * Page sections registered here appear in parent page navigation
1820
+ * and can be routed to via their parent page.
1821
+ */
1822
+ interface PageSectionDefinition<TProps extends PageSectionProps = PageSectionProps> {
1823
+ /** Unique identifier within parent page */
1824
+ id: string;
1825
+ /** ID of the parent page this section belongs to */
1826
+ parentPageId: string;
1827
+ /** Display name */
1828
+ name: string;
1829
+ /** Optional description */
1830
+ description?: string;
1831
+ /** Optional icon component */
1832
+ icon?: IconComponentLike;
1833
+ /** Optional category for grouping within parent page */
1834
+ category?: string;
1835
+ /**
1836
+ * Order within category.
1837
+ *
1838
+ * Lower numbers appear first. Default: 100.
1839
+ */
1840
+ order?: number;
1841
+ /** Section content component */
1842
+ component: ComponentLike<TProps>;
1843
+ /**
1844
+ * Optional function to get current status for overview card.
1845
+ *
1846
+ * Called when rendering the overview to show status badges.
1847
+ * Return null to show no status.
1848
+ * @returns Current status or null
1849
+ */
1850
+ getStatus?: () => PageSectionStatus | null;
1851
+ }
1852
+ //#endregion
1853
+ //#region ui/kernel/src/pages/PageDefinitionRegistry.d.ts
1854
+ /**
1855
+ * Filter a page-definition snapshot with the same semantics as registry.query().
1856
+ *
1857
+ * This keeps query logic reusable for hooks that must derive results from the
1858
+ * exact `useSyncExternalStore` snapshot they subscribed to, avoiding live-store
1859
+ * re-reads while still evaluating `when()` during render.
1860
+ * @param pages - Snapshot of page definitions to filter.
1861
+ * @param options - Query filters.
1862
+ * @returns Filtered pages in snapshot order.
1863
+ */
1864
+ declare function queryPageDefinitions(pages: ReadonlyArray<PageDefinition>, options?: PageDefinitionQueryOptions): PageDefinition[];
1865
+ /**
1866
+ * Unified registry for page definitions.
1867
+ *
1868
+ * Manages all page definitions (built-in and plugin-provided) with:
1869
+ * - Validation on registration
1870
+ * - Default values for order and group
1871
+ * - Sorted caching (by order field)
1872
+ * - Query filtering by mode, level, group, visibility
1873
+ * - Subscription for reactive UI updates
1874
+ * @example
1875
+ * ```typescript
1876
+ * // Register a page
1877
+ * const cleanup = pageDefinitionRegistry.register({
1878
+ * id: 'settings',
1879
+ * name: 'Settings',
1880
+ * mode: 'peek',
1881
+ * level: 'any',
1882
+ * component: () => import('./SettingsView.js').then(m => ({ default: m.SettingsView })),
1883
+ * });
1884
+ *
1885
+ * // Query pages
1886
+ * const peekPages = pageDefinitionRegistry.query({ mode: 'peek' });
1887
+ * const rootPages = pageDefinitionRegistry.query({ level: 'root' });
1888
+ *
1889
+ * // Subscribe to changes
1890
+ * const unsubscribe = pageDefinitionRegistry.subscribe(() => {
1891
+ * console.log('Registry changed');
1892
+ * });
1893
+ * ```
1894
+ */
1895
+ declare class PageDefinitionRegistry extends RegistryBase<string, PageDefinition> {
1896
+ /**
1897
+ * Cached sorted array of all pages.
1898
+ * Invalidated on mutation.
1899
+ */
1900
+ private cachedAll;
1901
+ /**
1902
+ * Register a page definition.
1903
+ *
1904
+ * Validates the definition, applies defaults for order and group,
1905
+ * and notifies subscribers.
1906
+ * @param definition - The page to register
1907
+ * @returns Cleanup function to unregister this page
1908
+ * @throws Error if page with same ID already exists
1909
+ * @throws Error if definition validation fails
1910
+ */
1911
+ register(definition: PageDefinition): () => void;
1912
+ /**
1913
+ * Get page definition by ID.
1914
+ * @param id - Page identifier
1915
+ * @returns Page definition or undefined if not registered
1916
+ */
1917
+ get(id: string): PageDefinition | undefined;
1918
+ /**
1919
+ * Get all registered pages, sorted by order field.
1920
+ *
1921
+ * Results are cached until registry is mutated.
1922
+ * @returns Array of all page definitions, sorted by order (lower = first)
1923
+ */
1924
+ getAll(): ReadonlyArray<PageDefinition>;
1925
+ /**
1926
+ * Query pages with filters.
1927
+ *
1928
+ * All filters are optional and combine with AND logic:
1929
+ * - mode: Exact match on page mode
1930
+ * - level: Matches level or 'any' (see matchesLevel)
1931
+ * - group: Exact match on navigation group
1932
+ * - surface: Matches pages available on the given surface (see matchesSurface)
1933
+ * - includeHidden: If false (default), exclude pages where when() returns false
1934
+ * @param options - Query filters
1935
+ * @returns Filtered pages, sorted by order
1936
+ * @example
1937
+ * ```typescript
1938
+ * // Get all peek mode pages
1939
+ * const peekPages = registry.query({ mode: 'peek' });
1940
+ *
1941
+ * // Get root-level pages (includes 'any' pages)
1942
+ * const rootPages = registry.query({ level: 'root' });
1943
+ *
1944
+ * // Get all pages including hidden ones
1945
+ * const allPages = registry.query({ includeHidden: true });
1946
+ * ```
1947
+ */
1948
+ query(options?: PageDefinitionQueryOptions): PageDefinition[];
1949
+ /**
1950
+ * Unregister a page by ID.
1951
+ *
1952
+ * Removes the page and notifies subscribers.
1953
+ * @param id - Page identifier
1954
+ * @returns True if page was unregistered, false if not found
1955
+ */
1956
+ unregister(id: string): boolean;
1957
+ /**
1958
+ * Clear all registered pages.
1959
+ *
1960
+ * Removes all pages and notifies subscribers.
1961
+ * Used primarily for testing or complete app teardown.
1962
+ */
1963
+ clear(): void;
1964
+ /**
1965
+ * Invalidate internal caches.
1966
+ * Called after any mutation to force re-computation on next access.
1967
+ */
1968
+ private invalidateCache;
1969
+ }
1970
+ /**
1971
+ * Global page definition registry instance.
1972
+ *
1973
+ * Singleton registry used throughout the application.
1974
+ * Pages are registered at app startup via registerCorePages().
1975
+ */
1976
+ declare const pageDefinitionRegistry: PageDefinitionRegistry;
1977
+ //#endregion
1978
+ //#region ui/kernel/src/pages/PageRegistry.d.ts
1979
+ /**
1980
+ * Registry for managing page declarations.
1981
+ */
1982
+ declare class PageRegistry extends RegistryBase<string, PageDeclaration> {
1983
+ private cachedAll;
1984
+ /**
1985
+ * Register a page declaration.
1986
+ * @param declaration - The page to register
1987
+ * @returns Cleanup function to unregister
1988
+ * @throws If page with same ID already exists, route is already registered, or declaration is invalid
1989
+ */
1990
+ register(declaration: PageDeclaration): () => void;
1991
+ /**
1992
+ * Get page by ID.
1993
+ * @param id - Page identifier
1994
+ * @returns Page declaration or undefined
1995
+ */
1996
+ get(id: string): PageDeclaration | undefined;
1997
+ /**
1998
+ * Get all registered pages.
1999
+ *
2000
+ * Result is cached and invalidated on any mutation. The returned array is
2001
+ * frozen to prevent callers from mutating the registry's internal cache.
2002
+ * @returns Frozen snapshot array of all page declarations
2003
+ */
2004
+ getAll(): ReadonlyArray<PageDeclaration>;
2005
+ /**
2006
+ * Get all pages that have routes (for router integration).
2007
+ * @returns Array of routable page declarations
2008
+ */
2009
+ getRoutablePages(): PageDeclaration[];
2010
+ /**
2011
+ * Get pages by scope.
2012
+ * @param scope - Widget scope to filter by
2013
+ * @param includeAny - Include pages with 'any' scope (default: true)
2014
+ * @returns Filtered pages
2015
+ */
2016
+ getByScope(scope: PageDeclaration['scope'], includeAny?: boolean): PageDeclaration[];
2017
+ /**
2018
+ * Get pages by navigation level.
2019
+ * @param level - Navigation level to filter by
2020
+ * @param includeAny - Include pages with 'any' level (default: true)
2021
+ * @returns Filtered pages
2022
+ */
2023
+ getByLevel(level: PageLevel, includeAny?: boolean): PageDeclaration[];
2024
+ /**
2025
+ * Unregister a page by ID.
2026
+ * @param id - Page identifier
2027
+ * @returns True if page was unregistered, false if not found
2028
+ */
2029
+ unregister(id: string): boolean;
2030
+ /**
2031
+ * Clear all registered pages.
2032
+ *
2033
+ * No-ops silently when the registry is already empty, avoiding a
2034
+ * spurious subscriber notification.
2035
+ */
2036
+ clear(): void;
2037
+ /**
2038
+ * Invalidate internal caches.
2039
+ */
2040
+ private invalidateCache;
2041
+ }
2042
+ /** Global page registry instance */
2043
+ declare const pageRegistry: PageRegistry;
2044
+ //#endregion
2045
+ //#region ui/kernel/src/pages/PageSectionRegistry.d.ts
2046
+ /**
2047
+ * Registry for managing page section definitions.
2048
+ *
2049
+ * Provides registration, lookup, and filtering by parent page and category.
2050
+ * Uses composite keys (parentPageId:sectionId) and caching for performance.
2051
+ */
2052
+ declare class PageSectionRegistry extends RegistryBase<string, PageSectionDefinition> {
2053
+ private cachedByParent;
2054
+ /**
2055
+ * Register a page section definition.
2056
+ *
2057
+ * Idempotent: if section is already registered, skips and returns cleanup.
2058
+ * This supports React StrictMode which double-invokes effects.
2059
+ * @param definition - Page section definition to register
2060
+ * @returns Cleanup function to unregister the section
2061
+ */
2062
+ register(definition: PageSectionDefinition): () => void;
2063
+ /**
2064
+ * Get page section definition by parent page ID and section ID.
2065
+ * @param parentPageId - Parent page ID
2066
+ * @param sectionId - Section ID
2067
+ * @returns Section definition or undefined if not found
2068
+ */
2069
+ get(parentPageId: string, sectionId: string): PageSectionDefinition | undefined;
2070
+ /**
2071
+ * Get all sections for a parent page, sorted by order.
2072
+ * @param parentPageId - Parent page ID
2073
+ * @returns Array of section definitions sorted by order
2074
+ */
2075
+ getByParent(parentPageId: string): PageSectionDefinition[];
2076
+ /**
2077
+ * Get sections filtered by parent page and category.
2078
+ * @param parentPageId - Parent page ID
2079
+ * @param category - Category to filter by
2080
+ * @returns Array of matching section definitions, sorted by order
2081
+ */
2082
+ getByParentAndCategory(parentPageId: string, category: string): PageSectionDefinition[];
2083
+ /**
2084
+ * Remove section from registry.
2085
+ * @param parentPageId - Parent page ID
2086
+ * @param sectionId - Section ID
2087
+ * @returns True if section was removed
2088
+ */
2089
+ unregister(parentPageId: string, sectionId: string): boolean;
2090
+ /**
2091
+ * Clear all sections.
2092
+ */
2093
+ clear(): void;
2094
+ /**
2095
+ * Create composite key from parent page ID and section ID.
2096
+ * @param parentPageId - Parent page ID
2097
+ * @param sectionId - Section ID
2098
+ * @returns Composite key
2099
+ */
2100
+ private makeKey;
2101
+ /**
2102
+ * Invalidate internal caches.
2103
+ */
2104
+ private invalidateCache;
2105
+ }
2106
+ /**
2107
+ * Global page section registry instance
2108
+ */
2109
+ declare const pageSectionRegistry: PageSectionRegistry;
2110
+ //#endregion
2111
+ //#region ui/kernel/src/pages/registerPageBusHandler.d.ts
2112
+ /**
2113
+ * Register bus handler that serves page metadata from the registry.
2114
+ * @param bus - The MakaioBus instance to register on
2115
+ * @returns Cleanup function to unregister the handler
2116
+ * @example
2117
+ * ```typescript
2118
+ * import { registerPageBusHandler } from '@makaio/framework/ui-kernel';
2119
+ * import { useBus } from '@makaio/framework/ui-hooks';
2120
+ *
2121
+ * function App() {
2122
+ * const bus = useBus();
2123
+ *
2124
+ * useEffect(() => {
2125
+ * const cleanup = registerPageBusHandler(bus);
2126
+ * return cleanup;
2127
+ * }, [bus]);
2128
+ * }
2129
+ * ```
2130
+ */
2131
+ declare function registerPageBusHandler(bus: IMakaioBus): () => void;
2132
+ //#endregion
2133
+ //#region ui/kernel/src/pages/persistence.d.ts
2134
+ interface PageLayoutPersistenceContext {
2135
+ /** UI scope for this persisted layout. */
2136
+ readonly scope: UiScope;
2137
+ /** Optional host context identifier within the scope. */
2138
+ readonly contextId?: string | null;
2139
+ }
2140
+ /**
2141
+ * Build preference key for page layout.
2142
+ * @param pageId - Page identifier
2143
+ * @param context - Generic UI context identity.
2144
+ * @returns Preference key context string
2145
+ */
2146
+ declare function buildPageLayoutKey(pageId: string, context: PageLayoutPersistenceContext): string;
2147
+ /**
2148
+ * Preference categories for page-related data.
2149
+ */
2150
+ declare const PAGE_PREFERENCE_CATEGORIES: {
2151
+ /** User's slot content customizations */readonly layout: "page-layout"; /** User's collapsed/expanded slot states */
2152
+ readonly slotState: "page-slot-state"; /** User's edit mode preferences */
2153
+ readonly editMode: "page-edit-mode";
2154
+ };
2155
+ //#endregion
2156
+ //#region ui/kernel/src/navigation/NavigationRegistry.d.ts
2157
+ /**
2158
+ * Registry for managing navigation targets.
2159
+ *
2160
+ * Navigation targets are items that appear in navigation UI:
2161
+ * - Quick Prompt suggestions
2162
+ * - KaiTrigger hover menu
2163
+ * - Breadcrumb dropdowns
2164
+ * @example
2165
+ * ```typescript
2166
+ * navigationRegistry.register({
2167
+ * id: 'settings',
2168
+ * label: 'Settings',
2169
+ * icon: Settings,
2170
+ * level: 'root',
2171
+ * action: { type: 'focus', focusContext: 'settings' },
2172
+ * group: 'quick-access',
2173
+ * });
2174
+ *
2175
+ * const targets = navigationRegistry.getByLevel('root');
2176
+ * ```
2177
+ */
2178
+ declare class NavigationRegistry extends RegistryBase<string, NavigationTarget> {
2179
+ private cachedAll;
2180
+ /**
2181
+ * Register a navigation target.
2182
+ * @param target - The navigation target to register
2183
+ * @returns Cleanup function to unregister
2184
+ * @throws If target with same ID already exists or target is invalid
2185
+ */
2186
+ register(target: NavigationTarget): () => void;
2187
+ /**
2188
+ * Get navigation target by ID.
2189
+ * @param id - Target identifier
2190
+ * @returns Navigation target or undefined
2191
+ */
2192
+ get(id: string): NavigationTarget | undefined;
2193
+ /**
2194
+ * Get all registered navigation targets.
2195
+ * @returns Frozen readonly array of all targets sorted by order
2196
+ */
2197
+ getAll(): ReadonlyArray<NavigationTarget>;
2198
+ /**
2199
+ * Query navigation targets with filters.
2200
+ * @param options - Query options
2201
+ * @returns Filtered and sorted targets
2202
+ */
2203
+ query(options?: NavigationQueryOptions): NavigationTarget[];
2204
+ /**
2205
+ * Get targets available at a specific navigation level.
2206
+ * @param level - Navigation level
2207
+ * @returns Targets available at this level
2208
+ */
2209
+ getByLevel(level: NavigationLevel): NavigationTarget[];
2210
+ /**
2211
+ * Get targets in a specific group.
2212
+ * @param group - Navigation group
2213
+ * @returns Targets in this group
2214
+ */
2215
+ getByGroup(group: NavigationTarget['group']): NavigationTarget[];
2216
+ /**
2217
+ * Unregister a navigation target by ID.
2218
+ * @param id - Target identifier
2219
+ * @returns True if target was unregistered, false if not found
2220
+ */
2221
+ unregister(id: string): boolean;
2222
+ /**
2223
+ * Clear all registered navigation targets.
2224
+ */
2225
+ clear(): void;
2226
+ /**
2227
+ * Invalidate internal caches.
2228
+ */
2229
+ private invalidateCache;
2230
+ }
2231
+ /** Global navigation registry instance */
2232
+ declare const navigationRegistry: NavigationRegistry;
2233
+ //#endregion
2234
+ //#region ui/kernel/src/navigation/navigation-group-config.d.ts
2235
+ /**
2236
+ * Configuration for a navigation group.
2237
+ *
2238
+ * Defines display label and sort order for groups in navigation UI.
2239
+ */
2240
+ interface NavigationGroupConfig {
2241
+ /** Navigation group identifier */
2242
+ readonly id: NavigationGroup;
2243
+ /** Display label for the group */
2244
+ readonly label: string;
2245
+ /** Sort order (lower appears first) */
2246
+ readonly order: number;
2247
+ }
2248
+ /**
2249
+ * Default navigation group configurations.
2250
+ *
2251
+ * Built-in groups for standard navigation patterns:
2252
+ * - `navigate`: Workspace-switching pages (Dashboard, Chat, Git)
2253
+ * - `analytics`: Analytics and reporting pages
2254
+ * - `quick-access`: Quick-access overlay pages (Settings, Projects, Sessions)
2255
+ */
2256
+ declare const defaultNavigationGroups: ReadonlyArray<NavigationGroupConfig>;
2257
+ //#endregion
2258
+ //#region ui/kernel/src/navigation/deriveBrowserTarget.d.ts
2259
+ /**
2260
+ * Browser-side navigation URL target derivation.
2261
+ * @packageDocumentation
2262
+ */
2263
+ /**
2264
+ * Maps a navigation URL to a `window.open` target name for browser singleton/reuse semantics.
2265
+ *
2266
+ * Used as a fallback when the bus RPC is unavailable. Under normal operation,
2267
+ * the bus handler handles everything.
2268
+ *
2269
+ * Routing rules:
2270
+ * - `/apps/:packageName` → `apps-{packageName}` (package-level singleton)
2271
+ * - `/project/:id` → `project-{id}`
2272
+ * - `/chat/:sessionId` → `chat-{sessionId}`
2273
+ * - `/chat` → `_blank` (always a new window)
2274
+ * - Single-segment static routes → that segment as a named target
2275
+ * - Everything else → `_blank`
2276
+ * @param url - Target URL path, e.g. '/apps/makaio.project-overview/main' or '/project/abc-123'
2277
+ * @returns Target name for `window.open()` — named targets reuse windows, '_blank' always opens new
2278
+ */
2279
+ declare function deriveBrowserTarget(url: string): string;
2280
+ //#endregion
2281
+ //#region ui/kernel/src/navigation/ui-schemas.d.ts
2282
+ /**
2283
+ * UI surface domain schemas.
2284
+ *
2285
+ * Covers lifecycle events emitted by web surfaces (React apps) to signal
2286
+ * rendering milestones. Surface-agnostic — any web surface (Electron, browser,
2287
+ * mobile) can emit these events.
2288
+ *
2289
+ * Each key becomes a subject identifier as: `ui.{key}`
2290
+ * @example
2291
+ * ```typescript
2292
+ * // Listen for any UI surface becoming ready
2293
+ * bus.on(UiSubjects.ready, (ctx) => {
2294
+ * console.log(`${ctx.payload.surface} UI rendered`);
2295
+ * });
2296
+ * ```
2297
+ */
2298
+ declare const UiSchemas: {
2299
+ /**
2300
+ * Emitted when a web surface has mounted its React tree and is visually ready.
2301
+ *
2302
+ * Fired once per surface mount (deduplicated across React StrictMode
2303
+ * double-invocations). Consumers can use this to confirm that the UI is
2304
+ * actually rendered, not just that a window or tab was opened.
2305
+ *
2306
+ * Subject: `ui.ready`
2307
+ * Type: Event
2308
+ */
2309
+ ready: z.ZodObject<{
2310
+ surface: z.ZodEnum<{
2311
+ web: "web";
2312
+ mobile: "mobile";
2313
+ electron: "electron";
2314
+ electrobun: "electrobun";
2315
+ tray: "tray";
2316
+ }>;
2317
+ timestamp: z.ZodNumber;
2318
+ }, z.core.$strip>;
2319
+ /**
2320
+ * Request to navigate to a URL.
2321
+ *
2322
+ * Handlers at different priorities decide what to do with the intent:
2323
+ * - Electron main process (priority 100): parse URL, find-or-create window
2324
+ * - Browser app shell (priority 10): open URL via window.open()
2325
+ *
2326
+ * Subject: `ui.navigate`
2327
+ * Type: Request RPC
2328
+ */
2329
+ navigate: {
2330
+ request: z.ZodObject<{
2331
+ url: z.ZodString;
2332
+ }, z.core.$strip>;
2333
+ response: z.ZodObject<{
2334
+ action: z.ZodEnum<{
2335
+ focused: "focused";
2336
+ opened: "opened";
2337
+ navigated: "navigated";
2338
+ }>;
2339
+ }, z.core.$strip>;
2340
+ };
2341
+ /**
2342
+ * Show the popover panel.
2343
+ *
2344
+ * Idempotent: when the popover is already visible this request is a no-op
2345
+ * and the popover remains open. When `x` / `y` are provided the popover is
2346
+ * anchored near that screen coordinate (e.g. the tray icon position); exact
2347
+ * placement and clamping are host-specific. When omitted the host chooses a
2348
+ * default position (typically centered on the primary display work area).
2349
+ *
2350
+ * Subject: `ui.popover.show`
2351
+ * Type: Request RPC
2352
+ */
2353
+ 'popover.show': {
2354
+ request: z.ZodObject<{
2355
+ x: z.ZodOptional<z.ZodNumber>;
2356
+ y: z.ZodOptional<z.ZodNumber>;
2357
+ }, z.core.$strip>;
2358
+ response: z.ZodObject<{
2359
+ shown: z.ZodBoolean;
2360
+ }, z.core.$strip>;
2361
+ };
2362
+ /**
2363
+ * Fired when the global keyboard shortcut is triggered.
2364
+ *
2365
+ * Reserved for external listeners (e.g. extensions on a separate bus
2366
+ * client) that want to react to the hotkey. The core Electron hotkey
2367
+ * handler uses `bus.request(ui.popover.show)` directly instead of
2368
+ * emitting this event, because local events don't fire local handlers
2369
+ * on the same bus instance.
2370
+ *
2371
+ * Subject: `ui.shortcut.triggered`
2372
+ * Type: Event
2373
+ */
2374
+ 'shortcut.triggered': z.ZodObject<{
2375
+ accelerator: z.ZodString;
2376
+ }, z.core.$strip>;
2377
+ };
2378
+ /** Payload of the `ui.ready` event. */
2379
+ type UiReadyEvent = z.infer<(typeof UiSchemas)['ready']>;
2380
+ /** Payload of the `ui.navigate` request. */
2381
+ type UiNavigateRequest = z.infer<(typeof UiSchemas)['navigate']['request']>;
2382
+ /** Response from the `ui.navigate` RPC. */
2383
+ type UiNavigateResponse = z.infer<(typeof UiSchemas)['navigate']['response']>;
2384
+ /** Possible navigation actions returned by `ui.navigate`. */
2385
+ type UiNavigateAction = UiNavigateResponse['action'];
2386
+ /** Request payload for `ui.popover.show`. */
2387
+ type UiPopoverShowRequest = z.infer<(typeof UiSchemas)['popover.show']['request']>;
2388
+ /** Response from `ui.popover.show`. */
2389
+ type UiPopoverShowResponse = z.infer<(typeof UiSchemas)['popover.show']['response']>;
2390
+ /** Payload of the `ui.shortcut.triggered` event. */
2391
+ type UiShortcutTriggeredEvent = z.infer<(typeof UiSchemas)['shortcut.triggered']>;
2392
+ //#endregion
2393
+ //#region ui/kernel/src/navigation/ui-namespace.d.ts
2394
+ /**
2395
+ * Bus namespace definition for UI surface lifecycle events.
2396
+ *
2397
+ * This is the canonical public namespace definition for the `ui.*`
2398
+ * contract and should be imported by all producers/consumers.
2399
+ * @example
2400
+ * ```typescript
2401
+ * // Emit the ready event after the React tree mounts
2402
+ * bus.emit(UiSubjects.ready, { surface: 'electron', timestamp: Date.now() });
2403
+ *
2404
+ * // Request navigation
2405
+ * await bus.request(UiSubjects.navigate, { url: '/project/abc-123' });
2406
+ * ```
2407
+ */
2408
+ declare const UiNamespace: _$_makaio_core0.BusNamespaceDefinition<"ui", {
2409
+ ready: _$zod.ZodObject<{
2410
+ surface: _$zod.ZodEnum<{
2411
+ web: "web";
2412
+ mobile: "mobile";
2413
+ electron: "electron";
2414
+ electrobun: "electrobun";
2415
+ tray: "tray";
2416
+ }>;
2417
+ timestamp: _$zod.ZodNumber;
2418
+ }, _$zod_v4_core0.$strip>;
2419
+ navigate: {
2420
+ request: _$zod.ZodObject<{
2421
+ url: _$zod.ZodString;
2422
+ }, _$zod_v4_core0.$strip>;
2423
+ response: _$zod.ZodObject<{
2424
+ action: _$zod.ZodEnum<{
2425
+ focused: "focused";
2426
+ opened: "opened";
2427
+ navigated: "navigated";
2428
+ }>;
2429
+ }, _$zod_v4_core0.$strip>;
2430
+ };
2431
+ 'popover.show': {
2432
+ request: _$zod.ZodObject<{
2433
+ x: _$zod.ZodOptional<_$zod.ZodNumber>;
2434
+ y: _$zod.ZodOptional<_$zod.ZodNumber>;
2435
+ }, _$zod_v4_core0.$strip>;
2436
+ response: _$zod.ZodObject<{
2437
+ shown: _$zod.ZodBoolean;
2438
+ }, _$zod_v4_core0.$strip>;
2439
+ };
2440
+ 'shortcut.triggered': _$zod.ZodObject<{
2441
+ accelerator: _$zod.ZodString;
2442
+ }, _$zod_v4_core0.$strip>;
2443
+ }>;
2444
+ /**
2445
+ * Typed subject tree for the UI namespace.
2446
+ *
2447
+ * Use this for all emit/on calls instead of raw string subjects.
2448
+ */
2449
+ declare const UiSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubjectDefinitions<"ui", {
2450
+ ready: _$zod.ZodObject<{
2451
+ surface: _$zod.ZodEnum<{
2452
+ web: "web";
2453
+ mobile: "mobile";
2454
+ electron: "electron";
2455
+ electrobun: "electrobun";
2456
+ tray: "tray";
2457
+ }>;
2458
+ timestamp: _$zod.ZodNumber;
2459
+ }, _$zod_v4_core0.$strip>;
2460
+ navigate: {
2461
+ request: _$zod.ZodObject<{
2462
+ url: _$zod.ZodString;
2463
+ }, _$zod_v4_core0.$strip>;
2464
+ response: _$zod.ZodObject<{
2465
+ action: _$zod.ZodEnum<{
2466
+ focused: "focused";
2467
+ opened: "opened";
2468
+ navigated: "navigated";
2469
+ }>;
2470
+ }, _$zod_v4_core0.$strip>;
2471
+ };
2472
+ 'popover.show': {
2473
+ request: _$zod.ZodObject<{
2474
+ x: _$zod.ZodOptional<_$zod.ZodNumber>;
2475
+ y: _$zod.ZodOptional<_$zod.ZodNumber>;
2476
+ }, _$zod_v4_core0.$strip>;
2477
+ response: _$zod.ZodObject<{
2478
+ shown: _$zod.ZodBoolean;
2479
+ }, _$zod_v4_core0.$strip>;
2480
+ };
2481
+ 'shortcut.triggered': _$zod.ZodObject<{
2482
+ accelerator: _$zod.ZodString;
2483
+ }, _$zod_v4_core0.$strip>;
2484
+ }>, "ui">;
2485
+ //#endregion
2486
+ //#region ui/kernel/src/onboarding/types.d.ts
2487
+ /**
2488
+ * Kai mascot state for a step.
2489
+ *
2490
+ * Controls the mascot animation shown alongside the step content.
2491
+ * Inlined here to avoid coupling kernel to `\@makaio/ui-components`.
2492
+ */
2493
+ type OnboardingKaiState = 'wave' | 'loading' | 'neutral' | 'success' | 'smile';
2494
+ /**
2495
+ * Information about an adapter driver.
2496
+ *
2497
+ * Structural type that mirrors `AdapterInfo` from
2498
+ * `\@makaio/services/settings/namespace` to avoid a platform-services
2499
+ * dependency at the kernel tier.
2500
+ */
2501
+ interface AdapterInfo {
2502
+ /** Adapter driver name (e.g., 'claude-code', 'openai-node') */
2503
+ adapterName: string;
2504
+ /** Human-readable display name for UI */
2505
+ displayName: string;
2506
+ /** Short description for tooltips/selection UI */
2507
+ description?: string;
2508
+ /** Whether this adapter driver is enabled in runtime config */
2509
+ enabled: boolean;
2510
+ /** Number of configured instances for this adapter */
2511
+ configCount: number;
2512
+ /** Whether this adapter currently has a registered log-import provider */
2513
+ supportsLogImport: boolean;
2514
+ /** Help links for setup and documentation. */
2515
+ helpLinks?: Array<{
2516
+ label: string;
2517
+ url: string;
2518
+ }>;
2519
+ /** Setup instructions in Markdown format. */
2520
+ instructions?: string;
2521
+ /** Readiness signal describing required configuration work, if any. */
2522
+ readiness?: 'ready' | 'missing-credentials' | 'needs-setup';
2523
+ /** Stable client identifier this adapter belongs to. */
2524
+ clientId?: string;
2525
+ /** Wire protocol this adapter speaks (for provider matching). */
2526
+ protocol?: 'anthropic' | 'openai';
2527
+ /** Provider definition IDs this adapter can run against. */
2528
+ providerDefinitionIds?: string[];
2529
+ }
2530
+ /**
2531
+ * Context evaluated once at the start of the onboarding flow.
2532
+ *
2533
+ * Used by step {@link OnboardingStepDefinition.condition} callbacks to decide
2534
+ * whether a step should be included in the active flow.
2535
+ */
2536
+ interface OnboardingContext {
2537
+ /** Adapters available at flow start. */
2538
+ readonly adapters: ReadonlyArray<AdapterInfo>;
2539
+ /** Extensions loaded at flow start. */
2540
+ readonly extensions: ReadonlyArray<ExtensionInfo>;
2541
+ /** Client records available at flow start. */
2542
+ readonly clients: ReadonlyArray<ClientRecord>;
2543
+ }
2544
+ /**
2545
+ * Props injected into every step component by the orchestrator.
2546
+ *
2547
+ * The flow-state and action props (flowState, actions) are injected
2548
+ * separately at the `\@makaio/ui-hooks` tier via `useOnboardingFlow`.
2549
+ * This base interface carries only the navigation callbacks so that
2550
+ * step components can be typed against the kernel contract.
2551
+ */
2552
+ interface OnboardingStepProps {
2553
+ /** Advance to the next step. */
2554
+ onNext: () => void;
2555
+ /** Return to the previous step. */
2556
+ onBack: () => void;
2557
+ /** Skip the entire onboarding flow. */
2558
+ onSkip: () => void;
2559
+ /** Complete the flow (call only from the final step). */
2560
+ onComplete: () => void;
2561
+ }
2562
+ /**
2563
+ * Declarative definition of one onboarding step.
2564
+ *
2565
+ * Steps are registered via {@link OnboardingStepRegistry} and sorted by
2566
+ * {@link OnboardingStepDefinition.order} before display.
2567
+ * @example
2568
+ * ```typescript
2569
+ * const cleanup = onboardingStepRegistry.register({
2570
+ * id: 'welcome',
2571
+ * title: 'Welcome',
2572
+ * kaiState: 'wave',
2573
+ * order: 10,
2574
+ * component: WelcomeStep,
2575
+ * });
2576
+ * ```
2577
+ */
2578
+ interface OnboardingStepDefinition {
2579
+ /** Stable unique identifier. Must be non-empty. */
2580
+ id: string;
2581
+ /** Display title shown in the progress indicator. */
2582
+ title: string;
2583
+ /** Mascot state rendered alongside this step. */
2584
+ kaiState: OnboardingKaiState;
2585
+ /**
2586
+ * Sort order. Lower values appear earlier.
2587
+ * Built-in steps use 10–50. Plugin steps should use 100+.
2588
+ */
2589
+ order: number;
2590
+ /**
2591
+ * The step content component.
2592
+ *
2593
+ * Typed as `object` because a callable/exotic union
2594
+ * (`((...args: unknown[]) => unknown) | (new (...args: unknown[]) => unknown)`)
2595
+ * fails due to contravariance on `ComponentClass` constructor params —
2596
+ * `unknown` is not assignable to the concrete props. `object` is the widest
2597
+ * type that all `ComponentLike<P>` values satisfy while still rejecting
2598
+ * primitives. `validateStepDefinition` enforces the callable/exotic shape
2599
+ * at runtime; the hooks tier narrows back to `ComponentLike<OnboardingStepProps>`
2600
+ * at retrieval time via `narrowToHooksStepDefinitions`.
2601
+ */
2602
+ component: object;
2603
+ /**
2604
+ * Optional condition evaluated once at mount with the pre-flow adapter state.
2605
+ * Return false to exclude this step from the active flow.
2606
+ * @remarks
2607
+ * Conditions are evaluated exactly once when the flow mounts, using the
2608
+ * adapter and plugin snapshot at that moment. Do not depend on mutable
2609
+ * flow state — that state does not exist yet when conditions run.
2610
+ * @param context - Snapshot of the onboarding context at flow start.
2611
+ */
2612
+ condition?: (context: OnboardingContext) => boolean;
2613
+ /** Whether the user can skip this step individually. */
2614
+ skippable?: boolean;
2615
+ }
2616
+ //#endregion
2617
+ //#region ui/kernel/src/onboarding/OnboardingStepRegistry.d.ts
2618
+ /**
2619
+ * Registry for onboarding step definitions.
2620
+ *
2621
+ * Steps are registered declaratively and sorted by their `order` field for display.
2622
+ * The registry is idempotent: re-registering a step with the same ID silently
2623
+ * replaces the previous registration, making it safe to call from React StrictMode
2624
+ * double-invoked effects.
2625
+ * @example
2626
+ * ```typescript
2627
+ * // Register a step
2628
+ * const cleanup = onboardingStepRegistry.register({
2629
+ * id: 'welcome',
2630
+ * title: 'Welcome',
2631
+ * kaiState: 'wave',
2632
+ * order: 10,
2633
+ * component: WelcomeStep,
2634
+ * });
2635
+ *
2636
+ * // Retrieve all steps sorted by order
2637
+ * const steps = onboardingStepRegistry.getAll();
2638
+ *
2639
+ * // Subscribe to changes
2640
+ * const unsubscribe = onboardingStepRegistry.subscribe(() => {
2641
+ * console.log('Registry changed');
2642
+ * });
2643
+ *
2644
+ * // Cleanup on unmount
2645
+ * cleanup();
2646
+ * ```
2647
+ */
2648
+ declare class OnboardingStepRegistry extends RegistryBase<string, OnboardingStepDefinition> {
2649
+ /**
2650
+ * Cached sorted array of all steps.
2651
+ * Invalidated on every mutation.
2652
+ */
2653
+ private cachedAll;
2654
+ /**
2655
+ * Register an onboarding step definition.
2656
+ *
2657
+ * Idempotent: if a step with the same ID is already registered it is
2658
+ * silently replaced. This makes registration safe to call from React
2659
+ * StrictMode double-invoked effects.
2660
+ *
2661
+ * Validates required fields before storing.
2662
+ * @param definition - The step to register
2663
+ * @returns Cleanup function that unregisters this step when called
2664
+ * @throws Error if definition validation fails
2665
+ */
2666
+ register(definition: OnboardingStepDefinition): () => void;
2667
+ /**
2668
+ * Get a step definition by ID.
2669
+ * @param id - Step identifier
2670
+ * @returns Step definition or undefined if not registered
2671
+ */
2672
+ get(id: string): OnboardingStepDefinition | undefined;
2673
+ /**
2674
+ * Get all registered steps, sorted ascending by order.
2675
+ *
2676
+ * Results are cached until the registry is mutated.
2677
+ * @returns Array of all step definitions, sorted by order (lower = first)
2678
+ */
2679
+ getAll(): ReadonlyArray<OnboardingStepDefinition>;
2680
+ /**
2681
+ * Unregister a step by ID.
2682
+ *
2683
+ * Removes the step and notifies subscribers.
2684
+ * @param id - Step identifier
2685
+ * @returns True if the step was found and removed, false if not registered
2686
+ */
2687
+ unregister(id: string): boolean;
2688
+ /**
2689
+ * Clear all registered steps.
2690
+ *
2691
+ * Used primarily for testing or complete app teardown.
2692
+ */
2693
+ clear(): void;
2694
+ /**
2695
+ * Invalidate the sorted cache.
2696
+ * Called after any mutation to force re-computation on next {@link getAll} access.
2697
+ */
2698
+ private invalidateCache;
2699
+ }
2700
+ /**
2701
+ * Global onboarding step registry instance.
2702
+ *
2703
+ * Singleton used throughout the application.
2704
+ * Built-in steps are registered at app startup.
2705
+ */
2706
+ declare const onboardingStepRegistry: OnboardingStepRegistry;
2707
+ //#endregion
2708
+ //#region ui/kernel/src/onboarding/plugin-categories.d.ts
2709
+ /**
2710
+ * plugin-categories — Plugin category domain logic for onboarding.
2711
+ *
2712
+ * Defines the canonical plugin category configuration, default-enabled
2713
+ * derivation, and category lookup. Pure constants with no runtime side effects.
2714
+ *
2715
+ * The `persistPluginEnabled` bus helper lives in `\@makaio/ui-hooks` (it
2716
+ * performs bus requests and requires `\@makaio/services-core`).
2717
+ * @packageDocumentation
2718
+ */
2719
+ /**
2720
+ * Category metadata including which plugin names belong here and what the
2721
+ * default enabled state is for newly discovered members.
2722
+ */
2723
+ interface PluginCategory {
2724
+ /** Display label */
2725
+ readonly label: string;
2726
+ /** Set of plugin names that belong to this category */
2727
+ readonly members: ReadonlySet<string>;
2728
+ /** Whether extensions in this category start enabled by default */
2729
+ readonly defaultEnabled: boolean;
2730
+ /**
2731
+ * When true, toggles for this category are disabled (always-on).
2732
+ * Used for Essential extensions.
2733
+ */
2734
+ readonly alwaysEnabled: boolean;
2735
+ }
2736
+ /**
2737
+ * Ordered list of plugin categories used to partition the full plugin list.
2738
+ *
2739
+ * Immutability is enforced structurally: the array is `ReadonlyArray` and
2740
+ * each category's `members` field is typed as `ReadonlySet<string>`, so
2741
+ * TypeScript prevents mutation at all call sites. Runtime freeze is not
2742
+ * applied — this constant is consumed only by TypeScript callers in the
2743
+ * framework shell.
2744
+ */
2745
+ declare const PLUGIN_CATEGORIES: ReadonlyArray<PluginCategory>;
2746
+ /**
2747
+ * Derive the initial enabled state for a plugin based on its category.
2748
+ * @param category - The category this plugin belongs to
2749
+ * @returns True when the plugin should be toggled on by default
2750
+ */
2751
+ declare function deriveDefaultEnabled(category: PluginCategory): boolean;
2752
+ /**
2753
+ * Find which category a plugin belongs to, or return a synthetic "Other" category
2754
+ * when the plugin name is not listed in any known category.
2755
+ * @param pluginName - Plugin name to categorise
2756
+ * @returns The matching {@link PluginCategory}, or a catch-all "Other" category
2757
+ */
2758
+ declare function findCategory(pluginName: string): PluginCategory;
2759
+ //#endregion
2760
+ //#region ui/kernel/src/tray-config.d.ts
2761
+ /**
2762
+ * Shared tray popover sizing constants.
2763
+ *
2764
+ * Centralises every pixel and grid value that must agree between the Electron
2765
+ * main-process window creation (`tray-popover.ts`) and the React canvas layout
2766
+ * (`tray-view.tsx`). A single edit here propagates to both surfaces.
2767
+ * @packageDocumentation
2768
+ */
2769
+ /** Tray popover window width in CSS/screen pixels. */
2770
+ declare const TRAY_WINDOW_WIDTH_PX = 480;
2771
+ /** Tray popover window height in CSS/screen pixels. */
2772
+ declare const TRAY_WINDOW_HEIGHT_PX = 500;
2773
+ /**
2774
+ * Horizontal padding on each side applied by the canvas container when in
2775
+ * fixed mode (`.fixed .gridArea { padding: 8px }`). Subtracted from the
2776
+ * window width on both sides to derive the usable grid width.
2777
+ */
2778
+ declare const TRAY_CANVAS_HORIZONTAL_PADDING_PX = 8;
2779
+ /** Number of grid columns in the tray canvas (non-responsive, fixed). */
2780
+ declare const TRAY_GRID_COLS = 2;
2781
+ /** Row height in pixels for the tray widget grid. */
2782
+ declare const TRAY_ROW_HEIGHT_PX = 60;
2783
+ /** Cell margin tuple `[horizontal, vertical]` in pixels used by the tray `react-grid-layout` instance. */
2784
+ declare const TRAY_CELL_MARGIN: [number, number];
2785
+ /**
2786
+ * Effective grid width passed to the non-responsive `GridLayout`.
2787
+ *
2788
+ * Derived as: `TRAY_WINDOW_WIDTH_PX - 2 * TRAY_CANVAS_HORIZONTAL_PADDING_PX`
2789
+ * = 480 - 16 = 464 px.
2790
+ */
2791
+ declare const TRAY_GRID_WIDTH_PX: number;
2792
+ //#endregion
2793
+ export { type AdapterInfo, type ComponentLike, DEFAULT_WIDGET_UI_CONTEXT, type ExtensionBrowserContribution, type ExtensionBrowserFactory, type ExtensionBrowserFactoryContext, type ExtensionBrowserFactoryResolution, type IconComponentLike, type IconComponentProps, type LazyComponentModule, type ListWidgetsRequest, type ListWidgetsResponse, type NavigationAction, type NavigationGroup, type NavigationGroupConfig, type NavigationGroupMap, type NavigationLevel, type NavigationQueryOptions, NavigationRegistry, type NavigationTarget, type OnboardingContext, type OnboardingKaiState, type OnboardingStepDefinition, type OnboardingStepProps, OnboardingStepRegistry, PAGE_PREFERENCE_CATEGORIES, PLUGIN_CATEGORIES, type PageComponentProps, type PageDeclaration, type PageDefinition, type PageDefinitionQueryOptions, PageDefinitionRegistry, type PageLayoutPersistenceContext, type PageLevel, type PageMode, PageRegistry, type PageSectionDefinition, type PageSectionProps, PageSectionRegistry, type PageSectionStatus, type PluginCategory, RegistryBase, type RuntimeReadyWaitResult, type RuntimeReadyWaiter, SHELL_BG_COLOR, SHELL_FONT_FAMILY, SHELL_TEXT_COLOR, type ShellContribution, type ShellProps, type SlotContent, type SlotDefinition, type SlotId, type SlotPlacement, type SlotPlacementMap, TRAY_CANVAS_HORIZONTAL_PADDING_PX, TRAY_CELL_MARGIN, TRAY_GRID_COLS, TRAY_GRID_WIDTH_PX, TRAY_ROW_HEIGHT_PX, TRAY_WINDOW_HEIGHT_PX, TRAY_WINDOW_WIDTH_PX, UiNamespace, type UiNavigateAction, type UiNavigateRequest, type UiNavigateResponse, type UiPopoverShowRequest, type UiPopoverShowResponse, type UiReadyEvent, UiSchemas, type UiShortcutTriggeredEvent, UiSubjects, type UnregisterPayload, type WidgetActivatedPayload, type WidgetActivation, type WidgetActivationContext, type WidgetDefinition, type WidgetDefinitionPayload, type WidgetInstance, type WidgetLayout, WidgetNamespace, type WidgetPlacement, type WidgetProps, WidgetRawSchemas, WidgetRegistry, WidgetSchemas, type WidgetScope, type WidgetScopeDefinition, type WidgetSize, type WidgetSlotId, type WidgetSlotState, WidgetSubjects, buildPageLayoutKey, clearExtensionBrowserFactories, createRuntimeReadyWaiter, defaultNavigationGroups, deriveBrowserTarget, deriveDefaultEnabled, deriveTrayLayout, eraseWidgetConfig, findCategory, getRegisteredExtensionBrowserFactory, isOverlayMode, isWidgetLayout, isWidgetPlacement, navigationRegistry, onboardingStepRegistry, pageDefinitionRegistry, pageRegistry, pageSectionRegistry, queryPageDefinitions, registerExtensionBrowserFactory, registerExtensionUI, registerPageBusHandler, registerWidget, registerWidgets, resolveExtensionBrowserFactory, runCleanupsInReverse, subscribeToWidgetEvents, unregisterExtensionBrowserFactory, unregisterWidget, widgetMatchesScope, widgetRegistry, widgetScopeRegistry };