@oscharko-dev/keiko 1.2.0 → 1.2.1

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 (1015) hide show
  1. package/README.md +10 -2
  2. package/dist/ui/csp-hashes.json +7 -7
  3. package/dist/ui/static/404.html +1 -1
  4. package/dist/ui/static/__next.__PAGE__.txt +12 -12
  5. package/dist/ui/static/__next._full.txt +23 -22
  6. package/dist/ui/static/__next._tree.txt +2 -2
  7. package/dist/ui/static/_next/static/chunks/014h2nyfet3kr.js +1 -0
  8. package/dist/ui/static/_next/static/chunks/02ahxxpsbao7z.js +1 -0
  9. package/dist/ui/static/_next/static/chunks/0851fl0j1ja4e.js +1 -0
  10. package/dist/ui/static/_next/static/chunks/08896ukd2zxg6.js +1 -0
  11. package/dist/ui/static/_next/static/chunks/08nml2svyd9vv.js +4 -0
  12. package/dist/ui/static/_next/static/chunks/08tg5xjyy073b.js +1 -0
  13. package/dist/ui/static/_next/static/chunks/09p2ty64ellxo.js +1 -0
  14. package/dist/ui/static/_next/static/chunks/0b7xat6jxvrmr.js +1 -0
  15. package/dist/ui/static/_next/static/chunks/{196257vfyrtgu.js → 0d3a8-uxb000v.js} +1 -1
  16. package/dist/ui/static/_next/static/chunks/{388eokaf_2t9k.js → 0jjhji-e9mg99.js} +1 -1
  17. package/dist/ui/static/_next/static/chunks/0jtp8te-03j1-.js +1 -0
  18. package/dist/ui/static/_next/static/chunks/0lw_ax6yn_z8w.js +1 -0
  19. package/dist/ui/static/_next/static/chunks/0oocu54xdbxf3.js +2 -0
  20. package/dist/ui/static/_next/static/chunks/{3h-rh_lx0l8_3.js → 0pf5ot48kepng.js} +1 -1
  21. package/dist/ui/static/_next/static/chunks/0rs9egrg2q85w.js +1 -0
  22. package/dist/ui/static/_next/static/chunks/{3hclt6m3ok4n9.js → 0rsutf6da798_.js} +1 -1
  23. package/dist/ui/static/_next/static/chunks/0rw0et8bt6w-b.js +1 -0
  24. package/dist/ui/static/_next/static/chunks/{2b_t95bbpmtej.js → 0su17ctiaqfp0.js} +1 -1
  25. package/dist/ui/static/_next/static/chunks/0wok-g3ndtvch.js +1 -0
  26. package/dist/ui/static/_next/static/chunks/0y3402xorco2c.js +1 -0
  27. package/dist/ui/static/_next/static/chunks/10p1rdlk7n_9w.js +1 -0
  28. package/dist/ui/static/_next/static/chunks/12aem44im45f-.js +1 -0
  29. package/dist/ui/static/_next/static/chunks/18kcx5kpyxr16.js +1 -0
  30. package/dist/ui/static/_next/static/chunks/1ggcq_lho062y.js +1 -0
  31. package/dist/ui/static/_next/static/chunks/1o-own3kgpojf.js +1 -0
  32. package/dist/ui/static/_next/static/chunks/{0l72usw6suk0h.js → 1osovjtjgxmbl.js} +1 -1
  33. package/dist/ui/static/_next/static/chunks/1uu9slkxpbe4y.js +1 -0
  34. package/dist/ui/static/_next/static/chunks/1vy80v9kp_rqv.js +1 -0
  35. package/dist/ui/static/_next/static/chunks/1x-sfb1_rl15-.js +1 -0
  36. package/dist/ui/static/_next/static/chunks/1zqfkyeqq5cl8.js +1 -0
  37. package/dist/ui/static/_next/static/chunks/{3603jy78awb1p.js → 1zw11x_e-3fzu.js} +1 -1
  38. package/dist/ui/static/_next/static/chunks/20-u8pg5ve_cz.js +1 -0
  39. package/dist/ui/static/_next/static/chunks/22zxuap4am9bs.js +1 -0
  40. package/dist/ui/static/_next/static/chunks/23lstlpeh2rb-.js +1 -0
  41. package/dist/ui/static/_next/static/chunks/261euyxjrb0lv.js +1 -0
  42. package/dist/ui/static/_next/static/chunks/2astwwmbb8e53.js +1 -0
  43. package/dist/ui/static/_next/static/chunks/2duxlo7cg_s7_.js +3 -0
  44. package/dist/ui/static/_next/static/chunks/2dwrkrp-gqyej.js +1 -0
  45. package/dist/ui/static/_next/static/chunks/{1m-9yzfpcm7wc.js → 2ef4l5re80dgi.js} +1 -1
  46. package/dist/ui/static/_next/static/chunks/2g_pljoa8f0e-.js +1 -0
  47. package/dist/ui/static/_next/static/chunks/{09zc5hgtb7s-z.js → 2h4vqb2rt3mr1.js} +1 -1
  48. package/dist/ui/static/_next/static/chunks/{3qjkuhjy_-_br.js → 2imh4llefx9d1.js} +1 -1
  49. package/dist/ui/static/_next/static/chunks/2jsnrkl0syr4y.js +1 -0
  50. package/dist/ui/static/_next/static/chunks/{0--s8pmsbkf62.js → 2ta3jr_uw2j0x.js} +1 -1
  51. package/dist/ui/static/_next/static/chunks/{2y98z-sun8_ew.js → 2u5_pu1uc6seh.js} +1 -1
  52. package/dist/ui/static/_next/static/chunks/2xd3_a4jlxum2.css +1 -0
  53. package/dist/ui/static/_next/static/chunks/{0mjsj7bp-ukgh.css → 2yuvdrio9ki3a.css} +26 -9
  54. package/dist/ui/static/_next/static/chunks/3-pcgkdsv7x4z.js +1 -0
  55. package/dist/ui/static/_next/static/chunks/{0yzmg9aoglud6.js → 3007ncr8g751a.js} +1 -1
  56. package/dist/ui/static/_next/static/chunks/307xuhrdmetj7.js +1 -0
  57. package/dist/ui/static/_next/static/chunks/30og31pxg8wrp.js +1 -0
  58. package/dist/ui/static/_next/static/chunks/32jgtvf2y-f54.js +1 -0
  59. package/dist/ui/static/_next/static/chunks/35ivnhnxr9dmz.js +1 -0
  60. package/dist/ui/static/_next/static/chunks/363iuc3t94rie.js +1 -0
  61. package/dist/ui/static/_next/static/chunks/37qsy798-g74f.js +1 -0
  62. package/dist/ui/static/_next/static/chunks/37v998g0cm36x.js +1 -0
  63. package/dist/ui/static/_next/static/chunks/3b05n-007vc3e.js +1 -0
  64. package/dist/ui/static/_next/static/chunks/3cpuzx4fetu6y.js +1 -0
  65. package/dist/ui/static/_next/static/chunks/3d27ozm1boe_5.js +3 -0
  66. package/dist/ui/static/_next/static/chunks/{1a6ri-sriyu-m.js → 3ftqojkan-5cl.js} +1 -1
  67. package/dist/ui/static/_next/static/chunks/3fwt6-8rc2mya.js +1 -0
  68. package/dist/ui/static/_next/static/chunks/{196x_tfexoucg.js → 3g4px251sg85e.js} +1 -1
  69. package/dist/ui/static/_next/static/chunks/3hjs3gk92eave.js +1 -0
  70. package/dist/ui/static/_next/static/chunks/{1n3b0bhd9q0p6.js → 3l3xw2fmr7pct.js} +3 -3
  71. package/dist/ui/static/_next/static/chunks/3neoxf-shnu-d.js +1 -0
  72. package/dist/ui/static/_next/static/chunks/3payvp5ps2fne.css +3 -0
  73. package/dist/ui/static/_next/static/chunks/3q-93bizla3k1.js +1 -0
  74. package/dist/ui/static/_next/static/chunks/{3eduf6vevclfm.js → 3qbbcm9fuk494.js} +1 -1
  75. package/dist/ui/static/_next/static/chunks/{2ta3xj9td_qot.js → 3rhep1yhgo6a7.js} +1 -1
  76. package/dist/ui/static/_next/static/chunks/{0bpexy600ffpg.js → 3ty06iqiblqi4.js} +1 -1
  77. package/dist/ui/static/_next/static/chunks/{0iu3dyqe7m7_7.js → 3wz98o059mhtf.js} +1 -1
  78. package/dist/ui/static/_next/static/chunks/{2kylv1kq1_4p1.js → 3x2p8mgrihuet.js} +1 -1
  79. package/dist/ui/static/_next/static/chunks/3xi3iilmw9_vy.js +5 -0
  80. package/dist/ui/static/_next/static/chunks/3zxbqudoeow_a.js +1 -0
  81. package/dist/ui/static/_next/static/chunks/3zxwlxhzm5swe.js +1 -0
  82. package/dist/ui/static/_next/static/chunks/{24u-5fslcj3n9.js → 405vbzo164i84.js} +2 -2
  83. package/dist/ui/static/_next/static/chunks/42pls95xys34g.js +1 -0
  84. package/dist/ui/static/_next/static/chunks/43z5mfwx4lk4w.js +1 -0
  85. package/dist/ui/static/_next/static/chunks/{turbopack-2rwr7ign9ynaa.js → turbopack-34k8wgx0iwdzg.js} +1 -1
  86. package/dist/ui/static/_not-found/__next._full.txt +21 -20
  87. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +9 -9
  88. package/dist/ui/static/_not-found/__next._tree.txt +1 -1
  89. package/dist/ui/static/_not-found.html +1 -1
  90. package/dist/ui/static/_not-found.txt +21 -20
  91. package/dist/ui/static/atlassian-connectors/__next._full.txt +23 -22
  92. package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
  93. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +11 -11
  94. package/dist/ui/static/atlassian-connectors.html +1 -1
  95. package/dist/ui/static/atlassian-connectors.txt +23 -22
  96. package/dist/ui/static/index.html +1 -1
  97. package/dist/ui/static/index.txt +23 -22
  98. package/dist/ui/static/launch/__next._full.txt +26 -25
  99. package/dist/ui/static/launch/__next._tree.txt +2 -2
  100. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +12 -12
  101. package/dist/ui/static/launch.html +1 -1
  102. package/dist/ui/static/launch.txt +26 -25
  103. package/dist/ui/static/local-knowledge/__next._full.txt +26 -25
  104. package/dist/ui/static/local-knowledge/__next._tree.txt +2 -2
  105. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +12 -12
  106. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +11 -11
  107. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
  108. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +11 -11
  109. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  110. package/dist/ui/static/local-knowledge/capsule.txt +11 -11
  111. package/dist/ui/static/local-knowledge.html +1 -1
  112. package/dist/ui/static/local-knowledge.txt +26 -25
  113. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-analyze.d.ts +5 -1
  114. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-analyze.d.ts.map +1 -1
  115. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-analyze.js +26 -1
  116. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts +5 -0
  117. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts.map +1 -1
  118. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.js +112 -1
  119. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts +12 -5
  120. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts.map +1 -1
  121. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.js +14 -6
  122. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-retrieval-miss.d.ts +13 -0
  123. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-retrieval-miss.d.ts.map +1 -0
  124. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-retrieval-miss.js +363 -0
  125. package/node_modules/@oscharko-dev/keiko-activity-log/package.json +3 -3
  126. package/node_modules/@oscharko-dev/keiko-cli/dist/init.d.ts.map +1 -1
  127. package/node_modules/@oscharko-dev/keiko-cli/dist/init.js +1 -0
  128. package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle-browser-activity.d.ts +22 -0
  129. package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle-browser-activity.d.ts.map +1 -0
  130. package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle-browser-activity.js +50 -0
  131. package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.d.ts +4 -1
  132. package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.d.ts.map +1 -1
  133. package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.js +137 -32
  134. package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts +24 -3
  135. package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts.map +1 -1
  136. package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.js +126 -5
  137. package/node_modules/@oscharko-dev/keiko-cli/dist/ui-browser-handoff.d.ts +15 -0
  138. package/node_modules/@oscharko-dev/keiko-cli/dist/ui-browser-handoff.d.ts.map +1 -0
  139. package/node_modules/@oscharko-dev/keiko-cli/dist/ui-browser-handoff.js +91 -0
  140. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts +2 -0
  141. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts.map +1 -1
  142. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.js +31 -3
  143. package/node_modules/@oscharko-dev/keiko-cli/package.json +15 -15
  144. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.d.ts +1 -1
  145. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.js +1 -1
  146. package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
  147. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts +229 -49
  148. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts.map +1 -1
  149. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.js +313 -24
  150. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts +2406 -98
  151. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts.map +1 -1
  152. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.js +2924 -183
  153. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.d.ts +2489 -206
  154. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.d.ts.map +1 -1
  155. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.js +2867 -35
  156. package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts +35 -5
  157. package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts.map +1 -1
  158. package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.js +63 -3
  159. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session-pairing.d.ts +37 -0
  160. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session-pairing.d.ts.map +1 -0
  161. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session-pairing.js +67 -0
  162. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session.d.ts +2 -35
  163. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session.d.ts.map +1 -1
  164. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session.js +1 -62
  165. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-repository-search.d.ts +1 -0
  166. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-repository-search.d.ts.map +1 -1
  167. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-repository-search.js +12 -9
  168. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-safe-activity.d.ts +38 -1
  169. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-safe-activity.d.ts.map +1 -1
  170. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-safe-activity.js +94 -2
  171. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.d.ts +3 -3
  172. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.d.ts.map +1 -1
  173. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.js +64 -17
  174. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api.d.ts +8 -4
  175. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api.d.ts.map +1 -1
  176. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api.js +1 -0
  177. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.d.ts +17 -1
  178. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.d.ts.map +1 -1
  179. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.js +13 -0
  180. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime.js +1 -1
  181. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-validation.d.ts.map +1 -1
  182. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-validation.js +27 -3
  183. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts +28 -2
  184. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts.map +1 -1
  185. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.js +27 -0
  186. package/node_modules/@oscharko-dev/keiko-contracts/dist/connected-context.d.ts +28 -1
  187. package/node_modules/@oscharko-dev/keiko-contracts/dist/connected-context.d.ts.map +1 -1
  188. package/node_modules/@oscharko-dev/keiko-contracts/dist/connected-context.js +60 -1
  189. package/node_modules/@oscharko-dev/keiko-contracts/dist/contract-validation-primitives.d.ts +3 -0
  190. package/node_modules/@oscharko-dev/keiko-contracts/dist/contract-validation-primitives.d.ts.map +1 -0
  191. package/node_modules/@oscharko-dev/keiko-contracts/dist/contract-validation-primitives.js +12 -0
  192. package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts +70 -2
  193. package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts.map +1 -1
  194. package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.js +266 -5
  195. package/node_modules/@oscharko-dev/keiko-contracts/dist/evidence.d.ts +11 -0
  196. package/node_modules/@oscharko-dev/keiko-contracts/dist/evidence.d.ts.map +1 -1
  197. package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.d.ts +57 -1
  198. package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.d.ts.map +1 -1
  199. package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.js +4 -2
  200. package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.d.ts +1 -1
  201. package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.d.ts.map +1 -1
  202. package/node_modules/@oscharko-dev/keiko-contracts/dist/grounded-assessment.d.ts +10 -2
  203. package/node_modules/@oscharko-dev/keiko-contracts/dist/grounded-assessment.d.ts.map +1 -1
  204. package/node_modules/@oscharko-dev/keiko-contracts/dist/grounded-assessment.js +52 -12
  205. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +5 -5
  206. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
  207. package/node_modules/@oscharko-dev/keiko-contracts/dist/no-evidence-answer.d.ts.map +1 -1
  208. package/node_modules/@oscharko-dev/keiko-contracts/dist/no-evidence-answer.js +29 -0
  209. package/node_modules/@oscharko-dev/keiko-contracts/dist/opencode-service-host.d.ts +42 -0
  210. package/node_modules/@oscharko-dev/keiko-contracts/dist/opencode-service-host.d.ts.map +1 -0
  211. package/node_modules/@oscharko-dev/keiko-contracts/dist/opencode-service-host.js +151 -0
  212. package/node_modules/@oscharko-dev/keiko-contracts/dist/support-report.d.ts +36 -0
  213. package/node_modules/@oscharko-dev/keiko-contracts/dist/support-report.d.ts.map +1 -1
  214. package/node_modules/@oscharko-dev/keiko-contracts/dist/support-report.js +11 -0
  215. package/node_modules/@oscharko-dev/keiko-contracts/dist/tools.d.ts.map +1 -1
  216. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.d.ts +2 -2
  217. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.js +2 -2
  218. package/node_modules/@oscharko-dev/keiko-contracts/dist/workspace.d.ts +41 -0
  219. package/node_modules/@oscharko-dev/keiko-contracts/dist/workspace.d.ts.map +1 -1
  220. package/node_modules/@oscharko-dev/keiko-contracts/dist/workspace.js +18 -0
  221. package/node_modules/@oscharko-dev/keiko-contracts/package.json +9 -1
  222. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
  223. package/node_modules/@oscharko-dev/keiko-evidence/dist/connected-context-evidence.d.ts +5 -0
  224. package/node_modules/@oscharko-dev/keiko-evidence/dist/connected-context-evidence.d.ts.map +1 -1
  225. package/node_modules/@oscharko-dev/keiko-evidence/dist/connected-context-evidence.js +23 -3
  226. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
  227. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
  228. package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
  229. package/node_modules/@oscharko-dev/keiko-git/dist/version.d.ts +1 -1
  230. package/node_modules/@oscharko-dev/keiko-git/dist/version.js +1 -1
  231. package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
  232. package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
  233. package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
  234. package/node_modules/@oscharko-dev/keiko-harness/package.json +7 -7
  235. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/conversation/grounded-answer-runner.d.ts.map +1 -1
  236. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/conversation/grounded-answer-runner.js +3 -0
  237. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/_internal.d.ts +1 -1
  238. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/_internal.d.ts.map +1 -1
  239. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/_internal.js +2 -33
  240. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/html-parser.js +5 -4
  241. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/index.d.ts +2 -0
  242. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/index.d.ts.map +1 -1
  243. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/index.js +2 -0
  244. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/retrieval-runner.d.ts +2 -1
  245. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/retrieval-runner.d.ts.map +1 -1
  246. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/retrieval-runner.js +1 -0
  247. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/scoped-vector-search.d.ts +9 -2
  248. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/scoped-vector-search.d.ts.map +1 -1
  249. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/scoped-vector-search.js +18 -10
  250. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
  251. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
  252. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
  253. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
  254. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
  255. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
  256. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
  257. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
  258. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
  259. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
  260. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
  261. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
  262. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
  263. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
  264. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
  265. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
  266. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
  267. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
  268. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.d.ts.map +1 -1
  269. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.js +103 -1
  270. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/embedding.d.ts +2 -0
  271. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/embedding.d.ts.map +1 -1
  272. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/embedding.js +2 -0
  273. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway-attempt-admission.d.ts +8 -0
  274. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway-attempt-admission.d.ts.map +1 -0
  275. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway-attempt-admission.js +44 -0
  276. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +89 -1
  277. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
  278. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +617 -129
  279. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts +4 -0
  280. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
  281. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +28 -3
  282. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts +3 -2
  283. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts.map +1 -1
  284. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.js +2 -2
  285. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/model-selection.d.ts +23 -0
  286. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/model-selection.d.ts.map +1 -1
  287. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/model-selection.js +50 -5
  288. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.d.ts +10 -0
  289. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.d.ts.map +1 -1
  290. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.js +54 -2
  291. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -1
  292. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +2 -0
  293. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts +11 -3
  294. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts.map +1 -1
  295. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.js +262 -58
  296. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/readiness-probe.d.ts +1 -0
  297. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/readiness-probe.d.ts.map +1 -1
  298. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/readiness-probe.js +1 -0
  299. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +143 -3
  300. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
  301. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +361 -39
  302. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.d.ts +9 -1
  303. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.d.ts.map +1 -1
  304. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.js +62 -16
  305. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/types.d.ts +15 -0
  306. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/types.d.ts.map +1 -1
  307. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
  308. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
  309. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +4 -4
  310. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
  311. package/node_modules/@oscharko-dev/keiko-sandbox/dist/backends.d.ts +2 -2
  312. package/node_modules/@oscharko-dev/keiko-sandbox/dist/backends.d.ts.map +1 -1
  313. package/node_modules/@oscharko-dev/keiko-sandbox/dist/backends.js +30 -15
  314. package/node_modules/@oscharko-dev/keiko-sandbox/dist/index.d.ts +1 -1
  315. package/node_modules/@oscharko-dev/keiko-sandbox/dist/index.d.ts.map +1 -1
  316. package/node_modules/@oscharko-dev/keiko-sandbox/dist/plan.d.ts.map +1 -1
  317. package/node_modules/@oscharko-dev/keiko-sandbox/dist/plan.js +24 -3
  318. package/node_modules/@oscharko-dev/keiko-sandbox/dist/runtime-gateway.d.ts +3 -0
  319. package/node_modules/@oscharko-dev/keiko-sandbox/dist/runtime-gateway.d.ts.map +1 -1
  320. package/node_modules/@oscharko-dev/keiko-sandbox/dist/runtime-gateway.js +31 -6
  321. package/node_modules/@oscharko-dev/keiko-sandbox/dist/seatbelt-execution-root.d.ts +11 -0
  322. package/node_modules/@oscharko-dev/keiko-sandbox/dist/seatbelt-execution-root.d.ts.map +1 -0
  323. package/node_modules/@oscharko-dev/keiko-sandbox/dist/seatbelt-execution-root.js +141 -0
  324. package/node_modules/@oscharko-dev/keiko-sandbox/dist/select.d.ts.map +1 -1
  325. package/node_modules/@oscharko-dev/keiko-sandbox/dist/select.js +2 -0
  326. package/node_modules/@oscharko-dev/keiko-sandbox/dist/types.d.ts +8 -0
  327. package/node_modules/@oscharko-dev/keiko-sandbox/dist/types.d.ts.map +1 -1
  328. package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
  329. package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
  330. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts +10 -1
  331. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts.map +1 -1
  332. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.js +25 -2
  333. package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts +1 -1
  334. package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts.map +1 -1
  335. package/node_modules/@oscharko-dev/keiko-security/dist/index.js +1 -1
  336. package/node_modules/@oscharko-dev/keiko-security/dist/portable-tree-attestation.d.ts +14 -0
  337. package/node_modules/@oscharko-dev/keiko-security/dist/portable-tree-attestation.d.ts.map +1 -1
  338. package/node_modules/@oscharko-dev/keiko-security/dist/portable-tree-attestation.js +183 -25
  339. package/node_modules/@oscharko-dev/keiko-security/dist/redaction.d.ts +9 -0
  340. package/node_modules/@oscharko-dev/keiko-security/dist/redaction.d.ts.map +1 -1
  341. package/node_modules/@oscharko-dev/keiko-security/dist/redaction.js +16 -1
  342. package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
  343. package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
  344. package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
  345. package/node_modules/@oscharko-dev/keiko-server/dist/chat-activity.d.ts +9 -2
  346. package/node_modules/@oscharko-dev/keiko-server/dist/chat-activity.d.ts.map +1 -1
  347. package/node_modules/@oscharko-dev/keiko-server/dist/chat-activity.js +47 -2
  348. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts.map +1 -1
  349. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.js +2 -0
  350. package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.d.ts.map +1 -1
  351. package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.js +4 -0
  352. package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.d.ts.map +1 -1
  353. package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.js +274 -7
  354. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/ciRepairPromptReservation.d.ts +11 -1
  355. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/ciRepairPromptReservation.d.ts.map +1 -1
  356. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/ciRepairPromptReservation.js +21 -7
  357. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeActivityOperations.d.ts +50 -2
  358. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeActivityOperations.d.ts.map +1 -1
  359. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeActivityOperations.js +25 -0
  360. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeCiRepairController.d.ts +14 -7
  361. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeCiRepairController.d.ts.map +1 -1
  362. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeCiRepairController.js +33 -26
  363. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.d.ts +46 -0
  364. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.d.ts.map +1 -1
  365. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.js +33 -0
  366. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.d.ts +51 -3
  367. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.d.ts.map +1 -1
  368. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.js +97 -5
  369. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.d.ts +8 -2
  370. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.d.ts.map +1 -1
  371. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.js +265 -29
  372. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.d.ts +37 -1
  373. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.d.ts.map +1 -1
  374. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.js +416 -34
  375. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorState.d.ts +5 -3
  376. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorState.d.ts.map +1 -1
  377. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorState.js +14 -7
  378. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorTypes.d.ts +21 -0
  379. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorTypes.d.ts.map +1 -1
  380. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRefusalEscalation.d.ts +79 -0
  381. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRefusalEscalation.d.ts.map +1 -0
  382. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRefusalEscalation.js +305 -0
  383. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRepositoryInstructions.d.ts +100 -0
  384. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRepositoryInstructions.d.ts.map +1 -0
  385. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRepositoryInstructions.js +363 -0
  386. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRoutes.d.ts.map +1 -1
  387. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRoutes.js +13 -0
  388. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRunEffort.d.ts +71 -0
  389. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRunEffort.d.ts.map +1 -0
  390. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRunEffort.js +294 -0
  391. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeTerminalCause.d.ts +47 -0
  392. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeTerminalCause.d.ts.map +1 -0
  393. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeTerminalCause.js +65 -0
  394. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeVerificationContinuation.d.ts +7 -0
  395. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeVerificationContinuation.d.ts.map +1 -0
  396. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeVerificationContinuation.js +79 -0
  397. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.d.ts +18 -0
  398. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.d.ts.map +1 -1
  399. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.js +201 -42
  400. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolAuthorityPort.d.ts +6 -1
  401. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolAuthorityPort.d.ts.map +1 -1
  402. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolAuthorityPort.js +733 -17
  403. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.d.ts +5 -1
  404. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.d.ts.map +1 -1
  405. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.js +262 -57
  406. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacadePorts.d.ts +185 -2
  407. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacadePorts.d.ts.map +1 -1
  408. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacadePorts.js +57 -1
  409. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolGovernedDelegate.d.ts +3 -1
  410. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolGovernedDelegate.d.ts.map +1 -1
  411. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolGovernedDelegate.js +14 -2
  412. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.d.ts +4 -0
  413. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.d.ts.map +1 -1
  414. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.js +50 -1
  415. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.d.ts +21 -3
  416. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.d.ts.map +1 -1
  417. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.js +143 -8
  418. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReadEditPorts.d.ts +63 -1
  419. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReadEditPorts.d.ts.map +1 -1
  420. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReadEditPorts.js +710 -170
  421. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.d.ts +108 -0
  422. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.d.ts.map +1 -0
  423. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.js +477 -0
  424. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLanePortableCodingRuntime.d.ts +2 -4
  425. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLanePortableCodingRuntime.d.ts.map +1 -1
  426. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLanePortableCodingRuntime.js +53 -46
  427. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.d.ts +4 -1
  428. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.d.ts.map +1 -1
  429. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.js +51 -52
  430. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/governedToolModelContent.d.ts +48 -0
  431. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/governedToolModelContent.d.ts.map +1 -0
  432. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/governedToolModelContent.js +179 -0
  433. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/materializedPatchRegistry.d.ts +60 -0
  434. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/materializedPatchRegistry.d.ts.map +1 -0
  435. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/materializedPatchRegistry.js +61 -0
  436. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.d.ts +7 -7
  437. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.d.ts.map +1 -1
  438. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.js +48 -15
  439. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessPaths.d.ts +3 -0
  440. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessPaths.d.ts.map +1 -1
  441. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessPaths.js +14 -0
  442. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessProtocol.d.ts.map +1 -1
  443. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessProtocol.js +11 -4
  444. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/npmLaneRuntimeApprovals.d.ts +2 -0
  445. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/npmLaneRuntimeApprovals.d.ts.map +1 -1
  446. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/npmLaneRuntimeApprovals.js +28 -14
  447. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeFunctionalHarness/_governedTools.d.ts +3 -0
  448. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeFunctionalHarness/_governedTools.d.ts.map +1 -1
  449. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeFunctionalHarness/_governedTools.js +48 -20
  450. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.d.ts +5 -4
  451. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.d.ts.map +1 -1
  452. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.js +11 -12
  453. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativeContext.d.ts +10 -0
  454. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativeContext.d.ts.map +1 -0
  455. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativeContext.js +27 -0
  456. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeReconciler.d.ts +6 -3
  457. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeReconciler.d.ts.map +1 -1
  458. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeReconciler.js +15 -15
  459. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts +17 -3
  460. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts.map +1 -1
  461. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.js +198 -43
  462. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts +97 -5
  463. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts.map +1 -1
  464. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.js +1334 -103
  465. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeServiceHostArtifact.d.ts +79 -0
  466. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeServiceHostArtifact.d.ts.map +1 -0
  467. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeServiceHostArtifact.js +176 -0
  468. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.d.ts +177 -25
  469. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.d.ts.map +1 -1
  470. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.js +131 -38
  471. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.d.ts +18 -0
  472. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.d.ts.map +1 -1
  473. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.js +298 -32
  474. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.d.ts +6 -0
  475. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.d.ts.map +1 -1
  476. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.js +14 -3
  477. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.d.ts +33 -0
  478. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.d.ts.map +1 -0
  479. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.js +213 -0
  480. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionAuxiliaryPorts.d.ts +1 -1
  481. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionAuxiliaryPorts.d.ts.map +1 -1
  482. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionAuxiliaryPorts.js +2 -8
  483. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCiRepairRuntime.js +15 -5
  484. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeHost.js +5 -0
  485. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts +25 -3
  486. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts.map +1 -1
  487. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.js +227 -40
  488. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionManagedWorktreeTools.d.ts +20 -1
  489. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionManagedWorktreeTools.d.ts.map +1 -1
  490. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionManagedWorktreeTools.js +217 -12
  491. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeActivation.d.ts +3 -1
  492. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeActivation.d.ts.map +1 -1
  493. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeActivation.js +20 -5
  494. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.d.ts +8 -1
  495. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.d.ts.map +1 -1
  496. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/repositorySearchProof.d.ts.map +1 -1
  497. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/repositorySearchProof.js +2 -1
  498. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/skillDiscoveryProof.d.ts.map +1 -1
  499. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/skillDiscoveryProof.js +2 -1
  500. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.js +262 -60
  501. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts +18 -0
  502. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts.map +1 -1
  503. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.js +43 -6
  504. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeAuthorityService.d.ts +38 -0
  505. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeAuthorityService.d.ts.map +1 -1
  506. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeAuthorityService.js +115 -16
  507. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.d.ts +20 -0
  508. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.d.ts.map +1 -0
  509. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.js +48 -0
  510. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.d.ts +5 -0
  511. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.d.ts.map +1 -1
  512. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.js +5 -1
  513. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextRead.d.ts +100 -4
  514. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextRead.d.ts.map +1 -1
  515. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextRead.js +435 -25
  516. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadAbsence.d.ts +61 -0
  517. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadAbsence.d.ts.map +1 -0
  518. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadAbsence.js +123 -0
  519. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadArtifact.d.ts +7 -0
  520. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadArtifact.d.ts.map +1 -1
  521. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadArtifact.js +26 -3
  522. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadNodeProcess.d.ts.map +1 -1
  523. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadNodeProcess.js +10 -0
  524. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProcess.d.ts +2 -0
  525. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProcess.d.ts.map +1 -1
  526. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProcess.js +17 -2
  527. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProtocol.d.ts +69 -2
  528. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProtocol.d.ts.map +1 -1
  529. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProtocol.js +266 -7
  530. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts +14 -3
  531. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
  532. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +761 -122
  533. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.d.ts +2 -2
  534. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.d.ts.map +1 -1
  535. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.js +139 -0
  536. package/node_modules/@oscharko-dev/keiko-server/dist/command-runner.d.ts +2 -0
  537. package/node_modules/@oscharko-dev/keiko-server/dist/command-runner.d.ts.map +1 -1
  538. package/node_modules/@oscharko-dev/keiko-server/dist/command-runner.js +176 -19
  539. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-admission.d.ts.map +1 -1
  540. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-admission.js +72 -13
  541. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-log.d.ts +3 -0
  542. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-log.d.ts.map +1 -0
  543. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-log.js +48 -0
  544. package/node_modules/@oscharko-dev/keiko-server/dist/correlation.d.ts.map +1 -1
  545. package/node_modules/@oscharko-dev/keiko-server/dist/correlation.js +8 -5
  546. package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.d.ts.map +1 -1
  547. package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.js +5 -0
  548. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +39 -8
  549. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
  550. package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +234 -77
  551. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +1 -1
  552. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
  553. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +6 -0
  554. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentAuthorityRegistry.d.ts +8 -0
  555. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentAuthorityRegistry.d.ts.map +1 -1
  556. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentAuthorityRegistry.js +16 -0
  557. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRootBoundary.d.ts +5 -1
  558. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRootBoundary.d.ts.map +1 -1
  559. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRootBoundary.js +60 -12
  560. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.d.ts +13 -2
  561. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.d.ts.map +1 -1
  562. package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.js +131 -18
  563. package/node_modules/@oscharko-dev/keiko-server/dist/editor/bufferSafetyTargets.d.ts +5 -0
  564. package/node_modules/@oscharko-dev/keiko-server/dist/editor/bufferSafetyTargets.d.ts.map +1 -0
  565. package/node_modules/@oscharko-dev/keiko-server/dist/editor/bufferSafetyTargets.js +44 -0
  566. package/node_modules/@oscharko-dev/keiko-server/dist/editor/changesetLineBreakProvenance.d.ts +26 -0
  567. package/node_modules/@oscharko-dev/keiko-server/dist/editor/changesetLineBreakProvenance.d.ts.map +1 -0
  568. package/node_modules/@oscharko-dev/keiko-server/dist/editor/changesetLineBreakProvenance.js +87 -0
  569. package/node_modules/@oscharko-dev/keiko-server/dist/editor/codingContextProviders.d.ts.map +1 -1
  570. package/node_modules/@oscharko-dev/keiko-server/dist/editor/codingContextProviders.js +0 -3
  571. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecution.d.ts +4 -1
  572. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecution.d.ts.map +1 -1
  573. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecution.js +62 -5
  574. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecutionLog.d.ts +128 -0
  575. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecutionLog.d.ts.map +1 -0
  576. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecutionLog.js +213 -0
  577. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRunner.d.ts.map +1 -1
  578. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRunner.js +68 -24
  579. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRuntimeTarget.d.ts +13 -0
  580. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRuntimeTarget.d.ts.map +1 -0
  581. package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRuntimeTarget.js +121 -0
  582. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts +10 -10
  583. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
  584. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +280 -88
  585. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.d.ts +1 -1
  586. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.d.ts.map +1 -1
  587. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.js +11 -5
  588. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts +15 -2
  589. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  590. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +445 -45
  591. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup-activity.d.ts +31 -0
  592. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup-activity.d.ts.map +1 -0
  593. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup-activity.js +74 -0
  594. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.d.ts +7 -0
  595. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.d.ts.map +1 -0
  596. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.js +282 -0
  597. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.d.ts.map +1 -1
  598. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.js +7 -3
  599. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.d.ts.map +1 -1
  600. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.js +7 -3
  601. package/node_modules/@oscharko-dev/keiko-server/dist/gitPorcelainStatus.d.ts +5 -0
  602. package/node_modules/@oscharko-dev/keiko-server/dist/gitPorcelainStatus.d.ts.map +1 -1
  603. package/node_modules/@oscharko-dev/keiko-server/dist/gitPorcelainStatus.js +46 -0
  604. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-activity.d.ts +19 -0
  605. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-activity.d.ts.map +1 -0
  606. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-activity.js +177 -0
  607. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-assessment.d.ts +7 -0
  608. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-assessment.d.ts.map +1 -0
  609. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-assessment.js +69 -0
  610. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-evidence.d.ts +11 -0
  611. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-evidence.d.ts.map +1 -0
  612. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-evidence.js +53 -0
  613. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-repair.d.ts +25 -0
  614. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-repair.d.ts.map +1 -0
  615. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-repair.js +120 -0
  616. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer.d.ts +56 -2
  617. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer.d.ts.map +1 -1
  618. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer.js +194 -0
  619. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-assistant-referents.d.ts +16 -0
  620. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-assistant-referents.d.ts.map +1 -0
  621. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-assistant-referents.js +133 -0
  622. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-candidate-ordering.d.ts +16 -0
  623. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-candidate-ordering.d.ts.map +1 -0
  624. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-candidate-ordering.js +103 -0
  625. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-capability.d.ts +7 -0
  626. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-capability.d.ts.map +1 -0
  627. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-capability.js +79 -0
  628. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-log.d.ts +22 -4
  629. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-log.d.ts.map +1 -1
  630. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-log.js +112 -11
  631. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-repair.d.ts +4 -0
  632. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-repair.d.ts.map +1 -0
  633. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-repair.js +117 -0
  634. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-context-pack-reranker.d.ts.map +1 -1
  635. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-context-pack-reranker.js +4 -0
  636. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-contextual-fallback.d.ts +10 -0
  637. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-contextual-fallback.d.ts.map +1 -0
  638. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-contextual-fallback.js +41 -0
  639. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-conversation-continuity.d.ts +6 -0
  640. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-conversation-continuity.d.ts.map +1 -1
  641. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-conversation-continuity.js +54 -5
  642. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-diagnostic-references.d.ts +42 -0
  643. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-diagnostic-references.d.ts.map +1 -0
  644. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-diagnostic-references.js +91 -0
  645. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-document-evidence.d.ts +6 -2
  646. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-document-evidence.d.ts.map +1 -1
  647. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-document-evidence.js +61 -8
  648. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-eval-support.d.ts +28 -1
  649. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-eval-support.d.ts.map +1 -1
  650. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-eval-support.js +140 -0
  651. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-evidence-selection.d.ts +9 -1
  652. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-evidence-selection.d.ts.map +1 -1
  653. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-evidence-selection.js +40 -3
  654. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-explicit-paths.d.ts +44 -0
  655. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-explicit-paths.d.ts.map +1 -0
  656. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-explicit-paths.js +385 -0
  657. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness-eval.d.ts +5 -2
  658. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness-eval.d.ts.map +1 -1
  659. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness-eval.js +91 -39
  660. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness.d.ts +43 -4
  661. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness.d.ts.map +1 -1
  662. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness.js +247 -34
  663. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-follow-up.d.ts +27 -0
  664. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-follow-up.d.ts.map +1 -0
  665. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-follow-up.js +198 -0
  666. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-latency-eval.d.ts +16 -2
  667. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-latency-eval.d.ts.map +1 -1
  668. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-latency-eval.js +69 -1
  669. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts +106 -7
  670. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts.map +1 -1
  671. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.js +2618 -376
  672. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-plural-synthesis.d.ts +27 -0
  673. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-plural-synthesis.d.ts.map +1 -0
  674. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-plural-synthesis.js +74 -0
  675. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-preselection-reranker.d.ts +25 -0
  676. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-preselection-reranker.d.ts.map +1 -0
  677. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-preselection-reranker.js +93 -0
  678. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt-context.d.ts +1 -0
  679. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt-context.d.ts.map +1 -1
  680. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.d.ts +7 -0
  681. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.d.ts.map +1 -1
  682. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.js +26 -13
  683. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts +23 -9
  684. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
  685. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +403 -90
  686. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts +31 -8
  687. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts.map +1 -1
  688. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +485 -99
  689. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts +24 -8
  690. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
  691. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +395 -90
  692. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-repo-semantic-search.d.ts +32 -2
  693. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-repo-semantic-search.d.ts.map +1 -1
  694. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-repo-semantic-search.js +370 -48
  695. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts +2 -0
  696. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts.map +1 -1
  697. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.js +22 -1
  698. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank.d.ts +2 -0
  699. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank.d.ts.map +1 -1
  700. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank.js +5 -1
  701. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-retrieval-eval.d.ts +1 -1
  702. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-retrieval-eval.d.ts.map +1 -1
  703. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-retrieval-eval.js +25 -7
  704. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-selection-quality.d.ts +19 -0
  705. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-selection-quality.d.ts.map +1 -0
  706. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-selection-quality.js +55 -0
  707. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-semantic-request.d.ts +31 -0
  708. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-semantic-request.d.ts.map +1 -0
  709. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-semantic-request.js +55 -0
  710. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace-cycles.d.ts +3 -0
  711. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace-cycles.d.ts.map +1 -0
  712. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace-cycles.js +90 -0
  713. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace.d.ts +44 -2
  714. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace.d.ts.map +1 -1
  715. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace.js +1053 -83
  716. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-recency.d.ts +34 -0
  717. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-recency.d.ts.map +1 -0
  718. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-recency.js +190 -0
  719. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-request.d.ts +5 -0
  720. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-request.d.ts.map +1 -0
  721. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-request.js +19 -0
  722. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
  723. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +4 -0
  724. package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.d.ts +1 -1
  725. package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.d.ts.map +1 -1
  726. package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.js +3 -1
  727. package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts.map +1 -1
  728. package/node_modules/@oscharko-dev/keiko-server/dist/server.js +7 -0
  729. package/node_modules/@oscharko-dev/keiko-server/dist/store/chats.d.ts.map +1 -1
  730. package/node_modules/@oscharko-dev/keiko-server/dist/store/chats.js +3 -1
  731. package/node_modules/@oscharko-dev/keiko-server/dist/store/legacySchemaTestFixture.js +2 -2
  732. package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.d.ts +1 -1
  733. package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.d.ts.map +1 -1
  734. package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.js +159 -1
  735. package/node_modules/@oscharko-dev/keiko-server/dist/support-report-routes.d.ts.map +1 -1
  736. package/node_modules/@oscharko-dev/keiko-server/dist/support-report-routes.js +4 -7
  737. package/node_modules/@oscharko-dev/keiko-server/dist/task-workspace/routes.js +3 -3
  738. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolDispatch.d.ts.map +1 -1
  739. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolDispatch.js +2 -2
  740. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.d.ts +20 -4
  741. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.d.ts.map +1 -1
  742. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.js +96 -20
  743. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolPorts.d.ts +2 -0
  744. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolPorts.d.ts.map +1 -1
  745. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.d.ts +2 -2
  746. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.d.ts.map +1 -1
  747. package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.js +47 -3
  748. package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-staging-verification.d.ts +3 -0
  749. package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-staging-verification.d.ts.map +1 -1
  750. package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-staging-verification.js +23 -7
  751. package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-verification.d.ts +3 -0
  752. package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-verification.d.ts.map +1 -1
  753. package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-verification.js +12 -0
  754. package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.js +4 -4
  755. package/node_modules/@oscharko-dev/keiko-server/package.json +23 -23
  756. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/index.d.ts +1 -1
  757. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/index.d.ts.map +1 -1
  758. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/index.js +1 -1
  759. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.d.ts +9 -25
  760. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.d.ts.map +1 -1
  761. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.js +207 -112
  762. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/profile.d.ts.map +1 -1
  763. package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/profile.js +15 -2
  764. package/node_modules/@oscharko-dev/keiko-tool-catalog/package.json +3 -3
  765. package/node_modules/@oscharko-dev/keiko-tools/dist/exec.d.ts.map +1 -1
  766. package/node_modules/@oscharko-dev/keiko-tools/dist/exec.js +44 -5
  767. package/node_modules/@oscharko-dev/keiko-tools/dist/index.d.ts +1 -1
  768. package/node_modules/@oscharko-dev/keiko-tools/dist/index.d.ts.map +1 -1
  769. package/node_modules/@oscharko-dev/keiko-tools/dist/patch-content.d.ts.map +1 -1
  770. package/node_modules/@oscharko-dev/keiko-tools/dist/patch-content.js +142 -49
  771. package/node_modules/@oscharko-dev/keiko-tools/dist/patch-parse.d.ts.map +1 -1
  772. package/node_modules/@oscharko-dev/keiko-tools/dist/patch-parse.js +14 -3
  773. package/node_modules/@oscharko-dev/keiko-tools/dist/patch.d.ts +15 -0
  774. package/node_modules/@oscharko-dev/keiko-tools/dist/patch.d.ts.map +1 -1
  775. package/node_modules/@oscharko-dev/keiko-tools/dist/patch.js +24 -9
  776. package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
  777. package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
  778. package/node_modules/@oscharko-dev/keiko-tools/package.json +7 -7
  779. package/node_modules/@oscharko-dev/keiko-verification/dist/dependencies.d.ts +16 -4
  780. package/node_modules/@oscharko-dev/keiko-verification/dist/dependencies.d.ts.map +1 -1
  781. package/node_modules/@oscharko-dev/keiko-verification/dist/dependencies.js +198 -25
  782. package/node_modules/@oscharko-dev/keiko-verification/dist/failure-location.d.ts +1 -1
  783. package/node_modules/@oscharko-dev/keiko-verification/dist/failure-location.d.ts.map +1 -1
  784. package/node_modules/@oscharko-dev/keiko-verification/dist/failure-location.js +34 -17
  785. package/node_modules/@oscharko-dev/keiko-verification/dist/orchestrator.d.ts +4 -1
  786. package/node_modules/@oscharko-dev/keiko-verification/dist/orchestrator.d.ts.map +1 -1
  787. package/node_modules/@oscharko-dev/keiko-verification/dist/orchestrator.js +32 -2
  788. package/node_modules/@oscharko-dev/keiko-verification/dist/plan.d.ts.map +1 -1
  789. package/node_modules/@oscharko-dev/keiko-verification/dist/plan.js +25 -16
  790. package/node_modules/@oscharko-dev/keiko-verification/dist/targeted-project.d.ts +7 -0
  791. package/node_modules/@oscharko-dev/keiko-verification/dist/targeted-project.d.ts.map +1 -0
  792. package/node_modules/@oscharko-dev/keiko-verification/dist/targeted-project.js +37 -0
  793. package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
  794. package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/failure-parse.d.ts +10 -1
  795. package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/failure-parse.d.ts.map +1 -1
  796. package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/failure-parse.js +93 -15
  797. package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/index.d.ts +1 -1
  798. package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/index.d.ts.map +1 -1
  799. package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/index.js +1 -1
  800. package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/assemble.d.ts.map +1 -1
  801. package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/assemble.js +16 -16
  802. package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/reranker.d.ts +3 -0
  803. package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/reranker.d.ts.map +1 -1
  804. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.d.ts +4 -1
  805. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.d.ts.map +1 -1
  806. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.js +296 -15
  807. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/governor.d.ts.map +1 -1
  808. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts +3 -1
  809. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts.map +1 -1
  810. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.js +1 -0
  811. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts +7 -2
  812. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts.map +1 -1
  813. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.js +85 -5
  814. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts +11 -0
  815. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts.map +1 -1
  816. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.js +507 -32
  817. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/references.d.ts +19 -0
  818. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/references.d.ts.map +1 -0
  819. package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/references.js +159 -0
  820. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/filter.d.ts +1 -0
  821. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/filter.d.ts.map +1 -1
  822. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/filter.js +13 -16
  823. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/index.d.ts +2 -2
  824. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/index.d.ts.map +1 -1
  825. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/index.js +2 -2
  826. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.d.ts.map +1 -1
  827. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.js +21 -4
  828. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/scoring.d.ts +6 -0
  829. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/scoring.d.ts.map +1 -1
  830. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/scoring.js +44 -29
  831. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/signals.d.ts +5 -2
  832. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/signals.d.ts.map +1 -1
  833. package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/signals.js +141 -45
  834. package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
  835. package/node_modules/@oscharko-dev/keiko-workspace/dist/binaryDetect.d.ts.map +1 -1
  836. package/node_modules/@oscharko-dev/keiko-workspace/dist/binaryDetect.js +91 -15
  837. package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligence.d.ts +22 -1
  838. package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligence.d.ts.map +1 -1
  839. package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligence.js +661 -106
  840. package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligenceSurface.d.ts +3 -1
  841. package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligenceSurface.d.ts.map +1 -1
  842. package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligenceSurface.js +3 -1
  843. package/node_modules/@oscharko-dev/keiko-workspace/dist/discovery.d.ts +24 -4
  844. package/node_modules/@oscharko-dev/keiko-workspace/dist/discovery.d.ts.map +1 -1
  845. package/node_modules/@oscharko-dev/keiko-workspace/dist/discovery.js +89 -26
  846. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractAdapter.d.ts.map +1 -1
  847. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractAdapter.js +31 -9
  848. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractGraph.d.ts +3 -2
  849. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractGraph.d.ts.map +1 -1
  850. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractGraph.js +35 -5
  851. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractSource.d.ts +7 -1
  852. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractSource.d.ts.map +1 -1
  853. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractSource.js +40 -7
  854. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractTypes.d.ts +1 -1
  855. package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractTypes.d.ts.map +1 -1
  856. package/node_modules/@oscharko-dev/keiko-workspace/dist/importGraphEdges.d.ts.map +1 -1
  857. package/node_modules/@oscharko-dev/keiko-workspace/dist/importGraphEdges.js +11 -5
  858. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts +8 -3
  859. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts.map +1 -1
  860. package/node_modules/@oscharko-dev/keiko-workspace/dist/index.js +7 -2
  861. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts +26 -5
  862. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts.map +1 -1
  863. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.js +418 -35
  864. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchHtml.d.ts +5 -0
  865. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchHtml.d.ts.map +1 -0
  866. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchHtml.js +21 -0
  867. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchLineSelection.d.ts +2 -1
  868. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchLineSelection.d.ts.map +1 -1
  869. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchLineSelection.js +5 -3
  870. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts +10 -0
  871. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts.map +1 -1
  872. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.js +32 -4
  873. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts +5 -1
  874. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts.map +1 -1
  875. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.js +41 -22
  876. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchQueryTerms.d.ts +14 -0
  877. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchQueryTerms.d.ts.map +1 -1
  878. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchQueryTerms.js +97 -0
  879. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchRoutes.d.ts +11 -0
  880. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchRoutes.d.ts.map +1 -1
  881. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchRoutes.js +154 -18
  882. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts +6 -5
  883. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts.map +1 -1
  884. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.js +88 -24
  885. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchStream.d.ts.map +1 -1
  886. package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchStream.js +21 -14
  887. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapterRequestContext.d.ts +4 -1
  888. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapterRequestContext.d.ts.map +1 -1
  889. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapterRequestContext.js +205 -14
  890. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapters.d.ts +1 -0
  891. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapters.d.ts.map +1 -1
  892. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapters.js +17 -13
  893. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralExecution.d.ts +1 -0
  894. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralExecution.d.ts.map +1 -1
  895. package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralExecution.js +1 -1
  896. package/node_modules/@oscharko-dev/keiko-workspace/dist/symbolGraphLexing.d.ts.map +1 -1
  897. package/node_modules/@oscharko-dev/keiko-workspace/dist/symbolGraphLexing.js +13 -7
  898. package/node_modules/@oscharko-dev/keiko-workspace/dist/testSourcePairing.js +1 -1
  899. package/node_modules/@oscharko-dev/keiko-workspace/dist/types.d.ts +2 -2
  900. package/node_modules/@oscharko-dev/keiko-workspace/dist/types.d.ts.map +1 -1
  901. package/node_modules/@oscharko-dev/keiko-workspace/dist/types.js +1 -1
  902. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
  903. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
  904. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndex.d.ts +13 -5
  905. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndex.d.ts.map +1 -1
  906. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndex.js +112 -42
  907. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexQueryMatch.d.ts +11 -0
  908. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexQueryMatch.d.ts.map +1 -0
  909. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexQueryMatch.js +71 -0
  910. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexStreaming.d.ts +47 -0
  911. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexStreaming.d.ts.map +1 -0
  912. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexStreaming.js +231 -0
  913. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspacePathDiscovery.d.ts +8 -0
  914. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspacePathDiscovery.d.ts.map +1 -0
  915. package/node_modules/@oscharko-dev/keiko-workspace/dist/workspacePathDiscovery.js +178 -0
  916. package/node_modules/@oscharko-dev/keiko-workspace/dist/xmlEntities.d.ts +2 -0
  917. package/node_modules/@oscharko-dev/keiko-workspace/dist/xmlEntities.d.ts.map +1 -0
  918. package/node_modules/@oscharko-dev/keiko-workspace/dist/xmlEntities.js +34 -0
  919. package/node_modules/@oscharko-dev/keiko-workspace/package.json +4 -3
  920. package/package.json +28 -27
  921. package/release-impact.catalog.json +100 -0
  922. package/vendor/oscharko-dev-keiko-activity-log-1.2.1.tgz +0 -0
  923. package/vendor/oscharko-dev-keiko-cli-1.2.1.tgz +0 -0
  924. package/vendor/{oscharko-dev-keiko-connectors-1.2.0.tgz → oscharko-dev-keiko-connectors-1.2.1.tgz} +0 -0
  925. package/vendor/oscharko-dev-keiko-contracts-1.2.1.tgz +0 -0
  926. package/vendor/{oscharko-dev-keiko-evaluations-1.2.0.tgz → oscharko-dev-keiko-evaluations-1.2.1.tgz} +0 -0
  927. package/vendor/oscharko-dev-keiko-evidence-1.2.1.tgz +0 -0
  928. package/vendor/{oscharko-dev-keiko-git-1.2.0.tgz → oscharko-dev-keiko-git-1.2.1.tgz} +0 -0
  929. package/vendor/{oscharko-dev-keiko-harness-1.2.0.tgz → oscharko-dev-keiko-harness-1.2.1.tgz} +0 -0
  930. package/vendor/oscharko-dev-keiko-local-knowledge-1.2.1.tgz +0 -0
  931. package/vendor/{oscharko-dev-keiko-memory-capture-1.2.0.tgz → oscharko-dev-keiko-memory-capture-1.2.1.tgz} +0 -0
  932. package/vendor/{oscharko-dev-keiko-memory-consolidation-1.2.0.tgz → oscharko-dev-keiko-memory-consolidation-1.2.1.tgz} +0 -0
  933. package/vendor/{oscharko-dev-keiko-memory-governance-1.2.0.tgz → oscharko-dev-keiko-memory-governance-1.2.1.tgz} +0 -0
  934. package/vendor/{oscharko-dev-keiko-memory-retrieval-1.2.0.tgz → oscharko-dev-keiko-memory-retrieval-1.2.1.tgz} +0 -0
  935. package/vendor/{oscharko-dev-keiko-memory-vault-1.2.0.tgz → oscharko-dev-keiko-memory-vault-1.2.1.tgz} +0 -0
  936. package/vendor/oscharko-dev-keiko-model-gateway-1.2.1.tgz +0 -0
  937. package/vendor/{oscharko-dev-keiko-quality-intelligence-1.2.0.tgz → oscharko-dev-keiko-quality-intelligence-1.2.1.tgz} +0 -0
  938. package/vendor/oscharko-dev-keiko-sandbox-1.2.1.tgz +0 -0
  939. package/vendor/{oscharko-dev-keiko-sdk-1.2.0.tgz → oscharko-dev-keiko-sdk-1.2.1.tgz} +0 -0
  940. package/vendor/oscharko-dev-keiko-security-1.2.1.tgz +0 -0
  941. package/vendor/oscharko-dev-keiko-server-1.2.1.tgz +0 -0
  942. package/vendor/oscharko-dev-keiko-tool-catalog-1.2.1.tgz +0 -0
  943. package/vendor/oscharko-dev-keiko-tools-1.2.1.tgz +0 -0
  944. package/vendor/oscharko-dev-keiko-verification-1.2.1.tgz +0 -0
  945. package/vendor/oscharko-dev-keiko-workflows-1.2.1.tgz +0 -0
  946. package/vendor/oscharko-dev-keiko-workspace-1.2.1.tgz +0 -0
  947. package/dist/ui/static/_next/static/chunks/07skh7tlpfo1v.js +0 -1
  948. package/dist/ui/static/_next/static/chunks/09i_8713x46yr.js +0 -1
  949. package/dist/ui/static/_next/static/chunks/0a6ri2ug5xf10.js +0 -1
  950. package/dist/ui/static/_next/static/chunks/0bbrrvuzilpy5.js +0 -1
  951. package/dist/ui/static/_next/static/chunks/0bg7uh6tq8-dx.js +0 -1
  952. package/dist/ui/static/_next/static/chunks/0cwy6mtvshbuo.js +0 -1
  953. package/dist/ui/static/_next/static/chunks/0fpbvpzg-omn0.js +0 -1
  954. package/dist/ui/static/_next/static/chunks/0fz9qig_5p73f.js +0 -1
  955. package/dist/ui/static/_next/static/chunks/0hvxxuef1gw9p.js +0 -1
  956. package/dist/ui/static/_next/static/chunks/0ktvc8fs3spkb.js +0 -1
  957. package/dist/ui/static/_next/static/chunks/0kvy_ru-kodgv.js +0 -1
  958. package/dist/ui/static/_next/static/chunks/0parm4c86umwk.js +0 -1
  959. package/dist/ui/static/_next/static/chunks/0q_08tk2d3m2n.js +0 -1
  960. package/dist/ui/static/_next/static/chunks/0r2lwkgws6jm8.js +0 -1
  961. package/dist/ui/static/_next/static/chunks/0t73kckx3olud.js +0 -1
  962. package/dist/ui/static/_next/static/chunks/0u7vyqk91gjb8.js +0 -1
  963. package/dist/ui/static/_next/static/chunks/0weojtwxo6qw7.js +0 -1
  964. package/dist/ui/static/_next/static/chunks/0x-r45yl06rdn.js +0 -1
  965. package/dist/ui/static/_next/static/chunks/0zlw46qz0crxg.css +0 -1
  966. package/dist/ui/static/_next/static/chunks/0zuaq_9l5pma_.js +0 -1
  967. package/dist/ui/static/_next/static/chunks/10kb8j7vggfwk.js +0 -1
  968. package/dist/ui/static/_next/static/chunks/14qdwomthzucj.js +0 -1
  969. package/dist/ui/static/_next/static/chunks/1a7ko-_7t4wjo.js +0 -1
  970. package/dist/ui/static/_next/static/chunks/1czgn62g6km38.js +0 -3
  971. package/dist/ui/static/_next/static/chunks/1juiifi_xnx68.js +0 -1
  972. package/dist/ui/static/_next/static/chunks/1wg1s3jm779ro.js +0 -3
  973. package/dist/ui/static/_next/static/chunks/224bbe_3ksnlw.js +0 -1
  974. package/dist/ui/static/_next/static/chunks/263_uck8el32f.js +0 -1
  975. package/dist/ui/static/_next/static/chunks/26gmn1z4oegqh.js +0 -1
  976. package/dist/ui/static/_next/static/chunks/28ylcw-leje_k.js +0 -1
  977. package/dist/ui/static/_next/static/chunks/2937s9os9u2tn.js +0 -1
  978. package/dist/ui/static/_next/static/chunks/29rlw6dih8owf.js +0 -1
  979. package/dist/ui/static/_next/static/chunks/2hq0zlnvfqol9.js +0 -1
  980. package/dist/ui/static/_next/static/chunks/2o584howfzzak.js +0 -3
  981. package/dist/ui/static/_next/static/chunks/2p66e_a0j23r8.js +0 -1
  982. package/dist/ui/static/_next/static/chunks/2r4vn_6anv2cw.js +0 -5
  983. package/dist/ui/static/_next/static/chunks/2ribv7pn1hr-l.js +0 -1
  984. package/dist/ui/static/_next/static/chunks/2tb2nt2wvu643.js +0 -1
  985. package/dist/ui/static/_next/static/chunks/2yot6vshhc19p.css +0 -1
  986. package/dist/ui/static/_next/static/chunks/30j8jo5v60ga1.js +0 -2
  987. package/dist/ui/static/_next/static/chunks/30q9b_aw8driv.js +0 -1
  988. package/dist/ui/static/_next/static/chunks/387k5c-bf1b2e.js +0 -1
  989. package/dist/ui/static/_next/static/chunks/3_alxp77ewgk_.js +0 -1
  990. package/dist/ui/static/_next/static/chunks/3_ycy0h8pq58a.js +0 -1
  991. package/dist/ui/static/_next/static/chunks/3ho1f5n8lir4r.js +0 -1
  992. package/dist/ui/static/_next/static/chunks/3kgc_j74tblcn.js +0 -1
  993. package/dist/ui/static/_next/static/chunks/3mxpjroefk8ou.js +0 -1
  994. package/dist/ui/static/_next/static/chunks/3q5jidle0lb3-.js +0 -1
  995. package/dist/ui/static/_next/static/chunks/3ua7si017r4dg.js +0 -1
  996. package/dist/ui/static/_next/static/chunks/3v2iluxqnsug9.css +0 -15
  997. package/dist/ui/static/_next/static/chunks/3z5f2s7yd35cu.js +0 -1
  998. package/dist/ui/static/_next/static/chunks/40co1uetczqcs.js +0 -1
  999. package/vendor/oscharko-dev-keiko-activity-log-1.2.0.tgz +0 -0
  1000. package/vendor/oscharko-dev-keiko-cli-1.2.0.tgz +0 -0
  1001. package/vendor/oscharko-dev-keiko-contracts-1.2.0.tgz +0 -0
  1002. package/vendor/oscharko-dev-keiko-evidence-1.2.0.tgz +0 -0
  1003. package/vendor/oscharko-dev-keiko-local-knowledge-1.2.0.tgz +0 -0
  1004. package/vendor/oscharko-dev-keiko-model-gateway-1.2.0.tgz +0 -0
  1005. package/vendor/oscharko-dev-keiko-sandbox-1.2.0.tgz +0 -0
  1006. package/vendor/oscharko-dev-keiko-security-1.2.0.tgz +0 -0
  1007. package/vendor/oscharko-dev-keiko-server-1.2.0.tgz +0 -0
  1008. package/vendor/oscharko-dev-keiko-tool-catalog-1.2.0.tgz +0 -0
  1009. package/vendor/oscharko-dev-keiko-tools-1.2.0.tgz +0 -0
  1010. package/vendor/oscharko-dev-keiko-verification-1.2.0.tgz +0 -0
  1011. package/vendor/oscharko-dev-keiko-workflows-1.2.0.tgz +0 -0
  1012. package/vendor/oscharko-dev-keiko-workspace-1.2.0.tgz +0 -0
  1013. /package/dist/ui/static/_next/static/{LNCY1B2FJBOe2AHFXpzB- → FS1LLJ_p3joZhfRkXBRhf}/_buildManifest.js +0 -0
  1014. /package/dist/ui/static/_next/static/{LNCY1B2FJBOe2AHFXpzB- → FS1LLJ_p3joZhfRkXBRhf}/_clientMiddlewareManifest.js +0 -0
  1015. /package/dist/ui/static/_next/static/{LNCY1B2FJBOe2AHFXpzB- → FS1LLJ_p3joZhfRkXBRhf}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { gatewaySpendRejectionReason } from "./gateway-spend-budget.js";
