@makaio/framework 1.0.0-dev-1781022866275 → 1.0.0-dev-1781023871421

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 (456) hide show
  1. package/dist/.makaio-build.json +5 -0
  2. package/dist/account-identity-DT5NOtFi.mjs +1 -0
  3. package/dist/adapter-C1eI-fGV.mjs +1 -0
  4. package/dist/adapters/acp-client/index.d.mts +6208 -0
  5. package/dist/adapters/acp-client/index.mjs +3 -0
  6. package/dist/adapters/config/index.d.mts +429 -0
  7. package/dist/adapters/config/index.mjs +1 -0
  8. package/dist/adapters/index.d.mts +4202 -0
  9. package/dist/adapters/index.mjs +18 -0
  10. package/dist/adapters/node.d.mts +263 -0
  11. package/dist/adapters/node.mjs +4 -0
  12. package/dist/adapters/stream-session/index.d.mts +1414 -0
  13. package/dist/adapters/stream-session/index.mjs +1 -0
  14. package/dist/adapters/stream-session/testing/index.d.mts +29 -0
  15. package/dist/adapters/stream-session/testing/index.mjs +1 -0
  16. package/dist/artifact-B3npq1cy.mjs +1 -0
  17. package/dist/base-orchestrator-wyumsn3b.d.mts +772 -0
  18. package/dist/bus/index.d.mts +3994 -0
  19. package/dist/bus/index.mjs +1 -0
  20. package/dist/bus-Caz3Jpbc.mjs +1 -0
  21. package/dist/bus-Hb-LGzgb.mjs +2 -0
  22. package/dist/capability-service-CJbmhfv9.mjs +1 -0
  23. package/dist/chunk-DTipWd-i.mjs +1 -0
  24. package/dist/chunk-cpUYaJdV.mjs +1 -0
  25. package/dist/cleanEnvForAdapter-KkYzQa1f.mjs +1 -0
  26. package/dist/client-bx74gm4R.mjs +1 -0
  27. package/dist/clients/index.d.mts +2639 -0
  28. package/dist/clients/index.mjs +2 -0
  29. package/dist/clients-namespace-GmSJpBUV.d.mts +332 -0
  30. package/dist/config-namespace-CPY9YsR8.d.mts +638 -0
  31. package/dist/config-namespace-ncYg2ct_.mjs +1 -0
  32. package/dist/contracts/adapter/index.d.mts +3 -0
  33. package/dist/contracts/adapter/index.mjs +1 -0
  34. package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
  35. package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
  36. package/dist/contracts/artifact/index.d.mts +2 -0
  37. package/dist/contracts/artifact/index.mjs +1 -0
  38. package/dist/contracts/client/index.d.mts +3 -0
  39. package/dist/contracts/client/index.mjs +1 -0
  40. package/dist/contracts/common/index.d.mts +2 -0
  41. package/dist/contracts/common/index.mjs +1 -0
  42. package/dist/contracts/config/index.d.mts +455 -0
  43. package/dist/contracts/config/index.mjs +1 -0
  44. package/dist/contracts/extension/index.d.mts +4 -0
  45. package/dist/contracts/extension/index.mjs +1 -0
  46. package/dist/contracts/facet/index.d.mts +2 -0
  47. package/dist/contracts/facet/index.mjs +1 -0
  48. package/dist/contracts/harness/index.d.mts +2 -0
  49. package/dist/contracts/harness/index.mjs +1 -0
  50. package/dist/contracts/host/index.d.mts +2 -0
  51. package/dist/contracts/host/index.mjs +1 -0
  52. package/dist/contracts/index.d.mts +23046 -0
  53. package/dist/contracts/index.mjs +1 -0
  54. package/dist/contracts/materialization/index.d.mts +4 -0
  55. package/dist/contracts/materialization/index.mjs +1 -0
  56. package/dist/contracts/model-registry/index.d.mts +2 -0
  57. package/dist/contracts/model-registry/index.mjs +1 -0
  58. package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
  59. package/dist/contracts/native-session-supervisor/index.mjs +1 -0
  60. package/dist/contracts/platform/index.d.mts +2 -0
  61. package/dist/contracts/platform/index.mjs +1 -0
  62. package/dist/contracts/provider/index.d.mts +3 -0
  63. package/dist/contracts/provider/index.mjs +1 -0
  64. package/dist/contracts/session/index.d.mts +3 -0
  65. package/dist/contracts/session/index.mjs +1 -0
  66. package/dist/contracts/shared/index.d.mts +2 -0
  67. package/dist/contracts/shared/index.mjs +1 -0
  68. package/dist/contracts/skill/index.d.mts +2 -0
  69. package/dist/contracts/skill/index.mjs +1 -0
  70. package/dist/contracts/telemetry/index.d.mts +2 -0
  71. package/dist/contracts/telemetry/index.mjs +1 -0
  72. package/dist/contracts/timeout/index.d.mts +2 -0
  73. package/dist/contracts/timeout/index.mjs +1 -0
  74. package/dist/contracts/toast/index.d.mts +198 -0
  75. package/dist/contracts/toast/index.mjs +1 -0
  76. package/dist/contracts/variant/index.d.mts +2 -0
  77. package/dist/contracts/variant/index.mjs +1 -0
  78. package/dist/core/index.d.mts +1263 -0
  79. package/dist/core/index.mjs +1 -0
  80. package/dist/credential-ref-YWQQENEo.mjs +1 -0
  81. package/dist/cursor-storage-CtVJ3JzB.mjs +1 -0
  82. package/dist/definition-BLCdXGzh.d.mts +383 -0
  83. package/dist/definition-CrgHIpTK.d.mts +60 -0
  84. package/dist/definition-DZMXOnjX.mjs +1 -0
  85. package/dist/definition-pkJ6szUl.d.mts +158 -0
  86. package/dist/drizzle-Eq8W1EbD.mjs +1 -0
  87. package/dist/event-Ca2yUf5i.mjs +1 -0
  88. package/dist/execution-target-CRPTfZlc.mjs +1 -0
  89. package/dist/extension-C-4BHMRI.mjs +1 -0
  90. package/dist/extension-CpIUgBKI.mjs +1 -0
  91. package/dist/extension-namespace-cMh_mMiL.mjs +1 -0
  92. package/dist/facet-BuwhrThl.mjs +1 -0
  93. package/dist/filesystem-service-B8rhBRgB.mjs +1 -0
  94. package/dist/filesystem-service-p_iJVHd4.d.mts +66 -0
  95. package/dist/git/index.d.mts +210 -0
  96. package/dist/git/index.mjs +18 -0
  97. package/dist/globby-rtWVaFHv.mjs +41 -0
  98. package/dist/handlers-CkTsQLra.mjs +41 -0
  99. package/dist/harness-BRCMcvQN.mjs +1 -0
  100. package/dist/hooks/index.d.mts +423 -0
  101. package/dist/hooks/index.mjs +1 -0
  102. package/dist/host-Br9VuOyr.mjs +1 -0
  103. package/dist/identity-Cz2IeEtm.mjs +1 -0
  104. package/dist/index-472sOmsW.d.mts +218 -0
  105. package/dist/index-8SZkg7s6.d.mts +353 -0
  106. package/dist/index-B3PK4FIn.d.mts +5116 -0
  107. package/dist/index-B80L4YqA.d.mts +180 -0
  108. package/dist/index-BFg9BUpx.d.mts +355 -0
  109. package/dist/index-BGfWS6GE.d.mts +483 -0
  110. package/dist/index-BVgfS-AJ.d.mts +109 -0
  111. package/dist/index-B_zQC98V.d.mts +995 -0
  112. package/dist/index-Bh_Ne7LF.d.mts +1008 -0
  113. package/dist/index-Bvb2mMH6.d.mts +1730 -0
  114. package/dist/index-CCGVh9BF2.d.mts +749 -0
  115. package/dist/index-CGmcS0Ma.d.mts +412 -0
  116. package/dist/index-CHQ1SqT0.d.mts +117 -0
  117. package/dist/index-CLpjm52M.d.mts +183 -0
  118. package/dist/index-Caig6TeF.d.mts +6746 -0
  119. package/dist/index-CelJCBjk.d.mts +2992 -0
  120. package/dist/index-ChunCFu4.d.mts +11 -0
  121. package/dist/index-Cm0dUkWL.d.mts +4651 -0
  122. package/dist/index-CokQYGVP.d.mts +184 -0
  123. package/dist/index-Cs0kZXIz2.d.mts +37 -0
  124. package/dist/index-D5d5HeWI2.d.mts +259 -0
  125. package/dist/index-D90OmGmV.d.mts +389 -0
  126. package/dist/index-D9MwJ2Q8.d.mts +67 -0
  127. package/dist/index-DANINzMu.d.mts +40 -0
  128. package/dist/index-DBw-89vC2.d.mts +3640 -0
  129. package/dist/index-DGBu6bHi2.d.mts +438 -0
  130. package/dist/index-DKC62dY5.d.mts +146 -0
  131. package/dist/index-DKia0MX1.d.mts +43 -0
  132. package/dist/index-DMKnON5s.d.mts +28 -0
  133. package/dist/index-DUaw0Dw8.d.mts +14747 -0
  134. package/dist/index-De3kPhlN.d.mts +72 -0
  135. package/dist/index-L4GjJDKb.d.mts +822 -0
  136. package/dist/index-U-A8eyGT.d.mts +1490 -0
  137. package/dist/index-eemAKwsB.d.mts +362 -0
  138. package/dist/index-mNec7V-9.d.mts +1075 -0
  139. package/dist/index-soFznFCy2.d.mts +89 -0
  140. package/dist/index-vtXJuwrz.d.mts +40 -0
  141. package/dist/index-x_lVDp_J.d.mts +134 -0
  142. package/dist/json-value-CmhSGMLv.mjs +1 -0
  143. package/dist/kernel/cli/index.d.mts +143 -0
  144. package/dist/kernel/cli/index.mjs +1 -0
  145. package/dist/kernel/cli/schemas.d.mts +64 -0
  146. package/dist/kernel/cli/schemas.mjs +1 -0
  147. package/dist/kernel/extension/index.d.mts +2 -0
  148. package/dist/kernel/extension/index.mjs +1 -0
  149. package/dist/kernel/index.d.mts +296 -0
  150. package/dist/kernel/index.mjs +1 -0
  151. package/dist/kernel/namespace/index.d.mts +2 -0
  152. package/dist/kernel/namespace/index.mjs +1 -0
  153. package/dist/kernel/observability/index.d.mts +2 -0
  154. package/dist/kernel/observability/index.mjs +1 -0
  155. package/dist/kernel/providers/index.d.mts +2 -0
  156. package/dist/kernel/providers/index.mjs +1 -0
  157. package/dist/kernel/window/index.d.mts +2 -0
  158. package/dist/kernel/window/index.mjs +1 -0
  159. package/dist/materialization-CuUBu4XI.mjs +1 -0
  160. package/dist/model-registry-CfXytvzx.mjs +1 -0
  161. package/dist/model-registry-Scn_MC2d.mjs +1 -0
  162. package/dist/namespace-5QQqbF-B.d.mts +3133 -0
  163. package/dist/namespace-BM7Djng9.d.mts +189 -0
  164. package/dist/namespace-BoD94mrN.mjs +1 -0
  165. package/dist/namespace-BwzZJqTV.mjs +1 -0
  166. package/dist/namespace-CFLAmQfh.mjs +1 -0
  167. package/dist/namespace-CTm3nEvh.d.mts +51 -0
  168. package/dist/namespace-CaaNnKcR.d.mts +921 -0
  169. package/dist/namespace-CaoZ3S78.d.mts +43 -0
  170. package/dist/namespace-CxhsoFUP.d.mts +607 -0
  171. package/dist/namespace-DD8Oiqo7.d.mts +580 -0
  172. package/dist/namespace-DLovh2Ws.d.mts +1313 -0
  173. package/dist/namespace-DgqkaOVu.d.mts +768 -0
  174. package/dist/namespace-DkRgbZYn.mjs +1 -0
  175. package/dist/namespace-Dr8K0MCp.d.mts +2047 -0
  176. package/dist/namespace-DuXK5AYN.mjs +1 -0
  177. package/dist/namespace-EQniz-Aw.d.mts +142 -0
  178. package/dist/namespace-IV1QK__V.d.mts +159 -0
  179. package/dist/namespace-LViZ-EQk.mjs +1 -0
  180. package/dist/namespace-TyiTsLFv.d.mts +3020 -0
  181. package/dist/namespace-Yna5-Pws.mjs +1 -0
  182. package/dist/namespace-xcmbQlxh.mjs +1 -0
  183. package/dist/native-session-supervisor-B1TnaPUF.mjs +1 -0
  184. package/dist/node/bus-server/index.d.mts +178 -0
  185. package/dist/node/bus-server/index.mjs +1 -0
  186. package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
  187. package/dist/node/bus-server/server-lifecycle.mjs +1 -0
  188. package/dist/node/machine-identity/index.d.mts +85 -0
  189. package/dist/node/machine-identity/index.mjs +3 -0
  190. package/dist/node/transports/index.d.mts +1945 -0
  191. package/dist/node/transports/index.mjs +2 -0
  192. package/dist/orchestrator-shared-CIDiFJMD.mjs +1 -0
  193. package/dist/orchestrator-shared-Dfa7FMyw.d.mts +249 -0
  194. package/dist/package-DKVlsMP3.mjs +1 -0
  195. package/dist/platform-DZ7z-wXD.mjs +1 -0
  196. package/dist/profile-6ynCD5k3.mjs +1 -0
  197. package/dist/provider-context-CK6B4X_8.mjs +1 -0
  198. package/dist/providers/index.d.mts +135 -0
  199. package/dist/providers/index.mjs +1 -0
  200. package/dist/providers-namespace-DSEpli4A.d.mts +583 -0
  201. package/dist/providers-u8i15co9.mjs +1 -0
  202. package/dist/schema-CoyE6mPt.mjs +1 -0
  203. package/dist/schema-M5YTvSAG.d.mts +949 -0
  204. package/dist/schema-e0wU_lcV.mjs +1 -0
  205. package/dist/schema-introspection-Dn1jWQs1.mjs +1 -0
  206. package/dist/schemas-Bd0OjRQf.d.mts +46 -0
  207. package/dist/schemas-C46QfKzv.d.mts +459 -0
  208. package/dist/schemas-CDBSjg7o.d.mts +237 -0
  209. package/dist/schemas-CR1Rripy.mjs +1 -0
  210. package/dist/schemas-CVvwIfG4.mjs +1 -0
  211. package/dist/schemas-CaLhkkLn.mjs +1 -0
  212. package/dist/schemas-ClOOT1W6.d.mts +174 -0
  213. package/dist/schemas-DATniTHb.d.mts +182 -0
  214. package/dist/schemas-DE-GNmSD.mjs +1 -0
  215. package/dist/schemas-DVF1A4DF.d.mts +160 -0
  216. package/dist/schemas-DaRSfYLf.d.mts +73 -0
  217. package/dist/schemas-DiYVzG6e.d.mts +315 -0
  218. package/dist/schemas-hSrzflwZ.mjs +1 -0
  219. package/dist/schemas-j7ivZ2HI.d.mts +944 -0
  220. package/dist/schemas-jFe1AuI-.mjs +1 -0
  221. package/dist/schemas-wg_6PAdV.d.mts +153 -0
  222. package/dist/scoped-bus-04pwo1uM.mjs +1 -0
  223. package/dist/server-lifecycle-FXTPW39-.mjs +1 -0
  224. package/dist/server-lifecycle-YoSGFGnU.d.mts +160 -0
  225. package/dist/service-base/index.d.mts +98 -0
  226. package/dist/service-base/index.mjs +1 -0
  227. package/dist/services/adapter-runtime/index.d.mts +4 -0
  228. package/dist/services/adapter-runtime/index.mjs +1 -0
  229. package/dist/services/adapter-runtime/namespace.d.mts +2 -0
  230. package/dist/services/adapter-runtime/namespace.mjs +1 -0
  231. package/dist/services/adapter-runtime/schemas.d.mts +2 -0
  232. package/dist/services/adapter-runtime/schemas.mjs +1 -0
  233. package/dist/services/adapter-subsystem/index.d.mts +3 -0
  234. package/dist/services/adapter-subsystem/index.mjs +1 -0
  235. package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
  236. package/dist/services/adapter-subsystem/namespace.mjs +1 -0
  237. package/dist/services/agent-runtime/index.d.mts +3 -0
  238. package/dist/services/agent-runtime/index.mjs +1 -0
  239. package/dist/services/agent-runtime/namespace.d.mts +2 -0
  240. package/dist/services/agent-runtime/namespace.mjs +1 -0
  241. package/dist/services/agent-runtime/schemas.d.mts +2 -0
  242. package/dist/services/agent-runtime/schemas.mjs +1 -0
  243. package/dist/services/capability/index.d.mts +2 -0
  244. package/dist/services/capability/index.mjs +1 -0
  245. package/dist/services/cli-detection/namespace.d.mts +56 -0
  246. package/dist/services/cli-detection/namespace.mjs +1 -0
  247. package/dist/services/codebase/index.d.mts +3 -0
  248. package/dist/services/codebase/index.mjs +1 -0
  249. package/dist/services/codebase/namespace.d.mts +2 -0
  250. package/dist/services/codebase/namespace.mjs +1 -0
  251. package/dist/services/codebase/schemas.d.mts +2 -0
  252. package/dist/services/codebase/schemas.mjs +1 -0
  253. package/dist/services/compression/index.d.mts +3 -0
  254. package/dist/services/compression/index.mjs +1 -0
  255. package/dist/services/compression/namespace.d.mts +2 -0
  256. package/dist/services/compression/namespace.mjs +1 -0
  257. package/dist/services/compression/schemas.d.mts +2 -0
  258. package/dist/services/compression/schemas.mjs +1 -0
  259. package/dist/services/context-rules/index.d.mts +412 -0
  260. package/dist/services/context-rules/index.mjs +1 -0
  261. package/dist/services/credential-change/index.d.mts +17 -0
  262. package/dist/services/credential-change/index.mjs +1 -0
  263. package/dist/services/definition/index.d.mts +2 -0
  264. package/dist/services/definition/index.mjs +1 -0
  265. package/dist/services/definition/namespace.d.mts +71 -0
  266. package/dist/services/definition/namespace.mjs +1 -0
  267. package/dist/services/definition/schemas.d.mts +38 -0
  268. package/dist/services/definition/schemas.mjs +1 -0
  269. package/dist/services/dialog/namespace.d.mts +105 -0
  270. package/dist/services/dialog/namespace.mjs +1 -0
  271. package/dist/services/dialog/schemas.d.mts +109 -0
  272. package/dist/services/dialog/schemas.mjs +1 -0
  273. package/dist/services/execution-target/index.d.mts +4 -0
  274. package/dist/services/execution-target/index.mjs +1 -0
  275. package/dist/services/execution-target/namespace.d.mts +2 -0
  276. package/dist/services/execution-target/namespace.mjs +1 -0
  277. package/dist/services/execution-target/schemas.d.mts +2 -0
  278. package/dist/services/execution-target/schemas.mjs +1 -0
  279. package/dist/services/filesystem/index.d.mts +3 -0
  280. package/dist/services/filesystem/index.mjs +1 -0
  281. package/dist/services/filesystem/namespace.d.mts +432 -0
  282. package/dist/services/filesystem/namespace.mjs +1 -0
  283. package/dist/services/filesystem/schemas.d.mts +240 -0
  284. package/dist/services/filesystem/schemas.mjs +1 -0
  285. package/dist/services/git/namespace.d.mts +1163 -0
  286. package/dist/services/git/namespace.mjs +1 -0
  287. package/dist/services/git/schemas.d.mts +932 -0
  288. package/dist/services/git/schemas.mjs +1 -0
  289. package/dist/services/harness/index.d.mts +861 -0
  290. package/dist/services/harness/index.mjs +1 -0
  291. package/dist/services/harness/storage/schema.d.mts +424 -0
  292. package/dist/services/harness/storage/schema.mjs +1 -0
  293. package/dist/services/index.d.mts +6185 -0
  294. package/dist/services/index.mjs +1 -0
  295. package/dist/services/local-notification/index.d.mts +25 -0
  296. package/dist/services/local-notification/index.mjs +1 -0
  297. package/dist/services/local-notification/namespace.d.mts +73 -0
  298. package/dist/services/local-notification/namespace.mjs +1 -0
  299. package/dist/services/local-notification/schemas.d.mts +88 -0
  300. package/dist/services/local-notification/schemas.mjs +1 -0
  301. package/dist/services/log-import/browser.d.mts +3 -0
  302. package/dist/services/log-import/browser.mjs +1 -0
  303. package/dist/services/log-import/index.d.mts +274 -0
  304. package/dist/services/log-import/index.mjs +2 -0
  305. package/dist/services/log-import/log-import.d.mts +3 -0
  306. package/dist/services/log-import/log-import.mjs +1 -0
  307. package/dist/services/log-import/namespace.d.mts +327 -0
  308. package/dist/services/log-import/namespace.mjs +1 -0
  309. package/dist/services/log-import/schemas.d.mts +217 -0
  310. package/dist/services/log-import/schemas.mjs +1 -0
  311. package/dist/services/model-registry/index.d.mts +2 -0
  312. package/dist/services/model-registry/index.mjs +1 -0
  313. package/dist/services/preferences/index.d.mts +3 -0
  314. package/dist/services/preferences/index.mjs +1 -0
  315. package/dist/services/preferences/schemas.d.mts +2 -0
  316. package/dist/services/preferences/schemas.mjs +1 -0
  317. package/dist/services/preferences/storage-namespace.d.mts +3 -0
  318. package/dist/services/preferences/storage-namespace.mjs +1 -0
  319. package/dist/services/provider-context/index.d.mts +2 -0
  320. package/dist/services/provider-context/index.mjs +1 -0
  321. package/dist/services/provider-runtime/index.d.mts +136 -0
  322. package/dist/services/provider-runtime/index.mjs +1 -0
  323. package/dist/services/session/handlers/index.d.mts +2 -0
  324. package/dist/services/session/handlers/index.mjs +1 -0
  325. package/dist/services/session/index.d.mts +10 -0
  326. package/dist/services/session/index.mjs +1 -0
  327. package/dist/services/session/messages/namespace.d.mts +2 -0
  328. package/dist/services/session/messages/namespace.mjs +1 -0
  329. package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
  330. package/dist/services/session/orchestrator-testing/index.mjs +1 -0
  331. package/dist/services/session/session-events/namespace.d.mts +2 -0
  332. package/dist/services/session/session-events/namespace.mjs +1 -0
  333. package/dist/services/session/storage/namespace.d.mts +2 -0
  334. package/dist/services/session/storage/namespace.mjs +1 -0
  335. package/dist/services/session/storage/schema.d.mts +2 -0
  336. package/dist/services/session/storage/schema.mjs +1 -0
  337. package/dist/services/session/testing/index.d.mts +35 -0
  338. package/dist/services/session/testing/index.mjs +65 -0
  339. package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
  340. package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
  341. package/dist/services/session/turns/namespace.d.mts +2 -0
  342. package/dist/services/session/turns/namespace.mjs +1 -0
  343. package/dist/services/session-editor/index.d.mts +119 -0
  344. package/dist/services/session-editor/index.mjs +1 -0
  345. package/dist/services/settings/index.d.mts +47 -0
  346. package/dist/services/settings/index.mjs +1 -0
  347. package/dist/services/settings/namespace.d.mts +663 -0
  348. package/dist/services/settings/namespace.mjs +1 -0
  349. package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
  350. package/dist/services/settings/storage/clients-namespace.mjs +1 -0
  351. package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
  352. package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
  353. package/dist/services/settings/storage/index.d.mts +4 -0
  354. package/dist/services/settings/storage/index.mjs +1 -0
  355. package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
  356. package/dist/services/settings/storage/providers-namespace.mjs +1 -0
  357. package/dist/services/subagent/index.d.mts +2 -0
  358. package/dist/services/subagent/index.mjs +1 -0
  359. package/dist/services/subagent-template/index.d.mts +3 -0
  360. package/dist/services/subagent-template/index.mjs +1 -0
  361. package/dist/services/subagent-template/namespace.d.mts +2 -0
  362. package/dist/services/subagent-template/namespace.mjs +1 -0
  363. package/dist/services/subagent-template/schemas.d.mts +2 -0
  364. package/dist/services/subagent-template/schemas.mjs +1 -0
  365. package/dist/services/tool-approval/index.d.mts +2 -0
  366. package/dist/services/tool-approval/index.mjs +1 -0
  367. package/dist/services/tools/index.d.mts +2 -0
  368. package/dist/services/tools/index.mjs +1 -0
  369. package/dist/services/tray-menu/index.d.mts +4 -0
  370. package/dist/services/tray-menu/index.mjs +1 -0
  371. package/dist/services/tray-menu/namespace.d.mts +2 -0
  372. package/dist/services/tray-menu/namespace.mjs +1 -0
  373. package/dist/services/tray-menu/schemas.d.mts +2 -0
  374. package/dist/services/tray-menu/schemas.mjs +1 -0
  375. package/dist/services/turn/index.d.mts +2 -0
  376. package/dist/services/turn/index.mjs +1 -0
  377. package/dist/services/turn/namespace.d.mts +2 -0
  378. package/dist/services/turn/namespace.mjs +1 -0
  379. package/dist/services/turn/schemas.d.mts +335 -0
  380. package/dist/services/turn/schemas.mjs +1 -0
  381. package/dist/session-BoldSdNZ2.mjs +134 -0
  382. package/dist/session-DuVOYctZ.mjs +1 -0
  383. package/dist/session-lineage-CRsc9g1x.d.mts +65 -0
  384. package/dist/shared-DpOEfD8F.mjs +1 -0
  385. package/dist/shared-schemas-CPShiLNp.mjs +1 -0
  386. package/dist/skill-CQO4mDqK.mjs +1 -0
  387. package/dist/storage/drizzle/client.d.mts +78 -0
  388. package/dist/storage/drizzle/client.mjs +1 -0
  389. package/dist/storage/drizzle/index.d.mts +137 -0
  390. package/dist/storage/drizzle/index.mjs +1 -0
  391. package/dist/storage/handlers/drizzle/index.d.mts +2 -0
  392. package/dist/storage/handlers/drizzle/index.mjs +1 -0
  393. package/dist/storage/handlers/index.d.mts +33 -0
  394. package/dist/storage/handlers/index.mjs +1 -0
  395. package/dist/storage/index.d.mts +192 -0
  396. package/dist/storage/index.mjs +1 -0
  397. package/dist/storage-namespace-BXkoh5Sy.d.mts +221 -0
  398. package/dist/storage-namespace-DWsYLAXa.mjs +1 -0
  399. package/dist/storage-namespace-definition-Bkx5rSto.d.mts +17 -0
  400. package/dist/storage-namespace-definition-CqSdsuCC.mjs +1 -0
  401. package/dist/style.css +3782 -0
  402. package/dist/telemetry-CvdLBWuk.mjs +1 -0
  403. package/dist/testing/drizzle-harness.d.mts +130 -0
  404. package/dist/testing/drizzle-harness.mjs +1 -0
  405. package/dist/testing/index.d.mts +106 -0
  406. package/dist/testing/index.mjs +1 -0
  407. package/dist/timeout-XsYIOKrc.mjs +1 -0
  408. package/dist/tool-approval-service-BvZWhYZp.mjs +1 -0
  409. package/dist/tools/index.d.mts +835 -0
  410. package/dist/tools/index.mjs +1 -0
  411. package/dist/tools/testing/index.d.mts +53 -0
  412. package/dist/tools/testing/index.mjs +1 -0
  413. package/dist/tools-D-luYcDw.mjs +1431 -0
  414. package/dist/tray-menu-service-DuXq5k22.mjs +1 -0
  415. package/dist/types-BCMUtBj1.d.mts +1106 -0
  416. package/dist/types-C2Ob9zz_.d.mts +128 -0
  417. package/dist/types-CCdqjeuH.d.mts +262 -0
  418. package/dist/types-DZHvOc_Q.d.mts +305 -0
  419. package/dist/types-Dy3YTcTF.d.mts +6777 -0
  420. package/dist/types-MfJZ67e9.d.mts +315 -0
  421. package/dist/types-dyP-bXXE.d.mts +31 -0
  422. package/dist/ui-components/index.d.mts +2342 -0
  423. package/dist/ui-components/index.mjs +8 -0
  424. package/dist/ui-config-9bDRwFZr.mjs +1 -0
  425. package/dist/ui-hooks/index.d.mts +1915 -0
  426. package/dist/ui-hooks/index.mjs +1 -0
  427. package/dist/ui-kernel/index.d.mts +2793 -0
  428. package/dist/ui-kernel/index.mjs +1 -0
  429. package/dist/ui-kernel/pages/namespace.d.mts +88 -0
  430. package/dist/ui-kernel/pages/namespace.mjs +1 -0
  431. package/dist/ui-kernel/pages/schemas.d.mts +2 -0
  432. package/dist/ui-kernel/pages/schemas.mjs +1 -0
  433. package/dist/ui-views/index.d.mts +487 -0
  434. package/dist/ui-views/index.mjs +30 -0
  435. package/dist/utils/health-probe.d.mts +26 -0
  436. package/dist/utils/health-probe.mjs +1 -0
  437. package/dist/utils/index.d.mts +262 -0
  438. package/dist/utils/index.mjs +2 -0
  439. package/dist/utils/keychain.d.mts +31 -0
  440. package/dist/utils/keychain.mjs +1 -0
  441. package/dist/utils/project-manifest.d.mts +130 -0
  442. package/dist/utils/project-manifest.mjs +1 -0
  443. package/dist/utils/resolve-package-root.d.mts +12 -0
  444. package/dist/utils/resolve-package-root.mjs +1 -0
  445. package/dist/utils/scope-paths.d.mts +33 -0
  446. package/dist/utils/scope-paths.mjs +1 -0
  447. package/dist/utils/workspace-packages.d.mts +59 -0
  448. package/dist/utils/workspace-packages.mjs +1 -0
  449. package/dist/utils/workspace-root.d.mts +24 -0
  450. package/dist/utils/workspace-root.mjs +2 -0
  451. package/dist/variant-CT6XBP6T.mjs +1 -0
  452. package/dist/version-BeT3ASEe.mjs +1 -0
  453. package/dist/visibility-Cb62p9bv.mjs +1 -0
  454. package/dist/window-registry-CBcrGTv4.d.mts +130 -0
  455. package/dist/window-registry-DW-dKRjQ.mjs +1 -0
  456. package/package.json +1 -1
