@oscharko-dev/keiko 0.3.15 → 0.3.17

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 (574) hide show
  1. package/dist/ui/csp-hashes.json +12 -12
  2. package/dist/ui/static/404.html +1 -1
  3. package/dist/ui/static/__next.__PAGE__.txt +2 -2
  4. package/dist/ui/static/__next._full.txt +3 -3
  5. package/dist/ui/static/__next._head.txt +1 -1
  6. package/dist/ui/static/__next._index.txt +1 -1
  7. package/dist/ui/static/__next._tree.txt +1 -1
  8. package/dist/ui/static/_next/static/chunks/06zt_mdjfd0l1.js +1 -0
  9. package/dist/ui/static/_next/static/chunks/0bhehe35iyqjr.js +1 -0
  10. package/dist/ui/static/_next/static/chunks/0ebqhb4-lqo3_.js +1 -0
  11. package/dist/ui/static/_next/static/chunks/0kllmzwq3m4t6.js +1 -0
  12. package/dist/ui/static/_next/static/chunks/0loqi-w3in9hh.js +7 -0
  13. package/dist/ui/static/_next/static/chunks/{2lz9ujlsm75kc.js → 0nthfqbd4m5rn.js} +1 -1
  14. package/dist/ui/static/_next/static/chunks/{0npbfd_er47xu.js → 0te_d7ls2ozkc.js} +1 -1
  15. package/dist/ui/static/_next/static/chunks/{167niw9we0b7n.js → 0u5u7e3fbq3rx.js} +1 -1
  16. package/dist/ui/static/_next/static/chunks/{2wbqxdm82mc6g.js → 0wxc3q97-jil3.js} +1 -1
  17. package/dist/ui/static/_next/static/chunks/{0kefabslo9zpa.js → 1-p5-rt-7uxi_.js} +1 -1
  18. package/dist/ui/static/_next/static/chunks/{1_m1z_f54hkji.js → 12te-wibzf1gs.js} +1 -1
  19. package/dist/ui/static/_next/static/chunks/{2uj0n49ihyt_7.js → 15sh7n1wjfckc.js} +1 -1
  20. package/dist/ui/static/_next/static/chunks/{1q2fca11xb2x0.js → 16gc6p4mobbkd.js} +1 -1
  21. package/dist/ui/static/_next/static/chunks/{0rvhrleg8f98b.js → 1749gpptuos4d.js} +1 -1
  22. package/dist/ui/static/_next/static/chunks/{3-4iik5ytvbed.js → 18o-euqluhpfn.js} +1 -1
  23. package/dist/ui/static/_next/static/chunks/1a35cd2uz40rm.js +1 -0
  24. package/dist/ui/static/_next/static/chunks/1fdowulgpx-tu.js +1 -0
  25. package/dist/ui/static/_next/static/chunks/{2jztaj4km0-p1.js → 1gg0sjnr8ce0_.js} +1 -1
  26. package/dist/ui/static/_next/static/chunks/1isat9t7mn8mx.js +1 -0
  27. package/dist/ui/static/_next/static/chunks/1nminehwt46sj.js +5 -0
  28. package/dist/ui/static/_next/static/chunks/1t1vm08xtco3a.js +1 -0
  29. package/dist/ui/static/_next/static/chunks/{40pywkvvth6qk.js → 1tu5p76jk6tu8.js} +1 -1
  30. package/dist/ui/static/_next/static/chunks/1upn5gu7c_j2v.js +1 -0
  31. package/dist/ui/static/_next/static/chunks/{0x8zukfn36b67.js → 1vq07gr__1fql.js} +1 -1
  32. package/dist/ui/static/_next/static/chunks/1wj5_uetggavn.js +1 -0
  33. package/dist/ui/static/_next/static/chunks/1xoioc6pnmeb3.js +1 -0
  34. package/dist/ui/static/_next/static/chunks/{339a2jjs3kjwj.js → 1xy001hdmhglo.js} +1 -1
  35. package/dist/ui/static/_next/static/chunks/{06zsbt3vzj_fx.js → 1za1-6o9oz1k5.js} +1 -1
  36. package/dist/ui/static/_next/static/chunks/{2skeghhuyv_c4.js → 299tu7y81dxk5.js} +1 -1
  37. package/dist/ui/static/_next/static/chunks/2d9gg91izncw0.js +1 -0
  38. package/dist/ui/static/_next/static/chunks/2evpuk4qo0lx3.js +1 -0
  39. package/dist/ui/static/_next/static/chunks/2fxkefwnb8y51.js +1 -0
  40. package/dist/ui/static/_next/static/chunks/{36z66lssar4oh.js → 2oqlt-9yz4qtf.js} +1 -1
  41. package/dist/ui/static/_next/static/chunks/2uu6q4bct_8uw.js +1 -0
  42. package/dist/ui/static/_next/static/chunks/2xi5lcexfddf9.js +1 -0
  43. package/dist/ui/static/_next/static/chunks/{1we__nb0syt11.js → 2y1e1t_x6totm.js} +1 -1
  44. package/dist/ui/static/_next/static/chunks/{001y_5k3kms8o.js → 339wsi27r9-nw.js} +1 -1
  45. package/dist/ui/static/_next/static/chunks/3b2-z8pj0i91u.js +1 -0
  46. package/dist/ui/static/_next/static/chunks/3ba_mrp8s5-2v.js +1 -0
  47. package/dist/ui/static/_next/static/chunks/{2bzjr2ai0a8hq.js → 3cuvu8nxos4fw.js} +1 -1
  48. package/dist/ui/static/_next/static/chunks/{43fq84z1snp1a.js → 3j-m1jy0sfg3x.js} +1 -1
  49. package/dist/ui/static/_next/static/chunks/3rqegw8x3e8l1.js +1 -0
  50. package/dist/ui/static/_next/static/chunks/{3mmcvq93ws1o_.js → 3yhyg862owqrl.js} +1 -1
  51. package/dist/ui/static/_not-found/__next._full.txt +1 -1
  52. package/dist/ui/static/_not-found/__next._head.txt +1 -1
  53. package/dist/ui/static/_not-found/__next._index.txt +1 -1
  54. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  55. package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
  56. package/dist/ui/static/_not-found/__next._tree.txt +1 -1
  57. package/dist/ui/static/_not-found.html +1 -1
  58. package/dist/ui/static/_not-found.txt +1 -1
  59. package/dist/ui/static/atlassian-connectors/__next._full.txt +5 -5
  60. package/dist/ui/static/atlassian-connectors/__next._head.txt +1 -1
  61. package/dist/ui/static/atlassian-connectors/__next._index.txt +1 -1
  62. package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
  63. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +2 -2
  64. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.txt +2 -2
  65. package/dist/ui/static/atlassian-connectors.html +1 -1
  66. package/dist/ui/static/atlassian-connectors.txt +5 -5
  67. package/dist/ui/static/index.html +1 -1
  68. package/dist/ui/static/index.txt +3 -3
  69. package/dist/ui/static/launch/__next._full.txt +3 -3
  70. package/dist/ui/static/launch/__next._head.txt +1 -1
  71. package/dist/ui/static/launch/__next._index.txt +1 -1
  72. package/dist/ui/static/launch/__next._tree.txt +1 -1
  73. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +2 -2
  74. package/dist/ui/static/launch/__next.launch.txt +1 -1
  75. package/dist/ui/static/launch.html +1 -1
  76. package/dist/ui/static/launch.txt +3 -3
  77. package/dist/ui/static/local-knowledge/__next._full.txt +3 -3
  78. package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
  79. package/dist/ui/static/local-knowledge/__next._index.txt +1 -1
  80. package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
  81. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +2 -2
  82. package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
  83. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +5 -5
  84. package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
  85. package/dist/ui/static/local-knowledge/capsule/__next._index.txt +1 -1
  86. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
  87. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +2 -2
  88. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +2 -2
  89. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
  90. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  91. package/dist/ui/static/local-knowledge/capsule.txt +5 -5
  92. package/dist/ui/static/local-knowledge.html +1 -1
  93. package/dist/ui/static/local-knowledge.txt +3 -3
  94. package/node_modules/@oscharko-dev/keiko-cli/dist/audit.d.ts +31 -2
  95. package/node_modules/@oscharko-dev/keiko-cli/dist/audit.d.ts.map +1 -1
  96. package/node_modules/@oscharko-dev/keiko-cli/dist/audit.js +91 -13
  97. package/node_modules/@oscharko-dev/keiko-cli/dist/investigate.d.ts +8 -0
  98. package/node_modules/@oscharko-dev/keiko-cli/dist/investigate.d.ts.map +1 -1
  99. package/node_modules/@oscharko-dev/keiko-cli/dist/investigate.js +283 -16
  100. package/node_modules/@oscharko-dev/keiko-cli/dist/process-guards.d.ts +5 -1
  101. package/node_modules/@oscharko-dev/keiko-cli/dist/process-guards.d.ts.map +1 -1
  102. package/node_modules/@oscharko-dev/keiko-cli/dist/process-guards.js +134 -22
  103. package/node_modules/@oscharko-dev/keiko-cli/dist/repair.d.ts.map +1 -1
  104. package/node_modules/@oscharko-dev/keiko-cli/dist/repair.js +1 -0
  105. package/node_modules/@oscharko-dev/keiko-cli/dist/runner.d.ts.map +1 -1
  106. package/node_modules/@oscharko-dev/keiko-cli/dist/runner.js +4 -0
  107. package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts +1 -1
  108. package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts.map +1 -1
  109. package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.js +35 -14
  110. package/node_modules/@oscharko-dev/keiko-cli/dist/support-analyze.d.ts +117 -0
  111. package/node_modules/@oscharko-dev/keiko-cli/dist/support-analyze.d.ts.map +1 -0
  112. package/node_modules/@oscharko-dev/keiko-cli/dist/support-analyze.js +782 -0
  113. package/node_modules/@oscharko-dev/keiko-cli/dist/support-export.d.ts +113 -0
  114. package/node_modules/@oscharko-dev/keiko-cli/dist/support-export.d.ts.map +1 -0
  115. package/node_modules/@oscharko-dev/keiko-cli/dist/support-export.js +340 -0
  116. package/node_modules/@oscharko-dev/keiko-cli/dist/support.d.ts +44 -0
  117. package/node_modules/@oscharko-dev/keiko-cli/dist/support.d.ts.map +1 -0
  118. package/node_modules/@oscharko-dev/keiko-cli/dist/support.js +614 -0
  119. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts +20 -2
  120. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts.map +1 -1
  121. package/node_modules/@oscharko-dev/keiko-cli/dist/ui.js +259 -17
  122. package/node_modules/@oscharko-dev/keiko-cli/package.json +13 -13
  123. package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
  124. package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts +15 -0
  125. package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts.map +1 -0
  126. package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.js +121 -0
  127. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +7 -2
  128. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
  129. package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +11 -2
  130. package/node_modules/@oscharko-dev/keiko-contracts/dist/observability.d.ts +22 -0
  131. package/node_modules/@oscharko-dev/keiko-contracts/dist/observability.d.ts.map +1 -0
  132. package/node_modules/@oscharko-dev/keiko-contracts/dist/observability.js +46 -0
  133. package/node_modules/@oscharko-dev/keiko-contracts/dist/store-fingerprint.d.ts +40 -0
  134. package/node_modules/@oscharko-dev/keiko-contracts/dist/store-fingerprint.d.ts.map +1 -0
  135. package/node_modules/@oscharko-dev/keiko-contracts/dist/store-fingerprint.js +123 -0
  136. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  137. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
  138. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
  139. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
  140. package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
  141. package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
  142. package/node_modules/@oscharko-dev/keiko-harness/dist/adapters.d.ts +5 -5
  143. package/node_modules/@oscharko-dev/keiko-harness/dist/adapters.d.ts.map +1 -1
  144. package/node_modules/@oscharko-dev/keiko-harness/dist/adapters.js +3 -0
  145. package/node_modules/@oscharko-dev/keiko-harness/dist/ports.d.ts +3 -3
  146. package/node_modules/@oscharko-dev/keiko-harness/dist/ports.d.ts.map +1 -1
  147. package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
  148. package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
  149. package/node_modules/@oscharko-dev/keiko-harness/package.json +6 -6
  150. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts +1 -1
  151. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts.map +1 -1
  152. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.js +1 -1
  153. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.d.ts.map +1 -1
  154. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.js +15 -0
  155. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts.map +1 -1
  156. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.js +10 -9
  157. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts +1 -1
  158. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts.map +1 -1
  159. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.js +32 -3
  160. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/local-vector-index-port.d.ts +2 -0
  161. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/local-vector-index-port.d.ts.map +1 -1
  162. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/local-vector-index-port.js +25 -1
  163. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/usearch-ann-index.d.ts +2 -0
  164. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/usearch-ann-index.d.ts.map +1 -1
  165. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/usearch-ann-index.js +21 -3
  166. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/vector-index.d.ts +3 -0
  167. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/vector-index.d.ts.map +1 -1
  168. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/vector-index.js +2 -0
  169. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store-content-encryption.d.ts +4 -1
  170. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store-content-encryption.d.ts.map +1 -1
  171. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store-content-encryption.js +41 -6
  172. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts +11 -0
  173. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts.map +1 -1
  174. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.js +75 -2
  175. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
  176. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
  177. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
  178. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
  179. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
  180. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
  181. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/consolidate.d.ts +1 -0
  182. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/consolidate.d.ts.map +1 -1
  183. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/consolidate.js +26 -6
  184. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/index.d.ts +2 -1
  185. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/index.d.ts.map +1 -1
  186. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/index.js +1 -0
  187. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/log-port.d.ts +19 -0
  188. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/log-port.d.ts.map +1 -0
  189. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/log-port.js +112 -0
  190. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/types.d.ts +2 -0
  191. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/types.d.ts.map +1 -1
  192. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
  193. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
  194. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
  195. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
  196. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
  197. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
  198. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
  199. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
  200. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
  201. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/cipher.d.ts +12 -0
  202. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/cipher.d.ts.map +1 -1
  203. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/cipher.js +32 -0
  204. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/db.d.ts +12 -2
  205. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/db.d.ts.map +1 -1
  206. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/db.js +171 -7
  207. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/index.d.ts +2 -0
  208. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/index.d.ts.map +1 -1
  209. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/index.js +17 -0
  210. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/migrate-encrypt.d.ts +25 -1
  211. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/migrate-encrypt.d.ts.map +1 -1
  212. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/migrate-encrypt.js +56 -4
  213. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.d.ts +2 -1
  214. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.d.ts.map +1 -1
  215. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/schema.js +15 -4
  216. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault-log.d.ts +30 -0
  217. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault-log.d.ts.map +1 -0
  218. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault-log.js +139 -0
  219. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.d.ts +21 -1
  220. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.d.ts.map +1 -1
  221. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/vault.js +37 -8
  222. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
  223. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
  224. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
  225. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +3 -0
  226. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
  227. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +71 -5
  228. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts +4 -1
  229. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts.map +1 -1
  230. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.js +14 -0
  231. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -1
  232. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +19 -6
  233. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts +4 -0
  234. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts.map +1 -1
  235. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.js +26 -1
  236. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/replay.d.ts +15 -0
  237. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/replay.d.ts.map +1 -0
  238. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/replay.js +88 -0
  239. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +5 -0
  240. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
  241. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +19 -1
  242. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
  243. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
  244. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +3 -3
  245. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
  246. package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
  247. package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
  248. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts +2 -1
  249. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts.map +1 -1
  250. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.js +13 -1
  251. package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts +2 -0
  252. package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts.map +1 -1
  253. package/node_modules/@oscharko-dev/keiko-security/dist/index.js +1 -0
  254. package/node_modules/@oscharko-dev/keiko-security/dist/log-port.d.ts +20 -0
  255. package/node_modules/@oscharko-dev/keiko-security/dist/log-port.d.ts.map +1 -0
  256. package/node_modules/@oscharko-dev/keiko-security/dist/log-port.js +130 -0
  257. package/node_modules/@oscharko-dev/keiko-security/dist/macos-keychain.d.ts +10 -0
  258. package/node_modules/@oscharko-dev/keiko-security/dist/macos-keychain.d.ts.map +1 -1
  259. package/node_modules/@oscharko-dev/keiko-security/dist/macos-keychain.js +43 -1
  260. package/node_modules/@oscharko-dev/keiko-security/dist/secret-vault.d.ts +22 -1
  261. package/node_modules/@oscharko-dev/keiko-security/dist/secret-vault.d.ts.map +1 -1
  262. package/node_modules/@oscharko-dev/keiko-security/dist/secret-vault.js +53 -10
  263. package/node_modules/@oscharko-dev/keiko-security/dist/sqlite-corruption.d.ts +3 -0
  264. package/node_modules/@oscharko-dev/keiko-security/dist/sqlite-corruption.d.ts.map +1 -1
  265. package/node_modules/@oscharko-dev/keiko-security/dist/sqlite-corruption.js +12 -3
  266. package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
  267. package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
  268. package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
  269. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/credentialVault.d.ts +2 -0
  270. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/credentialVault.d.ts.map +1 -1
  271. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/credentialVault.js +1 -0
  272. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/httpPort.d.ts +1 -0
  273. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/httpPort.d.ts.map +1 -1
  274. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/httpPort.js +24 -1
  275. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncRoutes.d.ts.map +1 -1
  276. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncRoutes.js +4 -3
  277. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/wiring.d.ts +2 -0
  278. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/wiring.d.ts.map +1 -1
  279. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/wiring.js +1 -0
  280. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/writeActionRoutes.d.ts.map +1 -1
  281. package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/writeActionRoutes.js +4 -3
  282. package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts +4 -0
  283. package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts.map +1 -1
  284. package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.js +80 -0
  285. package/node_modules/@oscharko-dev/keiko-server/dist/browser.d.ts +1 -1
  286. package/node_modules/@oscharko-dev/keiko-server/dist/browser.d.ts.map +1 -1
  287. package/node_modules/@oscharko-dev/keiko-server/dist/browser.js +10 -3
  288. package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-evidence.d.ts.map +1 -1
  289. package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-evidence.js +9 -2
  290. package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.d.ts.map +1 -1
  291. package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.js +26 -12
  292. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts +15 -2
  293. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts.map +1 -1
  294. package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.js +123 -28
  295. package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.d.ts.map +1 -1
  296. package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.js +50 -36
  297. package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.d.ts +5 -0
  298. package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.d.ts.map +1 -0
  299. package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.js +150 -0
  300. package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionChannel.d.ts.map +1 -1
  301. package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionChannel.js +3 -3
  302. package/node_modules/@oscharko-dev/keiko-server/dist/coding-context/codingContextRoutes.d.ts.map +1 -1
  303. package/node_modules/@oscharko-dev/keiko-server/dist/coding-context/codingContextRoutes.js +3 -1
  304. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.d.ts.map +1 -1
  305. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.js +3 -3
  306. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.js +19 -4
  307. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.d.ts.map +1 -1
  308. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.js +23 -3
  309. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts.map +1 -1
  310. package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.js +20 -6
  311. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
  312. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +8 -6
  313. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-attachment-store.d.ts +9 -0
  314. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-attachment-store.d.ts.map +1 -1
  315. package/node_modules/@oscharko-dev/keiko-server/dist/conversation-attachment-store.js +2 -0
  316. package/node_modules/@oscharko-dev/keiko-server/dist/correlation.d.ts +1 -0
  317. package/node_modules/@oscharko-dev/keiko-server/dist/correlation.d.ts.map +1 -1
  318. package/node_modules/@oscharko-dev/keiko-server/dist/correlation.js +9 -0
  319. package/node_modules/@oscharko-dev/keiko-server/dist/credentialPersistence.d.ts +5 -0
  320. package/node_modules/@oscharko-dev/keiko-server/dist/credentialPersistence.d.ts.map +1 -1
  321. package/node_modules/@oscharko-dev/keiko-server/dist/credentialPersistence.js +19 -1
  322. package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.d.ts +9 -0
  323. package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.d.ts.map +1 -1
  324. package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.js +1 -0
  325. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
  326. package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +32 -5
  327. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +16 -5
  328. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
  329. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +301 -102
  330. package/node_modules/@oscharko-dev/keiko-server/dist/editor/completionRoutes.d.ts.map +1 -1
  331. package/node_modules/@oscharko-dev/keiko-server/dist/editor/completionRoutes.js +3 -2
  332. package/node_modules/@oscharko-dev/keiko-server/dist/editor/hotExitStore.d.ts +2 -0
  333. package/node_modules/@oscharko-dev/keiko-server/dist/editor/hotExitStore.d.ts.map +1 -1
  334. package/node_modules/@oscharko-dev/keiko-server/dist/editor/hotExitStore.js +1 -0
  335. package/node_modules/@oscharko-dev/keiko-server/dist/editor/inlineCompletionRoutes.d.ts.map +1 -1
  336. package/node_modules/@oscharko-dev/keiko-server/dist/editor/inlineCompletionRoutes.js +3 -2
  337. package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryCapture.d.ts +2 -1
  338. package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryCapture.d.ts.map +1 -1
  339. package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryCapture.js +8 -4
  340. package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryStore.d.ts +9 -0
  341. package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryStore.d.ts.map +1 -1
  342. package/node_modules/@oscharko-dev/keiko-server/dist/editor/localHistory/localHistoryStore.js +2 -0
  343. package/node_modules/@oscharko-dev/keiko-server/dist/editor/patchApplyRoutes.d.ts.map +1 -1
  344. package/node_modules/@oscharko-dev/keiko-server/dist/editor/patchApplyRoutes.js +3 -1
  345. package/node_modules/@oscharko-dev/keiko-server/dist/files.d.ts.map +1 -1
  346. package/node_modules/@oscharko-dev/keiko-server/dist/files.js +24 -14
  347. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-error-diagnostic.d.ts +8 -0
  348. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-error-diagnostic.d.ts.map +1 -0
  349. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-error-diagnostic.js +26 -0
  350. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
  351. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +7 -29
  352. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  353. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +35 -15
  354. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/mutationEvidenceLedger.d.ts.map +1 -1
  355. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/mutationEvidenceLedger.js +17 -3
  356. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/syncEvidence.d.ts.map +1 -1
  357. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/syncEvidence.js +10 -3
  358. package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.d.ts +2 -0
  359. package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.d.ts.map +1 -1
  360. package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.js +20 -8
  361. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-judge.d.ts +1 -1
  362. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-judge.d.ts.map +1 -1
  363. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-judge.js +2 -1
  364. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-stage.d.ts.map +1 -1
  365. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-entailment-stage.js +8 -6
  366. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts +2 -1
  367. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
  368. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +3 -2
  369. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts +1 -1
  370. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts.map +1 -1
  371. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +2 -1
  372. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts +1 -1
  373. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
  374. package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +66 -42
  375. package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts +6 -2
  376. package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts.map +1 -1
  377. package/node_modules/@oscharko-dev/keiko-server/dist/index.js +39 -6
  378. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts +1 -1
  379. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
  380. package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +22 -10
  381. package/node_modules/@oscharko-dev/keiko-server/dist/localKnowledgeKeyProvider.d.ts +2 -0
  382. package/node_modules/@oscharko-dev/keiko-server/dist/localKnowledgeKeyProvider.d.ts.map +1 -1
  383. package/node_modules/@oscharko-dev/keiko-server/dist/localKnowledgeKeyProvider.js +1 -0
  384. package/node_modules/@oscharko-dev/keiko-server/dist/memory-audit-handler.d.ts.map +1 -1
  385. package/node_modules/@oscharko-dev/keiko-server/dist/memory-audit-handler.js +13 -6
  386. package/node_modules/@oscharko-dev/keiko-server/dist/memory-conflict-advisory.d.ts.map +1 -1
  387. package/node_modules/@oscharko-dev/keiko-server/dist/memory-conflict-advisory.js +46 -26
  388. package/node_modules/@oscharko-dev/keiko-server/dist/memory-consolidation-handlers.d.ts.map +1 -1
  389. package/node_modules/@oscharko-dev/keiko-server/dist/memory-consolidation-handlers.js +66 -74
  390. package/node_modules/@oscharko-dev/keiko-server/dist/memory-conv-handlers.d.ts.map +1 -1
  391. package/node_modules/@oscharko-dev/keiko-server/dist/memory-conv-handlers.js +11 -56
  392. package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.d.ts +1 -1
  393. package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.d.ts.map +1 -1
  394. package/node_modules/@oscharko-dev/keiko-server/dist/memory-handlers.js +112 -91
  395. package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.d.ts +5 -3
  396. package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.d.ts.map +1 -1
  397. package/node_modules/@oscharko-dev/keiko-server/dist/memory-maintenance-handlers.js +37 -13
  398. package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.d.ts.map +1 -1
  399. package/node_modules/@oscharko-dev/keiko-server/dist/memory-retrieval-signals.js +40 -23
  400. package/node_modules/@oscharko-dev/keiko-server/dist/memory-salience.d.ts.map +1 -1
  401. package/node_modules/@oscharko-dev/keiko-server/dist/memory-salience.js +59 -30
  402. package/node_modules/@oscharko-dev/keiko-server/dist/observability/error-classification.d.ts +25 -0
  403. package/node_modules/@oscharko-dev/keiko-server/dist/observability/error-classification.d.ts.map +1 -0
  404. package/node_modules/@oscharko-dev/keiko-server/dist/observability/error-classification.js +115 -0
  405. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts +2 -0
  406. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts.map +1 -1
  407. package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.js +220 -21
  408. package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts.map +1 -1
  409. package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.js +2 -0
  410. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts +12 -3
  411. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts.map +1 -1
  412. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.js +197 -41
  413. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts +1 -0
  414. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts.map +1 -1
  415. package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.js +11 -1
  416. package/node_modules/@oscharko-dev/keiko-server/dist/observability/stack-frames.d.ts +5 -0
  417. package/node_modules/@oscharko-dev/keiko-server/dist/observability/stack-frames.d.ts.map +1 -0
  418. package/node_modules/@oscharko-dev/keiko-server/dist/observability/stack-frames.js +261 -0
  419. package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts +11 -0
  420. package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts.map +1 -1
  421. package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.js +17 -0
  422. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/index.d.ts +1 -1
  423. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/index.d.ts.map +1 -1
  424. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figma/index.js +1 -1
  425. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotAdapter.d.ts.map +1 -1
  426. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotAdapter.js +3 -0
  427. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotOrchestration.d.ts.map +1 -1
  428. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotOrchestration.js +13 -3
  429. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.d.ts.map +1 -1
  430. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/figmaSnapshotRoutes.js +22 -7
  431. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/generationPort.d.ts +1 -1
  432. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/generationPort.d.ts.map +1 -1
  433. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/generationPort.js +6 -5
  434. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/handoffRoutes.js +1 -1
  435. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.d.ts +1 -0
  436. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.d.ts.map +1 -1
  437. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/judgePort.js +1 -0
  438. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelPolicyRoutes.d.ts +2 -2
  439. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelPolicyRoutes.d.ts.map +1 -1
  440. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/modelPolicyRoutes.js +43 -67
  441. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.d.ts.map +1 -1
  442. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/reCheckRoutes.js +10 -7
  443. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runExecution.d.ts.map +1 -1
  444. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runExecution.js +8 -8
  445. package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.js +1 -1
  446. package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.d.ts +1 -0
  447. package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.d.ts.map +1 -1
  448. package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.js +7 -5
  449. package/node_modules/@oscharko-dev/keiko-server/dist/relationship-handlers.d.ts.map +1 -1
  450. package/node_modules/@oscharko-dev/keiko-server/dist/relationship-handlers.js +39 -41
  451. package/node_modules/@oscharko-dev/keiko-server/dist/request-cancellation.d.ts +6 -0
  452. package/node_modules/@oscharko-dev/keiko-server/dist/request-cancellation.d.ts.map +1 -1
  453. package/node_modules/@oscharko-dev/keiko-server/dist/request-cancellation.js +18 -3
  454. package/node_modules/@oscharko-dev/keiko-server/dist/routes.d.ts.map +1 -1
  455. package/node_modules/@oscharko-dev/keiko-server/dist/routes.js +8 -3
  456. package/node_modules/@oscharko-dev/keiko-server/dist/run-engine.d.ts +2 -2
  457. package/node_modules/@oscharko-dev/keiko-server/dist/run-engine.d.ts.map +1 -1
  458. package/node_modules/@oscharko-dev/keiko-server/dist/run-engine.js +34 -22
  459. package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.d.ts.map +1 -1
  460. package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.js +10 -6
  461. package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts +9 -1
  462. package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts.map +1 -1
  463. package/node_modules/@oscharko-dev/keiko-server/dist/server.js +153 -35
  464. package/node_modules/@oscharko-dev/keiko-server/dist/sink.d.ts +4 -0
  465. package/node_modules/@oscharko-dev/keiko-server/dist/sink.d.ts.map +1 -1
  466. package/node_modules/@oscharko-dev/keiko-server/dist/sink.js +98 -0
  467. package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.d.ts +27 -2
  468. package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.d.ts.map +1 -1
  469. package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.js +110 -3
  470. package/node_modules/@oscharko-dev/keiko-server/dist/sse.d.ts +2 -1
  471. package/node_modules/@oscharko-dev/keiko-server/dist/sse.d.ts.map +1 -1
  472. package/node_modules/@oscharko-dev/keiko-server/dist/sse.js +13 -6
  473. package/node_modules/@oscharko-dev/keiko-server/dist/store/db.d.ts +15 -1
  474. package/node_modules/@oscharko-dev/keiko-server/dist/store/db.d.ts.map +1 -1
  475. package/node_modules/@oscharko-dev/keiko-server/dist/store/db.js +190 -2
  476. package/node_modules/@oscharko-dev/keiko-server/dist/store/index.d.ts +1 -1
  477. package/node_modules/@oscharko-dev/keiko-server/dist/store/index.d.ts.map +1 -1
  478. package/node_modules/@oscharko-dev/keiko-server/dist/store/index.js +1 -1
  479. package/node_modules/@oscharko-dev/keiko-server/dist/store/messages.d.ts.map +1 -1
  480. package/node_modules/@oscharko-dev/keiko-server/dist/store/messages.js +16 -1
  481. package/node_modules/@oscharko-dev/keiko-server/dist/store-fingerprints.d.ts +29 -0
  482. package/node_modules/@oscharko-dev/keiko-server/dist/store-fingerprints.d.ts.map +1 -0
  483. package/node_modules/@oscharko-dev/keiko-server/dist/store-fingerprints.js +135 -0
  484. package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.d.ts +1 -1
  485. package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.d.ts.map +1 -1
  486. package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.js +10 -3
  487. package/node_modules/@oscharko-dev/keiko-server/dist/update-preflight-catalog.d.ts +2 -1
  488. package/node_modules/@oscharko-dev/keiko-server/dist/update-preflight-catalog.d.ts.map +1 -1
  489. package/node_modules/@oscharko-dev/keiko-server/dist/update-preflight-catalog.js +17 -2
  490. package/node_modules/@oscharko-dev/keiko-server/dist/update-preflight-routes.d.ts.map +1 -1
  491. package/node_modules/@oscharko-dev/keiko-server/dist/update-preflight-routes.js +2 -2
  492. package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation-routes.d.ts.map +1 -1
  493. package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation-routes.js +3 -1
  494. package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation.d.ts +1 -1
  495. package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation.d.ts.map +1 -1
  496. package/node_modules/@oscharko-dev/keiko-server/dist/update-remediation.js +27 -24
  497. package/node_modules/@oscharko-dev/keiko-server/dist/voice-handlers.d.ts.map +1 -1
  498. package/node_modules/@oscharko-dev/keiko-server/dist/voice-handlers.js +2 -1
  499. package/node_modules/@oscharko-dev/keiko-server/dist/voice-live-dictation.d.ts.map +1 -1
  500. package/node_modules/@oscharko-dev/keiko-server/dist/voice-live-dictation.js +15 -6
  501. package/node_modules/@oscharko-dev/keiko-server/dist/voice-realtime.d.ts +6 -0
  502. package/node_modules/@oscharko-dev/keiko-server/dist/voice-realtime.d.ts.map +1 -1
  503. package/node_modules/@oscharko-dev/keiko-server/dist/voice-realtime.js +80 -16
  504. package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.d.ts +2 -0
  505. package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.d.ts.map +1 -1
  506. package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.js +24 -11
  507. package/node_modules/@oscharko-dev/keiko-server/package.json +21 -21
  508. package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
  509. package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
  510. package/node_modules/@oscharko-dev/keiko-tools/package.json +5 -5
  511. package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
  512. package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
  513. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
  514. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
  515. package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
  516. package/package.json +28 -25
  517. package/release-impact.catalog.json +115 -0
  518. package/vendor/oscharko-dev-keiko-cli-0.3.17.tgz +0 -0
  519. package/vendor/{oscharko-dev-keiko-connectors-0.3.15.tgz → oscharko-dev-keiko-connectors-0.3.17.tgz} +0 -0
  520. package/vendor/oscharko-dev-keiko-contracts-0.3.17.tgz +0 -0
  521. package/vendor/{oscharko-dev-keiko-evaluations-0.3.15.tgz → oscharko-dev-keiko-evaluations-0.3.17.tgz} +0 -0
  522. package/vendor/{oscharko-dev-keiko-evidence-0.3.15.tgz → oscharko-dev-keiko-evidence-0.3.17.tgz} +0 -0
  523. package/vendor/{oscharko-dev-keiko-git-0.3.15.tgz → oscharko-dev-keiko-git-0.3.17.tgz} +0 -0
  524. package/vendor/oscharko-dev-keiko-harness-0.3.17.tgz +0 -0
  525. package/vendor/oscharko-dev-keiko-local-knowledge-0.3.17.tgz +0 -0
  526. package/vendor/{oscharko-dev-keiko-memory-capture-0.3.15.tgz → oscharko-dev-keiko-memory-capture-0.3.17.tgz} +0 -0
  527. package/vendor/oscharko-dev-keiko-memory-consolidation-0.3.17.tgz +0 -0
  528. package/vendor/{oscharko-dev-keiko-memory-governance-0.3.15.tgz → oscharko-dev-keiko-memory-governance-0.3.17.tgz} +0 -0
  529. package/vendor/{oscharko-dev-keiko-memory-retrieval-0.3.15.tgz → oscharko-dev-keiko-memory-retrieval-0.3.17.tgz} +0 -0
  530. package/vendor/oscharko-dev-keiko-memory-vault-0.3.17.tgz +0 -0
  531. package/vendor/oscharko-dev-keiko-model-gateway-0.3.17.tgz +0 -0
  532. package/vendor/{oscharko-dev-keiko-quality-intelligence-0.3.15.tgz → oscharko-dev-keiko-quality-intelligence-0.3.17.tgz} +0 -0
  533. package/vendor/{oscharko-dev-keiko-sandbox-0.3.15.tgz → oscharko-dev-keiko-sandbox-0.3.17.tgz} +0 -0
  534. package/vendor/oscharko-dev-keiko-sdk-0.3.17.tgz +0 -0
  535. package/vendor/oscharko-dev-keiko-security-0.3.17.tgz +0 -0
  536. package/vendor/oscharko-dev-keiko-server-0.3.17.tgz +0 -0
  537. package/vendor/{oscharko-dev-keiko-tools-0.3.15.tgz → oscharko-dev-keiko-tools-0.3.17.tgz} +0 -0
  538. package/vendor/{oscharko-dev-keiko-verification-0.3.15.tgz → oscharko-dev-keiko-verification-0.3.17.tgz} +0 -0
  539. package/vendor/{oscharko-dev-keiko-workflows-0.3.15.tgz → oscharko-dev-keiko-workflows-0.3.17.tgz} +0 -0
  540. package/vendor/{oscharko-dev-keiko-workspace-0.3.15.tgz → oscharko-dev-keiko-workspace-0.3.17.tgz} +0 -0
  541. package/dist/ui/static/_next/static/chunks/03la2o0tcodk_.js +0 -1
  542. package/dist/ui/static/_next/static/chunks/089ft_ee-2y20.js +0 -1
  543. package/dist/ui/static/_next/static/chunks/09ifk61aybcwe.js +0 -1
  544. package/dist/ui/static/_next/static/chunks/0iwjev0wot4b0.js +0 -1
  545. package/dist/ui/static/_next/static/chunks/0lorosh9iyl5i.js +0 -7
  546. package/dist/ui/static/_next/static/chunks/0q76qswp80ci1.js +0 -1
  547. package/dist/ui/static/_next/static/chunks/130bqt0eb54h4.js +0 -1
  548. package/dist/ui/static/_next/static/chunks/1pcygmx7pvpwp.js +0 -4
  549. package/dist/ui/static/_next/static/chunks/1s1u4fx4mdurk.js +0 -1
  550. package/dist/ui/static/_next/static/chunks/1wnmpolx-w3e0.js +0 -1
  551. package/dist/ui/static/_next/static/chunks/23jcx3s74h89k.js +0 -1
  552. package/dist/ui/static/_next/static/chunks/26sy339azhbd8.js +0 -1
  553. package/dist/ui/static/_next/static/chunks/2c9gq9vpyd9sm.js +0 -1
  554. package/dist/ui/static/_next/static/chunks/2iqsdgq5z7zi-.js +0 -1
  555. package/dist/ui/static/_next/static/chunks/2iuxjus3qppec.js +0 -1
  556. package/dist/ui/static/_next/static/chunks/2t0ktf1dxwv0_.js +0 -1
  557. package/dist/ui/static/_next/static/chunks/2wvo7q19g065e.js +0 -1
  558. package/dist/ui/static/_next/static/chunks/2xgtm8mmbv8mx.js +0 -1
  559. package/dist/ui/static/_next/static/chunks/32h72gk6uqdr0.js +0 -1
  560. package/dist/ui/static/_next/static/chunks/3ljwwkelljh81.js +0 -1
  561. package/dist/ui/static/_next/static/chunks/3pukrjhzlxlur.js +0 -1
  562. package/vendor/oscharko-dev-keiko-cli-0.3.15.tgz +0 -0
  563. package/vendor/oscharko-dev-keiko-contracts-0.3.15.tgz +0 -0
  564. package/vendor/oscharko-dev-keiko-harness-0.3.15.tgz +0 -0
  565. package/vendor/oscharko-dev-keiko-local-knowledge-0.3.15.tgz +0 -0
  566. package/vendor/oscharko-dev-keiko-memory-consolidation-0.3.15.tgz +0 -0
  567. package/vendor/oscharko-dev-keiko-memory-vault-0.3.15.tgz +0 -0
  568. package/vendor/oscharko-dev-keiko-model-gateway-0.3.15.tgz +0 -0
  569. package/vendor/oscharko-dev-keiko-sdk-0.3.15.tgz +0 -0
  570. package/vendor/oscharko-dev-keiko-security-0.3.15.tgz +0 -0
  571. package/vendor/oscharko-dev-keiko-server-0.3.15.tgz +0 -0
  572. /package/dist/ui/static/_next/static/{4j3JDaPBERRu_ZIgeR1VQ → C3-P-HHUm15MLLjtORoPG}/_buildManifest.js +0 -0
  573. /package/dist/ui/static/_next/static/{4j3JDaPBERRu_ZIgeR1VQ → C3-P-HHUm15MLLjtORoPG}/_clientMiddlewareManifest.js +0 -0
  574. /package/dist/ui/static/_next/static/{4j3JDaPBERRu_ZIgeR1VQ → C3-P-HHUm15MLLjtORoPG}/_ssgManifest.js +0 -0