2
2
  import { CodingRuntimeLaunchRejectedError } from "./coding-runtime/launchFailure.js";
3
- import { AuthenticationError, CancelledError, CircuitOpenError, ContextOverflowError, GatewayError, MalformedToolCallError, ModelRefusalError, ProviderEmptyAnswerError, ProviderError, ProviderOutputExhaustedError, RateLimitError, TimeoutError, TransportError, } from "@oscharko-dev/keiko-security/errors/gateway";
3
+ import { CancelledError, CircuitOpenError, ContextOverflowError, CallerAttemptAdmissionError, GatewayError, MalformedToolCallError, ModelRefusalError, ProviderEmptyAnswerError, ProviderError, ProviderOutputExhaustedError, RateLimitError, TimeoutError, TransportError, } from "@oscharko-dev/keiko-security/errors/gateway";
4
4
  import { createHash, randomUUID } from "node:crypto";
5
5
  import { findConfiguredCapability, resolveCodingSafeSidecarGatewayProfile, ResponseRedactionError, } from "@oscharko-dev/keiko-model-gateway";
6
6
  import { countGatewayPromptTokens, } from "@oscharko-dev/keiko-model-gateway/internal/prompt-token-accounting";
@@ -9,9 +9,9 @@ import { compareStrings } from "@oscharko-dev/keiko-contracts/runtime/comparator
9
9
  import { CODING_WORKBENCH_MINIMUM_CODING_CONTEXT_PROMPT_TOKENS } from "@oscharko-dev/keiko-contracts/runtime/coding-workbench";
