@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,1805 @@
1
+ import * as _$react from "react";
2
+ import { ComponentType, JSX, ReactNode } from "react";
3
+ import { PreferenceKey } from "@makaio/framework/services/preferences";
4
+ import { AdapterInfo, ComponentLike, NavigationGroupConfig, OnboardingContext, OnboardingStepDefinition as OnboardingStepDefinition$1, OnboardingStepProps as OnboardingStepProps$1, PageComponentProps, PageDefinition, PageDefinitionQueryOptions, RuntimeReadyWaiter, WidgetDefinition, WidgetLayout, WidgetScope } from "@makaio/framework/ui-kernel";
5
+ import { ExtensionInfo } from "@makaio/framework/kernel";
6
+ import { IMakaioBus } from "@makaio/framework/bus";
7
+ import { AIModel, AgentSelection, ModelFilterMode, ModelVisibility, UiContextSnapshot, UiRuntimeNavigationLevel, UiScope } from "@makaio/framework/contracts";
8
+ import { BindingRecord, ProviderConfigFileRecord } from "@makaio/framework/services/adapter-subsystem";
9
+ import { LogImportMode } from "@makaio/framework/services/log-import/log-import";
10
+ import { CredentialRef } from "@makaio/framework/contracts/config";
11
+ import { ModelFilterMode as ModelFilterMode$1, ModelVisibility as ModelVisibility$1, ProtocolEndpoints, ProtocolId } from "@makaio/framework/contracts/provider";
12
+
13
+ //#region ui/hooks/src/bus/bus-provider.d.ts
14
+ /**
15
+ * React context carrying the active bus instance.
16
+ *
17
+ * Components must be rendered inside a `BusProvider` to access this context.
18
+ */
19
+ declare const BusContext: _$react.Context<IMakaioBus | null>;
20
+ /**
21
+ * Props for {@link BusProvider}.
22
+ */
23
+ interface BusProviderProps {
24
+ /**
25
+ * Pre-connected bus instance to expose via context.
26
+ *
27
+ * Required so framework surfaces make their bus bootstrap explicit instead of
28
+ * silently falling back to the global singleton.
29
+ */
30
+ bus: IMakaioBus;
31
+ /** React children rendered inside the bus context. */
32
+ children: ReactNode;
33
+ }
34
+ /**
35
+ * Provides the connected `IMakaioBus` instance to the React component tree.
36
+ *
37
+ * The bus transport must be established before this component mounts.
38
+ * On the Electron path, pass the `MakaioBus` singleton after calling
39
+ * `MakaioBus.connect()` in the bootstrap function.
40
+ * @param props - Provider configuration.
41
+ * @returns React provider wrapping children with the active bus context.
42
+ */
43
+ declare function BusProvider({
44
+ bus,
45
+ children
46
+ }: BusProviderProps): JSX.Element;
47
+ /**
48
+ * Hook to access the bus instance from React context.
49
+ *
50
+ * Must be called inside a component tree that is wrapped in `BusProvider`.
51
+ * @returns The active `IMakaioBus` instance.
52
+ * @throws When called outside a `BusProvider`.
53
+ * @example
54
+ * ```tsx
55
+ * function MyComponent() {
56
+ * const bus = useBus();
57
+ * const handleClick = () => void bus.emit(MySubjects.clicked, {});
58
+ * return <button onClick={handleClick}>Click</button>;
59
+ * }
60
+ * ```
61
+ */
62
+ declare function useBus(): IMakaioBus;
63
+ /**
64
+ * Hook to optionally access the bus instance from React context.
65
+ *
66
+ * Unlike {@link useBus}, this hook does not throw when called outside a
67
+ * `BusProvider`. It returns `null` when no provider is mounted, allowing
68
+ * components to degrade gracefully rather than crash.
69
+ *
70
+ * Use this for components that can meaningfully render without a bus (e.g.
71
+ * by disabling interactive affordances). Prefer {@link useBus} for components
72
+ * that have no useful state without a bus.
73
+ * @returns The active `IMakaioBus` instance, or `null` if no provider is mounted.
74
+ */
75
+ declare function useOptionalBus(): IMakaioBus | null;
76
+ //#endregion
77
+ //#region ui/hooks/src/widgets/hooks.d.ts
78
+ interface UseWidgetsOptions {
79
+ builtIns?: readonly WidgetDefinition[];
80
+ scope?: WidgetScope;
81
+ includeAny?: boolean;
82
+ }
83
+ interface UseWidgetsResult {
84
+ builtInWidgets: readonly WidgetDefinition[];
85
+ loading: boolean;
86
+ widgets: ReadonlyArray<WidgetDefinition> | undefined;
87
+ }
88
+ /**
89
+ * Register built-in widgets once and subscribe to runtime widget registrations.
90
+ * @param options - Built-in registration and scope-filter options.
91
+ * @returns Registered built-ins plus the current widget list for the requested scope.
92
+ */
93
+ declare function useWidgets(options?: UseWidgetsOptions): UseWidgetsResult;
94
+ interface UseWidgetRegistryOptions {
95
+ scope?: WidgetScope;
96
+ includeAny?: boolean;
97
+ }
98
+ /**
99
+ * Read registered widgets reactively from the shared widget registry.
100
+ * @param options - Optional scope filter and include-any behavior.
101
+ * @returns Widget definitions matching the requested scope.
102
+ */
103
+ declare function useWidgetRegistry(options?: UseWidgetRegistryOptions): ReadonlyArray<WidgetDefinition>;
104
+ interface UseWidgetConfigOptions<TConfig extends Record<string, unknown>> {
105
+ paneId: string;
106
+ widgetId: string;
107
+ context: WidgetLayoutContext;
108
+ surface: 'ui' | 'app';
109
+ defaultConfig: TConfig;
110
+ }
111
+ interface UseWidgetConfigResult<TConfig extends Record<string, unknown>> {
112
+ config: TConfig;
113
+ updateConfig: (partial: Partial<TConfig>) => void;
114
+ }
115
+ interface WidgetLayoutContext {
116
+ readonly scope: UiScope;
117
+ readonly contextId?: string | null;
118
+ }
119
+ /**
120
+ * Load and persist widget instance configuration through preferences.
121
+ * @param options - Widget identity plus default configuration.
122
+ * @returns Current widget config and a partial-update helper.
123
+ */
124
+ declare function useWidgetConfig<TConfig extends Record<string, unknown>>(options: UseWidgetConfigOptions<TConfig>): UseWidgetConfigResult<TConfig>;
125
+ //#endregion
126
+ //#region ui/hooks/src/widgets/use-widget-layout.d.ts
127
+ /**
128
+ * Load a widget layout preference and expose its fetch state.
129
+ * @param preferenceKey - Preference key that identifies the layout.
130
+ * @returns The current layout value plus loading, error, and refresh state.
131
+ */
132
+ declare function useWidgetLayout(preferenceKey: PreferenceKey): {
133
+ layout: WidgetLayout | null;
134
+ isLoading: boolean;
135
+ error: Error | null;
136
+ refresh: () => Promise<void>;
137
+ };
138
+ //#endregion
139
+ //#region ui/hooks/src/widgets/use-widget-layout-actions.d.ts
140
+ /**
141
+ * Persist or reset widget layouts in preferences.
142
+ * @returns Layout mutation helpers bound to the current bus instance.
143
+ */
144
+ declare function useWidgetLayoutActions(): {
145
+ saveLayout: (key: PreferenceKey, layout: WidgetLayout) => Promise<void>;
146
+ resetLayout: (key: PreferenceKey) => Promise<void>;
147
+ };
148
+ //#endregion
149
+ //#region ui/hooks/src/widgets/use-tray-layout.d.ts
150
+ /**
151
+ * Derive a read-only `WidgetLayout` for the tray surface from the live widget registry.
152
+ * @param lockedWidgetIds - Widget IDs that should be pinned at the top of the tray.
153
+ * @returns Stable tray layout derived from the current widget registry snapshot.
154
+ */
155
+ declare function useTrayLayout(lockedWidgetIds?: readonly string[]): WidgetLayout;
156
+ //#endregion
157
+ //#region ui/hooks/src/extensions/shared-browser-loader.d.ts
158
+ type SharedLoaderState = 'loading' | 'ready' | 'empty' | 'error';
159
+ interface SharedShellContribution<TShellProps> {
160
+ component: ComponentType<TShellProps>;
161
+ }
162
+ interface SharedExtensionBrowserContribution<TShellProps> {
163
+ shell?: SharedShellContribution<TShellProps>;
164
+ destroy?: () => void;
165
+ }
166
+ interface SharedFactoryResolution<TContribution> {
167
+ kind: 'resolved' | 'invalid';
168
+ factory?: (context: SharedBrowserFactoryContext) => TContribution | null | undefined;
169
+ reason?: string;
170
+ }
171
+ interface SharedBrowserFactoryContext {
172
+ bus: IMakaioBus;
173
+ }
174
+ interface ExtensionBrowserLoadResult<TShellProps> {
175
+ cleanups: Array<() => void>;
176
+ errorMessage: string | null;
177
+ shell: ComponentType<TShellProps> | null;
178
+ state: Exclude<SharedLoaderState, 'loading'>;
179
+ }
180
+ interface ExtensionBrowserLoadOptions<TContribution extends SharedExtensionBrowserContribution<TShellProps>, TShellProps, TFactory> {
181
+ bus: IMakaioBus;
182
+ getRegisteredFactory: (extensionName: string) => TFactory | undefined;
183
+ importModule?: (entrypointPath: string) => Promise<{
184
+ default?: unknown;
185
+ }>;
186
+ isCurrentRun: () => boolean;
187
+ registerExtensionUI: (bus: IMakaioBus, extensionName: string, contribution: TContribution) => () => void;
188
+ resolveFactory: (moduleDefault: unknown, registeredFactory: TFactory | undefined) => SharedFactoryResolution<TContribution>;
189
+ unregisterFactory: (extensionName: string) => void;
190
+ waitForRuntimeReady: (bus: IMakaioBus) => RuntimeReadyWaiter;
191
+ }
192
+ /**
193
+ * Load and register browser extension contributions for a renderer surface.
194
+ *
195
+ * Centralizes the runtime wait, extension discovery, secure browser import,
196
+ * contribution registration, and shell selection logic. Callers retain
197
+ * ownership of local registries and registration adapters via the injected
198
+ * callbacks so this seam removes orchestration duplication without collapsing
199
+ * framework and host ownership boundaries.
200
+ * @param options - Loader dependencies owned by the caller surface.
201
+ * @returns Final loader state, selected shell, and teardown callbacks.
202
+ */
203
+ declare function loadExtensionBrowserContributions<TContribution extends SharedExtensionBrowserContribution<TShellProps>, TShellProps, TFactory>(options: ExtensionBrowserLoadOptions<TContribution, TShellProps, TFactory>): Promise<ExtensionBrowserLoadResult<TShellProps>>;
204
+ //#endregion
205
+ //#region node_modules/zustand/esm/vanilla.d.mts
206
+ type SetStateInternal<T> = {
207
+ _(partial: T | Partial<T> | {
208
+ _(state: T): T | Partial<T>;
209
+ }['_'], replace?: false): void;
210
+ _(state: T | {
211
+ _(state: T): T;
212
+ }['_'], replace: true): void;
213
+ }['_'];
214
+ interface StoreApi<T> {
215
+ setState: SetStateInternal<T>;
216
+ getState: () => T;
217
+ getInitialState: () => T;
218
+ subscribe: (listener: (state: T, prevState: T) => void) => () => void;
219
+ }
220
+ type ExtractState<S> = S extends {
221
+ getState: () => infer T;
222
+ } ? T : never;
223
+ type Get<T, K, F> = K extends keyof T ? T[K] : F;
224
+ type Mutate<S, Ms> = number extends Ms['length' & keyof Ms] ? S : Ms extends [] ? S : Ms extends [[infer Mi, infer Ma], ...infer Mrs] ? Mutate<StoreMutators<S, Ma>[Mi & StoreMutatorIdentifier], Mrs> : never;
225
+ type StateCreator<T, Mis extends [StoreMutatorIdentifier, unknown][] = [], Mos extends [StoreMutatorIdentifier, unknown][] = [], U = T> = ((setState: Get<Mutate<StoreApi<T>, Mis>, 'setState', never>, getState: Get<Mutate<StoreApi<T>, Mis>, 'getState', never>, store: Mutate<StoreApi<T>, Mis>) => U) & {
226
+ $$storeMutators?: Mos;
227
+ };
228
+ interface StoreMutators<S, A> {}
229
+ type StoreMutatorIdentifier = keyof StoreMutators<unknown, unknown>;
230
+ //#endregion
231
+ //#region node_modules/zustand/esm/react.d.mts
232
+ type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'getInitialState' | 'subscribe'>;
233
+ type UseBoundStore<S extends ReadonlyStoreApi<unknown>> = {
234
+ (): ExtractState<S>;
235
+ <U>(selector: (state: ExtractState<S>) => U): U;
236
+ } & S;
237
+ //#endregion
238
+ //#region node_modules/zustand/esm/middleware/redux.d.mts
239
+ type Write$3<T, U> = Omit<T, keyof U> & U;
240
+ type StoreRedux<A> = {
241
+ dispatch: (a: A) => A;
242
+ dispatchFromDevtools: true;
243
+ };
244
+ type WithRedux<S, A> = Write$3<S, StoreRedux<A>>;
245
+ declare module '../vanilla.mjs' {
246
+ interface StoreMutators<S, A> {
247
+ 'zustand/redux': WithRedux<S, A>;
248
+ }
249
+ }
250
+ //#endregion
251
+ //#region node_modules/zustand/esm/middleware/devtools.d.mts
252
+ declare module '../vanilla.mjs' {
253
+ interface StoreMutators<S, A> {
254
+ 'zustand/devtools': WithDevtools<S>;
255
+ }
256
+ }
257
+ type Cast<T, U> = T extends U ? T : U;
258
+ type Write$2<T, U> = Omit<T, keyof U> & U;
259
+ type TakeTwo<T> = T extends {
260
+ length: 0;
261
+ } ? [undefined, undefined] : T extends {
262
+ length: 1;
263
+ } ? [...args0: Cast<T, unknown[]>, arg1: undefined] : T extends {
264
+ length: 0 | 1;
265
+ } ? [...args0: Cast<T, unknown[]>, arg1: undefined] : T extends {
266
+ length: 2;
267
+ } ? T : T extends {
268
+ length: 1 | 2;
269
+ } ? T : T extends {
270
+ length: 0 | 1 | 2;
271
+ } ? T : T extends [infer A0, infer A1, ...unknown[]] ? [A0, A1] : T extends [infer A0, (infer A1)?, ...unknown[]] ? [A0, A1?] : T extends [(infer A0)?, (infer A1)?, ...unknown[]] ? [A0?, A1?] : never;
272
+ type WithDevtools<S> = Write$2<S, StoreDevtools<S>>;
273
+ type Action = string | {
274
+ type: string;
275
+ [x: string | number | symbol]: unknown;
276
+ };
277
+ type StoreDevtools<S> = S extends {
278
+ setState: {
279
+ (...args: infer Sa1): infer Sr1;
280
+ (...args: infer Sa2): infer Sr2;
281
+ };
282
+ } ? {
283
+ setState(...args: [...args: TakeTwo<Sa1>, action?: Action]): Sr1;
284
+ setState(...args: [...args: TakeTwo<Sa2>, action?: Action]): Sr2;
285
+ devtools: {
286
+ cleanup: () => void;
287
+ };
288
+ } : never;
289
+ //#endregion
290
+ //#region node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts
291
+ type Write$1<T, U> = Omit<T, keyof U> & U;
292
+ type WithSelectorSubscribe<S> = S extends {
293
+ getState: () => infer T;
294
+ } ? Write$1<S, StoreSubscribeWithSelector<T>> : never;
295
+ declare module '../vanilla.mjs' {
296
+ interface StoreMutators<S, A> {
297
+ ['zustand/subscribeWithSelector']: WithSelectorSubscribe<S>;
298
+ }
299
+ }
300
+ type StoreSubscribeWithSelector<T> = {
301
+ subscribe: {
302
+ (listener: (selectedState: T, previousSelectedState: T) => void): () => void;
303
+ <U>(selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
304
+ equalityFn?: (a: U, b: U) => boolean;
305
+ fireImmediately?: boolean;
306
+ }): () => void;
307
+ };
308
+ };
309
+ //#endregion
310
+ //#region node_modules/zustand/esm/middleware/persist.d.mts
311
+ type StorageValue<S> = {
312
+ state: S;
313
+ version?: number;
314
+ };
315
+ interface PersistStorage<S, R = unknown> {
316
+ getItem: (name: string) => StorageValue<S> | null | Promise<StorageValue<S> | null>;
317
+ setItem: (name: string, value: StorageValue<S>) => R;
318
+ removeItem: (name: string) => R;
319
+ }
320
+ interface PersistOptions<S, PersistedState = S, PersistReturn = unknown> {
321
+ /** Name of the storage (must be unique) */
322
+ name: string;
323
+ /**
324
+ * Use a custom persist storage.
325
+ *
326
+ * Combining `createJSONStorage` helps creating a persist storage
327
+ * with JSON.parse and JSON.stringify.
328
+ *
329
+ * @default createJSONStorage(() => window.localStorage)
330
+ */
331
+ storage?: PersistStorage<PersistedState, PersistReturn> | undefined;
332
+ /**
333
+ * Filter the persisted value.
334
+ *
335
+ * @params state The state's value
336
+ */
337
+ partialize?: (state: S) => PersistedState;
338
+ /**
339
+ * A function returning another (optional) function.
340
+ * The main function will be called before the state rehydration.
341
+ * The returned function will be called after the state rehydration or when an error occurred.
342
+ */
343
+ onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void;
344
+ /**
345
+ * If the stored state's version mismatch the one specified here, the storage will not be used.
346
+ * This is useful when adding a breaking change to your store.
347
+ */
348
+ version?: number;
349
+ /**
350
+ * A function to perform persisted state migration.
351
+ * This function will be called when persisted state versions mismatch with the one specified here.
352
+ */
353
+ migrate?: (persistedState: unknown, version: number) => PersistedState | Promise<PersistedState>;
354
+ /**
355
+ * A function to perform custom hydration merges when combining the stored state with the current one.
356
+ * By default, this function does a shallow merge.
357
+ */
358
+ merge?: (persistedState: unknown, currentState: S) => S;
359
+ /**
360
+ * An optional boolean that will prevent the persist middleware from triggering hydration on initialization,
361
+ * This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle.
362
+ *
363
+ * This is useful in SSR application.
364
+ *
365
+ * @default false
366
+ */
367
+ skipHydration?: boolean;
368
+ }
369
+ type PersistListener<S> = (state: S) => void;
370
+ type StorePersist<S, Ps, Pr> = S extends {
371
+ getState: () => infer T;
372
+ setState: {
373
+ (...args: infer Sa1): infer Sr1;
374
+ (...args: infer Sa2): infer Sr2;
375
+ };
376
+ } ? {
377
+ setState(...args: Sa1): Sr1 | Pr;
378
+ setState(...args: Sa2): Sr2 | Pr;
379
+ persist: {
380
+ setOptions: (options: Partial<PersistOptions<T, Ps, Pr>>) => void;
381
+ clearStorage: () => void;
382
+ rehydrate: () => Promise<void> | void;
383
+ hasHydrated: () => boolean;
384
+ onHydrate: (fn: PersistListener<T>) => () => void;
385
+ onFinishHydration: (fn: PersistListener<T>) => () => void;
386
+ getOptions: () => Partial<PersistOptions<T, Ps, Pr>>;
387
+ };
388
+ } : never;
389
+ declare module '../vanilla.mjs' {
390
+ interface StoreMutators<S, A> {
391
+ 'zustand/persist': WithPersist<S, A>;
392
+ }
393
+ }
394
+ type Write<T, U> = Omit<T, keyof U> & U;
395
+ type WithPersist<S, A> = Write<S, StorePersist<S, A, unknown>>;
396
+ //#endregion
397
+ //#region ui/hooks/src/state/create-persisted-store.d.ts
398
+ /**
399
+ * Storage engine selection.
400
+ *
401
+ * - `'sessionStorage'` – tab-scoped; cleared when the tab is closed.
402
+ * - `'localStorage'` – cross-tab; survives browser restart.
403
+ */
404
+ type StorageType = 'sessionStorage' | 'localStorage';
405
+ /**
406
+ * SSR-safe no-op storage used when the requested browser storage is unavailable
407
+ * (e.g., server-side rendering, private-browsing mode, or unit tests).
408
+ */
409
+ declare const noopStorage: Storage;
410
+ /**
411
+ * Configuration options for `createPersistedStore`.
412
+ * @typeParam T - The Zustand state type.
413
+ */
414
+ interface PersistedStoreConfig<T> {
415
+ /**
416
+ * Unique storage key (e.g., `'makaio-agent-selection'`).
417
+ * Must be globally unique across all stores.
418
+ */
419
+ name: string;
420
+ /**
421
+ * Which browser storage to use.
422
+ * Defaults to `'sessionStorage'`.
423
+ */
424
+ storage?: StorageType;
425
+ /**
426
+ * Schema version for migrations.
427
+ * Increment when persisted shape changes; supply a `migrate` function in
428
+ * `extraPersistOptions` when doing so.
429
+ */
430
+ version?: number;
431
+ /**
432
+ * Subset of state to persist.
433
+ * When omitted the full state is persisted.
434
+ * @param state - Full store state.
435
+ * @returns Partial state to write to storage.
436
+ */
437
+ partialize?: PersistOptions<T, Partial<T>>['partialize'];
438
+ /**
439
+ * Custom merge function for rehydration.
440
+ * Useful for schema migrations that need to clean up persisted data.
441
+ * @param persistedState - Data read from storage (possibly stale shape).
442
+ * @param currentState - Current in-memory state (initial values).
443
+ * @returns Merged state.
444
+ */
445
+ merge?: (persistedState: unknown, currentState: T) => T;
446
+ /**
447
+ * Extra persist options forwarded verbatim to the Zustand `persist`
448
+ * middleware. Use this for advanced options such as `onRehydrateStorage` or
449
+ * `migrate`. Values here take precedence over other config fields when there
450
+ * is a key conflict (except `name` and `storage`, which are always set by
451
+ * this factory).
452
+ */
453
+ extraPersistOptions?: Omit<PersistOptions<T>, 'name' | 'storage'>;
454
+ }
455
+ /**
456
+ * Factory that creates a Zustand store with Zustand `persist` middleware
457
+ * pre-configured.
458
+ *
459
+ * All framework stores that need persistence should use this factory instead of
460
+ * calling `create(persist(...))` directly. This keeps the boilerplate in one
461
+ * place and guarantees SSR-safe storage resolution everywhere.
462
+ * @param stateCreator - Zustand state creator (same as the first arg to `create`).
463
+ * @param config - Persistence configuration for this store.
464
+ * @returns A Zustand store hook identical to what `create()` returns.
465
+ * @example
466
+ * ```ts
467
+ * export const useMyStore = createPersistedStore<MyState>(
468
+ * (set) => ({
469
+ * count: 0,
470
+ * increment: () => set((s) => ({ count: s.count + 1 })),
471
+ * }),
472
+ * { name: 'makaio-my-store', storage: 'sessionStorage' },
473
+ * );
474
+ * ```
475
+ */
476
+ declare function createPersistedStore<T>(stateCreator: StateCreator<T, [StoreMutatorIdentifier, unknown][], []>, config: PersistedStoreConfig<T>): UseBoundStore<Omit<StoreApi<T>, "setState" | "persist"> & {
477
+ setState(partial: T | Partial<T> | ((state: T) => T | Partial<T>), replace?: false | undefined): unknown;
478
+ setState(state: T | ((state: T) => T), replace: true): unknown;
479
+ persist: {
480
+ setOptions: (options: Partial<PersistOptions<T, Partial<T>, unknown>>) => void;
481
+ clearStorage: () => void;
482
+ rehydrate: () => Promise<void> | void;
483
+ hasHydrated: () => boolean;
484
+ onHydrate: (fn: (state: T) => void) => () => void;
485
+ onFinishHydration: (fn: (state: T) => void) => () => void;
486
+ getOptions: () => Partial<PersistOptions<T, Partial<T>, unknown>>;
487
+ };
488
+ }>;
489
+ //#endregion
490
+ //#region ui/hooks/src/state/window-context-store.d.ts
491
+ interface WindowContextState {
492
+ /**
493
+ * The qualified desktop window registration ID for this tab, when the page is
494
+ * hosted inside a desktop shell (`{packageName}:{windowId}`). Null when
495
+ * running as a standalone browser tab.
496
+ *
497
+ * Set once during bootstrap from host-local runtime config. Never changes for
498
+ * the lifetime of the tab. Not persisted — always re-derived from the host
499
+ * config on each page load.
500
+ */
501
+ windowId: string | null;
502
+ /** Current host UI context snapshot for this tab. */
503
+ uiContext: UiContextSnapshot;
504
+ /**
505
+ * ID of the pane that most recently received user focus.
506
+ * Transient — not persisted. Resets to `null` on page load.
507
+ */
508
+ activePaneId: string | null;
509
+ /**
510
+ * Set the window registration ID (called once during bootstrap).
511
+ *
512
+ * Should only be called by the bootstrap function before React renders.
513
+ * After the first non-null write, subsequent calls with a different value
514
+ * are silently ignored — the ID is immutable for the tab's lifetime.
515
+ * Re-setting the same value (e.g. HMR re-bootstrap) is a no-op.
516
+ * @param id - The qualified desktop window registration ID, or null for standalone browser.
517
+ */
518
+ setWindowId: (id: string | null) => void;
519
+ /**
520
+ * Set the active host UI context snapshot.
521
+ * @param uiContext - UI context snapshot to store for this tab.
522
+ */
523
+ setUiContext: (uiContext: UiContextSnapshot) => void;
524
+ /**
525
+ * Sets the active pane.
526
+ *
527
+ * Called by PaneContainer on focus or pointer-down capture.
528
+ * @param id - Pane ID, or null to clear.
529
+ */
530
+ setActivePaneId: (id: string | null) => void;
531
+ /** Clear the UI context back to the framework root context. */
532
+ clearUiContext: () => void;
533
+ }
534
+ /**
535
+ * Tab-scoped window context store.
536
+ *
537
+ * Use this for navigation state and window-specific overrides:
538
+ * - Which host UI context is active in THIS window
539
+ * - Model/adapter overrides for THIS window
540
+ *
541
+ * Navigation level is read directly from `uiContext.level`.
542
+ */
543
+ declare const useWindowContext: UseBoundStore<Omit<StoreApi<WindowContextState>, "setState" | "persist"> & {
544
+ setState(partial: WindowContextState | Partial<WindowContextState> | ((state: WindowContextState) => WindowContextState | Partial<WindowContextState>), replace?: false | undefined): unknown;
545
+ setState(state: WindowContextState | ((state: WindowContextState) => WindowContextState), replace: true): unknown;
546
+ persist: {
547
+ setOptions: (options: Partial<PersistOptions<WindowContextState, Partial<WindowContextState>, unknown>>) => void;
548
+ clearStorage: () => void;
549
+ rehydrate: () => Promise<void> | void;
550
+ hasHydrated: () => boolean;
551
+ onHydrate: (fn: (state: WindowContextState) => void) => () => void;
552
+ onFinishHydration: (fn: (state: WindowContextState) => void) => () => void;
553
+ getOptions: () => Partial<PersistOptions<WindowContextState, Partial<WindowContextState>, unknown>>;
554
+ };
555
+ }>;
556
+ //#endregion
557
+ //#region ui/hooks/src/state/page-overlay-store.d.ts
558
+ /**
559
+ * Page Overlay Store - Global page overlay state
560
+ *
561
+ * Manages the state of the PageOverlay system for IDE-like navigation to pages
562
+ * (Settings, Help, Plugin Config) as modal overlays that preserve workspace state.
563
+ * This is ephemeral UI state that persists to sessionStorage for tab isolation.
564
+ *
565
+ * Persisted to sessionStorage:
566
+ * - Tab survives refresh with overlay state preserved
567
+ * - Each tab has its own overlay state
568
+ * - Close tab = fresh start (no stale state)
569
+ * @packageDocumentation
570
+ */
571
+ /**
572
+ * Page overlay state management.
573
+ */
574
+ interface PageOverlayState {
575
+ /** Currently displayed page ID (null = closed) */
576
+ activePageId: string | null;
577
+ /** Internal route within the page */
578
+ internalRoute: string | null;
579
+ /**
580
+ * Open a page in the overlay.
581
+ * @param pageId - ID of the page to open (e.g., 'settings', 'help')
582
+ * @param route - Optional internal route within the page; defaults to null
583
+ */
584
+ openPage: (pageId: string, route?: string) => void;
585
+ /** Close the overlay */
586
+ close: () => void;
587
+ /**
588
+ * Navigate within the current page.
589
+ * @param route - New internal route
590
+ */
591
+ navigate: (route: string) => void;
592
+ }
593
+ /**
594
+ * Zustand store for PageOverlay state.
595
+ *
596
+ * Uses sessionStorage for tab-scoped persistence, ensuring each browser tab
597
+ * maintains its own overlay state independently.
598
+ * @example
599
+ * ```tsx
600
+ * function MyComponent() {
601
+ * const activePageId = usePageOverlayStore((s) => s.activePageId);
602
+ * const openPage = usePageOverlayStore((s) => s.openPage);
603
+ *
604
+ * return (
605
+ * <button onClick={() => openPage('settings')}>
606
+ * Open Settings
607
+ * </button>
608
+ * );
609
+ * }
610
+ * ```
611
+ */
612
+ declare const usePageOverlayStore: UseBoundStore<Omit<StoreApi<PageOverlayState>, "setState" | "persist"> & {
613
+ setState(partial: PageOverlayState | Partial<PageOverlayState> | ((state: PageOverlayState) => PageOverlayState | Partial<PageOverlayState>), replace?: false | undefined): unknown;
614
+ setState(state: PageOverlayState | ((state: PageOverlayState) => PageOverlayState), replace: true): unknown;
615
+ persist: {
616
+ setOptions: (options: Partial<PersistOptions<PageOverlayState, Partial<PageOverlayState>, unknown>>) => void;
617
+ clearStorage: () => void;
618
+ rehydrate: () => Promise<void> | void;
619
+ hasHydrated: () => boolean;
620
+ onHydrate: (fn: (state: PageOverlayState) => void) => () => void;
621
+ onFinishHydration: (fn: (state: PageOverlayState) => void) => () => void;
622
+ getOptions: () => Partial<PersistOptions<PageOverlayState, Partial<PageOverlayState>, unknown>>;
623
+ };
624
+ }>;
625
+ //#endregion
626
+ //#region ui/hooks/src/navigation/use-navigation-level.d.ts
627
+ /**
628
+ * Runtime navigation level from the current UI context snapshot.
629
+ */
630
+ type RuntimeNavigationLevel = UiRuntimeNavigationLevel;
631
+ /**
632
+ * Reads the current navigation level from window context.
633
+ * @returns The current navigation level from `uiContext.level`.
634
+ * @example
635
+ * ```tsx
636
+ * const level = useNavigationLevel();
637
+ * ```
638
+ */
639
+ declare function useNavigationLevel(): RuntimeNavigationLevel;
640
+ //#endregion
641
+ //#region ui/hooks/src/state/sidebar-store.d.ts
642
+ /**
643
+ * Per-level collapsed state record.
644
+ */
645
+ type CollapsedByLevel = Partial<Record<RuntimeNavigationLevel, boolean>>;
646
+ interface SidebarState {
647
+ /** Collapsed state keyed by navigation level */
648
+ collapsedByLevel: CollapsedByLevel;
649
+ /**
650
+ * Check if sidebar is collapsed at a given navigation level.
651
+ * @param level - Navigation level to check
652
+ * @returns True if collapsed (defaults to false)
653
+ */
654
+ isCollapsed: (level: RuntimeNavigationLevel) => boolean;
655
+ /**
656
+ * Toggle sidebar collapsed state for a navigation level.
657
+ * @param level - Navigation level to toggle
658
+ */
659
+ toggle: (level: RuntimeNavigationLevel) => void;
660
+ /**
661
+ * Set sidebar collapsed state for a navigation level.
662
+ * @param level - Navigation level to set
663
+ * @param collapsed - Whether the sidebar should be collapsed
664
+ */
665
+ setCollapsed: (level: RuntimeNavigationLevel, collapsed: boolean) => void;
666
+ }
667
+ /**
668
+ * Sidebar state store.
669
+ *
670
+ * Provides per-navigation-level collapse persistence via localStorage.
671
+ * @example
672
+ * ```tsx
673
+ * const isCollapsed = useSidebarStore((s) => s.isCollapsed(level));
674
+ * const toggle = useSidebarStore((s) => s.toggle);
675
+ *
676
+ * return (
677
+ * <button onClick={() => toggle(level)}>
678
+ * {isCollapsed ? 'Expand' : 'Collapse'}
679
+ * </button>
680
+ * );
681
+ * ```
682
+ */
683
+ declare const useSidebarStore: UseBoundStore<Omit<StoreApi<SidebarState>, "setState" | "persist"> & {
684
+ setState(partial: SidebarState | Partial<SidebarState> | ((state: SidebarState) => SidebarState | Partial<SidebarState>), replace?: false | undefined): unknown;
685
+ setState(state: SidebarState | ((state: SidebarState) => SidebarState), replace: true): unknown;
686
+ persist: {
687
+ setOptions: (options: Partial<PersistOptions<SidebarState, Partial<SidebarState>, unknown>>) => void;
688
+ clearStorage: () => void;
689
+ rehydrate: () => Promise<void> | void;
690
+ hasHydrated: () => boolean;
691
+ onHydrate: (fn: (state: SidebarState) => void) => () => void;
692
+ onFinishHydration: (fn: (state: SidebarState) => void) => () => void;
693
+ getOptions: () => Partial<PersistOptions<SidebarState, Partial<SidebarState>, unknown>>;
694
+ };
695
+ }>;
696
+ //#endregion
697
+ //#region ui/hooks/src/types/widget-layout.d.ts
698
+ /**
699
+ * Focus Context Widget Layout Types
700
+ *
701
+ * Defines the data structures for per-window widget layouts within Focus Contexts.
702
+ * These types describe how widgets are positioned and sized within a focus context.
703
+ *
704
+ * Key distinction from WidgetLayout (from \@makaio/ui-kernel):
705
+ * - The kernel WidgetLayout uses "placements" for the dashboard/project system
706
+ * - FocusContextLayout uses "widgets" for Focus Context-specific layouts
707
+ * @packageDocumentation
708
+ */
709
+ /**
710
+ * Widget size enumeration
711
+ */
712
+ type FocusContextWidgetSize = 'small' | 'medium' | 'large' | 'full-width';
713
+ /**
714
+ * A placed widget within a Focus Context layout
715
+ *
716
+ * Represents a widget instance with its position and size configuration.
717
+ * The widgetId references a WidgetDeclaration from extensions.
718
+ */
719
+ interface PlacedFocusWidget {
720
+ /** Widget definition ID (from plugin's WidgetDeclaration.id) */
721
+ widgetId: string;
722
+ /** Current size of the widget */
723
+ size: FocusContextWidgetSize;
724
+ /** X coordinate for free-form layouts (optional) */
725
+ x?: number;
726
+ /** Y coordinate for free-form layouts (optional) */
727
+ y?: number;
728
+ /** Width in grid units (optional) */
729
+ width?: number;
730
+ /** Height in grid units (optional) */
731
+ height?: number;
732
+ }
733
+ /**
734
+ * Widget layout for a Focus Context
735
+ *
736
+ * Defines how widgets are arranged within a specific focus context.
737
+ * The version field enables future migrations.
738
+ *
739
+ * Note: Named FocusContextLayout to avoid conflict with WidgetLayout from \@makaio/ui-kernel.
740
+ */
741
+ interface FocusContextLayout {
742
+ /** Layout version for migration support */
743
+ version: 1;
744
+ /** Array of placed widgets in this layout */
745
+ widgets: PlacedFocusWidget[];
746
+ }
747
+ /**
748
+ * Helper to create an empty widget layout
749
+ * @returns A new empty layout with no widgets
750
+ */
751
+ declare function createEmptyFocusContextLayout(): FocusContextLayout;
752
+ /**
753
+ * Helper to add a widget to a layout.
754
+ *
755
+ * Duplicate adds (same `widgetId`) are no-ops — the unchanged layout is
756
+ * returned. This prevents non-deterministic state when callers inadvertently
757
+ * re-add a widget that is already present.
758
+ * @param layout - The layout to modify
759
+ * @param widget - The placed widget to add
760
+ * @returns A new layout with the widget added, or the original layout when
761
+ * a widget with the same `widgetId` already exists.
762
+ */
763
+ declare function addWidgetToFocusLayout(layout: FocusContextLayout, widget: PlacedFocusWidget): FocusContextLayout;
764
+ /**
765
+ * Helper to remove a widget from a layout by widget ID
766
+ * @param layout - The layout to modify
767
+ * @param widgetId - The widget ID to remove
768
+ * @returns A new layout with the widget removed, or the original layout when
769
+ * the widget is not present (referential equality on no-op).
770
+ */
771
+ declare function removeWidgetFromFocusLayout(layout: FocusContextLayout, widgetId: string): FocusContextLayout;
772
+ /**
773
+ * Helper to update a widget's size in a layout
774
+ * @param layout - The layout to modify
775
+ * @param widgetId - The widget ID to update
776
+ * @param size - The new size
777
+ * @returns A new layout with the widget updated, or original if widget not found
778
+ */
779
+ declare function updateFocusContextWidgetSize(layout: FocusContextLayout, widgetId: string, size: FocusContextWidgetSize): FocusContextLayout;
780
+ /**
781
+ * Helper to update a widget's position in a layout
782
+ * @param layout - The layout to modify
783
+ * @param widgetId - The widget ID to update
784
+ * @param position - The new position (x, y, width, height)
785
+ * @returns A new layout with the widget updated, or original if widget not found
786
+ */
787
+ declare function updateFocusContextWidgetPosition(layout: FocusContextLayout, widgetId: string, position: Pick<PlacedFocusWidget, 'x' | 'y' | 'width' | 'height'>): FocusContextLayout;
788
+ //#endregion
789
+ //#region ui/hooks/src/state/focus-store.d.ts
790
+ /**
791
+ * Focus context ID - the preset context identifiers
792
+ *
793
+ * These are the built-in focus contexts available in the web/app interface.
794
+ * For cross-package API contracts (slash commands, etc.), use FocusContext from \@makaio/contracts.
795
+ * @deprecated FocusContext is being phased out. This store is kept for behavior parity
796
+ * but should be removed after the focus-context-deprecation cleanup plan lands.
797
+ * TODO(focus-context-deprecation): remove when FocusContext is deleted.
798
+ */
799
+ type FocusContextId = 'onboarding' | 'chat' | 'git' | 'review' | 'planning' | 'settings' | 'dashboard';
800
+ /**
801
+ * Full Focus Context object with widget layout
802
+ *
803
+ * Represents a complete focus context with its widget arrangement.
804
+ * System-provided contexts have preset IDs, while user-created contexts
805
+ * can have custom IDs.
806
+ */
807
+ interface FocusContextObject {
808
+ /** Unique identifier for this focus context */
809
+ id: FocusContextId | string;
810
+ /** Display name for this context */
811
+ name: string;
812
+ /** Whether this is a system preset or user-created */
813
+ isPreset?: boolean;
814
+ /** Widget arrangement for this context (optional) */
815
+ layout?: FocusContextLayout;
816
+ /** Context-aware quick prompt suggestions (optional) */
817
+ quickPromptSuggestions?: string[];
818
+ }
819
+ /**
820
+ * Normalized focus context state - always stores the full object
821
+ * @deprecated FocusContext is being phased out. This store is kept for behavior parity
822
+ * but should be removed after the focus-context-deprecation cleanup plan lands.
823
+ * TODO(focus-context-deprecation): remove when FocusContext is deleted.
824
+ */
825
+ interface FocusState {
826
+ /** Active focus context with full object (web/app only) */
827
+ activeFocus: FocusContextObject;
828
+ /**
829
+ * Set active focus by ID (looks up from presets).
830
+ * @param focusId - Preset focus context ID to activate.
831
+ */
832
+ setActiveFocus: (focusId: FocusContextId) => void;
833
+ /**
834
+ * Set active focus with full context object.
835
+ * @param context - Full focus context object to activate.
836
+ */
837
+ setActiveFocusContext: (context: FocusContextObject) => void;
838
+ /**
839
+ * Update widget layout for current focus context.
840
+ * @param layout - New layout to apply to the active focus context.
841
+ */
842
+ setFocusContextLayout: (layout: FocusContextLayout) => void;
843
+ /** Get widget layout for current focus context */
844
+ getFocusContextLayout: () => FocusContextLayout | undefined;
845
+ }
846
+ /**
847
+ * Focus Store with Zustand state management
848
+ *
849
+ * Uses sessionStorage for tab-scoped persistence.
850
+ * @deprecated FocusContext is being phased out. This store is kept for behavior parity
851
+ * but should be removed after the focus-context-deprecation cleanup plan lands.
852
+ * TODO(focus-context-deprecation): remove when FocusContext is deleted.
853
+ */
854
+ declare const useFocusStore: UseBoundStore<Omit<StoreApi<FocusState>, "setState" | "persist"> & {
855
+ setState(partial: FocusState | Partial<FocusState> | ((state: FocusState) => FocusState | Partial<FocusState>), replace?: false | undefined): unknown;
856
+ setState(state: FocusState | ((state: FocusState) => FocusState), replace: true): unknown;
857
+ persist: {
858
+ setOptions: (options: Partial<PersistOptions<FocusState, Partial<FocusState>, unknown>>) => void;
859
+ clearStorage: () => void;
860
+ rehydrate: () => Promise<void> | void;
861
+ hasHydrated: () => boolean;
862
+ onHydrate: (fn: (state: FocusState) => void) => () => void;
863
+ onFinishHydration: (fn: (state: FocusState) => void) => () => void;
864
+ getOptions: () => Partial<PersistOptions<FocusState, Partial<FocusState>, unknown>>;
865
+ };
866
+ }>;
867
+ //#endregion
868
+ //#region ui/hooks/src/navigation/register-navigation-handler.d.ts
869
+ /**
870
+ * Registers the browser-side navigation handler at priority 10.
871
+ *
872
+ * This handler validates the URL scheme, then performs `window.open()` with
873
+ * target names derived from the URL for singleton/reuse semantics. Only
874
+ * `http:` and `https:` URLs are allowed — `javascript:` and other unsafe
875
+ * schemes throw to prevent XSS via the bus.
876
+ *
877
+ * In Electron, the higher-priority main-process handler (priority 100)
878
+ * intercepts first; this handler acts as the fallback.
879
+ * @param bus - The MakaioBus instance to register on
880
+ * @returns Cleanup function that unregisters the handler
881
+ */
882
+ declare function registerNavigationHandler(bus: IMakaioBus): () => void;
883
+ //#endregion
884
+ //#region ui/hooks/src/pages/use-pages.d.ts
885
+ /**
886
+ * Page definition augmented with navigation action and active state.
887
+ *
888
+ * Returned by {@link usePages}. Guarantees both `execute` and `isActive`
889
+ * are always defined, unlike the base `PageDefinition` where `isActive`
890
+ * is optional.
891
+ *
892
+ * `isActive` is a plain boolean evaluated at render time. Consumers must
893
+ * not cache `ExecutablePage` objects across renders — re-read from the hook
894
+ * on each render to get the current active state.
895
+ */
896
+ interface ExecutablePage extends Omit<PageDefinition, 'isActive'> {
897
+ /** Execute the page's navigation action (open overlay or switch focus). */
898
+ execute: () => void;
899
+ /**
900
+ * Whether this page is currently active.
901
+ *
902
+ * Evaluated at render time from the current store state. Always defined.
903
+ * Re-read the hook on each render to observe changes.
904
+ */
905
+ isActive: boolean;
906
+ }
907
+ /**
908
+ * Convenience hook combining page definitions with navigation actions.
909
+ *
910
+ * Returns page definitions with an execute function for each:
911
+ * - Peek mode pages: execute opens the page overlay
912
+ * - Switch mode pages: execute changes the focus context (if focusContext is set)
913
+ *
914
+ * Used by sidebar, command palette, and other navigation UI to handle
915
+ * page activation consistently.
916
+ * @param options - Filter options (mode, level, group, includeHidden)
917
+ * @returns Pages with execute and isActive callbacks
918
+ * @example
919
+ * ```typescript
920
+ * function Sidebar() {
921
+ * const peekPages = usePages({ mode: 'peek' });
922
+ * const switchPages = usePages({ mode: 'switch' });
923
+ *
924
+ * return (
925
+ * <aside>
926
+ * <section>
927
+ * <h3>Navigate</h3>
928
+ * {switchPages.map(page => (
929
+ * <button key={page.id} onClick={page.execute}>
930
+ * {page.name}
931
+ * </button>
932
+ * ))}
933
+ * </section>
934
+ * <section>
935
+ * <h3>Quick Access</h3>
936
+ * {peekPages.map(page => (
937
+ * <button key={page.id} onClick={page.execute}>
938
+ * {page.name}
939
+ * </button>
940
+ * ))}
941
+ * </section>
942
+ * </aside>
943
+ * );
944
+ * }
945
+ * ```
946
+ */
947
+ declare function usePages(options?: PageDefinitionQueryOptions): ExecutablePage[];
948
+ //#endregion
949
+ //#region ui/hooks/src/navigation/group-pages.d.ts
950
+ /**
951
+ * Synthetic config created for navigation groups that appear in page data
952
+ * but have no entry in the provided `groupConfigs` array.
953
+ *
954
+ * Unlike {@link NavigationGroupConfig}, the `id` here is an arbitrary string
955
+ * because the group was not declared in the navigation group registry.
956
+ */
957
+ interface SyntheticGroupConfig {
958
+ /** Arbitrary string identifier from the page's `group` field */
959
+ id: string;
960
+ /** Label — falls back to the raw group id string */
961
+ label: string;
962
+ /** Sort order — unknown groups are appended at the end */
963
+ order: number;
964
+ }
965
+ /**
966
+ * A resolved group config is either a declared {@link NavigationGroupConfig}
967
+ * (known groups) or a {@link SyntheticGroupConfig} (unknown groups whose id
968
+ * does not appear in the provided configs).
969
+ */
970
+ type ResolvedGroupConfig = NavigationGroupConfig | SyntheticGroupConfig;
971
+ /**
972
+ * Grouped pages result.
973
+ */
974
+ interface GroupedPages {
975
+ /** Navigation group configuration (declared or synthetic) */
976
+ config: ResolvedGroupConfig;
977
+ /** Pages in this group */
978
+ pages: ExecutablePage[];
979
+ }
980
+ /**
981
+ * Group pages by NavigationGroup with config-driven ordering.
982
+ *
983
+ * Pages are organized by their `group` field. Pages without a group are excluded.
984
+ * Groups are ordered according to the provided configs. Unknown groups
985
+ * (groups not in configs) are appended at the end in the order they're encountered.
986
+ *
987
+ * Each group in the result includes its config and matching pages.
988
+ * Groups with no matching pages are still included (with empty pages array).
989
+ * @param pages - Pages to group
990
+ * @param groupConfigs - Navigation group configurations for ordering
991
+ * @returns Array of grouped pages, ordered by config
992
+ * @example
993
+ * ```typescript
994
+ * const pages = usePages();
995
+ * const grouped = groupPagesByNavigationGroup(pages, defaultNavigationGroups);
996
+ *
997
+ * grouped.forEach(({ config, pages }) => {
998
+ * console.log(`${config.label}:`, pages.map(p => p.name));
999
+ * });
1000
+ * // Navigate: ['Dashboard', 'Chat', 'Git']
1001
+ * // Quick Access: ['Settings', 'Projects', 'Sessions']
1002
+ * ```
1003
+ */
1004
+ declare function groupPagesByNavigationGroup(pages: ExecutablePage[], groupConfigs: ReadonlyArray<NavigationGroupConfig>): GroupedPages[];
1005
+ //#endregion
1006
+ //#region ui/hooks/src/pages/use-page-definitions.d.ts
1007
+ /**
1008
+ * Reactive hook for querying page definitions.
1009
+ *
1010
+ * Subscribes to registry changes and automatically updates when pages
1011
+ * are registered or unregistered. Returns filtered and sorted results
1012
+ * based on query options.
1013
+ * @param options - Filter by mode, level, group, or visibility
1014
+ * @returns Filtered, sorted page definitions
1015
+ * @example
1016
+ * ```typescript
1017
+ * function Sidebar() {
1018
+ * // Get all peek mode pages for Quick Access section
1019
+ * const peekPages = usePageDefinitions({ mode: 'peek' });
1020
+ *
1021
+ * // Get all switch mode pages for Navigate section
1022
+ * const switchPages = usePageDefinitions({ mode: 'switch' });
1023
+ *
1024
+ * return (
1025
+ * <aside>
1026
+ * <section>
1027
+ * <h3>Navigate</h3>
1028
+ * {switchPages.map(page => <SidebarItem key={page.id} page={page} />)}
1029
+ * </section>
1030
+ * <section>
1031
+ * <h3>Quick Access</h3>
1032
+ * {peekPages.map(page => <SidebarItem key={page.id} page={page} />)}
1033
+ * </section>
1034
+ * </aside>
1035
+ * );
1036
+ * }
1037
+ * ```
1038
+ */
1039
+ declare function usePageDefinitions(options?: PageDefinitionQueryOptions): PageDefinition[];
1040
+ //#endregion
1041
+ //#region ui/hooks/src/pages/use-window-id-pages.d.ts
1042
+ /**
1043
+ * Returns page definitions filtered by the current Electron window registration ID.
1044
+ *
1045
+ * Wraps {@link usePages} with an additional window ID filter derived from
1046
+ * {@link useWindowContext}. Pages that declare a `windowId` constraint are
1047
+ * only included when the constraint matches the current window. Pages without
1048
+ * a `windowId` constraint are always included.
1049
+ *
1050
+ * When no window ID is set (standalone browser), all pages pass through
1051
+ * unfiltered so the sidebar behaves identically to the pre-Electron behaviour.
1052
+ * @param options - Query options forwarded to {@link usePages} (mode, level, group, surface, includeHidden)
1053
+ * @returns Pages with execute and isActive callbacks, filtered for the current window
1054
+ * @example
1055
+ * ```typescript
1056
+ * function Sidebar() {
1057
+ * const level = useNavigationLevel();
1058
+ * const surface = window.__MAKAIO_MOBILE__ ? 'mobile' : 'web';
1059
+ * const pages = useWindowIdPages({ level, surface });
1060
+ *
1061
+ * // pages only contains entries valid for this Electron window
1062
+ * }
1063
+ * ```
1064
+ */
1065
+ declare function useWindowIdPages(options?: PageDefinitionQueryOptions): ExecutablePage[];
1066
+ //#endregion
1067
+ //#region ui/hooks/src/pages/use-page-component.d.ts
1068
+ /**
1069
+ * Resolve a lazy-loaded page component by ID.
1070
+ *
1071
+ * Returns the component wrapped in React.lazy() for Suspense support,
1072
+ * along with the full page definition for metadata access.
1073
+ *
1074
+ * Memoized per pageId to avoid re-creating lazy components on every render.
1075
+ * @param pageId - Page identifier, or `null` when no page is active.
1076
+ * A `null` value is treated the same as "not found" and returns `undefined`.
1077
+ * @param reloadKey - Optional key that forces React.lazy wrapper recreation
1078
+ * for retrying failed dynamic imports.
1079
+ * @returns Object with Component and definition, or undefined if not registered
1080
+ * or if pageId is null
1081
+ * @example
1082
+ * ```typescript
1083
+ * function PageOverlayView() {
1084
+ * const activePageId = usePageOverlayStore((s) => s.activePageId);
1085
+ * const resolved = usePageComponent(activePageId);
1086
+ *
1087
+ * if (!resolved) {
1088
+ * return null;
1089
+ * }
1090
+ *
1091
+ * const { Component, definition } = resolved;
1092
+ *
1093
+ * return (
1094
+ * <PageOverlay title={definition.name}>
1095
+ * <Suspense fallback={<LoadingSpinner />}>
1096
+ * <Component />
1097
+ * </Suspense>
1098
+ * </PageOverlay>
1099
+ * );
1100
+ * }
1101
+ * ```
1102
+ */
1103
+ declare function usePageComponent(pageId: string | null, reloadKey?: number): {
1104
+ Component: ComponentType<PageComponentProps>;
1105
+ definition: PageDefinition;
1106
+ } | undefined;
1107
+ //#endregion
1108
+ //#region ui/hooks/src/provider-config/selectors.d.ts
1109
+ /**
1110
+ * UI-facing provider-config summary enriched with provider definition metadata.
1111
+ */
1112
+ interface ProviderConfigSummaryView extends ProviderConfigFileRecord {
1113
+ /** Supported wire protocols derived from the backing provider definition. */
1114
+ supportedProtocols: ProtocolId[];
1115
+ }
1116
+ /**
1117
+ * UI-facing provider-config detail enriched with provider definition metadata.
1118
+ */
1119
+ interface ProviderConfigDetailView extends ProviderConfigSummaryView {
1120
+ /** Credential refs resolved through the runtime context seam. */
1121
+ credentialRefs?: Record<string, CredentialRef>;
1122
+ }
1123
+ /**
1124
+ * List provider-config summaries enriched for UI consumption.
1125
+ * @param bus - Bus used to load subsystem configs and provider definitions.
1126
+ * @param options - Optional list filter.
1127
+ * @returns Enriched provider-config summaries.
1128
+ */
1129
+ declare function listProviderConfigSummaryViews(bus: IMakaioBus, options?: {
1130
+ enabled?: boolean;
1131
+ }): Promise<ProviderConfigSummaryView[]>;
1132
+ /**
1133
+ * Load one provider-config detail view enriched for UI consumption.
1134
+ * @param bus - Bus used to load subsystem config, provider metadata, and runtime context.
1135
+ * @param id - Provider-config identifier.
1136
+ * @returns Enriched detail view or `null` when missing.
1137
+ */
1138
+ declare function getProviderConfigDetailView(bus: IMakaioBus, id: string): Promise<ProviderConfigDetailView | null>;
1139
+ //#endregion
1140
+ //#region ui/hooks/src/onboarding/scan-onboarding-adapters.d.ts
1141
+ /**
1142
+ * Client-grouped scan result for onboarding.
1143
+ *
1144
+ * One record is emitted per client. The `adapterNames` array lists all adapter
1145
+ * driver names belonging to that client so callers can enable them in bulk or
1146
+ * individually via {@link SettingsSubjects.adapter.setEnabled}.
1147
+ */
1148
+ interface OnboardingClient {
1149
+ /** Stable client identifier (e.g., 'claude-code'). */
1150
+ clientId: string;
1151
+ /** Human-readable display name (e.g., 'Claude Code'). */
1152
+ name: string;
1153
+ /** CLI binary name used for detection. */
1154
+ binary: string;
1155
+ /** Whether the CLI binary was detected on the system. */
1156
+ found: boolean;
1157
+ /** Detected CLI version, if found. */
1158
+ version?: string;
1159
+ /**
1160
+ * Warning message returned by the canonical client scan service.
1161
+ */
1162
+ warningMessage?: string;
1163
+ /**
1164
+ * Adapter driver names belonging to this client
1165
+ * (e.g., `['claude-agent-sdk', 'claude-code-cli']`).
1166
+ */
1167
+ adapterNames: string[];
1168
+ }
1169
+ /**
1170
+ * Enriched adapter metadata with canonical client scan results.
1171
+ *
1172
+ * One record is emitted per adapter (not per client). A single client binary
1173
+ * may map to multiple adapters (e.g., `claude` → `claude-agent-sdk` and
1174
+ * `claude-code-cli`), so the caller receives one row per adapter with the real
1175
+ * `adapterName` that the settings API understands.
1176
+ */
1177
+ interface OnboardingAdapter {
1178
+ /**
1179
+ * Real adapter driver name as registered with the settings API.
1180
+ * Used by AdaptersStep to call {@link SettingsSubjects.adapter.setEnabled}.
1181
+ */
1182
+ adapterName: string;
1183
+ /** Display name for UI */
1184
+ displayName: string;
1185
+ /** CLI binary name */
1186
+ binary: string;
1187
+ /** Whether CLI binary was detected */
1188
+ found: boolean;
1189
+ /** Detected version (if found) */
1190
+ version?: string;
1191
+ /**
1192
+ * Warning message returned by the canonical client scan service.
1193
+ */
1194
+ warningMessage?: string;
1195
+ }
1196
+ /**
1197
+ * Shared scan context built from bus data.
1198
+ *
1199
+ * Captures the resolved clients, adapter index, and canonical scan results so both
1200
+ * {@link scanOnboardingAdapters} and {@link scanOnboardingClients} can build
1201
+ * their respective output shapes from the same underlying data.
1202
+ */
1203
+ interface ScanContext {
1204
+ /** Enabled clients enriched with canonical scan results. */
1205
+ scannedClients: Array<{
1206
+ id: string;
1207
+ name: string;
1208
+ binary: string;
1209
+ found: boolean;
1210
+ version?: string;
1211
+ warningMessage?: string;
1212
+ }>;
1213
+ /** Adapter names indexed by clientId. */
1214
+ adaptersByClientId: Map<string, string[]>;
1215
+ }
1216
+ /**
1217
+ * Fetches clients and adapters from the bus, reuses `client.scan` for the
1218
+ * canonical scan result, and returns the shared context used by both public
1219
+ * scan functions.
1220
+ *
1221
+ * Returns `null` when there are no scannable clients (callers should return `[]`).
1222
+ * @returns Populated scan context, or null when no scannable clients exist
1223
+ */
1224
+ declare function buildScanContext(): Promise<ScanContext | null>;
1225
+ /**
1226
+ * Fetches all CLI-backed clients from the client storage bus, reuses the
1227
+ * canonical `client.scan` results, and returns enriched adapter records
1228
+ * including found/version/warningMessage data.
1229
+ *
1230
+ * This is a pure async function — it carries no React state. Scan results are
1231
+ * owned by the flow orchestrator ({@link OnboardingFlowState.scanAdapters}).
1232
+ *
1233
+ * Prefer {@link scanOnboarding} when both adapter and client results are needed
1234
+ * to avoid issuing duplicate bus requests.
1235
+ * @returns Enriched adapter list with canonical client scan results
1236
+ * @example
1237
+ * ```typescript
1238
+ * const adapters = await scanOnboardingAdapters();
1239
+ * ```
1240
+ */
1241
+ declare function scanOnboardingAdapters(): Promise<OnboardingAdapter[]>;
1242
+ /**
1243
+ * Scans for installed CLI-backed clients and returns client-grouped results.
1244
+ *
1245
+ * Unlike {@link scanOnboardingAdapters} which emits one row per adapter,
1246
+ * this function emits one row per client with an `adapterNames` array
1247
+ * listing all adapter driver names belonging to that client.
1248
+ *
1249
+ * Prefer {@link scanOnboarding} when both adapter and client results are needed
1250
+ * to avoid issuing duplicate bus requests.
1251
+ * @returns Client-grouped scan results
1252
+ */
1253
+ declare function scanOnboardingClients(): Promise<OnboardingClient[]>;
1254
+ /**
1255
+ * Run both adapter and client scans using a single shared scan context.
1256
+ *
1257
+ * Avoids duplicate bus requests that would occur when calling
1258
+ * {@link scanOnboardingAdapters} and {@link scanOnboardingClients} independently.
1259
+ * @returns Combined scan results for adapters and clients
1260
+ */
1261
+ declare function scanOnboarding(): Promise<{
1262
+ adapters: OnboardingAdapter[];
1263
+ clients: OnboardingClient[];
1264
+ }>;
1265
+ //#endregion
1266
+ //#region ui/hooks/src/onboarding/types.d.ts
1267
+ /**
1268
+ * Health check result for a single adapter.
1269
+ */
1270
+ interface HealthCheckResult {
1271
+ /** Whether the health check passed, is in progress, or failed. */
1272
+ status: 'pending' | 'success' | 'error';
1273
+ /** Human-readable message providing context for the status. */
1274
+ message?: string;
1275
+ /** Time taken to complete the check, in milliseconds. */
1276
+ durationMs?: number;
1277
+ }
1278
+ /**
1279
+ * Runtime state shared across all onboarding steps.
1280
+ *
1281
+ * Owned by the orchestrator and passed as controlled props to each step.
1282
+ * Treat as immutable inside step components — use {@link OnboardingFlowActions} to mutate.
1283
+ */
1284
+ interface OnboardingFlowState {
1285
+ /** Adapter list from the bus, refreshed after enable/load operations. */
1286
+ adapters: ReadonlyArray<AdapterInfo>;
1287
+ /** Adapter names the user has enabled during this flow. */
1288
+ enabledAdapterNames: ReadonlySet<string>;
1289
+ /** Health check results keyed by adapter name. */
1290
+ healthCheckResults: ReadonlyMap<string, HealthCheckResult>;
1291
+ /** Log import mode selections keyed by adapter name. */
1292
+ logImportSelections: ReadonlyMap<string, LogImportMode>;
1293
+ /** Default agent selection set during the preferences step. */
1294
+ defaultAgentSelection: AgentSelection | null;
1295
+ /** Full extension list from the coordinator, fetched on mount by the orchestrator. */
1296
+ extensions: ReadonlyArray<ExtensionInfo>;
1297
+ /** Per-plugin enabled toggle state, keyed by plugin name. */
1298
+ pluginEnabledStates: ReadonlyMap<string, boolean>;
1299
+ /** CLI adapter scan results, populated after {@link OnboardingFlowActions.scan} completes. */
1300
+ scanAdapters: ReadonlyArray<OnboardingAdapter>;
1301
+ /** Whether a CLI adapter scan is currently in progress. */
1302
+ isScanning: boolean;
1303
+ /** Error from the most recent {@link OnboardingFlowActions.scan} call, or null. */
1304
+ scanError: Error | null;
1305
+ /** Client-grouped scan results, populated after {@link OnboardingFlowActions.scan} completes. */
1306
+ scanClients: ReadonlyArray<OnboardingClient>;
1307
+ /** Client IDs selected by the user in step 2. */
1308
+ selectedClientIds: ReadonlySet<string>;
1309
+ /** Provider configs created during onboarding step 3. */
1310
+ providerConfigs: ReadonlyArray<ProviderConfigSummaryView>;
1311
+ /** Adapter-provider bindings created during onboarding step 4. */
1312
+ adapterProviderBindings: ReadonlyArray<BindingRecord>;
1313
+ }
1314
+ /**
1315
+ * Host/UI-facing provider-config draft accepted by onboarding actions.
1316
+ *
1317
+ * Host UI may collect plaintext credentials interactively before converting
1318
+ * them into stored credential refs through the host-owned create bridge.
1319
+ */
1320
+ interface OnboardingProviderConfigDraft {
1321
+ /** Provider definition identifier. */
1322
+ definitionId: string;
1323
+ /** Optional display name. */
1324
+ name?: string;
1325
+ /** Plaintext credentials captured by a host step. */
1326
+ credentials?: Record<string, string>;
1327
+ /** Pre-resolved credential refs for externally managed credentials. */
1328
+ credentialRefs?: Record<string, CredentialRef>;
1329
+ /** Optional endpoint overrides. */
1330
+ endpointOverrides?: ProtocolEndpoints;
1331
+ /** Optional per-model visibility overrides. */
1332
+ modelVisibility?: Record<string, ModelVisibility$1>;
1333
+ /** Optional default visibility mode. */
1334
+ modelFilterMode?: ModelFilterMode$1;
1335
+ }
1336
+ /**
1337
+ * Host-owned provider-config creator registered into the onboarding hook.
1338
+ *
1339
+ * This keeps plaintext credential capture on the host side while allowing
1340
+ * the framework-owned orchestrator to delegate provider creation through a
1341
+ * narrow inversion-of-control seam.
1342
+ */
1343
+ type OnboardingProviderConfigCreator = (bus: IMakaioBus, input: OnboardingProviderConfigDraft) => Promise<string>;
1344
+ /**
1345
+ * Explicit registration lifecycle for the onboarding create seam.
1346
+ */
1347
+ interface OnboardingProviderConfigRegistration {
1348
+ /**
1349
+ * Register the host-owned create bridge.
1350
+ * @param creator - Host-owned create bridge.
1351
+ * @returns Cleanup that unregisters this creator when still current.
1352
+ */
1353
+ registerCreateProviderConfig: (creator: OnboardingProviderConfigCreator) => () => void;
1354
+ /**
1355
+ * Unregister the current create bridge when it matches the provided creator.
1356
+ * @param creator - Host-owned create bridge.
1357
+ */
1358
+ unregisterCreateProviderConfig: (creator: OnboardingProviderConfigCreator) => void;
1359
+ }
1360
+ /**
1361
+ * Mutators for onboarding flow state, called by step components.
1362
+ *
1363
+ * All async methods resolve when the operation is complete.
1364
+ * Errors propagate as rejected promises — callers are responsible for handling them.
1365
+ */
1366
+ interface OnboardingFlowActions {
1367
+ /**
1368
+ * Enable an adapter by name.
1369
+ * @param adapterName - The adapter driver name to enable.
1370
+ */
1371
+ enableAdapter: (adapterName: string) => Promise<void>;
1372
+ /**
1373
+ * Disable an adapter by name.
1374
+ * @param adapterName - The adapter driver name to disable.
1375
+ */
1376
+ disableAdapter: (adapterName: string) => Promise<void>;
1377
+ /**
1378
+ * Run the health check for an adapter and record the result.
1379
+ * @param adapterName - The adapter driver name to check.
1380
+ * @returns The health check result.
1381
+ */
1382
+ runHealthCheck: (adapterName: string) => Promise<HealthCheckResult>;
1383
+ /**
1384
+ * Set the log import mode for an adapter.
1385
+ * @param adapterName - The adapter driver name.
1386
+ * @param mode - The import mode to apply.
1387
+ */
1388
+ setLogImportMode: (adapterName: string, mode: LogImportMode) => void;
1389
+ /**
1390
+ * Set or clear the default agent selection.
1391
+ * @param selection - The agent selection to persist, or null to clear.
1392
+ */
1393
+ setDefaultAgent: (selection: AgentSelection | null) => void;
1394
+ /**
1395
+ * Re-fetch the adapter list from the bus.
1396
+ */
1397
+ refreshAdapterList: () => Promise<void>;
1398
+ /**
1399
+ * Scan for installed CLI adapters and populate {@link OnboardingFlowState.scanAdapters}.
1400
+ * Sets {@link OnboardingFlowState.isScanning} during the operation.
1401
+ * Rejects with the scan error (also stored in {@link OnboardingFlowState.scanError}).
1402
+ */
1403
+ scan: () => Promise<void>;
1404
+ /**
1405
+ * Optimistically toggle a plugin's enabled state and persist the change.
1406
+ * Fire-and-forget: bus errors are logged but do not surface to the UI.
1407
+ * @param pluginName - The plugin name to toggle.
1408
+ * @param enabled - The new desired enabled state.
1409
+ */
1410
+ togglePlugin: (pluginName: string, enabled: boolean) => void;
1411
+ /**
1412
+ * Select a client in the clients step.
1413
+ * @param clientId - The client identifier to select.
1414
+ */
1415
+ selectClient: (clientId: string) => void;
1416
+ /**
1417
+ * Deselect a client in the clients step.
1418
+ * @param clientId - The client identifier to deselect.
1419
+ */
1420
+ deselectClient: (clientId: string) => void;
1421
+ /**
1422
+ * Create a provider config and add it to the onboarding state.
1423
+ * @param input - The provider config creation input.
1424
+ * @returns The ID of the created provider config.
1425
+ */
1426
+ createProviderConfig: (input: OnboardingProviderConfigDraft) => Promise<string>;
1427
+ /**
1428
+ * Delete a provider config created during onboarding.
1429
+ * @param id - The provider config ID to delete.
1430
+ */
1431
+ deleteProviderConfig: (id: string) => Promise<void>;
1432
+ /**
1433
+ * Bind a provider config to an adapter.
1434
+ * @param adapterName - The adapter name to bind to.
1435
+ * @param providerConfigId - The provider config to bind.
1436
+ */
1437
+ bindProvider: (adapterName: string, providerConfigId: string) => Promise<void>;
1438
+ /**
1439
+ * Unbind a provider config from an adapter.
1440
+ * @param adapterName - The adapter name to unbind from.
1441
+ * @param providerConfigId - The provider config to unbind.
1442
+ */
1443
+ unbindProvider: (adapterName: string, providerConfigId: string) => Promise<void>;
1444
+ /**
1445
+ * Set the default provider for an adapter.
1446
+ * @param adapterName - The adapter name.
1447
+ * @param providerConfigId - The provider config to make default.
1448
+ */
1449
+ setDefaultProvider: (adapterName: string, providerConfigId: string) => Promise<void>;
1450
+ /**
1451
+ * Refresh provider configs from the bus.
1452
+ */
1453
+ refreshProviderConfigs: () => Promise<void>;
1454
+ /**
1455
+ * Refresh adapter-provider bindings from the bus for a specific adapter.
1456
+ * @param adapterName - The adapter name to refresh bindings for.
1457
+ */
1458
+ refreshBindings: (adapterName: string) => Promise<void>;
1459
+ }
1460
+ /**
1461
+ * Concrete step props for the runtime onboarding flow.
1462
+ *
1463
+ * The kernel owns navigation-only step metadata; the hooks tier composes in
1464
+ * the live flow state and action surface that the orchestrator injects at
1465
+ * render time.
1466
+ */
1467
+ type OnboardingStepProps = OnboardingStepProps$1 & {
1468
+ /** Current snapshot of the shared flow state. */flowState: OnboardingFlowState; /** Mutators for flow state. */
1469
+ actions: OnboardingFlowActions;
1470
+ };
1471
+ /**
1472
+ * Concrete step definition for the runtime onboarding flow.
1473
+ *
1474
+ * This narrows the kernel step contract to the actual prop shape that host
1475
+ * and framework onboarding steps receive at runtime.
1476
+ */
1477
+ type OnboardingStepDefinition = Omit<OnboardingStepDefinition$1, 'component'> & {
1478
+ component: ComponentLike<OnboardingStepProps>;
1479
+ };
1480
+ /**
1481
+ * Options passed to {@link useOnboardingFlow}.
1482
+ */
1483
+ interface UseOnboardingFlowOptions {
1484
+ /** Adapter list, client list, and plugin list for condition evaluation. */
1485
+ context: OnboardingContext;
1486
+ /** Called when onboarding flow is completed. */
1487
+ onComplete: () => void;
1488
+ /** Called when onboarding flow is skipped. */
1489
+ onSkip: () => void;
1490
+ }
1491
+ /**
1492
+ * Return value of {@link useOnboardingFlow}.
1493
+ */
1494
+ interface UseOnboardingFlowResult {
1495
+ /** Currently active steps (filtered by conditions, frozen at mount). */
1496
+ activeSteps: ReadonlyArray<OnboardingStepDefinition>;
1497
+ /** Index of the current step. */
1498
+ currentStepIndex: number;
1499
+ /** The current step definition. */
1500
+ currentStep: OnboardingStepDefinition;
1501
+ /** Flow state shared across all steps. */
1502
+ flowState: OnboardingFlowState;
1503
+ /** Actions for step components to call. */
1504
+ actions: OnboardingFlowActions;
1505
+ /** Navigate to the next step. */
1506
+ goNext: () => void;
1507
+ /** Navigate to the previous step. */
1508
+ goBack: () => void;
1509
+ /** Persist accumulated selections and skip the remaining onboarding steps. */
1510
+ skip: () => Promise<void>;
1511
+ /** Persist flow selections and complete the flow (call only from the final step). */
1512
+ complete: () => Promise<void>;
1513
+ }
1514
+ /**
1515
+ * Framework-owned onboarding hook plus its explicit host registration seam.
1516
+ */
1517
+ type UseOnboardingFlowHook = ((options: UseOnboardingFlowOptions) => UseOnboardingFlowResult) & OnboardingProviderConfigRegistration;
1518
+ //#endregion
1519
+ //#region ui/hooks/src/onboarding/register-core-onboarding-steps.d.ts
1520
+ /**
1521
+ * Step components required for core onboarding registration.
1522
+ *
1523
+ * Pass lazy-loaded components from the views package to keep the framework
1524
+ * free of any direct view dependency:
1525
+ * @example
1526
+ * ```tsx
1527
+ * import { lazy } from 'react';
1528
+ *
1529
+ * const cleanup = registerCoreOnboardingSteps({
1530
+ * WelcomeStep: lazy(() => import('../OnboardingView/steps/WelcomeStep')),
1531
+ * ClientsStep: lazy(() => import('../OnboardingView/steps/ClientsStep')),
1532
+ * ProvidersStep: lazy(() => import('../OnboardingView/steps/ProvidersStep')),
1533
+ * AdaptersStep: lazy(() => import('../OnboardingView/steps/AdaptersStep')),
1534
+ * PreferencesStep: lazy(() => import('../OnboardingView/steps/PreferencesStep')),
1535
+ * PluginsStep: lazy(() => import('../OnboardingView/steps/PluginsStep')),
1536
+ * DoneStep: lazy(() => import('../OnboardingView/steps/DoneStep')),
1537
+ * });
1538
+ * ```
1539
+ */
1540
+ interface CoreOnboardingStepComponents {
1541
+ /** Welcome step component (always shown, order 10). */
1542
+ WelcomeStep: ComponentLike<OnboardingStepProps>;
1543
+ /** Clients selection step component (always shown, order 20). */
1544
+ ClientsStep: ComponentLike<OnboardingStepProps>;
1545
+ /** Provider config step component (always shown, order 25). */
1546
+ ProvidersStep: ComponentLike<OnboardingStepProps>;
1547
+ /** Tools (adapters) setup step component (always shown, order 30). */
1548
+ AdaptersStep: ComponentLike<OnboardingStepProps>;
1549
+ /** Preferences step component (always shown after adapters, order 35). */
1550
+ PreferencesStep: ComponentLike<OnboardingStepProps>;
1551
+ /** Plugins step component (shown when extensions are discovered, order 40). */
1552
+ PluginsStep: ComponentLike<OnboardingStepProps>;
1553
+ /** Final confirmation step component (always shown, order 50). */
1554
+ DoneStep: ComponentLike<OnboardingStepProps>;
1555
+ }
1556
+ /**
1557
+ * Register the seven core onboarding steps.
1558
+ *
1559
+ * Each step is assigned an order value in the range 10–50, leaving 100+ for
1560
+ * plugin-provided steps. Preferences is always included because adapter
1561
+ * enablement is mutable flow state; the Plugins step is conditioned on
1562
+ * extensions being discovered.
1563
+ * @param components - Step components injected from the views package
1564
+ * @returns Cleanup function that unregisters all core steps when called
1565
+ * @example
1566
+ * ```tsx
1567
+ * useEffect(() => {
1568
+ * const cleanup = registerCoreOnboardingSteps({
1569
+ * WelcomeStep: lazy(() => import('../OnboardingView/steps/WelcomeStep')),
1570
+ * ClientsStep: lazy(() => import('../OnboardingView/steps/ClientsStep')),
1571
+ * ProvidersStep: lazy(() => import('../OnboardingView/steps/ProvidersStep')),
1572
+ * AdaptersStep: lazy(() => import('../OnboardingView/steps/AdaptersStep')),
1573
+ * PreferencesStep: lazy(() => import('../OnboardingView/steps/PreferencesStep')),
1574
+ * PluginsStep: lazy(() => import('../OnboardingView/steps/PluginsStep')),
1575
+ * DoneStep: lazy(() => import('../OnboardingView/steps/DoneStep')),
1576
+ * });
1577
+ * return cleanup;
1578
+ * }, []);
1579
+ * ```
1580
+ */
1581
+ declare function registerCoreOnboardingSteps(components: CoreOnboardingStepComponents): () => void;
1582
+ //#endregion
1583
+ //#region ui/hooks/src/onboarding/skip-flag.d.ts
1584
+ /**
1585
+ * Shared onboarding skip-flag helpers.
1586
+ *
1587
+ * Centralizes localStorage access so the first-run gate and onboarding flow
1588
+ * completion use the same persistence contract.
1589
+ * @packageDocumentation
1590
+ */
1591
+ /**
1592
+ * Read the persisted onboarding skip flag.
1593
+ * Storage failures are treated as "not skipped".
1594
+ * @returns True when onboarding has been skipped in this browser profile
1595
+ */
1596
+ declare function getOnboardingSkipped(): boolean;
1597
+ /**
1598
+ * Persist the onboarding skip flag.
1599
+ * Storage failures are intentionally ignored so callers can still continue.
1600
+ */
1601
+ declare function setOnboardingSkipped(): void;
1602
+ /**
1603
+ * Clear the onboarding skip flag.
1604
+ * Storage failures are intentionally ignored so callers can still continue.
1605
+ */
1606
+ declare function clearOnboardingSkipped(): void;
1607
+ /**
1608
+ * Check whether onboarding has been completed.
1609
+ * @returns True when the completed flag is set in localStorage
1610
+ */
1611
+ declare function getOnboardingCompleted(): boolean;
1612
+ /** Mark onboarding as completed persistently. */
1613
+ declare function setOnboardingCompleted(): void;
1614
+ /** Clear the onboarding completed flag. */
1615
+ declare function clearOnboardingCompleted(): void;
1616
+ //#endregion
1617
+ //#region ui/hooks/src/onboarding/use-onboarding-flow.d.ts
1618
+ declare const useOnboardingFlow: UseOnboardingFlowHook;
1619
+ //#endregion
1620
+ //#region ui/hooks/src/onboarding/plugin-persistence.d.ts
1621
+ interface PersistPluginEnabledResult {
1622
+ id: string;
1623
+ }
1624
+ /**
1625
+ * Persisted extension config entry cached in a ref to preserve config blobs
1626
+ * across enabled-state toggles without driving re-renders.
1627
+ */
1628
+ interface PersistedExtensionConfigEntry {
1629
+ /** Stable storage row identifier */
1630
+ id: string;
1631
+ /** Existing extension config payload that must be preserved across enabled toggles */
1632
+ config: Record<string, unknown> | undefined;
1633
+ }
1634
+ /**
1635
+ * Persist only the enabled state for a plugin config row.
1636
+ *
1637
+ * This uses the storage layer's atomic `setEnabled` RPC instead of
1638
+ * reconstructing a partial `set` payload client-side. Cached config blobs stay
1639
+ * available in-memory for future full writes, but enabled toggles no longer
1640
+ * need to round-trip or risk clearing them.
1641
+ * @param pluginName - Registry name of the plugin
1642
+ * @param enabled - Desired enabled state
1643
+ * @param cache - Ref map of persisted config entries
1644
+ * @param bus - Bus instance used to dispatch the set request
1645
+ * @returns Persisted row identifier for the extension config record
1646
+ */
1647
+ declare function persistPluginEnabled(pluginName: string, enabled: boolean, cache: Map<string, PersistedExtensionConfigEntry>, bus: IMakaioBus): Promise<PersistPluginEnabledResult>;
1648
+ //#endregion
1649
+ //#region ui/hooks/src/state/app-context-store.d.ts
1650
+ interface AppContextState {
1651
+ /** Default agent selection for new windows (null = use system default) */
1652
+ defaultSelection: AgentSelection | null;
1653
+ /** Set the default selection for new windows */
1654
+ setDefaultSelection: (selection: AgentSelection | null) => void;
1655
+ }
1656
+ /**
1657
+ * Cross-tab application context store.
1658
+ *
1659
+ * Use this for user-level defaults that should:
1660
+ * - Persist across browser sessions
1661
+ * - Apply to newly opened windows/tabs
1662
+ * - Be overridable per-window via useSelectionStore
1663
+ * @example
1664
+ * ```tsx
1665
+ * const { defaultSelection, setDefaultSelection } = useAppContext();
1666
+ *
1667
+ * // Update default for new windows
1668
+ * setDefaultSelection({ kind: 'adapter', adapterName: 'claude-code', model: 'opus' });
1669
+ * ```
1670
+ */
1671
+ declare const useAppContext: UseBoundStore<Omit<StoreApi<AppContextState>, "setState" | "persist"> & {
1672
+ setState(partial: AppContextState | Partial<AppContextState> | ((state: AppContextState) => AppContextState | Partial<AppContextState>), replace?: false | undefined): unknown;
1673
+ setState(state: AppContextState | ((state: AppContextState) => AppContextState), replace: true): unknown;
1674
+ persist: {
1675
+ setOptions: (options: Partial<PersistOptions<AppContextState, Partial<AppContextState>, unknown>>) => void;
1676
+ clearStorage: () => void;
1677
+ rehydrate: () => Promise<void> | void;
1678
+ hasHydrated: () => boolean;
1679
+ onHydrate: (fn: (state: AppContextState) => void) => () => void;
1680
+ onFinishHydration: (fn: (state: AppContextState) => void) => () => void;
1681
+ getOptions: () => Partial<PersistOptions<AppContextState, Partial<AppContextState>, unknown>>;
1682
+ };
1683
+ }>;
1684
+ //#endregion
1685
+ //#region ui/hooks/src/state/provider-store.d.ts
1686
+ /**
1687
+ * An adapter that is bound to a provider config.
1688
+ *
1689
+ * Used by the model picker to emit model×adapter combinations. The
1690
+ * `displayLabel` resolves to the adapter's human-readable display name.
1691
+ */
1692
+ interface BoundAdapter {
1693
+ /** Stable adapter driver name (e.g., `'claude-code'`, `'openai-node'`). */
1694
+ adapterName: string;
1695
+ /**
1696
+ * Human-readable label for display in picker UI.
1697
+ * Sourced from the canonical adapter config's `displayName`, falling back to
1698
+ * the stable adapter `name` when the display label is absent.
1699
+ */
1700
+ displayLabel: string;
1701
+ }
1702
+ /**
1703
+ * Runtime information about a configured provider instance.
1704
+ *
1705
+ * Each entry corresponds to one canonical provider-config record and carries
1706
+ * the model catalog sourced from the linked provider definition.
1707
+ */
1708
+ interface ProviderInfo {
1709
+ /**
1710
+ * Provider config UUID — stable identifier for this configuration instance.
1711
+ * Corresponds to `providerConfigId` in {@link AgentSelection}.
1712
+ */
1713
+ providerConfigId: string;
1714
+ /** FK to providers.id — links this config to the provider definition. */
1715
+ definitionId: string;
1716
+ /** Display name for UI, as configured by the user. */
1717
+ name: string;
1718
+ /** Available models sourced from the provider definition catalog. */
1719
+ availableModels: AIModel[];
1720
+ /** Whether this is the default config for its provider definition. */
1721
+ isDefault: boolean;
1722
+ /** Whether this config is enabled. */
1723
+ enabled: boolean;
1724
+ /** Controls default visibility for models without explicit overrides. */
1725
+ modelFilterMode: ModelFilterMode;
1726
+ /** True when at least one credential key exists in storage. */
1727
+ hasCredentials: boolean;
1728
+ /** Sparse per-model visibility overrides. */
1729
+ modelVisibility?: Record<string, ModelVisibility>;
1730
+ /**
1731
+ * Adapters currently bound to this provider config.
1732
+ *
1733
+ * Used by the model picker to enumerate model×adapter combinations for
1734
+ * selection. Empty when no adapters are bound.
1735
+ */
1736
+ boundAdapters: BoundAdapter[];
1737
+ }
1738
+ interface ProviderState {
1739
+ /** All available providers across all definitions */
1740
+ providers: ProviderInfo[];
1741
+ /** Loading state */
1742
+ isLoading: boolean;
1743
+ /** Error state */
1744
+ error: Error | null;
1745
+ /** Fetch in progress (for deduplication) */
1746
+ _fetchPromise: Promise<void> | null;
1747
+ /**
1748
+ * Whether providers have been fetched at least once.
1749
+ * Used to gate the stale-cache guard so `invalidate()` can force a refresh.
1750
+ */
1751
+ _hasFetched: boolean;
1752
+ /**
1753
+ * Monotonically increasing counter incremented on every `invalidate()` call.
1754
+ * In-flight fetches compare their captured generation against the current
1755
+ * value on completion — if they differ, the results are discarded so a
1756
+ * subsequent `fetchProviders()` can start a fresh fetch.
1757
+ */
1758
+ _fetchGeneration: number;
1759
+ /**
1760
+ * Fetch providers from all enabled provider configs. Idempotent — concurrent
1761
+ * calls share the same promise. No-ops when already fetched unless
1762
+ * `invalidate()` has been called first.
1763
+ */
1764
+ fetchProviders: () => Promise<void>;
1765
+ /**
1766
+ * Mark the provider list as stale so the next `fetchProviders()` call
1767
+ * triggers a real refetch. Call this after creating, updating, or deleting
1768
+ * a provider config.
1769
+ */
1770
+ invalidate: () => void;
1771
+ /** Set providers */
1772
+ setProviders: (providers: ProviderInfo[]) => void;
1773
+ /** Set error state */
1774
+ setError: (error: Error | null) => void;
1775
+ }
1776
+ declare const useProviderStore: UseBoundStore<StoreApi<ProviderState>>;
1777
+ //#endregion
1778
+ //#region ui/hooks/src/utils/persisted-agent-selection.d.ts
1779
+ type PersistableAdapterSelection = Extract<AgentSelection, {
1780
+ kind: 'adapter';
1781
+ }> & {
1782
+ providerConfigId: string;
1783
+ model: string;
1784
+ };
1785
+ type PersistableProjectSelection = Exclude<AgentSelection, {
1786
+ kind: 'adapter';
1787
+ }> | PersistableAdapterSelection;
1788
+ /**
1789
+ * Parse persisted browser selection state into the current AgentSelection union.
1790
+ *
1791
+ * The wire schema intentionally stays open for host-tier extension. Browser
1792
+ * persistence is stricter: only current application kinds are accepted, with
1793
+ * one-way migration for legacy `'model'` and `'virtualModel'` payloads.
1794
+ * @param value - Raw persisted value from storage/preferences
1795
+ * @returns Current AgentSelection, or null when the payload is stale/invalid
1796
+ */
1797
+ declare function parsePersistedAgentSelection(value: unknown): AgentSelection | null;
1798
+ /**
1799
+ * Project defaults must be concrete and lossless when persisted.
1800
+ * @param selection - Candidate selection from UI state
1801
+ * @returns True when the selection can be stored as an explicit project default
1802
+ */
1803
+ declare function isPersistableProjectSelection(selection: AgentSelection): selection is PersistableProjectSelection;
1804
+ //#endregion
1805
+ export { type AppContextState, type BoundAdapter, BusContext, BusProvider, type BusProviderProps, type CoreOnboardingStepComponents, type ExecutablePage, type ExtensionBrowserLoadOptions, type ExtensionBrowserLoadResult, type FocusContextId, type FocusContextLayout, type FocusContextObject, type FocusContextWidgetSize, type FocusState, type GroupedPages, type HealthCheckResult, type OnboardingAdapter, type OnboardingClient, type OnboardingFlowActions, type OnboardingFlowState, type OnboardingStepDefinition, type OnboardingStepProps, type PageOverlayState, type PersistableAdapterSelection, type PersistableProjectSelection, type PersistedExtensionConfigEntry, type PersistedStoreConfig, type PlacedFocusWidget, type ProviderConfigDetailView, type ProviderConfigSummaryView, type ProviderInfo, type RuntimeNavigationLevel, type ScanContext, type SharedLoaderState, type SidebarState, type StorageType, type UseOnboardingFlowOptions, type UseOnboardingFlowResult, type UseWidgetConfigOptions, type UseWidgetConfigResult, type UseWidgetRegistryOptions, type UseWidgetsOptions, type UseWidgetsResult, type WindowContextState, addWidgetToFocusLayout, buildScanContext, clearOnboardingCompleted, clearOnboardingSkipped, createEmptyFocusContextLayout, createPersistedStore, getOnboardingCompleted, getOnboardingSkipped, getProviderConfigDetailView, groupPagesByNavigationGroup, isPersistableProjectSelection, listProviderConfigSummaryViews, loadExtensionBrowserContributions, noopStorage, parsePersistedAgentSelection, persistPluginEnabled, registerCoreOnboardingSteps, registerNavigationHandler, removeWidgetFromFocusLayout, scanOnboarding, scanOnboardingAdapters, scanOnboardingClients, setOnboardingCompleted, setOnboardingSkipped, updateFocusContextWidgetPosition, updateFocusContextWidgetSize, useAppContext, useBus, useFocusStore, useNavigationLevel, useOnboardingFlow, useOptionalBus, usePageComponent, usePageDefinitions, usePageOverlayStore, usePages, useProviderStore, useSidebarStore, useTrayLayout, useWidgetConfig, useWidgetLayout, useWidgetLayoutActions, useWidgetRegistry, useWidgets, useWindowContext, useWindowIdPages };