@@ -0,0 +1,4651 @@
1
+ import { F as ArtifactLifecycleHookRegistration$1, P as ArtifactLifecycleHookEvent, T as AnyArtifactKindDefinition, mt as ArtifactRevision$1 } from "./index-B3PK4FIn.mjs";
2
+ import { A as VersionRange, O as VersionLiteral$1, r as ClientDefinition$1 } from "./definition-BLCdXGzh.mjs";
3
+ import { o as ProviderDefinitionInput$1, r as ProtocolId$1 } from "./definition-pkJ6szUl.mjs";
4
+ import { t as RequiredTimeoutConfig } from "./index-DMKnON5s.mjs";
5
+ import { B as SESSION_EVENT_TYPES, i as MakaioSessionEvent$1, p as SessionMessage$1 } from "./types-Dy3YTcTF.mjs";
6
+ import { D as EntityUIConfig, I as FormFieldProps, Q as JsonValue$1 } from "./index-L4GjJDKb.mjs";
7
+ import { l as FacetNamespaceDefinition } from "./index-8SZkg7s6.mjs";
8
+ import { t as SurfaceBindingDefinition } from "./definition-CrgHIpTK.mjs";
9
+ import { z } from "zod";
10
+ import { MakaioBusLike, PayloadFilter, RegistrableBusNamespaceDefinition, SubjectSchema } from "@makaio/framework/core";
11
+ import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
12
+ import { Toolset } from "@makaio/framework/tools";
13
+ import { ComponentType } from "react";
14
+
15
+ //#region core/contracts/src/extension/browser-entrypoint.d.ts
16
+ /**
17
+ * Browser entrypoint metadata declared by a package manifest.
18
+ *
19
+ * The renderer uses this URL path to load a package's browser bundle.
20
+ */
21
+ declare const BrowserEntrypointSchema$1: z.ZodObject<{
22
+ entrypoint: z.ZodString;
23
+ }, z.core.$strip>;
24
+ /** Inferred type for browser entrypoint manifest metadata. */
25
+ type BrowserEntrypoint = z.infer<typeof BrowserEntrypointSchema$1>;
26
+ //#endregion
27
+ //#region core/contracts/src/extension/contribution-manifest.d.ts
28
+ /**
29
+ * Protocol-specific configuration for an adapter contribution.
30
+ *
31
+ * Currently supports endpoint overrides and acts as a seam for additional
32
+ * protocol-level settings such as auth overrides or timeout policies.
33
+ */
34
+ interface ProtocolConfig {
35
+ /** Optional custom endpoint URL overriding the protocol default. */
36
+ readonly endpoint?: string;
37
+ }
38
+ /** Zod schema for {@link ProtocolConfig}. */
39
+ declare const ProtocolConfigSchema: z.ZodObject<{
40
+ endpoint: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ /**
43
+ * Reference to a supported wire protocol, with optional per-protocol config.
44
+ *
45
+ * - **Simple string** — use the protocol with default settings: `'anthropic'`.
46
+ * - **Config object** — declare one or more protocols with overrides:
47
+ * `{ anthropic: { endpoint: 'https://custom.host/v1' } }`.
48
+ *
49
+ * Both forms are valid in the `protocols` array on {@link AdapterManifest}.
50
+ * @example Simple form
51
+ * ```json
52
+ * "protocols": ["anthropic", "openai"]
53
+ * ```
54
+ * @example Config form
55
+ * ```json
56
+ * "protocols": [{ "anthropic": { "endpoint": "https://custom.host/v1" } }]
57
+ * ```
58
+ */
59
+ type ProtocolRef = ProtocolId$1 | { readonly [K in ProtocolId$1]?: ProtocolConfig };
60
+ /** Zod schema for {@link ProtocolRef}. */
61
+ declare const ProtocolRefSchema: z.ZodUnion<readonly [z.ZodEnum<{
62
+ anthropic: "anthropic";
63
+ openai: "openai";
64
+ }>, z.ZodObject<{
65
+ anthropic: z.ZodOptional<z.ZodObject<{
66
+ endpoint: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>>;
68
+ openai: z.ZodOptional<z.ZodObject<{
69
+ endpoint: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>]>;
72
+ /**
73
+ * Reference from an adapter to a client package it depends on.
74
+ *
75
+ * The `version` field follows npm/package.json semver range syntax so the
76
+ * executable adapter contribution can verify compatibility against the
77
+ * installed client (npm package) version. The optional `binaryVersion` field
78
+ * constrains the version of the shipped binary separately — useful when the
79
+ * npm package version and the embedded binary version diverge.
80
+ * @example `{ id: 'claude-code', version: '^1.5.0' }`
81
+ * @example `{ id: 'claude-code', version: '^1.5.0', binaryVersion: '>=1.0.0 <1.2.0' }`
82
+ */
83
+ interface AdapterClientRef$1 {
84
+ /** Stable client identifier matching {@link ClientManifest.id}. */
85
+ readonly id: string;
86
+ /**
87
+ * Semver range the adapter is compatible with for the npm package version.
88
+ *
89
+ * Uses the same syntax as `package.json` dependency fields
90
+ * (e.g., `'^1.5.0'`, `'>=2.0.0'`, `'*'`).
91
+ */
92
+ readonly version: VersionRange;
93
+ /**
94
+ * Optional semver range constraining the binary version separately from the
95
+ * npm package version. The adapter subsystem evaluates this field at
96
+ * activation time by resolving the active client binary.
97
+ *
98
+ * Omit when the binary version is assumed to match the npm package version.
99
+ */
100
+ readonly binaryVersion?: VersionRange;
101
+ }
102
+ /** Zod schema for {@link AdapterClientRef}. */
103
+ declare const AdapterClientRefSchema: z.ZodObject<{
104
+ id: z.ZodString;
105
+ version: z.ZodString;
106
+ binaryVersion: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>;
108
+ /**
109
+ * Describes an adapter contributed by an extension.
110
+ *
111
+ * Serializable metadata for discovery, filtering, and inspection. The
112
+ * executable runtime source is `MakaioExtension.adapters[].manifest`, paired
113
+ * with its adapter definition; descriptor-level contributions do not register
114
+ * adapters by themselves.
115
+ *
116
+ * The `protocols` field is required because an adapter must declare at least
117
+ * which wire protocol(s) it implements; all other fields are optional metadata.
118
+ */
119
+ interface AdapterManifest {
120
+ /**
121
+ * Stable machine identifier for this adapter contribution (e.g., `'claude-code'`).
122
+ *
123
+ * Used as the key in adapter registries. Must be unique within the declaring
124
+ * extension.
125
+ */
126
+ readonly name: string;
127
+ /** Human-readable display name shown in the UI (e.g., `'Claude Code'`). */
128
+ readonly displayName?: string;
129
+ /** Short description of what this adapter does. */
130
+ readonly description?: string;
131
+ /**
132
+ * Client packages this adapter depends on.
133
+ *
134
+ * Each entry declares a required client by ID and semver range. Executable
135
+ * adapter processors verify that referenced clients are installed and
136
+ * compatible before activating the adapter.
137
+ */
138
+ readonly clients?: readonly AdapterClientRef$1[];
139
+ /**
140
+ * Wire protocol(s) this adapter implements.
141
+ *
142
+ * At least one entry is required. Each entry is either a plain
143
+ * {@link ProtocolId} string or a {@link ProtocolRef} config object with
144
+ * per-protocol overrides.
145
+ */
146
+ readonly protocols: readonly ProtocolRef[];
147
+ /**
148
+ * Identifier of the provider this adapter defaults to.
149
+ *
150
+ * When omitted, the runtime or user selects the provider. Must reference a
151
+ * registered provider definition `id`.
152
+ */
153
+ readonly defaultProvider?: string;
154
+ }
155
+ /** Zod schema for {@link AdapterManifest}. */
156
+ declare const AdapterManifestSchema: z.ZodObject<{
157
+ name: z.ZodString;
158
+ displayName: z.ZodOptional<z.ZodString>;
159
+ description: z.ZodOptional<z.ZodString>;
160
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
161
+ id: z.ZodString;
162
+ version: z.ZodString;
163
+ binaryVersion: z.ZodOptional<z.ZodString>;
164
+ }, z.core.$strip>>>>;
165
+ protocols: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
166
+ anthropic: "anthropic";
167
+ openai: "openai";
168
+ }>, z.ZodObject<{
169
+ anthropic: z.ZodOptional<z.ZodObject<{
170
+ endpoint: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strip>>;
172
+ openai: z.ZodOptional<z.ZodObject<{
173
+ endpoint: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>>;
175
+ }, z.core.$strip>]>>>;
176
+ defaultProvider: z.ZodOptional<z.ZodString>;
177
+ }, z.core.$strip>;
178
+ /**
179
+ * Describes a client binary contributed by an extension.
180
+ *
181
+ * A "client" is a standalone executable (e.g., the Claude Code CLI) that an
182
+ * adapter delegates work to. This manifest is discovery-time metadata;
183
+ * executable `MakaioExtension.clients` definitions are the runtime source for
184
+ * locating, verifying, and managing the binary lifecycle.
185
+ */
186
+ interface ClientManifest {
187
+ /**
188
+ * Stable machine identifier for this client (e.g., `'claude-code'`).
189
+ *
190
+ * Must be unique within the declaring extension. Referenced by
191
+ * {@link AdapterClientRef.id} to express adapter-to-client dependencies.
192
+ */
193
+ readonly id: string;
194
+ /** Human-readable display name (e.g., `'Claude Code'`). */
195
+ readonly name: string;
196
+ /** Short description of what this client binary does. */
197
+ readonly description?: string;
198
+ /**
199
+ * Binary identity for this client.
200
+ *
201
+ * When present, carries the executable name used for PATH detection.
202
+ * When `managed` is `true`, `version` is also required and records the
203
+ * exact binary version the framework should install and activate.
204
+ * @example Unmanaged binary
205
+ * ```ts
206
+ * { name: 'claude' }
207
+ * ```
208
+ * @example Managed binary with pinned version
209
+ * ```ts
210
+ * { name: 'claude', managed: true, version: '2.1.143' }
211
+ * ```
212
+ */
213
+ readonly binary?: {
214
+ readonly name: string; /** Whether the framework manages the installation of this binary. */
215
+ readonly managed?: boolean;
216
+ /**
217
+ * Exact semver version of the binary to install and activate.
218
+ * Required when `managed` is `true`.
219
+ */
220
+ readonly version?: VersionLiteral$1;
221
+ };
222
+ }
223
+ /** Zod schema for {@link ClientManifest}. */
224
+ declare const ClientManifestSchema: z.ZodObject<{
225
+ id: z.ZodString;
226
+ name: z.ZodString;
227
+ description: z.ZodOptional<z.ZodString>;
228
+ binary: z.ZodOptional<z.ZodObject<{
229
+ name: z.ZodString;
230
+ managed: z.ZodOptional<z.ZodBoolean>;
231
+ version: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strict>>;
233
+ }, z.core.$strict>;
234
+ /**
235
+ * Describes a model provider contributed by an extension.
236
+ *
237
+ * A "provider" is an inference backend (e.g., Anthropic, OpenAI, Z.AI) that
238
+ * adapters use to route model requests. This manifest is discovery-time
239
+ * metadata; executable `MakaioExtension.providers` definitions are the
240
+ * runtime source for credential resolution and model catalog registration.
241
+ * @example
242
+ * ```json
243
+ * { "id": "anthropic", "name": "Anthropic", "description": "Official Anthropic API" }
244
+ * ```
245
+ */
246
+ interface ProviderManifest {
247
+ /**
248
+ * Stable machine identifier for this provider (e.g., `'anthropic'`).
249
+ *
250
+ * Must be unique within the declaring extension. Used as the primary key
251
+ * in provider registries and referenced by
252
+ * {@link AdapterManifest.defaultProvider}.
253
+ */
254
+ readonly id: string;
255
+ /** Human-readable display name (e.g., `'Anthropic'`). */
256
+ readonly name: string;
257
+ /** Short description of this provider. */
258
+ readonly description?: string;
259
+ }
260
+ /** Zod schema for {@link ProviderManifest}. */
261
+ declare const ProviderManifestSchema: z.ZodObject<{
262
+ id: z.ZodString;
263
+ name: z.ZodString;
264
+ description: z.ZodOptional<z.ZodString>;
265
+ }, z.core.$strip>;
266
+ /**
267
+ * Pipeline stage a hash trigger participates in.
268
+ *
269
+ * Mirrors {@link HashTriggerStage} from the runtime contribution types.
270
+ * Kept as a local type alias so this manifest module remains self-contained.
271
+ */
272
+ type TriggerStage = 'gather' | 'transform' | 'action';
273
+ /**
274
+ * Describes a hash trigger contributed by an extension.
275
+ *
276
+ * Serializable metadata for discovery and introspection. The executable
277
+ * runtime source is `MakaioExtension.triggers.createTriggers()`; descriptor
278
+ * contributions are not a registration fallback.
279
+ */
280
+ interface TriggerManifest {
281
+ /**
282
+ * Prefix token this trigger responds to (e.g., `'loop'`, `'file'`).
283
+ *
284
+ * Must be unique within the declaring extension. Used by the hash trigger
285
+ * service to route `#prefix:argument` directives.
286
+ */
287
+ readonly prefix: string;
288
+ /** Human-readable description of what this trigger does. */
289
+ readonly description?: string;
290
+ /**
291
+ * Pipeline stage this trigger participates in.
292
+ *
293
+ * Defaults to `'action'` when omitted.
294
+ */
295
+ readonly stage?: TriggerStage;
296
+ }
297
+ /** Zod schema for {@link TriggerManifest}. */
298
+ declare const TriggerManifestSchema: z.ZodObject<{
299
+ prefix: z.ZodString;
300
+ description: z.ZodOptional<z.ZodString>;
301
+ stage: z.ZodOptional<z.ZodEnum<{
302
+ transform: "transform";
303
+ action: "action";
304
+ gather: "gather";
305
+ }>>;
306
+ }, z.core.$strip>;
307
+ /**
308
+ * Describes a log importer contributed by an extension.
309
+ *
310
+ * Serializable metadata for discovery, filtering, and inspection. The
311
+ * executable runtime source is `MakaioExtension.logImport`; descriptor
312
+ * contributions are not a registration fallback.
313
+ */
314
+ interface LogImporterManifest {
315
+ /**
316
+ * Adapter name used for attribution (e.g., `'plugin:opencode'`).
317
+ *
318
+ * Must be unique within the declaring extension.
319
+ */
320
+ readonly adapterName: string;
321
+ /** Human-readable display name (e.g., `'OpenCode'`). */
322
+ readonly displayName: string;
323
+ /**
324
+ * Glob pattern matching importable log files.
325
+ *
326
+ * Discovery tooling can use this pattern to filter file system entries
327
+ * without loading the extension code.
328
+ * @example `'** /storage/session/* /*.json'`
329
+ */
330
+ readonly logFilePattern?: string;
331
+ }
332
+ /** Zod schema for {@link LogImporterManifest}. */
333
+ declare const LogImporterManifestSchema: z.ZodObject<{
334
+ adapterName: z.ZodString;
335
+ displayName: z.ZodString;
336
+ logFilePattern: z.ZodOptional<z.ZodString>;
337
+ }, z.core.$strip>;
338
+ /**
339
+ * Describes a session event action contributed by an extension.
340
+ *
341
+ * Serializable metadata for discovery and introspection. The executable
342
+ * runtime source is `MakaioExtension.sessionEventActions.createActions()`;
343
+ * descriptor contributions are not a registration fallback.
344
+ */
345
+ interface SessionEventActionManifest {
346
+ /**
347
+ * Unique action identifier within the declaring extension
348
+ * (e.g., `'pin-message:pin'`).
349
+ */
350
+ readonly id: string;
351
+ /** Display label shown in action menus. */
352
+ readonly label: string;
353
+ /** Optional human-readable description. */
354
+ readonly description?: string;
355
+ /** Optional icon identifier. */
356
+ readonly icon?: string;
357
+ /**
358
+ * Whether the action operates on a single event or multiple events.
359
+ *
360
+ * - `'single'` — immediate execution from a kebab menu.
361
+ * - `'multi'` — opens a picker modal for multi-event selection.
362
+ */
363
+ readonly selectionMode: 'single' | 'multi';
364
+ /**
365
+ * Message roles the action applies to.
366
+ *
367
+ * Maps to the `entrypoint.messageRole` field on the runtime action options.
368
+ */
369
+ readonly messageRoles?: readonly ('user' | 'assistant')[];
370
+ }
371
+ /** Zod schema for {@link SessionEventActionManifest}. */
372
+ declare const SessionEventActionManifestSchema: z.ZodObject<{
373
+ id: z.ZodString;
374
+ label: z.ZodString;
375
+ description: z.ZodOptional<z.ZodString>;
376
+ icon: z.ZodOptional<z.ZodString>;
377
+ selectionMode: z.ZodEnum<{
378
+ single: "single";
379
+ multi: "multi";
380
+ }>;
381
+ messageRoles: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
382
+ user: "user";
383
+ assistant: "assistant";
384
+ }>>>>;
385
+ }, z.core.$strip>;
386
+ /** Zod schema for {@link ArtifactLifecycleHookEvent}. */
387
+ declare const ArtifactLifecycleHookEventSchema: z.ZodEnum<{
388
+ beforeCreate: "beforeCreate";
389
+ beforeRevise: "beforeRevise";
390
+ afterCreate: "afterCreate";
391
+ afterRevise: "afterRevise";
392
+ afterStatusChanged: "afterStatusChanged";
393
+ afterObservationAdded: "afterObservationAdded";
394
+ }>;
395
+ /**
396
+ * Describes a single artifact lifecycle hook entry declared by an extension.
397
+ *
398
+ * This is serializable discovery-time metadata only — it does NOT carry the
399
+ * hook handler function. The executable runtime source is
400
+ * `MakaioExtension.artifactLifecycleHooks.createHooks()`; descriptor
401
+ * contributions are not a registration fallback.
402
+ *
403
+ * When `kind` is omitted, the hook applies to all registered artifact kinds.
404
+ * When `schemaVersion` is omitted, the hook applies to all schema versions of
405
+ * the targeted kind.
406
+ */
407
+ interface ArtifactLifecycleHookManifest {
408
+ /**
409
+ * Stable identifier for this hook entry within the declaring extension.
410
+ *
411
+ * Must be unique within the extension's `artifactLifecycleHooks` array.
412
+ */
413
+ readonly id: string;
414
+ /** Artifact lifecycle event this hook responds to. */
415
+ readonly event: ArtifactLifecycleHookEvent;
416
+ /**
417
+ * Artifact kind discriminator this hook targets.
418
+ *
419
+ * When omitted, the hook applies across all registered kinds.
420
+ */
421
+ readonly kind?: string;
422
+ /**
423
+ * Schema version constraint for the targeted kind.
424
+ *
425
+ * When omitted, the hook applies to all schema versions of the targeted kind.
426
+ */
427
+ readonly schemaVersion?: string;
428
+ }
429
+ /** Zod schema for {@link ArtifactLifecycleHookManifest}. */
430
+ declare const ArtifactLifecycleHookManifestSchema: z.ZodObject<{
431
+ id: z.ZodString;
432
+ event: z.ZodEnum<{
433
+ beforeCreate: "beforeCreate";
434
+ beforeRevise: "beforeRevise";
435
+ afterCreate: "afterCreate";
436
+ afterRevise: "afterRevise";
437
+ afterStatusChanged: "afterStatusChanged";
438
+ afterObservationAdded: "afterObservationAdded";
439
+ }>;
440
+ kind: z.ZodOptional<z.ZodString>;
441
+ schemaVersion: z.ZodOptional<z.ZodString>;
442
+ }, z.core.$strip>;
443
+ /**
444
+ * Discovery-time flags for browser UI contribution surfaces.
445
+ *
446
+ * Each boolean flag indicates that the extension's executable
447
+ * {@link ExtensionUiContribution} declares the corresponding surface.
448
+ * Absent or `false` means the surface is not contributed.
449
+ */
450
+ interface UiSurfaceFlags {
451
+ /** Extension contributes one or more tile declarations. */
452
+ readonly tiles?: boolean;
453
+ /** Extension contributes one or more widget declarations. */
454
+ readonly widgets?: boolean;
455
+ /** Extension contributes one or more page declarations. */
456
+ readonly pages?: boolean;
457
+ /** Extension contributes one or more web UI routes. */
458
+ readonly routes?: boolean;
459
+ }
460
+ /** Zod schema for {@link UiSurfaceFlags}. */
461
+ declare const UiSurfaceFlagsSchema: z.ZodObject<{
462
+ tiles: z.ZodOptional<z.ZodBoolean>;
463
+ widgets: z.ZodOptional<z.ZodBoolean>;
464
+ pages: z.ZodOptional<z.ZodBoolean>;
465
+ routes: z.ZodOptional<z.ZodBoolean>;
466
+ }, z.core.$strip>;
467
+ /**
468
+ * Top-level container for all contributions an extension declares.
469
+ *
470
+ * Added as an optional field on {@link ExtensionManifest}. Extensions that do
471
+ * not need discovery-time contribution metadata may omit this field entirely.
472
+ * This manifest is intentionally not a runtime wiring surface; it mirrors the
473
+ * executable contribution fields only for pre-load introspection.
474
+ *
475
+ * Rich metadata fields ({@link adapters}, {@link clients}, {@link providers},
476
+ * {@link triggers}, {@link logImporters}, {@link sessionEventActions}) carry
477
+ * structured data for discovery and filtering. Boolean surface flags
478
+ * ({@link create}, {@link tools}, {@link bootstrap}, etc.) declare which
479
+ * executable surfaces the extension contributes without duplicating runtime
480
+ * detail.
481
+ * @example Extension contributing an adapter and a client
482
+ * ```json
483
+ * {
484
+ * "contributions": {
485
+ * "adapters": [
486
+ * {
487
+ * "name": "claude-code",
488
+ * "protocols": ["anthropic"],
489
+ * "clients": [{ "id": "claude-code", "version": "^1.5.0" }]
490
+ * }
491
+ * ],
492
+ * "clients": [
493
+ * { "id": "claude-code", "name": "Claude Code", "binary": { "name": "claude" } }
494
+ * ]
495
+ * }
496
+ * }
497
+ * ```
498
+ * @example Extension contributing hash triggers and tools
499
+ * ```json
500
+ * {
501
+ * "contributions": {
502
+ * "triggers": [
503
+ * { "prefix": "loop", "description": "Retry-until-success execution", "stage": "action" }
504
+ * ],
505
+ * "create": true,
506
+ * "tools": true,
507
+ * "configSchema": true,
508
+ * "ui": { "widgets": true }
509
+ * }
510
+ * }
511
+ * ```
512
+ */
513
+ interface ContributionManifest {
514
+ /** Adapter contributions declared by this extension. */
515
+ readonly adapters?: readonly AdapterManifest[];
516
+ /** Client binary contributions declared by this extension. */
517
+ readonly clients?: readonly ClientManifest[];
518
+ /** Provider contributions declared by this extension. */
519
+ readonly providers?: readonly ProviderManifest[];
520
+ /** Hash trigger contributions declared by this extension. */
521
+ readonly triggers?: readonly TriggerManifest[];
522
+ /** Log importer contribution declared by this extension. */
523
+ readonly logImporters?: readonly LogImporterManifest[];
524
+ /** Session event action contributions declared by this extension. */
525
+ readonly sessionEventActions?: readonly SessionEventActionManifest[];
526
+ /**
527
+ * Artifact lifecycle hook entries declared by this extension.
528
+ *
529
+ * Each entry is serializable discovery-time metadata. The executable runtime
530
+ * source is `MakaioExtension.artifactLifecycleHooks.createHooks()`; this
531
+ * field is for pre-load introspection only.
532
+ */
533
+ readonly artifactLifecycleHooks?: readonly ArtifactLifecycleHookManifest[];
534
+ /** Extension provides a service factory ({@link MakaioExtension.create}). */
535
+ readonly create?: boolean;
536
+ /** Extension contributes one or more toolsets ({@link MakaioExtension.tools}). */
537
+ readonly tools?: boolean;
538
+ /** Extension contributes bootstrap import/export ({@link MakaioExtension.bootstrap}). */
539
+ readonly bootstrap?: boolean;
540
+ /** Extension declares a bus namespace ({@link MakaioExtension."namespace"}). */
541
+ readonly namespace?: boolean;
542
+ /** Extension declares a config schema ({@link MakaioExtension.configSchema}). */
543
+ readonly configSchema?: boolean;
544
+ /** Extension declares UI config overrides ({@link MakaioExtension.uiConfig}). */
545
+ readonly uiConfig?: boolean;
546
+ /** Browser UI surface flags ({@link MakaioExtension.ui}). */
547
+ readonly ui?: UiSurfaceFlags;
548
+ }
549
+ /** Zod schema for {@link ContributionManifest}. */
550
+ declare const ContributionManifestSchema: z.ZodObject<{
551
+ adapters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
552
+ name: z.ZodString;
553
+ displayName: z.ZodOptional<z.ZodString>;
554
+ description: z.ZodOptional<z.ZodString>;
555
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
556
+ id: z.ZodString;
557
+ version: z.ZodString;
558
+ binaryVersion: z.ZodOptional<z.ZodString>;
559
+ }, z.core.$strip>>>>;
560
+ protocols: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
561
+ anthropic: "anthropic";
562
+ openai: "openai";
563
+ }>, z.ZodObject<{
564
+ anthropic: z.ZodOptional<z.ZodObject<{
565
+ endpoint: z.ZodOptional<z.ZodString>;
566
+ }, z.core.$strip>>;
567
+ openai: z.ZodOptional<z.ZodObject<{
568
+ endpoint: z.ZodOptional<z.ZodString>;
569
+ }, z.core.$strip>>;
570
+ }, z.core.$strip>]>>>;
571
+ defaultProvider: z.ZodOptional<z.ZodString>;
572
+ }, z.core.$strip>>>>;
573
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
574
+ id: z.ZodString;
575
+ name: z.ZodString;
576
+ description: z.ZodOptional<z.ZodString>;
577
+ binary: z.ZodOptional<z.ZodObject<{
578
+ name: z.ZodString;
579
+ managed: z.ZodOptional<z.ZodBoolean>;
580
+ version: z.ZodOptional<z.ZodString>;
581
+ }, z.core.$strict>>;
582
+ }, z.core.$strict>>>>;
583
+ providers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
584
+ id: z.ZodString;
585
+ name: z.ZodString;
586
+ description: z.ZodOptional<z.ZodString>;
587
+ }, z.core.$strip>>>>;
588
+ triggers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
589
+ prefix: z.ZodString;
590
+ description: z.ZodOptional<z.ZodString>;
591
+ stage: z.ZodOptional<z.ZodEnum<{
592
+ transform: "transform";
593
+ action: "action";
594
+ gather: "gather";
595
+ }>>;
596
+ }, z.core.$strip>>>>;
597
+ logImporters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
598
+ adapterName: z.ZodString;
599
+ displayName: z.ZodString;
600
+ logFilePattern: z.ZodOptional<z.ZodString>;
601
+ }, z.core.$strip>>>>;
602
+ sessionEventActions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
603
+ id: z.ZodString;
604
+ label: z.ZodString;
605
+ description: z.ZodOptional<z.ZodString>;
606
+ icon: z.ZodOptional<z.ZodString>;
607
+ selectionMode: z.ZodEnum<{
608
+ single: "single";
609
+ multi: "multi";
610
+ }>;
611
+ messageRoles: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
612
+ user: "user";
613
+ assistant: "assistant";
614
+ }>>>>;
615
+ }, z.core.$strip>>>>;
616
+ artifactLifecycleHooks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
617
+ id: z.ZodString;
618
+ event: z.ZodEnum<{
619
+ beforeCreate: "beforeCreate";
620
+ beforeRevise: "beforeRevise";
621
+ afterCreate: "afterCreate";
622
+ afterRevise: "afterRevise";
623
+ afterStatusChanged: "afterStatusChanged";
624
+ afterObservationAdded: "afterObservationAdded";
625
+ }>;
626
+ kind: z.ZodOptional<z.ZodString>;
627
+ schemaVersion: z.ZodOptional<z.ZodString>;
628
+ }, z.core.$strip>>>>;
629
+ create: z.ZodOptional<z.ZodBoolean>;
630
+ tools: z.ZodOptional<z.ZodBoolean>;
631
+ bootstrap: z.ZodOptional<z.ZodBoolean>;
632
+ namespace: z.ZodOptional<z.ZodBoolean>;
633
+ configSchema: z.ZodOptional<z.ZodBoolean>;
634
+ uiConfig: z.ZodOptional<z.ZodBoolean>;
635
+ ui: z.ZodOptional<z.ZodObject<{
636
+ tiles: z.ZodOptional<z.ZodBoolean>;
637
+ widgets: z.ZodOptional<z.ZodBoolean>;
638
+ pages: z.ZodOptional<z.ZodBoolean>;
639
+ routes: z.ZodOptional<z.ZodBoolean>;
640
+ }, z.core.$strip>>;
641
+ }, z.core.$strip>;
642
+ //#endregion
643
+ //#region core/contracts/src/extension/capability-token.d.ts
644
+ /**
645
+ * Declaration-mergeable registry for extension capability tokens.
646
+ *
647
+ * Extend this interface via `declare module` to register capability tokens that
648
+ * can be referenced by {@link CapabilityToken} at compile time.
649
+ */
650
+ interface CapabilityTokenMap {
651
+ /** Adapter subsystem readiness for adapter metadata, config, and runtime lifecycle. */
652
+ adapters: true;
653
+ }
654
+ /**
655
+ * Compile-time capability token used by extension manifests.
656
+ *
657
+ * Extracting string keys preserves declaration-merged literal tokens without
658
+ * relying on intersections that can collapse to `never` in downstream type
659
+ * contexts.
660
+ */
661
+ type CapabilityToken = Extract<keyof CapabilityTokenMap, string>;
662
+ /**
663
+ * Canonical runtime validator for extension capability tokens.
664
+ *
665
+ * Runtime validation intentionally remains string-based so descriptor JSON stays
666
+ * data-only; declaration merging supplies the compile-time token vocabulary.
667
+ */
668
+ declare const CapabilityTokenSchema: z.ZodType<CapabilityToken>;
669
+ //#endregion
670
+ //#region core/contracts/src/extension/manifest.d.ts
671
+ /**
672
+ * Visual presentation style for an extension window.
673
+ *
674
+ * - `'tray-popover'` — small overlay anchored to the system tray icon.
675
+ * - `'utility'` — standalone auxiliary window (e.g., settings panel).
676
+ * - `'panel'` — docked or floating workspace panel.
677
+ */
678
+ type WindowStyle = 'tray-popover' | 'utility' | 'panel';
679
+ /**
680
+ * Describes a window surface an extension can open.
681
+ *
682
+ * The shell uses this declaration to pre-register the window and manage
683
+ * its lifecycle without requiring the extension to be initialized first.
684
+ */
685
+ interface WindowManifest {
686
+ /**
687
+ * Identifier unique within the declaring extension.
688
+ * Referenced by {@link TrayManifest.opensWindow} to associate tray
689
+ * actions with specific windows.
690
+ */
691
+ readonly id: string;
692
+ /** Visual presentation style that governs how the shell positions and sizes the window. */
693
+ readonly style: WindowStyle;
694
+ /** Preferred initial width in logical pixels. */
695
+ readonly width?: number;
696
+ /** Preferred initial height in logical pixels. */
697
+ readonly height?: number;
698
+ /**
699
+ * When `true`, the shell ensures at most one instance of this window is
700
+ * open at a time, focusing the existing window instead of opening a new one.
701
+ */
702
+ readonly singleton?: boolean;
703
+ /**
704
+ * Named route parameters this window accepts.
705
+ * The shell uses these to map URL path segments to query params and
706
+ * to generalize window deduplication without hardcoding host IDs.
707
+ */
708
+ readonly params?: readonly WindowParamSpec[];
709
+ }
710
+ /**
711
+ * Specification for a named window route parameter.
712
+ */
713
+ interface WindowParamSpec {
714
+ /** Parameter name (e.g. `'projectId'`). */
715
+ readonly name: string;
716
+ /** Whether this parameter is required for window creation. */
717
+ readonly required?: boolean;
718
+ }
719
+ /** Zod schema for {@link WindowParamSpec}. */
720
+ declare const WindowParamSpecSchema: z.ZodObject<{
721
+ name: z.ZodString;
722
+ required: z.ZodOptional<z.ZodBoolean>;
723
+ }, z.core.$strip>;
724
+ /** Zod schema for {@link WindowManifest}. */
725
+ declare const WindowManifestSchema: z.ZodObject<{
726
+ id: z.ZodString;
727
+ style: z.ZodEnum<{
728
+ "tray-popover": "tray-popover";
729
+ utility: "utility";
730
+ panel: "panel";
731
+ }>;
732
+ width: z.ZodOptional<z.ZodNumber>;
733
+ height: z.ZodOptional<z.ZodNumber>;
734
+ singleton: z.ZodOptional<z.ZodBoolean>;
735
+ params: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
736
+ name: z.ZodString;
737
+ required: z.ZodOptional<z.ZodBoolean>;
738
+ }, z.core.$strip>>>>;
739
+ }, z.core.$strip>;
740
+ /**
741
+ * Describes an extension's entry in the system tray menu.
742
+ *
743
+ * The shell renders tray items grouped by {@link section}. Only one of
744
+ * {@link opensWindow} or {@link action} should be set; if both are present
745
+ * the shell prefers {@link opensWindow}.
746
+ */
747
+ interface TrayManifest$1 {
748
+ /** Human-readable label shown in the tray menu. */
749
+ readonly label: string;
750
+ /**
751
+ * Logical grouping for tray menu layout.
752
+ *
753
+ * - `'utilities'` — system / account tools (e.g., auth switcher).
754
+ * - `'tools'` — productivity tools (e.g., code review).
755
+ * - `'views'` — windows or panels that present content.
756
+ */
757
+ readonly section?: 'utilities' | 'tools' | 'views';
758
+ /**
759
+ * {@link WindowManifest.id} of the window to open when this tray item is
760
+ * clicked. Takes precedence over {@link action} when both are defined.
761
+ */
762
+ readonly opensWindow?: string;
763
+ /**
764
+ * Opaque action identifier echoed in `host:tray.item.clicked` metadata when
765
+ * this tray item is clicked.
766
+ */
767
+ readonly action?: string;
768
+ }
769
+ /** Zod schema for {@link TrayManifest}. */
770
+ declare const TrayManifestSchema: z.ZodObject<{
771
+ label: z.ZodString;
772
+ section: z.ZodOptional<z.ZodEnum<{
773
+ tools: "tools";
774
+ utilities: "utilities";
775
+ views: "views";
776
+ }>>;
777
+ opensWindow: z.ZodOptional<z.ZodString>;
778
+ action: z.ZodOptional<z.ZodString>;
779
+ }, z.core.$strip>;
780
+ /**
781
+ * Describes a single positional argument or named option for a CLI subcommand.
782
+ *
783
+ * This is the serializable, framework-agnostic counterpart to
784
+ * `CliSubcommandDefinition` — it carries only metadata, no handler.
785
+ */
786
+ interface CliArgManifest {
787
+ /**
788
+ * Argument or option name.
789
+ * For positional args this is the display name shown in usage text.
790
+ * For named options it is the schema field name. The CLI adapter converts it
791
+ * to a kebab-case long flag when registering Commander options
792
+ * (e.g. `'clientId'` -\> `--client-id`).
793
+ */
794
+ readonly name: string;
795
+ /** One-line description shown in help text. */
796
+ readonly description: string;
797
+ /** When `true`, the CLI parser rejects invocations that omit this argument. */
798
+ readonly required?: boolean;
799
+ /** When `true`, treat as a positional argument rather than a named option. */
800
+ readonly positional?: boolean;
801
+ /** Short single-character flag alias (e.g. `'-p'`). */
802
+ readonly short?: string;
803
+ /**
804
+ * Value type for this argument or option.
805
+ * Used by manifest-based CLI registration to determine whether an option
806
+ * takes a value or is a boolean flag. Defaults to `'string'` when omitted.
807
+ * Manifest-based registration also uses this metadata to coerce numeric
808
+ * values before they reach the subcommand's Zod schema.
809
+ */
810
+ readonly type?: 'string' | 'boolean' | 'number';
811
+ }
812
+ /** Zod schema for {@link CliArgManifest}. */
813
+ declare const CliArgManifestSchema: z.ZodObject<{
814
+ name: z.ZodString;
815
+ description: z.ZodString;
816
+ required: z.ZodOptional<z.ZodBoolean>;
817
+ positional: z.ZodOptional<z.ZodBoolean>;
818
+ short: z.ZodOptional<z.ZodString>;
819
+ type: z.ZodOptional<z.ZodEnum<{
820
+ string: "string";
821
+ number: "number";
822
+ boolean: "boolean";
823
+ }>>;
824
+ }, z.core.$strip>;
825
+ /**
826
+ * Describes a single subcommand nested under the extension's top-level CLI command.
827
+ *
828
+ * Pure metadata — no handler. Used for help generation and manifest inspection.
829
+ */
830
+ interface CliSubcommandManifest {
831
+ /** Subcommand name (e.g. `'list'`, `'switch'`). */
832
+ readonly name: string;
833
+ /** One-line description shown in help text. */
834
+ readonly description: string;
835
+ /** Arguments and options accepted by this subcommand. */
836
+ readonly args?: readonly CliArgManifest[];
837
+ }
838
+ /** Zod schema for {@link CliSubcommandManifest}. */
839
+ declare const CliSubcommandManifestSchema: z.ZodObject<{
840
+ name: z.ZodString;
841
+ description: z.ZodString;
842
+ args: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
843
+ name: z.ZodString;
844
+ description: z.ZodString;
845
+ required: z.ZodOptional<z.ZodBoolean>;
846
+ positional: z.ZodOptional<z.ZodBoolean>;
847
+ short: z.ZodOptional<z.ZodString>;
848
+ type: z.ZodOptional<z.ZodEnum<{
849
+ string: "string";
850
+ number: "number";
851
+ boolean: "boolean";
852
+ }>>;
853
+ }, z.core.$strip>>>>;
854
+ }, z.core.$strip>;
855
+ /**
856
+ * Describes the top-level CLI command an extension contributes.
857
+ *
858
+ * Serializable and framework-agnostic. The executable extension,
859
+ * `ExtensionCliContribution`, adds the interactive handler and typed subcommand
860
+ * definitions. The CLI router uses this manifest for help generation and
861
+ * command discovery without loading handler code.
862
+ */
863
+ interface CliManifest {
864
+ /** Top-level command name (e.g. `'account-manager'`). */
865
+ readonly name: string;
866
+ /** One-line description shown in help text. */
867
+ readonly description: string;
868
+ /** Non-interactive subcommands registered under this command. */
869
+ readonly subcommands?: readonly CliSubcommandManifest[];
870
+ /**
871
+ * Whether this extension provides an interactive TUI handler.
872
+ *
873
+ * When `true`, invoking the bare command (without a subcommand) launches
874
+ * the interactive handler. When `false` or omitted, bare invocation shows
875
+ * help. This is a serializable declaration in `descriptor.json`; the
876
+ * executable handler itself lives in `ExtensionCliContribution.interactive`.
877
+ *
878
+ * Named `hasInteractive` (not `interactive`) to avoid a type conflict with
879
+ * the `ExtensionCliContribution` property of the same short name, which carries
880
+ * the function implementation rather than a boolean flag.
881
+ */
882
+ readonly hasInteractive?: boolean;
883
+ /**
884
+ * Pre-connection routing hint indicating that this extension can embed and
885
+ * provide its own bus instance.
886
+ *
887
+ * When `true`, the CLI router may skip desktop auto-launch for a matching
888
+ * local command after probing for an already-running external daemon. The
889
+ * executable contribution can then bootstrap a self-contained bus for
890
+ * standalone or embedded execution if no external bus connected.
891
+ *
892
+ * This is a serializable declaration only — it carries no executable startup
893
+ * logic. The actual bus provisioning is performed by the executable
894
+ * `CliContribution.provideBus` handler.
895
+ */
896
+ readonly canProvideBus?: boolean;
897
+ }
898
+ /** Zod schema for {@link CliManifest}. */
899
+ declare const CliManifestSchema: z.ZodObject<{
900
+ name: z.ZodString;
901
+ description: z.ZodString;
902
+ subcommands: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
903
+ name: z.ZodString;
904
+ description: z.ZodString;
905
+ args: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
906
+ name: z.ZodString;
907
+ description: z.ZodString;
908
+ required: z.ZodOptional<z.ZodBoolean>;
909
+ positional: z.ZodOptional<z.ZodBoolean>;
910
+ short: z.ZodOptional<z.ZodString>;
911
+ type: z.ZodOptional<z.ZodEnum<{
912
+ string: "string";
913
+ number: "number";
914
+ boolean: "boolean";
915
+ }>>;
916
+ }, z.core.$strip>>>>;
917
+ }, z.core.$strip>>>>;
918
+ hasInteractive: z.ZodOptional<z.ZodBoolean>;
919
+ canProvideBus: z.ZodOptional<z.ZodBoolean>;
920
+ }, z.core.$strip>;
921
+ /**
922
+ * Describes the storage requirements of an extension.
923
+ *
924
+ * Serializable metadata that the runtime uses to run migrations before
925
+ * starting the extension's service. The migrations path is relative to the
926
+ * extension root and resolved to an absolute path by the composition root.
927
+ * Bundled hosts may also provide a stable `migrationSourceId` so migration
928
+ * identity does not collapse onto packaged output paths.
929
+ */
930
+ interface StorageManifest {
931
+ /**
932
+ * Path to the Drizzle migration folder, relative to the extension root.
933
+ *
934
+ * The runtime resolves this to an absolute path and passes it to the
935
+ * host-supplied `runMigrations` callback
936
+ * before any extension services are started. The callback is responsible for
937
+ * applying pending migrations against the shared database using a
938
+ * per-extension tracking table to avoid filename collisions.
939
+ * @example 'drizzle'
940
+ */
941
+ readonly migrations?: string;
942
+ /**
943
+ * Stable runtime identity for the migration bundle.
944
+ *
945
+ * Hosts use this to key deduplication, ledger tables, and bundled migration
946
+ * lookup independently of the on-disk discovery path. When omitted, the
947
+ * resolved migration folder path remains the identity.
948
+ */
949
+ readonly migrationSourceId?: string;
950
+ }
951
+ /** Zod schema for {@link StorageManifest}. */
952
+ declare const StorageManifestSchema: z.ZodObject<{
953
+ migrations: z.ZodOptional<z.ZodString>;
954
+ migrationSourceId: z.ZodOptional<z.ZodString>;
955
+ }, z.core.$strip>;
956
+ /**
957
+ * A structured dependency declaration on another extension.
958
+ *
959
+ * Carries the dependency name, a semver version range the declared extension
960
+ * must satisfy, and an optional `optional` flag for non-fatal dependencies.
961
+ */
962
+ interface ExtensionDependency {
963
+ /** Discriminant — always `'extension'`. */
964
+ readonly type: 'extension';
965
+ /**
966
+ * {@link ExtensionManifest.name} of the required extension.
967
+ *
968
+ * Accepts the same plain or scoped npm identifier format as
969
+ * {@link ExtensionManifest.name}.
970
+ */
971
+ readonly name: string;
972
+ /**
973
+ * Semver range the installed extension version must satisfy.
974
+ *
975
+ * Uses the same syntax as npm range strings (e.g. `'>=1.0.0 <2.0.0'`,
976
+ * `'^1.5.0'`).
977
+ */
978
+ readonly version: VersionRange;
979
+ /**
980
+ * When `true` the extension may start even if this dependency is absent or
981
+ * fails to activate.
982
+ *
983
+ * Omitting this field is equivalent to `false`.
984
+ */
985
+ readonly optional?: boolean;
986
+ }
987
+ /** Zod schema for {@link ExtensionDependency}. */
988
+ declare const ExtensionDependencySchema: z.ZodObject<{
989
+ type: z.ZodLiteral<"extension">;
990
+ name: z.ZodString;
991
+ version: z.ZodString;
992
+ optional: z.ZodOptional<z.ZodBoolean>;
993
+ }, z.core.$strip>;
994
+ /**
995
+ * Factory that creates an {@link ExtensionDependency} with `type: 'extension'`.
996
+ *
997
+ * Prefer this helper over inline object literals to keep dependency
998
+ * declarations concise and consistent across package descriptors.
999
+ * @param name - {@link ExtensionManifest.name} of the required extension.
1000
+ * @param version - Semver range the required extension must satisfy.
1001
+ * @param optional - When `true`, activation continues if the dependency is absent.
1002
+ * @returns A fully-typed {@link ExtensionDependency} object.
1003
+ * @example
1004
+ * dependencies: [dep('provider-anthropic'), dep('makaio.clients-core')]
1005
+ */
1006
+ declare function dep$1(name: string, version?: VersionRange, optional?: boolean): ExtensionDependency;
1007
+ /**
1008
+ * A typed runtime-environment gate that an extension declares it needs before
1009
+ * the kernel will activate it.
1010
+ *
1011
+ * Two flavors are supported:
1012
+ * - `'host'` — the runtime host must be present (e.g. `{ type: 'host', id: 'node' }`).
1013
+ * - `'capability'` — the host must advertise the named capability token
1014
+ * (e.g. `{ type: 'capability', id: 'storage.drizzle' }`). The optional
1015
+ * `version` field requires the host capability to declare a satisfying
1016
+ * concrete version.
1017
+ *
1018
+ * This is an environment compatibility gate, not an extension-to-extension
1019
+ * dependency. Use {@link ExtensionManifest.dependencies} for structural ordering.
1020
+ */
1021
+ type RuntimeRequirement = {
1022
+ readonly type: 'host';
1023
+ readonly id: string;
1024
+ } | {
1025
+ readonly type: 'capability';
1026
+ readonly id: string;
1027
+ readonly version?: VersionRange;
1028
+ };
1029
+ /** Zod schema for {@link RuntimeRequirement}. */
1030
+ declare const RuntimeRequirementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1031
+ type: z.ZodLiteral<"host">;
1032
+ id: z.ZodString;
1033
+ }, z.core.$strip>, z.ZodObject<{
1034
+ type: z.ZodLiteral<"capability">;
1035
+ id: z.ZodString;
1036
+ version: z.ZodOptional<z.ZodString>;
1037
+ }, z.core.$strip>], "type">;
1038
+ /**
1039
+ * Pure-data manifest for a Makaio extension.
1040
+ *
1041
+ * Fully serializable and safe to inspect or transmit without executing any
1042
+ * extension code. The shell and registry use this to discover extension surfaces
1043
+ * (windows, tray, CLI, storage) before deciding whether to initialize them.
1044
+ * @see {@link MakaioExtension} for the executable extension that adds `create`,
1045
+ * typed CLI handlers, and storage registration.
1046
+ */
1047
+ interface ExtensionManifest {
1048
+ /**
1049
+ * Unique extension identifier.
1050
+ *
1051
+ * Accepts plain identifiers (e.g. `'account-manager'`) and npm-scoped
1052
+ * names (e.g. `'@acme/weather-tools'`). Used as the primary key in the
1053
+ * extension registry and as the top-level CLI command name when no
1054
+ * {@link cli} override is provided.
1055
+ */
1056
+ readonly name: string;
1057
+ /** Human-readable display name shown in UI surfaces (e.g. `'Auth Switcher'`). */
1058
+ readonly displayName: string;
1059
+ /**
1060
+ * SemVer version of this extension package.
1061
+ *
1062
+ * Descriptor-only synthesized packages receive this from `descriptor.json`;
1063
+ * code-defined executable packages declare the same field directly on their
1064
+ * package object.
1065
+ */
1066
+ readonly version: VersionLiteral$1;
1067
+ /**
1068
+ * Execution surface the extension targets.
1069
+ *
1070
+ * - `'interactive'` — requires a UI shell (e.g., Electron renderer).
1071
+ * - `'headless'` — suitable for daemon or CLI-only runtimes.
1072
+ * - `'any'` — works in any surface (default when omitted).
1073
+ */
1074
+ readonly surface?: 'interactive' | 'headless' | 'any';
1075
+ /**
1076
+ * Structured dependencies on other extensions.
1077
+ *
1078
+ * The registry ensures all listed extensions are initialized before this
1079
+ * extension starts. Each entry carries the dependency name, a semver version
1080
+ * range the installed extension must satisfy, and an optional `optional` flag.
1081
+ * @see {@link ExtensionDependency}
1082
+ */
1083
+ readonly dependencies?: readonly ExtensionDependency[];
1084
+ /**
1085
+ * Runtime-environment gates this extension must satisfy before the kernel
1086
+ * activates it.
1087
+ *
1088
+ * Each entry is a {@link RuntimeRequirement} that declares either a required
1089
+ * host identity (e.g. `'node'`) or a host-advertised capability token (e.g.
1090
+ * `'storage.drizzle'`). All entries must be satisfied (AND semantics).
1091
+ *
1092
+ * This is an environment compatibility gate, not an extension-to-extension
1093
+ * dependency. Use {@link dependencies} for structural extension ordering.
1094
+ */
1095
+ readonly requires?: readonly RuntimeRequirement[];
1096
+ /**
1097
+ * Capability tokens this extension provides when active.
1098
+ *
1099
+ * Consumers and onboarding surfaces can inspect these declarations to decide
1100
+ * whether a capability exists at all before prompting the user to configure it.
1101
+ */
1102
+ readonly provides?: readonly CapabilityToken[];
1103
+ /** Windows this extension can open, keyed by {@link WindowManifest.id}. */
1104
+ readonly windows?: readonly WindowManifest[];
1105
+ /** System tray entry for this extension. */
1106
+ readonly tray?: TrayManifest$1;
1107
+ /**
1108
+ * CLI command contributed by this extension.
1109
+ *
1110
+ * On {@link ExtensionManifest} this is pure metadata. On {@link MakaioExtension}
1111
+ * this is widened to `ExtensionCliContribution` with executable handlers.
1112
+ */
1113
+ readonly cli?: CliManifest;
1114
+ /** Storage requirements (migrations) declared by this extension. */
1115
+ readonly storage?: StorageManifest;
1116
+ /**
1117
+ * Browser entry point for this extension.
1118
+ * URL path the renderer fetches to load the extension's UI.
1119
+ * @example '/extensions/my-extension/browser/index.js'
1120
+ */
1121
+ readonly browser?: BrowserEntrypoint;
1122
+ /**
1123
+ * Adapters and client binaries contributed by this extension.
1124
+ *
1125
+ * Discovery-time metadata only — serializable and safe to inspect without
1126
+ * loading any extension code. Runtime activation and registration use the
1127
+ * executable contribution fields on {@link MakaioExtension}; descriptor
1128
+ * metadata may mirror those fields for pre-load introspection but is not
1129
+ * used as a fallback wiring source.
1130
+ */
1131
+ readonly contributions?: ContributionManifest;
1132
+ }
1133
+ /** Zod schema for {@link ExtensionManifest}. */
1134
+ declare const ExtensionManifestSchema: z.ZodObject<{
1135
+ name: z.ZodString;
1136
+ displayName: z.ZodString;
1137
+ version: z.ZodString;
1138
+ surface: z.ZodOptional<z.ZodEnum<{
1139
+ any: "any";
1140
+ interactive: "interactive";
1141
+ headless: "headless";
1142
+ }>>;
1143
+ dependencies: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1144
+ type: z.ZodLiteral<"extension">;
1145
+ name: z.ZodString;
1146
+ version: z.ZodString;
1147
+ optional: z.ZodOptional<z.ZodBoolean>;
1148
+ }, z.core.$strip>>>>;
1149
+ requires: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1150
+ type: z.ZodLiteral<"host">;
1151
+ id: z.ZodString;
1152
+ }, z.core.$strip>, z.ZodObject<{
1153
+ type: z.ZodLiteral<"capability">;
1154
+ id: z.ZodString;
1155
+ version: z.ZodOptional<z.ZodString>;
1156
+ }, z.core.$strip>], "type">>>>;
1157
+ provides: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<"adapters", unknown, z.core.$ZodTypeInternals<"adapters", unknown>>>>>;
1158
+ windows: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1159
+ id: z.ZodString;
1160
+ style: z.ZodEnum<{
1161
+ "tray-popover": "tray-popover";
1162
+ utility: "utility";
1163
+ panel: "panel";
1164
+ }>;
1165
+ width: z.ZodOptional<z.ZodNumber>;
1166
+ height: z.ZodOptional<z.ZodNumber>;
1167
+ singleton: z.ZodOptional<z.ZodBoolean>;
1168
+ params: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1169
+ name: z.ZodString;
1170
+ required: z.ZodOptional<z.ZodBoolean>;
1171
+ }, z.core.$strip>>>>;
1172
+ }, z.core.$strip>>>>;
1173
+ tray: z.ZodOptional<z.ZodObject<{
1174
+ label: z.ZodString;
1175
+ section: z.ZodOptional<z.ZodEnum<{
1176
+ tools: "tools";
1177
+ utilities: "utilities";
1178
+ views: "views";
1179
+ }>>;
1180
+ opensWindow: z.ZodOptional<z.ZodString>;
1181
+ action: z.ZodOptional<z.ZodString>;
1182
+ }, z.core.$strip>>;
1183
+ cli: z.ZodOptional<z.ZodObject<{
1184
+ name: z.ZodString;
1185
+ description: z.ZodString;
1186
+ subcommands: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1187
+ name: z.ZodString;
1188
+ description: z.ZodString;
1189
+ args: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1190
+ name: z.ZodString;
1191
+ description: z.ZodString;
1192
+ required: z.ZodOptional<z.ZodBoolean>;
1193
+ positional: z.ZodOptional<z.ZodBoolean>;
1194
+ short: z.ZodOptional<z.ZodString>;
1195
+ type: z.ZodOptional<z.ZodEnum<{
1196
+ string: "string";
1197
+ number: "number";
1198
+ boolean: "boolean";
1199
+ }>>;
1200
+ }, z.core.$strip>>>>;
1201
+ }, z.core.$strip>>>>;
1202
+ hasInteractive: z.ZodOptional<z.ZodBoolean>;
1203
+ canProvideBus: z.ZodOptional<z.ZodBoolean>;
1204
+ }, z.core.$strip>>;
1205
+ storage: z.ZodOptional<z.ZodObject<{
1206
+ migrations: z.ZodOptional<z.ZodString>;
1207
+ migrationSourceId: z.ZodOptional<z.ZodString>;
1208
+ }, z.core.$strip>>;
1209
+ browser: z.ZodOptional<z.ZodObject<{
1210
+ entrypoint: z.ZodString;
1211
+ }, z.core.$strip>>;
1212
+ contributions: z.ZodOptional<z.ZodObject<{
1213
+ adapters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1214
+ name: z.ZodString;
1215
+ displayName: z.ZodOptional<z.ZodString>;
1216
+ description: z.ZodOptional<z.ZodString>;
1217
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1218
+ id: z.ZodString;
1219
+ version: z.ZodString;
1220
+ binaryVersion: z.ZodOptional<z.ZodString>;
1221
+ }, z.core.$strip>>>>;
1222
+ protocols: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
1223
+ anthropic: "anthropic";
1224
+ openai: "openai";
1225
+ }>, z.ZodObject<{
1226
+ anthropic: z.ZodOptional<z.ZodObject<{
1227
+ endpoint: z.ZodOptional<z.ZodString>;
1228
+ }, z.core.$strip>>;
1229
+ openai: z.ZodOptional<z.ZodObject<{
1230
+ endpoint: z.ZodOptional<z.ZodString>;
1231
+ }, z.core.$strip>>;
1232
+ }, z.core.$strip>]>>>;
1233
+ defaultProvider: z.ZodOptional<z.ZodString>;
1234
+ }, z.core.$strip>>>>;
1235
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1236
+ id: z.ZodString;
1237
+ name: z.ZodString;
1238
+ description: z.ZodOptional<z.ZodString>;
1239
+ binary: z.ZodOptional<z.ZodObject<{
1240
+ name: z.ZodString;
1241
+ managed: z.ZodOptional<z.ZodBoolean>;
1242
+ version: z.ZodOptional<z.ZodString>;
1243
+ }, z.core.$strict>>;
1244
+ }, z.core.$strict>>>>;
1245
+ providers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1246
+ id: z.ZodString;
1247
+ name: z.ZodString;
1248
+ description: z.ZodOptional<z.ZodString>;
1249
+ }, z.core.$strip>>>>;
1250
+ triggers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1251
+ prefix: z.ZodString;
1252
+ description: z.ZodOptional<z.ZodString>;
1253
+ stage: z.ZodOptional<z.ZodEnum<{
1254
+ transform: "transform";
1255
+ action: "action";
1256
+ gather: "gather";
1257
+ }>>;
1258
+ }, z.core.$strip>>>>;
1259
+ logImporters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1260
+ adapterName: z.ZodString;
1261
+ displayName: z.ZodString;
1262
+ logFilePattern: z.ZodOptional<z.ZodString>;
1263
+ }, z.core.$strip>>>>;
1264
+ sessionEventActions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1265
+ id: z.ZodString;
1266
+ label: z.ZodString;
1267
+ description: z.ZodOptional<z.ZodString>;
1268
+ icon: z.ZodOptional<z.ZodString>;
1269
+ selectionMode: z.ZodEnum<{
1270
+ single: "single";
1271
+ multi: "multi";
1272
+ }>;
1273
+ messageRoles: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
1274
+ user: "user";
1275
+ assistant: "assistant";
1276
+ }>>>>;
1277
+ }, z.core.$strip>>>>;
1278
+ artifactLifecycleHooks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1279
+ id: z.ZodString;
1280
+ event: z.ZodEnum<{
1281
+ beforeCreate: "beforeCreate";
1282
+ beforeRevise: "beforeRevise";
1283
+ afterCreate: "afterCreate";
1284
+ afterRevise: "afterRevise";
1285
+ afterStatusChanged: "afterStatusChanged";
1286
+ afterObservationAdded: "afterObservationAdded";
1287
+ }>;
1288
+ kind: z.ZodOptional<z.ZodString>;
1289
+ schemaVersion: z.ZodOptional<z.ZodString>;
1290
+ }, z.core.$strip>>>>;
1291
+ create: z.ZodOptional<z.ZodBoolean>;
1292
+ tools: z.ZodOptional<z.ZodBoolean>;
1293
+ bootstrap: z.ZodOptional<z.ZodBoolean>;
1294
+ namespace: z.ZodOptional<z.ZodBoolean>;
1295
+ configSchema: z.ZodOptional<z.ZodBoolean>;
1296
+ uiConfig: z.ZodOptional<z.ZodBoolean>;
1297
+ ui: z.ZodOptional<z.ZodObject<{
1298
+ tiles: z.ZodOptional<z.ZodBoolean>;
1299
+ widgets: z.ZodOptional<z.ZodBoolean>;
1300
+ pages: z.ZodOptional<z.ZodBoolean>;
1301
+ routes: z.ZodOptional<z.ZodBoolean>;
1302
+ }, z.core.$strip>>;
1303
+ }, z.core.$strip>>;
1304
+ }, z.core.$strip>;
1305
+ //#endregion
1306
+ //#region core/contracts/src/extension/extension-token.d.ts
1307
+ /**
1308
+ * Typed extension service tokens.
1309
+ *
1310
+ * Extension tokens pair a runtime extension name with the service type the
1311
+ * extension exposes. Consumers import an extension-owned token instead of
1312
+ * repeating string literals at service lookup call sites.
1313
+ */
1314
+ /**
1315
+ * Typed token for retrieving an extension service from an extension context.
1316
+ *
1317
+ * The type parameter is intentionally phantom: the runtime uses {@link name}
1318
+ * while TypeScript carries the expected service type through `getService`.
1319
+ * @typeParam T - Service type exposed by the extension.
1320
+ */
1321
+ interface ExtensionToken$1<T = unknown> {
1322
+ /** Extension name registered with the runtime coordinator. */
1323
+ readonly name: string;
1324
+ /** Phantom marker for the token's service type. */
1325
+ readonly __service?: T;
1326
+ }
1327
+ /**
1328
+ * Create a typed extension service token.
1329
+ * @param name - Extension name registered with the runtime coordinator.
1330
+ * @returns Frozen token carrying the extension name and service type.
1331
+ */
1332
+ declare function extensionToken$1<T>(name: string): ExtensionToken$1<T>;
1333
+ //#endregion
1334
+ //#region core/contracts/src/extension/adapter-definition.d.ts
1335
+ /**
1336
+ * Adapter-side declaration of a supported provider.
1337
+ *
1338
+ * The adapter declares which providers it can serve by stable definition ID.
1339
+ * The adapter subsystem resolves each ID to a full {@link ProviderDefinitionInput}
1340
+ * from the provider registry at boot. Optional schemas override the adapter-level
1341
+ * defaults for this specific provider.
1342
+ */
1343
+ interface AdapterProviderRef {
1344
+ /** Stable provider definition ID (e.g., `'anthropic'`, `'openai'`). */
1345
+ readonly definitionId: string;
1346
+ /**
1347
+ * Provider-specific config schema override.
1348
+ *
1349
+ * When present, overrides any adapter-level config schema for this provider.
1350
+ */
1351
+ readonly configSchema?: z.ZodObject<z.ZodRawShape>;
1352
+ /**
1353
+ * Provider-specific credential schema override.
1354
+ *
1355
+ * When present, overrides any adapter-level credential schema for this provider.
1356
+ */
1357
+ readonly credentialSchema?: z.ZodObject<z.ZodRawShape>;
1358
+ }
1359
+ /**
1360
+ * Runtime contract for a single provider supported by an adapter.
1361
+ *
1362
+ * This type is the single source of truth for the provider definition wrapper.
1363
+ * Both `ai-adapters-core/src/types/provider-definition.ts` and
1364
+ * `adapter-subsystem/src/adapter-runtime-types.ts` extend or alias this type.
1365
+ */
1366
+ interface AdapterProviderDefinitionContract$1 {
1367
+ /**
1368
+ * Provider identity, model catalog, and endpoint declarations.
1369
+ *
1370
+ * Accepts {@link ProviderDefinitionInput} so adapter packages that declare
1371
+ * static `providerDefinition` constants can omit `availableModels` (which
1372
+ * the registry service populates at boot time). The runtime-resolved type
1373
+ * narrows after the adapter subsystem merges the registry data.
1374
+ */
1375
+ readonly definition: ProviderDefinitionInput$1;
1376
+ /**
1377
+ * Zod schema for provider-specific configuration fields.
1378
+ *
1379
+ * When present, the adapter subsystem uses this schema to validate and
1380
+ * expose provider configuration via the settings bus handlers.
1381
+ * Not serializable — kept in the definition, not the manifest.
1382
+ */
1383
+ readonly configSchema?: z.ZodObject<z.ZodRawShape>;
1384
+ /**
1385
+ * Zod schema for provider credential fields (e.g., API key, token).
1386
+ *
1387
+ * When present, the adapter subsystem uses this schema to validate
1388
+ * credentials before forwarding them to the adapter factory.
1389
+ * Not serializable — kept in the definition, not the manifest.
1390
+ */
1391
+ readonly credentialSchema?: z.ZodObject<z.ZodRawShape>;
1392
+ }
1393
+ /**
1394
+ * Runtime contract for an adapter contributed by an extension.
1395
+ *
1396
+ * Contains all fields needed by the `AdapterSubsystemService` to register,
1397
+ * initialize, and manage the adapter lifecycle. The generic type parameters
1398
+ * allow higher-level adapter types (e.g., `AIAdapterDefinition`) to narrow
1399
+ * both the return type of {@link createAdapter} and the options it accepts,
1400
+ * without violating TypeScript's contravariant parameter-type rules.
1401
+ *
1402
+ * This interface is not Zod-validatable because it contains functions and
1403
+ * Zod schemas as values. The serializable counterpart is `AdapterManifest`.
1404
+ * @typeParam TAdapter - Concrete adapter instance type returned by {@link createAdapter}.
1405
+ * Defaults to `unknown` so the contract is usable without a type parameter.
1406
+ * @typeParam TOptions - Options type accepted by {@link createAdapter}.
1407
+ * Defaults to `never` so the type-erased base contract (`AdapterContribution.definition`)
1408
+ * is structurally compatible with any specialised definition via contravariance:
1409
+ * `(options?: ConcreteOptions) => Promise<T>` is assignable to `(options?: never) => Promise<T>`.
1410
+ * Specialised adapter interfaces (e.g. `AIAdapterDefinition`) pass a narrower
1411
+ * options type here to gain compile-time safety in their factory signatures.
1412
+ */
1413
+ interface AdapterDefinitionContract$1<TAdapter = unknown, TOptions = never> {
1414
+ /**
1415
+ * Stable machine identifier for this adapter (e.g., `'claude-code'`).
1416
+ *
1417
+ * Must match `AdapterManifest.name` on the paired manifest entry.
1418
+ * Used as the primary key in adapter registries.
1419
+ */
1420
+ readonly name: string;
1421
+ /**
1422
+ * Human-readable display name shown in the UI (e.g., `'Claude Code'`).
1423
+ *
1424
+ * When omitted, the subsystem falls back to `AdapterManifest.displayName`.
1425
+ */
1426
+ readonly displayName?: string;
1427
+ /** Short description of what this adapter does. */
1428
+ readonly description?: string;
1429
+ /**
1430
+ * Zod schema for adapter-level configuration.
1431
+ *
1432
+ * Used by the `settings.adapter.getConfigSchema` bus handler to generate
1433
+ * JSON Schema for UI form rendering. Currently a seam — no adapter populates
1434
+ * this yet, but it is correctly placed on the definition contract for future
1435
+ * adapter-level configuration UI.
1436
+ */
1437
+ readonly adapterConfigSchema?: z.ZodObject<z.ZodRawShape>;
1438
+ /**
1439
+ * Provider IDs this adapter can serve.
1440
+ *
1441
+ * Each entry declares a provider by definition ID with optional schema
1442
+ * overrides. The adapter subsystem resolves these to full
1443
+ * {@link ProviderDefinitionInput} objects at boot from the provider registry.
1444
+ */
1445
+ readonly providers: readonly AdapterProviderRef[];
1446
+ /**
1447
+ * Default config schema applied to all providers unless overridden
1448
+ * per-provider via {@link AdapterProviderRef.configSchema}.
1449
+ */
1450
+ readonly providerConfigSchema?: z.ZodObject<z.ZodRawShape>;
1451
+ /**
1452
+ * Default credential schema applied to all providers unless overridden
1453
+ * per-provider via {@link AdapterProviderRef.credentialSchema}.
1454
+ */
1455
+ readonly providerCredentialSchema?: z.ZodObject<z.ZodRawShape>;
1456
+ /**
1457
+ * Required timeout defaults for all adapter operations.
1458
+ *
1459
+ * The config factory should read these values instead of importing a
1460
+ * parallel constant, making this contract the single source of truth
1461
+ * for adapter timeout behavior.
1462
+ */
1463
+ readonly defaultTimeouts: RequiredTimeoutConfig;
1464
+ /**
1465
+ * External help links for this adapter (e.g., documentation, support).
1466
+ *
1467
+ * Displayed in the adapter settings UI when present.
1468
+ */
1469
+ readonly helpLinks?: ReadonlyArray<{
1470
+ label: string;
1471
+ url: string;
1472
+ }>;
1473
+ /**
1474
+ * Setup or usage instructions shown in the adapter configuration UI.
1475
+ *
1476
+ * May contain Markdown-formatted text.
1477
+ */
1478
+ readonly instructions?: string;
1479
+ /**
1480
+ * Identifier of the default provider preset for this adapter.
1481
+ *
1482
+ * When omitted, the runtime or user selects the preset.
1483
+ */
1484
+ readonly defaultPresetId?: string;
1485
+ /**
1486
+ * Client identifier this adapter delegates to (e.g., `'claude-code'`).
1487
+ *
1488
+ * References a `ClientManifest.id` declared on the executable
1489
+ * {@link AdapterContribution.manifest}; descriptor contributions may mirror
1490
+ * it for discovery but are not the runtime wiring source.
1491
+ */
1492
+ readonly clientId?: string;
1493
+ /**
1494
+ * Active wire protocol used by this adapter at runtime.
1495
+ *
1496
+ * This is the singular runtime-active protocol consumed by the subsystem
1497
+ * to route requests. The serializable counterpart (`AdapterManifest.protocols`)
1498
+ * may declare additional protocols for discovery-time use.
1499
+ */
1500
+ readonly protocol?: ProtocolId$1;
1501
+ /**
1502
+ * Factory that creates the adapter instance.
1503
+ *
1504
+ * Called by the subsystem after all configuration is resolved. The
1505
+ * `options` parameter receives merged adapter config (preset + user
1506
+ * overrides). The returned promise resolves to the typed adapter instance.
1507
+ * @param options - Resolved adapter configuration (shape defined by the adapter).
1508
+ * @returns Promise resolving to the adapter instance.
1509
+ */
1510
+ readonly createAdapter: (options?: TOptions) => Promise<TAdapter>;
1511
+ }
1512
+ //#endregion
1513
+ //#region core/contracts/src/extension/extension-warning.d.ts
1514
+ /**
1515
+ * Discriminated union of actionable responses to an extension warning.
1516
+ *
1517
+ * Each variant carries the data the host needs to execute the action without
1518
+ * further round-trips to the extension.
1519
+ *
1520
+ * - `configure-integration` — open the integration settings for a client.
1521
+ * - `install-extension` — prompt the user to install another extension.
1522
+ * - `open-url` — navigate to an external or internal URL.
1523
+ * - `run-command` — invoke a registered bus command by name.
1524
+ */
1525
+ declare const ExtensionWarningActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1526
+ kind: z.ZodLiteral<"configure-integration">;
1527
+ clientId: z.ZodString;
1528
+ bundle: z.ZodString;
1529
+ }, z.core.$strip>, z.ZodObject<{
1530
+ kind: z.ZodLiteral<"install-extension">;
1531
+ extensionName: z.ZodString;
1532
+ }, z.core.$strip>, z.ZodObject<{
1533
+ kind: z.ZodLiteral<"open-url">;
1534
+ url: z.ZodString;
1535
+ }, z.core.$strip>, z.ZodObject<{
1536
+ kind: z.ZodLiteral<"run-command">;
1537
+ command: z.ZodString;
1538
+ }, z.core.$strip>], "kind">;
1539
+ /**
1540
+ * Severity levels for an {@link ExtensionWarning}.
1541
+ *
1542
+ * - `'info'` — informational note; the extension functions normally.
1543
+ * - `'recommended'` — a recommended configuration is missing; functionality is reduced.
1544
+ * - `'degraded'` — the extension is operating in a degraded fallback mode.
1545
+ */
1546
+ declare const ExtensionWarningSeveritySchema: z.ZodEnum<{
1547
+ degraded: "degraded";
1548
+ info: "info";
1549
+ recommended: "recommended";
1550
+ }>;
1551
+ /**
1552
+ * A single health warning emitted by a package's `checkHealth` hook.
1553
+ *
1554
+ * The host collects these after startup and may display them in the UI as
1555
+ * notification toasts or persistent status indicators.
1556
+ */
1557
+ declare const ExtensionWarningSchema: z.ZodObject<{
1558
+ severity: z.ZodEnum<{
1559
+ degraded: "degraded";
1560
+ info: "info";
1561
+ recommended: "recommended";
1562
+ }>;
1563
+ title: z.ZodString;
1564
+ message: z.ZodString;
1565
+ action: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1566
+ kind: z.ZodLiteral<"configure-integration">;
1567
+ clientId: z.ZodString;
1568
+ bundle: z.ZodString;
1569
+ }, z.core.$strip>, z.ZodObject<{
1570
+ kind: z.ZodLiteral<"install-extension">;
1571
+ extensionName: z.ZodString;
1572
+ }, z.core.$strip>, z.ZodObject<{
1573
+ kind: z.ZodLiteral<"open-url">;
1574
+ url: z.ZodString;
1575
+ }, z.core.$strip>, z.ZodObject<{
1576
+ kind: z.ZodLiteral<"run-command">;
1577
+ command: z.ZodString;
1578
+ }, z.core.$strip>], "kind">>;
1579
+ }, z.core.$strip>;
1580
+ /** Inferred TypeScript type for {@link ExtensionWarningSchema}. */
1581
+ type ExtensionWarning = z.infer<typeof ExtensionWarningSchema>;
1582
+ /** Inferred TypeScript type for {@link ExtensionWarningActionSchema}. */
1583
+ type ExtensionWarningAction = z.infer<typeof ExtensionWarningActionSchema>;
1584
+ /** Inferred TypeScript type for {@link ExtensionWarningSeveritySchema}. */
1585
+ type ExtensionWarningSeverity = z.infer<typeof ExtensionWarningSeveritySchema>;
1586
+ /**
1587
+ * Return the default user-facing label for an extension warning action.
1588
+ *
1589
+ * Kept with the action contract so every surface labels the same action kind
1590
+ * consistently without duplicating switch statements.
1591
+ * @param action - Extension warning action to label.
1592
+ * @returns Short button label for the action kind.
1593
+ */
1594
+ declare function getExtensionWarningActionLabel(action: ExtensionWarningAction): string;
1595
+ /**
1596
+ * Aggregated warning entry grouping all health warnings for a single extension.
1597
+ *
1598
+ * Used as the payload shape for `kernel:extension.warnings.list` responses and
1599
+ * `kernel:extension.warnings.changed` events so consumers receive extension identity
1600
+ * alongside the full warning array in one atomic value.
1601
+ */
1602
+ declare const ExtensionWarningEntrySchema: z.ZodObject<{
1603
+ extensionName: z.ZodString;
1604
+ warnings: z.ZodArray<z.ZodObject<{
1605
+ severity: z.ZodEnum<{
1606
+ degraded: "degraded";
1607
+ info: "info";
1608
+ recommended: "recommended";
1609
+ }>;
1610
+ title: z.ZodString;
1611
+ message: z.ZodString;
1612
+ action: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1613
+ kind: z.ZodLiteral<"configure-integration">;
1614
+ clientId: z.ZodString;
1615
+ bundle: z.ZodString;
1616
+ }, z.core.$strip>, z.ZodObject<{
1617
+ kind: z.ZodLiteral<"install-extension">;
1618
+ extensionName: z.ZodString;
1619
+ }, z.core.$strip>, z.ZodObject<{
1620
+ kind: z.ZodLiteral<"open-url">;
1621
+ url: z.ZodString;
1622
+ }, z.core.$strip>, z.ZodObject<{
1623
+ kind: z.ZodLiteral<"run-command">;
1624
+ command: z.ZodString;
1625
+ }, z.core.$strip>], "kind">>;
1626
+ }, z.core.$strip>>;
1627
+ }, z.core.$strip>;
1628
+ /** Inferred TypeScript type for {@link ExtensionWarningEntrySchema}. */
1629
+ type ExtensionWarningEntry = z.infer<typeof ExtensionWarningEntrySchema>;
1630
+ //#endregion
1631
+ //#region core/contracts/src/extension/extension-lifecycle.d.ts
1632
+ declare const extensionIdentityBrand: unique symbol;
1633
+ /**
1634
+ * Opaque extension identity minted by the runtime coordinator.
1635
+ *
1636
+ * This identity proves which loaded extension is calling runtime-owned seams
1637
+ * such as future direct channels. Extension code receives it through
1638
+ * {@link ExtensionContext.identity}; external callers cannot construct one
1639
+ * without a type assertion.
1640
+ */
1641
+ interface ExtensionIdentity {
1642
+ /** Extension name associated with this identity. */
1643
+ readonly extensionName: string;
1644
+ /** Opaque brand preventing structural construction. */
1645
+ readonly [extensionIdentityBrand]: true;
1646
+ }
1647
+ /**
1648
+ * Minimal lifecycle shape accepted as an extension service.
1649
+ *
1650
+ * BaseService satisfies this interface, but plain service classes can also
1651
+ * participate in extension startup when they expose the same lifecycle.
1652
+ */
1653
+ interface ExtensionServiceLifecycle$1 {
1654
+ /** Initialize the service when startup work is not constructor-owned. */
1655
+ init?(): Promise<void> | void;
1656
+ /** Destroy the service and release resources when teardown is required. */
1657
+ destroy?(): Promise<void> | void;
1658
+ /**
1659
+ * Called after the extension reaches active state.
1660
+ *
1661
+ * Returns zero or more {@link ExtensionWarning} entries describing integration
1662
+ * health issues the user may want to act on. An empty array (or omitting the
1663
+ * hook entirely) signals that the extension is fully healthy.
1664
+ * @returns Active health warnings, or an empty array when the extension is healthy.
1665
+ */
1666
+ checkHealth?(): Promise<ExtensionWarning[]> | ExtensionWarning[];
1667
+ }
1668
+ /**
1669
+ * Service shape returned by {@link MakaioExtension.create}.
1670
+ *
1671
+ * Any class that extends `BaseService` satisfies this interface structurally
1672
+ * because `BaseService` exposes the same lifecycle methods.
1673
+ */
1674
+ type ExtensionService$1 = ExtensionServiceLifecycle$1;
1675
+ //#endregion
1676
+ //#region core/contracts/src/extension/extension-context.d.ts
1677
+ /**
1678
+ * Generic context provided by a host runtime when creating an extension's service.
1679
+ *
1680
+ * Contains host-agnostic runtime seams: the bus instance, extension identity,
1681
+ * extension-local data directory, machine identity, config, service lookup, and
1682
+ * lifecycle controls. Host-specific environment details belong on explicit
1683
+ * context extensions such as {@link NodeExtensionContext}.
1684
+ */
1685
+ interface ExtensionContext$1<TBus extends MakaioBusLike = MakaioBusLike> {
1686
+ /** Bus instance for registering handlers and emitting events. */
1687
+ readonly bus: TBus;
1688
+ /** Coordinator-minted identity for the extension being created. */
1689
+ readonly identity: ExtensionIdentity;
1690
+ /**
1691
+ * Per-extension writable data directory resolved by the host runtime.
1692
+ *
1693
+ * Use this for extension-local persistence (caches, state files, etc.).
1694
+ */
1695
+ readonly dataDir: string;
1696
+ /**
1697
+ * Stable machine identifier used for machine-scoped persistence and
1698
+ * encryption key derivation.
1699
+ *
1700
+ * Resolved by the composition root (e.g., `node-machine-id`) before
1701
+ * extensions are started.
1702
+ */
1703
+ readonly machineId: string;
1704
+ /**
1705
+ * Resolved configuration for this extension, merged from stored values and
1706
+ * descriptor defaults. Present only when the extension declared a
1707
+ * `configSchema` on its {@link MakaioExtension}.
1708
+ *
1709
+ * Extensions should parse this with their Zod schema to get typed config:
1710
+ * ```ts
1711
+ * const config = parseExtensionConfig(MyConfigSchema, ctx.config);
1712
+ * ```
1713
+ */
1714
+ readonly config?: unknown;
1715
+ /**
1716
+ * Retrieve a service exposed by another active extension.
1717
+ * @param token - Extension-owned token identifying the desired service.
1718
+ * @returns The active service instance, or `undefined` when unavailable.
1719
+ */
1720
+ getService<T>(token: ExtensionToken$1<T>): T | undefined;
1721
+ /**
1722
+ * Attempt a dynamic import, returning `null` when the package is not installed.
1723
+ *
1724
+ * Only swallows errors caused by the package itself being absent. Transitive
1725
+ * dependency failures and module evaluation errors are re-thrown.
1726
+ * @typeParam T - Expected module shape (caller-asserted, not runtime-verified).
1727
+ * @param specifier - Package specifier to import.
1728
+ * @returns The imported module cast to `T`, or `null` when the package is not installed.
1729
+ */
1730
+ readonly tryImport: <T>(specifier: string) => Promise<T | null>;
1731
+ /**
1732
+ * Abort signal triggered during graceful shutdown.
1733
+ *
1734
+ * Extensions can pass this to long-running operations (fetch, timers, streams)
1735
+ * so they cancel promptly when the runtime is stopping.
1736
+ */
1737
+ readonly signal: AbortSignal;
1738
+ /**
1739
+ * Check whether an extension with the given name is active.
1740
+ *
1741
+ * Returns `true` when the named extension has been loaded and reached
1742
+ * `active` state. Use this for optional integration checks without
1743
+ * requiring an ExtensionToken.
1744
+ * @param name - Extension name to check.
1745
+ * @returns `true` when the extension is active.
1746
+ */
1747
+ readonly hasExtension: (name: string) => boolean;
1748
+ }
1749
+ /**
1750
+ * Node.js host extension context.
1751
+ *
1752
+ * Adds the OS and filesystem fields supplied by Node-based composition roots.
1753
+ * Extensions that need these fields should opt into this context explicitly;
1754
+ * host-agnostic extensions can type themselves against {@link ExtensionContext}.
1755
+ */
1756
+ interface NodeExtensionContext$1<TBus extends MakaioBusLike = MakaioBusLike> extends ExtensionContext$1<TBus> {
1757
+ /** Current platform identifier (e.g., `'darwin'`, `'linux'`, `'win32'`). */
1758
+ readonly platform: NodeJS.Platform;
1759
+ /** User's home directory path. */
1760
+ readonly homedir: string;
1761
+ /** Resolved `.makaio` directory root (e.g., `~/.makaio`). */
1762
+ readonly makaioHome: string;
1763
+ /** Current OS username. */
1764
+ readonly username: string;
1765
+ /**
1766
+ * WebSocket URL for the host bus, when the runtime exposes one.
1767
+ *
1768
+ * Detached `bus-websocket` extensions use this to connect back to the host.
1769
+ * Hosts without a WebSocket bus omit it.
1770
+ */
1771
+ readonly busUrl?: string;
1772
+ }
1773
+ //#endregion
1774
+ //#region core/contracts/src/extension/extension-cli.d.ts
1775
+ /**
1776
+ * Type-erased output channel used by extension-local CLI handlers.
1777
+ *
1778
+ * Runtime code exposes the fully typed helper API via `@makaio/kernel/cli`.
1779
+ */
1780
+ interface ExtensionCliOutputWriter {
1781
+ /** Write text to standard output. */
1782
+ write(text: string): void;
1783
+ /** Write text to standard error. */
1784
+ error(text: string): void;
1785
+ }
1786
+ /**
1787
+ * Type-erased handler context stored in the contracts layer.
1788
+ *
1789
+ * Runtime code provides the fully typed variant in `@makaio/kernel/cli`.
1790
+ */
1791
+ interface ExtensionCliHandlerContext<TBus extends MakaioBusLike = MakaioBusLike> {
1792
+ /** Parsed and validated command arguments/options. */
1793
+ readonly args: unknown;
1794
+ /**
1795
+ * Bus client connected to the running Makaio instance.
1796
+ *
1797
+ * `null` when the bus is unavailable and the contribution's `beforeRun`
1798
+ * hook opted into offline execution.
1799
+ */
1800
+ readonly bus: TBus | null;
1801
+ /** Output channel for writing to stdout and stderr. */
1802
+ readonly output: ExtensionCliOutputWriter;
1803
+ /** Abort signal triggered when the invocation is cancelled. */
1804
+ readonly signal: AbortSignal;
1805
+ /**
1806
+ * Set the process-style exit code for the current command invocation.
1807
+ * @param exitCode - Command exit code to report.
1808
+ */
1809
+ setExitCode(exitCode: number): void;
1810
+ }
1811
+ /**
1812
+ * Interactive entry context stored in the contracts layer.
1813
+ */
1814
+ interface ExtensionCliInteractiveContext<TBus extends MakaioBusLike = MakaioBusLike> {
1815
+ /**
1816
+ * Bus client connected to the running Makaio instance.
1817
+ *
1818
+ * `null` when the bus is unavailable and the contribution's `beforeRun`
1819
+ * hook opted into bus-optional execution.
1820
+ */
1821
+ readonly bus: TBus | null;
1822
+ /** Abort signal triggered when the interactive invocation is cancelled. */
1823
+ readonly signal: AbortSignal;
1824
+ }
1825
+ /**
1826
+ * Type-erased CLI subcommand entry for collection storage.
1827
+ *
1828
+ * See `@makaio/kernel/cli` for the full typed API including
1829
+ * `defineCliSubcommand`.
1830
+ */
1831
+ interface ExtensionCliSubcommandEntry<TBus extends MakaioBusLike = MakaioBusLike> {
1832
+ /** Subcommand name. */
1833
+ readonly name: string;
1834
+ /** One-line description shown in help text. */
1835
+ readonly description: string;
1836
+ /** Minimal parse-only schema contract kept free of runtime Zod APIs. */
1837
+ readonly schema: {
1838
+ parse(v: unknown): unknown;
1839
+ };
1840
+ /** Handler invoked with the type-erased CLI execution context. */
1841
+ readonly handler: (ctx: ExtensionCliHandlerContext<TBus>) => Promise<void>;
1842
+ }
1843
+ /**
1844
+ * Type-erased context for the {@link ExtensionCliContribution.beforeRun} gate.
1845
+ */
1846
+ interface ExtensionCliBeforeRunContext<TBus extends MakaioBusLike = MakaioBusLike> {
1847
+ /** Subcommand name, or `'__interactive__'` for bare interactive invocations. */
1848
+ readonly subcommandName: string;
1849
+ /** Parsed and validated arguments for the subcommand. */
1850
+ readonly args: Record<string, unknown>;
1851
+ /** Bus client, or `null` when the server is unreachable. */
1852
+ readonly bus: TBus | null;
1853
+ }
1854
+ /**
1855
+ * Type-erased result of an {@link ExtensionCliContribution.beforeRun} gate.
1856
+ */
1857
+ type ExtensionCliBeforeRunResult = {
1858
+ readonly proceed: true;
1859
+ } | {
1860
+ readonly proceed: false;
1861
+ readonly message: string;
1862
+ readonly exitCode?: number;
1863
+ };
1864
+ /**
1865
+ * An extension's CLI contribution declared in its `MakaioExtension` manifest.
1866
+ *
1867
+ * Full implementation types live in `@makaio/kernel/cli`. This contract
1868
+ * keeps the extension layer on the executable shape only.
1869
+ */
1870
+ interface ExtensionCliContribution<TBus extends MakaioBusLike = MakaioBusLike> extends CliManifest {
1871
+ /**
1872
+ * Interactive TUI launched when the command is invoked without a subcommand.
1873
+ */
1874
+ readonly interactive?: (ctx: ExtensionCliInteractiveContext<TBus>) => Promise<void>;
1875
+ /** Declared subcommands exposed by this contribution. */
1876
+ readonly subcommands: ReadonlyArray<ExtensionCliSubcommandEntry<TBus>>;
1877
+ /**
1878
+ * Pre-execution gate that replaces the default bus-required check.
1879
+ * @param context - Subcommand name, parsed args, and bus availability.
1880
+ * @returns Whether to proceed or block with a message.
1881
+ */
1882
+ readonly beforeRun?: (context: ExtensionCliBeforeRunContext<TBus>) => ExtensionCliBeforeRunResult | Promise<ExtensionCliBeforeRunResult>;
1883
+ }
1884
+ //#endregion
1885
+ //#region core/contracts/src/extension/extension-runtime-boot.d.ts
1886
+ /**
1887
+ * Runtime subsystems with exactly one executable owner per boot.
1888
+ *
1889
+ * These declarations are runtime-owned metadata on {@link MakaioExtension},
1890
+ * not descriptor discovery metadata. Boot uses them to select default
1891
+ * framework packages only when no loaded extension provides the same
1892
+ * executable responsibility.
1893
+ */
1894
+ interface ExtensionRuntimeOwnership {
1895
+ /** Owns the `session.sendMessage` orchestration handlers for this runtime. */
1896
+ readonly sessionOrchestrator?: boolean;
1897
+ }
1898
+ //#endregion
1899
+ //#region core/contracts/src/extension/contributions/session-event-action-types.d.ts
1900
+ /** Keyboard modifier flags for an action shortcut. */
1901
+ interface ActionShortcutModifiers {
1902
+ /** Meta/Command key. */
1903
+ meta?: boolean;
1904
+ /** Alt/Option key. */
1905
+ alt?: boolean;
1906
+ /** Shift key. */
1907
+ shift?: boolean;
1908
+ /** Control key. */
1909
+ ctrl?: boolean;
1910
+ }
1911
+ /** Full keyboard shortcut definition including modifiers and display metadata. */
1912
+ interface ActionShortcut extends ActionShortcutModifiers {
1913
+ /** Primary key character or name. */
1914
+ key: string;
1915
+ /** Human-readable label shown in keyboard shortcut hints. */
1916
+ label: string;
1917
+ /** Category grouping for the shortcut. */
1918
+ category: ActionCategory;
1919
+ /** Optional human-readable description. */
1920
+ description?: string;
1921
+ /** Whether the shortcut should not activate while focus is in an input field. */
1922
+ skipInInputs?: boolean;
1923
+ /** Optional context scope string or list of scopes. */
1924
+ context?: string | string[];
1925
+ }
1926
+ /**
1927
+ * Extension point for registering custom action categories.
1928
+ *
1929
+ * Extend via declaration merging from packages or UI layers.
1930
+ * @example
1931
+ * ```typescript
1932
+ * declare module '@makaio/framework/contracts' {
1933
+ * interface ActionCategoryMap {
1934
+ * timeline: true;
1935
+ * }
1936
+ * }
1937
+ * ```
1938
+ */
1939
+ interface ActionCategoryMap {
1940
+ /** Default category for uncategorized actions. */
1941
+ general: true;
1942
+ }
1943
+ type RegisteredActionCategory = keyof ActionCategoryMap & string;
1944
+ /** Resolved action category type, extensible via {@link ActionCategoryMap} declaration merging. */
1945
+ type ActionCategory = RegisteredActionCategory;
1946
+ /** Allowed message role values for event action entrypoints. */
1947
+ type MessageRole = 'user' | 'assistant';
1948
+ /** Event filter that matches message events with optional role restriction. */
1949
+ interface MessageEventFilter {
1950
+ /** Discriminant: must be `'message'`. */
1951
+ eventType: 'message';
1952
+ /** Optional list of message roles this filter applies to. */
1953
+ messageRole?: MessageRole[];
1954
+ }
1955
+ /** All core session event types except `'message'`. */
1956
+ type StructuralEventType = Exclude<(typeof SESSION_EVENT_TYPES)[number], 'message'>;
1957
+ /** Event filter that matches structural (non-message) session events. */
1958
+ interface StructuralEventFilter {
1959
+ /** The specific structural event type to match. */
1960
+ eventType: StructuralEventType;
1961
+ }
1962
+ /** Union of message and structural event filters. */
1963
+ type EventFilter = MessageEventFilter | StructuralEventFilter;
1964
+ /**
1965
+ * Context passed to a session event action factory.
1966
+ * @typeParam TBus - Host bus shape supplied by the runtime.
1967
+ */
1968
+ interface SessionEventActionContext<TBus extends MakaioBusLike = MakaioBusLike> {
1969
+ /** Bus instance for registering action handlers. */
1970
+ bus: TBus;
1971
+ /** Name of the extension registering the action. */
1972
+ extensionName: string;
1973
+ /**
1974
+ * Register one executable action with the owning session-event-action service.
1975
+ *
1976
+ * The service package owns the bus subjects and callback plumbing; extension
1977
+ * contributors receive this factory through the contribution context instead
1978
+ * of importing service implementation modules directly.
1979
+ * @param options - Action declaration and runtime callbacks.
1980
+ * @returns Serializable declaration plus unregister hook.
1981
+ */
1982
+ createAction: <TMode extends 'single' | 'multi', TRoles extends MessageRole[]>(options: SessionEventActionOptions<TMode, TRoles, TBus>) => CreateSessionEventActionResult;
1983
+ }
1984
+ /**
1985
+ * Context passed to a session event action's `when` predicate.
1986
+ * @typeParam TRoles - Message roles accepted by the action entrypoint.
1987
+ * @typeParam TBus - Host bus shape supplied by the runtime.
1988
+ */
1989
+ interface WhenContext<TRoles extends MessageRole[] = MessageRole[], TBus extends MakaioBusLike = MakaioBusLike> {
1990
+ /** The message event that triggered the predicate check. */
1991
+ message: SessionMessage$1 & {
1992
+ role: TRoles[number];
1993
+ };
1994
+ /** Active session identifier. */
1995
+ sessionId: string;
1996
+ /** Bus instance for runtime queries. */
1997
+ bus: TBus;
1998
+ }
1999
+ /**
2000
+ * Context passed to a session event action's `onPickerOpen` callback.
2001
+ * @typeParam TRoles - Message roles accepted by the action entrypoint.
2002
+ * @typeParam TBus - Host bus shape supplied by the runtime.
2003
+ */
2004
+ interface PickerOpenContext<TRoles extends MessageRole[] = MessageRole[], TBus extends MakaioBusLike = MakaioBusLike> {
2005
+ /** Entrypoint information for the action. */
2006
+ entrypoint: {
2007
+ /** The message that was actioned. */messageId: string; /** Full message object. */
2008
+ message: SessionMessage$1 & {
2009
+ role: TRoles[number];
2010
+ };
2011
+ };
2012
+ /** Active session identifier. */
2013
+ sessionId: string;
2014
+ /** Active project identifier. */
2015
+ projectId?: string;
2016
+ /** Bus instance for runtime queries. */
2017
+ bus: TBus;
2018
+ }
2019
+ /** Configuration returned by `onPickerOpen` to control the event picker UI. */
2020
+ interface PickerConfig {
2021
+ /** Event IDs that should be pre-selected when the picker opens. */
2022
+ preSelectedEventIds?: string[];
2023
+ /** Maximum number of events that can be selected. */
2024
+ maxSelections?: number;
2025
+ /** Custom title for the picker dialog. */
2026
+ title?: string;
2027
+ }
2028
+ /**
2029
+ * Context passed to a session event action's `onSelectionChange` callback.
2030
+ * @typeParam TBus - Host bus shape supplied by the runtime.
2031
+ */
2032
+ interface SelectionChangeContext<TBus extends MakaioBusLike = MakaioBusLike> {
2033
+ /** Currently selected session events. */
2034
+ selectedEvents: MakaioSessionEvent$1[];
2035
+ /** Entrypoint information for the action. */
2036
+ entrypoint: {
2037
+ /** The message that was actioned. */messageId: string; /** Full message object. */
2038
+ message: SessionMessage$1;
2039
+ };
2040
+ /** Active session identifier. */
2041
+ sessionId: string;
2042
+ /** Bus instance for runtime queries. */
2043
+ bus: TBus;
2044
+ }
2045
+ /** Feedback returned by `onSelectionChange` to inform the picker UI. */
2046
+ interface SelectionFeedback {
2047
+ /** Estimated token count for the selected events. */
2048
+ tokenEstimate?: number;
2049
+ /** Warning message to display in the picker. */
2050
+ warning?: string;
2051
+ /** Error message that blocks confirmation. */
2052
+ error?: string;
2053
+ }
2054
+ /** Context passed to a session event action's `onExecute` callback. */
2055
+ interface ExecuteContext<TMode extends 'single' | 'multi' = 'single' | 'multi', TRoles extends MessageRole[] = MessageRole[], TBus extends MakaioBusLike = MakaioBusLike> {
2056
+ /** Entrypoint information for the action. */
2057
+ entrypoint: {
2058
+ /** The message that was actioned. */messageId: string; /** Full message object. */
2059
+ message: SessionMessage$1 & {
2060
+ role: TRoles[number];
2061
+ };
2062
+ };
2063
+ /** Selected events when in multi-selection mode, otherwise `undefined`. */
2064
+ selectedEvents: TMode extends 'multi' ? MakaioSessionEvent$1[] : undefined;
2065
+ /** Active session identifier. */
2066
+ sessionId: string;
2067
+ /** Active project identifier. */
2068
+ projectId?: string;
2069
+ /** Bus instance for runtime queries. */
2070
+ bus: TBus;
2071
+ }
2072
+ /** Result returned by a session event action's `onExecute` callback. */
2073
+ interface ExecuteResult {
2074
+ /** Whether execution succeeded. */
2075
+ success: boolean;
2076
+ /** Human-readable error message when `success` is `false`. */
2077
+ error?: string;
2078
+ }
2079
+ /** Configuration for a session event action's message entrypoint. */
2080
+ interface EntrypointConfig<TRoles extends MessageRole[] = MessageRole[]> {
2081
+ /** Allowed message roles that can trigger this action. */
2082
+ messageRole: TRoles;
2083
+ }
2084
+ /** Full options for defining a session event action. */
2085
+ interface SessionEventActionOptions<TMode extends 'single' | 'multi' = 'single' | 'multi', TRoles extends MessageRole[] = MessageRole[], TBus extends MakaioBusLike = MakaioBusLike> {
2086
+ /** Unique action identifier within the registering package. */
2087
+ id: string;
2088
+ /** Display label for the action. */
2089
+ label: string;
2090
+ /** Optional human-readable description. */
2091
+ description?: string;
2092
+ /** Optional icon identifier. */
2093
+ icon?: string;
2094
+ /** Message entrypoint configuration. */
2095
+ entrypoint: EntrypointConfig<TRoles>;
2096
+ /** Whether this action operates on a single event or multiple events. */
2097
+ selectionMode: TMode;
2098
+ /** Event type filters for multi-selection mode. */
2099
+ applicableTo?: TMode extends 'multi' ? EventFilter[] : never;
2100
+ /**
2101
+ * Optional predicate that determines whether the action is available.
2102
+ * @param ctx - Context with the triggering message.
2103
+ * @returns `true` when the action should be shown.
2104
+ */
2105
+ when?: (ctx: WhenContext<TRoles, TBus>) => Promise<boolean>;
2106
+ /**
2107
+ * Optional callback invoked when the event picker opens.
2108
+ * @param ctx - Context with entrypoint and session info.
2109
+ * @returns Picker configuration, `false` to cancel, or `void`.
2110
+ */
2111
+ onPickerOpen?: TMode extends 'multi' ? (ctx: PickerOpenContext<TRoles, TBus>) => Promise<PickerConfig | false | void> : never;
2112
+ /**
2113
+ * Optional callback invoked when the event selection changes.
2114
+ * @param ctx - Context with selected events.
2115
+ * @returns Selection feedback to display in the picker.
2116
+ */
2117
+ onSelectionChange?: TMode extends 'multi' ? (ctx: SelectionChangeContext<TBus>) => Promise<SelectionFeedback | void> : never;
2118
+ /** Category grouping for this action. */
2119
+ category?: ActionCategory;
2120
+ /** Optional keyboard shortcut. */
2121
+ shortcut?: ActionShortcut;
2122
+ /**
2123
+ * Main execution callback invoked when the action is confirmed.
2124
+ * @param ctx - Context with entrypoint, selected events, and bus.
2125
+ * @returns Execution result, or `void` on success.
2126
+ */
2127
+ onExecute: (ctx: ExecuteContext<TMode, TRoles, TBus>) => Promise<ExecuteResult | void>;
2128
+ }
2129
+ /** Serializable declaration stored in registries and emitted over the bus. */
2130
+ interface SessionEventActionDeclaration {
2131
+ /** Unique action identifier. */
2132
+ id: string;
2133
+ /** Display label. */
2134
+ label: string;
2135
+ /** Optional description. */
2136
+ description?: string;
2137
+ /** Optional icon identifier. */
2138
+ icon?: string;
2139
+ /** Entrypoint configuration. */
2140
+ entrypoint: EntrypointConfig;
2141
+ /** Selection mode. */
2142
+ selectionMode: 'single' | 'multi';
2143
+ /** Event type filters (multi mode only). */
2144
+ applicableTo?: EventFilter[];
2145
+ /** Whether a `when` predicate was provided. */
2146
+ hasWhenPredicate: boolean;
2147
+ /** Whether an `onPickerOpen` callback was provided. */
2148
+ hasPickerOpenCallback: boolean;
2149
+ /** Whether an `onSelectionChange` callback was provided. */
2150
+ hasSelectionChangeCallback: boolean;
2151
+ /** Resolved action category. */
2152
+ category: ActionCategory;
2153
+ /** Optional keyboard shortcut. */
2154
+ shortcut?: ActionShortcut;
2155
+ }
2156
+ /** Return value from `createSessionEventAction` — declaration plus unregister hook. */
2157
+ interface CreateSessionEventActionResult {
2158
+ /** Serializable declaration for registry and bus publication. */
2159
+ declaration: SessionEventActionDeclaration;
2160
+ /** Unregisters the action and cleans up bus subscriptions. */
2161
+ unregister: () => void;
2162
+ }
2163
+ //#endregion
2164
+ //#region core/contracts/src/extension/contributions/hash-trigger-types.d.ts
2165
+ /** Pipeline stage a hash trigger participates in. */
2166
+ type HashTriggerStage = 'gather' | 'transform' | 'action';
2167
+ /** Single suggestion entry returned by a hash trigger's suggest call. */
2168
+ interface HashSuggestion {
2169
+ /** Display label shown in the completion UI. */
2170
+ label: string;
2171
+ /** Human-readable explanation of the suggestion. */
2172
+ description: string;
2173
+ /** Whether this suggestion is a leaf (directly usable) or a group (opens sub-list). */
2174
+ kind: 'leaf' | 'group';
2175
+ /** Text inserted into the input when the suggestion is accepted. */
2176
+ insertText: string;
2177
+ /** Underlying value passed to execute when the suggestion is used. */
2178
+ value: string;
2179
+ /** Optional icon identifier for the suggestion entry. */
2180
+ icon?: string;
2181
+ /** Pipeline stage override for this particular suggestion. */
2182
+ stage?: HashTriggerStage;
2183
+ }
2184
+ /** A single entry gathered by a gather-stage hash trigger. */
2185
+ interface GatheredEntry {
2186
+ /** Gathered content string. */
2187
+ content: string;
2188
+ /** Prefix token that matched this entry. */
2189
+ prefix: string;
2190
+ /** Argument portion of the matched hash value. */
2191
+ argument: string;
2192
+ /** Optional arbitrary metadata from the gatherer. */
2193
+ metadata?: Record<string, unknown>;
2194
+ }
2195
+ /** Snapshot of all entries gathered by gather-stage triggers in this pipeline run. */
2196
+ interface GatheredContext {
2197
+ /** Immutable map of prefix → entry. */
2198
+ entries: ReadonlyMap<string, GatheredEntry>;
2199
+ }
2200
+ /**
2201
+ * Context passed to a hash trigger's suggest and execute methods.
2202
+ * @typeParam TBus - Host bus shape supplied by the runtime.
2203
+ */
2204
+ interface HashTriggerContext<TBus extends MakaioBusLike = MakaioBusLike> {
2205
+ /** Active session identifier, if any. */
2206
+ sessionId?: string;
2207
+ /** Active project identifier, if any. */
2208
+ projectId?: string;
2209
+ /** Current message text. */
2210
+ message?: string;
2211
+ /** Bus instance for trigger operations. */
2212
+ bus: TBus;
2213
+ /** Optional abort signal for cancellable operations. */
2214
+ signal?: AbortSignal;
2215
+ /** Entries gathered by earlier gather-stage triggers. */
2216
+ gathered?: GatheredContext;
2217
+ }
2218
+ /** Static descriptor for a registered hash trigger. */
2219
+ interface HashTriggerMetadata {
2220
+ /** Prefix token this trigger responds to (e.g. `'@'`, `'#'`). */
2221
+ prefix: string;
2222
+ /** Human-readable explanation of what this trigger does. */
2223
+ description: string;
2224
+ /** Semantic version of this trigger. */
2225
+ version: string;
2226
+ /** Pipeline stage this trigger participates in. */
2227
+ stage?: HashTriggerStage;
2228
+ /** Names of triggers that must run before this one. */
2229
+ runAfter?: string[];
2230
+ }
2231
+ /** Return value from a hash trigger's suggest call. */
2232
+ interface HashTriggerSuggestResult {
2233
+ /** Suggested completions. */
2234
+ suggestions: HashSuggestion[];
2235
+ /** Optional metadata about the result set. */
2236
+ metadata?: {
2237
+ /** Whether the result set was truncated due to size limits. */truncated?: boolean;
2238
+ };
2239
+ }
2240
+ /**
2241
+ * A registered hash trigger that can suggest completions and execute values.
2242
+ *
2243
+ * Implement this interface and return instances from
2244
+ * `MakaioExtension.triggers.createTriggers` so the runtime registers them
2245
+ * with the HashTriggerService.
2246
+ * @typeParam TBus - Host bus shape supplied by the runtime.
2247
+ */
2248
+ interface HashTrigger<TBus extends MakaioBusLike = MakaioBusLike> {
2249
+ /** Static descriptor used for registration and pipeline ordering. */
2250
+ metadata: HashTriggerMetadata;
2251
+ /**
2252
+ * Return completion suggestions for the current query.
2253
+ * @param query - Text typed after the prefix token.
2254
+ * @param context - Runtime context for this suggestion request.
2255
+ * @returns Suggestion list with optional pagination metadata.
2256
+ */
2257
+ suggest(query: string, context: HashTriggerContext<TBus>): Promise<HashTriggerSuggestResult>;
2258
+ /**
2259
+ * Execute the selected value (optional).
2260
+ *
2261
+ * Called when the user accepts a suggestion whose `kind` is `'leaf'`.
2262
+ * @param value - The accepted suggestion's `value` field.
2263
+ * @param context - Runtime context for this execution.
2264
+ * @returns Resolved content string inserted into the message.
2265
+ */
2266
+ execute?(value: string, context: HashTriggerContext<TBus>): Promise<string>;
2267
+ }
2268
+ //#endregion
2269
+ //#region core/contracts/src/extension/contributions/ui-context-types.d.ts
2270
+ /**
2271
+ * Extension point for UI scope identifiers.
2272
+ *
2273
+ * Hosts and extensions add host-specific scopes via declaration
2274
+ * merging. Framework defaults stay host-agnostic.
2275
+ */
2276
+ interface UiScopeMap {
2277
+ /** Available in framework-global contexts. */
2278
+ global: true;
2279
+ /** Available regardless of active UI context. */
2280
+ any: true;
2281
+ }
2282
+ /** UI scope identifier, extensible via {@link UiScopeMap}. */
2283
+ type UiScope$1 = keyof UiScopeMap & string;
2284
+ /**
2285
+ * Extension point for UI navigation levels.
2286
+ *
2287
+ * Hosts add domain levels through declaration merging.
2288
+ */
2289
+ interface UiNavigationLevelMap {
2290
+ /** Root shell level with no host context implied. */
2291
+ root: true;
2292
+ /** Available at every registered navigation level. */
2293
+ any: true;
2294
+ }
2295
+ /** UI navigation level, extensible via {@link UiNavigationLevelMap}. */
2296
+ type UiNavigationLevel$1 = keyof UiNavigationLevelMap & string;
2297
+ /**
2298
+ * Runtime UI navigation level.
2299
+ *
2300
+ * Runtime context snapshots describe the active renderer surface. The `'any'`
2301
+ * level is reserved for definition matching and is never an active navigation
2302
+ * level.
2303
+ */
2304
+ type UiRuntimeNavigationLevel = Exclude<UiNavigationLevel$1, 'any'>;
2305
+ /**
2306
+ * Extension point for typed UI context values.
2307
+ *
2308
+ * Keys are context dimensions; values are the serializable values exposed for
2309
+ * that dimension in a host context snapshot.
2310
+ */
2311
+ interface UiContextValueMap {
2312
+ /** Active session identifier, if the framework shell has one. */
2313
+ session: string;
2314
+ }
2315
+ /** UI context dimension identifier, extensible via {@link UiContextValueMap}. */
2316
+ type UiContextDimension = keyof UiContextValueMap & string;
2317
+ /** Snapshot of host UI context passed to contributed UI. */
2318
+ interface UiContextSnapshot$1 {
2319
+ /** Active navigation level for the renderer surface. */
2320
+ readonly level: UiRuntimeNavigationLevel;
2321
+ /** Active context values keyed by registered context dimension. */
2322
+ readonly values: Partial<{ readonly [K in UiContextDimension]: UiContextValueMap[K] | null }>;
2323
+ }
2324
+ //#endregion
2325
+ //#region core/contracts/src/extension/contributions/tile-types.d.ts
2326
+ /** Optional feature flags a tile can declare. */
2327
+ interface TileCapabilities {
2328
+ /** Whether this tile supports fullscreen mode. */
2329
+ supportsFullscreen?: boolean;
2330
+ }
2331
+ /**
2332
+ * Props passed to tile components.
2333
+ *
2334
+ * Tiles do not receive host context as direct props; hosts expose context
2335
+ * through their UI runtime.
2336
+ */
2337
+ interface TileProps {
2338
+ /** Optional class name for styling. */
2339
+ className?: string;
2340
+ }
2341
+ /**
2342
+ * Icon loader for a tile.
2343
+ *
2344
+ * Lazy-loads an icon component (typically from `lucide-react`).
2345
+ * @example
2346
+ * ```typescript
2347
+ * icon: () => import('lucide-react').then(m => ({ default: m.Terminal }))
2348
+ * ```
2349
+ */
2350
+ type TileIconLoader = () => Promise<{
2351
+ default: ComponentType<{
2352
+ size?: number;
2353
+ }>;
2354
+ }>;
2355
+ /**
2356
+ * Platform renderers for a tile.
2357
+ *
2358
+ * SEAM: Currently supports React; additional platforms can be added as optional
2359
+ * keys without breaking existing declarations.
2360
+ */
2361
+ interface TileRenderers {
2362
+ /**
2363
+ * React renderer for the web UI.
2364
+ *
2365
+ * Lazy-loaded component module with a default export that accepts
2366
+ * {@link TileProps}.
2367
+ */
2368
+ react: () => Promise<{
2369
+ default: ComponentType<TileProps>;
2370
+ }>;
2371
+ /**
2372
+ * SEAM: Future platform renderers (e.g. `reactNative`, `electron`).
2373
+ *
2374
+ * Additional platforms can be added here as optional keys.
2375
+ */
2376
+ [platform: string]: (() => Promise<{
2377
+ default: ComponentType<TileProps>;
2378
+ }>) | undefined;
2379
+ }
2380
+ /**
2381
+ * Tile declaration contributed by a package.
2382
+ *
2383
+ * Packages declare tiles they provide for pane placement. These are registered
2384
+ * with `TileRegistry` and shown in the "Add Pane" palette.
2385
+ * @example
2386
+ * ```typescript
2387
+ * const terminalExtension: MakaioExtension = {
2388
+ * name: 'terminal',
2389
+ * ui: {
2390
+ * tiles: [
2391
+ * {
2392
+ * id: 'status',
2393
+ * name: 'Status',
2394
+ * description: 'Runtime status panel',
2395
+ * scope: 'global',
2396
+ * icon: () => import('lucide-react').then(m => ({ default: m.Activity })),
2397
+ * allowMultiple: true,
2398
+ * capabilities: { supportsFullscreen: true },
2399
+ * renderers: {
2400
+ * react: () => import('./ui/StatusTile.js'),
2401
+ * },
2402
+ * },
2403
+ * ],
2404
+ * },
2405
+ * };
2406
+ * ```
2407
+ */
2408
+ interface TileDeclaration {
2409
+ /**
2410
+ * Unique tile identifier.
2411
+ *
2412
+ * Must be unique across all packages. Use the package name as a prefix to
2413
+ * avoid collisions.
2414
+ * @example `'status'`, `'session-summary'`
2415
+ */
2416
+ id: string;
2417
+ /**
2418
+ * Display name for the tile.
2419
+ *
2420
+ * Human-readable name shown in the "Add Pane" palette.
2421
+ * @example `'Status'`, `'Session Summary'`
2422
+ */
2423
+ name: string;
2424
+ /**
2425
+ * Optional description of tile purpose.
2426
+ *
2427
+ * Shown in the "Add Pane" palette below the name.
2428
+ */
2429
+ description?: string;
2430
+ /**
2431
+ * Tile scope — where the tile is available.
2432
+ *
2433
+ * Defaults to `'any'` when not specified.
2434
+ */
2435
+ scope?: UiScope$1;
2436
+ /**
2437
+ * Icon loader for the tile.
2438
+ *
2439
+ * Lazy-loads an icon component for the "Add Pane" palette. Required for
2440
+ * tiles to appear in the palette.
2441
+ */
2442
+ icon: TileIconLoader;
2443
+ /**
2444
+ * Whether multiple instances of this tile are allowed simultaneously.
2445
+ *
2446
+ * Defaults to `true`. When `false`, only one instance can exist at a time.
2447
+ */
2448
+ allowMultiple?: boolean;
2449
+ /** Optional capability flags for the tile. */
2450
+ capabilities?: TileCapabilities;
2451
+ /**
2452
+ * Context dimensions this tile's state depends on.
2453
+ *
2454
+ * When declared, the host can remount the tile when any listed dimension
2455
+ * changes to prevent stale in-memory state from leaking across contexts.
2456
+ */
2457
+ contextDependencies?: UiContextDimension[];
2458
+ /**
2459
+ * Platform-specific renderers.
2460
+ *
2461
+ * Maps platform names to lazy-loaded component modules. At minimum, the
2462
+ * `'react'` platform is required for the web UI.
2463
+ */
2464
+ renderers: TileRenderers;
2465
+ }
2466
+ //#endregion
2467
+ //#region core/contracts/src/extension/contributions/widget-types.d.ts
2468
+ /**
2469
+ * Widget size variants.
2470
+ *
2471
+ * Defines the visual footprint a widget can occupy in a layout.
2472
+ * - `'small'`: Minimal space, suitable for status indicators
2473
+ * - `'medium'`: Standard panel size, default for most widgets
2474
+ * - `'large'`: Expanded view, for detailed information
2475
+ * - `'full-width'`: Spans the full available width
2476
+ */
2477
+ type WidgetSize$1 = 'small' | 'medium' | 'large' | 'full-width';
2478
+ /**
2479
+ * Serializable widget definition.
2480
+ *
2481
+ * Platform-agnostic description of what data a widget needs and how it
2482
+ * behaves. This definition can be serialized and stored in user preferences.
2483
+ */
2484
+ interface WidgetDefinition {
2485
+ /**
2486
+ * Bus subject for the widget's data source.
2487
+ *
2488
+ * Optional — widgets can render without dynamic data (e.g. static controls).
2489
+ * When provided, the widget requests data from this subject.
2490
+ */
2491
+ dataSource?: string;
2492
+ /**
2493
+ * Events that trigger a widget refresh.
2494
+ *
2495
+ * List of bus event subjects that cause the widget to refresh its data.
2496
+ * @example `['session.updated', 'extension.stateChanged']`
2497
+ */
2498
+ refreshOn?: string[];
2499
+ /**
2500
+ * Supported size variants for this widget.
2501
+ *
2502
+ * Must include at least one size and must include `defaultSize`.
2503
+ */
2504
+ sizes: WidgetSize$1[];
2505
+ /**
2506
+ * Default size when the widget is first added to a layout.
2507
+ *
2508
+ * Must be one of the values in {@link sizes}.
2509
+ */
2510
+ defaultSize: WidgetSize$1;
2511
+ }
2512
+ /**
2513
+ * Props passed to widget components.
2514
+ * @typeParam TData - Type of data from the widget's data source, if any.
2515
+ */
2516
+ interface WidgetProps<TData = unknown> {
2517
+ /** The widget's definition (from declaration). */
2518
+ definition: WidgetDefinition;
2519
+ /** Current size of this widget instance. */
2520
+ size: WidgetSize$1;
2521
+ /** Data from the widget's data source (when `dataSource` is defined). */
2522
+ data?: TData;
2523
+ /** Active host UI context for this widget surface. */
2524
+ uiContext: UiContextSnapshot$1;
2525
+ }
2526
+ /**
2527
+ * Framework-agnostic UI component shape for lazy widget modules.
2528
+ *
2529
+ * Kept free of React imports so the contracts package does not force React
2530
+ * types onto non-web consumers. React function components are structurally
2531
+ * assignable to the call signature.
2532
+ */
2533
+ type WidgetComponent = ((props: WidgetProps) => unknown) | (new (props: WidgetProps) => unknown);
2534
+ /** Lazy widget component loader. */
2535
+ type WidgetComponentLoader = () => Promise<{
2536
+ default: WidgetComponent;
2537
+ }>;
2538
+ /**
2539
+ * Platform renderers for a widget.
2540
+ *
2541
+ * SEAM: Currently supports React; additional platforms can be added as optional
2542
+ * keys without breaking existing declarations.
2543
+ */
2544
+ interface WidgetRenderers {
2545
+ /**
2546
+ * React renderer for the web UI.
2547
+ *
2548
+ * Lazy-loaded component module with a default export that accepts
2549
+ * `WidgetProps<TData>` where `TData` matches the `dataSource` response.
2550
+ */
2551
+ react: WidgetComponentLoader;
2552
+ /**
2553
+ * SEAM: Future platform renderers (e.g. `reactNative`, `electron`).
2554
+ *
2555
+ * Additional platforms can be added here as optional keys.
2556
+ */
2557
+ [platform: string]: WidgetComponentLoader | undefined;
2558
+ }
2559
+ /**
2560
+ * Widget declaration contributed by a package.
2561
+ *
2562
+ * Packages declare widgets they provide. These are collected into a global
2563
+ * catalog that the UI system uses to populate focus contexts.
2564
+ * @example
2565
+ * ```typescript
2566
+ * const statusExtension: MakaioExtension = {
2567
+ * name: 'status-panel',
2568
+ * ui: {
2569
+ * widgets: [
2570
+ * {
2571
+ * id: 'status-summary',
2572
+ * name: 'Status Summary',
2573
+ * description: 'Shows current runtime status',
2574
+ * scope: 'global',
2575
+ * definition: {
2576
+ * dataSource: 'runtime.getStatus',
2577
+ * refreshOn: ['runtime.ready', 'extension.stateChanged'],
2578
+ * sizes: ['small', 'medium', 'large'],
2579
+ * defaultSize: 'medium',
2580
+ * },
2581
+ * renderers: {
2582
+ * react: () => import('./widgets/StatusSummary.js'),
2583
+ * },
2584
+ * },
2585
+ * ],
2586
+ * },
2587
+ * };
2588
+ * ```
2589
+ */
2590
+ interface WidgetDeclaration {
2591
+ /**
2592
+ * Unique widget identifier.
2593
+ *
2594
+ * Must be unique across all packages. Use the package name as a prefix to
2595
+ * avoid collisions.
2596
+ * @example `'status-summary'`, `'session-activity'`
2597
+ */
2598
+ id: string;
2599
+ /**
2600
+ * Display name for the widget.
2601
+ *
2602
+ * Human-readable name shown in UI when users browse available widgets.
2603
+ */
2604
+ name: string;
2605
+ /**
2606
+ * Optional description of widget purpose.
2607
+ *
2608
+ * Provides additional context about what the widget displays and when to
2609
+ * use it.
2610
+ */
2611
+ description?: string;
2612
+ /**
2613
+ * Widget scope identifier.
2614
+ *
2615
+ * Defaults to `'global'` when not specified.
2616
+ */
2617
+ scope?: UiScope$1;
2618
+ /**
2619
+ * Serializable widget definition.
2620
+ *
2621
+ * Describes the widget's data needs and behavior without platform-specific
2622
+ * details. Can be serialized and stored in user preferences.
2623
+ */
2624
+ definition: WidgetDefinition;
2625
+ /**
2626
+ * Platform-specific renderers.
2627
+ *
2628
+ * Maps platform names to lazy-loaded component modules. At minimum, the
2629
+ * `'react'` platform is required for the web UI.
2630
+ */
2631
+ renderers: WidgetRenderers;
2632
+ }
2633
+ //#endregion
2634
+ //#region core/contracts/src/extension/contributions/page-types.d.ts
2635
+ /**
2636
+ * Widget size values used for slot declarations in page layouts.
2637
+ */
2638
+ type WidgetSize = 'small' | 'medium' | 'large' | 'full-width';
2639
+ /**
2640
+ * Normalized slot identifiers for page layout regions.
2641
+ */
2642
+ type SlotId = 'main' | 'sidebar-left' | 'sidebar-right' | 'detail-panel' | 'bottom-panel' | 'widget-zone';
2643
+ /**
2644
+ * Page mode controlling sidebar navigation behavior.
2645
+ *
2646
+ * - `'switch'`: Takes over the workspace; shown in the sidebar "Navigate" section
2647
+ * - `'peek'`: Small overlay that preserves existing state
2648
+ * - `'cover'`: Full-viewport overlay that preserves existing state
2649
+ */
2650
+ type PageMode = 'switch' | 'peek' | 'cover';
2651
+ /** Props passed to all page components. */
2652
+ interface PageComponentProps {
2653
+ /** Optional CSS class name for the page container. */
2654
+ className?: string;
2655
+ /** Current internal route within the page. */
2656
+ internalRoute?: string | null;
2657
+ /**
2658
+ * Callback for internal navigation within the page.
2659
+ * @param route - The new internal route path.
2660
+ */
2661
+ onNavigate?: (route: string) => void;
2662
+ }
2663
+ /** Slot definition for package declarations (fully serializable). */
2664
+ interface SlotDeclaration {
2665
+ /** Slot identifier. */
2666
+ id: SlotId;
2667
+ /** Human-readable slot name. */
2668
+ name: string;
2669
+ /** Sizes accepted by this slot. */
2670
+ acceptsSizes: WidgetSize[];
2671
+ /** Minimum column width in pixels. */
2672
+ minColumnWidth: number;
2673
+ /** Maximum number of columns. */
2674
+ maxColumns: number;
2675
+ /** Whether the slot can be collapsed. */
2676
+ collapsible?: boolean;
2677
+ /** Whether the slot starts collapsed. */
2678
+ defaultCollapsed?: boolean;
2679
+ }
2680
+ /** Content reference for a slot placement (view or widget). */
2681
+ type SlotContentDeclaration = {
2682
+ type: 'view';
2683
+ viewId: string;
2684
+ props?: Record<string, unknown>;
2685
+ } | {
2686
+ type: 'widget';
2687
+ widgetId: string;
2688
+ config?: Record<string, unknown>;
2689
+ };
2690
+ /** Placement declaration with a mandatory flag and optional position. */
2691
+ interface SlotPlacementDeclaration {
2692
+ /**
2693
+ * Stable unique identifier for this placement.
2694
+ *
2695
+ * Used as a React key and for layout persistence.
2696
+ */
2697
+ instanceId: string;
2698
+ /** Content reference for this placement. */
2699
+ content: SlotContentDeclaration;
2700
+ /** Whether this placement is mandatory (cannot be removed by the user). */
2701
+ mandatory: boolean;
2702
+ /** Optional grid position. */
2703
+ position?: {
2704
+ col: number;
2705
+ row: number;
2706
+ };
2707
+ }
2708
+ /**
2709
+ * Page declaration for packages.
2710
+ *
2711
+ * Fully serializable — lazy-loads any custom components. To also register the
2712
+ * page in sidebar navigation (`PageDefinitionRegistry`), provide `mode`,
2713
+ * `level`, and `component`. The package loader will bridge this declaration to
2714
+ * a `PageDefinition` entry automatically.
2715
+ * @example
2716
+ * ```typescript
2717
+ * // Minimal page (slot-layout system only, no sidebar entry):
2718
+ * { id: 'my-page', name: 'My Page', scope: 'any', slots: [], defaultContent: {} }
2719
+ *
2720
+ * // Page with sidebar navigation entry:
2721
+ * {
2722
+ * id: 'my-page',
2723
+ * name: 'My Page',
2724
+ * scope: 'any',
2725
+ * mode: 'switch',
2726
+ * level: 'any',
2727
+ * component: () => import('./MyPage.js'),
2728
+ * slots: [],
2729
+ * defaultContent: {},
2730
+ * }
2731
+ * ```
2732
+ */
2733
+ interface PageDeclaration {
2734
+ /**
2735
+ * Unique page identifier.
2736
+ *
2737
+ * Will be namespaced to `'<package-name>:<page-id>'` by the loader.
2738
+ */
2739
+ id: string;
2740
+ /** Human-readable name. */
2741
+ name: string;
2742
+ /** Optional description shown in page listings. */
2743
+ description?: string;
2744
+ /**
2745
+ * Route path relative to the package mount point.
2746
+ * @example `'dashboard'` becomes `/extensions/my-package/dashboard`
2747
+ */
2748
+ route?: string;
2749
+ /** UI scope for this page context. */
2750
+ scope: UiScope$1;
2751
+ /** Slot definitions for this page's layout. */
2752
+ slots: SlotDeclaration[];
2753
+ /** Default content per slot. */
2754
+ defaultContent: Partial<Record<SlotId, SlotPlacementDeclaration[]>>;
2755
+ /** Optional page-level icon (lazy-loaded). */
2756
+ icon?: () => Promise<{
2757
+ default: ComponentType<{
2758
+ size?: number;
2759
+ }>;
2760
+ }>;
2761
+ /** Optional page-level layout constraints. */
2762
+ layout?: {
2763
+ /** Minimum page width in pixels. */minWidth?: number;
2764
+ };
2765
+ /**
2766
+ * Navigation mode for sidebar registration.
2767
+ *
2768
+ * When provided alongside `level` and `component`, the package loader
2769
+ * registers this page in the sidebar navigation (`PageDefinitionRegistry`).
2770
+ * Omit to register in the slot-layout system only (`pageRegistry`).
2771
+ */
2772
+ mode?: PageMode;
2773
+ /**
2774
+ * Navigation level for sidebar registration.
2775
+ *
2776
+ * Required when `mode` is provided.
2777
+ */
2778
+ level?: UiNavigationLevel$1;
2779
+ /**
2780
+ * Lazy-loaded page component for sidebar navigation.
2781
+ *
2782
+ * Required when `mode` is provided. Must return a module with a default
2783
+ * export that accepts {@link PageComponentProps}.
2784
+ * @example
2785
+ * ```typescript
2786
+ * () => import('./MyPage.js').then(m => ({ default: m.MyPage }))
2787
+ * ```
2788
+ */
2789
+ component?: () => Promise<{
2790
+ default: ComponentType<PageComponentProps>;
2791
+ }>;
2792
+ /**
2793
+ * Display order in sidebar (lower = first).
2794
+ *
2795
+ * Only used when `mode` is provided. Defaults to `50` when omitted.
2796
+ */
2797
+ order?: number;
2798
+ }
2799
+ //#endregion
2800
+ //#region core/contracts/src/extension/contributions/tool-formatter-types.d.ts
2801
+ /** Discriminated content types for formatted tool call output. */
2802
+ type PluginTransformedContentType = 'markdown';
2803
+ /** Formatted content block for tool call display. */
2804
+ interface PluginTransformedContent {
2805
+ /** Content rendering strategy. */
2806
+ type: PluginTransformedContentType;
2807
+ /** Content string interpreted according to `type`. */
2808
+ content: string;
2809
+ }
2810
+ /**
2811
+ * Output from a tool call formatter (package-side declaration).
2812
+ *
2813
+ * All fields are optional — formatters can override any subset.
2814
+ */
2815
+ interface PluginFormattedToolCallOutput {
2816
+ /** Replaces the tool name in the block header. */
2817
+ label?: string;
2818
+ /** Replaces the Arguments section. */
2819
+ content?: PluginTransformedContent;
2820
+ /** Replaces the Output section rendering. */
2821
+ outputContent?: PluginTransformedContent;
2822
+ }
2823
+ /** Input shape passed to a formatter's `format` function. */
2824
+ interface PluginToolCallFormatterInput {
2825
+ /** Name of the tool being called. */
2826
+ toolName: string;
2827
+ /** Arguments passed to the tool. */
2828
+ args: Record<string, unknown>;
2829
+ /** Current status of the tool call. */
2830
+ status: 'pending' | 'running' | 'completed' | 'error';
2831
+ /** Output from the tool when the call has completed. */
2832
+ output?: string;
2833
+ }
2834
+ /**
2835
+ * A tool call formatter declaration contributed by a package.
2836
+ *
2837
+ * Structurally compatible with `ToolCallFormatterDefinition` used by the
2838
+ * UI registry, so the package loader can register declarations directly
2839
+ * without bridging.
2840
+ */
2841
+ interface ToolCallFormatterDeclaration {
2842
+ /** Unique identifier for this formatter. */
2843
+ id: string;
2844
+ /**
2845
+ * Declarative filter matched against the tool call input shape.
2846
+ *
2847
+ * Uses a `PayloadFilter` with dot-path support (e.g. `'args.subagent_type'`).
2848
+ * All conditions are ANDed.
2849
+ */
2850
+ filter: PayloadFilter;
2851
+ /**
2852
+ * Priority for ordering when multiple formatters match.
2853
+ *
2854
+ * Lower number = higher priority (checked first). Default: `50`.
2855
+ */
2856
+ priority: number;
2857
+ /**
2858
+ * Pure function that transforms a tool call block into formatted output.
2859
+ *
2860
+ * Returns `undefined` if the formatter decides not to handle this specific
2861
+ * call, falling through to the next formatter.
2862
+ * @param input - The tool call block data.
2863
+ * @returns Formatted output, or `undefined` to skip to the next formatter.
2864
+ */
2865
+ format: (input: PluginToolCallFormatterInput) => PluginFormattedToolCallOutput | undefined;
2866
+ }
2867
+ //#endregion
2868
+ //#region core/contracts/src/extension/contributions/web-ui-types.d.ts
2869
+ /**
2870
+ * Request context passed to a WebUI loader function.
2871
+ *
2872
+ * Provides visibility-aware context so loaders can filter data by the active
2873
+ * host UI context. URL params are forwarded from the route match so loaders can
2874
+ * access path segments and query strings.
2875
+ */
2876
+ interface LoaderContext {
2877
+ /**
2878
+ * Active session identifier, if a session is selected.
2879
+ *
2880
+ * `undefined` when no session is currently active.
2881
+ */
2882
+ sessionId?: string;
2883
+ /** Active host UI context for the matched route. */
2884
+ uiContext: UiContextSnapshot$1;
2885
+ /**
2886
+ * URL parameters from the matched route, including path segments and query
2887
+ * strings.
2888
+ *
2889
+ * Forwarded from the router so loaders can read route-specific identifiers.
2890
+ */
2891
+ params: Record<string, string>;
2892
+ }
2893
+ /**
2894
+ * Loader function that fetches data for a WebUI route.
2895
+ *
2896
+ * Receives a {@link LoaderContext} with active session, UI context, and URL
2897
+ * params so loaders can return visibility-appropriate data. The resolved data
2898
+ * is passed to the component as `loaderData`.
2899
+ * @typeParam TData - Type of data returned by the loader.
2900
+ * @param context - Request context with session, UI context, and URL params.
2901
+ * @returns Promise resolving to the loader data.
2902
+ */
2903
+ type MakaioWebUiLoader<TData = unknown> = (context: LoaderContext) => Promise<TData>;
2904
+ /**
2905
+ * Action function that performs server-side operations.
2906
+ * @typeParam TData - Type of data returned by the action.
2907
+ * @typeParam TArgs - Tuple type of arguments accepted by the action.
2908
+ * @param args - Arguments passed to the action.
2909
+ * @returns Promise resolving to the action result.
2910
+ */
2911
+ type MakaioWebUiAction<TData = unknown, TArgs extends unknown[] = unknown[]> = (...args: TArgs) => Promise<TData>;
2912
+ /**
2913
+ * Record of named actions available to a WebUI route.
2914
+ *
2915
+ * Each action can return different data types.
2916
+ */
2917
+ type MakaioWebUiActions = Record<string, MakaioWebUiAction<unknown, unknown[]>>;
2918
+ /**
2919
+ * Transforms server-side action definitions into client-side Promise-based
2920
+ * executors.
2921
+ *
2922
+ * Used in component props to provide an async/await API for actions.
2923
+ * @typeParam TActions - The server-side action record shape.
2924
+ */
2925
+ type PromisifiedActions<TActions extends MakaioWebUiActions> = { [K in keyof TActions]: TActions[K] extends ((...args: infer Args) => Promise<infer Result>) ? (...args: Args) => Promise<Result> : never };
2926
+ /**
2927
+ * Props passed to a WebUI component.
2928
+ *
2929
+ * Provides type-safe access to loader data, Promise-based action executors,
2930
+ * and the {@link LoaderContext} that was active when the loader ran.
2931
+ * @typeParam TLoaderData - Type of data returned by the loader.
2932
+ * @typeParam TActions - Record of available actions.
2933
+ */
2934
+ type MakaioWebUiComponentProps<TLoaderData = unknown, TActions extends MakaioWebUiActions = MakaioWebUiActions> = {
2935
+ /** Data resolved by the loader before the component was rendered. */loaderData: TLoaderData; /** Promisified action executors for mutating server-side state. */
2936
+ actions: TActions extends MakaioWebUiActions ? PromisifiedActions<TActions> : Record<string, never>; /** The loader context that was active when the loader ran. */
2937
+ loaderContext: LoaderContext;
2938
+ };
2939
+ /**
2940
+ * WebUI route definition for packages.
2941
+ *
2942
+ * Defines a route with path, optional loader/actions, and a lazy-loaded React
2943
+ * component. Provides full TypeScript inference for component props.
2944
+ * @typeParam TLoaderData - Type of data returned by the loader.
2945
+ * @typeParam TActions - Record of available actions (or `undefined` if none).
2946
+ */
2947
+ interface MakaioWebUiRoute<TLoaderData = unknown, TActions extends MakaioWebUiActions | undefined = undefined> {
2948
+ /** Route path relative to the package mount point. */
2949
+ path: string;
2950
+ /** Optional data loader. */
2951
+ loader?: MakaioWebUiLoader<TLoaderData>;
2952
+ /** Optional action handlers. */
2953
+ actions?: TActions;
2954
+ /**
2955
+ * Lazy component loader — called only browser-side.
2956
+ *
2957
+ * Must return a module with a default export of a React component that
2958
+ * accepts the inferred {@link MakaioWebUiComponentProps}.
2959
+ */
2960
+ component: () => Promise<{
2961
+ default: ComponentType<MakaioWebUiComponentProps<TLoaderData, TActions extends MakaioWebUiActions ? TActions : Record<string, never>>>;
2962
+ }>;
2963
+ }
2964
+ /**
2965
+ * Props for custom extension configuration components.
2966
+ *
2967
+ * When an extension provides `ui.configComponent`, the loaded component receives
2968
+ * these props to interact with the extension configuration system.
2969
+ * @typeParam TConfig - Extension configuration type.
2970
+ */
2971
+ interface ExtensionConfigComponentProps<TConfig = unknown> {
2972
+ /** Current configuration values. */
2973
+ config: TConfig;
2974
+ /**
2975
+ * Called when configuration values change.
2976
+ * @param config - Updated configuration.
2977
+ */
2978
+ onChange: (config: TConfig) => void;
2979
+ /** Called when the user confirms the save action. */
2980
+ onSave: () => Promise<void>;
2981
+ /** Whether a save is currently in progress. */
2982
+ isSaving: boolean;
2983
+ /** Validation errors keyed by field name. */
2984
+ errors?: Record<string, string>;
2985
+ }
2986
+ /**
2987
+ * Async loader for registering custom form field types.
2988
+ *
2989
+ * Must return a module with a default export of a React component that accepts
2990
+ * {@link FormFieldProps}.
2991
+ */
2992
+ type ExtensionFieldTypeLoader = () => Promise<{
2993
+ default: ComponentType<FormFieldProps>;
2994
+ }>;
2995
+ /**
2996
+ * Async loader for a custom extension configuration component.
2997
+ *
2998
+ * Must return a module with a default export of a React component that accepts
2999
+ * {@link ExtensionConfigComponentProps}.
3000
+ * @typeParam TConfig - Extension configuration type.
3001
+ */
3002
+ type ExtensionConfigComponentLoader<TConfig = unknown> = () => Promise<{
3003
+ default: ComponentType<ExtensionConfigComponentProps<TConfig>>;
3004
+ }>;
3005
+ //#endregion
3006
+ //#region core/contracts/src/workflow/blocks.d.ts
3007
+ /**
3008
+ * JSON Schema document used for `outputSchema` fields on step block run mappings.
3009
+ *
3010
+ * A JSON Schema document is a JSON object (`Record<string, JsonValue>`). Using
3011
+ * the inferred type from {@link JsonSchemaRecordSchema} keeps this type consistent
3012
+ * with the schema validator used in persisted workflow node definitions.
3013
+ */
3014
+ type JsonSchemaRecord = Record<string, JsonValue$1>;
3015
+ /**
3016
+ * Step block run mapping that compiles into a `station` primitive node.
3017
+ *
3018
+ * A station node is an atomic work unit executed by an AI agent or registered
3019
+ * runtime handler. The `prompt` is a template evaluated against the builder
3020
+ * form values; the optional `role` selects the executor role.
3021
+ */
3022
+ interface StationNodeBlockRun {
3023
+ /** Run mapping discriminant. */
3024
+ readonly type: 'station';
3025
+ /**
3026
+ * Task prompt template compiled into the station node.
3027
+ * Supports `{{ config.<field> }}` and `{{ input.<field> }}` interpolation.
3028
+ */
3029
+ readonly prompt: string;
3030
+ /**
3031
+ * Named role reference forwarded to the compiled station node.
3032
+ * Resolved via the bus `resolveRole` RPC before execution.
3033
+ */
3034
+ readonly role?: string;
3035
+ /**
3036
+ * JSON Schema for the expected station output.
3037
+ * Forwarded verbatim to the compiled station node's `outputSchema` field.
3038
+ */
3039
+ readonly outputSchema?: JsonSchemaRecord;
3040
+ /**
3041
+ * Positive timeout in milliseconds forwarded to the compiled station node.
3042
+ * Defaults to 300 000 ms at execution time when omitted.
3043
+ */
3044
+ readonly timeoutMs?: number;
3045
+ }
3046
+ /**
3047
+ * Step block run mapping that compiles into a `delegate-agent` primitive node.
3048
+ *
3049
+ * The `agentId` references a registered agent definition. The block builder
3050
+ * resolves `inputExpression` against the configured form values when compiling
3051
+ * the node.
3052
+ */
3053
+ interface DelegateAgentNodeBlockRun {
3054
+ /** Run mapping discriminant. */
3055
+ readonly type: 'delegate-agent';
3056
+ /**
3057
+ * Identifier of the registered agent definition to invoke.
3058
+ */
3059
+ readonly agentId: string;
3060
+ /**
3061
+ * jexl expression template resolving to the agent input payload.
3062
+ * Supports `{{ config.<field> }}` and `{{ input.<field> }}` interpolation
3063
+ * that the builder resolves when compiling into a concrete node.
3064
+ */
3065
+ readonly inputExpression?: string;
3066
+ /**
3067
+ * JSON Schema for the expected agent output.
3068
+ * Forwarded verbatim to the compiled node's `outputSchema` field.
3069
+ */
3070
+ readonly outputSchema?: JsonSchemaRecord;
3071
+ }
3072
+ /**
3073
+ * Step block run mapping that compiles into a `delegate-role` primitive node.
3074
+ *
3075
+ * The `role` is a product-resolved named executor. The `prompt` template is
3076
+ * evaluated against the builder form values when compiling the node.
3077
+ */
3078
+ interface DelegateRoleNodeBlockRun {
3079
+ /** Run mapping discriminant. */
3080
+ readonly type: 'delegate-role';
3081
+ /**
3082
+ * Named role reference resolved via the bus `resolveRole` RPC at execution time.
3083
+ */
3084
+ readonly role: string;
3085
+ /**
3086
+ * Task prompt template forwarded to the compiled node.
3087
+ * Supports `{{ config.<field> }}` and `{{ input.<field> }}` interpolation.
3088
+ */
3089
+ readonly prompt: string;
3090
+ /**
3091
+ * JSON Schema for the expected delegation output.
3092
+ * Forwarded verbatim to the compiled node's `outputSchema` field.
3093
+ */
3094
+ readonly outputSchema?: JsonSchemaRecord;
3095
+ /**
3096
+ * Positive timeout in milliseconds forwarded to the compiled node.
3097
+ * Defaults to 300 000 ms at execution time when omitted.
3098
+ */
3099
+ readonly timeoutMs?: number;
3100
+ }
3101
+ /**
3102
+ * Discriminated union of all supported workflow step block run mappings.
3103
+ *
3104
+ * Each variant maps a declared step block to a concrete primitive node type.
3105
+ * The builder compiles the selected variant into the workflow definition as the
3106
+ * corresponding {@link WorkflowNode} subtype when the block is placed in the canvas.
3107
+ *
3108
+ * Extend this union when new primitive node types require builder support.
3109
+ */
3110
+ type WorkflowStepBlockRun = StationNodeBlockRun | DelegateAgentNodeBlockRun | DelegateRoleNodeBlockRun;
3111
+ /**
3112
+ * Metadata shared by all workflow blocks.
3113
+ */
3114
+ interface WorkflowBlockMetadata {
3115
+ /** Stable identifier, namespaced by extension (e.g., 'coderabbit.review-posted'). */
3116
+ name: string;
3117
+ /** Human-readable label for the builder UI. */
3118
+ label: string;
3119
+ /** Short description for tooltips and catalog. */
3120
+ description: string;
3121
+ /** Grouping tags for the builder palette. Uncategorized blocks appear in "Other". */
3122
+ categories?: string[];
3123
+ }
3124
+ /**
3125
+ * A trigger block declaration — determines WHEN a workflow starts.
3126
+ * @typeParam TConfig - Zod shape for the builder configuration form.
3127
+ * @typeParam TOutput - Zod type for the payload passed into the workflow as input.
3128
+ */
3129
+ interface WorkflowTriggerBlock<TConfig extends z.ZodRawShape = z.ZodRawShape, TOutput extends z.ZodType = z.ZodType> {
3130
+ /** Shared metadata used in the builder palette and catalog. */
3131
+ metadata: WorkflowBlockMetadata;
3132
+ /** Drives the configuration form in the builder UI. */
3133
+ configSchema: z.ZodObject<TConfig>;
3134
+ /** The payload shape passed into the workflow when this trigger fires. */
3135
+ outputSchema: TOutput;
3136
+ }
3137
+ /**
3138
+ * A step block declaration — determines WHAT happens inside a workflow.
3139
+ *
3140
+ * The `runs` field specifies which primitive node type this block compiles to
3141
+ * when placed in the workflow canvas. The builder reads `runs` to construct a
3142
+ * concrete {@link WorkflowNode} (station, delegate-agent, or delegate-role) for
3143
+ * the persisted workflow definition.
3144
+ * @typeParam TConfig - Zod shape for the builder configuration form.
3145
+ * @typeParam TInput - Zod type for what this step expects from upstream.
3146
+ * @typeParam TOutput - Zod type for what downstream steps can reference.
3147
+ */
3148
+ interface WorkflowStepBlock<TConfig extends z.ZodRawShape = z.ZodRawShape, TInput extends z.ZodType = z.ZodType, TOutput extends z.ZodType = z.ZodType> {
3149
+ /** Shared metadata used in the builder palette and catalog. */
3150
+ metadata: WorkflowBlockMetadata;
3151
+ /** Drives the configuration form in the builder UI. */
3152
+ configSchema: z.ZodObject<TConfig>;
3153
+ /** What this step expects from upstream (expressions/config). */
3154
+ inputSchema: TInput;
3155
+ /** What downstream steps can reference via steps.<id>.result. */
3156
+ outputSchema: TOutput;
3157
+ /**
3158
+ * Primitive node compilation target for this step block.
3159
+ *
3160
+ * The builder reads this field and constructs the corresponding primitive
3161
+ * node ({@link WorkflowStationNode}, {@link WorkflowDelegateAgentNode}, or
3162
+ * {@link WorkflowDelegateRoleNode}) when the block is placed on the canvas.
3163
+ */
3164
+ runs: WorkflowStepBlockRun;
3165
+ }
3166
+ /**
3167
+ * Collection of workflow blocks contributed by an extension.
3168
+ */
3169
+ interface WorkflowBlockCollection$1 {
3170
+ /** Trigger block declarations — each determines WHEN a workflow starts. */
3171
+ readonly triggers?: readonly WorkflowTriggerBlock[];
3172
+ /** Step block declarations — each determines WHAT happens inside a workflow. */
3173
+ readonly steps?: readonly WorkflowStepBlock[];
3174
+ }
3175
+ /**
3176
+ * Serialized trigger block as stored in the registry and served via bus.
3177
+ *
3178
+ * Schema fields are stored as JSON Schema objects for transport and builder
3179
+ * catalog rendering.
3180
+ */
3181
+ interface RegisteredTriggerBlock$1 {
3182
+ /** Trigger metadata combined with the owning extension name. */
3183
+ metadata: WorkflowBlockMetadata & {
3184
+ extensionName: string;
3185
+ };
3186
+ /** JSON Schema representation of the builder configuration form. */
3187
+ configSchema: Record<string, unknown>;
3188
+ /** JSON Schema representation of the trigger output payload. */
3189
+ outputSchema: Record<string, unknown>;
3190
+ }
3191
+ /**
3192
+ * Serialized step block as stored in the registry and served via bus.
3193
+ *
3194
+ * Schema fields are stored as JSON Schema objects for transport and builder
3195
+ * catalog rendering. The `runs` field is preserved verbatim from the block
3196
+ * declaration so the builder can construct the target primitive node directly.
3197
+ */
3198
+ interface RegisteredStepBlock$1 {
3199
+ /** Step metadata combined with the owning extension name. */
3200
+ metadata: WorkflowBlockMetadata & {
3201
+ extensionName: string;
3202
+ };
3203
+ /** JSON Schema representation of the builder configuration form. */
3204
+ configSchema: Record<string, unknown>;
3205
+ /** JSON Schema representation of the expected upstream input. */
3206
+ inputSchema: Record<string, unknown>;
3207
+ /** JSON Schema representation of what downstream steps can reference. */
3208
+ outputSchema: Record<string, unknown>;
3209
+ /**
3210
+ * Primitive node compilation target preserved verbatim from the block declaration.
3211
+ * The builder uses this to construct the appropriate primitive node when
3212
+ * placing the block on the canvas.
3213
+ */
3214
+ runs: WorkflowStepBlockRun;
3215
+ }
3216
+ //#endregion
3217
+ //#region core/contracts/src/extension/contributions/workflow-block-types.d.ts
3218
+ /**
3219
+ * Workflow block contribution — triggers and steps for the workflow builder.
3220
+ *
3221
+ * Unlike other contribution surfaces, blocks are purely declarative (no runtime
3222
+ * context needed), so this is a static property rather than a factory. The
3223
+ * workflow block registry processor reads `blocks` during extension activation
3224
+ * and serialises each block to JSON Schema for catalog storage.
3225
+ */
3226
+ interface ExtensionWorkflowBlocksContribution {
3227
+ /** Trigger and step block declarations contributed by this extension. */
3228
+ readonly blocks: WorkflowBlockCollection$1;
3229
+ }
3230
+ //#endregion
3231
+ //#region core/contracts/src/extension/extension-contributions.d.ts
3232
+ /**
3233
+ * Typed adapter contribution declared by an extension.
3234
+ *
3235
+ * The `manifest` field carries the adapter metadata that runtime processors
3236
+ * consume alongside the executable `definition`. Descriptor-level
3237
+ * `ExtensionManifest.contributions.adapters` may repeat this metadata for
3238
+ * pre-load discovery, but activation reads this executable surface.
3239
+ * @typeParam TAdapter - Concrete adapter instance type. Defaults to `unknown`
3240
+ * for use in collections where the concrete type is not available.
3241
+ */
3242
+ interface AdapterContribution<TAdapter = unknown> {
3243
+ /** Runtime adapter metadata paired with the executable definition. */
3244
+ readonly manifest: AdapterManifest;
3245
+ /**
3246
+ * Full adapter runtime definition.
3247
+ *
3248
+ * Typed via {@link AdapterDefinitionContract} — the adapter subsystem
3249
+ * consumes this directly. The generic parameter allows higher-level types
3250
+ * (e.g., `AIAdapterDefinition`) to narrow the factory return type.
3251
+ */
3252
+ readonly definition: AdapterDefinitionContract$1<TAdapter>;
3253
+ }
3254
+ /**
3255
+ * Opaque log import contribution declared by an extension.
3256
+ *
3257
+ * Typed as `unknown` in the contracts layer to avoid importing from
3258
+ * `ai-adapters-core`. The log-import contribution processor narrows
3259
+ * this to `PluginLogImport` at processing time.
3260
+ */
3261
+ interface LogImportContribution {
3262
+ /** Adapter name for attribution (e.g. `'opencode'`). */
3263
+ readonly adapterName: string;
3264
+ /** Human-readable display name (e.g. `'OpenCode'`). */
3265
+ readonly displayName: string;
3266
+ /** Full log importer configuration, opaque in contracts. */
3267
+ readonly config: unknown;
3268
+ }
3269
+ /** Tool contribution surface declared by an extension. */
3270
+ interface ExtensionToolsContribution<THostContext extends ExtensionContext$1 = NodeExtensionContext$1> {
3271
+ /**
3272
+ * Create toolsets for this extension.
3273
+ * @param ctx - Runtime context with bus, host details, and machine identity.
3274
+ * @returns Array of toolsets to register with `ToolRegistry`.
3275
+ */
3276
+ readonly createToolsets: (ctx: THostContext) => Toolset[];
3277
+ }
3278
+ /**
3279
+ * Hash trigger contribution surface declared by an extension.
3280
+ * @typeParam TBus - Host bus shape supplied by the runtime.
3281
+ */
3282
+ interface ExtensionTriggersContribution<TBus extends MakaioBusLike = MakaioBusLike> {
3283
+ /**
3284
+ * Create hash triggers for this extension.
3285
+ * @param bus - The bus instance for trigger operations.
3286
+ * @returns Array of hash triggers to register with `HashTriggerService`.
3287
+ */
3288
+ readonly createTriggers: (bus: TBus) => HashTrigger<TBus>[];
3289
+ }
3290
+ /**
3291
+ * Session event action contribution surface declared by an extension.
3292
+ * @typeParam TBus - Host bus shape supplied by the runtime.
3293
+ */
3294
+ interface ExtensionSessionEventActionsContribution<TBus extends MakaioBusLike = MakaioBusLike> {
3295
+ /**
3296
+ * Create session event actions for this extension.
3297
+ * @param ctx - Context with bus instance and extension metadata.
3298
+ * @returns Map of action ID to registration result (declaration + unregister).
3299
+ */
3300
+ readonly createActions: (ctx: SessionEventActionContext<TBus>) => Record<string, CreateSessionEventActionResult>;
3301
+ }
3302
+ /** Bus namespace introspection surface declared by an extension. */
3303
+ interface ExtensionNamespaceContribution {
3304
+ /**
3305
+ * Schema record for bus subject introspection.
3306
+ *
3307
+ * Keys are subject short-names; values are subject schema descriptors.
3308
+ */
3309
+ readonly schemas: Record<string, SubjectSchema>;
3310
+ }
3311
+ /** Browser UI contribution surface declared by an extension. */
3312
+ interface ExtensionUiContribution {
3313
+ /**
3314
+ * WebUI routes mounted under `/extensions/<extension-name>/`.
3315
+ *
3316
+ * Each route defines a path, an optional data loader, optional action
3317
+ * handlers, and a lazy-loaded React component.
3318
+ */
3319
+ readonly routes?: readonly MakaioWebUiRoute<unknown, MakaioWebUiActions | undefined>[];
3320
+ /**
3321
+ * Tile declarations for pane-placeable content.
3322
+ *
3323
+ * Tiles are registered with `TileRegistry` and shown in the "Add Pane"
3324
+ * palette. Each declaration includes metadata, an icon, and platform
3325
+ * renderers.
3326
+ */
3327
+ readonly tiles?: readonly TileDeclaration[];
3328
+ /**
3329
+ * Widget declarations for small dashboard cards.
3330
+ *
3331
+ * Widgets are registered in the global widget catalog. They are NOT pane
3332
+ * content — use `tiles` for pane-placeable content.
3333
+ */
3334
+ readonly widgets?: readonly WidgetDeclaration[];
3335
+ /**
3336
+ * Page declarations for the page registry and optional sidebar navigation.
3337
+ *
3338
+ * Pages are registered in the page registry. When `mode`, `level`, and
3339
+ * `component` are provided, the loader also registers the page in the
3340
+ * sidebar navigation (`PageDefinitionRegistry`).
3341
+ */
3342
+ readonly pages?: readonly PageDeclaration[];
3343
+ /**
3344
+ * Tool call formatter declarations.
3345
+ *
3346
+ * Formatters customize how specific tool calls are rendered in the chat
3347
+ * UI. Registered with `ToolCallFormatterRegistry` on extension load.
3348
+ */
3349
+ readonly toolFormatters?: readonly ToolCallFormatterDeclaration[];
3350
+ /**
3351
+ * Custom field type loaders for schema-driven forms.
3352
+ *
3353
+ * Maps field type identifiers to lazy-loaded React components that accept
3354
+ * `FormFieldProps`. Registered with `FormFieldRegistry` on extension load.
3355
+ * @example
3356
+ * ```typescript
3357
+ * fieldTypes: {
3358
+ * 'image-upload': () => import('./ui/ImageUploadField.js'),
3359
+ * }
3360
+ * ```
3361
+ */
3362
+ readonly fieldTypes?: Record<string, ExtensionFieldTypeLoader>;
3363
+ /**
3364
+ * Fully custom configuration component loader.
3365
+ *
3366
+ * When provided, the schema-driven form is bypassed entirely. Use this
3367
+ * for complex UIs where &gt;50% of fields need custom rendering.
3368
+ * @example
3369
+ * ```typescript
3370
+ * configComponent: () => import('./ui/CustomConfigPanel.js'),
3371
+ * ```
3372
+ */
3373
+ readonly configComponent?: ExtensionConfigComponentLoader;
3374
+ }
3375
+ //#endregion
3376
+ //#region core/contracts/src/extension/contributions/bootstrap-types.d.ts
3377
+ /**
3378
+ * Context passed to bootstrap discovery and export operations.
3379
+ * @typeParam TBus - Host bus shape supplied by the runtime.
3380
+ */
3381
+ interface BootstrapDiscoverContext<TBus extends MakaioBusLike = MakaioBusLike> {
3382
+ /** Bus instance for querying the runtime. */
3383
+ bus: TBus;
3384
+ /** Active project identifier. */
3385
+ projectId: string;
3386
+ /** Absolute path to the project repository. */
3387
+ repoPath: string;
3388
+ }
3389
+ /** Context for export operations - identical to discover context. */
3390
+ type BootstrapExportContext<TBus extends MakaioBusLike = MakaioBusLike> = BootstrapDiscoverContext<TBus>;
3391
+ /** Context for import operations - extends discover context with the bootstrap folder path. */
3392
+ interface BootstrapImportContext<TBus extends MakaioBusLike = MakaioBusLike> extends BootstrapDiscoverContext<TBus> {
3393
+ /** Absolute path to the `.makaio/bootstrap/` folder being imported from. */
3394
+ bootstrapFolderPath: string;
3395
+ }
3396
+ /** A single exportable or importable bootstrap asset. */
3397
+ interface BootstrapAsset {
3398
+ /** Identifier of the extension that owns this asset. */
3399
+ extensionId: string;
3400
+ /** Logical asset type (e.g. `'session'`, `'config'`). */
3401
+ type: string;
3402
+ /** Human-readable asset name. */
3403
+ name: string;
3404
+ /** Filename within the bootstrap folder. */
3405
+ filename: string;
3406
+ /** Whether the asset already exists in the target environment. */
3407
+ exists?: boolean;
3408
+ /** Identifier of an existing asset that would be replaced by import. */
3409
+ existingId?: string;
3410
+ }
3411
+ /** Stable key type for bootstrap asset lookups. */
3412
+ type BootstrapAssetKey = string;
3413
+ /**
3414
+ * Build a stable key for a bootstrap asset.
3415
+ * @param asset - The asset to key.
3416
+ * @returns Stable asset key for UI state and list rendering.
3417
+ */
3418
+ declare function getBootstrapAssetKey(asset: BootstrapAsset): BootstrapAssetKey;
3419
+ /** Result of a single bootstrap import operation. */
3420
+ interface BootstrapImportResult {
3421
+ /** Whether the import succeeded. */
3422
+ success: boolean;
3423
+ /** Action taken during import. */
3424
+ action: 'created' | 'replaced' | 'skipped';
3425
+ /** Error message when `success` is `false`. */
3426
+ error?: string;
3427
+ }
3428
+ /** User-selected action for a conflicting bootstrap asset. */
3429
+ interface BootstrapChoice {
3430
+ /** The conflicting asset. */
3431
+ asset: BootstrapAsset;
3432
+ /** Chosen resolution action. */
3433
+ action: 'replace' | 'skip';
3434
+ }
3435
+ /** Result of a completed bootstrap operation (import or export). */
3436
+ interface BootstrapResult {
3437
+ /** The asset that was processed. */
3438
+ asset: BootstrapAsset;
3439
+ /** Action taken. */
3440
+ action: 'replaced' | 'skipped' | 'created';
3441
+ /** Error message when the operation failed. */
3442
+ error?: string;
3443
+ }
3444
+ /** Result of a bootstrap export operation. */
3445
+ interface BootstrapExportResult {
3446
+ /** The asset that was exported. */
3447
+ asset: BootstrapAsset;
3448
+ /** Absolute path to the file that was written. */
3449
+ filePath: string;
3450
+ /** Error message when the export failed. */
3451
+ error?: string;
3452
+ }
3453
+ /**
3454
+ * Bootstrap capability contributed by an extension.
3455
+ *
3456
+ * Participates in project export (`discoverExportable` + `export`) and
3457
+ * project import (`listImportable` + `import`) workflows.
3458
+ * @typeParam TBus - Host bus shape supplied by the runtime.
3459
+ */
3460
+ interface ExtensionBootstrap<TBus extends MakaioBusLike = MakaioBusLike> {
3461
+ /** Subfolder name within `.makaio/bootstrap/` for this extension's assets. */
3462
+ folder: string;
3463
+ /**
3464
+ * List assets that can be imported from the bootstrap folder.
3465
+ * @param ctx - Import context with bus, project, and bootstrap folder path.
3466
+ * @param files - Files present in the bootstrap folder.
3467
+ * @returns Assets available for import.
3468
+ */
3469
+ listImportable: (ctx: BootstrapImportContext<TBus>, files: string[]) => Promise<BootstrapAsset[]>;
3470
+ /**
3471
+ * Discover assets available for export from the current project.
3472
+ * @param ctx - Discovery context with bus and project info.
3473
+ * @returns Assets that can be exported.
3474
+ */
3475
+ discoverExportable: (ctx: BootstrapDiscoverContext<TBus>) => Promise<BootstrapAsset[]>;
3476
+ /**
3477
+ * Export a single asset and return its serialized content.
3478
+ * @param ctx - Export context with bus and project info.
3479
+ * @param asset - The asset to export.
3480
+ * @returns Serialized content string written to the bootstrap folder.
3481
+ */
3482
+ export: (ctx: BootstrapExportContext<TBus>, asset: BootstrapAsset) => Promise<string>;
3483
+ /**
3484
+ * Import a single asset from its serialized content.
3485
+ * @param ctx - Import context with bus, project, and bootstrap folder path.
3486
+ * @param asset - The asset being imported.
3487
+ * @param content - Serialized content string from the bootstrap folder.
3488
+ * @param action - User-selected conflict resolution action.
3489
+ * @returns Result of the import operation.
3490
+ */
3491
+ import: (ctx: BootstrapImportContext<TBus>, asset: BootstrapAsset, content: string, action: 'replace' | 'skip') => Promise<BootstrapImportResult>;
3492
+ }
3493
+ //#endregion
3494
+ //#region core/contracts/src/workflow/transition.d.ts
3495
+ /**
3496
+ * The set of artifact bus events that can trigger a transition rule.
3497
+ *
3498
+ * - `artifact.created` — fires when a new artifact is created
3499
+ * - `artifact.revised` — fires when an existing artifact receives a new revision
3500
+ * - `artifact.status.changed` — fires when a tracked status field changes
3501
+ */
3502
+ declare const TransitionEventTypeSchema: z.ZodEnum<{
3503
+ "artifact.created": "artifact.created";
3504
+ "artifact.revised": "artifact.revised";
3505
+ "artifact.status.changed": "artifact.status.changed";
3506
+ }>;
3507
+ type TransitionEventType$1 = z.infer<typeof TransitionEventTypeSchema>;
3508
+ /**
3509
+ * Serializable condition evaluated against an artifact event payload.
3510
+ *
3511
+ * Stored as an opaque JSON record in the contracts layer. The pipeline
3512
+ * service interprets this using `@makaio/rules` at evaluation time,
3513
+ * supporting field comparisons, `$and`/`$or`/`$not` combinators, and
3514
+ * `$expr` jexl expression strings.
3515
+ *
3516
+ * Evaluation context shape:
3517
+ * - `artifact` — the `ArtifactRevision` involved in the event
3518
+ * - `previous` — the previous `ArtifactRef` for `artifact.revised` events
3519
+ * - `previousArtifact` — the resolved previous `ArtifactRevision` for
3520
+ * `artifact.revised` events when the artifact store can provide it
3521
+ * - `path` — the status path for `artifact.status.changed` events
3522
+ * - `current` — the new status value for `artifact.status.changed` events
3523
+ */
3524
+ declare const TransitionConditionSchema: z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>;
3525
+ type TransitionCondition = z.infer<typeof TransitionConditionSchema>;
3526
+ /**
3527
+ * Invocation descriptor for the action to execute when a transition rule fires.
3528
+ *
3529
+ * `type` selects the registered action handler; `input` supplies the
3530
+ * action-specific payload; `executionHints` threads optional infrastructure
3531
+ * hints to the execution host.
3532
+ *
3533
+ * Built-in action type:
3534
+ * - `'workflow.start'` — start a workflow execution via the bus
3535
+ */
3536
+ declare const TransitionActionInvocationSchema: z.ZodObject<{
3537
+ type: z.ZodString;
3538
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
3539
+ executionHints: z.ZodOptional<z.ZodObject<{
3540
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3541
+ kind: z.ZodLiteral<"path">;
3542
+ path: z.ZodString;
3543
+ }, z.core.$strict>, z.ZodObject<{
3544
+ kind: z.ZodLiteral<"source">;
3545
+ filename: z.ZodString;
3546
+ source: z.ZodString;
3547
+ }, z.core.$strict>], "kind">>;
3548
+ requirements: z.ZodOptional<z.ZodObject<{
3549
+ isolation: z.ZodOptional<z.ZodEnum<{
3550
+ local: "local";
3551
+ remote: "remote";
3552
+ container: "container";
3553
+ }>>;
3554
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
3555
+ }, z.core.$catchall<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>>;
3556
+ providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
3557
+ }, z.core.$catchall<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>>;
3558
+ }, z.core.$strip>;
3559
+ type TransitionActionInvocation$1 = z.infer<typeof TransitionActionInvocationSchema>;
3560
+ /**
3561
+ * Declarative rule that watches artifact events and triggers workflow actions.
3562
+ *
3563
+ * Transition rules are purely serializable — no functions. The pipeline service
3564
+ * evaluates the `when` condition against the incoming artifact event payload and
3565
+ * dispatches the `action` through the `TransitionActionRegistry` when the
3566
+ * condition matches.
3567
+ *
3568
+ * ID namespacing:
3569
+ * - Bundle-contributed rules: `'<bundleId>.<localId>'`
3570
+ * - Extension-contributed rules: `'<extensionName>.<localId>'`
3571
+ *
3572
+ * Duplicate IDs across all sources hard-fail activation.
3573
+ */
3574
+ declare const TransitionRuleDefinitionSchema$1: z.ZodObject<{
3575
+ id: z.ZodString;
3576
+ description: z.ZodOptional<z.ZodString>;
3577
+ on: z.ZodEnum<{
3578
+ "artifact.created": "artifact.created";
3579
+ "artifact.revised": "artifact.revised";
3580
+ "artifact.status.changed": "artifact.status.changed";
3581
+ }>;
3582
+ when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
3583
+ action: z.ZodObject<{
3584
+ type: z.ZodString;
3585
+ input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
3586
+ executionHints: z.ZodOptional<z.ZodObject<{
3587
+ source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
3588
+ kind: z.ZodLiteral<"path">;
3589
+ path: z.ZodString;
3590
+ }, z.core.$strict>, z.ZodObject<{
3591
+ kind: z.ZodLiteral<"source">;
3592
+ filename: z.ZodString;
3593
+ source: z.ZodString;
3594
+ }, z.core.$strict>], "kind">>;
3595
+ requirements: z.ZodOptional<z.ZodObject<{
3596
+ isolation: z.ZodOptional<z.ZodEnum<{
3597
+ local: "local";
3598
+ remote: "remote";
3599
+ container: "container";
3600
+ }>>;
3601
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
3602
+ }, z.core.$catchall<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>>;
3603
+ providers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>;
3604
+ }, z.core.$catchall<z.ZodType<_$_makaio_contracts0.JsonValue, unknown, z.core.$ZodTypeInternals<_$_makaio_contracts0.JsonValue, unknown>>>>>;
3605
+ }, z.core.$strip>;
3606
+ enabled: z.ZodDefault<z.ZodBoolean>;
3607
+ }, z.core.$strip>;
3608
+ type TransitionRuleDefinition$1 = z.infer<typeof TransitionRuleDefinitionSchema$1>;
3609
+ /**
3610
+ * Transition rule contribution surface for extension packages.
3611
+ *
3612
+ * Declarative static rules contributed by an extension. Processed by
3613
+ * `TransitionContributionProcessor` during extension activation.
3614
+ */
3615
+ interface ExtensionTransitionRulesContribution {
3616
+ /**
3617
+ * Transition rule definitions contributed by this extension.
3618
+ *
3619
+ * All IDs must be prefixed with `'<extensionName>.'` (enforced by the
3620
+ * contribution processor). Duplicate IDs hard-fail activation.
3621
+ */
3622
+ readonly rules: readonly TransitionRuleDefinition$1[];
3623
+ }
3624
+ /**
3625
+ * Callable transition action handler.
3626
+ *
3627
+ * Invoked by the pipeline when a matching rule fires. Receives the resolved
3628
+ * invocation and the artifact event context so it can read artifact data when
3629
+ * building downstream bus requests.
3630
+ */
3631
+ interface TransitionActionHandler {
3632
+ /**
3633
+ * Execute the action.
3634
+ * @param invocation - Resolved action invocation descriptor.
3635
+ * @param context - Evaluation context built from the triggering artifact event.
3636
+ * @returns Promise that resolves when the action dispatch completes.
3637
+ */
3638
+ readonly execute: (invocation: TransitionActionInvocation$1, context: TransitionEvaluationContext$1) => Promise<void>;
3639
+ }
3640
+ /**
3641
+ * Factory that creates a {@link TransitionActionHandler} for a given action type.
3642
+ *
3643
+ * Factories are registered at contribution time and instantiated lazily by the
3644
+ * pipeline service.
3645
+ */
3646
+ type TransitionActionFactory$1 = () => TransitionActionHandler;
3647
+ /**
3648
+ * Transition action factory contribution surface for extension packages.
3649
+ *
3650
+ * Extensions that need custom action semantics beyond the built-in
3651
+ * `workflow.start` action register their handler factories here.
3652
+ */
3653
+ interface ExtensionTransitionActionsContribution {
3654
+ /**
3655
+ * Map of action type strings to action handler factories.
3656
+ *
3657
+ * Each key is a registered action `type` string as declared in
3658
+ * {@link TransitionActionInvocationSchema}. Values are factories
3659
+ * called once per rule dispatch to produce a fresh handler.
3660
+ *
3661
+ * All keys must be prefixed with `'<extensionName>.'`.
3662
+ */
3663
+ readonly actions: Readonly<Record<string, TransitionActionFactory$1>>;
3664
+ }
3665
+ /**
3666
+ * Context object passed to condition evaluation and action dispatch.
3667
+ *
3668
+ * The pipeline builds this from the incoming artifact event payload so
3669
+ * that rules can reference `artifact`, `previous`, `path`, and `current`
3670
+ * fields using dot-notation in their `when` conditions.
3671
+ */
3672
+ interface TransitionEvaluationContext$1 {
3673
+ /**
3674
+ * The artifact revision involved in the event.
3675
+ *
3676
+ * The transition pipeline resolves ref-oriented artifact events, such as
3677
+ * `artifact.status.changed`, before evaluating rules so authoring sees a
3678
+ * consistent full-revision context.
3679
+ */
3680
+ readonly artifact: ArtifactRevision$1;
3681
+ /**
3682
+ * Previous value from the artifact event. For `artifact.revised` this is the
3683
+ * previous artifact ref; for `artifact.status.changed` this is the previous
3684
+ * status value.
3685
+ */
3686
+ readonly previous?: unknown;
3687
+ /**
3688
+ * Resolved previous artifact revision for `artifact.revised` events.
3689
+ *
3690
+ * This preserves `previous` as the original event value while giving rules a
3691
+ * full before/after snapshot when they need to detect semantic deltas.
3692
+ */
3693
+ readonly previousArtifact?: ArtifactRevision$1;
3694
+ /**
3695
+ * JSON Pointer path to the status field that changed.
3696
+ * Present only for `artifact.status.changed` events.
3697
+ */
3698
+ readonly path?: string;
3699
+ /**
3700
+ * Current status value after the change.
3701
+ * Present only for `artifact.status.changed` events.
3702
+ */
3703
+ readonly current?: unknown;
3704
+ /**
3705
+ * Loop-protection metadata injected by the pipeline.
3706
+ *
3707
+ * Downstream actions can inspect this to detect and break
3708
+ * artifact-triggered → workflow → artifact cycles.
3709
+ */
3710
+ readonly _transition: {
3711
+ /**
3712
+ * The transition rule ID that fired this action.
3713
+ */
3714
+ readonly ruleId: string;
3715
+ /**
3716
+ * The artifact event type that matched the rule.
3717
+ */
3718
+ readonly eventType: TransitionEventType$1;
3719
+ /**
3720
+ * Depth counter tracking recursive transition invocations.
3721
+ *
3722
+ * The pipeline increments this on each nested trigger level.
3723
+ * Action handlers that re-emit artifact events must propagate this
3724
+ * metadata so the pipeline can reject invocations that exceed the
3725
+ * configured maximum depth.
3726
+ */
3727
+ readonly depth: number;
3728
+ };
3729
+ }
3730
+ //#endregion
3731
+ //#region core/contracts/src/extension/makaio-extension.d.ts
3732
+ /**
3733
+ * Awaited contribution processor registered with the runtime coordinator.
3734
+ *
3735
+ * Processors are registered before package startup and are invoked when a
3736
+ * package activates or stops. A processor can filter the packages it handles
3737
+ * by inspecting the executable {@link MakaioExtension} manifest.
3738
+ * @typeParam THostContext - Host context supplied to active extensions.
3739
+ */
3740
+ interface ExtensionContributionProcessor$1<THostContext extends ExtensionContext$1 = NodeExtensionContext$1> {
3741
+ /**
3742
+ * Optional activation filter.
3743
+ * @param pkg - Extension manifest to evaluate.
3744
+ * @returns `true` when this processor should handle the extension.
3745
+ */
3746
+ readonly filter?: (pkg: MakaioExtension$1<THostContext>) => boolean;
3747
+ /**
3748
+ * Called when an extension is being activated.
3749
+ * @param name - Extension package name.
3750
+ * @param pkg - Extension manifest.
3751
+ * @param ctx - Per-extension runtime context.
3752
+ */
3753
+ readonly processActivated: (name: string, pkg: MakaioExtension$1<THostContext>, ctx: THostContext) => Promise<void>;
3754
+ /**
3755
+ * Called when an extension is stopped or disabled.
3756
+ * @param name - Extension package name.
3757
+ */
3758
+ readonly processStopped?: (name: string) => Promise<void>;
3759
+ }
3760
+ /**
3761
+ * Context for executable boot contributions declared by extension packages.
3762
+ *
3763
+ * This seam runs after all packages have been loaded into the coordinator and
3764
+ * before startup begins, so packages can register contribution processors for
3765
+ * extension surfaces they own.
3766
+ * @typeParam THostContext - Host context supplied to contribution processors.
3767
+ */
3768
+ interface ExtensionRuntimeBootContext<THostContext extends ExtensionContext$1 = NodeExtensionContext$1> {
3769
+ /** Runtime bus. */
3770
+ readonly bus: THostContext['bus'];
3771
+ /**
3772
+ * Register a contribution processor before package startup.
3773
+ * @param processor - Processor to add to the coordinator.
3774
+ */
3775
+ readonly registerContributionProcessor: (processor: ExtensionContributionProcessor$1<THostContext>) => void;
3776
+ /**
3777
+ * Enumerate active extensions lazily after startup.
3778
+ * @param callback - Called for each active extension with its context.
3779
+ */
3780
+ readonly forEachActiveExtension: (callback: (name: string, pkg: MakaioExtension$1<THostContext>, ctx: THostContext) => void) => void;
3781
+ }
3782
+ /**
3783
+ * Executable boot contribution declared by an extension package.
3784
+ *
3785
+ * Use this for runtime wiring that must be installed before
3786
+ * {@link ExtensionContributionProcessor} activation starts, such as registering
3787
+ * processors for extension-owned contribution surfaces.
3788
+ * @typeParam THostContext - Host context supplied by the runtime.
3789
+ */
3790
+ interface ExtensionRuntimeBootContribution<THostContext extends ExtensionContext$1 = NodeExtensionContext$1> {
3791
+ /**
3792
+ * Configure the runtime coordinator before package startup.
3793
+ * @param context - Minimal boot context supplied by the host runtime.
3794
+ * @returns Optional cleanup callback or callbacks for runtime shutdown.
3795
+ */
3796
+ readonly configure: (context: ExtensionRuntimeBootContext<THostContext>) => void | (() => void) | readonly (() => void)[];
3797
+ }
3798
+ /**
3799
+ * Executable artifact kind contribution declared by an extension package.
3800
+ */
3801
+ interface ExtensionArtifactKindsContribution {
3802
+ /**
3803
+ * Artifact kind definitions to register during extension activation.
3804
+ */
3805
+ readonly kinds?: readonly AnyArtifactKindDefinition[];
3806
+ }
3807
+ /**
3808
+ * Executable facet namespace contribution declared by an extension package.
3809
+ */
3810
+ interface ExtensionFacetNamespacesContribution {
3811
+ /**
3812
+ * Facet namespace definitions to register during extension activation.
3813
+ */
3814
+ readonly namespaces?: readonly FacetNamespaceDefinition[];
3815
+ }
3816
+ /**
3817
+ * Executable surface bindings contribution declared by an extension package.
3818
+ */
3819
+ interface ExtensionSurfaceBindingsContribution {
3820
+ /**
3821
+ * Surface binding definitions to register during extension activation.
3822
+ */
3823
+ readonly bindings?: readonly SurfaceBindingDefinition[];
3824
+ }
3825
+ /**
3826
+ * Context supplied to the `createHooks` factory of an
3827
+ * {@link ExtensionArtifactLifecycleHooksContribution}.
3828
+ * @typeParam TBus - Concrete bus type supplied by the host runtime.
3829
+ */
3830
+ interface ArtifactLifecycleHooksContributionContext<TBus extends MakaioBusLike = MakaioBusLike> {
3831
+ /** Runtime bus available during hook factory invocation. */
3832
+ readonly bus: TBus;
3833
+ /** Name of the owning extension, used for hook ID namespacing. */
3834
+ readonly extensionName: string;
3835
+ }
3836
+ /**
3837
+ * Executable artifact lifecycle hooks contribution declared by an extension package.
3838
+ *
3839
+ * The `createHooks` factory is called during extension activation with the
3840
+ * runtime context and must return the set of hook registrations to install.
3841
+ * Returning a `Promise` allows async resource acquisition (e.g. lazy loading).
3842
+ * @typeParam TBus - Concrete bus type supplied by the host runtime.
3843
+ */
3844
+ interface ExtensionArtifactLifecycleHooksContribution<TBus extends MakaioBusLike = MakaioBusLike> {
3845
+ /**
3846
+ * Factory that produces the hook registrations for this extension.
3847
+ *
3848
+ * Called once during extension activation. The returned hooks are registered
3849
+ * with the artifact lifecycle hook registry and unregistered when the
3850
+ * extension stops.
3851
+ * @param ctx - Activation context supplying the bus and extension name.
3852
+ * @returns Hook registrations or a promise that resolves to them.
3853
+ */
3854
+ readonly createHooks: (ctx: ArtifactLifecycleHooksContributionContext<TBus>) => readonly ArtifactLifecycleHookRegistration$1<TBus>[] | Promise<readonly ArtifactLifecycleHookRegistration$1<TBus>[]>;
3855
+ }
3856
+ /**
3857
+ * Executable Makaio extension manifest.
3858
+ *
3859
+ * Extends {@link ExtensionManifest} with executable code: a service factory,
3860
+ * a CLI contribution with interactive TUI support, and a Drizzle storage
3861
+ * handler registration callback.
3862
+ *
3863
+ * Source-of-truth rule: fields on this executable extension are the runtime
3864
+ * wiring source. Serializable descriptor fields, including
3865
+ * {@link ExtensionManifest.contributions}, are discovery metadata and are not
3866
+ * promoted into executable contribution surfaces by the loader.
3867
+ *
3868
+ * The host runtime calls {@link create} (if defined) with a
3869
+ * {@link ExtensionContext} to instantiate the service. Window-only extensions
3870
+ * that have no background service may omit {@link create} entirely.
3871
+ * @typeParam THostContext - Concrete context shape supplied by the host
3872
+ * runtime. Defaults to {@link NodeExtensionContext} because the current
3873
+ * framework hosts are Node-based.
3874
+ * @example
3875
+ * ```ts
3876
+ * export const myExtension: MakaioExtension = {
3877
+ * name: 'my-extension',
3878
+ * displayName: 'My Extension',
3879
+ * create: (ctx) => new MyService(ctx.bus),
3880
+ * };
3881
+ * ```
3882
+ */
3883
+ interface MakaioExtension$1<THostContext extends ExtensionContext$1 = NodeExtensionContext$1> extends ExtensionManifest {
3884
+ /**
3885
+ * Bus namespace definitions owned by this extension.
3886
+ *
3887
+ * Registered by `ExtensionCoordinator` during extension activation, before
3888
+ * {@link create} is called, so handlers registered during construction can
3889
+ * rely on the namespace being available.
3890
+ *
3891
+ * Extensions that don't own bus namespaces omit this field.
3892
+ */
3893
+ readonly namespaces?: readonly RegistrableBusNamespaceDefinition[];
3894
+ /**
3895
+ * Factory that creates and returns the extension's service.
3896
+ *
3897
+ * Optional — window-only extensions that have no background service may omit
3898
+ * this field entirely. When present, the host calls this during startup; the
3899
+ * extension is responsible for all internal composition (choosing backends,
3900
+ * creating sources, etc.) based on the provided context.
3901
+ * @param ctx - Runtime context with bus, host details, and machine identity.
3902
+ * @returns The extension's service instance (not yet initialized — host calls `init`).
3903
+ */
3904
+ readonly create?: (ctx: THostContext) => ExtensionService$1 | Promise<ExtensionService$1>;
3905
+ /**
3906
+ * Executable ownership declarations for runtime responsibilities that must
3907
+ * have exactly one owner in a booted runtime.
3908
+ */
3909
+ readonly runtimeOwnership?: ExtensionRuntimeOwnership;
3910
+ /**
3911
+ * Boot-time executable contribution for registering runtime processors or
3912
+ * services before package startup begins.
3913
+ */
3914
+ readonly runtimeBoot?: ExtensionRuntimeBootContribution<THostContext>;
3915
+ /**
3916
+ * When true, startup fails if this extension fails to initialize.
3917
+ *
3918
+ * Optional extensions default to isolated failure so one extension cannot
3919
+ * prevent the runtime from booting. Framework and host core extensions set
3920
+ * this to true when the runtime cannot safely continue without them.
3921
+ */
3922
+ readonly critical?: boolean;
3923
+ /**
3924
+ * Executable CLI contribution registered under `makaio <name>`.
3925
+ *
3926
+ * The runtime exposes the fully typed helper API through
3927
+ * `@makaio/kernel/cli` when authoring CLI commands. This manifest stores
3928
+ * only the type-erased executable shape used after loading.
3929
+ */
3930
+ readonly cli?: ExtensionCliContribution<THostContext['bus']>;
3931
+ /**
3932
+ * Server-side HTTP routes.
3933
+ * Hosts that support HTTP route contributions call `mount()` on a fresh,
3934
+ * rebuildable app graph as extensions activate or stop. Contracts keeps the
3935
+ * app type erased so this layer does not depend on Hono.
3936
+ * @param app - Host-owned HTTP app instance.
3937
+ */
3938
+ readonly http?: {
3939
+ readonly prefix: string;
3940
+ readonly mount: (app: unknown) => void;
3941
+ };
3942
+ /**
3943
+ * Executable storage contribution.
3944
+ *
3945
+ * Extends {@link StorageManifest} (migration paths) with a Drizzle handler
3946
+ * registration callback invoked by the composition root after migrations
3947
+ * have been applied but before services are started.
3948
+ *
3949
+ * The `db` parameter is typed as `unknown` in the contracts layer (which
3950
+ * does not take a drizzle dependency) — composition roots cast it to
3951
+ * `MakaioDatabase` before calling. The returned cleanup function is
3952
+ * invoked during graceful shutdown to unregister bus handlers.
3953
+ */
3954
+ readonly storage?: StorageManifest & {
3955
+ /**
3956
+ * Absolute extension root used to resolve relative storage asset paths.
3957
+ *
3958
+ * Required when a code-defined extension declares relative
3959
+ * {@link StorageManifest.migrations} paths, since there is no descriptor
3960
+ * file path for the runtime to infer from.
3961
+ */
3962
+ readonly packageRoot?: string;
3963
+ /**
3964
+ * Stable runtime identity for the migration bundle.
3965
+ *
3966
+ * Bundled hosts use this instead of packaged output paths when they need a
3967
+ * durable key for migration deduplication and embedded lookup.
3968
+ */
3969
+ readonly migrationSourceId?: string;
3970
+ /**
3971
+ * Registers Drizzle-backed bus storage handlers for this extension.
3972
+ * @param bus - The application bus instance.
3973
+ * @param db - The Drizzle database instance (typed opaquely here; cast at the call site).
3974
+ * @param ctx - Runtime extension context supplying host details and machine identity
3975
+ * (e.g., for machine-scoped storage registration).
3976
+ * @returns Optional cleanup function called during shutdown to unregister handlers.
3977
+ */
3978
+ readonly registerHandlers?: (bus: THostContext['bus'], db: unknown, ctx: THostContext) => (() => void) | void;
3979
+ };
3980
+ /**
3981
+ * Zod schema describing this extension's configuration shape.
3982
+ *
3983
+ * When present, the coordinator:
3984
+ * 1. Exposes the schema as JSON Schema via `extension.getConfigSchema` RPC
3985
+ * 2. Loads stored config from `ExtensionConfigStorageSubjects` at boot
3986
+ * 3. Parses it through this schema and injects the result into
3987
+ * {@link ExtensionContext.config}
3988
+ *
3989
+ * The schema should provide `.default()` values for all optional fields
3990
+ * so parsing `{}` always yields a valid config.
3991
+ */
3992
+ readonly configSchema?: z.ZodType;
3993
+ /**
3994
+ * UI configuration for schema-driven configuration forms.
3995
+ *
3996
+ * Controls how the config form is rendered: edit mode (slidePanel vs full),
3997
+ * which fields to hide, and per-field widget overrides (e.g. slider, color
3998
+ * picker). Only meaningful when {@link configSchema} is also declared.
3999
+ */
4000
+ readonly uiConfig?: EntityUIConfig;
4001
+ /**
4002
+ * Client runtime definitions contributed by this extension.
4003
+ *
4004
+ * Loaded clients are passed to `createClientsCorePackage` during boot and
4005
+ * registered with the client bootstrap service. These definitions are the
4006
+ * runtime source of truth for client wiring; descriptor `contributions.clients`
4007
+ * is discovery metadata only.
4008
+ */
4009
+ readonly clients?: readonly ClientDefinition$1[];
4010
+ /**
4011
+ * Provider definitions contributed by this extension.
4012
+ *
4013
+ * Each entry defines a model provider (e.g., Anthropic, OpenAI) with its
4014
+ * supported models, capabilities, and credential requirements. Loaded
4015
+ * providers are registered with the provider subsystem during boot.
4016
+ *
4017
+ * Provider definitions are executable extension contributions. Descriptor
4018
+ * `contributions.providers` may mirror provider identity metadata for
4019
+ * pre-load discovery, but is not a registration fallback.
4020
+ */
4021
+ readonly providers?: readonly ProviderDefinitionInput$1[];
4022
+ /**
4023
+ * Adapter runtime definitions contributed by this extension.
4024
+ *
4025
+ * Each entry pairs JSON-serializable discovery metadata with the full
4026
+ * runtime adapter definition typed via {@link AdapterDefinitionContract}.
4027
+ * The adapter contribution processor consumes this executable field directly;
4028
+ * descriptor `contributions.adapters` is not a registration fallback.
4029
+ */
4030
+ readonly adapters?: readonly AdapterContribution[];
4031
+ /**
4032
+ * Log import capability for external tool session import.
4033
+ *
4034
+ * Opaque in contracts. The log-import contribution processor narrows
4035
+ * `config` to `PluginLogImport` at processing time.
4036
+ */
4037
+ readonly logImport?: LogImportContribution;
4038
+ /**
4039
+ * Tool contribution factory for this extension.
4040
+ *
4041
+ * When present, the runtime calls `createToolsets(ctx)` after all
4042
+ * dependencies are loaded and registers the returned toolsets with
4043
+ * `ToolRegistry`. Extensions that contribute tools should declare a dependency
4044
+ * on the tool-registry service if one is required for registration.
4045
+ */
4046
+ readonly tools?: ExtensionToolsContribution<THostContext>;
4047
+ /**
4048
+ * Hash trigger factory for this extension.
4049
+ *
4050
+ * When present, the runtime calls `createTriggers(bus)` after all
4051
+ * dependencies are loaded, then registers the returned triggers with
4052
+ * `HashTriggerService`.
4053
+ *
4054
+ * Extensions declaring triggers should depend on `'hash-trigger'` to ensure
4055
+ * the service exists when triggers are registered.
4056
+ */
4057
+ readonly triggers?: ExtensionTriggersContribution<THostContext['bus']>;
4058
+ /**
4059
+ * Session event action factory for this extension.
4060
+ *
4061
+ * When present, the runtime calls `createActions(ctx)` after all
4062
+ * dependencies are loaded and registers the returned declarations with
4063
+ * `SessionEventActionService`. Unregister callbacks are stored for
4064
+ * shutdown cleanup.
4065
+ */
4066
+ readonly sessionEventActions?: ExtensionSessionEventActionsContribution<THostContext['bus']>;
4067
+ /**
4068
+ * Bootstrap capability for project config import/export.
4069
+ *
4070
+ * When present, this extension participates in:
4071
+ * - Project export: extension data can be saved to `.makaio/bootstrap/`
4072
+ * - Project import: extension data can be restored from `.makaio/bootstrap/`
4073
+ */
4074
+ readonly bootstrap?: ExtensionBootstrap<THostContext['bus']>;
4075
+ /**
4076
+ * Workflow trigger and step block declarations for the workflow builder.
4077
+ *
4078
+ * When present, the runtime reads `blocks` during extension activation and
4079
+ * registers each block with the workflow block registry. Blocks are purely
4080
+ * declarative — no runtime context is required. Use {@link WorkflowTriggerBlock}
4081
+ * and {@link WorkflowStepBlock} to define blocks with typed Zod schemas.
4082
+ */
4083
+ readonly workflowBlocks?: ExtensionWorkflowBlocksContribution;
4084
+ /**
4085
+ * Artifact kind definitions contributed by this extension.
4086
+ *
4087
+ * Each entry is an executable {@link AnyArtifactKindDefinition} produced by
4088
+ * {@link defineArtifactKind}. The artifact kind contribution processor reads
4089
+ * this field during extension activation and registers each kind with the
4090
+ * {@link ArtifactSchemaRegistry} via the `artifact.kind.register` bus RPC.
4091
+ *
4092
+ * This is runtime registration data, not descriptor metadata. The
4093
+ * `ArtifactSchemaRegistry` package must be started before any extension that
4094
+ * declares artifact kinds.
4095
+ */
4096
+ readonly artifactKinds?: ExtensionArtifactKindsContribution;
4097
+ /**
4098
+ * Artifact lifecycle hook factory contributed by this extension.
4099
+ *
4100
+ * When present, the runtime calls `createHooks(ctx)` during extension
4101
+ * activation and registers the returned hooks with the artifact lifecycle
4102
+ * hook registry. Hooks are unregistered when the extension stops.
4103
+ *
4104
+ * Hooks are live-only and must not be included in serializable registration
4105
+ * payloads. The `ArtifactLifecycleHookRegistry` package must be started
4106
+ * before any extension that declares lifecycle hooks.
4107
+ */
4108
+ readonly artifactLifecycleHooks?: ExtensionArtifactLifecycleHooksContribution<THostContext['bus']>;
4109
+ /**
4110
+ * Facet namespace definitions contributed by this extension.
4111
+ *
4112
+ * Each entry is an executable {@link FacetNamespaceDefinition} produced by
4113
+ * {@link defineFacetNamespace}. The facet namespace contribution processor reads
4114
+ * this field during extension activation and registers each namespace directly
4115
+ * with the {@link FacetNamespaceRegistry} service.
4116
+ *
4117
+ * Facet namespace registrations are permanent — there is no deregister
4118
+ * operation. This is runtime registration data, not descriptor metadata. The
4119
+ * `FacetNamespaceRegistry` package must be started before any extension that
4120
+ * declares facet namespaces.
4121
+ */
4122
+ readonly facetNamespaces?: ExtensionFacetNamespacesContribution;
4123
+ /**
4124
+ * Surface binding definitions contributed by this extension.
4125
+ *
4126
+ * Each entry is an executable {@link SurfaceBindingDefinition} produced by
4127
+ * {@link defineSurfaceBinding}. The surface binding contribution processor reads
4128
+ * this field during extension activation and registers each binding directly
4129
+ * with the {@link SurfaceBindingRegistry} service.
4130
+ *
4131
+ * Surface binding registrations are permanent — there is no deregister
4132
+ * operation. This is runtime registration data, not descriptor metadata. The
4133
+ * `SurfaceBindingRegistry` package must be started before any extension that
4134
+ * declares surface bindings.
4135
+ */
4136
+ readonly surfaceBindings?: ExtensionSurfaceBindingsContribution;
4137
+ /**
4138
+ * Declarative transition rules contributed by this extension.
4139
+ *
4140
+ * Rules are purely serializable — no functions. The transition contribution
4141
+ * processor reads `transitionRules.rules` during extension activation and
4142
+ * registers each rule with {@link TransitionRuleRegistry}.
4143
+ *
4144
+ * All rule IDs must be prefixed with `'<extensionName>.'`. Duplicate IDs
4145
+ * across all sources hard-fail activation.
4146
+ *
4147
+ * The `transition-pipeline` service must be started before any extension
4148
+ * that declares transition rules.
4149
+ */
4150
+ readonly transitionRules?: ExtensionTransitionRulesContribution;
4151
+ /**
4152
+ * Executable transition action factories contributed by this extension.
4153
+ *
4154
+ * Factories provide custom action semantics beyond the built-in
4155
+ * `workflow.start` action. The transition contribution processor registers
4156
+ * each factory with {@link TransitionActionRegistry} during extension activation.
4157
+ *
4158
+ * All action type keys must be prefixed with `'<extensionName>.'`. Duplicate
4159
+ * type keys across all sources hard-fail activation.
4160
+ */
4161
+ readonly transitionActions?: ExtensionTransitionActionsContribution;
4162
+ /**
4163
+ * Bus namespace introspection for this extension.
4164
+ *
4165
+ * The domain is auto-prefixed to `'extension:NAME'` to avoid collisions.
4166
+ * Register schemas statically in a `namespace.ts` file for type-safe
4167
+ * subjects, then reference them here for documentation and introspection.
4168
+ */
4169
+ readonly namespace?: ExtensionNamespaceContribution;
4170
+ /**
4171
+ * Browser UI contributions for this extension.
4172
+ *
4173
+ * Groups all UI-layer contribution surfaces. Absent for headless-only
4174
+ * extensions. The coordinator passes this bag to the UI loader
4175
+ * which bridges each surface to the appropriate client-side registry.
4176
+ */
4177
+ readonly ui?: ExtensionUiContribution;
4178
+ }
4179
+ /**
4180
+ * Convenience executable extension type for Node hosts.
4181
+ *
4182
+ * Contracts stays independent of the concrete bus implementation; Node-based
4183
+ * packages bind `TBus` from their host layer (for example `IMakaioBus` from
4184
+ * `@makaio/bus-core`) when they need the full typed bus authoring surface.
4185
+ * @typeParam TBus - Concrete bus type supplied by the Node host.
4186
+ */
4187
+ type MakaioNodeExtension$1<TBus extends MakaioBusLike> = MakaioExtension$1<NodeExtensionContext$1<TBus>>;
4188
+ //#endregion
4189
+ //#region core/contracts/src/extension/extension-descriptor.d.ts
4190
+ /**
4191
+ * Discriminated union of supported transports for detached extensions.
4192
+ *
4193
+ * - `bus-stdio` — bidirectional Makaio bus over stdin/stdout.
4194
+ * - `bus-websocket` — bidirectional Makaio bus over a WebSocket connection.
4195
+ * - `mcp-stdio` — MCP protocol over stdin/stdout (no restart policy).
4196
+ */
4197
+ declare const DetachedTransportSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4198
+ command: z.ZodString;
4199
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
4200
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4201
+ healthTimeoutMs: z.ZodOptional<z.ZodNumber>;
4202
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
4203
+ restartPolicy: z.ZodOptional<z.ZodEnum<{
4204
+ none: "none";
4205
+ always: "always";
4206
+ "on-crash": "on-crash";
4207
+ }>>;
4208
+ type: z.ZodLiteral<"bus-stdio">;
4209
+ }, z.core.$strip>, z.ZodObject<{
4210
+ command: z.ZodString;
4211
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
4212
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4213
+ healthTimeoutMs: z.ZodOptional<z.ZodNumber>;
4214
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
4215
+ restartPolicy: z.ZodOptional<z.ZodEnum<{
4216
+ none: "none";
4217
+ always: "always";
4218
+ "on-crash": "on-crash";
4219
+ }>>;
4220
+ type: z.ZodLiteral<"bus-websocket">;
4221
+ }, z.core.$strip>, z.ZodObject<{
4222
+ command: z.ZodString;
4223
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
4224
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4225
+ healthTimeoutMs: z.ZodOptional<z.ZodNumber>;
4226
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
4227
+ type: z.ZodLiteral<"mcp-stdio">;
4228
+ }, z.core.$strip>], "type">;
4229
+ /** Inferred type from {@link DetachedTransportSchema}. */
4230
+ type DetachedTransportConfig = z.infer<typeof DetachedTransportSchema>;
4231
+ /**
4232
+ * Convention-based entrypoint declarations for each runtime surface.
4233
+ *
4234
+ * `true` means "use the surface name as the stem". A string value is a custom
4235
+ * stem whose final path segment names the file (e.g. `"cli/index"` resolves to
4236
+ * `src/cli/index.ts` in dev or `dist/cli/index.mjs` in production). Omit
4237
+ * surfaces the extension does not target.
4238
+ *
4239
+ * The runtime resolves the stem by trying `src/{stem}.ts` first (dev), then
4240
+ * `dist/{stem}.mjs` (production). No path prefix or file extension should be
4241
+ * included in the descriptor — those are added by convention.
4242
+ */
4243
+ interface ExtensionEntrypoints {
4244
+ /** Server entry — exports a {@link MakaioExtension} as default export. */
4245
+ readonly server?: true | string;
4246
+ /** Browser entry — bundled JS loaded in the renderer. */
4247
+ readonly browser?: true | string;
4248
+ /** CLI entry — exports an `ExtensionCliContribution` as default export. */
4249
+ readonly cli?: true | string;
4250
+ }
4251
+ /** Zod schema for {@link ExtensionEntrypoints}. */
4252
+ declare const ExtensionEntrypointsSchema: z.ZodObject<{
4253
+ server: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
4254
+ browser: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
4255
+ cli: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
4256
+ }, z.core.$strip>;
4257
+ /**
4258
+ * Shared base fields for all extension descriptors.
4259
+ *
4260
+ * Contains the fields common to both embedded and detached descriptors,
4261
+ * excluding `entrypoints` and `transport` which differ per execution mode.
4262
+ */
4263
+ interface ExtensionDescriptorBase extends ExtensionManifest {
4264
+ /** SemVer version of the extension package. */
4265
+ readonly version: string;
4266
+ /** Framework version range required (npm semver range, e.g. `">=1.0.0 <2.0.0"`). */
4267
+ readonly makaio: {
4268
+ readonly framework: VersionRange;
4269
+ };
4270
+ /**
4271
+ * Default configuration values for this extension.
4272
+ *
4273
+ * Applied when no stored config exists. Keys should match the properties
4274
+ * in the extension's `configSchema` (declared on its {@link MakaioExtension}).
4275
+ * The Zod schema's own `.default()` values layer on top of these.
4276
+ */
4277
+ readonly config?: {
4278
+ readonly defaults?: Readonly<Record<string, unknown>>;
4279
+ };
4280
+ }
4281
+ /**
4282
+ * Descriptor for extensions running in the host process (default mode).
4283
+ *
4284
+ * `entrypoints` is required; `execution` is `'embedded'` or omitted.
4285
+ * `transport` must be absent.
4286
+ */
4287
+ interface EmbeddedDescriptor extends ExtensionDescriptorBase {
4288
+ /**
4289
+ * Handler execution mode — `'embedded'` or omitted (defaults to embedded).
4290
+ * Code is `import()`'d directly into the host process.
4291
+ */
4292
+ readonly execution?: 'embedded';
4293
+ /**
4294
+ * Convention-based entrypoint stems and enabled-surface flags per runtime
4295
+ * surface. Required for embedded extensions.
4296
+ */
4297
+ readonly entrypoints: ExtensionEntrypoints;
4298
+ /** Must be absent for embedded extensions. */
4299
+ readonly transport?: undefined;
4300
+ }
4301
+ /**
4302
+ * Descriptor for extensions running as child processes.
4303
+ *
4304
+ * `transport` is required; `execution` must be `'detached'`.
4305
+ * `entrypoints` must be absent.
4306
+ */
4307
+ interface DetachedDescriptor extends ExtensionDescriptorBase {
4308
+ /**
4309
+ * Handler execution mode — must be `'detached'` for subprocess extensions.
4310
+ * The extension runs as a child process communicating via the chosen transport.
4311
+ */
4312
+ readonly execution: 'detached';
4313
+ /**
4314
+ * Transport configuration for detached extensions.
4315
+ *
4316
+ * Specifies the IPC mechanism and process lifecycle options for the child
4317
+ * process.
4318
+ */
4319
+ readonly transport: DetachedTransportConfig;
4320
+ /** Must be absent for detached extensions. */
4321
+ readonly entrypoints?: undefined;
4322
+ }
4323
+ /**
4324
+ * Discriminated union of extension descriptor shapes.
4325
+ *
4326
+ * Narrows automatically via `execution` check:
4327
+ * - `descriptor.execution === 'detached'` → `DetachedDescriptor`
4328
+ * - Otherwise (including `undefined`) → `EmbeddedDescriptor`
4329
+ *
4330
+ * Use {@link isDetachedDescriptor} for an explicit type guard.
4331
+ */
4332
+ type ExtensionDescriptor = EmbeddedDescriptor | DetachedDescriptor;
4333
+ /**
4334
+ * Type guard for detached extension descriptors.
4335
+ *
4336
+ * After this guard returns `true`, TypeScript narrows the descriptor to
4337
+ * {@link DetachedDescriptor} where `transport` is required and `entrypoints`
4338
+ * is absent.
4339
+ * @param descriptor - The extension descriptor to check.
4340
+ * @returns Whether the descriptor is for a detached (subprocess) extension.
4341
+ */
4342
+ declare function isDetachedDescriptor(descriptor: ExtensionDescriptor): descriptor is DetachedDescriptor;
4343
+ /**
4344
+ * Zod schema for {@link ExtensionDescriptor}.
4345
+ *
4346
+ * Enforces execution-mode invariants via `superRefine`:
4347
+ * - `execution === 'detached'` requires `transport`; `entrypoints` is optional.
4348
+ * - All other modes (including the default embedded mode) require `entrypoints`.
4349
+ *
4350
+ * Note: `satisfies z.ZodType<ExtensionDescriptor>` is intentionally omitted
4351
+ * because `superRefine` wraps the schema in `ZodEffects`, which is incompatible
4352
+ * with that constraint.
4353
+ */
4354
+ declare const ExtensionDescriptorSchema: z.ZodObject<{
4355
+ name: z.ZodString;
4356
+ displayName: z.ZodString;
4357
+ surface: z.ZodOptional<z.ZodEnum<{
4358
+ any: "any";
4359
+ interactive: "interactive";
4360
+ headless: "headless";
4361
+ }>>;
4362
+ dependencies: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4363
+ type: z.ZodLiteral<"extension">;
4364
+ name: z.ZodString;
4365
+ version: z.ZodString;
4366
+ optional: z.ZodOptional<z.ZodBoolean>;
4367
+ }, z.core.$strip>>>>;
4368
+ requires: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
4369
+ type: z.ZodLiteral<"host">;
4370
+ id: z.ZodString;
4371
+ }, z.core.$strip>, z.ZodObject<{
4372
+ type: z.ZodLiteral<"capability">;
4373
+ id: z.ZodString;
4374
+ version: z.ZodOptional<z.ZodString>;
4375
+ }, z.core.$strip>], "type">>>>;
4376
+ provides: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<"adapters", unknown, z.core.$ZodTypeInternals<"adapters", unknown>>>>>;
4377
+ windows: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4378
+ id: z.ZodString;
4379
+ style: z.ZodEnum<{
4380
+ "tray-popover": "tray-popover";
4381
+ utility: "utility";
4382
+ panel: "panel";
4383
+ }>;
4384
+ width: z.ZodOptional<z.ZodNumber>;
4385
+ height: z.ZodOptional<z.ZodNumber>;
4386
+ singleton: z.ZodOptional<z.ZodBoolean>;
4387
+ params: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4388
+ name: z.ZodString;
4389
+ required: z.ZodOptional<z.ZodBoolean>;
4390
+ }, z.core.$strip>>>>;
4391
+ }, z.core.$strip>>>>;
4392
+ tray: z.ZodOptional<z.ZodObject<{
4393
+ label: z.ZodString;
4394
+ section: z.ZodOptional<z.ZodEnum<{
4395
+ tools: "tools";
4396
+ utilities: "utilities";
4397
+ views: "views";
4398
+ }>>;
4399
+ opensWindow: z.ZodOptional<z.ZodString>;
4400
+ action: z.ZodOptional<z.ZodString>;
4401
+ }, z.core.$strip>>;
4402
+ cli: z.ZodOptional<z.ZodObject<{
4403
+ name: z.ZodString;
4404
+ description: z.ZodString;
4405
+ subcommands: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4406
+ name: z.ZodString;
4407
+ description: z.ZodString;
4408
+ args: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4409
+ name: z.ZodString;
4410
+ description: z.ZodString;
4411
+ required: z.ZodOptional<z.ZodBoolean>;
4412
+ positional: z.ZodOptional<z.ZodBoolean>;
4413
+ short: z.ZodOptional<z.ZodString>;
4414
+ type: z.ZodOptional<z.ZodEnum<{
4415
+ string: "string";
4416
+ number: "number";
4417
+ boolean: "boolean";
4418
+ }>>;
4419
+ }, z.core.$strip>>>>;
4420
+ }, z.core.$strip>>>>;
4421
+ hasInteractive: z.ZodOptional<z.ZodBoolean>;
4422
+ canProvideBus: z.ZodOptional<z.ZodBoolean>;
4423
+ }, z.core.$strip>>;
4424
+ storage: z.ZodOptional<z.ZodObject<{
4425
+ migrations: z.ZodOptional<z.ZodString>;
4426
+ migrationSourceId: z.ZodOptional<z.ZodString>;
4427
+ }, z.core.$strip>>;
4428
+ browser: z.ZodOptional<z.ZodObject<{
4429
+ entrypoint: z.ZodString;
4430
+ }, z.core.$strip>>;
4431
+ contributions: z.ZodOptional<z.ZodObject<{
4432
+ adapters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4433
+ name: z.ZodString;
4434
+ displayName: z.ZodOptional<z.ZodString>;
4435
+ description: z.ZodOptional<z.ZodString>;
4436
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4437
+ id: z.ZodString;
4438
+ version: z.ZodString;
4439
+ binaryVersion: z.ZodOptional<z.ZodString>;
4440
+ }, z.core.$strip>>>>;
4441
+ protocols: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
4442
+ anthropic: "anthropic";
4443
+ openai: "openai";
4444
+ }>, z.ZodObject<{
4445
+ anthropic: z.ZodOptional<z.ZodObject<{
4446
+ endpoint: z.ZodOptional<z.ZodString>;
4447
+ }, z.core.$strip>>;
4448
+ openai: z.ZodOptional<z.ZodObject<{
4449
+ endpoint: z.ZodOptional<z.ZodString>;
4450
+ }, z.core.$strip>>;
4451
+ }, z.core.$strip>]>>>;
4452
+ defaultProvider: z.ZodOptional<z.ZodString>;
4453
+ }, z.core.$strip>>>>;
4454
+ clients: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4455
+ id: z.ZodString;
4456
+ name: z.ZodString;
4457
+ description: z.ZodOptional<z.ZodString>;
4458
+ binary: z.ZodOptional<z.ZodObject<{
4459
+ name: z.ZodString;
4460
+ managed: z.ZodOptional<z.ZodBoolean>;
4461
+ version: z.ZodOptional<z.ZodString>;
4462
+ }, z.core.$strict>>;
4463
+ }, z.core.$strict>>>>;
4464
+ providers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4465
+ id: z.ZodString;
4466
+ name: z.ZodString;
4467
+ description: z.ZodOptional<z.ZodString>;
4468
+ }, z.core.$strip>>>>;
4469
+ triggers: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4470
+ prefix: z.ZodString;
4471
+ description: z.ZodOptional<z.ZodString>;
4472
+ stage: z.ZodOptional<z.ZodEnum<{
4473
+ transform: "transform";
4474
+ action: "action";
4475
+ gather: "gather";
4476
+ }>>;
4477
+ }, z.core.$strip>>>>;
4478
+ logImporters: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4479
+ adapterName: z.ZodString;
4480
+ displayName: z.ZodString;
4481
+ logFilePattern: z.ZodOptional<z.ZodString>;
4482
+ }, z.core.$strip>>>>;
4483
+ sessionEventActions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4484
+ id: z.ZodString;
4485
+ label: z.ZodString;
4486
+ description: z.ZodOptional<z.ZodString>;
4487
+ icon: z.ZodOptional<z.ZodString>;
4488
+ selectionMode: z.ZodEnum<{
4489
+ single: "single";
4490
+ multi: "multi";
4491
+ }>;
4492
+ messageRoles: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodEnum<{
4493
+ user: "user";
4494
+ assistant: "assistant";
4495
+ }>>>>;
4496
+ }, z.core.$strip>>>>;
4497
+ artifactLifecycleHooks: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
4498
+ id: z.ZodString;
4499
+ event: z.ZodEnum<{
4500
+ beforeCreate: "beforeCreate";
4501
+ beforeRevise: "beforeRevise";
4502
+ afterCreate: "afterCreate";
4503
+ afterRevise: "afterRevise";
4504
+ afterStatusChanged: "afterStatusChanged";
4505
+ afterObservationAdded: "afterObservationAdded";
4506
+ }>;
4507
+ kind: z.ZodOptional<z.ZodString>;
4508
+ schemaVersion: z.ZodOptional<z.ZodString>;
4509
+ }, z.core.$strip>>>>;
4510
+ create: z.ZodOptional<z.ZodBoolean>;
4511
+ tools: z.ZodOptional<z.ZodBoolean>;
4512
+ bootstrap: z.ZodOptional<z.ZodBoolean>;
4513
+ namespace: z.ZodOptional<z.ZodBoolean>;
4514
+ configSchema: z.ZodOptional<z.ZodBoolean>;
4515
+ uiConfig: z.ZodOptional<z.ZodBoolean>;
4516
+ ui: z.ZodOptional<z.ZodObject<{
4517
+ tiles: z.ZodOptional<z.ZodBoolean>;
4518
+ widgets: z.ZodOptional<z.ZodBoolean>;
4519
+ pages: z.ZodOptional<z.ZodBoolean>;
4520
+ routes: z.ZodOptional<z.ZodBoolean>;
4521
+ }, z.core.$strip>>;
4522
+ }, z.core.$strip>>;
4523
+ version: z.ZodString;
4524
+ makaio: z.ZodReadonly<z.ZodObject<{
4525
+ framework: z.ZodString;
4526
+ }, z.core.$strict>>;
4527
+ entrypoints: z.ZodOptional<z.ZodObject<{
4528
+ server: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
4529
+ browser: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
4530
+ cli: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
4531
+ }, z.core.$strip>>;
4532
+ execution: z.ZodOptional<z.ZodEnum<{
4533
+ embedded: "embedded";
4534
+ detached: "detached";
4535
+ }>>;
4536
+ transport: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
4537
+ command: z.ZodString;
4538
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
4539
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4540
+ healthTimeoutMs: z.ZodOptional<z.ZodNumber>;
4541
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
4542
+ restartPolicy: z.ZodOptional<z.ZodEnum<{
4543
+ none: "none";
4544
+ always: "always";
4545
+ "on-crash": "on-crash";
4546
+ }>>;
4547
+ type: z.ZodLiteral<"bus-stdio">;
4548
+ }, z.core.$strip>, z.ZodObject<{
4549
+ command: z.ZodString;
4550
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
4551
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4552
+ healthTimeoutMs: z.ZodOptional<z.ZodNumber>;
4553
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
4554
+ restartPolicy: z.ZodOptional<z.ZodEnum<{
4555
+ none: "none";
4556
+ always: "always";
4557
+ "on-crash": "on-crash";
4558
+ }>>;
4559
+ type: z.ZodLiteral<"bus-websocket">;
4560
+ }, z.core.$strip>, z.ZodObject<{
4561
+ command: z.ZodString;
4562
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
4563
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4564
+ healthTimeoutMs: z.ZodOptional<z.ZodNumber>;
4565
+ shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
4566
+ type: z.ZodLiteral<"mcp-stdio">;
4567
+ }, z.core.$strip>], "type">>;
4568
+ config: z.ZodOptional<z.ZodObject<{
4569
+ defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4570
+ }, z.core.$strip>>;
4571
+ }, z.core.$strip>;
4572
+ /**
4573
+ * Parse and validate an extension descriptor from raw JSON input.
4574
+ *
4575
+ * This is the typed wrapper around {@link ExtensionDescriptorSchema} that
4576
+ * returns the {@link ExtensionDescriptor} discriminated union. Throws a Zod
4577
+ * error on invalid input.
4578
+ * @param input - Raw JSON-like value to parse.
4579
+ * @returns Parsed and typed extension descriptor.
4580
+ */
4581
+ declare function parseExtensionDescriptor(input: unknown): ExtensionDescriptor;
4582
+ /** Result shape returned by {@link safeParseExtensionDescriptor}. */
4583
+ type ExtensionDescriptorParseResult = {
4584
+ readonly success: true;
4585
+ readonly data: ExtensionDescriptor;
4586
+ } | {
4587
+ readonly success: false;
4588
+ readonly error: z.ZodError;
4589
+ };
4590
+ /**
4591
+ * Safely parse and validate an extension descriptor from raw JSON input.
4592
+ *
4593
+ * This is the typed wrapper around {@link ExtensionDescriptorSchema} that
4594
+ * returns a result with the {@link ExtensionDescriptor} discriminated union on
4595
+ * success.
4596
+ * @param input - Raw JSON-like value to parse.
4597
+ * @returns Parse result with `data` typed as {@link ExtensionDescriptor} on
4598
+ * success, or a Zod error on failure.
4599
+ */
4600
+ declare function safeParseExtensionDescriptor(input: unknown): ExtensionDescriptorParseResult;
4601
+ //#endregion
4602
+ //#region core/contracts/src/extension/parse-extension-config.d.ts
4603
+ /**
4604
+ * Parse raw extension config with a Zod schema, applying schema defaults.
4605
+ *
4606
+ * Handles the common extension initialization pattern where `ctx.config` may be
4607
+ * `undefined` (no stored config) or a partial object. The schema is expected
4608
+ * to provide defaults for all optional fields so that parsing `{}` always
4609
+ * yields a valid config.
4610
+ * @param schema - Zod schema with defaults for all optional fields.
4611
+ * @param rawConfig - Raw config value from {@link ExtensionContext.config} (may be undefined).
4612
+ * @returns Validated and defaulted config object.
4613
+ * @example
4614
+ * ```typescript
4615
+ * create: (ctx) => {
4616
+ * const config = parseExtensionConfig(MyConfigSchema, ctx.config);
4617
+ * return new MyService(ctx.bus, config);
4618
+ * },
4619
+ * ```
4620
+ */
4621
+ declare function parseExtensionConfig<T extends z.ZodType>(schema: T, rawConfig: unknown): z.infer<T>;
4622
+ //#endregion
4623
+ //#region core/contracts/src/extension/extension-config-provider.d.ts
4624
+ /**
4625
+ * Provider for persisted extension configuration and enablement state.
4626
+ *
4627
+ * Injected by the host composition root. When absent, all extensions start
4628
+ * enabled with default (Zod-schema) configuration only.
4629
+ */
4630
+ interface ExtensionConfigProvider {
4631
+ /**
4632
+ * Load persisted configuration for an extension by name.
4633
+ *
4634
+ * Returns `undefined` when no stored config exists for the extension.
4635
+ * Invalid values are ignored by the coordinator during schema parse.
4636
+ * @param name - Extension package name.
4637
+ * @returns Stored configuration object, or `undefined` when absent.
4638
+ */
4639
+ loadConfig(name: string): Record<string, unknown> | undefined;
4640
+ /**
4641
+ * Check whether an extension is enabled in persistent storage.
4642
+ *
4643
+ * Returns `undefined` to indicate no persisted preference — the coordinator
4644
+ * treats `undefined` the same as `true` (start normally).
4645
+ * @param name - Extension package name.
4646
+ * @returns `false` to skip the package at boot, `true` or `undefined` to start normally.
4647
+ */
4648
+ loadEnabled(name: string): boolean | undefined;
4649
+ }
4650
+ //#endregion
4651
+ export { LogImportContribution as $, CliArgManifest as $n, GatheredEntry as $t, TransitionConditionSchema as A, ExtensionCliHandlerContext as An, ArtifactLifecycleHookManifestSchema as Ar, SlotDeclaration as At, BootstrapExportContext as B, ExtensionWarningAction as Bn, ProtocolRefSchema as Br, TileDeclaration as Bt, ExtensionTransitionActionsContribution as C, SessionEventActionOptions as Cn, CapabilityTokenSchema as Cr, PluginTransformedContent as Ct, TransitionActionInvocation$1 as D, ExtensionCliBeforeRunContext as Dn, AdapterManifestSchema as Dr, PageDeclaration as Dt, TransitionActionHandler as E, ExtensionRuntimeOwnership as En, AdapterManifest as Er, PageComponentProps as Et, TransitionRuleDefinitionSchema$1 as F, NodeExtensionContext$1 as Fn, LogImporterManifest as Fr, WidgetDefinition as Ft, ExtensionBootstrap as G, ExtensionWarningSeverity as Gn, TriggerManifest as Gr, UiContextSnapshot$1 as Gt, BootstrapImportContext as H, ExtensionWarningEntry as Hn, ProviderManifestSchema as Hr, TileProps as Ht, BootstrapAsset as I, ExtensionIdentity as In, LogImporterManifestSchema as Ir, WidgetProps as It, ExtensionNamespaceContribution as J, AdapterDefinitionContract$1 as Jn, UiSurfaceFlags as Jr, UiNavigationLevelMap as Jt, getBootstrapAssetKey as K, ExtensionWarningSeveritySchema as Kn, TriggerManifestSchema as Kr, UiContextValueMap as Kt, BootstrapAssetKey as L, ExtensionService$1 as Ln, ProtocolConfig as Lr, WidgetRenderers as Lt, TransitionEventType$1 as M, ExtensionCliOutputWriter as Mn, ClientManifestSchema as Mr, SlotPlacementDeclaration as Mt, TransitionEventTypeSchema as N, ExtensionCliSubcommandEntry as Nn, ContributionManifest as Nr, WidgetSize as Nt, TransitionActionInvocationSchema as O, ExtensionCliBeforeRunResult as On, ArtifactLifecycleHookEventSchema as Or, PageMode as Ot, TransitionRuleDefinition$1 as P, ExtensionContext$1 as Pn, ContributionManifestSchema as Pr, WidgetDeclaration as Pt, ExtensionUiContribution as Q, extensionToken$1 as Qn, GatheredContext as Qt, BootstrapChoice as R, ExtensionServiceLifecycle$1 as Rn, ProtocolConfigSchema as Rr, WidgetSize$1 as Rt, MakaioNodeExtension$1 as S, SessionEventActionDeclaration as Sn, CapabilityTokenMap as Sr, PluginToolCallFormatterInput as St, TransitionActionFactory$1 as T, WhenContext as Tn, AdapterClientRefSchema as Tr, ToolCallFormatterDeclaration as Tt, BootstrapImportResult as U, ExtensionWarningEntrySchema as Un, SessionEventActionManifest as Ur, TileRenderers as Ut, BootstrapExportResult as V, ExtensionWarningActionSchema as Vn, ProviderManifest as Vr, TileIconLoader as Vt, BootstrapResult as W, ExtensionWarningSchema as Wn, SessionEventActionManifestSchema as Wr, UiContextDimension as Wt, ExtensionToolsContribution as X, AdapterProviderRef as Xn, BrowserEntrypoint as Xr, UiScope$1 as Xt, ExtensionSessionEventActionsContribution as Y, AdapterProviderDefinitionContract$1 as Yn, UiSurfaceFlagsSchema as Yr, UiRuntimeNavigationLevel as Yt, ExtensionTriggersContribution as Z, ExtensionToken$1 as Zn, BrowserEntrypointSchema$1 as Zr, UiScopeMap as Zt, ExtensionArtifactLifecycleHooksContribution as _, PickerConfig as _n, WindowParamSpec as _r, MakaioWebUiComponentProps as _t, DetachedTransportSchema as a, HashTriggerSuggestResult as an, ExtensionDependency as ar, StationNodeBlockRun as at, ExtensionRuntimeBootContribution as b, SelectionFeedback as bn, dep$1 as br, PromisifiedActions as bt, ExtensionDescriptorBase as c, ActionShortcut as cn, ExtensionManifestSchema as cr, WorkflowStepBlock as ct, ExtensionEntrypoints as d, EntrypointConfig as dn, StorageManifest as dr, ExtensionConfigComponentLoader as dt, HashSuggestion as en, CliArgManifestSchema as er, ExtensionWorkflowBlocksContribution as et, ExtensionEntrypointsSchema as f, EventFilter as fn, StorageManifestSchema as fr, ExtensionConfigComponentProps as ft, ArtifactLifecycleHooksContributionContext as g, MessageRole as gn, WindowManifestSchema as gr, MakaioWebUiActions as gt, safeParseExtensionDescriptor as h, MessageEventFilter as hn, WindowManifest as hr, MakaioWebUiAction as ht, DetachedTransportConfig as i, HashTriggerStage as in, CliSubcommandManifestSchema as ir, RegisteredTriggerBlock$1 as it, TransitionEvaluationContext$1 as j, ExtensionCliInteractiveContext as jn, ClientManifest as jr, SlotId as jt, TransitionCondition as k, ExtensionCliContribution as kn, ArtifactLifecycleHookManifest as kr, SlotContentDeclaration as kt, ExtensionDescriptorParseResult as l, ActionShortcutModifiers as ln, RuntimeRequirement as lr, WorkflowStepBlockRun as lt, parseExtensionDescriptor as m, ExecuteResult as mn, TrayManifestSchema as mr, LoaderContext as mt, parseExtensionConfig as n, HashTriggerContext as nn, CliManifestSchema as nr, DelegateRoleNodeBlockRun as nt, EmbeddedDescriptor as o, ActionCategory as on, ExtensionDependencySchema as or, WorkflowBlockCollection$1 as ot, isDetachedDescriptor as p, ExecuteContext as pn, TrayManifest$1 as pr, ExtensionFieldTypeLoader as pt, AdapterContribution as q, getExtensionWarningActionLabel as qn, TriggerStage as qr, UiNavigationLevel$1 as qt, DetachedDescriptor as r, HashTriggerMetadata as rn, CliSubcommandManifest as rr, RegisteredStepBlock$1 as rt, ExtensionDescriptor as s, ActionCategoryMap as sn, ExtensionManifest as sr, WorkflowBlockMetadata as st, ExtensionConfigProvider as t, HashTrigger as tn, CliManifest as tr, DelegateAgentNodeBlockRun as tt, ExtensionDescriptorSchema as u, CreateSessionEventActionResult as un, RuntimeRequirementSchema as ur, WorkflowTriggerBlock as ut, ExtensionContributionProcessor$1 as v, PickerOpenContext as vn, WindowParamSpecSchema as vr, MakaioWebUiLoader as vt, ExtensionTransitionRulesContribution as w, StructuralEventFilter as wn, AdapterClientRef$1 as wr, PluginTransformedContentType as wt, MakaioExtension$1 as x, SessionEventActionContext as xn, CapabilityToken as xr, PluginFormattedToolCallOutput as xt, ExtensionRuntimeBootContext as y, SelectionChangeContext as yn, WindowStyle as yr, MakaioWebUiRoute as yt, BootstrapDiscoverContext as z, ExtensionWarning as zn, ProtocolRef as zr, TileCapabilities as zt };