10
10
  import { activityLogEvent, defineActivityLogOperation, } from "@oscharko-dev/keiko-contracts/runtime/observability";
11
11
  import { MODEL_REASONING_EFFORTS, validateGatewaySamplingParameters, } from "@oscharko-dev/keiko-contracts/runtime/gateway";
12
- import { currentGateway, currentGatewayConfig, currentGatewayVerification, } from "./deps.js";
12
+ import { currentGateway, currentGatewayConfig, currentGatewayVerification, currentConversationReadinessObservation, } from "./deps.js";
13
13
  import { OPENCODE_RUNTIME_MODEL_ALIAS, OPENCODE_RUNTIME_READINESS_PROMPT, } from "./coding-runtime/opencodeLaunchProfile.js";
14
- import { createOpenCodeGatewayToolCatalogAdvertisement, opencodeGatewayOfferLifetimeMs, hasExactOpenCodeVisibleToolContract, OPENCODE_MODEL_VISIBLE_TOOL_NAMES, } from "./coding-runtime/opencodeToolSchemas.js";
14
+ import { createOpenCodeGatewayToolCatalogAdvertisement, opencodeGatewayOfferLifetimeMs, hasExactOpenCodeVisibleToolContract, openCodeVisibleToolNames, } from "./coding-runtime/opencodeToolSchemas.js";
15
15
  import { correlationIdOrUnknown, UNKNOWN_CORRELATION_ID } from "./correlation.js";
