@makaio/framework 1.0.0-dev-1785407933303 → 1.0.0-dev-1786014320559

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 (511) hide show
  1. package/dist/.makaio-build.json +4 -3
  2. package/dist/{account-identity-DFx8pwKL.mjs → account-identity-DGpXd8h_.mjs} +1 -1
  3. package/dist/adapter-BkdJaOOG.mjs +1 -0
  4. package/dist/adapter-subsystem/index.d.mts +138 -6
  5. package/dist/adapter-subsystem/index.mjs +1 -1
  6. package/dist/adapters/acp-client/index.d.mts +105 -7
  7. package/dist/adapters/acp-client/index.mjs +2 -2
  8. package/dist/adapters/claude/index.d.mts +24 -24
  9. package/dist/adapters/config/index.d.mts +1 -1
  10. package/dist/adapters/config/index.mjs +1 -1
  11. package/dist/adapters/index.d.mts +379 -812
  12. package/dist/adapters/index.mjs +6 -6
  13. package/dist/adapters/node.d.mts +1 -1
  14. package/dist/adapters/node.mjs +1 -1
  15. package/dist/adapters/stream-session/index.d.mts +28 -7
  16. package/dist/adapters/stream-session/index.mjs +1 -1
  17. package/dist/agent-namespace-D51PODFf.mjs +1 -0
  18. package/dist/{ajv-DD3SIL2i.mjs → ajv-L5fKxaia.mjs} +2 -2
  19. package/dist/artifact-k3veR4Yx.mjs +1 -0
  20. package/dist/attach-error-BSlc7JfL.mjs +1 -0
  21. package/dist/{auth-DGEdiHF6.mjs → auth-A1K_7q-8.mjs} +1 -1
  22. package/dist/authority-state-bootstrap-YwtEImIB.mjs +1 -0
  23. package/dist/automation-trigger-CuSdQwir.mjs +1 -0
  24. package/dist/await-trigger-ph1S0zVI.mjs +1 -0
  25. package/dist/bus/index.d.mts +17 -3
  26. package/dist/bus/index.mjs +1 -1
  27. package/dist/bus-BIj0_aG6.mjs +1 -0
  28. package/dist/bus-CqgrphNE.mjs +2 -0
  29. package/dist/{canonical-model-BAytQ4NV.mjs → canonical-model-DJASlL4m.mjs} +1 -1
  30. package/dist/{capabilities-BQEp34ir.mjs → capabilities-Bqckjh7G.mjs} +1 -1
  31. package/dist/{client-DbS847wW.mjs → client-BL5__WT0.mjs} +1 -1
  32. package/dist/clients/index.d.mts +7 -7
  33. package/dist/clients/index.mjs +1 -1
  34. package/dist/clients/managed-install.d.mts +1 -1
  35. package/dist/clients/managed-install.mjs +1 -1
  36. package/dist/{compression-74fFeBha.mjs → compression-BbttSqm8.mjs} +1 -1
  37. package/dist/{config-namespace-TVX-hG4I.mjs → config-namespace-CyzeLWSg.mjs} +1 -1
  38. package/dist/{context-resolution-DNRkyQto.d.mts → context-resolution-CW0ya4QO.d.mts} +14 -14
  39. package/dist/contracts/adapter/index.d.mts +3 -3
  40. package/dist/contracts/adapter/index.mjs +1 -1
  41. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  42. package/dist/contracts/artifact/index.d.mts +3 -3
  43. package/dist/contracts/artifact/index.mjs +1 -1
  44. package/dist/contracts/auth/index.d.mts +2 -2
  45. package/dist/contracts/auth/index.mjs +1 -1
  46. package/dist/contracts/automation-trigger/index.d.mts +4 -0
  47. package/dist/contracts/automation-trigger/index.mjs +1 -0
  48. package/dist/contracts/canonical-model/index.d.mts +1 -1
  49. package/dist/contracts/canonical-model/index.mjs +1 -1
  50. package/dist/contracts/capabilities/index.d.mts +1 -1
  51. package/dist/contracts/capabilities/index.mjs +1 -1
  52. package/dist/contracts/client/index.d.mts +2 -2
  53. package/dist/contracts/client/index.mjs +1 -1
  54. package/dist/contracts/common/index.d.mts +1 -1
  55. package/dist/contracts/config/index.d.mts +1 -1
  56. package/dist/contracts/config/index.mjs +1 -1
  57. package/dist/contracts/extension/index.d.mts +6 -5
  58. package/dist/contracts/extension/index.mjs +1 -1
  59. package/dist/contracts/facet/index.d.mts +1 -1
  60. package/dist/contracts/facet/index.mjs +1 -1
  61. package/dist/contracts/harness/index.d.mts +1 -1
  62. package/dist/contracts/harness/index.mjs +1 -1
  63. package/dist/contracts/host/index.d.mts +1 -1
  64. package/dist/contracts/host/index.mjs +1 -1
  65. package/dist/contracts/index.d.mts +161 -100
  66. package/dist/contracts/index.mjs +1 -1
  67. package/dist/contracts/materialization/index.d.mts +3 -3
  68. package/dist/contracts/materialization/index.mjs +1 -1
  69. package/dist/contracts/model-registry/index.d.mts +1 -1
  70. package/dist/contracts/model-registry/index.mjs +1 -1
  71. package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
  72. package/dist/contracts/native-session-supervisor/index.mjs +1 -1
  73. package/dist/contracts/platform/index.d.mts +1 -1
  74. package/dist/contracts/platform/index.mjs +1 -1
  75. package/dist/contracts/provider/index.d.mts +2 -2
  76. package/dist/contracts/provider/index.mjs +1 -1
  77. package/dist/contracts/reaction/index.d.mts +2 -0
  78. package/dist/contracts/reaction/index.mjs +1 -0
  79. package/dist/contracts/session/index.d.mts +3 -3
  80. package/dist/contracts/session/index.mjs +1 -1
  81. package/dist/contracts/shared/index.d.mts +3 -3
  82. package/dist/contracts/shared/index.mjs +1 -1
  83. package/dist/contracts/skill/index.d.mts +1 -1
  84. package/dist/contracts/skill/index.mjs +1 -1
  85. package/dist/contracts/telemetry/index.d.mts +1 -1
  86. package/dist/contracts/telemetry/index.mjs +1 -1
  87. package/dist/contracts/timeout/index.d.mts +1 -1
  88. package/dist/contracts/timeout/index.mjs +1 -1
  89. package/dist/contracts/toast/index.mjs +1 -1
  90. package/dist/contracts/variant/index.d.mts +1 -1
  91. package/dist/contracts/variant/index.mjs +1 -1
  92. package/dist/contracts/worker-node/index.d.mts +1 -1
  93. package/dist/contracts/worker-node/index.mjs +1 -1
  94. package/dist/contracts/workflow/index.d.mts +3 -3
  95. package/dist/contracts/workflow/index.mjs +1 -1
  96. package/dist/contribution-BH-wKsWI.d.mts +35 -0
  97. package/dist/core/index.d.mts +60 -1
  98. package/dist/core/index.mjs +1 -1
  99. package/dist/definition-BYgHlmMw.d.mts +375 -0
  100. package/dist/{definition-CJfiv8xm.mjs → definition-CDg-Jq1T.mjs} +1 -1
  101. package/dist/{detached-extension-handle-Ddfquy5_.mjs → detached-extension-handle-DKd17UB6.mjs} +1 -1
  102. package/dist/drizzle/0031_adapter_session_currency.sql +66 -0
  103. package/dist/drizzle/0032_native_session_ownership.sql +77 -0
  104. package/dist/drizzle/0033_m_msf3hu2s.sql +1 -0
  105. package/dist/drizzle/meta/_journal.json +21 -0
  106. package/dist/{execution-attempt-repository-DWXKY41_.d.mts → execution-attempt-repository-DFyAnchJ.d.mts} +1 -1
  107. package/dist/{execution-target-Cf645pDj.mjs → execution-target-ByNwZh5-.mjs} +1 -1
  108. package/dist/extension-DMdmj9gi.mjs +1 -0
  109. package/dist/extension-DUmibvMk.mjs +1 -0
  110. package/dist/extension-context-CqfddWXs.d.mts +295 -0
  111. package/dist/{extension-discovery-CQRdbVQ6.d.mts → extension-discovery-Fhps4icD.d.mts} +2 -0
  112. package/dist/{extension-namespace-Yu41YepM.mjs → extension-namespace-B554RmCp.mjs} +1 -1
  113. package/dist/extension-package-provenance-Dh_-Z-tE.mjs +1 -0
  114. package/dist/{filesystem-service-DlP2HfDg.mjs → filesystem-service-FAtd9gWH.mjs} +1 -1
  115. package/dist/framework-packages-D_2hBZ-p.mjs +1 -0
  116. package/dist/git/index.mjs +1 -1
  117. package/dist/{globby-1yCVCk8s.mjs → globby-BBLuT_vy.mjs} +1 -1
  118. package/dist/handlers-2yd00VEq.mjs +57 -0
  119. package/dist/{harness-DpwsFsE7.mjs → harness-KxbWGL4I.mjs} +1 -1
  120. package/dist/{hook-responses-Dh1PWXqJ.d.mts → hook-responses-CQZIv3L3.d.mts} +2 -293
  121. package/dist/{index-HsTxm-R3.d.mts → index-3eUIRy7T.d.mts} +250 -20
  122. package/dist/{index-brqfk9JQ.d.mts → index-B4xdTT3c.d.mts} +6 -6
  123. package/dist/{index-CmFbzuiW.d.mts → index-B5op6AsV.d.mts} +72 -62
  124. package/dist/{index-CMgLxw14.d.mts → index-B6GOuxVy2.d.mts} +18 -18
  125. package/dist/index-BFhJe-Sb.d.mts +302 -0
  126. package/dist/{index-fmR2JNgJ.d.mts → index-BQprJNA_.d.mts} +4 -4
  127. package/dist/{index-EjsSBQXy2.d.mts → index-BSQ30wYP.d.mts} +1 -1
  128. package/dist/{index-Hk9mpC3o.d.mts → index-BSbGB23v.d.mts} +8 -8
  129. package/dist/{index-BbF2gRwd.d.mts → index-BiAYXjgM.d.mts} +41 -41
  130. package/dist/{index-sFsAqeK1.d.mts → index-ByZi9bml.d.mts} +7616 -4158
  131. package/dist/{index-CMJZ2Z8m.d.mts → index-C7HcDpHE.d.mts} +4 -0
  132. package/dist/{index-BskPjMet.d.mts → index-CB4aIUoF.d.mts} +16 -16
  133. package/dist/{index-B-xrJCwa.d.mts → index-CDusRXio.d.mts} +136 -137
  134. package/dist/{index-CUvNKYkV.d.mts → index-CSN_0sCo.d.mts} +19 -2
  135. package/dist/{index-BAXkicoQ.d.mts → index-C__EQfKa.d.mts} +1 -1
  136. package/dist/{index-BfLulUMy2.d.mts → index-CqQYgsbB.d.mts} +1659 -217
  137. package/dist/{index-DF9ffhVe.d.mts → index-CwDiyJkJ.d.mts} +327 -756
  138. package/dist/{index-GHASUiem.d.mts → index-DBadVauL.d.mts} +1 -1
  139. package/dist/{index-gUhidukN.d.mts → index-DI7-tIL3.d.mts} +299 -2
  140. package/dist/index-DP3o_13U.d.mts +165 -0
  141. package/dist/{index-DSBT83c0.d.mts → index-DcYAAJ0V.d.mts} +24 -3
  142. package/dist/{index-DqkjRTr7.d.mts → index-Dch_AxUg.d.mts} +77 -39
  143. package/dist/{index-XZyMxxnU.d.mts → index-DcqSUsX6.d.mts} +39 -83
  144. package/dist/{index-B0Kf_OWi.d.mts → index-DgOfgjx3.d.mts} +1 -1
  145. package/dist/{index-Ds5_rDEJ.d.mts → index-DwLRZscE.d.mts} +1 -12
  146. package/dist/{index-DkiTJM5p.d.mts → index-DxYDRoDE2.d.mts} +17 -3
  147. package/dist/{index-CRvpVIqA.d.mts → index-OsbtyMgx2.d.mts} +10 -1
  148. package/dist/{index-BaZeoZoS.d.mts → index-bIe_57cL.d.mts} +1 -1
  149. package/dist/{json-value-Brslhqbm.d.mts → json-value-C1RGgS0a.d.mts} +16 -1
  150. package/dist/{json-value-DmU8ibo_.mjs → json-value-D57aJhVn.mjs} +1 -1
  151. package/dist/kernel/cli/index.d.mts +2 -2
  152. package/dist/kernel/cli/index.mjs +1 -1
  153. package/dist/kernel/cli/register.d.mts +1 -1
  154. package/dist/kernel/cli/register.mjs +1 -1
  155. package/dist/kernel/cli/schemas.mjs +1 -1
  156. package/dist/kernel/extension/index.d.mts +1 -1
  157. package/dist/kernel/extension/index.mjs +1 -1
  158. package/dist/kernel/index.d.mts +9 -9
  159. package/dist/kernel/index.mjs +1 -1
  160. package/dist/kernel/namespace/index.d.mts +2 -2
  161. package/dist/kernel/namespace/index.mjs +1 -1
  162. package/dist/kernel/observability/index.d.mts +1 -1
  163. package/dist/kernel/observability/index.mjs +1 -1
  164. package/dist/kernel/providers/index.d.mts +1 -1
  165. package/dist/kernel/providers/index.mjs +1 -1
  166. package/dist/kernel/window/index.d.mts +1 -1
  167. package/dist/kernel/window/index.mjs +1 -1
  168. package/dist/{lib-C7-s68uf.mjs → lib-B_rJ6r0T.mjs} +1 -1
  169. package/dist/{lib-DErgth_E.mjs → lib-CnOAtohU.mjs} +1 -1
  170. package/dist/load-extensions-CW9uzNR5.mjs +1 -0
  171. package/dist/{load-extensions-BxsDB87B.d.mts → load-extensions-DUpaMQ7G.d.mts} +17 -13
  172. package/dist/{materialization-Jd198K3y.mjs → materialization-CcpCDhXh.mjs} +1 -1
  173. package/dist/mcp-http-server/index.mjs +1 -1
  174. package/dist/model-ZH3L1dPW.mjs +1 -0
  175. package/dist/{namespace-BqxtpNAn.mjs → namespace-B7bntOB8.mjs} +1 -1
  176. package/dist/{namespace-CWUDFGOy.mjs → namespace-BFqkUTJp.mjs} +1 -1
  177. package/dist/{namespace-D-WH2uYV2.d.mts → namespace-CAy4P5mW.d.mts} +8 -8
  178. package/dist/{namespace-B8uKAzWJ.mjs → namespace-CFjdyNXG.mjs} +1 -1
  179. package/dist/{namespace-DV-Hr9sZ.d.mts → namespace-ChnRTUG4.d.mts} +11 -1
  180. package/dist/namespace-CxrOLeeP.mjs +1 -0
  181. package/dist/{namespace-g_mbIZq_.d.mts → namespace-DSlfFhB1.d.mts} +410 -26
  182. package/dist/{namespace-Dkod-w11.d.mts → namespace-DwZwGXgF.d.mts} +4 -0
  183. package/dist/{namespace-BXvD9t0I.d.mts → namespace-Rge9mMI-.d.mts} +27 -19
  184. package/dist/{native-session-supervisor-DRx0MX-d.mjs → native-session-supervisor-fZYPUk0-.mjs} +1 -1
  185. package/dist/node/bus-server/index.d.mts +1 -1
  186. package/dist/node/bus-server/index.mjs +1 -1
  187. package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
  188. package/dist/node/bus-server/server-lifecycle.mjs +1 -1
  189. package/dist/{orchestrator-shared-BHCv-l2O.d.mts → orchestrator-shared-B-KRW1Z0.d.mts} +1 -0
  190. package/dist/orchestrator-shared-CTCZc6Vl.mjs +1 -0
  191. package/dist/ownership-memory-handler-Bblp93YC.mjs +1 -0
  192. package/dist/{package-DWMxGfzK.d.mts → package-Bf3hyuzs.d.mts} +234 -84
  193. package/dist/package-CBdvjyyZ.mjs +1 -0
  194. package/dist/package-CddkNbZI.mjs +1 -0
  195. package/dist/package-ypz4rKvn.mjs +7 -0
  196. package/dist/package.json +1 -1
  197. package/dist/{profile-BTAI31Nt.mjs → profile-BtznZlq3.mjs} +1 -1
  198. package/dist/{provider-context-Dq53Cgzz.mjs → provider-context-BrLZYnDW.mjs} +1 -1
  199. package/dist/{provider-context-PZIQWcqQ.mjs → provider-context-Dh-VOOYF.mjs} +1 -1
  200. package/dist/reaction-BS0k4eNN.mjs +1 -0
  201. package/dist/{registry-wfF2uTty.mjs → registry-BO_bOoky.mjs} +2 -2
  202. package/dist/{resolved-DZgqql2Z.mjs → resolved-DMByz1_2.mjs} +1 -1
  203. package/dist/rules/index.d.mts +1 -1
  204. package/dist/rules/index.mjs +1 -1
  205. package/dist/rules/schemas.d.mts +1 -1
  206. package/dist/runtime-bun/index.mjs +1 -1
  207. package/dist/runtime-node/extension-discovery.d.mts +1 -1
  208. package/dist/runtime-node/extension-validation.d.mts +1 -1
  209. package/dist/runtime-node/extension-validation.mjs +1 -1
  210. package/dist/runtime-node/index.d.mts +4 -4
  211. package/dist/runtime-node/index.mjs +24 -24
  212. package/dist/runtime-node/makaio-config.d.mts +1 -1
  213. package/dist/runtime-node/makaio-config.mjs +1 -1
  214. package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
  215. package/dist/runtime-node/workflow-worker/index.mjs +1 -1
  216. package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
  217. package/dist/{schema-Dd-e89MO.mjs → schema-DBG7Jq5_.mjs} +1 -1
  218. package/dist/{schema-DKUb4rkr.d.mts → schema-DKTzriEY.d.mts} +519 -9
  219. package/dist/{schemas-B5eUUi6u.d.mts → schemas-9qeeHGBf.d.mts} +8 -8
  220. package/dist/{schemas-CRB2O5zo.mjs → schemas-BqD8LlQw.mjs} +1 -1
  221. package/dist/{schemas-DaHQzpgm.mjs → schemas-CsjN7cmM.mjs} +1 -1
  222. package/dist/schemas-DSkBOdx_.mjs +1 -0
  223. package/dist/schemas-DplrlAyR.mjs +1 -0
  224. package/dist/{schemas-DuIlOWR3.d.mts → schemas-VbB1FTxx.d.mts} +4 -0
  225. package/dist/scoped-bus-ClwTWqX8.mjs +1 -0
  226. package/dist/{selection-BNwTKEVT.mjs → selection-7Ku8DBnh.mjs} +1 -1
  227. package/dist/services/adapter-runtime/index.d.mts +3 -3
  228. package/dist/services/adapter-runtime/index.mjs +1 -1
  229. package/dist/services/adapter-runtime/namespace.d.mts +1 -1
  230. package/dist/services/adapter-runtime/schemas.d.mts +1 -1
  231. package/dist/services/adapter-subsystem/index.d.mts +4 -4
  232. package/dist/services/adapter-subsystem/index.mjs +1 -1
  233. package/dist/services/adapter-subsystem/namespace.d.mts +2 -2
  234. package/dist/services/adapter-subsystem/namespace.mjs +1 -1
  235. package/dist/services/agent-runtime/index.d.mts +2 -2
  236. package/dist/services/agent-runtime/namespace.d.mts +1 -1
  237. package/dist/services/agent-runtime/schemas.d.mts +1 -1
  238. package/dist/services/automation-trigger/index.d.mts +943 -0
  239. package/dist/services/automation-trigger/index.mjs +1 -0
  240. package/dist/services/capability/index.d.mts +1 -1
  241. package/dist/services/capability/index.mjs +1 -1
  242. package/dist/services/codebase/index.d.mts +2 -2
  243. package/dist/services/codebase/namespace.d.mts +1 -1
  244. package/dist/services/codebase/schemas.d.mts +1 -1
  245. package/dist/services/compression/index.d.mts +2 -2
  246. package/dist/services/compression/namespace.d.mts +1 -1
  247. package/dist/services/compression/schemas.d.mts +1 -1
  248. package/dist/services/context-rules/index.d.mts +4 -4
  249. package/dist/services/context-rules/index.mjs +1 -1
  250. package/dist/services/execution-target/index.d.mts +3 -3
  251. package/dist/services/execution-target/index.mjs +1 -1
  252. package/dist/services/execution-target/namespace.d.mts +1 -1
  253. package/dist/services/execution-target/namespace.mjs +1 -1
  254. package/dist/services/execution-target/schemas.d.mts +1 -1
  255. package/dist/services/execution-target/schemas.mjs +1 -1
  256. package/dist/services/filesystem/index.d.mts +1 -1
  257. package/dist/services/filesystem/index.mjs +1 -1
  258. package/dist/services/filesystem/namespace.d.mts +6 -6
  259. package/dist/services/filesystem/schemas.d.mts +3 -3
  260. package/dist/services/git/namespace.d.mts +2 -2
  261. package/dist/services/git/namespace.mjs +1 -1
  262. package/dist/services/git/schemas.d.mts +1 -1
  263. package/dist/services/git/schemas.mjs +1 -1
  264. package/dist/services/harness/index.d.mts +3 -3
  265. package/dist/services/harness/index.mjs +1 -1
  266. package/dist/services/index.d.mts +449 -83
  267. package/dist/services/index.mjs +1 -1
  268. package/dist/services/log-import/browser.d.mts +2 -2
  269. package/dist/services/log-import/index.d.mts +3 -3
  270. package/dist/services/log-import/log-import.d.mts +1 -1
  271. package/dist/services/log-import/log-import.mjs +1 -1
  272. package/dist/services/log-import/namespace.mjs +1 -1
  273. package/dist/services/log-import/schemas.mjs +1 -1
  274. package/dist/services/materialization/index.d.mts +1 -1
  275. package/dist/services/materialization/index.mjs +1 -1
  276. package/dist/services/model-registry/index.d.mts +1 -1
  277. package/dist/services/model-registry/index.mjs +1 -1
  278. package/dist/services/preferences/index.d.mts +2 -2
  279. package/dist/services/preferences/schemas.d.mts +1 -1
  280. package/dist/services/preferences/storage-namespace.d.mts +2 -2
  281. package/dist/services/provider-context/index.d.mts +1 -1
  282. package/dist/services/provider-context/index.mjs +1 -1
  283. package/dist/services/provider-runtime/index.mjs +1 -1
  284. package/dist/services/session/handlers/index.d.mts +2 -2
  285. package/dist/services/session/handlers/index.mjs +1 -1
  286. package/dist/services/session/index.d.mts +10 -10
  287. package/dist/services/session/index.mjs +1 -1
  288. package/dist/services/session/messages/namespace.d.mts +1 -1
  289. package/dist/services/session/messages/namespace.mjs +1 -1
  290. package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
  291. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  292. package/dist/services/session/session-events/namespace.d.mts +1 -1
  293. package/dist/services/session/session-events/namespace.mjs +1 -1
  294. package/dist/services/session/storage/namespace.d.mts +1 -1
  295. package/dist/services/session/storage/schema.d.mts +2 -2
  296. package/dist/services/session/storage/schema.mjs +1 -1
  297. package/dist/services/session/testing/index.d.mts +12 -4
  298. package/dist/services/session/testing/index.mjs +36 -4
  299. package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
  300. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  301. package/dist/services/session/turns/namespace.d.mts +1 -1
  302. package/dist/services/session/turns/namespace.mjs +1 -1
  303. package/dist/services/session-editor/index.d.mts +1 -1
  304. package/dist/services/session-editor/index.mjs +1 -1
  305. package/dist/services/settings/index.d.mts +3 -3
  306. package/dist/services/settings/index.mjs +1 -1
  307. package/dist/services/settings/namespace.d.mts +8 -8
  308. package/dist/services/settings/namespace.mjs +1 -1
  309. package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
  310. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  311. package/dist/services/settings/storage/index.d.mts +3 -3
  312. package/dist/services/settings/storage/index.mjs +1 -1
  313. package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
  314. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  315. package/dist/services/subagent/index.d.mts +1 -1
  316. package/dist/services/subagent/index.mjs +1 -1
  317. package/dist/services/subagent-template/index.d.mts +2 -2
  318. package/dist/services/subagent-template/namespace.d.mts +1 -1
  319. package/dist/services/subagent-template/schemas.d.mts +1 -1
  320. package/dist/services/tool-approval/index.d.mts +1 -1
  321. package/dist/services/tool-approval/index.mjs +1 -1
  322. package/dist/services/tools/index.d.mts +1 -1
  323. package/dist/services/tools/index.mjs +1 -1
  324. package/dist/services/tray-menu/index.d.mts +3 -3
  325. package/dist/services/tray-menu/index.mjs +1 -1
  326. package/dist/services/tray-menu/namespace.d.mts +1 -1
  327. package/dist/services/tray-menu/schemas.d.mts +1 -1
  328. package/dist/services/turn/index.d.mts +1 -1
  329. package/dist/services/turn/namespace.d.mts +1 -1
  330. package/dist/services/workflow-transitions/index.d.mts +1 -1
  331. package/dist/services/workflow-transitions/index.mjs +1 -1
  332. package/dist/session-BMy2kRpX.mjs +90 -0
  333. package/dist/session-Cipx34j6.mjs +1 -0
  334. package/dist/{session-lineage-B_JW5LpF.d.mts → session-lineage-B_PVa1XN.d.mts} +1 -1
  335. package/dist/shared-BFVuCDPx.mjs +1 -0
  336. package/dist/{skill-BR6rkfLe.mjs → skill-C1D51nhh.mjs} +1 -1
  337. package/dist/{src-DD0v-nIj.mjs → src-xbmzokNe.mjs} +1 -1
  338. package/dist/storage/drizzle/client.d.mts +1 -1
  339. package/dist/storage/drizzle/client.mjs +1 -1
  340. package/dist/storage/drizzle/index.d.mts +42 -2
  341. package/dist/storage/drizzle/index.mjs +1 -1
  342. package/dist/storage/handlers/drizzle/index.d.mts +1 -1
  343. package/dist/storage/handlers/drizzle/index.mjs +1 -1
  344. package/dist/storage/handlers/index.d.mts +1 -1
  345. package/dist/storage/handlers/index.mjs +1 -1
  346. package/dist/tool-approval-service-BVgN9Q1r.mjs +1 -0
  347. package/dist/{tools-PdG9fO1M.mjs → tools-DxwHox1a.mjs} +1 -1
  348. package/dist/{transition-DwqL8W9V.d.mts → transition-BF1nevaC.d.mts} +7 -34
  349. package/dist/{types-DMLDHFR9.d.mts → types-BNjPhj_a.d.mts} +1 -1
  350. package/dist/{types-DR60yv6W.d.mts → types-CijlWGwb.d.mts} +1575 -157
  351. package/dist/types-ClpEaoAm.d.mts +2917 -0
  352. package/dist/ui-hooks/index.d.mts +29 -2
  353. package/dist/ui-hooks/index.mjs +1 -1
  354. package/dist/ui-kernel/index.d.mts +2 -2
  355. package/dist/ui-kernel/pages/schemas.d.mts +1 -1
  356. package/dist/ui-views/index.d.mts +1 -1
  357. package/dist/utils/index.d.mts +77 -1
  358. package/dist/utils/index.mjs +2 -2
  359. package/dist/{version-CoCeMxDT.mjs → version-BfNnVAGr.mjs} +1 -1
  360. package/dist/{view-builder-qp51cMWh.d.mts → view-builder-Bc9dx6jF.d.mts} +1 -1
  361. package/dist/{visibility-qhGWmpSJ.mjs → visibility-Dl1o2I01.mjs} +1 -1
  362. package/dist/{worker-node-Bl9_vqYi.mjs → worker-node-BDOYPEpi.mjs} +1 -1
  363. package/dist/{worker-node-DZTuT1DS.mjs → worker-node-DJ41Tr-F.mjs} +1 -1
  364. package/dist/workflow-Hzc5jlnV.mjs +1 -0
  365. package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
  366. package/dist/workflow-engine/index.d.mts +161 -442
  367. package/dist/workflow-engine/index.mjs +1 -1
  368. package/dist/workflow-engine/package.d.mts +1 -1
  369. package/dist/workflow-engine/package.mjs +1 -1
  370. package/dist/workflow-engine/provider-operation.d.mts +1 -1
  371. package/dist/workflow-engine/testing/index.d.mts +2 -2
  372. package/dist/workflow-engine/testing/index.mjs +1 -1
  373. package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
  374. package/dist/workflow-engine/testing/sqlite.mjs +27 -27
  375. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  376. package/dist/workflow-engine/workflow-trigger-binding-consumer.d.mts +46 -0
  377. package/dist/workflow-engine/workflow-trigger-binding-consumer.mjs +1 -0
  378. package/dist/{workflow-transitions-DSc45ixc.mjs → workflow-transitions-DM0fN_eP.mjs} +1 -1
  379. package/dist/workflow-worker-DARC7UZl.mjs +1 -0
  380. package/dist/zod-json-schema-BAGAFfCN.mjs +1 -0
  381. package/package.json +29 -1
  382. package/dist/adapter-D5c5LrPN.mjs +0 -1
  383. package/dist/artifact-DGiXqb11.mjs +0 -1
  384. package/dist/attach-error-C3tngg6J.mjs +0 -1
  385. package/dist/authority-state-bootstrap-GPL_tqaT.mjs +0 -1
  386. package/dist/await-trigger-I3lrepb8.mjs +0 -1
  387. package/dist/bus-B6SAjgOC.mjs +0 -2
  388. package/dist/bus-C2l3K74u.mjs +0 -1
  389. package/dist/extension-DCA4pYrY.mjs +0 -1
  390. package/dist/extension-hjOPs10e.mjs +0 -1
  391. package/dist/framework-packages-C3RWfJDk.mjs +0 -1
  392. package/dist/handlers-CfnLyLfE.mjs +0 -57
  393. package/dist/load-extensions-D0DfjYLC.mjs +0 -1
  394. package/dist/model-BGgVmRnN.mjs +0 -1
  395. package/dist/namespace-DJfUADSV.mjs +0 -1
  396. package/dist/orchestrator-shared-BxmHCPvx.mjs +0 -1
  397. package/dist/package-CNUPPcU1.mjs +0 -7
  398. package/dist/package-Dft_RItb.mjs +0 -1
  399. package/dist/schemas-Cm09dXL4.mjs +0 -1
  400. package/dist/scoped-bus-C9BdNwfM.mjs +0 -1
  401. package/dist/session-BOGCd18q.mjs +0 -1
  402. package/dist/session-BTFiDoGz.mjs +0 -76
  403. package/dist/shared-BQ0CHIVy.mjs +0 -1
  404. package/dist/tool-approval-service-kBA0fRzm.mjs +0 -1
  405. package/dist/types-CJ_QZ1yW.d.mts +0 -1487
  406. package/dist/workflow-BfDbgtIQ.mjs +0 -1
  407. package/dist/workflow-worker-BN9XPxQO.mjs +0 -1
  408. package/dist/{adapter-auth-runtime-DO-FVTXg.mjs → adapter-auth-runtime-D9Lnl7cc.mjs} +0 -0
  409. package/dist/{adapter-binding-DQchUtrK.d.mts → adapter-binding-B-FBoCys.d.mts} +0 -0
  410. package/dist/{attempt-record-codec-CqO1_XnE.mjs → attempt-record-codec-DaFLKR5C.mjs} +0 -0
  411. package/dist/{base-orchestrator-BilsQNW1.d.mts → base-orchestrator-D9u4NyiM.d.mts} +0 -0
  412. package/dist/{capability-service-BqiLlRGA.mjs → capability-service-CJHNkjvm.mjs} +0 -0
  413. package/dist/{client-B--e2qcU.d.mts → client-4ihewPUm.d.mts} +0 -0
  414. package/dist/{client-binary-version-verifier-taewmKTY.mjs → client-binary-version-verifier-DJajc_Ff.mjs} +0 -0
  415. package/dist/{client-binary-version-verifier-CgjM_vGF.d.mts → client-binary-version-verifier-jDDZ64Ah.d.mts} +0 -0
  416. package/dist/{clients-namespace-DfxjG2ZP.d.mts → clients-namespace-DFWuUawf.d.mts} +0 -0
  417. package/dist/{config-namespace-BCqvufbD.d.mts → config-namespace-D1kyZj0B.d.mts} +0 -0
  418. package/dist/{create-static-mount-bbQhTt6W.mjs → create-static-mount-9tnGpIeK.mjs} +0 -0
  419. package/dist/{cross-spawn-B57KZuns.mjs → cross-spawn-BIgueAqr.mjs} +0 -0
  420. package/dist/{cursor-storage-DIFK_9hg.mjs → cursor-storage-ROWfiTh1.mjs} +0 -0
  421. package/dist/{definition-gnKgXU91.d.mts → definition-DB-kKc0d.d.mts} +0 -0
  422. package/dist/{definitions-xrrY0wgz.mjs → definitions-CF6YmEhL.mjs} +0 -0
  423. package/dist/{descriptor-to-package-DvF08krT.mjs → descriptor-to-package-BecVCopf.mjs} +0 -0
  424. package/dist/{drizzle-z_0SiGY8.mjs → drizzle-CPv3vdTE.mjs} +0 -0
  425. package/dist/{esm-CltRnX8_.mjs → esm-CBFWM8u_.mjs} +0 -0
  426. package/dist/{event-CmVjR6Ib.mjs → event-DR8U9Efx.mjs} +0 -0
  427. package/dist/{facet-BCI00njh.mjs → facet-DVsW12iF.mjs} +0 -0
  428. package/dist/{filesystem-service-CQ9yVkSz.d.mts → filesystem-service-Cm2RHKBa.d.mts} +0 -0
  429. package/dist/{handler-Cbv9FqDO.mjs → handler-Bqlk-6BY.mjs} +0 -0
  430. package/dist/{host-Caq6ZfSJ.mjs → host-k5yoyKHg.mjs} +0 -0
  431. package/dist/{identity-D6guMtmi.mjs → identity-DC3Pk0ps.mjs} +0 -0
  432. package/dist/{index-dtsLKOID.d.mts → index-42UdYStR.d.mts} +0 -0
  433. package/dist/{index-DR40QWlw.d.mts → index-BJAB-BW_.d.mts} +0 -0
  434. package/dist/{index-Dm1nUxCF.d.mts → index-BJMezANn.d.mts} +0 -0
  435. package/dist/{index-Cv-o5Krs.d.mts → index-BRCrFirq.d.mts} +0 -0
  436. package/dist/{index-BVRQEpAg.d.mts → index-BRzHs7Bx.d.mts} +6 -6
  437. /package/dist/{index-vA--0lOM.d.mts → index-BVcQcphK.d.mts} +0 -0
  438. /package/dist/{index-ye0oklfU.d.mts → index-BcvqDfcN.d.mts} +0 -0
  439. /package/dist/{index-CGZQVTid.d.mts → index-BeENojSx2.d.mts} +0 -0
  440. /package/dist/{index-DjgLchuQ.d.mts → index-Beo_Ik8-.d.mts} +0 -0
  441. /package/dist/{index-sS6KUlrx.d.mts → index-BgGe9WZz.d.mts} +0 -0
  442. /package/dist/{index-CWHfOz6d.d.mts → index-CK3f0bAL.d.mts} +0 -0
  443. /package/dist/{index-DZunhZec.d.mts → index-CQuRTeRa.d.mts} +0 -0
  444. /package/dist/{index-jTaAHsul.d.mts → index-CRmE88hi.d.mts} +0 -0
  445. /package/dist/{index-CjdRdsd0.d.mts → index-CvW9_SzR.d.mts} +0 -0
  446. /package/dist/{index-ByKi34v5.d.mts → index-CxSSdIZz.d.mts} +0 -0
  447. /package/dist/{index-vcSj12YQ.d.mts → index-E4SET1AA.d.mts} +0 -0
  448. /package/dist/{index-DN4NOCqN2.d.mts → index-Ol9RBB0W2.d.mts} +0 -0
  449. /package/dist/{index-BIdsFcQs2.d.mts → index-aoxdnhJ42.d.mts} +0 -0
  450. /package/dist/{index-SsBHjUqA.d.mts → index-nydhGvXa.d.mts} +0 -0
  451. /package/dist/{jsonl-transport-bQl3JwIu.mjs → jsonl-transport-Bp_6pB2a.mjs} +0 -0
  452. /package/dist/{lib-DOBXZmYX.mjs → lib-Bwdd2m81.mjs} +0 -0
  453. /package/dist/{model-registry-CmgcPDH3.mjs → model-registry-Y854mUml.mjs} +0 -0
  454. /package/dist/{model-registry-xyBKSye-.mjs → model-registry-yURX738J.mjs} +0 -0
  455. /package/dist/{modes-BheyN7SS.mjs → modes-DmUsjHdV.mjs} +0 -0
  456. /package/dist/{namespace-HO2J9sO8.mjs → namespace-B9FEGuEu.mjs} +0 -0
  457. /package/dist/{namespace-jDhZjw-i.d.mts → namespace-Bi3CmYQy.d.mts} +0 -0
  458. /package/dist/{namespace-GPA7zots.d.mts → namespace-BusZERU8.d.mts} +0 -0
  459. /package/dist/{namespace-BOkKoq34.d.mts → namespace-ByP1Iipi.d.mts} +0 -0
  460. /package/dist/{namespace-YytVKIgI.d.mts → namespace-C1D77w7U.d.mts} +0 -0
  461. /package/dist/{namespace-CErHuXtb.d.mts → namespace-C6CVEGH8.d.mts} +0 -0
  462. /package/dist/{namespace-C-9si-fV.mjs → namespace-CfIW0hpQ.mjs} +0 -0
  463. /package/dist/{namespace-YxU1xf-K.mjs → namespace-CkBbNFSU.mjs} +0 -0
  464. /package/dist/{namespace-DWCEo-9M.d.mts → namespace-DX1Ec15L.d.mts} +0 -0
  465. /package/dist/{namespace-CWGKCNZm.mjs → namespace-DbNWsPFY.mjs} +0 -0
  466. /package/dist/{namespace-Cv1RFP7n.d.mts → namespace-Dgg0uoe6.d.mts} +0 -0
  467. /package/dist/{namespace-tGRAod3o.d.mts → namespace-s2y_NFKf.d.mts} +0 -0
  468. /package/dist/{namespace-Blp4c8GK.d.mts → namespace-yREpGJgG.d.mts} +0 -0
  469. /package/dist/{out-CvjtANXN.mjs → out-DrhwCgqM.mjs} +0 -0
  470. /package/dist/{packages-DtEEP0Vt.mjs → packages-FBv3fAOR.mjs} +0 -0
  471. /package/dist/{packages-BZ6pzFIq.d.mts → packages-N3-2Kl-Y.d.mts} +0 -0
  472. /package/dist/{platform-Bv8llU9c.mjs → platform-BrsMv_S3.mjs} +0 -0
  473. /package/dist/{provider-operation-Cxoe2SUr.d.mts → provider-operation-DJ_TLZFf.d.mts} +0 -0
  474. /package/dist/{providers-Co5UszRH.mjs → providers-CCcn4Ndp.mjs} +0 -0
  475. /package/dist/{providers-namespace-DjFkmvBR.d.mts → providers-namespace-DeJBh6MP.d.mts} +0 -0
  476. /package/dist/{quick-lru-CrOpWwrf.mjs → quick-lru-uwB0hP-y.mjs} +0 -0
  477. /package/dist/{schema-introspection-DgWQCpwx.mjs → schema-introspection-C1wvklj9.mjs} +0 -0
  478. /package/dist/{schema-Db-y-09L.mjs → schema-jIapW8Kb.mjs} +0 -0
  479. /package/dist/{schemas-CR8hSqTy.d.mts → schemas-B7zo7Zcx.d.mts} +0 -0
  480. /package/dist/{schemas-CqRm0i9a.mjs → schemas-BNdiVBWh.mjs} +0 -0
  481. /package/dist/{schemas-B1NWNASS.d.mts → schemas-C-Bm6Oac.d.mts} +0 -0
  482. /package/dist/{schemas-BO7uOum6.d.mts → schemas-CD0wOQxx.d.mts} +0 -0
  483. /package/dist/{schemas-N6x2z7Lf.d.mts → schemas-CeUI2i5j.d.mts} +0 -0
  484. /package/dist/{schemas-CwbYk_kZ.d.mts → schemas-Cg-Kwp8c.d.mts} +0 -0
  485. /package/dist/{schemas-BtZqovRH.d.mts → schemas-Cv3rR9Sz.d.mts} +0 -0
  486. /package/dist/{schemas-tDf_WiC8.mjs → schemas-CvHFbzdy.mjs} +0 -0
  487. /package/dist/{schemas-BsVYZviy.d.mts → schemas-DZH9lpxs.d.mts} +0 -0
  488. /package/dist/{schemas-BGExwp3j.mjs → schemas-DgwEVUt-.mjs} +0 -0
  489. /package/dist/{schemas-Bfxskx_2.mjs → schemas-mLpOfMoN.mjs} +0 -0
  490. /package/dist/{schemas-CQyRBqD6.d.mts → schemas-qA279_j_.d.mts} +0 -0
  491. /package/dist/{schemas-miYxK_Z1.d.mts → schemas-sMoRnBdZ.d.mts} +0 -0
  492. /package/dist/{semver-DlM8znk4.mjs → semver-DTXuyLcK.mjs} +0 -0
  493. /package/dist/{server-lifecycle-Dsq56aqC.d.mts → server-lifecycle-C_8iKgat.d.mts} +0 -0
  494. /package/dist/{server-lifecycle-kmQ5PUDv.mjs → server-lifecycle-DKx_fWlq.mjs} +0 -0
  495. /package/dist/{shared-schemas-DXwyMCwZ.mjs → shared-schemas-aahW97QW.mjs} +0 -0
  496. /package/dist/{src-CCu8TwL6.mjs → src-DHqsl5Pg.mjs} +0 -0
  497. /package/dist/{storage-namespace-BSrv0vXR.mjs → storage-namespace-Dz2jsssp.mjs} +0 -0
  498. /package/dist/{storage-namespace-dfywhXR3.d.mts → storage-namespace-Tf3P5yJ5.d.mts} +0 -0
  499. /package/dist/{storage-namespace-definition-BvlX0QV_.d.mts → storage-namespace-definition-BsnYAPot.d.mts} +0 -0
  500. /package/dist/{storage-namespace-definition-CkMKt7-I.mjs → storage-namespace-definition-CDef0E20.mjs} +0 -0
  501. /package/dist/{supports-color-DUugCQsK.mjs → supports-color-i7OTnKcZ.mjs} +0 -0
  502. /package/dist/{telemetry-Pr3oP2rk.mjs → telemetry-BvCBUjFg.mjs} +0 -0
  503. /package/dist/{timeout-DWDhddRJ.mjs → timeout-B0nYjLc8.mjs} +0 -0
  504. /package/dist/{tray-menu-service-BBLa-Rcv.mjs → tray-menu-service-Deo6yyP8.mjs} +0 -0
  505. /package/dist/{types-BrcjaNPZ.d.mts → types-CNS55jvt.d.mts} +0 -0
  506. /package/dist/{types-b54n1o57.d.mts → types-Ce6LL25v.d.mts} +0 -0
  507. /package/dist/{types-DHmPneIO.d.mts → types-xCdGghb2.d.mts} +0 -0
  508. /package/dist/{ui-config-CyCdlns_.mjs → ui-config-BIyGzMNL.mjs} +0 -0
  509. /package/dist/{variant-krjlTdJt.mjs → variant-B4uWdxW7.mjs} +0 -0
  510. /package/dist/{window-registry-BDnZLPVx.d.mts → window-registry-BLtVx3Iw.d.mts} +0 -0
  511. /package/dist/{window-registry-I-imZHV_.mjs → window-registry-CoBJq3u4.mjs} +0 -0