@@ -0,0 +1,782 @@
1
+ // `keiko support analyze` — pure logic: parsing, grouping, and ordering `server*.log` lines
2
+ // (whether raw, or copied verbatim into a `keiko support export` bundle) by `correlationId`.
3
+ //
4
+ // Wave 6 (epic #3233 closeout, w6-log-analyze-full) extends the Wave 1 minimal `LogTimeline`
5
+ // (`lines`, `firstTs`, `lastTs`, `durationMs`, `errorKinds`) with `frames` (the union of every
6
+ // `frames[]` entry seen for the correlationId, occurrence order, capped) — OMITTED, never an
7
+ // empty array, when no line in the timeline carried frames, the same no-placeholder-stubbing
8
+ // discipline the rest of this file already follows. It also adds whole-file `clusters`
9
+ // (`OpCluster[]`, grouping every parsed line by `(category, op, errorKind)` regardless of
10
+ // correlationId) and `buildReproductionSeed`/`renderGatewayReplayScriptFixture`, which assemble a
11
+ // `ReproductionSeed` — a `gatewayScript`/`httpRequest`/`storeFingerprint`/`indexingJob`/
12
+ // `stackFrames`/`causeChain` reconstruction for one correlationId, plus a `warnings` field naming
13
+ // exactly what could NOT be reconstructed and why. `support.ts` owns argv parsing and wires these
14
+ // exports (plus `renderHumanReproductionSeed`, below) to `--clusters`/`--seed`/`--emit-fixture`.
15
+ //
16
+ // Ordering: `seq` has shipped unconditionally since the v2 envelope (schemaVersion 2), so within
17
+ // one process lifetime a v2 line is ordered by `seq` — never by its position in the file. ACROSS
18
+ // process lifetimes the envelope promises no order (ADR-0173 D2), so lifetimes are ranked by the
19
+ // position of their FIRST line in the file — the order the operator's machine actually produced
20
+ // them — and a lifetime's lines are kept together behind that rank. A line written before the v2
21
+ // envelope shipped (schemaVersion 1, no pid/instanceId/seq) can still be present in a server.log
22
+ // spanning the upgrade (the sink's own 7-day retention window); it has no lifetime to belong to, so
23
+ // it ranks by its own file position. The result is ONE total order (rank, then seq) rather than a
24
+ // comparator that switches rule per pair, which is not transitive and would hand `sort` an
25
+ // undefined result the moment a pre-v2 line sits between two v2 lines of the same process.
26
+ //
27
+ // `AnalyzeAllResult` (whole-file scope, unlike the per-`LogTimeline` fields above) carries three
28
+ // more fields the analyzer CAN populate honestly today (ADR-0173 D9/D10): `processes` — one
29
+ // summary per process lifetime, built from every line with a full (pid, instanceId, seq) triple
30
+ // regardless of correlationId, so the correlationId-less `process.*` lifecycle lines stay
31
+ // reconstructable; `legacyLineCount` — lines successfully parsed but missing that triple; and
32
+ // `warnings`, which carries exactly one entry naming `legacyLineCount` when it is nonzero. This is
33
+ // the honest machine-readable admission that file-position ordering was used for some lines, which
34
+ // Wave 6 extends rather than the analyzer silently omitting the caveat.
35
+ //
36
+ // `support.ts` owns argv parsing, file reads, and stdout/stderr; this file owns everything that
37
+ // can be exercised on an in-memory string.
38
+ import { createHash } from "node:crypto";
39
+ import { isStoreFingerprint } from "@oscharko-dev/keiko-contracts";
40
+ const KNOWN_ENVELOPE_KEYS = new Set([
41
+ "ts",
42
+ "schemaVersion",
43
+ "pid",
44
+ "instanceId",
45
+ "seq",
46
+ "level",
47
+ "category",
48
+ "op",
49
+ "correlationId",
50
+ "durationMs",
51
+ "status",
52
+ "errorKind",
53
+ "frames",
54
+ "causeChain",
55
+ ]);
56
+ function splitLines(text) {
57
+ if (text.length === 0)
58
+ return [];
59
+ const lines = text.split("\n");
60
+ if (lines.at(-1) === "")
61
+ lines.pop();
62
+ return lines;
63
+ }
64
+ function tryParseJsonObject(raw) {
65
+ try {
66
+ const value = JSON.parse(raw);
67
+ return typeof value === "object" && value !== null && !Array.isArray(value)
68
+ ? value
69
+ : undefined;
70
+ }
71
+ catch {
72
+ return undefined;
73
+ }
74
+ }
75
+ // A support bundle's first line is a manifest object tagged `$section: "manifest"`; a raw
76
+ // server.log's first line is an ordinary log record (ts+category+op, no `$section`). Any other
77
+ // shape (unparseable, empty file) is treated as a raw log — its own line-level malformed-line
78
+ // accounting handles the rest.
79
+ export function detectSourceKind(firstLine) {
80
+ if (firstLine === undefined)
81
+ return "raw-log";
82
+ const parsed = tryParseJsonObject(firstLine);
83
+ return parsed?.$section === "manifest" ? "bundle" : "raw-log";
84
+ }
85
+ function isStringArray(value) {
86
+ return Array.isArray(value) && value.every((entry) => typeof entry === "string");
87
+ }
88
+ function optionalString(record, key) {
89
+ const value = record[key];
90
+ return typeof value === "string" ? value : undefined;
91
+ }
92
+ function optionalNumber(record, key) {
93
+ const value = record[key];
94
+ return typeof value === "number" ? value : undefined;
95
+ }
96
+ function optionalStringArray(value) {
97
+ return isStringArray(value) ? value : undefined;
98
+ }
99
+ // Bucketing every OTHER top-level key on the parsed record: `formatServerLogLine` flattens an
100
+ // event's `extra` object onto the top level of the written JSON (there is no nested `.extra` key
101
+ // on disk), so reconstructing a display-only `extra` bucket means collecting whatever survived
102
+ // redaction beyond the known envelope keys.
103
+ function extraFields(record) {
104
+ // Null prototype: a `"__proto__"` key parsed out of a log line is an ordinary own property on
105
+ // `record` (`JSON.parse` defines it via `[[DefineOwnProperty]]`, not the exotic setter), but
106
+ // assigning it onto a plain `{}` here would hit `Object.prototype`'s inherited `__proto__`
107
+ // setter instead of defining an own property — silently dropping the field from the reported
108
+ // `extra` bucket (and, for an object value, replacing `extra`'s own prototype) rather than
109
+ // reporting it, which is exactly the silent skip this module's header states it must not do.
110
+ const extra = Object.create(null);
111
+ let hasAny = false;
112
+ for (const key of Object.keys(record)) {
113
+ if (KNOWN_ENVELOPE_KEYS.has(key))
114
+ continue;
115
+ extra[key] = record[key];
116
+ hasAny = true;
117
+ }
118
+ return hasAny ? extra : undefined;
119
+ }
120
+ function readIdentity(record) {
121
+ return {
122
+ pid: optionalNumber(record, "pid"),
123
+ instanceId: optionalString(record, "instanceId"),
124
+ seq: optionalNumber(record, "seq"),
125
+ };
126
+ }
127
+ // Split out of `buildView` purely to keep that function's cyclomatic complexity under the
128
+ // repository's ceiling (AGENTS.md §6) — the three identity fields are optional for exactly the
129
+ // same "a pre-v2 line has none" reason as every other field there.
130
+ function identityFields(identity) {
131
+ return {
132
+ ...(identity.pid === undefined ? {} : { pid: identity.pid }),
133
+ ...(identity.instanceId === undefined ? {} : { instanceId: identity.instanceId }),
134
+ ...(identity.seq === undefined ? {} : { seq: identity.seq }),
135
+ };
136
+ }
137
+ function buildView(ts, category, op, record, identity) {
138
+ const level = optionalString(record, "level");
139
+ const errorKind = optionalString(record, "errorKind");
140
+ const durationMs = optionalNumber(record, "durationMs");
141
+ const status = optionalNumber(record, "status");
142
+ const frames = optionalStringArray(record.frames);
143
+ const causeChain = optionalStringArray(record.causeChain);
144
+ const extra = extraFields(record);
145
+ return {
146
+ ts,
147
+ category,
148
+ op,
149
+ ...identityFields(identity),
150
+ ...(level === undefined ? {} : { level }),
151
+ ...(errorKind === undefined ? {} : { errorKind }),
152
+ ...(durationMs === undefined ? {} : { durationMs }),
153
+ ...(status === undefined ? {} : { status }),
154
+ ...(frames === undefined ? {} : { frames }),
155
+ ...(causeChain === undefined ? {} : { causeChain }),
156
+ ...(extra === undefined ? {} : { extra }),
157
+ };
158
+ }
159
+ // A line is malformed when it is not valid JSON, or is valid JSON that is not shaped like a log
160
+ // record (missing ts/category/op) — evidence of corruption, per AGENTS.md §7 never silently
161
+ // skipped. A `$section`-tagged line is bundle metadata, not corruption: it is skipped, not counted.
162
+ function classifyLine(raw, fileIndex) {
163
+ const record = tryParseJsonObject(raw);
164
+ if (record === undefined)
165
+ return { kind: "malformed" };
166
+ if (typeof record.$section === "string")
167
+ return { kind: "section" };
168
+ const ts = optionalString(record, "ts");
169
+ const category = optionalString(record, "category");
170
+ const op = optionalString(record, "op");
171
+ if (ts === undefined || category === undefined || op === undefined) {
172
+ return { kind: "malformed" };
173
+ }
174
+ const identity = readIdentity(record);
175
+ return {
176
+ kind: "line",
177
+ parsed: {
178
+ view: buildView(ts, category, op, record, identity),
179
+ correlationId: optionalString(record, "correlationId"),
180
+ hasFullIdentity: identity.pid !== undefined &&
181
+ identity.instanceId !== undefined &&
182
+ identity.seq !== undefined,
183
+ fileIndex,
184
+ },
185
+ };
186
+ }
187
+ function groupByCorrelationId(records) {
188
+ const groups = new Map();
189
+ for (const record of records) {
190
+ if (record.correlationId === undefined)
191
+ continue;
192
+ const existing = groups.get(record.correlationId);
193
+ if (existing === undefined) {
194
+ groups.set(record.correlationId, [record]);
195
+ }
196
+ else {
197
+ existing.push(record);
198
+ }
199
+ }
200
+ return groups;
201
+ }
202
+ function orZero(value) {
203
+ return value ?? 0;
204
+ }
205
+ function orEmpty(value) {
206
+ return value ?? "";
207
+ }
208
+ // The process-lifetime key of a v2 line; a pre-v2 line has none.
209
+ function lifetimeKey(line) {
210
+ return line.hasFullIdentity
211
+ ? `${String(orZero(line.view.pid))}:${orEmpty(line.view.instanceId)}`
212
+ : undefined;
213
+ }
214
+ function assignOrder(group) {
215
+ const firstSeen = new Map();
216
+ return group.map((line) => {
217
+ const key = lifetimeKey(line);
218
+ if (key === undefined)
219
+ return { line, rank: line.fileIndex, within: line.fileIndex };
220
+ const rank = firstSeen.get(key) ?? line.fileIndex;
221
+ firstSeen.set(key, rank);
222
+ return { line, rank, within: orZero(line.view.seq) };
223
+ });
224
+ }
225
+ function compareOrdered(a, b) {
226
+ return a.rank === b.rank ? a.within - b.within : a.rank - b.rank;
227
+ }
228
+ function distinctInOrder(values) {
229
+ const seen = new Set();
230
+ const out = [];
231
+ for (const value of values) {
232
+ if (seen.has(value))
233
+ continue;
234
+ seen.add(value);
235
+ out.push(value);
236
+ }
237
+ return out;
238
+ }
239
+ function minMaxTs(values) {
240
+ let first = values[0] ?? "";
241
+ let last = values[0] ?? "";
242
+ for (const value of values) {
243
+ if (value < first)
244
+ first = value;
245
+ if (value > last)
246
+ last = value;
247
+ }
248
+ return { first, last };
249
+ }
250
+ // Wave 6 cap on `LogTimeline.frames`: the union is aggregated across every line in a (potentially
251
+ // long-running) timeline, not one line's own already-capped `frames[]` — a generous ceiling well
252
+ // above any single line's own 8-frame cap (ADR-0173 §2), never unbounded.
253
+ const MAX_TIMELINE_FRAMES = 32;
254
+ function aggregateFrames(views) {
255
+ const all = [];
256
+ for (const view of views) {
257
+ if (view.frames === undefined)
258
+ continue;
259
+ all.push(...view.frames);
260
+ }
261
+ return distinctInOrder(all).slice(0, MAX_TIMELINE_FRAMES);
262
+ }
263
+ function buildTimeline(correlationId, group) {
264
+ const views = [...assignOrder(group)].sort(compareOrdered).map((ordered) => ordered.line.view);
265
+ const { first, last } = minMaxTs(views.map((view) => view.ts));
266
+ const parsedFirst = Date.parse(first);
267
+ const parsedLast = Date.parse(last);
268
+ const durationMs = Number.isFinite(parsedFirst) && Number.isFinite(parsedLast) ? parsedLast - parsedFirst : 0;
269
+ const errorKinds = distinctInOrder(views.map((view) => view.errorKind).filter((kind) => kind !== undefined));
270
+ const frames = aggregateFrames(views);
271
+ return {
272
+ correlationId,
273
+ lines: views,
274
+ firstTs: first,
275
+ lastTs: last,
276
+ durationMs,
277
+ errorKinds,
278
+ ...(frames.length === 0 ? {} : { frames }),
279
+ };
280
+ }
281
+ function exitReasonOf(view) {
282
+ const reason = view.extra?.reason;
283
+ return typeof reason === "string" ? reason : undefined;
284
+ }
285
+ function newProcessAccum(view, pid, instanceId) {
286
+ const seq = orZero(view.seq);
287
+ return {
288
+ pid,
289
+ instanceId,
290
+ firstSeq: seq,
291
+ lastSeq: seq,
292
+ lineCount: 1,
293
+ firstTs: view.ts,
294
+ lastTs: view.ts,
295
+ started: view.op === "process.started" ? view.extra : undefined,
296
+ exitReason: view.op === "process.exiting" ? exitReasonOf(view) : undefined,
297
+ };
298
+ }
299
+ function mergeIntoProcessAccum(accum, view) {
300
+ const seq = orZero(view.seq);
301
+ accum.lineCount += 1;
302
+ accum.firstSeq = Math.min(accum.firstSeq, seq);
303
+ accum.lastSeq = Math.max(accum.lastSeq, seq);
304
+ if (view.ts < accum.firstTs)
305
+ accum.firstTs = view.ts;
306
+ if (view.ts > accum.lastTs)
307
+ accum.lastTs = view.ts;
308
+ if (view.op === "process.started" && view.extra !== undefined)
309
+ accum.started = view.extra;
310
+ if (view.op === "process.exiting") {
311
+ const reason = exitReasonOf(view);
312
+ if (reason !== undefined)
313
+ accum.exitReason = reason;
314
+ }
315
+ }
316
+ // Summarises every process lifetime seen across ALL parsed lines — including the lifecycle lines
317
+ // (`process.started`/`process.heartbeat`/`process.exiting`) that carry no correlationId and so
318
+ // never enter a `LogTimeline` — in first-file-appearance order (a `Map`'s insertion order, the
319
+ // same ranking rule `assignOrder` uses for timelines).
320
+ function buildProcessSummaries(lines) {
321
+ const accums = new Map();
322
+ for (const { view, hasFullIdentity } of lines) {
323
+ if (!hasFullIdentity || view.pid === undefined || view.instanceId === undefined)
324
+ continue;
325
+ const key = `${String(view.pid)}:${view.instanceId}`;
326
+ const existing = accums.get(key);
327
+ if (existing === undefined) {
328
+ accums.set(key, newProcessAccum(view, view.pid, view.instanceId));
329
+ }
330
+ else {
331
+ mergeIntoProcessAccum(existing, view);
332
+ }
333
+ }
334
+ return [...accums.values()];
335
+ }
336
+ const MAX_CLUSTER_SAMPLE_IDS = 5;
337
+ function clusterKey(category, op, errorKind) {
338
+ return `${category}\0${op}\0${errorKind ?? ""}`;
339
+ }
340
+ function newClusterAccum(category, op, errorKind) {
341
+ return { category, op, errorKind, count: 0, sampleCorrelationIds: [], seenIds: new Set() };
342
+ }
343
+ function addClusterSample(accum, correlationId) {
344
+ if (correlationId === undefined || accum.seenIds.has(correlationId))
345
+ return;
346
+ accum.seenIds.add(correlationId);
347
+ if (accum.sampleCorrelationIds.length < MAX_CLUSTER_SAMPLE_IDS) {
348
+ accum.sampleCorrelationIds.push(correlationId);
349
+ }
350
+ }
351
+ // Groups ALL parsed lines (correlated or not) by (category, op, errorKind), first-occurrence
352
+ // order — a `Map`'s insertion order, the same ranking rule every other aggregate in this file uses.
353
+ function buildOpClusters(lines) {
354
+ const accums = new Map();
355
+ for (const { view, correlationId } of lines) {
356
+ const errorKind = view.errorKind ?? null;
357
+ const key = clusterKey(view.category, view.op, errorKind);
358
+ const accum = accums.get(key) ?? newClusterAccum(view.category, view.op, errorKind);
359
+ accum.count += 1;
360
+ addClusterSample(accum, correlationId);
361
+ accums.set(key, accum);
362
+ }
363
+ return [...accums.values()].map((accum) => ({
364
+ category: accum.category,
365
+ op: accum.op,
366
+ errorKind: accum.errorKind,
367
+ count: accum.count,
368
+ sampleCorrelationIds: accum.sampleCorrelationIds,
369
+ }));
370
+ }
371
+ function buildWarnings(legacyLineCount) {
372
+ return legacyLineCount > 0
373
+ ? [
374
+ `${String(legacyLineCount)} line(s) predate the v2 envelope and were ordered by file position`,
375
+ ]
376
+ : [];
377
+ }
378
+ // Parses `text` (the full content of a raw server.log OR a support bundle), groups every line
379
+ // that carries a correlationId into one LogTimeline per id (first-occurrence order), and counts
380
+ // every line that could not be read as a log record. A line with no correlationId at all
381
+ // (`process.*` lines, a first-ever request before any id was assigned) belongs to no timeline and
382
+ // is neither malformed nor counted — this module only reconstructs correlated request/run stories.
383
+ export function analyzeLogText(text) {
384
+ const lines = splitLines(text);
385
+ const kind = detectSourceKind(lines[0]);
386
+ const contentLines = kind === "bundle" ? lines.slice(1) : lines;
387
+ const parsedLines = [];
388
+ let malformedLineCount = 0;
389
+ for (const [index, raw] of contentLines.entries()) {
390
+ const classification = classifyLine(raw, index);
391
+ if (classification.kind === "malformed")
392
+ malformedLineCount += 1;
393
+ if (classification.kind === "line")
394
+ parsedLines.push(classification.parsed);
395
+ }
396
+ const groups = groupByCorrelationId(parsedLines);
397
+ const timelines = [...groups.entries()].map(([correlationId, group]) => buildTimeline(correlationId, group));
398
+ const processes = buildProcessSummaries(parsedLines);
399
+ const legacyLineCount = parsedLines.filter((parsed) => !parsed.hasFullIdentity).length;
400
+ const warnings = buildWarnings(legacyLineCount);
401
+ const clusters = buildOpClusters(parsedLines);
402
+ return { timelines, malformedLineCount, processes, legacyLineCount, warnings, clusters };
403
+ }
404
+ export function findTimeline(result, correlationId) {
405
+ return result.timelines.find((timeline) => timeline.correlationId === correlationId);
406
+ }
407
+ function renderEventLine(view) {
408
+ const seq = view.seq !== undefined ? String(view.seq) : "-";
409
+ const level = view.level ?? "-";
410
+ const suffix = [
411
+ view.errorKind === undefined ? undefined : `[${view.errorKind}]`,
412
+ view.durationMs === undefined ? undefined : `[${String(view.durationMs)}ms]`,
413
+ ]
414
+ .filter((part) => part !== undefined)
415
+ .join(" ");
416
+ const base = `${view.ts} ${seq} ${level} ${view.category} ${view.op}`;
417
+ return suffix.length > 0 ? `${base} ${suffix}` : base;
418
+ }
419
+ export function renderHumanTimeline(timeline) {
420
+ const header = `correlationId=${timeline.correlationId} lines=${String(timeline.lines.length)} durationMs=${String(timeline.durationMs)}\n`;
421
+ if (timeline.lines.length === 0)
422
+ return header;
423
+ const body = timeline.lines.map((line) => ` ${renderEventLine(line)}`).join("\n");
424
+ return `${header}${body}\n`;
425
+ }
426
+ function renderProcessSummary(process) {
427
+ const seqRange = `${String(process.firstSeq)}-${String(process.lastSeq)}`;
428
+ const started = process.started === undefined ? "" : " started=yes";
429
+ const exit = process.exitReason === undefined ? "" : ` exitReason=${process.exitReason}`;
430
+ return (` pid=${String(process.pid)} instanceId=${process.instanceId} ` +
431
+ `lines=${String(process.lineCount)} seq=${seqRange} ts=${process.firstTs}..${process.lastTs}` +
432
+ `${started}${exit}`);
433
+ }
434
+ function renderProcessSummaries(processes) {
435
+ const header = `Processes: ${String(processes.length)}\n`;
436
+ const body = processes.map((process) => renderProcessSummary(process)).join("\n");
437
+ return `${header}${body}\n`;
438
+ }
439
+ function renderWarnings(warnings) {
440
+ const lines = warnings.map((warning) => `warning: ${warning}`);
441
+ return `${lines.join("\n")}\n`;
442
+ }
443
+ function renderCluster(cluster) {
444
+ const errorKind = cluster.errorKind ?? "-";
445
+ const samples = cluster.sampleCorrelationIds.join(",");
446
+ return (` ${cluster.category} ${cluster.op} [${errorKind}] count=${String(cluster.count)}` +
447
+ (samples.length > 0 ? ` sample=${samples}` : ""));
448
+ }
449
+ // Standalone, Wave 6: not called from `renderHumanAllTimelines` (a `--clusters` view is a
450
+ // deliberately DIFFERENT report from the default per-timeline one, not a section folded into it),
451
+ // exported for a future `--clusters` CLI flag to call directly.
452
+ export function renderHumanClusters(clusters) {
453
+ const header = `Clusters: ${String(clusters.length)}\n`;
454
+ if (clusters.length === 0)
455
+ return header;
456
+ return `${header}${clusters.map((cluster) => renderCluster(cluster)).join("\n")}\n`;
457
+ }
458
+ export function renderHumanAllTimelines(result) {
459
+ const sections = [];
460
+ if (result.warnings.length > 0)
461
+ sections.push(renderWarnings(result.warnings));
462
+ if (result.processes.length > 0)
463
+ sections.push(renderProcessSummaries(result.processes));
464
+ sections.push(result.timelines.length === 0
465
+ ? "No correlated events found.\n"
466
+ : result.timelines.map((timeline) => renderHumanTimeline(timeline)).join("\n"));
467
+ return sections.join("\n");
468
+ }
469
+ const GATEWAY_RETRY_OPS = new Set([
470
+ "gateway.retry.scheduled",
471
+ "gateway.retry.exhausted",
472
+ "gateway.retry.budget-exhausted",
473
+ ]);
474
+ const GATEWAY_SUCCESS_OPS = new Set([
475
+ "gateway.chat.completed",
476
+ "gateway.stream.completed",
477
+ ]);
478
+ const GATEWAY_FAILURE_OPS = new Set([
479
+ "gateway.chat.failed",
480
+ "gateway.stream.failed",
481
+ "gateway.stream.abandoned",
482
+ ]);
483
+ function isGatewayAttemptLine(view) {
484
+ if (view.category !== "gateway")
485
+ return false;
486
+ return (GATEWAY_RETRY_OPS.has(view.op) ||
487
+ GATEWAY_SUCCESS_OPS.has(view.op) ||
488
+ GATEWAY_FAILURE_OPS.has(view.op));
489
+ }
490
+ // `errorKind` is the gateway's own `GatewayError.code` (`logErrorKind`, keiko-model-gateway's
491
+ // observability.ts) — this maps the 4 codes a replay script cares about onto the narrower
492
+ // `GatewayReplayAttempt.outcome` vocabulary; anything else (circuit-open, cancelled, unknown)
493
+ // falls into the generic "provider-error" bucket rather than growing the outcome union for a
494
+ // distinction a replay fixture does not need to make.
495
+ function attemptOutcome(errorKind) {
496
+ if (errorKind === "GATEWAY_RATE_LIMIT")
497
+ return "rate-limit";
498
+ if (errorKind === "GATEWAY_TIMEOUT")
499
+ return "timeout";
500
+ if (errorKind === "GATEWAY_TRANSPORT")
501
+ return "transport-error";
502
+ return "provider-error";
503
+ }
504
+ function attemptUsage(extra) {
505
+ const promptTokens = optionalNumber(extra, "promptTokens");
506
+ const completionTokens = optionalNumber(extra, "completionTokens");
507
+ return promptTokens === undefined || completionTokens === undefined
508
+ ? undefined
509
+ : { promptTokens, completionTokens };
510
+ }
511
+ function gatewayAttemptFrom(view) {
512
+ const extra = view.extra ?? {};
513
+ const outcome = GATEWAY_SUCCESS_OPS.has(view.op) ? "success" : attemptOutcome(view.errorKind);
514
+ const httpStatus = optionalNumber(extra, "httpStatus");
515
+ const retryAfterMs = optionalNumber(extra, "retryAfterMs");
516
+ const finishReason = optionalString(extra, "finishReason");
517
+ const usage = attemptUsage(extra);
518
+ const toolCallCount = optionalNumber(extra, "toolCallCount");
519
+ const firstTokenMs = optionalNumber(extra, "firstTokenMs");
520
+ return {
521
+ outcome,
522
+ durationMs: view.durationMs ?? 0,
523
+ ...(httpStatus === undefined ? {} : { httpStatus }),
524
+ ...(retryAfterMs === undefined ? {} : { retryAfterMs }),
525
+ ...(finishReason === undefined ? {} : { finishReason }),
526
+ ...(usage === undefined ? {} : { usage }),
527
+ ...(toolCallCount === undefined ? {} : { toolCallCount }),
528
+ ...(firstTokenMs === undefined ? {} : { firstTokenMs }),
529
+ };
530
+ }
531
+ function gatewayModelId(lines) {
532
+ for (const view of lines) {
533
+ const modelId = optionalString(view.extra ?? {}, "modelId");
534
+ if (modelId !== undefined)
535
+ return modelId;
536
+ }
537
+ return "unknown-model";
538
+ }
539
+ // Undefined when the timeline carries no gateway line at all — distinct from an attempts array
540
+ // that IS populated but every attempt failed, which is a real, reportable replay script.
541
+ export function buildGatewayReplayScript(lines) {
542
+ const attemptLines = lines.filter(isGatewayAttemptLine);
543
+ if (attemptLines.length === 0)
544
+ return undefined;
545
+ return { modelId: gatewayModelId(lines), attempts: attemptLines.map(gatewayAttemptFrom) };
546
+ }
547
+ function optionalBoolean(record, key) {
548
+ const value = record[key];
549
+ return typeof value === "boolean" ? value : undefined;
550
+ }
551
+ function buildHttpRequestSeed(lines) {
552
+ const requestLine = lines.find((view) => view.category === "http" && view.op === "request");
553
+ const sseLine = lines.find((view) => view.category === "http" && view.op === "sse.stream.closed");
554
+ if (requestLine === undefined && sseLine === undefined)
555
+ return undefined;
556
+ const extra = requestLine?.extra ?? {};
557
+ const frameCount = optionalNumber(sseLine?.extra ?? {}, "frameCount");
558
+ return {
559
+ method: optionalString(extra, "method"),
560
+ routeTemplate: optionalString(extra, "routeTemplate"),
561
+ queryParamNames: optionalStringArray(extra.queryParamNames),
562
+ responseBytes: optionalNumber(extra, "responseBytes"),
563
+ status: requestLine?.status,
564
+ durationMs: requestLine?.durationMs,
565
+ aborted: optionalBoolean(extra, "aborted"),
566
+ frameCount,
567
+ };
568
+ }
569
+ function buildIndexingJobSeed(lines) {
570
+ const started = lines.find((view) => view.category === "indexing" && view.op === "indexing.job.started");
571
+ if (started === undefined)
572
+ return undefined;
573
+ const extra = started.extra ?? {};
574
+ return {
575
+ sourceCount: optionalNumber(extra, "sourceCount"),
576
+ batchSize: optionalNumber(extra, "batchSize"),
577
+ concurrency: optionalNumber(extra, "concurrency"),
578
+ minChunkTokens: optionalNumber(extra, "minChunkTokens"),
579
+ maxChunkTokens: optionalNumber(extra, "maxChunkTokens"),
580
+ overlapTokens: optionalNumber(extra, "overlapTokens"),
581
+ tokenizerKind: optionalString(extra, "tokenizerKind"),
582
+ };
583
+ }
584
+ // A bundle's manifest line (index 0, `$section: "manifest"`) carries `storeFingerprints` when the
585
+ // exporter is Wave-4a-or-later. `classifyLine` treats it as bundle metadata and never parses its
586
+ // content, so this reads it directly, independent of `analyzeLogText`. Every candidate is
587
+ // re-validated with the contract's own `isStoreFingerprint` guard (never trusted merely because it
588
+ // parsed as JSON) — a raw server.log, which has no manifest line at all, always returns undefined.
589
+ function extractManifestStoreFingerprints(text) {
590
+ const [firstLine] = splitLines(text);
591
+ if (firstLine === undefined)
592
+ return undefined;
593
+ const record = tryParseJsonObject(firstLine);
594
+ if (record?.$section !== "manifest" || !Array.isArray(record.storeFingerprints)) {
595
+ return undefined;
596
+ }
597
+ const valid = record.storeFingerprints.filter(isStoreFingerprint);
598
+ return valid.length > 0 ? valid : undefined;
599
+ }
600
+ const MAX_SEED_CAUSE_CHAIN = 16;
601
+ function aggregateCauseChain(lines) {
602
+ const all = [];
603
+ for (const view of lines) {
604
+ if (view.causeChain === undefined)
605
+ continue;
606
+ all.push(...view.causeChain);
607
+ }
608
+ return distinctInOrder(all).slice(0, MAX_SEED_CAUSE_CHAIN);
609
+ }
610
+ function sha256Hex(text) {
611
+ return createHash("sha256").update(text, "utf8").digest("hex");
612
+ }
613
+ const REPRODUCTION_SEED_SCHEMA_VERSION = 1;
614
+ const NO_BODY_WARNING = "no prompt/response body was ever logged by design — content-shape only " +
615
+ "(counts, ids, and closed-vocabulary labels, never message/completion text)";
616
+ function framesWarning(frames) {
617
+ return frames.length === 0
618
+ ? "no frames recorded for this correlationId — either no error occurred on this call, or " +
619
+ "this artifact predates Wave 2's frame capture"
620
+ : undefined;
621
+ }
622
+ function gatewayScriptWarning(script) {
623
+ return script === undefined
624
+ ? "no gateway.chat.*/gateway.stream.*/gateway.retry.* lines found for this correlationId — " +
625
+ "either no gateway call occurred, or this artifact predates Wave 3's provider detail"
626
+ : undefined;
627
+ }
628
+ function httpRequestWarning(seed) {
629
+ return seed === undefined
630
+ ? "no http.request line found for this correlationId — this artifact may cover only an " +
631
+ "internal/background operation with no HTTP request boundary"
632
+ : undefined;
633
+ }
634
+ function storeFingerprintWarning(kind, fingerprints) {
635
+ if (fingerprints !== undefined)
636
+ return undefined;
637
+ return kind === "raw-log"
638
+ ? "a raw server.log carries no store fingerprints — export a support bundle " +
639
+ "(`keiko support export`) to include them"
640
+ : "no store fingerprints found in this bundle's manifest — either the exporter predates " +
641
+ "Wave 4a, or every store was unavailable at export time";
642
+ }
643
+ function buildSeedWarnings(input) {
644
+ return [
645
+ NO_BODY_WARNING,
646
+ framesWarning(input.frames),
647
+ gatewayScriptWarning(input.gatewayScript),
648
+ httpRequestWarning(input.httpRequest),
649
+ storeFingerprintWarning(input.kind, input.storeFingerprint),
650
+ ].filter((warning) => warning !== undefined);
651
+ }
652
+ // Assembles a full `ReproductionSeed` for one correlationId out of `text` (a raw server.log or a
653
+ // support bundle — auto-detected, same as `analyzeLogText`). Undefined when no timeline exists for
654
+ // `correlationId`, mirroring `findTimeline`. `generatedAt` is caller-supplied (never `new Date()`
655
+ // read here) so this stays pure and deterministic, like every other export in this file.
656
+ export function buildReproductionSeed(text, correlationId, generatedAt) {
657
+ const timeline = findTimeline(analyzeLogText(text), correlationId);
658
+ if (timeline === undefined)
659
+ return undefined;
660
+ const kind = detectSourceKind(splitLines(text)[0]);
661
+ const gatewayScript = buildGatewayReplayScript(timeline.lines);
662
+ const httpRequest = buildHttpRequestSeed(timeline.lines);
663
+ const indexingJob = buildIndexingJobSeed(timeline.lines);
664
+ const storeFingerprint = extractManifestStoreFingerprints(text);
665
+ const stackFrames = timeline.frames ?? [];
666
+ const causeChain = aggregateCauseChain(timeline.lines);
667
+ return {
668
+ schemaVersion: REPRODUCTION_SEED_SCHEMA_VERSION,
669
+ generatedAt: generatedAt.toISOString(),
670
+ sourceArtifact: { kind, lineCount: splitLines(text).length, sha256: sha256Hex(text) },
671
+ correlationId,
672
+ timeline: timeline.lines,
673
+ ...(gatewayScript === undefined ? {} : { gatewayScript }),
674
+ ...(httpRequest === undefined ? {} : { httpRequest }),
675
+ ...(storeFingerprint === undefined ? {} : { storeFingerprint }),
676
+ ...(indexingJob === undefined ? {} : { indexingJob }),
677
+ ...(stackFrames.length === 0 ? {} : { stackFrames }),
678
+ ...(causeChain.length === 0 ? {} : { causeChain }),
679
+ warnings: buildSeedWarnings({
680
+ kind,
681
+ frames: stackFrames,
682
+ gatewayScript,
683
+ httpRequest,
684
+ storeFingerprint,
685
+ }),
686
+ };
687
+ }
688
+ // ─── Wave 6: `--emit-fixture` ───────────────────────────────────────────────────────────────────
689
+ //
690
+ // Renders `script` as a ready-to-paste TypeScript module: a `GatewayReplayScriptEntry[]` literal
691
+ // for `createScriptedGatewayFetch` (`@oscharko-dev/keiko-model-gateway`'s replay.ts). Built via
692
+ // `JSON.stringify` on a plain-data shape rather than hand-assembled template strings, so the
693
+ // output's syntax is guaranteed valid (a JSON object/array literal is always a valid TS/JS object
694
+ // literal) — there is no manual quoting/escaping step that could produce broken source.
695
+ const FAILURE_STATUS_FALLBACK = {
696
+ success: 200,
697
+ "rate-limit": 429,
698
+ timeout: 504,
699
+ "provider-error": 500,
700
+ "transport-error": 0,
701
+ };
702
+ function successFixtureBody(attempt) {
703
+ return {
704
+ choices: [
705
+ {
706
+ finish_reason: attempt.finishReason ?? "stop",
707
+ message: { role: "assistant", content: "" },
708
+ },
709
+ ],
710
+ ...(attempt.usage === undefined
711
+ ? {}
712
+ : {
713
+ usage: {
714
+ prompt_tokens: attempt.usage.promptTokens,
715
+ completion_tokens: attempt.usage.completionTokens,
716
+ },
717
+ }),
718
+ };
719
+ }
720
+ function failureFixtureEntry(attempt) {
721
+ if (attempt.outcome === "transport-error")
722
+ return { networkError: true };
723
+ const status = attempt.httpStatus ?? FAILURE_STATUS_FALLBACK[attempt.outcome];
724
+ const headers = attempt.retryAfterMs === undefined
725
+ ? undefined
726
+ : { "retry-after": String(Math.ceil(attempt.retryAfterMs / 1000)) };
727
+ return {
728
+ status,
729
+ ...(headers === undefined ? {} : { headers }),
730
+ bodyJson: { error: { message: "reconstructed from ReproductionSeed", type: attempt.outcome } },
731
+ latencyMs: attempt.durationMs,
732
+ };
733
+ }
734
+ function fixtureEntryFor(attempt) {
735
+ return attempt.outcome === "success"
736
+ ? { status: 200, bodyJson: successFixtureBody(attempt), latencyMs: attempt.durationMs }
737
+ : failureFixtureEntry(attempt);
738
+ }
739
+ // Returns undefined (never an empty-array fixture) when `script` has no attempts — there is
740
+ // nothing meaningful to paste.
741
+ export function renderGatewayReplayScriptFixture(script) {
742
+ if (script.attempts.length === 0)
743
+ return undefined;
744
+ const entries = script.attempts.map(fixtureEntryFor);
745
+ return ("// Generated by `keiko support analyze --emit-fixture` from a ReproductionSeed's gatewayScript.\n" +
746
+ "// Ready to paste into a *.test.ts for createScriptedGatewayFetch (@oscharko-dev/keiko-model-gateway).\n" +
747
+ 'import type { GatewayReplayScriptEntry } from "@oscharko-dev/keiko-model-gateway";\n\n' +
748
+ `export const gatewayReplayScript: GatewayReplayScriptEntry[] = ${JSON.stringify(entries, null, 2)};\n`);
749
+ }
750
+ // Human rendering for `keiko support analyze --seed` (without --json). Each structured sub-field
751
+ // is printed as its own compact JSON line rather than a hand-formatted table — a seed's whole
752
+ // point is to be read back by an agent, so the human view stays a thin, honest read of the exact
753
+ // same data `--json` emits, never a second formula computing something new from it (AGENTS.md §7).
754
+ export function renderHumanReproductionSeed(seed) {
755
+ const lines = [
756
+ `correlationId=${seed.correlationId} schemaVersion=${String(seed.schemaVersion)}`,
757
+ `source: kind=${seed.sourceArtifact.kind} lines=${String(seed.sourceArtifact.lineCount)} ` +
758
+ `sha256=${seed.sourceArtifact.sha256}`,
759
+ ];
760
+ if (seed.gatewayScript !== undefined) {
761
+ lines.push(`gatewayScript: ${JSON.stringify(seed.gatewayScript)}`);
762
+ }
763
+ if (seed.httpRequest !== undefined) {
764
+ lines.push(`httpRequest: ${JSON.stringify(seed.httpRequest)}`);
765
+ }
766
+ if (seed.indexingJob !== undefined) {
767
+ lines.push(`indexingJob: ${JSON.stringify(seed.indexingJob)}`);
768
+ }
769
+ if (seed.storeFingerprint !== undefined) {
770
+ lines.push(`storeFingerprint: ${JSON.stringify(seed.storeFingerprint)}`);
771
+ }
772
+ if (seed.stackFrames !== undefined && seed.stackFrames.length > 0) {
773
+ const frameLines = seed.stackFrames.map((frame) => ` ${frame}`).join("\n");
774
+ lines.push(`stackFrames:\n${frameLines}`);
775
+ }
776
+ if (seed.causeChain !== undefined && seed.causeChain.length > 0) {
777
+ lines.push(`causeChain: ${seed.causeChain.join(" -> ")}`);
778
+ }
779
+ const warningLines = seed.warnings.map((warning) => ` - ${warning}`).join("\n");
780
+ lines.push(`warnings:\n${warningLines}`);
781
+ return `${lines.join("\n")}\n`;
782
+ }