16
16
  import { describeError, emitServerDiagnostic, serverDiagnosticFromError, } from "./diagnostics-log.js";
17
17
  import { readJsonObject } from "./files.js";
@@ -63,13 +63,23 @@ function observedPromptSettlement(outcome, selected, unverified) {
63
63
  * may settle defensively from more than one exit path. Absent `settlePromptTokens` on the injected
64
64
  * authenticator (not every deployment wires it) is a silent no-op, never a failure.
65
65
  */
66
- function settlePromptTokenReservation(deps, reservation, actualPromptTokens) {
66
+ function settlePromptTokenReservation(deps, reservation, actualPromptTokens, discardedPromptTokens = 0) {
67
67
  const providerReported = actualPromptTokens !== undefined && actualPromptTokens > 0;
68
68
  return applyPromptTokenSettlement(deps, reservation, {
69
- promptTokens: providerReported ? actualPromptTokens : reservation.reservedPromptTokens,
69
+ promptTokens: (providerReported ? actualPromptTokens : reservation.reservedPromptTokens) +
70
+ discardedPromptTokens,
70
71
  source: providerReported ? "provider-reported" : "reserved-estimate",
71
72
  });
72
73
  }
74
+ /**
75
+ * The prompt tokens of the attempts the gateway discarded on its way to this answer (#3873 review):
76
+ * a steered repair's first answer, a catalog-rejected tool call, a stream that failed after its
77
+ * usage arrived. The provider processed them, so the run's prompt allowance (ADR-0137 D2, the only
78
+ * default per-run token bound) counts them beside the answer's own prompt.
79
+ */
80
+ function discardedPromptTokens(response) {
81
+ return response.discardedAttemptUsage?.promptTokens ?? 0;
82
+ }
73
83
  /**
74
84
  * Releases a reservation whose provider call never ran — the client would not take the opening
75
85
  * SSE frame, so the buffered path never called the chat factory and the streamed path never pulled
@@ -102,14 +112,16 @@ function applyPromptTokenSettlement(deps, reservation, usage) {
102
112
  reservation.settlement = { ...selected, status: "not-wired" };
103
113
  return reservation.settlement;
104
114
  }
105
- const outcome = authenticator.settlePromptTokens(reservation.capability, reservation.reservedPromptTokens, usage.promptTokens);
115
+ const outcome = reservation.modelCallId === undefined
116
+ ? authenticator.settlePromptTokens(reservation.capability, reservation.reservedPromptTokens, usage.promptTokens)
117
+ : authenticator.settlePromptTokens(reservation.capability, reservation.reservedPromptTokens, usage.promptTokens, reservation.modelCallId);
106
118
  reservation.settlement = observedPromptSettlement(outcome, selected, unverified);
107
119
  return reservation.settlement;
108
120
  }
109
121
  const CODING_SIDECAR_GATEWAY_ERROR_CODE = "CODING_SIDECAR_UNAVAILABLE";
110
122
  const CODING_SIDECAR_GATEWAY_ROUTE = "POST /api/coding-sidecar/gateway/chat/completions";
111
123
  const CODING_SAFE_SIDECAR_GATEWAY_PROFILE_ID = "coding-safe-openai-compatible";
112
- const BUFFERED_STREAM_HEARTBEAT_MS = 5_000;
124
+ const SIDECAR_SSE_HEARTBEAT_MS = 5_000;
113
125
  const OUTPUT_BYTES_PER_TOKEN_LIMIT = 4;
114
126
  // The #2680 live-probe fingerprint (many model requests, zero keiko_* facade calls) becomes
115
127
  // judgeable once the replayed history holds the two system messages, the task prompt, and three
@@ -136,6 +148,12 @@ const CODING_SIDECAR_GATEWAY_REQUEST_VALIDATED_OPERATION = defineActivityLogOper
136
148
  // remains after the prompt — the value an output-exhausted turn has to be read against.
137
149
  maxOutputTokens: { type: "integer", dataClass: "count", required: false },
138
150
  inputMessageCount: { type: "integer", dataClass: "count", required: true },
151
+ offeredToolCount: { type: "integer", dataClass: "count", required: false },
152
+ // #3873 (F23): how many prior assistant messages carried nothing but the reasoning of a turn that
153
+ // already ran and were dropped before the gateway request was built, so the estimate above and
154
+ // `inputMessageCount` describe what is actually sent upstream. A count; the reasoning is never
155
+ // recorded. `required: false` only because a record written before this field existed lacks it.
156
+ droppedReasoningMessageCount: { type: "integer", dataClass: "count", required: false },
139
157
  completeness: { type: "string", dataClass: "completeness-state", required: true },
140
158
  loss: { type: "string", dataClass: "loss-state", required: true },
141
159
  },
@@ -163,8 +181,15 @@ const CODING_SIDECAR_GATEWAY_READINESS_INSUFFICIENT_OPERATION = defineActivityLo
163
181
  "no-tool-calling",
164
182
  "tool-calling-unverified",
165
183
  "model-verification-pending",
184
+ "conversation-not-ready",
166
185
  ],
167
186
  },
187
+ storedReason: {
188
+ type: "string",
189
+ dataClass: "closed-enum",
190
+ required: false,
191
+ values: ["model-context-window-insufficient", "no-tool-calling", "tool-calling-unverified"],
192
+ },
168
193
  inputTokenLimit: { type: "integer", dataClass: "count", required: false },
169
194
  availablePromptTokens: { type: "integer", dataClass: "count", required: false },
170
195
  maxPromptTokens: { type: "integer", dataClass: "count", required: false },
@@ -289,6 +314,24 @@ const CODING_SIDECAR_GATEWAY_REJECTED_OPERATION = defineActivityLogOperation({
289
314
  proofIds: ["coding-sidecar.gateway.rejected.line"],
290
315
  releaseImpact: "patch",
291
316
  });
317
+ // #3873 (F17, F23): the gateway's one steered repair of an answer the model could not use — one that
318
+ // exhausted its output budget, or ended after reasoning without a tool call or any text — on every
319
+ // settlement line of a turn: whether it ran, and how the repaired attempt ended, so an
320
+ // `output-exhausted` or `empty-answer` turn the runtime may not retry names its cause, and a
321
+ // recovered turn shows the repair that saved it. `exhausted-again` and `empty-again` name how the
322
+ // repaired attempt ended (the whole budget spent once more; no text or tool call once more),
323
+ // whichever failure triggered the repair; `gateway.retry.scheduled` names that trigger. `required:
324
+ // false` only because a record written before these fields existed lacks them; every line written
325
+ // since carries `repairAttempted`, and `repairOutcome` whenever a repair ran.
326
+ const OUTPUT_REPAIR_FIELDS = {
327
+ repairAttempted: { type: "boolean", dataClass: "closed-enum", required: false },
328
+ repairOutcome: {
329
+ type: "string",
330
+ dataClass: "closed-enum",
331
+ required: false,
332
+ values: ["recovered", "exhausted-again", "empty-again", "failed"],
333
+ },
334
+ };
292
335
  const CODING_SIDECAR_GATEWAY_TURN_FAILED_OPERATION = defineActivityLogOperation({
293
336
  contractKind: "activity-log-operation",
294
337
  schemaVersion: 1,
@@ -333,13 +376,22 @@ const CODING_SIDECAR_GATEWAY_TURN_FAILED_OPERATION = defineActivityLogOperation(
333
376
  ],
334
377
  },
335
378
  // Whether the answer to the runtime lets it retry the turn: `refused` for a provider rejection
336
- // no retry can change, which the runtime reads as final (lab 2026-09-26).
379
+ // no retry can change, which the runtime reads as final (lab 2026-09-26), and for an exhausted
380
+ // or empty answer whose one steered repair failed the same way again (#3873, F17, F23).
337
381
  runtimeRetry: {
338
382
  type: "string",
339
383
  dataClass: "closed-enum",
340
384
  required: true,
341
385
  values: ["allowed", "refused"],
342
386
  },
387
+ // #3873 review (PR #3876): `provider-failed` names a provider that rejected the turn and one that
388
+ // stayed unavailable alike. `true` marks the second — a retryable provider status (408, 429,
389
+ // 5xx), a rate limit or an open breaker that outlasted the gateway's outage window — so a run
390
+ // that ends on this failure settles `provider-unavailable` and the log shows why. Absent for
391
+ // every other failure; `required: false` because a line written before this field existed
392
+ // lacks it.
393
+ providerUnavailable: { type: "boolean", dataClass: "closed-enum", required: false },
394
+ ...OUTPUT_REPAIR_FIELDS,
343
395
  // The Keiko-code frames and cause classes of the failure, when the turn failed on an error
344
396
  // (PR #3617 review): a model-answer failure writes no error-level diagnostic, so this line is
345
397
  // where its frames live.
@@ -367,6 +419,85 @@ const CODING_SIDECAR_GATEWAY_TURN_FAILED_OPERATION = defineActivityLogOperation(
367
419
  proofIds: ["coding-sidecar.gateway.turn-failed.emitted-line"],
368
420
  releaseImpact: "patch",
369
421
  });
422
+ // #3873 review: while the gateway rides out a provider outage the turn waits silently, and the
423
+ // Workbench's run status read "Waiting for the model" for the whole window. The first retry of an
424
+ // unavailable provider, or the first wait of a call's admission behind the circuit breaker or a
425
+ // provider cooldown, is published to the run's event replay as `model-gateway-retrying` (again when
426
+ // a later frame of the run superseded it while the call kept retrying, which ends the phase on the
427
+ // client), the answer that ends the outage as `model-gateway-recovered`, and a call the run
428
+ // cancelled before either as `model-gateway-retry-stopped`. This line records each publication and
429
+ // whether it reached the replay, so the status the operator saw can be rebuilt from the log. Counts
430
+ // and closed words only: the provider attempt that was retried and the policy it ran under, or the
431
+ // reason the admission was held.
432
+ const CODING_SIDECAR_GATEWAY_RETRY_SURFACED_OPERATION = defineActivityLogOperation({
433
+ contractKind: "activity-log-operation",
434
+ schemaVersion: 1,
435
+ op: "coding-sidecar.gateway.retry-surfaced",
436
+ category: "gateway",
437
+ owner: "keiko-server",
438
+ emitter: "coding-sidecar-gateway.surfaceGatewayRetry",
439
+ fields: {
440
+ runId: { type: "string", dataClass: "opaque-id", required: true, maxLength: 128 },
441
+ revision: { type: "integer", dataClass: "count", required: true },
442
+ state: {
443
+ type: "string",
444
+ dataClass: "closed-enum",
445
+ required: true,
446
+ values: ["running", "paused"],
447
+ },
448
+ // `retry-stopped`: the call was retried or held and ended with neither an answer nor a
449
+ // turn-failure frame, because the run cancelled it (a client that went away, a transport that
450
+ // was cut, the route deadline); no answer recovered the outage and nothing is retrying it now.
451
+ fact: {
452
+ type: "string",
453
+ dataClass: "closed-enum",
454
+ required: true,
455
+ values: ["retrying", "recovered", "retry-stopped"],
456
+ },
457
+ // What the `retrying` fact followed, and the policy the call ran under; only on a `retrying`
458
+ // fact. A retry carries the failed PROVIDER `attempt` it followed, counted from 1: the call's
459
+ // steered repair is not a provider attempt and is not counted, so after a repair this is lower
460
+ // than the `attempt` of the `gateway.retry.scheduled` line of the same retry, which counts every
461
+ // attempt of the call and joins this line on the same correlation id. A call whose admission
462
+ // waited before any attempt of its own carries the `waitReason` that held it instead — the
463
+ // closed reason of the `gateway.circuit.wait` line it joins on — and no attempt.
464
+ attempt: { type: "integer", dataClass: "count", required: false },
465
+ waitReason: {
466
+ type: "string",
467
+ dataClass: "closed-enum",
468
+ required: false,
469
+ values: ["provider-cooldown", "circuit-cooldown", "probe-saturated"],
470
+ },
471
+ retryPolicy: {
472
+ type: "string",
473
+ dataClass: "closed-enum",
474
+ required: false,
475
+ values: ["attempts", "outage-window"],
476
+ },
477
+ published: { type: "boolean", dataClass: "closed-enum", required: true },
478
+ publicationReason: {
479
+ type: "string",
480
+ dataClass: "closed-enum",
481
+ required: true,
482
+ values: [
483
+ "published",
484
+ "event-hub-unavailable",
485
+ "terminal-run",
486
+ "invalid-event",
487
+ "sequence-exhausted",
488
+ "capacity-pressure",
489
+ ],
490
+ },
491
+ completeness: { type: "string", dataClass: "completeness-state", required: true },
492
+ loss: { type: "string", dataClass: "loss-state", required: true },
493
+ },
494
+ causal: "correlation",
495
+ lifecycle: "state",
496
+ analyzerProjection: "timeline",
497
+ failureClasses: ["coding-sidecar-gateway-retry"],
498
+ proofIds: ["coding-sidecar.gateway.retry-surfaced.emitted-line"],
499
+ releaseImpact: "patch",
500
+ });
370
501
  const CODING_SIDECAR_GATEWAY_USAGE_SETTLED_OPERATION = defineActivityLogOperation({
371
502
  contractKind: "activity-log-operation",
372
503
  schemaVersion: 1,
@@ -398,6 +529,22 @@ const CODING_SIDECAR_GATEWAY_USAGE_SETTLED_OPERATION = defineActivityLogOperatio
398
529
  required: true,
399
530
  values: ["provider-reported", "streamed-byte-estimate", "output-byte-estimate"],
400
531
  },
532
+ // #3878: the turn's share of visible text and model reasoning, as counts beside `outputBytes`
533
+ // (answer text, tool calls and structured output together): the UTF-8 size of the answer text,
534
+ // of the reasoning the provider returned (also when it was not forwarded), and the provider's
535
+ // own reasoning-token count when it reports one, never an estimate. Never the text itself.
536
+ // `required: false`: lines written before these fields existed lack them.
537
+ contentBytes: { type: "integer", dataClass: "count", required: false },
538
+ reasoningBytes: { type: "integer", dataClass: "count", required: false },
539
+ reasoningTokens: { type: "integer", dataClass: "count", required: false },
540
+ // #3873 review: the attempts of this turn the gateway discarded on its way to the answer (a
541
+ // steered repair's first answer, a catalog-rejected tool call, a stream that failed after its
542
+ // usage arrived), with their provider-reported tokens. `promptTokens` above already includes
543
+ // the discarded prompt tokens, because the run's allowance counts every prompt the provider
544
+ // processed. Absent when no attempt was discarded with reported usage.
545
+ discardedAttemptCount: { type: "integer", dataClass: "count", required: false },
546
+ discardedPromptTokens: { type: "integer", dataClass: "count", required: false },
547
+ discardedCompletionTokens: { type: "integer", dataClass: "count", required: false },
401
548
  completeness: { type: "string", dataClass: "completeness-state", required: true },
402
549
  loss: { type: "string", dataClass: "loss-state", required: true },
403
550
  },
@@ -425,6 +572,23 @@ const CODING_SIDECAR_GATEWAY_OUTCOME_OPERATION = defineActivityLogOperation({
425
572
  },
426
573
  completionTokens: { type: "integer", dataClass: "count", required: true },
427
574
  outputBytes: { type: "integer", dataClass: "count", required: true },
575
+ // #3878: the frames (or the one buffered answer) that carried model reasoning to the coding
576
+ // runtime; 0 when the answer had none or the reasoning display is off. A count only.
577
+ reasoningFrames: { type: "integer", dataClass: "count", required: false },
578
+ // #3873 review: the UTF-8 bytes of model reasoning the runtime actually received, beside the
579
+ // frames that carried them. `required: false`: lines written before this field existed lack it.
580
+ forwardedReasoningBytes: { type: "integer", dataClass: "count", required: false },
581
+ // #3873 review: on an `output-limit` turn, which byte bound ended it — the answer's or the
582
+ // forwarded reasoning's — so a support analysis can tell the two cuts apart.
583
+ limit: {
584
+ type: "string",
585
+ dataClass: "closed-enum",
586
+ required: false,
587
+ values: ["answer", "reasoning"],
588
+ },
589
+ // #3873 review: a complete buffered answer whose reasoning exceeded the reasoning byte bound is
590
+ // delivered without it rather than refused; `true` says the reasoning was withheld.
591
+ reasoningWithheld: { type: "boolean", dataClass: "closed-enum", required: false },
428
592
  // The route backstop armed for this turn (#3602 review); absent on lines written before 1.1.7.
429
593
  deadlineMs: { type: "integer", dataClass: "duration", required: false },
430
594
  // On a cancelled outcome only: which armed abort source ended the turn, so a stall that ran into
@@ -435,6 +599,7 @@ const CODING_SIDECAR_GATEWAY_OUTCOME_OPERATION = defineActivityLogOperation({
435
599
  required: false,
436
600
  values: ["client-disconnect", "route-deadline", "backpressure-killed", "run-stopped"],
437
601
  },
602
+ ...OUTPUT_REPAIR_FIELDS,
438
603
  completeness: { type: "string", dataClass: "completeness-state", required: true },
439
604
  loss: { type: "string", dataClass: "loss-state", required: true },
440
605
  },
@@ -564,7 +729,8 @@ function pendingChallengeWait(runId, signal, armed, waiters) {
564
729
  signal.addEventListener("abort", abort, { once: true });
565
730
  });
566
731
  }
567
- export function createOpenCodeGatewayReadinessRegistry() {
732
+ export function createOpenCodeGatewayReadinessRegistry(toolProfile = "direct") {
733
+ openCodeVisibleToolNames(toolProfile);
568
734
  const observed = new Set();
569
735
  const armed = new Set();
570
736
  const adoptionGapDiagnosed = new Set();
@@ -573,7 +739,8 @@ export function createOpenCodeGatewayReadinessRegistry() {
573
739
  observed.add(runId);
574
740
  waiters.get(runId)?.(true);
575
741
  };
576
- return {
742
+ return Object.freeze({
743
+ toolProfile,
577
744
  claim: (runId) => {
578
745
  if (!armed.delete(runId))
579
746
  return false;
@@ -609,7 +776,7 @@ export function createOpenCodeGatewayReadinessRegistry() {
609
776
  adoptionGapDiagnosed.delete(runId);
610
777
  waiters.get(runId)?.(false);
611
778
  },
612
- };
779
+ });
613
780
  }
614
781
  function envEnabled(value) {
615
782
  return value !== undefined && ENABLE_TOKENS.has(value.trim().toLowerCase());
@@ -626,14 +793,27 @@ function isCodingSidecarGatewayChatRole(value) {
626
793
  function chatFactoryFor(deps, gateway) {
627
794
  return deps.codingSidecarGatewayChatFactory ?? defaultChatFactoryFor(gateway);
628
795
  }
796
+ // How every model call of a coding turn reaches the gateway, buffered or streamed: under the
797
+ // coding-workbench timeout floors (#3591), the explicit outage policy (#3873), which rides out a
798
+ // gateway overload for the configured `codingOutageWindowMs` instead of failing the autonomous run,
799
+ // and the explicit reasoning delivery (#3878, #3873 F23), which hands the model's reasoning to the
800
+ // Workbench. This route is the only one that sets the last two: an interactive surface that borrows
801
+ // the latency profile for its timeout floors (the commit draft) keeps the fail-fast attempt count
802
+ // and receives its answer without the model's reasoning.
803
+ const CODING_TURN_GATEWAY_POLICY = {
804
+ latencyProfile: "coding-workbench",
805
+ outagePolicy: "outage-window",
806
+ reasoningDelivery: "forward",
807
+ answerRepair: "steered",
808
+ };
629
809
  function defaultChatFactoryFor(gateway) {
630
810
  return (_config, modelId) => {
631
- return (request) => gateway.chat({ ...request, modelId, latencyProfile: "coding-workbench" });
811
+ return (request) => gateway.chat({ ...request, modelId, ...CODING_TURN_GATEWAY_POLICY });
632
812
  };
633
813
  }
634
814
  function defaultChatStreamFactoryFor(gateway) {
635
815
  return (_config, modelId) => {
636
- return (request) => gateway.chatStream({ ...request, modelId, latencyProfile: "coding-workbench" });
816
+ return (request) => gateway.chatStream({ ...request, modelId, ...CODING_TURN_GATEWAY_POLICY });
637
817
  };
638
818
  }
639
819
  function chatStreamFactoryFor(deps, gateway) {
@@ -755,19 +935,67 @@ function parseContinuationToolCall(value) {
755
935
  return undefined;
756
936
  }
757
937
  }
938
+ // The fields an OpenAI-compatible message carries a model's reasoning in. The gateway reads the same
939
+ // two names off a provider's answer (`reasoningText`, keiko-model-gateway normalize.ts), and the
940
+ // sidecar hands reasoning to the runtime as `reasoning_content` (#3878), so a client that echoes an
941
+ // earlier assistant turn's reasoning back sends it under one of them.
942
+ const REASONING_MESSAGE_FIELDS = ["reasoning_content", "reasoning"];
943
+ function carriesReasoning(entry) {
944
+ return REASONING_MESSAGE_FIELDS.some((field) => {
945
+ const reasoning = entry[field];
946
+ return typeof reasoning === "string" && reasoning.length > 0;
947
+ });
948
+ }
949
+ // No answer text: absent, null, blank, or a list of nothing but blank text parts. A part of any other
950
+ // kind is not "no text" — it is left to the content parser, which rejects what it does not accept.
951
+ function hasNoAnswerText(content) {
952
+ if (content === undefined || content === null)
953
+ return true;
954
+ if (typeof content === "string")
955
+ return content.trim().length === 0;
956
+ return (Array.isArray(content) &&
957
+ content.every((part) => isTextContentPart(part) && part.text.trim().length === 0));
958
+ }
959
+ function hasNoToolCalls(toolCalls) {
960
+ return (toolCalls === undefined ||
961
+ toolCalls === null ||
962
+ (Array.isArray(toolCalls) && toolCalls.length === 0));
963
+ }
964
+ /**
965
+ * An assistant message that carries nothing but the reasoning of a turn that already ran (#3873,
966
+ * F23): a reasoning field, no answer text and no tool call. The runtime keeps the reasoning the
967
+ * sidecar forwarded for a turn that then failed in its history and sends that history back with
968
+ * every later request (the live F23 run: about 6,200 prompt tokens and two messages more per failed
969
+ * attempt). Prior reasoning is never resent upstream, so such a message is dropped; the reasoning of
970
+ * a message that also carries text or a tool call is dropped with it by the parser, which copies no
971
+ * reasoning field.
972
+ */
973
+ function isReasoningOnlyAssistantMessage(entry) {
974
+ return (isRecord(entry) &&
975
+ entry.role === "assistant" &&
976
+ carriesReasoning(entry) &&
977
+ hasNoAnswerText(entry.content) &&
978
+ hasNoToolCalls(entry.tool_calls));
979
+ }
758
980
  /**
759
981
  * Distinguishes the two 400 reasons an unusable `messages` array can hand back (#3390): `undefined`
760
982
  * for the array being missing/empty (`body-empty-messages`), a `RouteResult` when entries were
761
983
  * present but at least one was unparsable — `content-part-unsupported` for a recognized-but-closed
762
984
  * content part, `message-shape-invalid` (carrying only the total entry COUNT, never any entry's
763
- * content) for every other malformed shape.
985
+ * content) for every other malformed shape. Reasoning-only assistant messages are dropped and
986
+ * counted (#3873, F23); a history that was nothing else is an empty one.
764
987
  */
765
988
  function parseMessages(value) {
766
989
  if (!Array.isArray(value) || value.length === 0) {
767
990
  return undefined;
768
991
  }
769
992
  const messages = [];
993
+ let droppedReasoningMessageCount = 0;
770
994
  for (const entry of value) {
995
+ if (isReasoningOnlyAssistantMessage(entry)) {
996
+ droppedReasoningMessageCount += 1;
997
+ continue;
998
+ }
771
999
  const parsed = parseMessageEntry(entry);
772
1000
  if (parsed.kind === "content-part-unsupported") {
773
1001
  return badRequest("Request body message content included an unsupported content part.");
@@ -777,7 +1005,7 @@ function parseMessages(value) {
777
1005
  }
778
1006
  messages.push(parsed.value);
779
1007
  }
780
- return messages;
1008
+ return messages.length === 0 ? undefined : { messages, droppedReasoningMessageCount };
781
1009
  }
782
1010
  function badRequest(message) {
783
1011
  return { status: 400, body: errorBody("BAD_REQUEST", message) };
@@ -816,8 +1044,8 @@ function isMatchingModelAlias(model, modelAlias, runtimeAuthenticated) {
816
1044
  : model === undefined || model === modelAlias;
817
1045
  }
818
1046
  function toolCatalogFor(tools, offer) {
819
- return isExactManagedToolSet(tools)
820
- ? createOpenCodeGatewayToolCatalogAdvertisement(Date.now(), offer.coverage, offer.offerLifetimeMs)
1047
+ return isExactManagedToolSet(tools, offer.toolProfile)
1048
+ ? createOpenCodeGatewayToolCatalogAdvertisement(Date.now(), offer.coverage, offer.offerLifetimeMs, offer.toolProfile)
821
1049
  : undefined;
822
1050
  }
823
1051
  function toolRequestFields(parsed, offer) {
@@ -856,7 +1084,7 @@ function resolveToolCatalogHandlerCoverage(deps, runId, correlationId) {
856
1084
  const offeredOptionalTools = [...OPENCODE_OPTIONAL_TOOL_NAMES]
857
1085
  .filter((name) => !unavailable.has(name))
858
1086
  .sort(compareStrings);
859
- const coverage = createCanonicalOpenCodeHandlerCoverage(unavailable);
1087
+ const coverage = createCanonicalOpenCodeHandlerCoverage(unavailable, gatewayReadinessRegistry(deps)?.toolProfile ?? "direct");
860
1088
  getServerLogger().info(activityLogEvent(CODING_SIDECAR_GATEWAY_TOOL_AVAILABILITY_OPERATION, { correlationId: correlationIdOrUnknown(correlationId) }, {
861
1089
  runId,
862
1090
  handlerSetDigest: coverage.handlerSetDigest,
@@ -883,12 +1111,12 @@ function buildChatRequest(parsed, modelAlias, cancellationSignal, maxOutputToken
883
1111
  };
884
1112
  }
885
1113
  function parseChatRequest(body) {
886
- const messages = parseMessages(body.messages);
887
- if (messages === undefined) {
1114
+ const parsedMessages = parseMessages(body.messages);
1115
+ if (parsedMessages === undefined) {
888
1116
  return undefined;
889
1117
  }
890
- if (isRouteResult(messages)) {
891
- return messages;
1118
+ if (isRouteResult(parsedMessages)) {
1119
+ return parsedMessages;
892
1120
  }
893
1121
  const tools = parseTools(body.tools);
894
1122
  if (isRouteResult(tools)) {
@@ -896,7 +1124,8 @@ function parseChatRequest(body) {
896
1124
  }
897
1125
  return {
898
1126
  ...(typeof body.model === "string" && body.model.length > 0 ? { model: body.model } : {}),
899
- messages,
1127
+ messages: parsedMessages.messages,
1128
+ droppedReasoningMessageCount: parsedMessages.droppedReasoningMessageCount,
900
1129
  ...(tools === undefined ? {} : { tools }),
901
1130
  ...(typeof body.stream === "boolean" ? { stream: body.stream } : {}),
902
1131
  ...(typeof body.temperature === "number" ? { temperature: body.temperature } : {}),
@@ -917,6 +1146,8 @@ function openAiResponse(modelId, response) {
917
1146
  message: {
918
1147
  role: "assistant",
919
1148
  content: response.content,
1149
+ // #3878: the field OpenCode's OpenAI-compatible provider reads as a reasoning part.
1150
+ ...(response.reasoning === undefined ? {} : { reasoning_content: response.reasoning }),
920
1151
  ...(response.toolCalls.length === 0
921
1152
  ? {}
922
1153
  : { tool_calls: openAiToolCalls(response.toolCalls) }),
@@ -995,14 +1226,45 @@ function gatewayOutcomeCancellationCause(cancellation, outcome) {
995
1226
  return undefined;
996
1227
  return { cancellationCause: cancellation.cause() ?? "client-disconnect" };
997
1228
  }
998
- function recordGatewayOutcome(ctx, deps, runId, cancellation, outcome, completionTokens, outputBytes) {
1229
+ const NO_GATEWAY_OUTPUT = {
1230
+ completionTokens: 0,
1231
+ outputBytes: 0,
1232
+ reasoningFrames: 0,
1233
+ forwardedReasoningBytes: 0,
1234
+ };
1235
+ const REPAIR_NOT_SETTLED = { settled: false };
1236
+ function settledRepair(outcome) {
1237
+ return { settled: true, outcome };
1238
+ }
1239
+ // The gateway's one steered repair of an exhausted or empty answer (#3873, F17, F23), read off what
1240
+ // the call settled with: `recovered` rides on the response (`NormalizedResponse.outputRepair`), the
1241
+ // failures on the error the repaired attempt surfaced. Absent when no repair ran.
1242
+ function outputRepairOf(error) {
1243
+ return error instanceof GatewayError ? error.outputRepair : undefined;
1244
+ }
1245
+ function repairEvidence(evidence) {
1246
+ if (!evidence.settled)
1247
+ return {};
1248
+ const { outcome } = evidence;
1249
+ return {
1250
+ repairAttempted: outcome !== undefined,
1251
+ ...(outcome === undefined ? {} : { repairOutcome: outcome }),
1252
+ };
1253
+ }
1254
+ function recordGatewayOutcome(ctx, deps, runId, cancellation, outcome, metrics, repair) {
1255
+ const { completionTokens, outputBytes } = metrics;
999
1256
  getServerLogger().info(activityLogEvent(CODING_SIDECAR_GATEWAY_OUTCOME_OPERATION, { correlationId: correlationIdOrUnknown(ctx.correlationId), parentCorrelationId: runId }, {
1000
1257
  runId,
1001
1258
  outcome,
1002
1259
  completionTokens,
1003
1260
  outputBytes,
1261
+ reasoningFrames: metrics.reasoningFrames,
1262
+ forwardedReasoningBytes: metrics.forwardedReasoningBytes,
1263
+ ...(metrics.limit === undefined ? {} : { limit: metrics.limit }),
1264
+ ...(metrics.reasoningWithheld === undefined ? {} : { reasoningWithheld: true }),
1004
1265
  deadlineMs: cancellation.deadlineMs,
1005
1266
  ...gatewayOutcomeCancellationCause(cancellation, outcome),
1267
+ ...repairEvidence(repair),
1006
1268
  completeness: "complete",
1007
1269
  loss: "none",
1008
1270
  }));
@@ -1136,7 +1398,10 @@ function gatewayDiagnosticCorrelation(ctx, runId) {
1136
1398
  // ran out, or a tool call that never parsed or matched its schema -- is the model's answer, not a
1137
1399
  // server fault: the warn-level turn-failed line names it. An error-level diagnostic opened a support
1138
1400
  // incident for every such turn; a lab run of the 1.1.8 candidate behind a LiteLLM hosted_vllm route
1139
- // opened one on its first empty answer.
1401
+ // opened one on its first empty answer. The runtime may retry these, with one exception: an
1402
+ // exhausted or empty answer whose steered gateway repair failed the same way again is answered as
1403
+ // final (`runtimeRetryFor`, #3873 F17, F23) — the identical turn ran away identically, and a third
1404
+ // attempt would only burn the envelope's duration.
1140
1405
  const MODEL_ANSWER_FAILURES = new Set([
1141
1406
  "output-exhausted",
1142
1407
  "empty-answer",
@@ -1170,9 +1435,10 @@ function reportGatewayTurnFailure(ctx, deps, runId, failure) {
1170
1435
  const snapshot = deps.codingRuntimeOrchestrator?.getSnapshot(runId);
1171
1436
  if (snapshot?.state !== "running" && snapshot?.state !== "paused")
1172
1437
  return false;
1173
- const publicationReason = gatewayTurnFailurePublication(deps, runId, snapshot, failureCode);
1438
+ const providerUnavailable = failureCode === "provider-failed" && providerUnavailableFault(error);
1439
+ const publicationReason = gatewayTurnFailurePublication(deps, runId, snapshot, failureCode, providerUnavailable);
1174
1440
  const run = { revision: snapshot.revision, state: snapshot.state };
1175
- logGatewayTurnFailure(ctx, runId, run, failureCode, { publicationReason, runtimeRetry }, error);
1441
+ logGatewayTurnFailure(ctx, runId, run, failureCode, { publicationReason, runtimeRetry, providerUnavailable }, error);
1176
1442
  return true;
1177
1443
  }
1178
1444
  /** A turn the gateway refused itself, with no error: its answer's status decides the retry. */
@@ -1182,12 +1448,117 @@ function reportGatewayTurnRejection(ctx, deps, runId, answer) {
1182
1448
  runtimeRetry: runtimeRetryForStatus(answer.status),
1183
1449
  });
1184
1450
  }
1185
- function gatewayTurnFailurePublication(deps, runId, snapshot, failureCode) {
1186
- const publication = deps.codingRuntimeEventHub?.publishTurnFailure(runId, snapshot.state, snapshot.revision, failureCode);
1451
+ function gatewayTurnFailurePublication(deps, runId, snapshot, failureCode, providerUnavailable) {
1452
+ const publication = deps.codingRuntimeEventHub?.publishTurnFailure(runId, snapshot.state, snapshot.revision, failureCode, { providerUnavailable });
1187
1453
  const publicationReason = publication?.ok === true ? "published" : (publication?.reason ?? "event-hub-unavailable");
1188
1454
  return publicationReason;
1189
1455
  }
1190
- function logGatewayTurnFailure(ctx, runId, { revision, state }, failureCode, { publicationReason, runtimeRetry, }, error) {
1456
+ function gatewayRetryTrace(ctx, deps, runId) {
1457
+ // True from the moment this call's `retrying` fact reached the replay until its answer or its end
1458
+ // closes it. A failed call stays open: its turn-failure frame, or `end`, decides what closes it.
1459
+ let open = false;
1460
+ const retryingShown = () => deps.codingRuntimeEventHub?.modelGatewayRetrying(runId) === true;
1461
+ const hear = (notice) => {
1462
+ if (notice.kind === "settled") {
1463
+ if (open && notice.outcome === "answered") {
1464
+ open = false;
1465
+ surfaceGatewayRetry(ctx, deps, runId, "recovered");
1466
+ }
1467
+ return;
1468
+ }
1469
+ if (open && retryingShown())
1470
+ return;
1471
+ if (surfaceGatewayRetry(ctx, deps, runId, "retrying", notice))
1472
+ open = true;
1473
+ };
1474
+ const finish = () => {
1475
+ if (!open)
1476
+ return;
1477
+ open = false;
1478
+ if (retryingShown())
1479
+ surfaceGatewayRetry(ctx, deps, runId, "retry-stopped");
1480
+ };
1481
+ return {
1482
+ observer: (notice) => {
1483
+ runRetryTraceStep(ctx, deps, runId, () => {
1484
+ hear(notice);
1485
+ });
1486
+ },
1487
+ end: () => {
1488
+ runRetryTraceStep(ctx, deps, runId, finish);
1489
+ },
1490
+ };
1491
+ }
1492
+ // Runs one step of the trace; a failure of the step goes to the operator diagnostic and nowhere else.
1493
+ function runRetryTraceStep(ctx, deps, runId, step) {
1494
+ try {
1495
+ step();
1496
+ }
1497
+ catch (error) {
1498
+ emitServerDiagnostic(deps.diagnostics, serverDiagnosticFromError({
1499
+ ...gatewayDiagnosticCorrelation(ctx, runId),
1500
+ operation: CODING_SIDECAR_GATEWAY_ROUTE,
1501
+ source: "coding-sidecar-gateway.retry-observer",
1502
+ error,
1503
+ redact: (message) => String(deps.redactor(message)),
1504
+ }));
1505
+ }
1506
+ }
1507
+ // The event kind each fact is published as.
1508
+ const GATEWAY_FACT_EVENT_KINDS = {
1509
+ retrying: "model-gateway-retrying",
1510
+ recovered: "model-gateway-recovered",
1511
+ "retry-stopped": "model-gateway-retry-stopped",
1512
+ };
1513
+ // The run's state while it can still show a status: running or paused. Any other run (stopping,
1514
+ // settled, unknown) has none, and the gateway's own retry line is its record.
1515
+ function liveRunSnapshot(deps, runId) {
1516
+ const snapshot = deps.codingRuntimeOrchestrator?.getSnapshot(runId);
1517
+ if (snapshot?.state !== "running" && snapshot?.state !== "paused")
1518
+ return undefined;
1519
+ return { state: snapshot.state, revision: snapshot.revision };
1520
+ }
1521
+ function publishGatewayRetryFact(deps, runId, run, fact) {
1522
+ const publication = deps.codingRuntimeEventHub?.publishModelGatewayFact(runId, run.state, run.revision, GATEWAY_FACT_EVENT_KINDS[fact]);
1523
+ return publication?.ok === true ? "published" : (publication?.reason ?? "event-hub-unavailable");
1524
+ }
1525
+ // The body-free fields the fact's line records for its cause: the failed attempt of a retry, or the
1526
+ // reason an admission was held, and the policy the call ran under either way.
1527
+ function gatewayRetryCauseFields(cause) {
1528
+ return cause.kind === "scheduled"
1529
+ ? { attempt: cause.attempt, retryPolicy: cause.retryPolicy }
1530
+ : { waitReason: cause.reason, retryPolicy: cause.retryPolicy };
1531
+ }
1532
+ // Publishes the fact to the run's event replay and records the publication. True when the replay
1533
+ // took the frame; a run that has no status to show (not live) and a refused publication are both
1534
+ // false, so the caller never counts a fact the Workbench cannot see as shown.
1535
+ function surfaceGatewayRetry(ctx, deps, runId, fact, cause) {
1536
+ const run = liveRunSnapshot(deps, runId);
1537
+ if (run === undefined)
1538
+ return false;
1539
+ const publicationReason = publishGatewayRetryFact(deps, runId, run, fact);
1540
+ const published = publicationReason === "published";
1541
+ const event = activityLogEvent(CODING_SIDECAR_GATEWAY_RETRY_SURFACED_OPERATION, {
1542
+ ...gatewayDiagnosticCorrelation(ctx, runId),
1543
+ ...(published ? {} : { errorKind: "unavailable" }),
1544
+ }, {
1545
+ runId,
1546
+ revision: run.revision,
1547
+ state: run.state,
1548
+ fact,
1549
+ ...(cause === undefined ? {} : gatewayRetryCauseFields(cause)),
1550
+ published,
1551
+ publicationReason,
1552
+ completeness: "complete",
1553
+ loss: "none",
1554
+ });
1555
+ if (published)
1556
+ getServerLogger().info(event);
1557
+ else
1558
+ getServerLogger().warn(event);
1559
+ return published;
1560
+ }
1561
+ function logGatewayTurnFailure(ctx, runId, { revision, state }, failureCode, { publicationReason, runtimeRetry, providerUnavailable, }, error) {
1191
1562
  const { frames, causeChain } = describeError(error);
1192
1563
  getServerLogger().warn(activityLogEvent(CODING_SIDECAR_GATEWAY_TURN_FAILED_OPERATION, {
1193
1564
  ...gatewayDiagnosticCorrelation(ctx, runId),
@@ -1200,6 +1571,11 @@ function logGatewayTurnFailure(ctx, runId, { revision, state }, failureCode, { p
1200
1571
  published: publicationReason === "published",
1201
1572
  publicationReason,
1202
1573
  runtimeRetry,
1574
+ // Present only when the provider could not serve the call (a retryable status, a rate limit,
1575
+ // an open breaker): the fact a run that ends on this failure settles `provider-unavailable`.
1576
+ ...(providerUnavailable ? { providerUnavailable } : {}),
1577
+ // The turn failed with a settled gateway error, which says whether a repair ran.
1578
+ ...repairEvidence(settledRepair(outputRepairOf(error))),
1203
1579
  ...(error === undefined || frames === undefined ? {} : { frames }),
1204
1580
  ...(error === undefined || causeChain === undefined ? {} : { causeChain }),
1205
1581
  completeness: "complete",
@@ -1214,6 +1590,7 @@ function modelTurnFailureCode(error) {
1214
1590
  // its error-level diagnostic (PR #3617 review). It extends MalformedToolCallError, so it is named
1215
1591
  // before that check.
1216
1592
  if (error instanceof ContextOverflowError ||
1593
+ error instanceof CallerAttemptAdmissionError ||
1217
1594
  error instanceof ModelRefusalError ||
1218
1595
  error instanceof ResponseRedactionError)
1219
1596
  return "turn-rejected";
@@ -1225,28 +1602,46 @@ function modelTurnFailureCode(error) {
1225
1602
  return "invalid-tool-call";
1226
1603
  return undefined;
1227
1604
  }
1605
+ // A gateway error that says the call stopped answering rather than that it was refused: a timeout, a
1606
+ // refused or dropped connection, a stream that ended without its terminal answer (HTTP 200).
1607
+ function isStreamInterruption(error) {
1608
+ return (error instanceof TimeoutError ||
1609
+ error instanceof TransportError ||
1610
+ (error instanceof ProviderError && error.httpStatus === 200));
1611
+ }
1228
1612
  function gatewayTurnFailureCode(error) {
1229
1613
  const modelCause = modelTurnFailureCode(error);
1230
1614
  if (modelCause !== undefined)
1231
1615
  return modelCause;
1232
- if (error instanceof TimeoutError ||
1233
- error instanceof TransportError ||
1234
- (error instanceof ProviderError && error.httpStatus === 200))
1235
- return "stream-incomplete";
1236
- return "provider-failed";
1237
- }
1616
+ return isStreamInterruption(error) ? "stream-incomplete" : "provider-failed";
1617
+ }
1618
+ // The streamed path names `stream-incomplete` only for a call that stopped answering: an
1619
+ // interruption, or a failure that is no gateway error at all (a decoder or socket fault inside the
1620
+ // stream). Every other gateway error — a refused credential, a configuration or egress refusal, an
1621
+ // unknown model, a provider status — is named `provider-failed`, as the buffered path always named
1622
+ // it. Before (#3873 review, PR #3876) the default bucket was `stream-incomplete`, so a configuration
1623
+ // or egress error that reached the stream settled the whole run `provider-unavailable`: "nothing was
1624
+ // rejected, check that the gateway is running".
1238
1625
  function gatewayStreamFailureCode(error) {
1239
1626
  if (gatewaySpendRejectionReason(error) !== undefined)
1240
1627
  return "turn-rejected";
1241
1628
  const modelCause = modelTurnFailureCode(error);
1242
1629
  if (modelCause !== undefined)
1243
1630
  return modelCause;
1244
- if (error instanceof AuthenticationError ||
1245
- error instanceof RateLimitError ||
1246
- error instanceof CircuitOpenError ||
1247
- (error instanceof ProviderError && error.httpStatus !== 200))
1248
- return "provider-failed";
1249
- return "stream-incomplete";
1631
+ return error instanceof GatewayError && !isStreamInterruption(error)
1632
+ ? "provider-failed"
1633
+ : "stream-incomplete";
1634
+ }
1635
+ // Whether the provider could not serve the call, as opposed to rejecting it: a retryable provider
1636
+ // status (408, 429, 5xx), a rate limit or an open breaker. `provider-failed` names both alike, and
1637
+ // the gateway has by now retried through its outage window, so such a failure means the provider
1638
+ // stayed unavailable (#3873 review, F10). Positively identified from the error, never inferred from
1639
+ // the turn-failure bucket; an output-exhausted or empty answer is an HTTP 200 and never one.
1640
+ function providerUnavailableFault(error) {
1641
+ if (error instanceof RateLimitError || error instanceof CircuitOpenError)
1642
+ return true;
1643
+ return (error instanceof ProviderError &&
1644
+ (error.httpStatus === 408 || error.httpStatus === 429 || error.httpStatus >= 500));
1250
1645
  }
1251
1646
  // A rejection no retry can change — a provider 4xx other than 408/409/429, a refused credential, an
1252
1647
  // invalid configuration, an exhausted spend budget — which the gateway's own retry policy already
@@ -1256,13 +1651,36 @@ function gatewayStreamFailureCode(error) {
1256
1651
  function runtimeRetryFor(error, failureCode) {
1257
1652
  if (gatewaySpendRejectionReason(error) !== undefined)
1258
1653
  return "refused";
1259
- const final = failureCode === "provider-failed" &&
1654
+ if (repairFailedAgain(error, failureCode))
1655
+ return "refused";
1656
+ // The gateway already owns bounded schema/transport correction. Repeating the identical
1657
+ // malformed turn in OpenCode adds no correction and can loop without an attempt limit.
1658
+ if (failureCode === "invalid-tool-call")
1659
+ return "refused";
1660
+ return isFinalProviderRejection(error, failureCode) ? "refused" : "allowed";
1661
+ }
1662
+ // How the repaired attempt of each model-answer failure ends when the model fails that way again.
1663
+ const REPAIRED_ANSWER_FAILED_AGAIN = new Map([
1664
+ ["output-exhausted", "exhausted-again"],
1665
+ ["empty-answer", "empty-again"],
1666
+ ]);
1667
+ // #3873 (F17, F23): the gateway already steered the one repair an exhausted or empty answer gets,
1668
+ // and the model failed the same way again. A runtime retry of the identical turn would run away
1669
+ // identically (run 324076066246415201273338647160811469441: three seven-minute attempts, no
1670
+ // progress; run 74202984158312182524609898190850427735: seven attempts that each ended empty after
1671
+ // reasoning), so the turn is final. A first failure the call's budget could not repair, and a
1672
+ // repair that failed for another reason, stay retryable.
1673
+ function repairFailedAgain(error, failureCode) {
1674
+ const again = REPAIRED_ANSWER_FAILED_AGAIN.get(failureCode);
1675
+ return again !== undefined && outputRepairOf(error) === again;
1676
+ }
1677
+ function isFinalProviderRejection(error, failureCode) {
1678
+ return (failureCode === "provider-failed" &&
1260
1679
  error instanceof GatewayError &&
1261
1680
  !error.retryable &&
1262
1681
  !(error instanceof CircuitOpenError) &&
1263
1682
  !(error instanceof CancelledError) &&
1264
- !(error instanceof ProviderError && runtimeRetriesStatus(error.httpStatus));
1265
- return final ? "refused" : "allowed";
1683
+ !(error instanceof ProviderError && runtimeRetriesStatus(error.httpStatus)));
1266
1684
  }
1267
1685
  // The provider statuses OpenCode 2.0.10 retries on its own (408, 409, 429, 5xx): a rejection with one
1268
1686
  // of them is no verdict on the turn, whatever Keiko's own retry policy did with it (PR #3625 review:
@@ -1343,6 +1761,15 @@ function promptReservationRunId(value) {
1343
1761
  return undefined;
1344
1762
  return typeof value.runId === "string" && value.runId.length > 0 ? value.runId : undefined;
1345
1763
  }
1764
+ // The identity an admitted reservation answers beside its run, when it answers one: a safe integer
1765
+ // the settlement hands back verbatim. Anything else is no identity, and the call is then untracked.
1766
+ function promptReservationModelCallId(value) {
1767
+ if (!isRecord(value) || value.ok !== true)
1768
+ return undefined;
1769
+ return typeof value.modelCallId === "number" && Number.isSafeInteger(value.modelCallId)
1770
+ ? value.modelCallId
1771
+ : undefined;
1772
+ }
1346
1773
  function gatewayReadinessRegistry(deps) {
1347
1774
  return deps.openCodeGatewayReadinessRegistry;
1348
1775
  }
@@ -1356,11 +1783,12 @@ function bearerCapability(ctx) {
1356
1783
  const capability = value.slice("Bearer ".length);
1357
1784
  return capability.length > 0 ? capability : undefined;
1358
1785
  }
1359
- function isExactManagedToolSet(tools) {
1360
- return hasExactOpenCodeVisibleToolContract(tools);
1786
+ function isExactManagedToolSet(tools, profile = "direct") {
1787
+ return hasExactOpenCodeVisibleToolContract(tools, profile);
1361
1788
  }
1362
1789
  function isAdmittedManagedToolSet(tools, registry, runId) {
1363
- return (isExactManagedToolSet(tools) || (tools === undefined && registry?.isVerified(runId) === true));
1790
+ return (isExactManagedToolSet(tools, registry?.toolProfile ?? "direct") ||
1791
+ (tools === undefined && registry?.isVerified(runId) === true));
1364
1792
  }
1365
1793
  function isRuntimeReadinessProbe(parsed) {
1366
1794
  const readiness = parsed.messages.at(-1);
@@ -1388,8 +1816,8 @@ function toolNameSetDigest(names) {
1388
1816
  hash.update(`${String(name.length)}:${name}`);
1389
1817
  return hash.digest("hex");
1390
1818
  }
1391
- function toolContractMismatch(tools) {
1392
- const expected = new Set(OPENCODE_MODEL_VISIBLE_TOOL_NAMES);
1819
+ function toolContractMismatch(tools, profile) {
1820
+ const expected = new Set(openCodeVisibleToolNames(profile));
1393
1821
  const received = new Set(tools?.map((tool) => tool.name) ?? []);
1394
1822
  const unexpected = [...received].filter((name) => !expected.has(name));
1395
1823
  const missing = [...expected].filter((name) => !received.has(name));
@@ -1415,7 +1843,7 @@ function refuseGatewayToolContract(ctx, deps, runId, parsed) {
1415
1843
  code,
1416
1844
  });
1417
1845
  const answer = forbiddenGatewayRequest();
1418
- logGatewayRejection(ctx, runId, answer.status, reason, toolContractMismatch(tools));
1846
+ logGatewayRejection(ctx, runId, answer.status, reason, toolContractMismatch(tools, gatewayReadinessRegistry(deps)?.toolProfile ?? "direct"));
1419
1847
  refuseReadinessChallenge(deps, runId, parsed);
1420
1848
  reportGatewayTurnRejection(ctx, deps, runId, answer);
1421
1849
  return answer;
@@ -1527,9 +1955,15 @@ function isRuntimeTransportProfileId(modelProfileId) {
1527
1955
  }
1528
1956
  function reserveGatewayPromptBudget(deps, capability, runId, reservedPromptTokens) {
1529
1957
  const reserved = runtimeCapabilityAuthenticator(deps)?.reservePromptTokens?.(capability, reservedPromptTokens);
1530
- return promptReservationRunId(reserved) === runId
1531
- ? { capability, reservedPromptTokens, settled: false }
1532
- : undefined;
1958
+ if (promptReservationRunId(reserved) !== runId)
1959
+ return undefined;
1960
+ const modelCallId = promptReservationModelCallId(reserved);
1961
+ return {
1962
+ capability,
1963
+ reservedPromptTokens,
1964
+ ...(modelCallId === undefined ? {} : { modelCallId }),
1965
+ settled: false,
1966
+ };
1533
1967
  }
1534
1968
  function isAvailableGatewayProfile(resolved) {
1535
1969
  return (resolved.result.status === "available" &&
@@ -1612,8 +2046,9 @@ function gatewayCancellationCause(signal, sources) {
1612
2046
  // run (coding run 23, 2026-09-11).
1613
2047
  export function codingSidecarGatewayRequestDeadlineMs(config, modelId) {
1614
2048
  // The sidecar reaches the gateway both ways — a buffered `chat()` answer or a `chatStream()`
1615
- // read — so its backstop sits behind the longer of the two budgets.
1616
- return gatewayRouteDeadlineMs(config, modelId, ["buffered", "streamed"]);
2049
+ // read — so its backstop sits behind the longer of the two budgets, each extended by the outage
2050
+ // window these calls ride out (#3873 review): the route must not cut the configured window short.
2051
+ return gatewayRouteDeadlineMs(config, modelId, ["buffered", "streamed"], CODING_TURN_GATEWAY_POLICY.outagePolicy);
1617
2052
  }
1618
2053
  function gatewayRequestCancellation(ctx, deps, config, modelId, runId) {
1619
2054
  const client = new AbortController();
@@ -1640,8 +2075,15 @@ function gatewayRequestCancellation(ctx, deps, config, modelId, runId) {
1640
2075
  },
1641
2076
  };
1642
2077
  }
1643
- function requestForGatewayDelivery(ctx, parsed, delivery, signal) {
1644
- return buildChatRequest(parsed, delivery.modelAlias, signal, delivery.maxOutputTokens, ctx.correlationId, delivery.reasoningEffort, { coverage: delivery.toolCatalogCoverage, offerLifetimeMs: delivery.offerLifetimeMs });
2078
+ function requestForGatewayDelivery(ctx, parsed, delivery, signal, retryObserver) {
2079
+ return {
2080
+ ...buildChatRequest(parsed, delivery.modelAlias, signal, delivery.maxOutputTokens, ctx.correlationId, delivery.reasoningEffort, {
2081
+ coverage: delivery.toolCatalogCoverage,
2082
+ offerLifetimeMs: delivery.offerLifetimeMs,
2083
+ toolProfile: delivery.toolProfile,
2084
+ }),
2085
+ retryObserver,
2086
+ };
1645
2087
  }
1646
2088
  async function executeGatewayChat(ctx, deps, binding, parsed, runId, delivery) {
1647
2089
  const cancellation = gatewayRequestCancellation(ctx, deps, binding.config, delivery.modelAlias, runId);
@@ -1655,7 +2097,8 @@ async function executeGatewayChat(ctx, deps, binding, parsed, runId, delivery) {
1655
2097
  // Extracted so `executeGatewayChat` stays under AGENTS.md §6's 50-line ceiling.
1656
2098
  async function dispatchGatewayChat(ctx, deps, binding, parsed, runId, delivery, cancellation) {
1657
2099
  const { modelAlias, upstreamStreamingSupported } = delivery;
1658
- const request = requestForGatewayDelivery(ctx, parsed, delivery, cancellation.signal);
2100
+ const retries = gatewayRetryTrace(ctx, deps, runId);
2101
+ const request = requestForGatewayDelivery(ctx, parsed, delivery, cancellation.signal, retries.observer);
1659
2102
  const dispatch = {
1660
2103
  deps,
1661
2104
  binding,
@@ -1680,13 +2123,19 @@ async function dispatchGatewayChat(ctx, deps, binding, parsed, runId, delivery,
1680
2123
  catch (error) {
1681
2124
  return settleFailedGatewayChat(ctx, deps, runId, cancellation, error, delivery, bufferedStream);
1682
2125
  }
2126
+ finally {
2127
+ // After the answer, or the failure frame, has been settled: what is still the newest frame is
2128
+ // a retrying fact nothing closed.
2129
+ retries.end();
2130
+ }
1683
2131
  }
1684
2132
  // The opening frame never reached the client — the shared path killed the stream, or the response
1685
2133
  // was already gone — so no provider call is started for an answer nobody can receive, exactly as
1686
2134
  // `beginGatewayStream` ends the streamed path (#3602 review). The outcome names the abort source.
1687
2135
  function settleUndeliverableBufferedStream(ctx, dispatch) {
1688
2136
  const { deps, runId, cancellation, promptTokenReservation } = dispatch;
1689
- recordGatewayOutcome(ctx, deps, runId, cancellation, "cancelled", 0, 0);
2137
+ // No provider call was started, so no repair can have run.
2138
+ recordGatewayOutcome(ctx, deps, runId, cancellation, "cancelled", NO_GATEWAY_OUTPUT, settledRepair(undefined));
1690
2139
  releaseUndispatchedPromptBudget(ctx, deps, runId, promptTokenReservation);
1691
2140
  return STREAMING;
1692
2141
  }
@@ -1695,12 +2144,12 @@ function settleUndeliverableBufferedStream(ctx, dispatch) {
1695
2144
  // `released-unspent`) so the ledger movement is reconstructible from the log.
1696
2145
  function releaseUndispatchedPromptBudget(ctx, deps, runId, reservation) {
1697
2146
  const settlement = releasePromptTokenReservation(deps, reservation);
1698
- logGatewayCompletionUsage(ctx, runId, { completionTokens: 0, outputBytes: 0 }, "output-byte-estimate", settlement);
2147
+ logGatewayCompletionUsage(ctx, runId, { completionTokens: 0, outputBytes: 0, contentBytes: 0, reasoningBytes: 0 }, "output-byte-estimate", settlement);
1699
2148
  }
1700
2149
  // Extracted so `executeGatewayChat` stays under AGENTS.md §6's 50-line ceiling.
1701
2150
  function settleFailedGatewayChat(ctx, deps, runId, cancellation, error, delivery, bufferedStream) {
1702
2151
  const cancelled = cancellation.signal.aborted;
1703
- recordGatewayOutcome(ctx, deps, runId, cancellation, cancelled ? "cancelled" : "failed", 0, 0);
2152
+ recordGatewayOutcome(ctx, deps, runId, cancellation, cancelled ? "cancelled" : "failed", NO_GATEWAY_OUTPUT, settledRepair(outputRepairOf(error)));
1704
2153
  const spendReason = gatewaySpendRejectionReason(error);
1705
2154
  const failureCode = spendReason === undefined ? gatewayTurnFailureCode(error) : "turn-rejected";
1706
2155
  const runtimeRetry = runtimeRetryFor(error, failureCode);
@@ -1721,7 +2170,7 @@ function settleFailedGatewayChat(ctx, deps, runId, cancellation, error, delivery
1721
2170
  async function executeBufferedGatewayChat(ctx, dispatch, stream) {
1722
2171
  const { deps, binding, modelAlias, request, runId, cancellation, promptTokenReservation } = dispatch;
1723
2172
  const response = await chatFactoryFor(deps, binding.gateway)(binding.config, modelAlias)(request);
1724
- const promptSettlement = settlePromptTokenReservation(deps, promptTokenReservation, response.usage.promptTokens);
2173
+ const promptSettlement = settlePromptTokenReservation(deps, promptTokenReservation, response.usage.promptTokens, discardedPromptTokens(response));
1725
2174
  const output = outputMetrics(response);
1726
2175
  const usage = completionUsage(response, output.outputBytes, 0);
1727
2176
  const metrics = { ...output, completionTokens: usage.completionTokens };
@@ -1729,31 +2178,55 @@ async function executeBufferedGatewayChat(ctx, dispatch, stream) {
1729
2178
  ...response,
1730
2179
  usage: { ...response.usage, completionTokens: usage.completionTokens },
1731
2180
  };
1732
- logGatewayCompletionUsage(ctx, runId, metrics, usage.source, promptSettlement);
1733
- const record = (outcome) => {
1734
- recordGatewayOutcome(ctx, deps, runId, cancellation, outcome, metrics.completionTokens, metrics.outputBytes);
1735
- };
2181
+ logGatewayCompletionUsage(ctx, runId, { ...metrics, ...answerShares(response) }, usage.source, promptSettlement);
2182
+ const record = bufferedOutcomeRecorder(ctx, dispatch, metrics, response);
1736
2183
  if (cancellation.signal.aborted) {
1737
2184
  record("cancelled");
1738
2185
  return stream === undefined
1739
2186
  ? unavailableError()
1740
2187
  : settleBufferedOpenAiStreamError(stream, "error");
1741
2188
  }
1742
- if (exceedsOutputBudget(metrics, request.maxOutputTokens ?? 1)) {
1743
- record("output-limit");
2189
+ const maxOutputTokens = request.maxOutputTokens ?? 1;
2190
+ if (exceedsOutputBudget(metrics, maxOutputTokens)) {
2191
+ record("output-limit", { limit: "answer" });
1744
2192
  return stream === undefined
1745
2193
  ? unavailableError()
1746
2194
  : settleBufferedOpenAiStreamError(stream, "length");
1747
2195
  }
1748
- return deliverBufferedGatewayAnswer(ctx, modelAlias, stream, settledResponse, record);
2196
+ return deliverBufferedGatewayAnswer(ctx, modelAlias, stream, withinReasoningBudget(settledResponse, maxOutputTokens), record);
2197
+ }
2198
+ // The outcome line of a buffered turn: the answer's counts, the reasoning it carried to the
2199
+ // runtime (#3878) or withheld, and — from the settled answer — the gateway's steered repair (#3873).
2200
+ function bufferedOutcomeRecorder(ctx, dispatch, metrics, response) {
2201
+ const { deps, runId, cancellation } = dispatch;
2202
+ return (outcome, delivery = {}) => {
2203
+ recordGatewayOutcome(ctx, deps, runId, cancellation, outcome, { reasoningFrames: 0, forwardedReasoningBytes: 0, ...metrics, ...delivery }, settledRepair(response.outputRepair));
2204
+ };
1749
2205
  }
1750
- function deliverBufferedGatewayAnswer(ctx, modelAlias, stream, response, record) {
2206
+ // A buffered answer is complete when it arrives: its own output bound decides whether it may be
2207
+ // delivered, never the size of the reasoning beside it (#3873 review). A reasoning over the byte
2208
+ // bound of one model attempt is withheld from the runtime — display-only text — and the answer is
2209
+ // delivered without it; the outcome line says so (`reasoningWithheld`).
2210
+ function withinReasoningBudget(response, maxOutputTokens) {
2211
+ if (!exceedsReasoningBudget(response, maxOutputTokens))
2212
+ return { response, withheld: false };
2213
+ const { reasoning: _withheld, ...withoutReasoning } = response;
2214
+ return { response: withoutReasoning, withheld: true };
2215
+ }
2216
+ function deliverBufferedGatewayAnswer(ctx, modelAlias, stream, answer, record) {
2217
+ const { response } = answer;
2218
+ const delivery = {
2219
+ reasoningFrames: response.reasoning === undefined ? 0 : 1,
2220
+ forwardedReasoningBytes: response.reasoning === undefined ? 0 : Buffer.byteLength(response.reasoning, "utf8"),
2221
+ ...(answer.withheld ? { reasoningWithheld: true } : {}),
2222
+ };
1751
2223
  if (stream === undefined) {
1752
- record("accepted");
2224
+ record("accepted", delivery);
1753
2225
  return openAiResponse(modelAlias, response);
1754
2226
  }
1755
2227
  completeBufferedOpenAiStream(stream, response);
1756
- record(ctx.res.writableEnded && !ctx.res.destroyed ? "accepted" : "cancelled");
2228
+ const delivered = ctx.res.writableEnded && !ctx.res.destroyed;
2229
+ record(delivered ? "accepted" : "cancelled", delivered ? delivery : {});
1757
2230
  return STREAMING;
1758
2231
  }
1759
2232
  // Closed stream state machine keeps iterator, cancellation, and SSE backpressure transitions together.
@@ -1764,7 +2237,7 @@ async function streamGatewayChat(ctx, dispatch) {
1764
2237
  iterator = chatStreamFactoryFor(deps, binding.gateway)(binding.config, modelAlias)(request)[Symbol.asyncIterator]();
1765
2238
  }
1766
2239
  catch (error) {
1767
- recordGatewayOutcome(ctx, deps, runId, dispatch.cancellation, "failed", 0, 0);
2240
+ recordGatewayOutcome(ctx, deps, runId, dispatch.cancellation, "failed", NO_GATEWAY_OUTPUT, settledRepair(outputRepairOf(error)));
1768
2241
  const failureCode = gatewayTurnFailureCode(error);
1769
2242
  const runtimeRetry = runtimeRetryFor(error, failureCode);
1770
2243
  const turnFailureRecorded = reportGatewayTurnFailure(ctx, deps, runId, {
@@ -1802,6 +2275,10 @@ async function pumpGatewayStreamWithCancellation(deps, session) {
1802
2275
  void iterator.return?.();
1803
2276
  };
1804
2277
  cancellationSignal.addEventListener("abort", cancelIterator, { once: true });
2278
+ // A live turn keeps the same keep-alive the buffered answer always had (lab ledger F2): a model
2279
+ // that thinks before its first token, or generates a tool call the sidecar forwards only once it
2280
+ // is whole, leaves the runtime's connection silent for as long as that takes.
2281
+ const stopHeartbeat = sidecarSseHeartbeat(session.ctx, cancellation.transport);
1805
2282
  try {
1806
2283
  await pumpGatewayStream(session);
1807
2284
  }
@@ -1815,9 +2292,10 @@ async function pumpGatewayStreamWithCancellation(deps, session) {
1815
2292
  error,
1816
2293
  });
1817
2294
  emitGatewayStreamFailureDiagnostic(session.ctx, deps, error, session.runId, turnFailureRecorded);
1818
- settleGatewayStreamError(session, runtimeRetry);
2295
+ settleGatewayStreamError(session, runtimeRetry, outputRepairOf(error));
1819
2296
  }
1820
2297
  finally {
2298
+ stopHeartbeat();
1821
2299
  cancellationSignal.removeEventListener("abort", cancelIterator);
1822
2300
  }
1823
2301
  }
@@ -1839,6 +2317,9 @@ function createGatewayStreamSession(ctx, dispatch, iterator) {
1839
2317
  promptTokens: 0,
1840
2318
  outputBytes: 0,
1841
2319
  previousDeltaEndedWithHighSurrogate: false,
2320
+ reasoningFrames: 0,
2321
+ forwardedReasoningBytes: 0,
2322
+ previousReasoningEndedWithHighSurrogate: false,
1842
2323
  },
1843
2324
  };
1844
2325
  }
@@ -1853,14 +2334,21 @@ function beginGatewayStream(session) {
1853
2334
  const opened = writeOpenAiSse(ctx, openAiStreamChunk(id, created, modelId, { role: "assistant" }, null), session.cancellation.transport);
1854
2335
  if (!opened) {
1855
2336
  ctx.res.destroy();
1856
- recordSessionOutcome(session, "cancelled");
2337
+ // The gateway's generator was never pulled: no provider call, so no repair can have run.
2338
+ recordSessionOutcome(session, "cancelled", settledRepair(undefined));
1857
2339
  return false;
1858
2340
  }
1859
2341
  return true;
1860
2342
  }
1861
- function recordSessionOutcome(session, outcome) {
2343
+ function recordSessionOutcome(session, outcome, repair, limit) {
1862
2344
  const { ctx, deps, runId, cancellation, metrics } = session;
1863
- recordGatewayOutcome(ctx, deps, runId, cancellation, outcome, metrics.completionTokens, metrics.outputBytes);
2345
+ recordGatewayOutcome(ctx, deps, runId, cancellation, outcome, {
2346
+ completionTokens: metrics.completionTokens,
2347
+ outputBytes: metrics.outputBytes,
2348
+ reasoningFrames: metrics.reasoningFrames,
2349
+ forwardedReasoningBytes: metrics.forwardedReasoningBytes,
2350
+ ...(limit === undefined ? {} : { limit }),
2351
+ }, repair);
1864
2352
  }
1865
2353
  function writeSessionTerminal(session, finishReason) {
1866
2354
  const { ctx, id, created, modelId, metrics, cancellation } = session;
@@ -1872,19 +2360,19 @@ async function pumpGatewayStream(session) {
1872
2360
  for (;;) {
1873
2361
  if (isGatewayRequestCancelled(cancellationSignal)) {
1874
2362
  await iterator.return?.();
1875
- recordSessionOutcome(session, "cancelled");
2363
+ recordSessionOutcome(session, "cancelled", REPAIR_NOT_SETTLED);
1876
2364
  return;
1877
2365
  }
1878
2366
  const next = await iterator.next();
1879
2367
  if (cancellationSignal.aborted) {
1880
- recordSessionOutcome(session, "cancelled");
2368
+ recordSessionOutcome(session, "cancelled", REPAIR_NOT_SETTLED);
1881
2369
  return;
1882
2370
  }
1883
2371
  if (next.done)
1884
2372
  break;
1885
2373
  const chunk = next.value;
1886
- if (chunk.type === "delta") {
1887
- if (await streamGatewayDelta(session, chunk.token))
2374
+ if (chunk.type !== "done") {
2375
+ if (await streamGatewayText(session, chunk))
1888
2376
  continue;
1889
2377
  return;
1890
2378
  }
@@ -1895,24 +2383,63 @@ async function pumpGatewayStream(session) {
1895
2383
  throw new ProviderError("provider stream ended without a terminal response", 200);
1896
2384
  }
1897
2385
  /** Returns true when the stream may continue with the next chunk. */
1898
- async function streamGatewayDelta(session, token) {
1899
- const { ctx, id, created, modelId, request, iterator, metrics } = session;
2386
+ function streamGatewayText(session, chunk) {
2387
+ return chunk.type === "delta"
2388
+ ? streamGatewayDelta(session, chunk.token)
2389
+ : streamGatewayReasoning(session, chunk.token);
2390
+ }
2391
+ /** Returns true when the stream may continue with the next chunk. */
2392
+ function streamGatewayDelta(session, token) {
2393
+ const { request, metrics } = session;
1900
2394
  const deltaMetrics = incrementalUtf8ByteCount(token, metrics.previousDeltaEndedWithHighSurrogate);
1901
2395
  metrics.outputBytes += deltaMetrics.bytes;
1902
2396
  metrics.previousDeltaEndedWithHighSurrogate = deltaMetrics.endsWithHighSurrogate;
1903
2397
  metrics.completionTokens = Math.ceil(metrics.outputBytes / OUTPUT_BYTES_PER_TOKEN_LIMIT);
1904
2398
  const budget = { completionTokens: metrics.completionTokens, outputBytes: metrics.outputBytes };
1905
- if (exceedsOutputBudget(budget, request.maxOutputTokens ?? 1)) {
2399
+ const overBudget = exceedsOutputBudget(budget, request.maxOutputTokens ?? 1);
2400
+ return forwardStreamText(session, { content: token }, overBudget ? "answer" : undefined);
2401
+ }
2402
+ // The reasoning passages one turn may carry: the first attempt that forwards reasoning and the
2403
+ // gateway's one steered repair (#3873 F17, F23, option iii). The gateway forwards no further
2404
+ // passage — a provider retry after forwarded reasoning streams its reasoning undelivered — so the
2405
+ // second passage is the repair working, not an overgrown reasoning.
2406
+ const REASONING_PASSAGES_PER_TURN = 2;
2407
+ // #3878: the model's reasoning reaches the coding runtime as `delta.reasoning_content`, the field
2408
+ // OpenCode's OpenAI-compatible provider turns into a reasoning part, as it arrives. It is bounded
2409
+ // apart from the answer, by the same byte allowance per model attempt for the attempts a turn may
2410
+ // carry, so a reasoning model keeps its whole answer budget and a provider that ignores its output
2411
+ // limit still cannot stream without end.
2412
+ async function streamGatewayReasoning(session, token) {
2413
+ const { request, metrics } = session;
2414
+ const counted = incrementalUtf8ByteCount(token, metrics.previousReasoningEndedWithHighSurrogate);
2415
+ const total = metrics.forwardedReasoningBytes + counted.bytes;
2416
+ const overBudget = total > outputByteBudget(request.maxOutputTokens ?? 1) * REASONING_PASSAGES_PER_TURN;
2417
+ const forwarded = await forwardStreamText(session, { reasoning_content: token }, overBudget ? "reasoning" : undefined);
2418
+ if (forwarded) {
2419
+ // Only bytes the runtime actually received count as forwarded (#3873 review).
2420
+ metrics.forwardedReasoningBytes = total;
2421
+ metrics.previousReasoningEndedWithHighSurrogate = counted.endsWithHighSurrogate;
2422
+ metrics.reasoningFrames += 1;
2423
+ }
2424
+ return forwarded;
2425
+ }
2426
+ // One text frame of a live turn, or its end: past a byte bound (`limit`: the answer's or the
2427
+ // forwarded reasoning's) the turn ends with `length`, and a frame that no longer reaches the client
2428
+ // ends it as cancelled. The gateway call has not settled at either point, so neither line can say
2429
+ // whether a steered repair ran. Returns true when the stream may continue with the next chunk.
2430
+ async function forwardStreamText(session, delta, limit) {
2431
+ const { ctx, id, created, modelId, iterator } = session;
2432
+ if (limit !== undefined) {
1906
2433
  await iterator.return?.();
1907
- recordSessionOutcome(session, "output-limit");
2434
+ recordSessionOutcome(session, "output-limit", REPAIR_NOT_SETTLED, limit);
1908
2435
  writeSessionTerminal(session, "length");
1909
2436
  return false;
1910
2437
  }
1911
- const wrote = writeOpenAiSse(ctx, openAiStreamChunk(id, created, modelId, { content: token }, null), session.cancellation.transport);
2438
+ const wrote = writeOpenAiSse(ctx, openAiStreamChunk(id, created, modelId, delta, null), session.cancellation.transport);
1912
2439
  if (!wrote) {
1913
2440
  ctx.res.destroy();
1914
2441
  await iterator.return?.();
1915
- recordSessionOutcome(session, "cancelled");
2442
+ recordSessionOutcome(session, "cancelled", REPAIR_NOT_SETTLED);
1916
2443
  return false;
1917
2444
  }
1918
2445
  return true;
@@ -1922,11 +2449,11 @@ async function streamGatewayResponse(session, response) {
1922
2449
  const outcome = outputMetrics(response);
1923
2450
  metrics.outputBytes = Math.max(outcome.outputBytes, metrics.outputBytes);
1924
2451
  metrics.promptTokens = response.usage.promptTokens;
1925
- const promptSettlement = settlePromptTokenReservation(session.deps, promptTokenReservation, response.usage.promptTokens);
2452
+ const promptSettlement = settlePromptTokenReservation(session.deps, promptTokenReservation, response.usage.promptTokens, discardedPromptTokens(response));
1926
2453
  settleStreamCompletionUsage(session, response, outcome, promptSettlement);
1927
2454
  if (exceedsOutputBudget(metrics, request.maxOutputTokens ?? 1)) {
1928
2455
  await iterator.return?.();
1929
- recordSessionOutcome(session, "output-limit");
2456
+ recordSessionOutcome(session, "output-limit", settledRepair(response.outputRepair), "answer");
1930
2457
  writeSessionTerminal(session, "length");
1931
2458
  return;
1932
2459
  }
@@ -1935,12 +2462,12 @@ async function streamGatewayResponse(session, response) {
1935
2462
  if (!wrote) {
1936
2463
  ctx.res.destroy();
1937
2464
  await iterator.return?.();
1938
- recordSessionOutcome(session, "cancelled");
2465
+ recordSessionOutcome(session, "cancelled", settledRepair(response.outputRepair));
1939
2466
  return;
1940
2467
  }
1941
2468
  }
1942
2469
  writeSessionTerminal(session, response.finishReason);
1943
- recordSessionOutcome(session, ctx.res.writableEnded && !ctx.res.destroyed ? "accepted" : "cancelled");
2470
+ recordSessionOutcome(session, ctx.res.writableEnded && !ctx.res.destroyed ? "accepted" : "cancelled", settledRepair(response.outputRepair));
1944
2471
  }
1945
2472
  function settleStreamCompletionUsage(session, response, outcome, promptSettlement) {
1946
2473
  const { metrics, ctx, runId } = session;
@@ -1949,6 +2476,7 @@ function settleStreamCompletionUsage(session, response, outcome, promptSettlemen
1949
2476
  logGatewayCompletionUsage(ctx, runId, {
1950
2477
  completionTokens: metrics.completionTokens,
1951
2478
  outputBytes: Math.max(outcome.outputBytes, metrics.outputBytes),
2479
+ ...answerShares(response),
1952
2480
  }, usage.source, promptSettlement);
1953
2481
  }
1954
2482
  function completionUsage(response, outputBytes, streamedCompletionTokens) {
@@ -1970,6 +2498,36 @@ function completionUsage(response, outputBytes, streamedCompletionTokens) {
1970
2498
  source: "output-byte-estimate",
1971
2499
  };
1972
2500
  }
2501
+ function answerShares(response) {
2502
+ const { reasoningBytes, reasoningTokens } = response.usage;
2503
+ const discarded = response.discardedAttemptUsage;
2504
+ return {
2505
+ contentBytes: Buffer.byteLength(response.content, "utf8"),
2506
+ reasoningBytes: reasoningBytes ?? 0,
2507
+ ...(reasoningTokens === undefined ? {} : { reasoningTokens }),
2508
+ ...(discarded === undefined
2509
+ ? {}
2510
+ : {
2511
+ discardedAttemptCount: discarded.attemptCount,
2512
+ discardedPromptTokens: discarded.promptTokens,
2513
+ discardedCompletionTokens: discarded.completionTokens,
2514
+ }),
2515
+ };
2516
+ }
2517
+ // A forwarded reasoning is bounded by the turn's output allowance in bytes, apart from the answer.
2518
+ function exceedsReasoningBudget(response, maxOutputTokens) {
2519
+ return (response.reasoning !== undefined &&
2520
+ Buffer.byteLength(response.reasoning, "utf8") > outputByteBudget(maxOutputTokens));
2521
+ }
2522
+ function discardedAttemptFields(shares) {
2523
+ const { discardedAttemptCount, discardedPromptTokens, discardedCompletionTokens } = shares;
2524
+ if (discardedAttemptCount === undefined ||
2525
+ discardedPromptTokens === undefined ||
2526
+ discardedCompletionTokens === undefined) {
2527
+ return {};
2528
+ }
2529
+ return { discardedAttemptCount, discardedPromptTokens, discardedCompletionTokens };
2530
+ }
1973
2531
  function logGatewayCompletionUsage(ctx, runId, metrics, source, promptSettlement) {
1974
2532
  getServerLogger().info(activityLogEvent(CODING_SIDECAR_GATEWAY_USAGE_SETTLED_OPERATION, { correlationId: correlationIdOrUnknown(ctx.correlationId), parentCorrelationId: runId }, {
1975
2533
  runId,
@@ -1979,16 +2537,22 @@ function logGatewayCompletionUsage(ctx, runId, metrics, source, promptSettlement
1979
2537
  promptSettlementStatus: promptSettlement.status,
1980
2538
  outputBytes: metrics.outputBytes,
1981
2539
  source,
2540
+ contentBytes: metrics.contentBytes,
2541
+ reasoningBytes: metrics.reasoningBytes,
2542
+ ...(metrics.reasoningTokens === undefined
2543
+ ? {}
2544
+ : { reasoningTokens: metrics.reasoningTokens }),
2545
+ ...discardedAttemptFields(metrics),
1982
2546
  completeness: "complete",
1983
2547
  loss: "none",
1984
2548
  }));
1985
2549
  }
1986
- function settleGatewayStreamError(session, runtimeRetry) {
2550
+ function settleGatewayStreamError(session, runtimeRetry, repair) {
1987
2551
  if (session.cancellation.signal.aborted) {
1988
- recordSessionOutcome(session, "cancelled");
2552
+ recordSessionOutcome(session, "cancelled", settledRepair(repair));
1989
2553
  return;
1990
2554
  }
1991
- recordSessionOutcome(session, "failed");
2555
+ recordSessionOutcome(session, "failed", settledRepair(repair));
1992
2556
  if (runtimeRetry === "refused") {
1993
2557
  const { ctx, id, created, modelId, cancellation } = session;
1994
2558
  writeStreamRejection({ ctx, id, created, modelId, transport: cancellation.transport });
@@ -2020,23 +2584,25 @@ function beginBufferedOpenAiStream(ctx, modelId, transport) {
2020
2584
  created,
2021
2585
  modelId,
2022
2586
  transport,
2023
- stopHeartbeat: startSseHeartbeat(ctx.res, BUFFERED_STREAM_HEARTBEAT_MS, undefined, {
2024
- controller: transport.backpressure,
2025
- onBackpressure: transport.onBackpressure,
2026
- correlationId: transport.correlationId,
2027
- }),
2587
+ stopHeartbeat: sidecarSseHeartbeat(ctx, transport),
2028
2588
  };
2029
2589
  }
2590
+ // SSE comments that keep the runtime's connection alive while the model is silent, written through
2591
+ // the shared protective path so a client that stops draining kills the stream like any frame.
2592
+ function sidecarSseHeartbeat(ctx, transport) {
2593
+ return startSseHeartbeat(ctx.res, SIDECAR_SSE_HEARTBEAT_MS, undefined, {
2594
+ controller: transport.backpressure,
2595
+ onBackpressure: transport.onBackpressure,
2596
+ correlationId: transport.correlationId,
2597
+ });
2598
+ }
2030
2599
  function completeBufferedOpenAiStream(session, response) {
2031
2600
  const { ctx, id, created, modelId, transport, stopHeartbeat } = session;
2032
2601
  stopHeartbeat();
2033
- if (response.content.length > 0 || response.toolCalls.length > 0) {
2034
- const wrote = writeOpenAiSse(ctx, openAiStreamChunk(id, created, modelId, {
2035
- ...(response.content.length === 0 ? {} : { content: response.content }),
2036
- ...(response.toolCalls.length === 0
2037
- ? {}
2038
- : { tool_calls: openAiToolCalls(response.toolCalls) }),
2039
- }, null), transport);
2602
+ if (response.content.length > 0 ||
2603
+ response.toolCalls.length > 0 ||
2604
+ response.reasoning !== undefined) {
2605
+ const wrote = writeOpenAiSse(ctx, openAiStreamChunk(id, created, modelId, bufferedAnswerDelta(response), null), transport);
2040
2606
  if (!wrote) {
2041
2607
  ctx.res.destroy();
2042
2608
  return STREAMING;
@@ -2045,6 +2611,15 @@ function completeBufferedOpenAiStream(session, response) {
2045
2611
  writeStreamTerminal(session, response.finishReason, response.usage.promptTokens, response.usage.completionTokens);
2046
2612
  return STREAMING;
2047
2613
  }
2614
+ // The whole buffered answer as one streamed delta: the model's reasoning (#3878), then the answer
2615
+ // and its tool calls, the order in which the runtime shows them.
2616
+ function bufferedAnswerDelta(response) {
2617
+ return {
2618
+ ...(response.reasoning === undefined ? {} : { reasoning_content: response.reasoning }),
2619
+ ...(response.content.length === 0 ? {} : { content: response.content }),
2620
+ ...(response.toolCalls.length === 0 ? {} : { tool_calls: openAiToolCalls(response.toolCalls) }),
2621
+ };
2622
+ }
2048
2623
  function settleBufferedOpenAiStreamError(session, finishReason) {
2049
2624
  session.stopHeartbeat();
2050
2625
  writeStreamTerminal(session, finishReason, 0, 0);
@@ -2102,6 +2677,54 @@ function openAiStreamChunk(id, created, model, delta, finishReason) {
2102
2677
  choices: [{ index: 0, delta, finish_reason: finishReason }],
2103
2678
  };
2104
2679
  }
2680
+ function configuredConversationSubset(config, holder, freshOnly) {
2681
+ const providers = config.providers.filter((provider) => {
2682
+ const readiness = holder?.current() === config
2683
+ ? currentConversationReadinessObservation({ gatewayConfig: holder }, provider.modelId)
2684
+ : undefined;
2685
+ return freshOnly ? readiness === true : readiness !== false;
2686
+ });
2687
+ const ids = new Set(providers.map((provider) => provider.modelId));
2688
+ return {
2689
+ ...config,
2690
+ providers,
2691
+ ...(config.capabilities === undefined
2692
+ ? {}
2693
+ : { capabilities: config.capabilities.filter((model) => ids.has(model.id)) }),
2694
+ };
2695
+ }
2696
+ /** New admissions and passive readiness share the original selector over fresh serving evidence. */
2697
+ function resolveFreshCodingProfile(config, holder, options) {
2698
+ const configured = resolveCodingSafeSidecarGatewayProfile(config, options);
2699
+ if (configured.status !== "available" || config === undefined)
2700
+ return configured;
2701
+ const fresh = resolveCodingSafeSidecarGatewayProfile(configuredConversationSubset(config, holder, true), options);
2702
+ if (fresh.status === "available")
2703
+ return fresh;
2704
+ // Preserve a structural window refusal; an untested connection cannot repair that shortfall.
2705
+ if (!codingContextFits(configured))
2706
+ return configured;
2707
+ const unknown = resolveCodingSafeSidecarGatewayProfile(configuredConversationSubset(config, holder, false), options);
2708
+ return {
2709
+ status: "unavailable",
2710
+ reason: unknown.status === "available" ? "model-verification-pending" : "conversation-not-ready",
2711
+ };
2712
+ }
2713
+ function passiveCodingProfile(deps) {
2714
+ return resolveFreshCodingProfile(currentGatewayConfig(deps), deps.gatewayConfig, {
2715
+ deploymentPolicyDisabled: sidecarPolicyDisabled(deps),
2716
+ modelSource: currentModelSource(deps),
2717
+ gatewayVerification: currentGatewayVerification(deps),
2718
+ });
2719
+ }
2720
+ function conversationShortfall(result) {
2721
+ if (result.status === "available")
2722
+ return undefined;
2723
+ return result.reason === "model-verification-pending" ||
2724
+ result.reason === "conversation-not-ready"
2725
+ ? result.reason
2726
+ : undefined;
2727
+ }
2105
2728
  /**
2106
2729
  * Readiness dimension (#3390 closeout): a profile can be "available" per the stored config and
2107
2730
  * probe yet still be unusable — its `runMetadata.maxPromptTokens` (derived from the capability via
@@ -2112,9 +2735,14 @@ function openAiStreamChunk(id, created, model, delta, finishReason) {
2112
2735
  * requests keep failing exactly as before, unchanged by this readiness-only check.
2113
2736
  */
2114
2737
  function gatewayReadinessProjection(ctx, deps) {
2115
- const result = resolveGatewayProfile(deps).result;
2738
+ const result = passiveCodingProfile(deps);
2116
2739
  if (codingContextFits(result))
2117
2740
  return result;
2741
+ const conversation = conversationShortfall(result);
2742
+ if (conversation !== undefined) {
2743
+ logReadinessShortfall(ctx, result, conversation, conversation === "model-verification-pending");
2744
+ return result;
2745
+ }
2118
2746
  const shortfall = result.status === "available" ? "model-context-window-insufficient" : result.reason;
2119
2747
  if (shortfall !== "model-context-window-insufficient" &&
2120
2748
  shortfall !== "no-tool-calling" &&
@@ -2122,11 +2750,11 @@ function gatewayReadinessProjection(ctx, deps) {
2122
2750
  return result;
2123
2751
  // #3591 (1.1.7): while the automatic probe is still running against a slow gateway the shortfall
2124
2752
  // is not a verdict. The profile says so, and the Workbench re-reads it instead of refusing.
2125
- const pending = readinessProbePending(deps, result, shortfall);
2753
+ const pending = readinessProbePending(deps, result);
2126
2754
  const reason = pending
2127
2755
  ? "model-verification-pending"
2128
2756
  : shortfall;
2129
- logReadinessShortfall(ctx, result, reason, pending);
2757
+ logReadinessShortfall(ctx, result, reason, pending, shortfall);
2130
2758
  // An open verification replaces the stored shortfall for an unavailable projection too (an
2131
2759
  // unverified tool-calling proof whose probe is still running), or the Workbench would stop
2132
2760
  // reading and keep the refusal until an unrelated refresh.
@@ -2157,9 +2785,11 @@ export function codingContextShortfall(config, result) {
2157
2785
  * model the gateway does not admit right now is a typed refusal that names the sidecar's reason
2158
2786
  * (#3565 Observation 17), never a bare Error the orchestrator can only report as
2159
2787
  * `authority-resolution-failed`; so is a model whose window cannot hold the run's prompt (#3603).
2788
+ * Only a fresh basic-chat success in the same current runtime holder admits a new run; already
2789
+ * admitted F73 requests keep their captured profile and never use this new-run guard.
2160
2790
  */
2161
- export function admitCodingRunModel(config, modelId, reasoningEffort) {
2162
- const resolved = resolveCodingSafeSidecarGatewayProfile(config, {
2791
+ export function admitCodingRunModel(config, modelId, reasoningEffort, holder) {
2792
+ const resolved = resolveFreshCodingProfile(config, holder, {
2163
2793
  ...(modelId === undefined ? {} : { modelId }),
2164
2794
  });
2165
2795
  if (resolved.status !== "available" || config === undefined) {
@@ -2183,9 +2813,7 @@ function admittedReasoningEffort(config, modelAlias, reasoningEffort) {
2183
2813
  }
2184
2814
  return { reasoningEffort };
2185
2815
  }
2186
- function readinessProbePending(deps, result, shortfall) {
2187
- if (shortfall === "no-tool-calling")
2188
- return false;
2816
+ function readinessProbePending(deps, result) {
2189
2817
  const config = currentGatewayConfig(deps);
2190
2818
  if (config === undefined)
2191
2819
  return false;
@@ -2195,12 +2823,13 @@ function readinessProbePending(deps, result, shortfall) {
2195
2823
  ? isCodingWorkbenchProbePending(config, result.modelAlias)
2196
2824
  : isAnyCodingWorkbenchProbePending(config);
2197
2825
  }
2198
- function logReadinessShortfall(ctx, result, reason, pending) {
2826
+ function logReadinessShortfall(ctx, result, reason, pending, storedReason) {
2199
2827
  getServerLogger().warn(activityLogEvent(CODING_SIDECAR_GATEWAY_READINESS_INSUFFICIENT_OPERATION, {
2200
2828
  correlationId: correlationIdOrUnknown(ctx.correlationId),
2201
2829
  errorKind: "unavailable",
2202
2830
  }, {
2203
2831
  reason,
2832
+ ...(pending && storedReason !== undefined ? { storedReason } : {}),
2204
2833
  probeMode: pending ? "pending" : "passive",
2205
2834
  ...(result.status === "available"
2206
2835
  ? {
@@ -2244,8 +2873,15 @@ function boundedProfileWait() {
2244
2873
  timer.unref();
2245
2874
  });
2246
2875
  }
2876
+ // Lab ledger F2 (#3873): a streamed request is answered live wherever the resolved profile streams
2877
+ // (the model's capability streams and `codingStreaming` is not "off"), so the coding runtime sees
2878
+ // the answer as the provider produces it instead of only once it exists. An injected stream seam
2879
+ // streams; an injected buffered seam alone stands in for the whole gateway, which then has no
2880
+ // stream to read.
2247
2881
  function upstreamGatewayStreamingSupported(deps, advertisedSupport) {
2248
- return advertisedSupport || deps.codingSidecarGatewayChatStreamFactory !== undefined;
2882
+ if (deps.codingSidecarGatewayChatStreamFactory !== undefined)
2883
+ return true;
2884
+ return advertisedSupport && deps.codingSidecarGatewayChatFactory === undefined;
2249
2885
  }
2250
2886
  /** The unmanaged-tool-contract rejection applies before authentication is even known, so it stays
2251
2887
  * its own check: extracting it keeps `runtimeGatewayAdmissionResponse` and
@@ -2253,7 +2889,8 @@ function upstreamGatewayStreamingSupported(deps, advertisedSupport) {
2253
2889
  * carrying every branch. */
2254
2890
  function rejectUnmanagedGatewayToolContract(ctx, deps, parsed, authentication) {
2255
2891
  const declaresTools = parsed.tools !== undefined && parsed.tools.length > 0;
2256
- if (!declaresTools || isExactManagedToolSet(parsed.tools))
2892
+ if (!declaresTools ||
2893
+ isExactManagedToolSet(parsed.tools, gatewayReadinessRegistry(deps)?.toolProfile ?? "direct"))
2257
2894
  return undefined;
2258
2895
  return refuseGatewayToolContract(ctx, deps, authentication.runId, parsed);
2259
2896
  }
@@ -2267,21 +2904,20 @@ function runtimeGatewayAdmissionResponse(ctx, deps, parsed, authentication, mode
2267
2904
  }
2268
2905
  function authenticatedGatewayAdmission(ctx, deps, parsed, authentication, modelAlias) {
2269
2906
  const registry = gatewayReadinessRegistry(deps);
2907
+ const exact = isExactManagedToolSet(parsed.tools, registry?.toolProfile ?? "direct");
2270
2908
  if (!isAdmittedManagedToolSet(parsed.tools, registry, authentication.runId)) {
2271
2909
  return {
2272
2910
  kind: "handled",
2273
2911
  result: refuseGatewayToolContract(ctx, deps, authentication.runId, parsed),
2274
2912
  };
2275
2913
  }
2276
- if (isExactManagedToolSet(parsed.tools) &&
2277
- isRuntimeReadinessProbe(parsed) &&
2278
- registry?.claim(authentication.runId) === true) {
2914
+ if (exact && isRuntimeReadinessProbe(parsed) && registry?.claim(authentication.runId) === true) {
2279
2915
  return {
2280
2916
  kind: "handled",
2281
2917
  result: fixedReadinessResponse(ctx, deps, modelAlias, parsed.stream === true),
2282
2918
  };
2283
2919
  }
2284
- if (isExactManagedToolSet(parsed.tools))
2920
+ if (exact)
2285
2921
  registry?.verifyObserved(authentication.runId);
2286
2922
  noteToolAdoptionGap(ctx, deps, authentication.runId, parsed.messages);
2287
2923
  return { kind: "proceed" };
@@ -2405,6 +3041,8 @@ function logValidatedRequestBounds(ctx, runId, request, bounds, estimatedPromptT
2405
3041
  estimatedPromptTokens,
2406
3042
  maxOutputTokens: admittedOutputTokens(bounds, estimatedPromptTokens),
2407
3043
  inputMessageCount: request.messages.length,
3044
+ offeredToolCount: request.tools?.length ?? 0,
3045
+ droppedReasoningMessageCount: request.droppedReasoningMessageCount,
2408
3046
  completeness: "complete",
2409
3047
  loss: "none",
2410
3048
  }));
@@ -2420,6 +3058,7 @@ function executeBudgetedGatewayChat(ctx, deps, binding, parsed, authentication,
2420
3058
  return executeGatewayChat(ctx, deps, binding, parsed, authentication.runId, {
2421
3059
  ...profile,
2422
3060
  promptTokenReservation,
3061
+ toolProfile: gatewayReadinessRegistry(deps)?.toolProfile ?? "direct",
2423
3062
  toolCatalogCoverage: resolveToolCatalogHandlerCoverage(deps, authentication.runId, ctx.correlationId),
2424
3063
  offerLifetimeMs: opencodeGatewayOfferLifetimeMs(codingSidecarGatewayRequestDeadlineMs(binding.config, profile.modelAlias)),
2425
3064
  });