@@ -1,5 +1,5 @@
1
- import { $ as NormalizedMessageInput, C as NormalizedCallUsage, D as AdapterAuthLeaseHandle, E as StartAgentOptions, J as IAdapterConfigFactory, K as AdapterProviderDefinition, O as AdapterAuthRuntimePreparer, Q as markCompletedWithFinalResult, S as GetCapabilitiesResponsePayload, T as SendMessageResponsePayload, X as MessageDeliveryMode, Y as AIAgentConnector, Z as MessageHandle, _ as BaseAgentConnectorConfig, a as AgentCredentialChangeResponsePayload, at as AIModel, b as ContextWindowInput, c as AgentIdentity, ct as ISessionToolLedger, d as AgentMcpServersSetRequestPayload, dt as ToolLedgerEntry, et as normalizeMessageInput, f as AgentMcpServersSetResponsePayload, g as AgentStartResult, h as AgentSendMessageOptions, i as AgentCredentialChangeRequestPayload, it as SendMessageOptions, j as ResolvedAdapterRuntimeConfig, k as BoundAdapterRuntimeConfig, l as AgentInterruptRequestPayload, lt as LedgerSessionContext, m as AgentModelChangeResponsePayload, n as AgentConnectorConfigOverrides, nt as MessageState, o as AgentCwdChangeRequestPayload, ot as AIReasoningLevel, p as AgentModelChangeRequestPayload, q as ConfigFactoryInput, r as AgentContext, rt as ProcessingState, s as AgentCwdChangeResponsePayload, st as ReasoningLevelMap, t as AIAgentConfig, tt as MessageResult, u as AgentInterruptResponsePayload, ut as SessionToolLedger, v as ConnectorSendMessageOptions, w as SendMessageRequestPayload, x as ExecutionContext, y as ConnectorStartOptions } from "../types-CJ_QZ1yW.mjs";
2
- import { S as toImportSegment, _ as LogImporter, a as CompactionMetadata, b as ProcessLogFileResult, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImportTestConfig, h as LogImportSessionContext, l as ExternalToolMeta, m as ImportSegmentTurn, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as LogImporterConfig, x as StorageMessagePayload, y as NormalizedEvent } from "../base-orchestrator-BilsQNW1.mjs";
1
+ import { $t as SessionToolLedger, A as AgentTeardownArbiter, At as runBestEffortStage, Bt as MessageHandle, C as NormalizedCallUsage, Ct as ObservedExitOptions, D as AdapterProviderDefinition, Dt as reportBestEffortStages, E as StartAgentOptions, Et as exitWasObserved, F as TeardownSubject, Ft as unknownTeardown, Gt as MessageState, Ht as NormalizedMessageInput, I as CreateConnectorRuntimeOptions, It as CONNECTOR_EXIT_OBSERVATION_MS, Jt as AIModel, Kt as ProcessingState, Lt as SWAP_SETTLEMENT_WAIT_MS, M as ConnectorReplacementSettlement, Mt as TeardownReport, N as ConnectorSwapAdmission, Nt as aggregateTeardownReports, O as ConfigFactoryInput, Ot as reportObservedExit, P as ConnectorSwapHandover, Pt as rethrowTeardownFailure, Qt as LedgerSessionContext, R as AdapterAuthRuntimePreparer, Rt as AIAgentConnector, S as GetCapabilitiesResponsePayload, St as SupersededGeneration, T as SendMessageResponsePayload, Tt as describeTeardownFailure, Ut as normalizeMessageInput, Vt as markCompletedWithFinalResult, Wt as MessageResult, Xt as ReasoningLevelMap, Yt as AIReasoningLevel, Zt as ISessionToolLedger, _ as BaseAgentConnectorConfig, _t as BaseConnectorTurn, a as AgentCredentialChangeResponsePayload, at as WireSessionSubjects, b as ContextWindowInput, bt as ConnectorSessionConfig, c as AgentIdentity, ct as QueueableTurn, d as AgentMcpServersSetRequestPayload, dt as rejectQueuedHandles, en as ToolLedgerEntry, f as AgentMcpServersSetResponsePayload, ft as UserMessageQueue, g as AgentStartResult, gt as TurnSubjects, h as AgentSendMessageOptions, ht as ProceduralTurnState, i as AgentCredentialChangeRequestPayload, it as WireSessionConfig, j as ClosableConnectorRuntime, jt as stageFailure, k as IAdapterConfigFactory, kt as reportRepeatTeardown, l as AgentInterruptRequestPayload, lt as SESSION_CLOSED_QUEUE_ERROR, m as AgentModelChangeResponsePayload, mt as ProceduralTurnConfig, n as AgentConnectorConfigOverrides, nt as ProceduralAgentConnector, o as AgentCwdChangeRequestPayload, ot as MergeResult, p as AgentModelChangeRequestPayload, pt as ProceduralConnectorTurn, qt as SendMessageOptions, r as AgentContext, rt as ProceduralConnectorSession, s as AgentCwdChangeResponsePayload, st as ProcessQueueCallbacks, t as AIAgentConfig, u as AgentInterruptResponsePayload, ut as processQueueMessages, v as ConnectorSendMessageOptions, vt as PauseResult, w as SendMessageRequestPayload, wt as capTeardownEvidence, x as ExecutionContext, xt as GenerationRetirementLedger, y as ConnectorStartOptions, yt as BaseConnectorSession, zt as MessageDeliveryMode } from "../types-ClpEaoAm.mjs";
2
+ import { S as toImportSegment, _ as LogImporter, a as CompactionMetadata, b as ProcessLogFileResult, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImportTestConfig, h as LogImportSessionContext, l as ExternalToolMeta, m as ImportSegmentTurn, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as LogImporterConfig, x as StorageMessagePayload, y as NormalizedEvent } from "../base-orchestrator-D9u4NyiM.mjs";
3
3
  import { z } from "zod";
4
4
  import * as _$_makaio_core0 from "@makaio/framework/core";
5
5
  import { CreateBusNamespaceOptions, ExtractSubjectPayload, FilterablePayloadIntersection, HandlerForSubjectDefinition, RegistrableBusNamespaceDefinition, RequestContext, SchemaRecord, ScopedSubjectDefinition, SubjectDefinition, SubjectRecordFromSchemaRecord } from "@makaio/framework/core";
@@ -144,6 +144,30 @@ interface AIAdapterInitOptions {
144
144
  */
145
145
  declare function safeJsonStringify(value: unknown): string;
146
146
  //#endregion
147
+ //#region adapters/core/src/utils/withTimeout.d.ts
148
+ /**
149
+ * Bounding helper for awaits that would otherwise have no end.
150
+ * @packageDocumentation
151
+ */
152
+ /**
153
+ * Race a promise against a timeout, clearing the timer when either settles.
154
+ *
155
+ * Exists so an adapter that declares a budget can actually honour it: an
156
+ * unbounded await on a provider handshake is indistinguishable from a hang, and
157
+ * a caller waiting behind it inherits that hang. The timer is always cleared, so
158
+ * bounding a promise never keeps the event loop alive past its settlement.
159
+ *
160
+ * The bound applies to the *wait*, not to the work. A rejected race leaves the
161
+ * underlying operation running; callers that own a resource behind the promise
162
+ * are responsible for releasing it.
163
+ * @param promise - Promise to bound.
164
+ * @param ms - Milliseconds to wait before rejecting.
165
+ * @param message - Error message used when the bound expires.
166
+ * @returns The promise's resolved value.
167
+ * @throws Error with `message` when the bound expires first.
168
+ */
169
+ declare function withTimeout<T>(promise: Promise<T>, ms: number, message: string): Promise<T>;
170
+ //#endregion
147
171
  //#region adapters/core/src/utils/serializeTurnContext.d.ts
148
172
  /**
149
173
  * A single serialized context entry ready for adapter-specific formatting.
@@ -719,657 +743,6 @@ declare function formatMessageHistoryAsTranscript(history: Message[]): string;
719
743
  */
720
744
  declare function serializeBlockToText(block: MessageBlock$1): string;
721
745
  //#endregion
722
- //#region adapters/core/src/connector/base-connector-session.d.ts
723
- /**
724
- * Configuration for a connector session.
725
- * @typeParam TBus - Scoped bus type for adapter namespace
726
- */
727
- interface ConnectorSessionConfig<TBus extends ScopedBus<string> = ScopedBus<string>> {
728
- bus: TBus;
729
- adapterId: string;
730
- adapterName: string;
731
- cwd: string;
732
- model: string;
733
- env: Record<string, string>;
734
- /** Auth-free environment safe for bus-routable tool and MCP contexts. */
735
- contextEnv?: Readonly<Record<string, string>>;
736
- }
737
- /**
738
- * Interface for turn-like objects that support pause/abort operations.
739
- * Allows base session class to work with different turn implementations.
740
- */
741
- interface PausableTurn {
742
- pause(): Promise<unknown>;
743
- }
744
- /**
745
- * Base abstract class for connector session implementations.
746
- *
747
- * Sessions manage SDK query lifecycle across multiple turns:
748
- * - SDK connection management
749
- * - Turn creation and coordination
750
- * - Session ID management
751
- *
752
- * Each adapter implements its own session subclass.
753
- * @typeParam TConfig - Configuration type extending ConnectorSessionConfig
754
- */
755
- declare abstract class BaseConnectorSession<TConfig extends ConnectorSessionConfig = ConnectorSessionConfig> {
756
- protected readonly config: TConfig;
757
- protected readonly bus: TConfig['bus'];
758
- protected sessionId?: string;
759
- protected currentTurn?: PausableTurn;
760
- /**
761
- * True once `close()` or `abort()` has begun; gates queue processing.
762
- *
763
- * ## Shutdown vs queue processing invariant
764
- *
765
- * Once `close()` or `abort()` begins, no new turn may start.
766
- * `processQueue` implementations must refuse to dequeue or start turns
767
- * when `this.closing` is `true`, and drain all remaining queued handles
768
- * with an error outcome so that callers awaiting `waitForCompletion()`
769
- * resolve deterministically instead of hanging.
770
- *
771
- * A dequeued handle that has entered the start-turn path either starts
772
- * its turn before `close()` begins, or is completed with the closing
773
- * error at every await point where `close()` can interleave. This is
774
- * enforced by {@link completeHandleIfClosing}, which rechecks the flag
775
- * after each awaited setup step and completes the handle with the same
776
- * error contract used by {@link rejectQueuedHandles}.
777
- */
778
- protected closing: boolean;
779
- constructor(config: TConfig);
780
- /**
781
- * Recheck the shutdown flag after an awaited setup step in the start path.
782
- *
783
- * When `close()` sets `this.closing` while the subclass start-turn method
784
- * is awaiting an async setup step (schema rotation, query creation, MCP
785
- * registration, env resolution), the dequeued handle is no longer in the
786
- * queue and {@link rejectQueuedHandles} cannot reach it. This helper
787
- * completes the handle with the same error contract so callers see a
788
- * consistent shutdown outcome.
789
- * @param handle - Dequeued message handle currently being set up
790
- * @returns `true` when the session is closing and the handle was completed
791
- */
792
- protected completeHandleIfClosing(handle: MessageHandle): boolean;
793
- /**
794
- * Abort the session and cleanup resources.
795
- * Pauses the current turn if one is active.
796
- */
797
- abort(): Promise<void>;
798
- /**
799
- * Send a message to the provider.
800
- * Not used - subclasses should implement processQueue instead.
801
- * @param _message - Unused message parameter
802
- * @param _options - Unused options parameter
803
- */
804
- sendMessage(_message: unknown, _options?: unknown): Promise<void>;
805
- /**
806
- * Get the adapter session ID.
807
- * @returns The session ID from the provider
808
- */
809
- getAdapterSessionId(): Promise<string>;
810
- }
811
- //#endregion
812
- //#region adapters/core/src/connector/base-connector-turn.d.ts
813
- /**
814
- * Result of pausing a turn.
815
- * @typeParam TState - Turn state type
816
- */
817
- interface PauseResult<TState = string> {
818
- /** The state the turn was in before pausing */
819
- stateBeforePause: TState;
820
- /** Whether the turn had already ended when pause was requested */
821
- turnEnded: boolean;
822
- }
823
- /**
824
- * Base abstract class for connector turn implementations.
825
- *
826
- * Turns manage the state machine for a single user message:
827
- * - State transitions (idle to turn_started to step_started to ...)
828
- * - Pause/resume mechanics
829
- * - Safe boundary detection for immediate messages
830
- * - Message handle delegation (acknowledgment, completion)
831
- *
832
- * Each adapter implements its own turn subclass with adapter-specific
833
- * state handling and SDK integration.
834
- * @typeParam TState - Turn state enum type (string union)
835
- */
836
- declare abstract class BaseConnectorTurn<TState extends string = string> {
837
- protected state: TState;
838
- protected readonly bus: ScopedBus<string>;
839
- protected readonly adapterId: string;
840
- protected readonly adapterName: string;
841
- protected stateChangedCallback?: (oldState: TState, newState: TState) => Promise<void> | void;
842
- /**
843
- * Active message handle for this turn.
844
- * Subclasses must provide this handle for message lifecycle management.
845
- */
846
- protected abstract activeMessageHandle: MessageHandle;
847
- constructor(bus: ScopedBus<string>, adapterId: string, adapterName: string, initialState: TState);
848
- /**
849
- * Pause the turn at next safe boundary.
850
- * @returns Pause result indicating whether turn already ended
851
- */
852
- abstract pause(): Promise<PauseResult<TState>>;
853
- /**
854
- * Resume the paused turn with optional additional message.
855
- * @param message - Optional message to inject when resuming
856
- */
857
- abstract resume(message?: unknown): Promise<void>;
858
- /**
859
- * Check if turn is currently paused.
860
- */
861
- abstract isPaused(): boolean;
862
- /**
863
- * Register callback for state changes.
864
- * @param cb - Callback to invoke on state transitions
865
- */
866
- onStateChanged(cb: (oldState: TState, newState: TState) => Promise<void> | void): void;
867
- /**
868
- * Transition to new state and notify listeners.
869
- * Template method for shared state transition pattern.
870
- *
871
- * NOTE: Subclasses should use their typed namespace subjects for emission.
872
- * This is a template - concrete implementation in adapter-specific Turn classes.
873
- * @param newState - New state to transition to
874
- */
875
- protected transitionTo(newState: TState): Promise<void>;
876
- /**
877
- * Emit state change event - implemented by subclass with typed subjects.
878
- * @param oldState - Previous state
879
- * @param newState - New state
880
- */
881
- protected abstract emitStateChange(oldState: TState, newState: TState): Promise<void>;
882
- /**
883
- * Get current turn state.
884
- * @returns Current turn state
885
- */
886
- getState(): TState;
887
- /**
888
- * Get the message handle for this turn.
889
- * @returns The message handle for this turn
890
- */
891
- getMessageHandle(): MessageHandle;
892
- /**
893
- * Mark message handle as acknowledged.
894
- */
895
- markAcknowledged(): void;
896
- /**
897
- * Mark message handle as completed.
898
- * @param result - The completion result with outcome and optional result/error
899
- */
900
- markCompleted(result: {
901
- outcome: string;
902
- result?: unknown;
903
- error?: unknown;
904
- }): void;
905
- }
906
- //#endregion
907
- //#region adapters/core/src/connector/procedural-connector-turn.d.ts
908
- /**
909
- * Typed subject references for turn lifecycle events.
910
- *
911
- * Each adapter provides its namespace-specific subjects when constructing
912
- * a ProceduralConnectorTurn. The subjects must all accept the same
913
- * TurnStateChangedPayload shape.
914
- * @typeParam TSubject - The subject definition type for the adapter's bus
915
- */
916
- interface TurnSubjects<TSubject = ScopedSubjectDefinition> {
917
- state_changed: TSubject;
918
- turn_started: TSubject;
919
- step_started: TSubject;
920
- step_finished: TSubject;
921
- turn_finished: TSubject;
922
- }
923
- /**
924
- * Standard turn state type for procedural adapters.
925
- *
926
- * Procedural adapters (Gemini, OpenAI, Copilot) use abort+restart
927
- * rather than true pause/resume. Their state machine is:
928
- * idle to turn_started to step_started to step_finished to turn_finished
929
- */
930
- type ProceduralTurnState = 'idle' | 'turn_started' | 'step_started' | 'step_finished' | 'turn_finished';
931
- /**
932
- * Configuration for ProceduralConnectorTurn.
933
- * @typeParam TBus - Scoped bus type for the adapter
934
- * @typeParam TSubject - Subject definition type
935
- */
936
- interface ProceduralTurnConfig<TBus extends ScopedBus<string>, TSubject> {
937
- bus: TBus;
938
- adapterId: string;
939
- adapterName: string;
940
- agentId: string;
941
- messageHandle: MessageHandle;
942
- turnSubjects: TurnSubjects<TSubject>;
943
- }
944
- /**
945
- * Base turn implementation for procedural adapters (Gemini, OpenAI, Copilot).
946
- *
947
- * These adapters share an abort+restart pattern rather than true pause/resume.
948
- * This class extracts the common state machine, lifecycle methods, and
949
- * message handle delegation that was duplicated across all three.
950
- *
951
- * Subclasses only need to add adapter-specific behavior:
952
- * - Gemini: AbortController for SDK cancellation
953
- * - OpenAI: AbortController for SDK cancellation
954
- * - Copilot: SDK event handling (handleSdkEvent)
955
- * @typeParam TState - Turn state type (defaults to ProceduralTurnState)
956
- * @typeParam TBus - Scoped bus type for the adapter
957
- * @typeParam TSubject - Subject definition type for emit calls
958
- */
959
- declare class ProceduralConnectorTurn<TState extends string = ProceduralTurnState, TBus extends ScopedBus<string> = ScopedBus<string>, TSubject extends ScopedSubjectDefinition = ScopedSubjectDefinition> extends BaseConnectorTurn<TState> {
960
- protected activeMessageHandle: MessageHandle;
961
- protected readonly connectorBus: TBus;
962
- protected readonly agentId: string;
963
- protected readonly turnSubjects: TurnSubjects<TSubject>;
964
- protected aborted: boolean;
965
- constructor(config: ProceduralTurnConfig<TBus, TSubject>, initialState: TState);
966
- /**
967
- * Emit state change using adapter-provided turn subjects.
968
- * @param oldState - Previous state before transition
969
- * @param newState - New state after transition
970
- */
971
- protected emitStateChange(oldState: TState, newState: TState): Promise<void>;
972
- /**
973
- * Start the turn.
974
- */
975
- start(): Promise<void>;
976
- /**
977
- * Transition to step_started (called when first content arrives).
978
- * Allows turn_started to step_started AND step_finished to step_started
979
- * (for tool recursion).
980
- */
981
- markStepStarted(): Promise<void>;
982
- /**
983
- * Transition to step_finished (called after content block completes).
984
- */
985
- markStepFinished(): Promise<void>;
986
- /**
987
- * Mark turn as finished.
988
- */
989
- markTurnFinished(): Promise<void>;
990
- /**
991
- * Pause (abort) at next opportunity.
992
- * Procedural adapters don't support true pause - caller creates a new turn
993
- * with merged content instead.
994
- * @returns Pause result indicating turn state
995
- */
996
- pause(): Promise<PauseResult<TState>>;
997
- /**
998
- * Resume is not supported for procedural adapters - caller creates new turn.
999
- * @param _message - Unused
1000
- * @throws Error always
1001
- */
1002
- resume(_message?: unknown): Promise<void>;
1003
- /**
1004
- * Check if turn was aborted.
1005
- * @returns True if turn was aborted
1006
- */
1007
- isPaused(): boolean;
1008
- /**
1009
- * Check if turn is completed.
1010
- * @returns True if turn has finished
1011
- */
1012
- isCompleted(): boolean;
1013
- /**
1014
- * Check if turn can accept immediate message.
1015
- * True if turn is active (not finished, not aborted).
1016
- * @returns True if turn can accept an immediate message
1017
- */
1018
- canAcceptImmediate(): boolean;
1019
- }
1020
- //#endregion
1021
- //#region adapters/core/src/session/user-message-queue.d.ts
1022
- /**
1023
- * Simple FIFO queue for user messages with delivery mode support.
1024
- *
1025
- * This queue is owned by adapter Connectors and passed to Sessions for processing.
1026
- *
1027
- * Delivery modes:
1028
- * - 'enqueue': Add to end of queue (default); internal retries are prioritized
1029
- * ahead of already queued user turns.
1030
- * - 'replace': Supersede all unacknowledged messages, add to queue
1031
- * - 'immediate': Handled by Session (abort/restart), not queue
1032
- *
1033
- * Design:
1034
- * - Connector enqueues messages as they arrive
1035
- * - Session dequeues messages when ready to process
1036
- * - Peek allows Session to inspect next message without removing
1037
- */
1038
- declare class UserMessageQueue {
1039
- private readonly queue;
1040
- /**
1041
- * Add message to queue based on delivery mode.
1042
- * @param handle - Message handle to enqueue
1043
- */
1044
- enqueue(handle: MessageHandle): void;
1045
- /**
1046
- * Enqueue an internal retry before ordinary queued user turns while preserving
1047
- * immediate-mode ordering and FIFO ordering among retries.
1048
- * @param handle - Internal retry handle to enqueue
1049
- */
1050
- private enqueueInternalRetry;
1051
- /**
1052
- * Remove all superseded messages from queue.
1053
- */
1054
- private removeSuperseded;
1055
- /**
1056
- * Remove and return first message from queue.
1057
- * @returns First message or undefined if queue empty
1058
- */
1059
- dequeue(): MessageHandle | undefined;
1060
- /**
1061
- * Look at first message without removing.
1062
- * @returns First message or undefined if queue empty
1063
- */
1064
- peek(): MessageHandle | undefined;
1065
- /**
1066
- * Check if queue is empty.
1067
- * @returns True if queue has no messages
1068
- */
1069
- isEmpty(): boolean;
1070
- /**
1071
- * Get current queue size.
1072
- * @returns Number of messages in queue
1073
- */
1074
- size(): number;
1075
- /**
1076
- * Clear all messages from queue.
1077
- */
1078
- clear(): void;
1079
- /**
1080
- * Find the first immediate message in the queue.
1081
- * @returns First immediate message or undefined
1082
- */
1083
- findImmediate(): MessageHandle | undefined;
1084
- /**
1085
- * Remove a specific immediate message from the queue.
1086
- * @param handle - Handle to remove
1087
- */
1088
- removeImmediate(handle: MessageHandle): void;
1089
- /**
1090
- * Remove and return all enqueued (non-immediate) messages.
1091
- * Used when immediate arrives to merge their content.
1092
- * @returns Array of enqueued message handles in FIFO order
1093
- */
1094
- drainEnqueued(): MessageHandle[];
1095
- }
1096
- //#endregion
1097
- //#region adapters/core/src/session/process-queue.d.ts
1098
- /**
1099
- * Canonical error message used when a queued message cannot be processed
1100
- * because the session has entered the shutdown path.
1101
- *
1102
- * Shared between {@link rejectQueuedHandles} (queue drain) and the per-handle
1103
- * shutdown gate ({@link BaseConnectorSession.completeHandleIfClosing}) so that
1104
- * callers see a consistent error contract regardless of whether the handle was
1105
- * still in the queue or had already been dequeued when `close()` interleaved.
1106
- */
1107
- declare const SESSION_CLOSED_QUEUE_ERROR = "Session closed before queued message could be processed";
1108
- /**
1109
- * Minimal turn interface required by processQueue orchestration.
1110
- *
1111
- * Any turn implementation (Claude, Gemini, OpenAI, Copilot) that exposes
1112
- * these methods can participate in the shared processQueue flow.
1113
- */
1114
- interface QueueableTurn {
1115
- canAcceptImmediate(): boolean;
1116
- isCompleted(): boolean;
1117
- getMessageHandle(): MessageHandle;
1118
- pause(): Promise<PauseResult>;
1119
- }
1120
- /**
1121
- * Result of processing an immediate message merge.
1122
- *
1123
- * Returned by the `extractMergeContent` callback so that adapters
1124
- * can collect adapter-specific content (e.g., Gemini collects non-text parts).
1125
- * The `mergedContent` array is always present; `extra` is an opaque bag
1126
- * for adapter-specific data that flows through to `startNewTurn`.
1127
- */
1128
- interface MergeResult {
1129
- /** Text content collected from superseded/merged messages */
1130
- mergedContent: string[];
1131
- /** Adapter-specific merge data (e.g., non-text parts for Gemini) */
1132
- extra?: unknown;
1133
- }
1134
- /**
1135
- * Callbacks for adapter-specific behavior during queue processing.
1136
- * @typeParam TExtra - Type of adapter-specific extra merge data
1137
- */
1138
- interface ProcessQueueCallbacks<TExtra = unknown> {
1139
- /**
1140
- * Get the current turn, if any.
1141
- * @returns The current turn or undefined
1142
- */
1143
- getCurrentTurn: () => QueueableTurn | undefined;
1144
- /**
1145
- * Extract text content from a message handle for merge.
1146
- * Default: `handle.message.message as string`
1147
- * @param handle - The message handle to extract content from
1148
- * @returns The text content
1149
- */
1150
- extractContent?: (handle: MessageHandle) => string;
1151
- /**
1152
- * Called after merge content is collected from superseded/enqueued messages.
1153
- * Allows adapters to collect additional content (e.g., Gemini's non-text parts).
1154
- *
1155
- * If not provided, only text content is collected using `extractContent`.
1156
- * @param currentHandle - The in-flight message handle being superseded (or undefined)
1157
- * @param enqueuedHandles - The enqueued handles being merged
1158
- * @returns Extra merge data to pass through to startNewTurn
1159
- */
1160
- collectMergeExtra?: (currentHandle: MessageHandle | undefined, enqueuedHandles: MessageHandle[]) => TExtra;
1161
- /**
1162
- * Hook called after merge is collected but before starting the new turn.
1163
- * Used by Claude to create a fresh query instance.
1164
- */
1165
- onBeforeImmediateTurn?: () => Promise<void>;
1166
- /**
1167
- * Start a new turn with the given message and optional merge data.
1168
- *
1169
- * Returns `void` (or `undefined`) when the turn was started normally.
1170
- * Returns `false` explicitly when the turn was **not** started (e.g.,
1171
- * shutdown interleaved during setup and the handle was completed with
1172
- * an error). `processQueueMessages` propagates this so callers see an
1173
- * accurate "no turn started" result and can transition to idle.
1174
- * @param handle - The message handle to process
1175
- * @param mergedContent - Text content from superseded/merged messages
1176
- * @param extra - Adapter-specific extra merge data
1177
- * @returns `false` when the turn was skipped; `void` otherwise
1178
- */
1179
- startNewTurn: (handle: MessageHandle, mergedContent?: string[], extra?: TExtra) => Promise<void | false>;
1180
- }
1181
- /**
1182
- * Shared processQueue orchestration for all session implementations.
1183
- *
1184
- * Handles the complete immediate-mode flow:
1185
- * 1. Detect immediate message while a turn is active
1186
- * 2. Pause the active turn
1187
- * 3. Supersede the in-flight message and drain enqueued messages
1188
- * 4. Collect merged content from all superseded/merged messages
1189
- * 5. Start a new turn with the immediate message and merged context
1190
- *
1191
- * Also handles the normal queue flow:
1192
- * - Late immediate rejection (immediate arrives after turn finishes)
1193
- * - Normal enqueue/replace message processing
1194
- *
1195
- * Returns `true` when a new turn was started, `false` otherwise.
1196
- * Callers can use this to decide whether to transition to idle when
1197
- * the queue drains without starting a new turn (e.g., all-rejection case).
1198
- * @param queue - The user message queue to process
1199
- * @param callbacks - Adapter-specific callbacks
1200
- * @returns True if a new turn was started, false otherwise
1201
- * @typeParam TExtra - Type of adapter-specific extra merge data
1202
- */
1203
- declare function processQueueMessages<TExtra = unknown>(queue: UserMessageQueue, callbacks: ProcessQueueCallbacks<TExtra>): Promise<boolean>;
1204
- /**
1205
- * Drain all remaining handles from the queue and complete each with an error
1206
- * outcome so callers awaiting `waitForCompletion()` resolve deterministically.
1207
- *
1208
- * Used by session implementations during shutdown to prevent queued messages
1209
- * from hanging indefinitely when the session refuses to start new turns.
1210
- * @param queue - User message queue to drain
1211
- * @param message - Error message to attach to each rejected handle
1212
- */
1213
- declare function rejectQueuedHandles(queue: UserMessageQueue, message?: string): void;
1214
- //#endregion
1215
- //#region adapters/core/src/connector/procedural-agent-connector.d.ts
1216
- /**
1217
- * Minimal session interface required by ProceduralAgentConnector.
1218
- *
1219
- * Any session implementation (OpenAI, Copilot, Gemini) that exposes
1220
- * these methods can be used with ProceduralAgentConnector's default
1221
- * wireSessionEvents / processUserMessages / acceptsImmediate.
1222
- */
1223
- interface ProceduralConnectorSession {
1224
- /** Process messages from the queue. */
1225
- processQueue(queue: UserMessageQueue): Promise<void>;
1226
- /** Get the current turn for state inspection. */
1227
- getCurrentTurn(): QueueableTurn | undefined;
1228
- }
1229
- /**
1230
- * Turn subject references for wireSessionEvents.
1231
- *
1232
- * Each adapter provides its namespace-specific subjects. The subjects
1233
- * must accept TurnStateChangedPayload (or compatible shape).
1234
- * @typeParam TNamespace - The bus namespace string for subject typing
1235
- */
1236
- interface WireSessionSubjects<TNamespace extends string = string> {
1237
- turn_started: ScopedSubjectDefinition<TNamespace>;
1238
- step_started: ScopedSubjectDefinition<TNamespace>;
1239
- step_finished: ScopedSubjectDefinition<TNamespace>;
1240
- turn_finished: ScopedSubjectDefinition<TNamespace>;
1241
- }
1242
- /**
1243
- * Configuration for ProceduralAgentConnector's wireSessionEvents behavior.
1244
- *
1245
- * The `onTurnStarted` and `onTurnFinished` hooks allow adapters to inject
1246
- * logic at turn boundaries. By default both are no-ops.
1247
- */
1248
- interface WireSessionConfig {
1249
- /**
1250
- * Called when a new turn starts (turn_started bus event).
1251
- *
1252
- * Executes before the default `updateProcessingState('turn_started')` so
1253
- * the connector state machine is always updated regardless of this hook.
1254
- *
1255
- * Supports async so that turn-start operations with I/O — such as a pending
1256
- * MCP tool refresh via the bus — can complete before the API call is made.
1257
- * In-memory operations (recordInjection, consumeTurnNumber) are not affected
1258
- * by the async signature.
1259
- */
1260
- onTurnStarted?: () => Promise<void> | void;
1261
- /**
1262
- * Custom handler for turn_finished events.
1263
- *
1264
- * When provided, replaces the default turn_finished behavior entirely.
1265
- * The handler receives a callback to process the queue, which it should
1266
- * call when the message is considered complete and the queue should drain.
1267
- * @param drainQueue - Callback that processes the queue or goes idle
1268
- */
1269
- onTurnFinished?: (drainQueue: () => Promise<void>) => Promise<void>;
1270
- }
1271
- /**
1272
- * Abstract base class for procedural (non-event-driven) agent connectors.
1273
- *
1274
- * Procedural adapters (OpenAI, Copilot, Gemini) share common patterns:
1275
- * - wireSessionEvents: subscribe to turn lifecycle events and update processing state
1276
- * - processUserMessages: initialize session, enqueue, transition to active, process queue
1277
- * - complete: poll processing state until idle/paused
1278
- * - start: delegate to sendMessage and return AgentStartResult
1279
- * - acceptsImmediate: delegate to session's current turn
1280
- *
1281
- * Subclasses must implement:
1282
- * - `getSession()` / `ensureSession()` for session access and lazy initialization
1283
- * - `getSessionQueue()` for the adapter's UserMessageQueue instance
1284
- * - `getTurnSubjects()` for namespace-specific turn subjects
1285
- * - `sendMessage()`, `abort()`, `close()`, `interrupt()`, `getAdapterSessionId()`
1286
- *
1287
- * Subclasses may override:
1288
- * - `getWireSessionConfig()` for custom turn_finished behavior (e.g., Copilot multi-turn)
1289
- * @typeParam TBus - Scoped bus type for adapter namespace
1290
- * @typeParam TConfig - Configuration type extending BaseAgentConnectorConfig
1291
- */
1292
- declare abstract class ProceduralAgentConnector<TBus extends ScopedBus<string> = ScopedBus<string>, TConfig extends BaseAgentConnectorConfig<TBus> = BaseAgentConnectorConfig<TBus>> extends AIAgentConnector<TBus, TConfig> {
1293
- /** Whether turn event wiring has been setup. */
1294
- private turnEventsWired;
1295
- /**
1296
- * Get the adapter's session instance (may be undefined if not yet initialized).
1297
- * @returns The session or undefined
1298
- */
1299
- protected abstract getSession(): ProceduralConnectorSession | undefined;
1300
- /**
1301
- * Initialize and return the adapter's session.
1302
- * Must be idempotent (no-op if already initialized).
1303
- * @returns The initialized session
1304
- */
1305
- protected abstract ensureSession(): Promise<ProceduralConnectorSession>;
1306
- /**
1307
- * Get the adapter's UserMessageQueue instance.
1308
- * @returns The message queue
1309
- */
1310
- protected abstract getSessionQueue(): UserMessageQueue;
1311
- /**
1312
- * Get the adapter's namespace-specific turn subjects for wireSessionEvents.
1313
- * @returns Turn subject definitions
1314
- */
1315
- protected abstract getTurnSubjects(): WireSessionSubjects<TBus['namespace']>;
1316
- /**
1317
- * Get optional wire session configuration for custom turn_finished behavior.
1318
- * Override in subclasses that need non-standard turn_finished handling
1319
- * (e.g., Copilot multi-turn message completion).
1320
- * @returns Wire session configuration, or undefined for default behavior
1321
- */
1322
- protected getWireSessionConfig(): WireSessionConfig | undefined;
1323
- /**
1324
- * Wire Session turn events to Connector state updates.
1325
- *
1326
- * Session emits typed events, Connector subscribes and updates processing state.
1327
- * This maintains separation of concerns - Session does not know about Connector state.
1328
- *
1329
- * Default turn_finished behavior: transition through processing_finished to idle,
1330
- * or drain the queue if messages are pending. Override via `getWireSessionConfig()`.
1331
- */
1332
- protected wireSessionEvents(): void;
1333
- /**
1334
- * Process queued user messages by delegating to Session.
1335
- *
1336
- * Shared flow:
1337
- * 1. Initialize session if not yet created
1338
- * 2. Enqueue the message
1339
- * 3. Set adapterSessionId on handle
1340
- * 4. Transition to active if currently idle/paused
1341
- * 5. Process queue via session
1342
- * @param messageHandles - Array of message handles to process
1343
- * @returns Set of message handles that were processed
1344
- */
1345
- protected processUserMessages(messageHandles: MessageHandle[]): Promise<Set<MessageHandle>>;
1346
- /**
1347
- * Initialize the connector's SDK session without sending a message.
1348
- * Must set adapterSessionId before returning.
1349
- * Called by createAgent for idle agent setup.
1350
- * Implementations MUST be idempotent (no-op if already initialized).
1351
- * @param options - Optional start options (e.g., systemPrompt)
1352
- */
1353
- initialize(options?: ConnectorStartOptions): Promise<void>;
1354
- /**
1355
- * Start session with initial message.
1356
- * @param message - The initial message to send
1357
- * @param options - Optional send message options
1358
- * @returns The agent start result with session ID and message handle
1359
- */
1360
- start(message: NormalizedMessageInput, options?: ConnectorSendMessageOptions): Promise<AgentStartResult>;
1361
- /**
1362
- * Complete the agent session by waiting for all messages to finish.
1363
- * @returns Last message result or null if no messages processed
1364
- */
1365
- complete(): Promise<MessageResult | null>;
1366
- /**
1367
- * Returns true if current turn can accept immediate messages.
1368
- * @returns True if turn can accept immediate, false otherwise
1369
- */
1370
- protected acceptsImmediate(): boolean;
1371
- }
1372
- //#endregion
1373
746
  //#region adapters/core/src/utils/tool-approval.d.ts
1374
747
  /**
1375
748
  * Context required to complete a global tool approval request.
@@ -1976,6 +1349,60 @@ declare class AgentEventBridge {
1976
1349
  private emitOwnedStepFinished;
1977
1350
  }
1978
1351
  //#endregion
1352
+ //#region adapters/core/src/adapter/adapter-provider-key-publication.d.ts
1353
+ /**
1354
+ * The one gate a provider session passes before it leaves this adapter.
1355
+ *
1356
+ * **A provider key has one publisher per attempt: the party that claims it.**
1357
+ * For a start or rehydrate the adapter owns, that is the adapter — it announces
1358
+ * the movement and stamps the key on what it emits, and the movement observer
1359
+ * settles the currency. For a **caller-owned** one it is the caller: it reserved
1360
+ * the provider session before dispatching, and it settles the key its connector
1361
+ * confirms, under a generation token it minted and can give back. Until that
1362
+ * caller has been handed the key, nothing here may put it where somebody else
1363
+ * can act on it — an event field a consumer writes onto a session row, a durable
1364
+ * row write, an announcement the observer turns into a second generation.
1365
+ *
1366
+ * The rule was enforced per route before this module: the row write knew it, the
1367
+ * `agent.added` field knew it, enrichment knew it, and each new route had to be
1368
+ * found by a reviewer before it learned it. Two were missed that way. So the
1369
+ * question moves here, and every route asks it the same way — by taking the key
1370
+ * it publishes from {@link publishedProviderKey} rather than from the connector,
1371
+ * the registry or the start result.
1372
+ *
1373
+ * ## What the window is
1374
+ *
1375
+ * It opens with the attempt and closes when the adapter has **handed the key
1376
+ * over**: for a start, the last act of the start itself, after which the key
1377
+ * travels in the response and the caller settles it; for a rehydrate, the whole
1378
+ * call, since its answer *is* the hand-over. A caller-owned attempt that
1379
+ * confirms no key hands over nothing and still closes its window, because
1380
+ * nothing is waiting to be settled and the movement observer is that agent's
1381
+ * only publisher from then on.
1382
+ *
1383
+ * ## What it does not cover
1384
+ *
1385
+ * The window ends where the adapter's knowledge does. Between the hand-over and
1386
+ * the caller's settlement the adapter has no way to observe that the generation
1387
+ * exists — `startAgent`'s contract carries no settlement signal back — so a key
1388
+ * published in that gap is published before it is claimed. The gap is a few
1389
+ * statements of the caller's own (nothing fallible runs between a live connector
1390
+ * and its settlement), and closing it needs an adapter-contract change, which
1391
+ * this wave does not make.
1392
+ */
1393
+ /**
1394
+ * Whether this attempt may publish the provider session it confirmed.
1395
+ *
1396
+ * Mutable, with exactly one writer — {@link releaseProviderKeyPublication}, at
1397
+ * the point the attempt hands its key over. A start carries one of these for its
1398
+ * whole duration; a rehydrate builds one that never opens, because its response
1399
+ * is the hand-over and there is nothing after it.
1400
+ */
1401
+ interface ProviderKeyPublication {
1402
+ /** Whether the key is still the caller's to publish first. */
1403
+ deferred: boolean;
1404
+ }
1405
+ //#endregion
1979
1406
  //#region adapters/core/src/factory/create-adapter-namespace.d.ts
1980
1407
  /**
1981
1408
  * Adapter namespace extends BusNamespace with additional metadata for adapters.
@@ -2071,6 +1498,22 @@ interface AgentTurnExecutorConfig {
2071
1498
  * @param mode - Derived start mode for this turn
2072
1499
  */
2073
1500
  setPendingStartMode: (mode: StartMode) => void;
1501
+ /**
1502
+ * Report that this dispatch discards the pending start-time resume target,
1503
+ * moving the provider session before any provider confirmation.
1504
+ *
1505
+ * Mirrors the precondition every adapter session applies in its own
1506
+ * `suppressStartResumeIfRequested`: the caller disabled native resume, a
1507
+ * concrete resume target is still armed, and the provider has not confirmed
1508
+ * a session for the current connector generation. Under those conditions the
1509
+ * adapter drops the target and mints a fresh identity, so the previously
1510
+ * advertised provider session stops being valid resume currency.
1511
+ *
1512
+ * Awaited before the dispatch it describes, so the session row stops
1513
+ * advertising the abandoned provider session before the provider is asked to
1514
+ * start a new one.
1515
+ */
1516
+ onNativeResumeSuppressed?: () => void | Promise<void>;
2074
1517
  /** Completion/lifecycle tracker hook. */
2075
1518
  onMessageHandle: AgentMessageHandleCallback;
2076
1519
  /** Side-effect callback to mark agent status active before dispatch. */
@@ -2097,6 +1540,7 @@ declare class AgentTurnExecutor {
2097
1540
  private readonly shouldUseNativeResume;
2098
1541
  private readonly hasResumeTarget;
2099
1542
  private readonly setPendingStartMode;
1543
+ private readonly onNativeResumeSuppressed?;
2100
1544
  private readonly onMessageHandle;
2101
1545
  private readonly onBeforeDispatch?;
2102
1546
  private readonly runDispatch;
@@ -2137,10 +1581,39 @@ declare class AgentTurnExecutor {
2137
1581
  * Derive the start mode for the given resolved session context, stash it
2138
1582
  * as the pending mode for the next lifecycle start emission, and return
2139
1583
  * the native-resume decision shared by the dispatch that follows.
1584
+ *
1585
+ * Async because a suppressed resume target moves the provider session: the
1586
+ * movement is recorded before this returns, so the dispatch that abandons the
1587
+ * old provider session cannot be preceded by a resume that still targets it.
2140
1588
  * @param sessionContext - Session context after pre-user-message hooks
2141
1589
  * @returns Whether the connector should rely on native resume
2142
1590
  */
2143
1591
  private deriveAndSetPendingStartMode;
1592
+ /**
1593
+ * Whether this dispatch will move the provider session without confirmation.
1594
+ *
1595
+ * The armed target is abandoned unless the connector holds a *provider-committed*
1596
+ * session that carries continuity forward, which is what
1597
+ * `providerCommittedAdapterSessionId` resolves — the same sampling rule payload
1598
+ * enrichment applies, expressed once. It collapses the two reasons a reported
1599
+ * ID does not prove continuity: a fork awaiting `system.init` reports no
1600
+ * authoritative session at all, and a seeded resume the provider has not echoed
1601
+ * yet reports the very target this dispatch discards. Inferring "no movement"
1602
+ * from the raw accessor left the session row advertising an abandoned provider
1603
+ * thread until a later confirmation — or indefinitely, if the process died
1604
+ * first.
1605
+ *
1606
+ * Effectively one-shot per armed target, so this signal is not a retry clock:
1607
+ * the dispatch it precedes consumes the resume target, after which the
1608
+ * connector reports no pending rotation and mints its own identity — both
1609
+ * reasons stop matching. Re-delivering an announcement no consumer accepted is
1610
+ * therefore owned by `ConfirmedAdapterSessionTracker`, which parks the
1611
+ * undelivered movement and re-drives it from payload enrichment; this method
1612
+ * only has to report the movement honestly once.
1613
+ * @param useNativeResume - Native-resume decision for this dispatch
1614
+ * @returns `true` when the armed resume target is about to be discarded
1615
+ */
1616
+ private movesProviderSession;
2144
1617
  /**
2145
1618
  * Execute the turn pipeline for agent.sendMessage.
2146
1619
  * @param payload - agent.sendMessage request payload
@@ -2179,24 +1652,46 @@ declare class AgentTurnExecutor {
2179
1652
  private assertCanonicalMessageId;
2180
1653
  }
2181
1654
  //#endregion
2182
- //#region adapters/core/src/agent/connector-runtime.d.ts
2183
- /** Connector instance paired with its explicit client config lease. */
2184
- interface ConnectorRuntimeHandle<TConnector extends Pick<AIAgentConnector, 'close'>> {
2185
- /** Live connector instance. */
2186
- readonly connector: TConnector;
2187
- /** Lease whose lifetime exactly matches this connector. */
2188
- readonly lease?: AdapterAuthLeaseHandle;
2189
- }
2190
- /** Dependencies for creating one managed connector runtime. */
2191
- interface CreateConnectorRuntimeOptions<TBus extends ScopedBus<string>, TConnector extends AIAgentConnector<TBus>, TConfig extends BaseAgentConnectorConfig<TBus> = BaseAgentConnectorConfig<TBus>> {
2192
- /** Refs-only config emitted by the common adapter factory. */
2193
- readonly config: BoundAdapterRuntimeConfig<TBus, TConfig>;
2194
- /** Adapter connector constructor. */
2195
- readonly connectorFactory: (config: ResolvedAdapterRuntimeConfig<TBus, TConfig>) => TConnector | Promise<TConnector>;
2196
- /** Optional user-message callback attached only after auth preparation. */
2197
- readonly onMessageSent?: (handle: MessageHandle) => void;
2198
- /** Trusted host-local auth preparer; defaults to DirectChannel + client lease. */
2199
- readonly prepareAuthRuntime?: AdapterAuthRuntimePreparer<TBus, TConfig>;
1655
+ //#region adapters/core/src/agent/connector-swap-vetoed-error.d.ts
1656
+ /**
1657
+ * The typed refusal a connector replacement receives at the arbitration door.
1658
+ * @packageDocumentation
1659
+ */
1660
+ /** Why a replacement was refused before it produced any effect. */
1661
+ type ConnectorSwapVetoReason = /** A teardown of this agent was already in flight when the door was reached. */'teardown-in-flight'
1662
+ /**
1663
+ * The agent holds no connector runtime any more.
1664
+ *
1665
+ * Permanent rather than transient: the runtime reference is cleared before the
1666
+ * teardown's close is awaited, and only a start or a published replacement ever
1667
+ * sets it — so "the runtime is gone" is exactly the fact a post-teardown
1668
+ * replacement must not proceed on.
1669
+ */
1670
+ | 'no-runtime';
1671
+ /**
1672
+ * A connector replacement refused by the arbitration door.
1673
+ *
1674
+ * **Typed because the distinction it carries is not derivable from anything
1675
+ * else.** The door refuses before any replacement effect has occurred, so the
1676
+ * one path with a modelled answer for that — a warm rehydrate — may report
1677
+ * `not-dispatched` instead of leaving its caller uncertain. An untyped throw
1678
+ * lands in the generic replacement rollback and becomes "something failed,
1679
+ * possibly after reaching the provider", which is the strictly worse answer the
1680
+ * door exists to avoid.
1681
+ *
1682
+ * A compound failure is **never** this type. When a producer's own rollback also
1683
+ * fails, the veto is known but whether a replacement connector actually closed is
1684
+ * not, so that case stays an aggregate and keeps the uncertain classification.
1685
+ */
1686
+ declare class ConnectorSwapVetoedError extends Error {
1687
+ readonly agentId: string;
1688
+ readonly reason: ConnectorSwapVetoReason;
1689
+ /**
1690
+ * Build the refusal.
1691
+ * @param agentId - Agent whose replacement was refused
1692
+ * @param reason - Which of the door's two preconditions failed
1693
+ */
1694
+ constructor(agentId: string, reason: ConnectorSwapVetoReason);
2200
1695
  }
2201
1696
  //#endregion
2202
1697
  //#region adapters/core/src/agent/agent-lifecycle-emitter.d.ts
@@ -2282,8 +1777,23 @@ interface AgentPayloadEmitterConfig {
2282
1777
  getConnectorAdapterSessionId: () => string | undefined;
2283
1778
  /** Last known adapterSessionId cached across connector swaps. */
2284
1779
  getLastKnownAdapterSessionId: () => string | undefined;
2285
- /** Persist latest adapterSessionId after resolution. */
2286
- setLastKnownAdapterSessionId: (adapterSessionId: string | undefined) => void;
1780
+ /**
1781
+ * Persist latest adapterSessionId after resolution.
1782
+ *
1783
+ * May be asynchronous: the owning agent uses this sink to announce a moved
1784
+ * provider identity, and enrichment awaits it so no event carrying the new ID
1785
+ * is published before the movement is recorded.
1786
+ */
1787
+ setLastKnownAdapterSessionId: (adapterSessionId: string | undefined) => void | Promise<void>;
1788
+ /**
1789
+ * Whether the agent's provider session is this adapter's to publish yet.
1790
+ *
1791
+ * Absent means yes. While it answers `false` the enriched event carries no
1792
+ * provider session at all — a caller-owned start's key is the caller's to
1793
+ * publish, and a consumer that writes it onto a session row would advertise a
1794
+ * key no generation holds yet.
1795
+ */
1796
+ isProviderKeyPublishable?: () => boolean;
2287
1797
  /** Live event metadata defaults resolved from current runtime state. */
2288
1798
  getEventMetadataDefaults: () => AgentPayloadEventMetadata;
2289
1799
  }
@@ -2306,14 +1816,20 @@ declare class AgentPayloadEmitter {
2306
1816
  * non-Claude adapters) the locally-determined ID is authoritative and returned
2307
1817
  * immediately.
2308
1818
  *
2309
- * The `lastKnownAdapterSessionId` bridges connector swaps: when the old
2310
- * connector is gone and the new one is not yet wired, the cached value carries
2311
- * the confirmed ID from the previous connector.
1819
+ * The `lastKnownAdapterSessionId` bridges connector swaps *for stamping only*:
1820
+ * when the old connector is gone and the new one is not yet wired, the cached
1821
+ * value carries the confirmed ID from the previous connector. The recording
1822
+ * sink is deliberately not given that fallback — see the inline note.
1823
+ *
1824
+ * No async *resolution* fallback is used. `connector.getAdapterSessionId()`
1825
+ * may resolve with a provisional placeholder for fork sessions. Enrichment
1826
+ * must never stamp unconfirmed IDs — omitting the field is safe since R8
1827
+ * schemas allow it optional.
2312
1828
  *
2313
- * No async fallback is used. `connector.getAdapterSessionId()` may resolve
2314
- * with a provisional placeholder for fork sessions. Enrichment must never
2315
- * stamp unconfirmed IDs — omitting the field is safe since R8 schemas allow
2316
- * it optional.
1829
+ * The recording sink is awaited even though resolution stays synchronous: it
1830
+ * announces a moved provider identity, and that movement must be recorded
1831
+ * before this event advertises the new ID. Recording an unchanged ID — the
1832
+ * case for all but the first event of a generation — resolves without I/O.
2317
1833
  * @returns Confirmed adapter session ID or `undefined`
2318
1834
  */
2319
1835
  private resolveConfirmedAdapterSessionId;
@@ -2558,7 +2074,16 @@ type StartAgentRequestPayload = ExtractSubjectPayload<typeof AdapterSubjects.sta
2558
2074
  */
2559
2075
  type AgentCreationOptions = Omit<Partial<Pick<StartAgentRequestPayload, 'model' | 'cwd' | 'env' | 'allowedTools' | 'disallowedTools' | 'allowedDirectories' | 'reasoningEffort' | 'adapterConfig' | 'mode' | 'mcpSessionContext' | 'harnessId' | 'clientId' | 'clientProfileName' | 'providerContext' | 'ephemeral'>>, 'providerContext'> & {
2560
2076
  adapterSessionId?: string;
2561
- resumeAdapterSessionId?: string; /** Unresolved provider context (credential refs, not plaintext). */
2077
+ resumeAdapterSessionId?: string;
2078
+ /**
2079
+ * The attempt's provider-key publication gate.
2080
+ *
2081
+ * Carried into the agent because the routes inside it — the identity
2082
+ * enrichment stamps on every emitted event, the movement its tracker
2083
+ * announces — are publication routes like the start's own, and every route
2084
+ * asks one gate. See {@link ProviderKeyPublication}.
2085
+ */
2086
+ providerKeyPublication?: ProviderKeyPublication; /** Unresolved provider context (credential refs, not plaintext). */
2562
2087
  providerContext?: ProviderContext;
2563
2088
  /**
2564
2089
  * Source Makaio session ID when mode is 'fork'.
@@ -2616,6 +2141,18 @@ interface AgentUsageTotals {
2616
2141
  totalOutputTokens: number;
2617
2142
  totalCalls: number;
2618
2143
  }
2144
+ /**
2145
+ * In-process handle for an active agent and its registry-owned session metadata.
2146
+ * @typeParam TAgent - Live agent implementation exposed to local callers
2147
+ */
2148
+ interface ActiveAgentHandle<TAgent = AIAgent> {
2149
+ /** Live agent instance with its prototype and runtime state intact. */
2150
+ readonly agent: TAgent;
2151
+ /** Makaio session ID associated with the registry entry. */
2152
+ readonly sessionId: string;
2153
+ /** Provider-specific session ID, unavailable until the provider confirms it. */
2154
+ readonly adapterSessionId: string | undefined;
2155
+ }
2619
2156
  /** Result from creating an agent runtime. */
2620
2157
  interface AgentRuntimeCreationResult {
2621
2158
  cleanup: () => void;
@@ -2676,113 +2213,35 @@ interface AIAdapterConstructorConfig<TBus extends ScopedBus<string>, TConnector
2676
2213
  definitionProviders?: readonly AdapterProviderDefinition[];
2677
2214
  }
2678
2215
  //#endregion
2679
- //#region adapters/core/src/agent/agent-connector-lifecycle-manager.d.ts
2680
- /** Sanitized lifecycle diagnostic emitted after a replacement became primary. */
2681
- interface ConnectorCleanupDiagnostic {
2682
- /** Stable machine-readable failure category. */
2683
- readonly code: 'previous-connector-cleanup-failed';
2684
- /** Lifecycle stage whose cleanup failed. */
2685
- readonly stage: 'swap-old-runtime';
2686
- /** Agent owning the replacement connector. */
2687
- readonly agentId: string;
2688
- }
2689
- /** Final async guard run after the replacement is ready but before it becomes primary. */
2690
- type ConnectorSwapCommitGuard = () => void | Promise<void>;
2691
- /**
2692
- * Dependencies for connector lifecycle management.
2693
- */
2694
- interface AgentConnectorLifecycleManagerConfig<TBus extends ScopedBus<string>, TConnector extends AIAgentConnector<TBus>> {
2695
- /** Stable agent identifier (used for diagnostics). */
2696
- agentId: string;
2697
- /** Create config input for connector/config factories. */
2698
- buildConfigInput: (overrides?: AgentConnectorConfigOverrides) => ConfigFactoryInput<TBus>;
2699
- /** Adapter config factory from AIAgent config. */
2700
- configFactory: (input: ConfigFactoryInput<TBus>) => Promise<BaseAgentConnectorConfig<TBus> & {
2701
- adapterId: string;
2702
- }>;
2703
- /** Connector factory from AIAgent config. */
2704
- connectorFactory: (config: BaseAgentConnectorConfig<TBus> & {
2705
- adapterId: string;
2706
- }) => Promise<TConnector> | TConnector;
2707
- /** Trusted host-local auth preparer shared by every connector generation. */
2708
- prepareAuthRuntime?: AdapterAuthRuntimePreparer<TBus>;
2709
- /** Build onMessageSent callback for connector creation. */
2710
- createOnMessageSent: () => (handle: MessageHandle) => void;
2711
- /** Wire adapter-specific events on a connector instance. */
2712
- wireEvents: (connector: TConnector) => void | Promise<void>;
2713
- /** Emit idle lifecycle event on processing-state idle transitions. */
2714
- emitIdle: () => Promise<void>;
2715
- /** Get current connector plus its explicit client config lease. */
2716
- getConnectorRuntime: () => ConnectorRuntimeHandle<TConnector>;
2717
- /** Replace active connector and lease together on successful swap. */
2718
- setConnectorRuntime: (runtime: ConnectorRuntimeHandle<TConnector>) => void;
2719
- /** Get runtime system prompt to preserve across swaps. */
2720
- getRuntimeSystemPrompt: () => SystemPrompt | undefined;
2721
- /** Store latest adapter session ID for enrichment after swaps. */
2722
- setLastKnownAdapterSessionId: (adapterSessionId: string | undefined) => void;
2723
- /** Publish a sanitized cleanup diagnostic without exposing connector errors. */
2724
- reportCleanupFailure: (diagnostic: ConnectorCleanupDiagnostic) => void | Promise<void>;
2725
- }
2726
- /**
2727
- * Manages connector lifecycle for AIAgent.
2728
- *
2729
- * Owns per-connector wiring cleanup registration and swap lifecycle choreography.
2730
- */
2731
- declare class AgentConnectorLifecycleManager<TBus extends ScopedBus<string>, TConnector extends AIAgentConnector<TBus>> {
2732
- /** Cleanup functions for connector event wiring (cleared on each connector swap) */
2733
- private connectorWiringCleanups;
2734
- private readonly config;
2735
- constructor(config: AgentConnectorLifecycleManagerConfig<TBus, TConnector>);
2736
- /**
2737
- * Register a cleanup function for connector wiring.
2738
- * @param cleanup - Cleanup function to register
2739
- */
2740
- addConnectorWiringCleanup(cleanup: () => void): void;
2741
- /**
2742
- * Clear connector wiring cleanups.
2743
- */
2744
- clearConnectorWiring(): void;
2216
+ //#region adapters/core/src/adapter/agent-registry.d.ts
2217
+ /** What one agent teardown observed, plus whether there was an agent at all. */
2218
+ interface AgentDisposalReport extends TeardownReport {
2745
2219
  /**
2746
- * Wire base and adapter-specific connector events.
2747
- * @param connector - Connector instance to wire
2748
- */
2749
- wireAllConnectorEvents(connector: TConnector): Promise<void>;
2750
- /**
2751
- * Replace the active connector with a fresh instance.
2220
+ * Whether a live agent was found and its teardown attempted.
2752
2221
  *
2753
- * Uses create-before-close pattern with rollback to preserve availability.
2754
- * @param configOverrides - Optional runtime override fields
2755
- * @param beforeCommit - Final guard after replacement initialization and before publication
2756
- * @returns The replacement's provider-confirmed session ID, when it has one
2757
- */
2758
- swapConnector(configOverrides?: AgentConnectorConfigOverrides, beforeCommit?: ConnectorSwapCommitGuard): Promise<string | undefined>;
2759
- /**
2760
- * Build and materialize the replacement connector runtime.
2761
- * @param currentConnector - Active connector whose runtime values provide defaults
2762
- * @param configOverrides - Optional requested runtime changes
2763
- * @returns Prepared replacement connector and auth lease
2222
+ * True for a teardown this call joined as well as one it started: an agent *was*
2223
+ * found, by whichever caller got there first, and both callers are answered with
2224
+ * the same evidence.
2764
2225
  */
2765
- private createReplacementRuntime;
2766
- /**
2767
- * Wire and initialize a replacement, restoring the current wiring on failure.
2768
- * @param newRuntime - Replacement connector and auth lease
2769
- * @param oldWiringCleanups - Wiring still owned by the active connector
2770
- * @param beforeCommit - Optional final publication guard
2771
- * @returns Provider-confirmed session ID, when the replacement has one
2772
- */
2773
- private initializeReplacement;
2774
- /**
2775
- * Run superseded connector wiring cleanups without failing the committed swap.
2776
- * @param cleanups - Previous connector wiring cleanups
2777
- */
2778
- private runWiringCleanups;
2226
+ readonly found: boolean;
2227
+ }
2228
+ /** Options a teardown entry point accepts from the request that drove it. */
2229
+ interface AgentTeardownOptions {
2779
2230
  /**
2780
- * Close the superseded runtime and publish only a sanitized diagnostic on failure.
2781
- * @param currentRuntime - Superseded connector and auth lease
2231
+ * Absolute deadline of the request driving this teardown, when it has one.
2232
+ *
2233
+ * Passed through so a teardown that must wait for a connector replacement ends
2234
+ * its wait inside the deadline of whoever is waiting on it. Absent for
2235
+ * fan-out teardowns with no request behind them, where the policy ceiling stands
2236
+ * alone.
2782
2237
  */
2783
- private closePreviousRuntime;
2238
+ readonly deadline?: number | undefined;
2784
2239
  }
2785
2240
  //#endregion
2241
+ //#region adapters/core/src/agent/agent-connector-lifecycle-manager.d.ts
2242
+ /** Final async guard run after the replacement is ready but before it becomes primary. */
2243
+ type ConnectorSwapCommitGuard = () => void | Promise<void>;
2244
+ //#endregion
2786
2245
  //#region adapters/core/src/agent/ai-agent.d.ts
2787
2246
  /**
2788
2247
  * Abstract base class for AI agents.
@@ -2798,10 +2257,8 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
2798
2257
  private connectorRuntime;
2799
2258
  protected confirmedModel?: string;
2800
2259
  protected initialModel?: string;
2801
- /** Cached adapterSessionId from the last connector that had a session — survives connector swaps. */
2802
- private lastKnownAdapterSessionId?;
2803
- /** Cleanup functions for bus subscriptions (stable, survive connector swap) */
2804
- private busHandlerCleanups;
2260
+ /** Owns the confirmed provider-session identity cache and the movement seam. */
2261
+ private readonly adapterSessionTracker;
2805
2262
  /** Whether init() has been called */
2806
2263
  private initialized;
2807
2264
  /** Runtime system prompt captured from start/initialize, preserved across connector swaps. */
@@ -2820,6 +2277,10 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
2820
2277
  private readonly connectorLifecycleManager;
2821
2278
  /** Serialized connector replacement and runtime-config publication owner. */
2822
2279
  private readonly connectorSwapCoordinator;
2280
+ /** Classes of closes performed for this agent that no teardown waiter reported. */
2281
+ private readonly closeReportLedger;
2282
+ /** Callback every connector generation reports a submitted message through. */
2283
+ private readonly onMessageSent;
2823
2284
  /** Payload enrichment and global emission helper. */
2824
2285
  private readonly payloadEmitter;
2825
2286
  /** Stateful lifecycle emitter for start/complete/error/session.closed. */
@@ -2853,11 +2314,9 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
2853
2314
  /**
2854
2315
  * Create the connector lifecycle collaborator bound to this agent instance.
2855
2316
  * @param emitGlobal - Enriched global event emitter
2856
- * @param setLastKnownAdapterSessionId - Sink for the latest confirmed provider session
2857
2317
  * @returns Connector lifecycle manager for this agent
2858
2318
  */
2859
2319
  private createConnectorLifecycleManager;
2860
- private getEventMetadataDefaults;
2861
2320
  /** @returns Unique agent identifier */
2862
2321
  get agentId(): string;
2863
2322
  /** @returns Adapter instance identifier */
@@ -3031,9 +2490,12 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
3031
2490
  * as baseline for non-overridden fields.
3032
2491
  * @param configOverrides - Optional config overrides (e.g., new cwd, model)
3033
2492
  * @param beforeCommit - Optional guard executed before replacing the active connector
2493
+ * @param settledByCaller - Whether the caller writes the replacement's durable
2494
+ * currency itself, in which case the swap records the confirmed session
2495
+ * without announcing it as a movement
3034
2496
  * @throws Error if connector is currently processing a turn
3035
2497
  */
3036
- swapConnector(configOverrides?: AgentConnectorConfigOverrides, beforeCommit?: ConnectorSwapCommitGuard): Promise<void>;
2498
+ swapConnector(configOverrides?: AgentConnectorConfigOverrides, beforeCommit?: ConnectorSwapCommitGuard, settledByCaller?: boolean): Promise<void>;
3037
2499
  /**
3038
2500
  * Build config factory input from agent config with optional overrides.
3039
2501
  *
@@ -3043,13 +2505,6 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
3043
2505
  * @returns ConfigFactoryInput ready for config factory
3044
2506
  */
3045
2507
  private buildConfigInput;
3046
- /**
3047
- * Create the onMessageSent callback for connector factories.
3048
- *
3049
- * Returns a callback that emits user_message.sent events to the global bus.
3050
- * @returns Callback function for connector config
3051
- */
3052
- private createOnMessageSent;
3053
2508
  /**
3054
2509
  * Wire adapter-specific connector events.
3055
2510
  * Called automatically during init() and connector swap.
@@ -3073,11 +2528,53 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
3073
2528
  *
3074
2529
  * Emits session.closed event (once per session) unless explicitly suppressed,
3075
2530
  * then unsubscribes from all bus handlers and aborts the connector if available.
2531
+ * Reports the class the connector runtime observed, or `released` when there was
2532
+ * no runtime — provably nothing is speaking in that case.
2533
+ *
2534
+ * **A bus-handler cleanup failure does not downgrade the class**, because a local
2535
+ * listener that refuses to unsubscribe cannot keep a provider conversation alive.
2536
+ * A failed lease release *does* downgrade, because the lease is a resource this
2537
+ * runtime held; that asymmetry is the whole distinction.
2538
+ *
2539
+ * **The report is for the agent, not only for the runtime it is holding now.** A
2540
+ * connector replacement closes runtimes on this agent's behalf, and when no
2541
+ * teardown was waiting to receive what those closes observed, the classes are
2542
+ * booked on the agent — so they are aggregated here rather than lost, and a
2543
+ * runtime that was superseded unobserved cannot be answered for as if it had
2544
+ * never existed.
3076
2545
  * @param options - Cleanup options; ephemeral agents suppress session-close lifecycle events because they never join a session.
2546
+ * @returns What this agent observed about the end of its resources
3077
2547
  */
3078
2548
  close(options?: {
3079
2549
  emitSessionClosed?: boolean;
3080
- }): Promise<void>;
2550
+ }): Promise<TeardownReport>;
2551
+ /**
2552
+ * Give this agent's identity up, closing nothing.
2553
+ *
2554
+ * **For the teardown that abandons its wait on a connector replacement.** From
2555
+ * the instant that wait expires this agent is no longer the instance answering
2556
+ * for its ID — the registry entry is dropped in the same arm, so a successor may
2557
+ * claim the ID immediately — while the runtimes stay with the replacement until
2558
+ * it settles, which can be a whole wait later. Waiting for that settlement to
2559
+ * unsubscribe leaves both agents answering for one identity in between.
2560
+ *
2561
+ * It closes nothing, reports nothing and emits nothing: the expiry arm's
2562
+ * `unknown` is the honest statement about the runtimes, and this changes none of
2563
+ * it. Safe to call twice — the cleanups are taken off their list, not merely run.
2564
+ */
2565
+ releaseIdentityWiring(): void;
2566
+ /**
2567
+ * Take this agent's connector runtime away from it.
2568
+ *
2569
+ * Clearing the reference **before** the close is awaited is what makes "the
2570
+ * runtime is gone" permanent: only a start or a published replacement ever sets
2571
+ * it, so a replacement arriving after a teardown began finds the absence and is
2572
+ * refused instead of building onto a dying agent. The abandoned-waiter path in
2573
+ * the replacement coordinator needs the same guarantee, which is why this is one
2574
+ * method and not two copies of a two-line sequence.
2575
+ * @returns The runtime this agent held, or `undefined` when it held none
2576
+ */
2577
+ private detachConnectorRuntime;
3081
2578
  /**
3082
2579
  * Ensure the connector is initialized, throwing if not.
3083
2580
  * @returns The initialized connector instance
@@ -3139,6 +2636,44 @@ declare abstract class AIAgent<TBus extends ScopedBus<string> = ScopedBus<string
3139
2636
  * @throws Error if connector is not initialized
3140
2637
  */
3141
2638
  getAdapterSessionId(): Promise<string>;
2639
+ /**
2640
+ * Announce the provider session this generation resolved to, through the
2641
+ * agent's own movement tracker.
2642
+ *
2643
+ * For producers outside the turn pipeline — cold rehydration resolves an
2644
+ * identity before the agent has emitted anything, so payload enrichment has
2645
+ * not run yet. Routing through the tracker rather than emitting on the seam
2646
+ * directly is what keeps an undelivered announcement retryable: the tracker's
2647
+ * acknowledged-announcement marker is the retry anchor, and the agent's next
2648
+ * emitted event re-drives the announcement. It also makes the announcement
2649
+ * idempotent against that first enrichment call instead of duplicating it.
2650
+ * **Who writes the durable currency is a parameter, not a second method.**
2651
+ * A start or rehydrate whose caller owns the agent row settles the confirmed
2652
+ * key itself, under a generation token that caller minted and can give back;
2653
+ * announcing the same movement would make the observer a second settle
2654
+ * producer for one identity, and its generation would be held under a token
2655
+ * nobody in that caller's failure paths can name. One entry point keeps that
2656
+ * choice explicit at every call site rather than letting a future producer
2657
+ * pick the announcing variant by not knowing there is another — see
2658
+ * {@link ConfirmedAdapterSessionTracker.recordCallerSettled}.
2659
+ * @param adapterSessionId - Provider session ID this generation is current on
2660
+ * @param settledByCaller - Whether the caller writes this movement's currency itself
2661
+ * @returns Promise resolving once the announcement attempt completed
2662
+ */
2663
+ recordConfirmedAdapterSession(adapterSessionId: string, settledByCaller?: boolean): Promise<void>;
2664
+ /**
2665
+ * Provider session this agent is currently the live writer of.
2666
+ *
2667
+ * The occupancy authority for the adapter's registry. Synchronous on purpose:
2668
+ * the claim check serializing two concurrent resume attaches reads it inside a
2669
+ * critical section, which {@link getAdapterSessionId} — awaiting the connector —
2670
+ * cannot serve. Current before any movement is announced, because the tracker
2671
+ * caches a confirmed identity before announcing it; that ordering is what lets a
2672
+ * concurrent attach see this agent occupying the session the same announcement
2673
+ * publishes as resume currency.
2674
+ * @returns Last provider-confirmed session ID, or `undefined` before the first confirmation
2675
+ */
2676
+ get currentAdapterSessionId(): string | undefined;
3142
2677
  /**
3143
2678
  * Complete the agent session by waiting for all messages to finish.
3144
2679
  *
@@ -3217,6 +2752,14 @@ declare abstract class AIAdapter<TBus extends ScopedBus<string> = ScopedBus<stri
3217
2752
  protected readonly globalBus: IMakaioBus;
3218
2753
  /** Scoped bus for adapter-specific communication. Created in init(). */
3219
2754
  protected adapterBus: TBus;
2755
+ /**
2756
+ * The one place a teardown and a connector replacement meet on this instance.
2757
+ *
2758
+ * Constructed here because one adapter instance is exactly its scope, and
2759
+ * declared before the registry so it can be handed to it as a required
2760
+ * dependency — see {@link AgentTeardownArbiter}.
2761
+ */
2762
+ private readonly teardownArbiter;
3220
2763
  /** Registry of active agents with session info and usage totals. */
3221
2764
  private readonly registry;
3222
2765
  /** Cleanup functions for bus subscriptions. */
@@ -3298,30 +2841,27 @@ declare abstract class AIAdapter<TBus extends ScopedBus<string> = ScopedBus<stri
3298
2841
  /** Hook for subclass cleanup. Override to perform async teardown (close connections, etc.). */
3299
2842
  protected onClose(): Promise<void>;
3300
2843
  /**
3301
- * Get an agent by ID with session info.
2844
+ * Get a live agent and its registry-owned session metadata.
3302
2845
  * @param agentId - Agent identifier
3303
- * @returns Agent with session info, or undefined if not found
2846
+ * @returns Active agent handle, or undefined if not found
3304
2847
  */
3305
- getAgent(agentId: string): (TAgent & {
3306
- sessionId: string;
3307
- adapterSessionId: string;
3308
- }) | undefined;
2848
+ getAgent(agentId: string): ActiveAgentHandle<TAgent> | undefined;
3309
2849
  /**
3310
- * Dispose resources for an agent.
2850
+ * Dispose resources for an agent and report what the teardown observed.
3311
2851
  *
3312
- * Aborts the agent and removes it from the tracking map.
2852
+ * `found` answers the question the boolean return always answered — was there an
2853
+ * agent here — and the class answers the one it could not: whether anything of
2854
+ * ours provably stopped speaking to the provider.
3313
2855
  * @param agentId - Agent identifier
3314
- * @returns true if agent was found and disposed, false otherwise
2856
+ * @param options - The driving request's deadline, when there is one
2857
+ * @returns Whether an agent was found, and what its teardown observed
3315
2858
  */
3316
- disposeAgent(agentId: string): boolean;
2859
+ disposeAgent(agentId: string, options?: AgentTeardownOptions): Promise<AgentDisposalReport>;
3317
2860
  /**
3318
2861
  * Get all active agents managed by this adapter.
3319
- * @returns Array of active agents with session info
2862
+ * @returns Active agent handles
3320
2863
  */
3321
- getActiveAgents(): Array<TAgent & {
3322
- sessionId: string;
3323
- adapterSessionId: string;
3324
- }>;
2864
+ getActiveAgents(): Array<ActiveAgentHandle<TAgent>>;
3325
2865
  /**
3326
2866
  * Check if the adapter has been initialized.
3327
2867
  * @returns true if init() has been called successfully
@@ -3509,6 +3049,24 @@ interface TestModelRef {
3509
3049
  /** Default reasoning effort for tests that exercise reasoning. */
3510
3050
  reasoningEffort?: AIReasoningLevel$1;
3511
3051
  }
3052
+ /**
3053
+ * Which of an adapter's declared authentication methods a conformance config
3054
+ * should select.
3055
+ *
3056
+ * `config-default` is the live-harness order: a config picks whatever it would
3057
+ * pick for a real conformance run, including an `inferred` method that inherits
3058
+ * a developer's native client login.
3059
+ *
3060
+ * `declared-credentials` forbids that inheritance. It asks the config for a
3061
+ * method whose credentials come from declared sources, so that a caller which
3062
+ * supplies those sources can construct the connector identically on every
3063
+ * machine. Cases in the default test run need this: an `inferred` method is only
3064
+ * materializable where somebody has logged the vendor client in, and a gate that
3065
+ * is green only on a logged-in developer machine is not a gate. Configs whose
3066
+ * adapters declare nothing but credential-backed methods already satisfy it and
3067
+ * may ignore it.
3068
+ */
3069
+ type ConformanceAuthSelection = 'config-default' | 'declared-credentials';
3512
3070
  /**
3513
3071
  * Provider definitions supplied by the conformance harness.
3514
3072
  *
@@ -3518,6 +3076,11 @@ interface TestModelRef {
3518
3076
  interface CreateConformanceTestConfigOptions {
3519
3077
  /** Full provider definitions available to conformance tests. */
3520
3078
  providerDefinitions?: readonly ProviderDefinitionInput[];
3079
+ /**
3080
+ * Auth-method selection policy for this config. Defaults to
3081
+ * `config-default` when the harness expresses no requirement.
3082
+ */
3083
+ authSelection?: ConformanceAuthSelection;
3521
3084
  }
3522
3085
  /**
3523
3086
  * Options for creating test agent instances.
@@ -3856,6 +3419,10 @@ declare class ConformanceConnectorRuntimeRegistry<TBus extends ScopedBus<string>
3856
3419
  create<TConfig extends BaseAgentConnectorConfig<TBus>>(options: CreateConnectorRuntimeOptions<TBus, TConnector, TConfig>): Promise<TConnector>;
3857
3420
  /**
3858
3421
  * Close every connector still owned by this configuration.
3422
+ *
3423
+ * The managed close reports instead of rejecting, so the failures are read out
3424
+ * of the reports; a suite teardown that swallowed them would hide exactly the
3425
+ * lease leak this registry exists to catch.
3859
3426
  * @throws The single close failure, or an AggregateError containing all failures
3860
3427
  */
3861
3428
  closeAll(): Promise<void>;
@@ -4577,4 +4144,4 @@ declare const ToolCompletedEventSchema: z.ZodObject<{
4577
4144
  type ToolStartedEvent = z.infer<typeof ToolStartedEventSchema>;
4578
4145
  type ToolCompletedEvent = z.infer<typeof ToolCompletedEventSchema>;
4579
4146
  //#endregion
4580
- export { AIAdapter, type AIAdapterCapabilities, type AIAdapterCapability, type AIAdapterCapabilityRegistry, type AIAdapterConfig, type AIAdapterConstructorConfig, type AIAdapterContext, type AIAdapterDefinition, type AIAdapterInitOptions, type AIAdapterPromptFailureResult, type AIAdapterPromptOptions, type AIAdapterPromptResult, type AIAdapterPromptSuccessResult, AIAgent, type AIAgentConfig, AIAgentConnector, type AIModel, type AIReasoningLevel, type AdapterNamespace, type AdapterProviderDefinition, type AgentBusHandlerRegistrarConfig, type AgentCompleteEvent, AgentCompleteEventSchema, AgentConnectorLifecycleManager, type AgentConnectorLifecycleManagerConfig, type AgentContext, AgentEventBridge, type AgentEventBridgeConfig, type AgentIdentity, AgentLifecycleEmitter, type AgentLifecycleEmitterConfig, AgentPayloadEmitter, type AgentPayloadEmitterConfig, type AgentRuntimeCreationResult, AgentRuntimeMutationManager, type AgentRuntimeMutationManagerConfig, type AgentSendMessageOptions, type AgentStartResult, type AgentStartedEvent, AgentStartedEventSchema, AgentTurnExecutor, type AgentTurnExecutorConfig, type AgentUsageTotals, type BaseAgentConnectorConfig, BaseConnectorSession, BaseConnectorTurn, BaseLogImporter, type CompactionMetadata, type ConfigFactoryInput, ConformanceConnectorRuntimeRegistry, type ConformanceEnvReader, type ConformanceTestConfig, type ConnectorSendMessageOptions, type ConnectorSessionConfig, type ConnectorStartOptions, type CreateConformanceTestConfigOptions, type CreateTestAgentOptions, type DiscoveryMetadata, type DiscriminatedHandler, type DiscriminatedHandlersConfig, type DiscriminatedHandlersMap, type ErrorEvent, ErrorEventSchema, type ExecutionContext, type ExternalToolIdentifier, type ExternalToolIdentifiers, type ExternalToolMeta, FactoryUsageCorrelationHeaders, type FromGlobalToolApprovalFn, type GeneratedCapabilityProperties, type HarnessRequester, type IAdapterConfigFactory, type ISessionToolLedger, type ImportCursorPosition, ImportCursorPositionSchema, ImportCursorStorageNamespace, ImportCursorStorageSubjects, type ImportMetadata, type ImportSegment, type ImportSegmentLineage, type ImportSegmentTurn, type LedgerSessionContext, type LogImportConfig, type LogImportOrchestrator, type LogImportRegistration, type LogImportSessionContext, type LogImportTestConfig, type LogImporter, type LogImporterConfig, type LogImporterConstructor, type LogOrchestratorConfig, type LogOrchestratorConstructor, MAKAIO_CONFORMANCE_PRIMARY_MODEL_ENV, MAKAIO_CONFORMANCE_PROVIDER_DEFINITIONS_ENV, MAKAIO_CONFORMANCE_PROVIDER_ENV, MAKAIO_CONFORMANCE_SECONDARY_MODEL_ENV, type McpIntegrationStrategy, type McpSessionResources, type McpToolChange, type MergeResult, type MergeScopedToolApprovalOptions, type MessageDeliveryMode, MessageHandle, MessageLifecycleTracker, type MessageResult, type MessageState, type NormalizedCallUsage, type NormalizedEvent, type NormalizedMessageInput, type ParseFileResult, type PauseResult, type PlatformDefaults, ProceduralAgentConnector, type ProceduralConnectorSession, ProceduralConnectorTurn, type ProceduralTurnConfig, type ProceduralTurnState, type ProcessLogFileResult, type ProcessQueueCallbacks, type ProcessingState, type ProviderRequestCorrelation, type QueueableTurn, type ReasoningLevelMap, type ResolveConformanceDefinitionProvidersOptions, type ResolveConformanceTestPresetOptions, type ResolveHints, type ResolvedConformanceTestPreset, SESSION_CLOSED_QUEUE_ERROR, type ScopedBusFor, type ScopedToolApprovalRequest, type ScopedToolApprovalResponse, ScopedToolApprovalSchema, type SendMessageOptions, type SendMessageRequest, type SendMessageResponse, type SerializedContextBlock, SessionLifecycle, SessionToolLedger, type ShouldUseNativeResumeFn, type StartAgentOptions, type StartAgentRequest, type StartAgentResponse, type StorageMessagePayload, type SyncDiscriminatedHandler, type SyncDiscriminatedHandlersConfig, type SyncDiscriminatedHandlersMap, type SyncTypedEmitFn, type TestModelRef, type ToGlobalToolApprovalFn, type ToolApprovalContext, ToolCallTracker, type ToolCompletedEvent, ToolCompletedEventSchema, type ToolLedgerEntry, type ToolStartedEvent, ToolStartedEventSchema, type TurnEvent, type TurnState, type TurnSubjects, TurnTracker, type TurnTrackerOptions, type TurnTrackerSerializedState, TurnTrackerSerializedStateSchema, type TypedEmitFn, UserMessageQueue, type ValidCapability, type WireSessionConfig, type WireSessionSubjects, bindProviderRequestCorrelation, buildFactoryUsageCorrelationHeaders, cleanEnvForAdapter, createAdapterNamespace, createNoAuthTestProviderContext, createTestProviderContext, createToolApprovalHandler, defineDiscriminatedHandlers, defineDiscriminatedHandlersSync, extractMcpCallTarget, formatContextBlockAsText, formatContextBlocksAsText, formatMessageHistoryAsTranscript, isMcpCallTool, isTextLikeMimeType, markCompletedWithFinalResult, mergeScopedToolApproval, normalizeEnvValue, normalizeMessageInput, normalizeMimeType, parseAIAdapterCapabilities, processDiscriminatedItems, processDiscriminatedItemsSync, processQueueMessages, registerAgentBusHandlers, registerMemoryImportCursorStorage, rejectQueuedHandles, resolveConformanceDefinitionProviders, resolveConformanceTestPreset, resolveDisabledNativeTools, resolveRequiredSessionId, resolveTestConfig, safeJsonStringify, serializeBlockToText, serializeTurnContext, toImportSegment };
4147
+ export { AIAdapter, type AIAdapterCapabilities, type AIAdapterCapability, type AIAdapterCapabilityRegistry, type AIAdapterConfig, type AIAdapterConstructorConfig, type AIAdapterContext, type AIAdapterDefinition, type AIAdapterInitOptions, type AIAdapterPromptFailureResult, type AIAdapterPromptOptions, type AIAdapterPromptResult, type AIAdapterPromptSuccessResult, AIAgent, type AIAgentConfig, AIAgentConnector, type AIModel, type AIReasoningLevel, type ActiveAgentHandle, type AdapterNamespace, type AdapterProviderDefinition, type AgentBusHandlerRegistrarConfig, type AgentCompleteEvent, AgentCompleteEventSchema, type AgentContext, type AgentDisposalReport, AgentEventBridge, type AgentEventBridgeConfig, type AgentIdentity, AgentLifecycleEmitter, type AgentLifecycleEmitterConfig, AgentPayloadEmitter, type AgentPayloadEmitterConfig, type AgentRuntimeCreationResult, AgentRuntimeMutationManager, type AgentRuntimeMutationManagerConfig, type AgentSendMessageOptions, type AgentStartResult, type AgentStartedEvent, AgentStartedEventSchema, AgentTeardownArbiter, type AgentTeardownOptions, AgentTurnExecutor, type AgentTurnExecutorConfig, type AgentUsageTotals, type BaseAgentConnectorConfig, BaseConnectorSession, BaseConnectorTurn, BaseLogImporter, CONNECTOR_EXIT_OBSERVATION_MS, type ClosableConnectorRuntime, type CompactionMetadata, type ConfigFactoryInput, type ConformanceAuthSelection, ConformanceConnectorRuntimeRegistry, type ConformanceEnvReader, type ConformanceTestConfig, type ConnectorReplacementSettlement, type ConnectorSendMessageOptions, type ConnectorSessionConfig, type ConnectorStartOptions, type ConnectorSwapAdmission, type ConnectorSwapHandover, type ConnectorSwapVetoReason, ConnectorSwapVetoedError, type CreateConformanceTestConfigOptions, type CreateTestAgentOptions, type DiscoveryMetadata, type DiscriminatedHandler, type DiscriminatedHandlersConfig, type DiscriminatedHandlersMap, type ErrorEvent, ErrorEventSchema, type ExecutionContext, type ExternalToolIdentifier, type ExternalToolIdentifiers, type ExternalToolMeta, FactoryUsageCorrelationHeaders, type FromGlobalToolApprovalFn, type GeneratedCapabilityProperties, GenerationRetirementLedger, type HarnessRequester, type IAdapterConfigFactory, type ISessionToolLedger, type ImportCursorPosition, ImportCursorPositionSchema, ImportCursorStorageNamespace, ImportCursorStorageSubjects, type ImportMetadata, type ImportSegment, type ImportSegmentLineage, type ImportSegmentTurn, type LedgerSessionContext, type LogImportConfig, type LogImportOrchestrator, type LogImportRegistration, type LogImportSessionContext, type LogImportTestConfig, type LogImporter, type LogImporterConfig, type LogImporterConstructor, type LogOrchestratorConfig, type LogOrchestratorConstructor, MAKAIO_CONFORMANCE_PRIMARY_MODEL_ENV, MAKAIO_CONFORMANCE_PROVIDER_DEFINITIONS_ENV, MAKAIO_CONFORMANCE_PROVIDER_ENV, MAKAIO_CONFORMANCE_SECONDARY_MODEL_ENV, type McpIntegrationStrategy, type McpSessionResources, type McpToolChange, type MergeResult, type MergeScopedToolApprovalOptions, type MessageDeliveryMode, MessageHandle, MessageLifecycleTracker, type MessageResult, type MessageState, type NormalizedCallUsage, type NormalizedEvent, type NormalizedMessageInput, type ObservedExitOptions, type ParseFileResult, type PauseResult, type PlatformDefaults, ProceduralAgentConnector, type ProceduralConnectorSession, ProceduralConnectorTurn, type ProceduralTurnConfig, type ProceduralTurnState, type ProcessLogFileResult, type ProcessQueueCallbacks, type ProcessingState, type ProviderRequestCorrelation, type QueueableTurn, type ReasoningLevelMap, type ResolveConformanceDefinitionProvidersOptions, type ResolveConformanceTestPresetOptions, type ResolveHints, type ResolvedConformanceTestPreset, SESSION_CLOSED_QUEUE_ERROR, SWAP_SETTLEMENT_WAIT_MS, type ScopedBusFor, type ScopedToolApprovalRequest, type ScopedToolApprovalResponse, ScopedToolApprovalSchema, type SendMessageOptions, type SendMessageRequest, type SendMessageResponse, type SerializedContextBlock, SessionLifecycle, SessionToolLedger, type ShouldUseNativeResumeFn, type StartAgentOptions, type StartAgentRequest, type StartAgentResponse, type StorageMessagePayload, type SupersededGeneration, type SyncDiscriminatedHandler, type SyncDiscriminatedHandlersConfig, type SyncDiscriminatedHandlersMap, type SyncTypedEmitFn, type TeardownReport, type TeardownSubject, type TestModelRef, type ToGlobalToolApprovalFn, type ToolApprovalContext, ToolCallTracker, type ToolCompletedEvent, ToolCompletedEventSchema, type ToolLedgerEntry, type ToolStartedEvent, ToolStartedEventSchema, type TurnEvent, type TurnState, type TurnSubjects, TurnTracker, type TurnTrackerOptions, type TurnTrackerSerializedState, TurnTrackerSerializedStateSchema, type TypedEmitFn, UserMessageQueue, type ValidCapability, type WireSessionConfig, type WireSessionSubjects, aggregateTeardownReports, bindProviderRequestCorrelation, buildFactoryUsageCorrelationHeaders, capTeardownEvidence, cleanEnvForAdapter, createAdapterNamespace, createNoAuthTestProviderContext, createTestProviderContext, createToolApprovalHandler, defineDiscriminatedHandlers, defineDiscriminatedHandlersSync, describeTeardownFailure, exitWasObserved, extractMcpCallTarget, formatContextBlockAsText, formatContextBlocksAsText, formatMessageHistoryAsTranscript, isMcpCallTool, isTextLikeMimeType, markCompletedWithFinalResult, mergeScopedToolApproval, normalizeEnvValue, normalizeMessageInput, normalizeMimeType, parseAIAdapterCapabilities, processDiscriminatedItems, processDiscriminatedItemsSync, processQueueMessages, registerAgentBusHandlers, registerMemoryImportCursorStorage, rejectQueuedHandles, reportBestEffortStages, reportObservedExit, reportRepeatTeardown, resolveConformanceDefinitionProviders, resolveConformanceTestPreset, resolveDisabledNativeTools, resolveRequiredSessionId, resolveTestConfig, rethrowTeardownFailure, runBestEffortStage, safeJsonStringify, serializeBlockToText, serializeTurnContext, stageFailure, toImportSegment, unknownTeardown, withTimeout };