trouteai 1.0.6 → 1.0.8

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 (735) hide show
  1. package/.build/next/BUILD_ID +1 -1
  2. package/.build/next/build-manifest.json +3 -3
  3. package/.build/next/fallback-build-manifest.json +3 -3
  4. package/.build/next/server/app/(dashboard)/dashboard/activity/page_client-reference-manifest.js +1 -1
  5. package/.build/next/server/app/(dashboard)/dashboard/analytics/combo-health/page_client-reference-manifest.js +1 -1
  6. package/.build/next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  7. package/.build/next/server/app/(dashboard)/dashboard/analytics/utilization/page_client-reference-manifest.js +1 -1
  8. package/.build/next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  9. package/.build/next/server/app/(dashboard)/dashboard/audit/page_client-reference-manifest.js +1 -1
  10. package/.build/next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  11. package/.build/next/server/app/(dashboard)/dashboard/cache/page_client-reference-manifest.js +1 -1
  12. package/.build/next/server/app/(dashboard)/dashboard/combos/[id]/page_client-reference-manifest.js +1 -1
  13. package/.build/next/server/app/(dashboard)/dashboard/combos/live/page_client-reference-manifest.js +1 -1
  14. package/.build/next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/.build/next/server/app/(dashboard)/dashboard/combos/playground/page_client-reference-manifest.js +1 -1
  16. package/.build/next/server/app/(dashboard)/dashboard/costs/budget/page_client-reference-manifest.js +1 -1
  17. package/.build/next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  18. package/.build/next/server/app/(dashboard)/dashboard/costs/pricing/page_client-reference-manifest.js +1 -1
  19. package/.build/next/server/app/(dashboard)/dashboard/costs/quota-share/page_client-reference-manifest.js +1 -1
  20. package/.build/next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/.build/next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  22. package/.build/next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  23. package/.build/next/server/app/(dashboard)/dashboard/logs/activity/page_client-reference-manifest.js +1 -1
  24. package/.build/next/server/app/(dashboard)/dashboard/logs/console/page_client-reference-manifest.js +1 -1
  25. package/.build/next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  26. package/.build/next/server/app/(dashboard)/dashboard/logs/proxy/page_client-reference-manifest.js +1 -1
  27. package/.build/next/server/app/(dashboard)/dashboard/logs/timeline/page_client-reference-manifest.js +1 -1
  28. package/.build/next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/.build/next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/.build/next/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  31. package/.build/next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  32. package/.build/next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  33. package/.build/next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  34. package/.build/next/server/app/(dashboard)/dashboard/provider-stats/page_client-reference-manifest.js +1 -1
  35. package/.build/next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  36. package/.build/next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  37. package/.build/next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  38. package/.build/next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  39. package/.build/next/server/app/(dashboard)/dashboard/runtime/page_client-reference-manifest.js +1 -1
  40. package/.build/next/server/app/(dashboard)/dashboard/settings/advanced/page_client-reference-manifest.js +1 -1
  41. package/.build/next/server/app/(dashboard)/dashboard/settings/ai/page_client-reference-manifest.js +1 -1
  42. package/.build/next/server/app/(dashboard)/dashboard/settings/appearance/page_client-reference-manifest.js +1 -1
  43. package/.build/next/server/app/(dashboard)/dashboard/settings/cache/page_client-reference-manifest.js +1 -1
  44. package/.build/next/server/app/(dashboard)/dashboard/settings/feature-flags/page_client-reference-manifest.js +1 -1
  45. package/.build/next/server/app/(dashboard)/dashboard/settings/general/page_client-reference-manifest.js +1 -1
  46. package/.build/next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  47. package/.build/next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  48. package/.build/next/server/app/(dashboard)/dashboard/settings/resilience/page_client-reference-manifest.js +1 -1
  49. package/.build/next/server/app/(dashboard)/dashboard/settings/routing/page_client-reference-manifest.js +1 -1
  50. package/.build/next/server/app/(dashboard)/dashboard/settings/security/page_client-reference-manifest.js +1 -1
  51. package/.build/next/server/app/(dashboard)/dashboard/settings/sidebar/page_client-reference-manifest.js +1 -1
  52. package/.build/next/server/app/(dashboard)/dashboard/system/page_client-reference-manifest.js +1 -1
  53. package/.build/next/server/app/(dashboard)/dashboard/system/proxy/page_client-reference-manifest.js +1 -1
  54. package/.build/next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  55. package/.build/next/server/app/(dashboard)/home/page_client-reference-manifest.js +1 -1
  56. package/.build/next/server/app/400/page_client-reference-manifest.js +1 -1
  57. package/.build/next/server/app/401/page_client-reference-manifest.js +1 -1
  58. package/.build/next/server/app/403/page_client-reference-manifest.js +1 -1
  59. package/.build/next/server/app/408/page_client-reference-manifest.js +1 -1
  60. package/.build/next/server/app/429/page_client-reference-manifest.js +1 -1
  61. package/.build/next/server/app/500/page_client-reference-manifest.js +1 -1
  62. package/.build/next/server/app/502/page_client-reference-manifest.js +1 -1
  63. package/.build/next/server/app/503/page_client-reference-manifest.js +1 -1
  64. package/.build/next/server/app/_global-error.html +1 -1
  65. package/.build/next/server/app/_global-error.rsc +1 -1
  66. package/.build/next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  67. package/.build/next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  68. package/.build/next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  69. package/.build/next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  70. package/.build/next/server/app/api/combos/test/route.js +156 -156
  71. package/.build/next/server/app/api/compression/compare/verify/route.js +2 -2
  72. package/.build/next/server/app/api/models/test/route.js +143 -143
  73. package/.build/next/server/app/api/models/test-all/route.js +143 -143
  74. package/.build/next/server/app/api/usage/[connectionId]/route.js +2 -2
  75. package/.build/next/server/app/api/usage/codex-reset-credit/route.js +2 -2
  76. package/.build/next/server/app/api/usage/provider-limits/route.js +2 -2
  77. package/.build/next/server/app/api/v1/antigravity/route.js +125 -125
  78. package/.build/next/server/app/api/v1/api/chat/route.js +127 -127
  79. package/.build/next/server/app/api/v1/chat/completions/route.js +133 -133
  80. package/.build/next/server/app/api/v1/completions/route.js +131 -131
  81. package/.build/next/server/app/api/v1/messages/count_tokens/route.js +2 -2
  82. package/.build/next/server/app/api/v1/messages/route.js +130 -130
  83. package/.build/next/server/app/api/v1/providers/[provider]/chat/completions/route.js +124 -124
  84. package/.build/next/server/app/api/v1/responses/[...path]/route.js +125 -125
  85. package/.build/next/server/app/api/v1/responses/route.js +133 -133
  86. package/.build/next/server/app/api/v1/videos/generations/route.js +2 -2
  87. package/.build/next/server/app/api/v1/vscode/[token]/api/chat/route.js +131 -131
  88. package/.build/next/server/app/api/v1/vscode/[token]/chat/completions/route.js +132 -132
  89. package/.build/next/server/app/api/v1/vscode/[token]/responses/route.js +131 -131
  90. package/.build/next/server/app/api/v1/vscode/[token]/v1/chat/completions/route.js +132 -132
  91. package/.build/next/server/app/api/v1/vscode/raw/[token]/api/chat/route.js +131 -131
  92. package/.build/next/server/app/api/v1/vscode/raw/[token]/chat/completions/route.js +132 -132
  93. package/.build/next/server/app/api/v1/vscode/raw/[token]/responses/route.js +131 -131
  94. package/.build/next/server/app/api/v1/vscode/raw/[token]/v1/chat/completions/route.js +132 -132
  95. package/.build/next/server/app/api/v1beta/models/[...path]/route.js +128 -128
  96. package/.build/next/server/app/auth/callback/page_client-reference-manifest.js +1 -1
  97. package/.build/next/server/app/callback/page_client-reference-manifest.js +1 -1
  98. package/.build/next/server/app/connect/codex/[token]/page_client-reference-manifest.js +1 -1
  99. package/.build/next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  100. package/.build/next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  101. package/.build/next/server/app/login/page_client-reference-manifest.js +1 -1
  102. package/.build/next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  103. package/.build/next/server/app/offline/page_client-reference-manifest.js +1 -1
  104. package/.build/next/server/app/page_client-reference-manifest.js +1 -1
  105. package/.build/next/server/chunks/{1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0071t6-gy8206.js → 1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0cdytbweqx6b7.js} +1 -1
  106. package/.build/next/server/chunks/{1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_03uipan87s4vs.js → 1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0dv1_6icxx4nr.js} +1 -1
  107. package/.build/next/server/chunks/{1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_04qcux733c716.js → 1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0feukx8b--i7y.js} +1 -1
  108. package/.build/next/server/chunks/{1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_04y--asln23t-.js → 1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0foh2lmr9t9jf.js} +1 -1
  109. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0ieu8lrtllaog.js +3 -0
  110. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0jow9no35q-gl.js +3 -0
  111. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0k39__s-5wenx.js +3 -0
  112. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0lu36e9zlm6y2.js +3 -0
  113. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0q3hd0z__qhm1.js +3 -0
  114. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0svnbjltkehm0.js +3 -0
  115. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0tp3k6-k_smkk.js +3 -0
  116. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0tw8hx-r12mrw.js +3 -0
  117. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0vdgv0qv9t25q.js +3 -0
  118. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_13pu0wi09xd-q.js +3 -0
  119. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_16gcrutnx6jpm.js +3 -0
  120. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_170l4-im9-rts.js +3 -0
  121. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_18ujd4t8o0iap.js +3 -0
  122. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1kuob30li3zz4.js +3 -0
  123. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1oghu697pywz1.js +3 -0
  124. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1oz1ky4cqo5la.js +3 -0
  125. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1t1tpwfjdroz-.js +3 -0
  126. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1twzsl5g2kx-m.js +3 -0
  127. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1u4l5hhlfmkq7.js +3 -0
  128. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1wgek1bfzkudf.js +3 -0
  129. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1yazcd_f60euz.js +3 -0
  130. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1zg9eixcilibu.js +3 -0
  131. package/.build/next/server/chunks/{[root-of-the-server]__0y-c0o33nm9k7._.js → [root-of-the-server]__013qtg6e7nrnt._.js} +2 -2
  132. package/.build/next/server/chunks/{[root-of-the-server]__0jcn_nom11qn8._.js → [root-of-the-server]__01cuuk82yhow-._.js} +2 -2
  133. package/.build/next/server/chunks/[root-of-the-server]__03j1rri4jmffc._.js +1 -1
  134. package/.build/next/server/chunks/{[root-of-the-server]__03ce1fmn0qpsk._.js → [root-of-the-server]__04-wq1d8ad7-c._.js} +2 -2
  135. package/.build/next/server/chunks/{[root-of-the-server]__09e_jeovzn41x._.js → [root-of-the-server]__04ex4wx450p98._.js} +2 -2
  136. package/.build/next/server/chunks/{[root-of-the-server]__0s1n86lqib-r8._.js → [root-of-the-server]__054pm2e42ihgb._.js} +2 -2
  137. package/.build/next/server/chunks/{[root-of-the-server]__09miz4mr315ge._.js → [root-of-the-server]__06a582l--8gfi._.js} +2 -2
  138. package/.build/next/server/chunks/{[root-of-the-server]__14qrr7cz7ih12._.js → [root-of-the-server]__08mchwc4bo740._.js} +2 -2
  139. package/.build/next/server/chunks/{[root-of-the-server]__0cdyf9uauo7s-._.js → [root-of-the-server]__0_potadi-xpgt._.js} +2 -2
  140. package/.build/next/server/chunks/{[root-of-the-server]__053e56_stref0._.js → [root-of-the-server]__0au1tn-inyd_g._.js} +2 -2
  141. package/.build/next/server/chunks/{[root-of-the-server]__0dnxb-t5a29qw._.js → [root-of-the-server]__0bi89tb8hq7gp._.js} +2 -2
  142. package/.build/next/server/chunks/[root-of-the-server]__0bjb6df6ao16p._.js +3 -0
  143. package/.build/next/server/chunks/{[root-of-the-server]__0b6xbrajo6q7j._.js → [root-of-the-server]__0bn0fnmy3cyov._.js} +2 -2
  144. package/.build/next/server/chunks/[root-of-the-server]__0c8uunduj0rcb._.js +3 -0
  145. package/.build/next/server/chunks/{[root-of-the-server]__0bqjf5vfej0y0._.js → [root-of-the-server]__0cfm4y8lfzabg._.js} +2 -2
  146. package/.build/next/server/chunks/[root-of-the-server]__0h2tv7welidf2._.js +1 -1
  147. package/.build/next/server/chunks/[root-of-the-server]__0h6jczejtzur4._.js +3 -0
  148. package/.build/next/server/chunks/[root-of-the-server]__0jboht3yosva1._.js +1 -1
  149. package/.build/next/server/chunks/[root-of-the-server]__0kmh0llofhi-t._.js +3 -0
  150. package/.build/next/server/chunks/{[root-of-the-server]__19fndg4-8fl2p._.js → [root-of-the-server]__0oe87-hbfx_wt._.js} +2 -2
  151. package/.build/next/server/chunks/[root-of-the-server]__0pkk8q-mwrlhb._.js +3 -0
  152. package/.build/next/server/chunks/[root-of-the-server]__0pr6ndvl99m80._.js +3 -0
  153. package/.build/next/server/chunks/[root-of-the-server]__0q4kt78fse6u1._.js +1 -1
  154. package/.build/next/server/chunks/{[root-of-the-server]__0puajugwbae33._.js → [root-of-the-server]__0qwx0hffq93lu._.js} +2 -2
  155. package/.build/next/server/chunks/{[root-of-the-server]__03wxkz1ocd2m9._.js → [root-of-the-server]__0qzppsy_m_vb2._.js} +2 -2
  156. package/.build/next/server/chunks/[root-of-the-server]__0tadcednrqwvh._.js +3 -0
  157. package/.build/next/server/chunks/[root-of-the-server]__0tmd8acngsii3._.js +3 -0
  158. package/.build/next/server/chunks/{[root-of-the-server]__0urs4jrktsqji._.js → [root-of-the-server]__0vrh-4tf0ft8-._.js} +2 -2
  159. package/.build/next/server/chunks/[root-of-the-server]__0w0-w78j-o7zx._.js +3 -0
  160. package/.build/next/server/chunks/[root-of-the-server]__0yhdbb9w6oy0w._.js +3 -0
  161. package/.build/next/server/chunks/[root-of-the-server]__0yovqcjs0srde._.js +3 -0
  162. package/.build/next/server/chunks/{[root-of-the-server]__155hah7mtxxeu._.js → [root-of-the-server]__0yrk_78ixd453._.js} +2 -2
  163. package/.build/next/server/chunks/{[root-of-the-server]__0e_cgryo2zwu7._.js → [root-of-the-server]__0z24jgzvrqjf-._.js} +2 -2
  164. package/.build/next/server/chunks/[root-of-the-server]__1-elrzh0r1gn1._.js +3 -0
  165. package/.build/next/server/chunks/[root-of-the-server]__13g59axrgpk8f._.js +3 -0
  166. package/.build/next/server/chunks/{[root-of-the-server]__0fqufbrh_mxe6._.js → [root-of-the-server]__14htch0up35mq._.js} +2 -2
  167. package/.build/next/server/chunks/[root-of-the-server]__16__ky70mzpki._.js +1 -1
  168. package/.build/next/server/chunks/[root-of-the-server]__175s6rzt1gxf5._.js +3 -0
  169. package/.build/next/server/chunks/[root-of-the-server]__183u7xm7s7a0k._.js +3 -0
  170. package/.build/next/server/chunks/{[root-of-the-server]__1b7gfspxmfn7w._.js → [root-of-the-server]__1_bm64-b9rvps._.js} +2 -2
  171. package/.build/next/server/chunks/{[root-of-the-server]__0_89zuvif-ac0._.js → [root-of-the-server]__1_u2c9t8ghphk._.js} +2 -2
  172. package/.build/next/server/chunks/[root-of-the-server]__1asmrtinwnms1._.js +3 -0
  173. package/.build/next/server/chunks/[root-of-the-server]__1cs67f0gx1m2b._.js +1 -1
  174. package/.build/next/server/chunks/{[root-of-the-server]__0cya_vem8spaz._.js → [root-of-the-server]__1di-si5n-wa-0._.js} +1 -1
  175. package/.build/next/server/chunks/[root-of-the-server]__1eqvp0su82wa0._.js +1 -1
  176. package/.build/next/server/chunks/[root-of-the-server]__1f5u7fc6i-lh2._.js +3 -0
  177. package/.build/next/server/chunks/[root-of-the-server]__1gvcl_1847dlk._.js +1 -1
  178. package/.build/next/server/chunks/[root-of-the-server]__1gvwvri5-zmqs._.js +3 -0
  179. package/.build/next/server/chunks/[root-of-the-server]__1mfz-ys8z6-vj._.js +3 -0
  180. package/.build/next/server/chunks/[root-of-the-server]__1trre9oa-f-0-._.js +3 -0
  181. package/.build/next/server/chunks/[root-of-the-server]__1vwllhi2yaj22._.js +3 -0
  182. package/.build/next/server/chunks/[root-of-the-server]__1waj1qbbu8d0o._.js +3 -0
  183. package/.build/next/server/chunks/[root-of-the-server]__1x9t7o--7d3xv._.js +3 -0
  184. package/.build/next/server/chunks/[root-of-the-server]__1xi0yu215obtp._.js +3 -0
  185. package/.build/next/server/chunks/[root-of-the-server]__1xrpvccwm0tui._.js +3 -0
  186. package/.build/next/server/chunks/[root-of-the-server]__1xxb_la5pyyty._.js +1 -1
  187. package/.build/next/server/chunks/[root-of-the-server]__1yyq83bab1_34._.js +3 -0
  188. package/.build/next/server/chunks/[root-of-the-server]__1zvn7n_eg3bv6._.js +3 -0
  189. package/.build/next/server/chunks/_0-eumrsx9uwoc._.js +3 -3
  190. package/.build/next/server/chunks/_0-whad0_ydcsy._.js +1 -1
  191. package/.build/next/server/chunks/{_029oc7_2cayf9._.js → _01jw2l_g1m495._.js} +1 -1
  192. package/.build/next/server/chunks/_02r_3f8xhg8a_._.js +16 -0
  193. package/.build/next/server/chunks/{_0-7-wo2rhe742._.js → _03qfav-eclfsv._.js} +1 -1
  194. package/.build/next/server/chunks/{_0v8bztyjzmwju._.js → _040sjflhcim3n._.js} +2 -2
  195. package/.build/next/server/chunks/{_045qaiya-q9mx._.js → _06tafvn_2upb9._.js} +1 -1
  196. package/.build/next/server/chunks/{_0bnzv1p-iih9y._.js → _070swycte4f2y._.js} +1 -1
  197. package/.build/next/server/chunks/{_0v223bkfoc35x._.js → _08crm5ua26ded._.js} +1 -1
  198. package/.build/next/server/chunks/{_0cnrejialoejq._.js → _09pw38n0fvjve._.js} +132 -119
  199. package/.build/next/server/chunks/_0_owpim-84v6c._.js +1 -1
  200. package/.build/next/server/chunks/_0bjni2b0bk48x._.js +7 -0
  201. package/.build/next/server/chunks/_0cthudnt9nl4t._.js +3 -0
  202. package/.build/next/server/chunks/_0dtaqfgy6-5ws._.js +3 -0
  203. package/.build/next/server/chunks/{_1gwyqrv4jj-h0._.js → _0dx0f1oye7vfm._.js} +1 -1
  204. package/.build/next/server/chunks/_0gqrj_t8bk-8t._.js +1 -1
  205. package/.build/next/server/chunks/_0heuo1apizyqe._.js +1 -1
  206. package/.build/next/server/chunks/{_05uyjdaba145h._.js → _0jbl3xtidh76w._.js} +1 -1
  207. package/.build/next/server/chunks/_0jzperkk-1ag9._.js +1 -1
  208. package/.build/next/server/chunks/_0ma7hnwk4_v5i._.js +1 -1
  209. package/.build/next/server/chunks/_0nntu-lmwlb6z._.js +1 -1
  210. package/.build/next/server/chunks/_0ntfaxua3a497._.js +3 -0
  211. package/.build/next/server/chunks/{_1mf3kg0sol0_p._.js → _0pqtuwqkanzsg._.js} +132 -119
  212. package/.build/next/server/chunks/{_0syxc2wl5qdnf._.js → _0q0iu436_75a8._.js} +1 -1
  213. package/.build/next/server/chunks/_0qa8wnj0oms8q._.js +3 -0
  214. package/.build/next/server/chunks/{_0hmkgx75fn7mt._.js → _0r-1igk81_7eg._.js} +1 -1
  215. package/.build/next/server/chunks/{_0i0eoe3j0-x0v._.js → _0rffd_e2te-9v._.js} +1 -1
  216. package/.build/next/server/chunks/{_0fr8xxna2d5zn._.js → _0rtwo7u0mrb9r._.js} +1 -1
  217. package/.build/next/server/chunks/_0srkl-vgqcos7._.js +1 -1
  218. package/.build/next/server/chunks/_0tjk31-3k5hyf._.js +1 -1
  219. package/.build/next/server/chunks/_0tu5ehvbm4nc0._.js +3 -0
  220. package/.build/next/server/chunks/_0u8bko69-zd_z._.js +3 -0
  221. package/.build/next/server/chunks/_0v2kg-vv66amt._.js +3 -0
  222. package/.build/next/server/chunks/_0xujjs2b429r3._.js +3 -0
  223. package/.build/next/server/chunks/_0zvrsdbnkncnv._.js +3 -0
  224. package/.build/next/server/chunks/{_15efjsoc2b-sk._.js → _0zzir4fs7j_1p._.js} +2 -2
  225. package/.build/next/server/chunks/_10bcih89e-jn4._.js +3 -0
  226. package/.build/next/server/chunks/_10fwjeqnb57r-._.js +3 -0
  227. package/.build/next/server/chunks/_12_v3uivh86bs._.js +3 -0
  228. package/.build/next/server/chunks/_12ra9yaf_1dyr._.js +650 -0
  229. package/.build/next/server/chunks/_12rywigtphiop._.js +1 -1
  230. package/.build/next/server/chunks/_14cqpo0o-pr27._.js +3 -0
  231. package/.build/next/server/chunks/_14lqp4-f8wqgn._.js +3 -0
  232. package/.build/next/server/chunks/_159dadvt3pm1n._.js +3 -0
  233. package/.build/next/server/chunks/_1644hhqg6d_ln._.js +1 -1
  234. package/.build/next/server/chunks/{_1avfc3einmg1h._.js → _16_wwhbnnhkuh._.js} +1 -1
  235. package/.build/next/server/chunks/_16an60huh6tbs._.js +9 -9
  236. package/.build/next/server/chunks/_16i__1nx0epf7._.js +3 -0
  237. package/.build/next/server/chunks/_178o182dc7ex1._.js +3 -0
  238. package/.build/next/server/chunks/_188c9_xzcpc31._.js +1 -1
  239. package/.build/next/server/chunks/_19fzj3u7s0yz1._.js +3 -0
  240. package/.build/next/server/chunks/_19sfk-pzknkyv._.js +3 -0
  241. package/.build/next/server/chunks/_1_r1zgsvs713w._.js +3 -0
  242. package/.build/next/server/chunks/_1b6zyz_ay2ym5._.js +3 -0
  243. package/.build/next/server/chunks/_1btzlsw6io52c._.js +3 -0
  244. package/.build/next/server/chunks/{_0b_i4b8q0n1wz._.js → _1ft8yf-b3j8b8._.js} +146 -133
  245. package/.build/next/server/chunks/_1g8ka5zb3up7z._.js +3 -0
  246. package/.build/next/server/chunks/_1i00v3yjot-q_._.js +3 -0
  247. package/.build/next/server/chunks/{_0j524iax5w-bz._.js → _1kwnwtivfzp5u._.js} +1 -1
  248. package/.build/next/server/chunks/_1n9cbjvt_d82t._.js +1 -1
  249. package/.build/next/server/chunks/{_1wos-_82xr837._.js → _1q0_qh1mlc-1m._.js} +146 -133
  250. package/.build/next/server/chunks/{_0u-x3uzfboviu._.js → _1qmyzv3q9s7el._.js} +1 -1
  251. package/.build/next/server/chunks/_1qqqu7qtmx3if._.js +3 -0
  252. package/.build/next/server/chunks/_1r-xz7njt1agb._.js +62 -0
  253. package/.build/next/server/chunks/_1r3w1g8gzsrx3._.js +3 -0
  254. package/.build/next/server/chunks/{_1zcs33t-he7xd._.js → _1t7-qccr20ews._.js} +10 -10
  255. package/.build/next/server/chunks/_1uj3ppmpkxnlt._.js +3 -0
  256. package/.build/next/server/chunks/_1vgt3hw061lvz._.js +3 -0
  257. package/.build/next/server/chunks/_1xsk0mm2-hw63._.js +3 -0
  258. package/.build/next/server/chunks/_1yia8a_9rs285._.js +3 -0
  259. package/.build/next/server/chunks/_1yq_qtnhzgne_._.js +3 -0
  260. package/.build/next/server/chunks/_1z1_7oxdwqiqe._.js +3 -0
  261. package/.build/next/server/chunks/{_0zea7hovhgt2_._.js → _1zk9j5avh9do1._.js} +2 -2
  262. package/.build/next/server/chunks/_1zmyssg1ql6gl._.js +3 -3
  263. package/.build/next/server/chunks/_1zzqi2vrqln8r._.js +3 -0
  264. package/.build/next/server/chunks/_20wczne8lusnr._.js +1 -1
  265. package/.build/next/server/chunks/{node_modules_0_a57i8xt9icf._.js → node_modules_00j-j70vb5l89._.js} +1 -1
  266. package/.build/next/server/chunks/{node_modules_0-_w__4n53410._.js → node_modules_00rveaxr6xn-1._.js} +1 -1
  267. package/.build/next/server/chunks/{node_modules_06km3ub1t353p._.js → node_modules_0318sxb9xejre._.js} +1 -1
  268. package/.build/next/server/chunks/{node_modules_070w8pzva2-b5._.js → node_modules_03eegbwr1ykhv._.js} +1 -1
  269. package/.build/next/server/chunks/node_modules_04kmq4fi-fcs3._.js +3 -0
  270. package/.build/next/server/chunks/node_modules_0clpxklowdv39._.js +3 -0
  271. package/.build/next/server/chunks/node_modules_0ixloym14amfv._.js +3 -0
  272. package/.build/next/server/chunks/node_modules_0jcobbm12qhmj._.js +3 -0
  273. package/.build/next/server/chunks/node_modules_0lav-ieym04zb._.js +3 -0
  274. package/.build/next/server/chunks/node_modules_0meaikpo6sp-0._.js +3 -0
  275. package/.build/next/server/chunks/node_modules_0qjpghqow25tc._.js +3 -0
  276. package/.build/next/server/chunks/node_modules_0t3d23hihdgmu._.js +3 -0
  277. package/.build/next/server/chunks/node_modules_0trsqf3qottck._.js +3 -0
  278. package/.build/next/server/chunks/node_modules_0voxtqt-anw9e._.js +3 -0
  279. package/.build/next/server/chunks/node_modules_0vrbvfb6201w6._.js +3 -0
  280. package/.build/next/server/chunks/node_modules_1-kv_qmpt4341._.js +3 -0
  281. package/.build/next/server/chunks/node_modules_10rbyfmbpi425._.js +3 -0
  282. package/.build/next/server/chunks/node_modules_135e3rn3qtd-6._.js +3 -0
  283. package/.build/next/server/chunks/node_modules_17pyrt2it4bgr._.js +3 -0
  284. package/.build/next/server/chunks/node_modules_1ir4um6mro95r._.js +3 -0
  285. package/.build/next/server/chunks/node_modules_1j_0ubaizcezn._.js +3 -0
  286. package/.build/next/server/chunks/node_modules_1n05kwizfpjo6._.js +3 -0
  287. package/.build/next/server/chunks/node_modules_1n47vn0307_u5._.js +3 -0
  288. package/.build/next/server/chunks/node_modules_1srzy9xr2ioyr._.js +3 -0
  289. package/.build/next/server/chunks/node_modules_1tqglxa-ymtqw._.js +3 -0
  290. package/.build/next/server/chunks/node_modules_1z6rpfu7winx2._.js +3 -0
  291. package/.build/next/server/chunks/{node_modules_@aws-sdk_032-tpe7346hb._.js → node_modules_@aws-sdk_03kfydhiseqdg._.js} +2 -2
  292. package/.build/next/server/chunks/{node_modules_@aws-sdk_04o_8bax4fbo4._.js → node_modules_@aws-sdk_0_s99dpim75pu._.js} +2 -2
  293. package/.build/next/server/chunks/{node_modules_@aws-sdk_0_at_8j5m5taa._.js → node_modules_@aws-sdk_0bv_r2pcdu10h._.js} +2 -2
  294. package/.build/next/server/chunks/{node_modules_@aws-sdk_0cpedsd2e8nj9._.js → node_modules_@aws-sdk_0f5qnmpxmag01._.js} +2 -2
  295. package/.build/next/server/chunks/node_modules_@aws-sdk_0nlcm-f5ytb4h._.js +3 -0
  296. package/.build/next/server/chunks/node_modules_@aws-sdk_0obp77rs96mvi._.js +3 -0
  297. package/.build/next/server/chunks/node_modules_@aws-sdk_0oylq1k5y_3ce._.js +3 -0
  298. package/.build/next/server/chunks/node_modules_@aws-sdk_0qf0zztgs682s._.js +3 -0
  299. package/.build/next/server/chunks/node_modules_@aws-sdk_0rgyt30cubjzf._.js +3 -0
  300. package/.build/next/server/chunks/node_modules_@aws-sdk_0vi2hngy9pnuy._.js +3 -0
  301. package/.build/next/server/chunks/node_modules_@aws-sdk_0x510i9ngxcyf._.js +3 -0
  302. package/.build/next/server/chunks/node_modules_@aws-sdk_0y-e4gqf903o3._.js +3 -0
  303. package/.build/next/server/chunks/node_modules_@aws-sdk_0yhl9bvr9ueqh._.js +3 -0
  304. package/.build/next/server/chunks/node_modules_@aws-sdk_0yqxb4ienz6kj._.js +3 -0
  305. package/.build/next/server/chunks/node_modules_@aws-sdk_0yttguxby4mdi._.js +3 -0
  306. package/.build/next/server/chunks/node_modules_@aws-sdk_10101hyu_zjk4._.js +3 -0
  307. package/.build/next/server/chunks/node_modules_@aws-sdk_123n4jie1tq6a._.js +3 -0
  308. package/.build/next/server/chunks/node_modules_@aws-sdk_15qb522ckeehe._.js +3 -0
  309. package/.build/next/server/chunks/node_modules_@aws-sdk_1_n1vj3j0xfms._.js +3 -0
  310. package/.build/next/server/chunks/node_modules_@aws-sdk_1ix0scvbr4xd9._.js +3 -0
  311. package/.build/next/server/chunks/node_modules_@aws-sdk_1lza3gi_jvmio._.js +3 -0
  312. package/.build/next/server/chunks/node_modules_@aws-sdk_1mdahx12zwp_1._.js +3 -0
  313. package/.build/next/server/chunks/node_modules_@aws-sdk_1nk8tt26yrxh-._.js +3 -0
  314. package/.build/next/server/chunks/node_modules_@aws-sdk_1ot6491i27kfo._.js +3 -0
  315. package/.build/next/server/chunks/node_modules_@aws-sdk_1vcgyijr8-gln._.js +3 -0
  316. package/.build/next/server/chunks/node_modules_@aws-sdk_204anorh-zvk-._.js +3 -0
  317. package/.build/next/server/chunks/{node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0-2dpkdybmydz.js → node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_01m33xoynofsl.js} +1 -1
  318. package/.build/next/server/chunks/{node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_00c1icqvrqz-s.js → node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_06adt_ianv_md.js} +1 -1
  319. package/.build/next/server/chunks/{node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_039_xf84osnel.js → node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_07njywm0sbeyv.js} +1 -1
  320. package/.build/next/server/chunks/{node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_03hjwb47vuwm9.js → node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_080lter3o8zcp.js} +1 -1
  321. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_09_cxlxlqf67s.js +3 -0
  322. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_09ov7ntve-mx7.js +3 -0
  323. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0kbpnxnu2ejlc.js +3 -0
  324. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0ki8jbo6k_atz.js +3 -0
  325. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0npewtp_nops5.js +3 -0
  326. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0q715b8wgpb1u.js +3 -0
  327. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0yy3fcwj_b5be.js +3 -0
  328. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1-4ppt5kmz50x.js +3 -0
  329. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1-ky0eo80twjx.js +3 -0
  330. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_11u9jygsvvu5c.js +3 -0
  331. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_12s0w02i5mlzh.js +3 -0
  332. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_12sb57-_mdan4.js +3 -0
  333. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_13be-a641383i.js +3 -0
  334. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_14nxcn9iwq7oj.js +3 -0
  335. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_15sqaub981ncp.js +3 -0
  336. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_16mb7bvgqd72p.js +3 -0
  337. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1a96ybufo8-_d.js +3 -0
  338. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1epmqjkncfa-t.js +3 -0
  339. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1ymjdx7brv1u5.js +3 -0
  340. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1zmx4t1zp2plx.js +3 -0
  341. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1ztb14nbvq-v8.js +3 -0
  342. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_20swopgb7gs5p.js +3 -0
  343. package/.build/next/server/chunks/{node_modules_ioredis_built_index_1-s3egdocnznd.js → node_modules_ioredis_built_index_0bym26c4shwf9.js} +1 -1
  344. package/.build/next/server/chunks/{node_modules_ioredis_built_index_14ex7cglfl3pz.js → node_modules_ioredis_built_index_0olys7xgnfo0i.js} +1 -1
  345. package/.build/next/server/chunks/{node_modules_ioredis_built_index_1w1hzk4_-8xu5.js → node_modules_ioredis_built_index_14ct1dd055dku.js} +1 -1
  346. package/.build/next/server/chunks/{node_modules_ioredis_built_index_15mwjswq7fcc7.js → node_modules_ioredis_built_index_1agrynr6yap-q.js} +1 -1
  347. package/.build/next/server/chunks/{node_modules_ioredis_built_index_1a9ll1mwrmtob.js → node_modules_ioredis_built_index_1ik97n_251xek.js} +1 -1
  348. package/.build/next/server/chunks/node_modules_ioredis_built_index_1vv514_mvh8ve.js +3 -0
  349. package/.build/next/server/chunks/open-sse_02t7zn7htyw-9._.js +1 -1
  350. package/.build/next/server/chunks/open-sse_03goq14q0_x4f._.js +1 -1
  351. package/.build/next/server/chunks/open-sse_03ipq-9xg4l9m._.js +1 -1
  352. package/.build/next/server/chunks/open-sse_0bl-irqke65hd._.js +1 -1
  353. package/.build/next/server/chunks/open-sse_0h0zluguzhqef._.js +16 -3
  354. package/.build/next/server/chunks/open-sse_0s84hi7h9418d._.js +16 -3
  355. package/.build/next/server/chunks/open-sse_1b6ivsct5ejh3._.js +1 -1
  356. package/.build/next/server/chunks/open-sse_1r2up99lm4jtz._.js +1 -1
  357. package/.build/next/server/chunks/open-sse_1tgbautgb4f7f._.js +16 -3
  358. package/.build/next/server/chunks/{open-sse_services_02bmh-sbso22m._.js → open-sse_services_00hw3r8y1gfsk._.js} +1 -1
  359. package/.build/next/server/chunks/open-sse_services_03wu42_5vmj9o._.js +2 -2
  360. package/.build/next/server/chunks/open-sse_services_0ct5y5fs-6yum._.js +2 -2
  361. package/.build/next/server/chunks/{open-sse_services_04dvqigm0hy_b._.js → open-sse_services_0faya5lemfn3z._.js} +1 -1
  362. package/.build/next/server/chunks/{open-sse_services_0884oo1_foqx1._.js → open-sse_services_0fqgcvavo8wg0._.js} +1 -1
  363. package/.build/next/server/chunks/{open-sse_services_0cjgk3rys3phs._.js → open-sse_services_0gp_perj2ozc7._.js} +1 -1
  364. package/.build/next/server/chunks/open-sse_services_0luw8b50a275y._.js +3 -0
  365. package/.build/next/server/chunks/open-sse_services_0lz8kz3o3n32w._.js +3 -0
  366. package/.build/next/server/chunks/open-sse_services_0o2xbv4-s_hgc._.js +2 -2
  367. package/.build/next/server/chunks/open-sse_services_0uzit9opfex07._.js +3 -0
  368. package/.build/next/server/chunks/open-sse_services_10-13kqpampl8._.js +3 -0
  369. package/.build/next/server/chunks/open-sse_services_11px-eu6wpco1._.js +3 -0
  370. package/.build/next/server/chunks/open-sse_services_12xf6ogfm7fk6._.js +3 -0
  371. package/.build/next/server/chunks/open-sse_services_13aor5_u0vw67._.js +3 -0
  372. package/.build/next/server/chunks/open-sse_services_17to5z2yz9tp5._.js +3 -0
  373. package/.build/next/server/chunks/open-sse_services_1_z10i8xets76._.js +2 -2
  374. package/.build/next/server/chunks/open-sse_services_1aofhb43cunjk._.js +3 -0
  375. package/.build/next/server/chunks/open-sse_services_1bmzbrj-w51an._.js +3 -0
  376. package/.build/next/server/chunks/open-sse_services_1cfnib8brx231._.js +3 -0
  377. package/.build/next/server/chunks/open-sse_services_1m558021-9l1o._.js +3 -0
  378. package/.build/next/server/chunks/open-sse_services_1mixpyyaadj44._.js +2 -2
  379. package/.build/next/server/chunks/open-sse_services_1pb9vai4pzp46._.js +3 -0
  380. package/.build/next/server/chunks/open-sse_services_1u1h_rm99qyq_._.js +3 -0
  381. package/.build/next/server/chunks/open-sse_services_1v47txy532v7j._.js +3 -0
  382. package/.build/next/server/chunks/open-sse_services_1zn2whnlx96gx._.js +3 -0
  383. package/.build/next/server/chunks/open-sse_services_20qr88u5g_bzt._.js +3 -0
  384. package/.build/next/server/chunks/open-sse_services_kiroRegion_ts_1plr7t56zivs5._.js +1 -1
  385. package/.build/next/server/chunks/open-sse_utils_requestLogger_ts_0bd_-kg8s0mnb._.js +1 -1
  386. package/.build/next/server/chunks/open-sse_utils_requestLogger_ts_0o1bn8tbcrdys._.js +1 -1
  387. package/.build/next/server/chunks/{src_0gff8n1288m1s._.js → src_06dmt2gh7c2r5._.js} +1 -1
  388. package/.build/next/server/chunks/src_072_u91zja_z6._.js +1 -1
  389. package/.build/next/server/chunks/{src_0ogv5rsf3ovzt._.js → src_0iivcw6e2y8b-._.js} +1 -1
  390. package/.build/next/server/chunks/src_0jsr5vm5qt_kk._.js +1 -1
  391. package/.build/next/server/chunks/{src_1gr5o5rdqanpt._.js → src_0l9p-6g-6c00r._.js} +1 -1
  392. package/.build/next/server/chunks/src_1m93lsr72gv4e._.js +1 -1
  393. package/.build/next/server/chunks/src_1p24y5m9owsdz._.js +1 -1
  394. package/.build/next/server/chunks/{src_1w9wqtyffs4jp._.js → src_20-a3old2hlv7._.js} +1 -1
  395. package/.build/next/server/chunks/{src_lib_0t6aj24w2w4um._.js → src_lib_05upj47v7jd8d._.js} +1 -1
  396. package/.build/next/server/chunks/{src_lib_18c9gtbeeedlu._.js → src_lib_0g6dvcltrlrt1._.js} +1 -1
  397. package/.build/next/server/chunks/{src_lib_plugins_manager_ts_082ank_n7lv72._.js → src_lib_plugins_manager_ts_06-b_e2ssdrqp._.js} +2 -2
  398. package/.build/next/server/chunks/{src_lib_plugins_manager_ts_08h-7dzhghsw_._.js → src_lib_plugins_manager_ts_07a371xptxn0i._.js} +2 -2
  399. package/.build/next/server/chunks/{src_lib_plugins_manager_ts_08obzclzfmgdo._.js → src_lib_plugins_manager_ts_07iwfiw5lpzv6._.js} +2 -2
  400. package/.build/next/server/chunks/{src_lib_plugins_manager_ts_0_8jhcn7g0hyd._.js → src_lib_plugins_manager_ts_094zfas129qox._.js} +2 -2
  401. package/.build/next/server/chunks/src_lib_plugins_manager_ts_09x05wttn6gky._.js +3 -0
  402. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0eicpmorbgq_0._.js +3 -0
  403. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0j45w1t53tqiq._.js +3 -0
  404. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0jtsoy2o58_fe._.js +3 -0
  405. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0k2l6fz_allhv._.js +3 -0
  406. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0m4u5d2zpf0jx._.js +3 -0
  407. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0r69m_ija5052._.js +3 -0
  408. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0rd7v66pzywb8._.js +3 -0
  409. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0u9_z3h42wsrr._.js +3 -0
  410. package/.build/next/server/chunks/src_lib_plugins_manager_ts_12ucso7gp_9we._.js +3 -0
  411. package/.build/next/server/chunks/src_lib_plugins_manager_ts_16wp__3_qev5x._.js +3 -0
  412. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1d_p6ksvmoo3y._.js +3 -0
  413. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1l-e0sne7qzzx._.js +3 -0
  414. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1lf_y4ssq-plx._.js +3 -0
  415. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1qlgxrqwigi2t._.js +3 -0
  416. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1u2eu34-upcvy._.js +3 -0
  417. package/.build/next/server/chunks/src_lib_plugins_manager_ts_218376dd7xrc4._.js +3 -0
  418. package/.build/next/server/chunks/{src_lib_quota_0gw-asus4493x._.js → src_lib_quota_05418fyg4agnh._.js} +1 -1
  419. package/.build/next/server/chunks/{src_lib_quota_0mglshbqfhgw7._.js → src_lib_quota_05bcp_6tt7jbr._.js} +1 -1
  420. package/.build/next/server/chunks/{src_lib_quota_0zwicsy-gs0ct._.js → src_lib_quota_0nybt-asgnvf4._.js} +1 -1
  421. package/.build/next/server/chunks/{src_lib_quota_1o_jx24-m_fom._.js → src_lib_quota_0vqp3tcjqt1dw._.js} +1 -1
  422. package/.build/next/server/chunks/{src_lib_quota_2002143jitgx6._.js → src_lib_quota_0wb8erb76zq-0._.js} +1 -1
  423. package/.build/next/server/chunks/src_lib_quota_19hosofplhjh1._.js +3 -0
  424. package/.build/next/server/chunks/{src_lib_quota_quotaKey_ts_0e9929u5mgny4._.js → src_lib_quota_quotaKey_ts_00sufley9tfda._.js} +1 -1
  425. package/.build/next/server/chunks/{src_lib_quota_quotaKey_ts_06gq2e2g0ozlr._.js → src_lib_quota_quotaKey_ts_05unnu3n41ko_._.js} +1 -1
  426. package/.build/next/server/chunks/{src_lib_quota_quotaKey_ts_07_2e5snrn1ck._.js → src_lib_quota_quotaKey_ts_0_9lralwqmbb2._.js} +1 -1
  427. package/.build/next/server/chunks/{src_lib_quota_quotaKey_ts_0e3c15o4yzmvf._.js → src_lib_quota_quotaKey_ts_0anxeaf_zkp8o._.js} +1 -1
  428. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0ffo874n5oku6._.js +3 -0
  429. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0jafzf3ifgkuv._.js +3 -0
  430. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0llm3vdjpfanc._.js +3 -0
  431. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0o6z11z1bom_m._.js +3 -0
  432. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0txirnznm274h._.js +3 -0
  433. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0xuq_g-h5m3c1._.js +3 -0
  434. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_10_ltppb3vez-._.js +3 -0
  435. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_151pluvj7g-vc._.js +3 -0
  436. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1ceheb324j-3o._.js +3 -0
  437. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1es9tfkkri56i._.js +3 -0
  438. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1g0ppe_dhr5q1._.js +3 -0
  439. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1lyayo5r_xxjv._.js +3 -0
  440. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1mc353kr74tft._.js +3 -0
  441. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1q-_0jqsbdlh5._.js +3 -0
  442. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1qd-81-a26uej._.js +3 -0
  443. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1qg73wxhhll-s._.js +3 -0
  444. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1t-h7vqoh9u3s._.js +3 -0
  445. package/.build/next/server/chunks/{src_lib_usage_callLogs_ts_0qnepwt2wta77._.js → src_lib_usage_callLogs_ts_1sie3xbxc5_10._.js} +1 -1
  446. package/.build/next/server/chunks/src_shared_constants_1vndx1xsi1o3x._.js +1 -1
  447. package/.build/next/server/chunks/{src_shared_services_03_eh-49sw70b._.js → src_shared_services_057p4bz8pl04k._.js} +1 -1
  448. package/.build/next/server/chunks/{src_shared_services_04hl1xzqthbh1._.js → src_shared_services_080e2ej5vl6ay._.js} +1 -1
  449. package/.build/next/server/chunks/{src_shared_services_0fjvc-g7uuyno._.js → src_shared_services_0eedv-3vaf69y._.js} +1 -1
  450. package/.build/next/server/chunks/{src_shared_services_0kg6hc95fd11s._.js → src_shared_services_0erucmxdso94e._.js} +1 -1
  451. package/.build/next/server/chunks/{src_shared_services_04z41n7bdg09x._.js → src_shared_services_0lt7_o14ml7sz._.js} +1 -1
  452. package/.build/next/server/chunks/{src_shared_services_06s-_f77zvc_v._.js → src_shared_services_0mv_oizuaavj6._.js} +1 -1
  453. package/.build/next/server/chunks/src_shared_services_0pbe9rzf7waje._.js +3 -0
  454. package/.build/next/server/chunks/src_shared_services_0yf7zz4c9vtx-._.js +3 -0
  455. package/.build/next/server/chunks/src_shared_services_0zulbbb3ttk64._.js +3 -0
  456. package/.build/next/server/chunks/src_shared_services_1-1kghymkipsb._.js +3 -0
  457. package/.build/next/server/chunks/{src_shared_services_13msbx-c1194y._.js → src_shared_services_106s8shtblhd5._.js} +1 -1
  458. package/.build/next/server/chunks/src_shared_services_11l3nwnjgyxm-._.js +3 -0
  459. package/.build/next/server/chunks/src_shared_services_12t1-ga9w38dz._.js +3 -0
  460. package/.build/next/server/chunks/src_shared_services_14w2j2iqdj9eb._.js +3 -0
  461. package/.build/next/server/chunks/src_shared_services_176ndx2kuwev7._.js +3 -0
  462. package/.build/next/server/chunks/{src_shared_services_1jmf68l2lf9nz._.js → src_shared_services_1e0qskhl18qx6._.js} +1 -1
  463. package/.build/next/server/chunks/src_shared_services_1egld-y_7xfyo._.js +3 -0
  464. package/.build/next/server/chunks/src_shared_services_1fhzl753fxvsf._.js +3 -0
  465. package/.build/next/server/chunks/src_shared_services_1rjiu-sbe0cc_._.js +3 -0
  466. package/.build/next/server/chunks/src_shared_services_1w8ezwxiuwg4-._.js +3 -0
  467. package/.build/next/server/chunks/src_shared_services_1y_ma3zvgiio6._.js +3 -0
  468. package/.build/next/server/chunks/src_shared_services_1ypadc9tai46y._.js +3 -0
  469. package/.build/next/server/chunks/{src_shared_services_modelSyncScheduler_ts_0jprbetg42idf._.js → src_shared_services_modelSyncScheduler_ts_091bx-fd70d-_._.js} +1 -1
  470. package/.build/next/server/chunks/{src_shared_services_modelSyncScheduler_ts_1w5s8oci38o86._.js → src_shared_services_modelSyncScheduler_ts_0x1-b0_nhg8oa._.js} +1 -1
  471. package/.build/next/server/chunks/{src_shared_services_modelSyncScheduler_ts_0z9wckeen9uzt._.js → src_shared_services_modelSyncScheduler_ts_0zan1i5wv3x1s._.js} +1 -1
  472. package/.build/next/server/chunks/{src_shared_services_modelSyncScheduler_ts_1admvvz7wu5mb._.js → src_shared_services_modelSyncScheduler_ts_1xd6j5kaxzekj._.js} +1 -1
  473. package/.build/next/server/chunks/{src_shared_services_modelSyncScheduler_ts_1nid3ygpp832c._.js → src_shared_services_modelSyncScheduler_ts_1zp-x3g0jwv9s._.js} +1 -1
  474. package/.build/next/server/chunks/ssr/_0rb4h6lptmehu._.js +1 -1
  475. package/.build/next/server/chunks/ssr/_1ucg-1lxpwd_3._.js +2 -2
  476. package/.build/next/server/chunks/ssr/_1wo8wxqh1dk5a._.js +2 -2
  477. package/.build/next/server/middleware-build-manifest.js +3 -3
  478. package/.build/next/server/middleware.js +2 -2
  479. package/.build/next/server/pages/500.html +1 -1
  480. package/.build/next/static/chunks/{1osm01_w12rhk.js → 273ss8mst5n0x.js} +1 -1
  481. package/.build/next/static/chunks/{0wxtns-mya-et.css → 36imcs53bs6ue.css} +1 -1
  482. package/.build/next/static/chunks/{2yhtmu668hmia.js → 41ia4t5lkoy-u.js} +1 -1
  483. package/open-sse/config/claudeTokens.ts +108 -0
  484. package/open-sse/executors/base.ts +17 -0
  485. package/open-sse/executors/kiro.ts +845 -91
  486. package/open-sse/handlers/chatCore/nonStreamingResponseParse.ts +14 -0
  487. package/open-sse/handlers/chatCore.ts +23 -3
  488. package/open-sse/handlers/responseTranslator.ts +29 -5
  489. package/open-sse/handlers/sseParser.ts +21 -0
  490. package/open-sse/services/combo/targetExhaustion.ts +16 -1
  491. package/open-sse/services/combo.ts +2 -0
  492. package/open-sse/services/kiroRegion.ts +20 -0
  493. package/open-sse/services/usage/kimi.ts +64 -5
  494. package/open-sse/services/webSearchResultText.ts +100 -0
  495. package/open-sse/translator/request/claude-to-openai.ts +194 -3
  496. package/open-sse/translator/request/openai-to-kiro.ts +165 -11
  497. package/open-sse/translator/response/kiro-to-openai.ts +16 -0
  498. package/open-sse/translator/response/openai-to-claude.ts +74 -3
  499. package/open-sse/utils/contextOverflowError.ts +63 -0
  500. package/open-sse/utils/finishReason.ts +8 -0
  501. package/open-sse/utils/pdfText.ts +1252 -0
  502. package/open-sse/utils/requestLogger.ts +4 -1
  503. package/open-sse/utils/stream.ts +19 -6
  504. package/open-sse/utils/streamHelpers.ts +3 -1
  505. package/open-sse/utils/streamPayloadCollector.ts +3 -0
  506. package/package.json +1 -1
  507. package/src/app/api/v1/messages/count_tokens/route.ts +64 -6
  508. package/src/app/api/v1/messages/route.ts +7 -1
  509. package/src/domain/quotaCache.ts +4 -2
  510. package/src/server/authz/pipeline.ts +6 -0
  511. package/src/shared/components/CommandPalette.tsx +2 -2
  512. package/src/shared/components/Sidebar.tsx +3 -3
  513. package/src/shared/utils/anthropicErrorShape.ts +89 -0
  514. package/src/sse/handlers/chat.ts +30 -0
  515. package/src/sse/handlers/webSearchEmulation.ts +1181 -0
  516. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0agn1t27_-87q.js +0 -3
  517. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0bdbaz8ncan3j.js +0 -3
  518. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0ic-xl80j3ahf.js +0 -3
  519. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0j-gka-h5--g7.js +0 -3
  520. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0jikxjpd83y3m.js +0 -3
  521. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0pcsfxk7rl_qj.js +0 -3
  522. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_0rour4wnl6mch.js +0 -3
  523. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1-vgf7hsozo4d.js +0 -3
  524. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1-wk-99yzo_ij.js +0 -3
  525. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_11j-oo1fko_w9.js +0 -3
  526. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_163fonx9p1t53.js +0 -3
  527. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1_scz53f35ozv.js +0 -3
  528. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1b31tiezn9knj.js +0 -3
  529. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1bc7yeb23me7o.js +0 -3
  530. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1cy8wnhh8esbt.js +0 -3
  531. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1hcyk-boxbura.js +0 -3
  532. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1hjr8tkngjpn2.js +0 -3
  533. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1i9ijw0wkft95.js +0 -3
  534. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1o4j3aexo9biu.js +0 -3
  535. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1pvenj5ob2aem.js +0 -3
  536. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_1q3t40dvo4--p.js +0 -3
  537. package/.build/next/server/chunks/1q96_modules_@aws-sdk_nested-clients_dist-es_submodules_signin_index_2024waa5dd1lu.js +0 -3
  538. package/.build/next/server/chunks/[root-of-the-server]__0cyc8ns5c-hak._.js +0 -3
  539. package/.build/next/server/chunks/[root-of-the-server]__0hsw8ehbw3i2o._.js +0 -3
  540. package/.build/next/server/chunks/[root-of-the-server]__0jojq4ni9peyl._.js +0 -3
  541. package/.build/next/server/chunks/[root-of-the-server]__0k_9tln3gjdsg._.js +0 -3
  542. package/.build/next/server/chunks/[root-of-the-server]__0sh-ax_s9lxgs._.js +0 -3
  543. package/.build/next/server/chunks/[root-of-the-server]__0yjugdbzmjz__._.js +0 -3
  544. package/.build/next/server/chunks/[root-of-the-server]__0yku0wexi8ghl._.js +0 -3
  545. package/.build/next/server/chunks/[root-of-the-server]__0yt9iwxll_l6u._.js +0 -3
  546. package/.build/next/server/chunks/[root-of-the-server]__0zgbbqlctz_ss._.js +0 -3
  547. package/.build/next/server/chunks/[root-of-the-server]__1-1xnobnihmvu._.js +0 -3
  548. package/.build/next/server/chunks/[root-of-the-server]__10y_wajcozqre._.js +0 -3
  549. package/.build/next/server/chunks/[root-of-the-server]__172v_j4xarr6o._.js +0 -3
  550. package/.build/next/server/chunks/[root-of-the-server]__176x6fzvqwsiv._.js +0 -3
  551. package/.build/next/server/chunks/[root-of-the-server]__17ud9_3_ssk8k._.js +0 -3
  552. package/.build/next/server/chunks/[root-of-the-server]__19ocgqujae39l._.js +0 -3
  553. package/.build/next/server/chunks/[root-of-the-server]__1cwkjoabvk0op._.js +0 -3
  554. package/.build/next/server/chunks/[root-of-the-server]__1jb65mvmckdjg._.js +0 -3
  555. package/.build/next/server/chunks/[root-of-the-server]__1ks8m6fd5ayhs._.js +0 -3
  556. package/.build/next/server/chunks/[root-of-the-server]__1m7e1c6uyafq0._.js +0 -3
  557. package/.build/next/server/chunks/[root-of-the-server]__1my791be0ej2f._.js +0 -3
  558. package/.build/next/server/chunks/[root-of-the-server]__1ohivgmoa4y7_._.js +0 -3
  559. package/.build/next/server/chunks/[root-of-the-server]__1pwuqglvqb8ae._.js +0 -3
  560. package/.build/next/server/chunks/[root-of-the-server]__1q9d4sa50girl._.js +0 -3
  561. package/.build/next/server/chunks/[root-of-the-server]__1qqnlb8mlv5qn._.js +0 -3
  562. package/.build/next/server/chunks/[root-of-the-server]__1sbq18_dr5ht1._.js +0 -3
  563. package/.build/next/server/chunks/[root-of-the-server]__1wcvw0tlzacfj._.js +0 -3
  564. package/.build/next/server/chunks/[root-of-the-server]__20gdw36eknl9h._.js +0 -3
  565. package/.build/next/server/chunks/_0mqzrek7ffz5c._.js +0 -3
  566. package/.build/next/server/chunks/_0ox6qf339bblb._.js +0 -3
  567. package/.build/next/server/chunks/_0re9_1xpmi1in._.js +0 -3
  568. package/.build/next/server/chunks/_0w7y9fwzdv184._.js +0 -3
  569. package/.build/next/server/chunks/_1--z-c5w3yh_b._.js +0 -3
  570. package/.build/next/server/chunks/_11dfub0-g5hqx._.js +0 -3
  571. package/.build/next/server/chunks/_13xv49s2emgbh._.js +0 -12
  572. package/.build/next/server/chunks/_142m98dl-v5qx._.js +0 -3
  573. package/.build/next/server/chunks/_16fb5lg934z_y._.js +0 -3
  574. package/.build/next/server/chunks/_16ldvpp3ltmg_._.js +0 -3
  575. package/.build/next/server/chunks/_17i9uubpwxtr6._.js +0 -3
  576. package/.build/next/server/chunks/_18nswcjdn-o_d._.js +0 -3
  577. package/.build/next/server/chunks/_19d_r4e56lw6c._.js +0 -3
  578. package/.build/next/server/chunks/_19lsyjj_cdcma._.js +0 -3
  579. package/.build/next/server/chunks/_1_a8xtb4eim3-._.js +0 -3
  580. package/.build/next/server/chunks/_1c99m13xvj0dv._.js +0 -3
  581. package/.build/next/server/chunks/_1do5vraekw7a_._.js +0 -3
  582. package/.build/next/server/chunks/_1e-2ziz7vbvj9._.js +0 -3
  583. package/.build/next/server/chunks/_1foat8d-cw4p_._.js +0 -3
  584. package/.build/next/server/chunks/_1lg1a1-ip82th._.js +0 -3
  585. package/.build/next/server/chunks/_1lyng1xt6yaki._.js +0 -3
  586. package/.build/next/server/chunks/_1nprpllrhv5ur._.js +0 -3
  587. package/.build/next/server/chunks/_1nxn6ans9h-yd._.js +0 -3
  588. package/.build/next/server/chunks/_1ohylflm1s935._.js +0 -3
  589. package/.build/next/server/chunks/_1omvf1ucof_yl._.js +0 -3
  590. package/.build/next/server/chunks/_1p60mk1s2dj0m._.js +0 -3
  591. package/.build/next/server/chunks/_1p628qecv5bcu._.js +0 -3
  592. package/.build/next/server/chunks/_1t0wesdzmxm--._.js +0 -3
  593. package/.build/next/server/chunks/_1tryysi-zw-uk._.js +0 -3
  594. package/.build/next/server/chunks/_1u2fevomxng1z._.js +0 -3
  595. package/.build/next/server/chunks/_1u9svjs_bx9zp._.js +0 -3
  596. package/.build/next/server/chunks/_1ukh92xt_h9ls._.js +0 -3
  597. package/.build/next/server/chunks/_1v87bx9e8bvly._.js +0 -3
  598. package/.build/next/server/chunks/_1vf7irr1wo9p-._.js +0 -3
  599. package/.build/next/server/chunks/_1wkk7z3fobxbo._.js +0 -3
  600. package/.build/next/server/chunks/node_modules_0_x6ms_t9skng._.js +0 -3
  601. package/.build/next/server/chunks/node_modules_0gohbx9aorh0u._.js +0 -3
  602. package/.build/next/server/chunks/node_modules_0kv7lp09lm4-8._.js +0 -3
  603. package/.build/next/server/chunks/node_modules_0l3c--_iz3xqs._.js +0 -3
  604. package/.build/next/server/chunks/node_modules_0p85cgv7zv71m._.js +0 -3
  605. package/.build/next/server/chunks/node_modules_0pkok82ldrbvy._.js +0 -3
  606. package/.build/next/server/chunks/node_modules_0taa189fdyrvj._.js +0 -3
  607. package/.build/next/server/chunks/node_modules_0xbbdz3qows09._.js +0 -3
  608. package/.build/next/server/chunks/node_modules_0z17bntb8cv10._.js +0 -3
  609. package/.build/next/server/chunks/node_modules_12n0xi55k1732._.js +0 -3
  610. package/.build/next/server/chunks/node_modules_12w64fw3z-bcd._.js +0 -3
  611. package/.build/next/server/chunks/node_modules_17q-udh619fx5._.js +0 -3
  612. package/.build/next/server/chunks/node_modules_19z_pj5419z4n._.js +0 -3
  613. package/.build/next/server/chunks/node_modules_1kx78kk7zgs6_._.js +0 -3
  614. package/.build/next/server/chunks/node_modules_1l6a6ml6v2i_k._.js +0 -3
  615. package/.build/next/server/chunks/node_modules_1lkgfl4ettcxp._.js +0 -3
  616. package/.build/next/server/chunks/node_modules_1t9hizql924bp._.js +0 -3
  617. package/.build/next/server/chunks/node_modules_1tdhc46ytvj0n._.js +0 -3
  618. package/.build/next/server/chunks/node_modules_1uk_qp0gbho8r._.js +0 -3
  619. package/.build/next/server/chunks/node_modules_1w0h0i7jkq9fa._.js +0 -3
  620. package/.build/next/server/chunks/node_modules_1xtwpfq69aty8._.js +0 -3
  621. package/.build/next/server/chunks/node_modules_1zlh23qg1uq5s._.js +0 -3
  622. package/.build/next/server/chunks/node_modules_@aws-sdk_0fukg5x40kwub._.js +0 -3
  623. package/.build/next/server/chunks/node_modules_@aws-sdk_0g1gza5ppvhr8._.js +0 -3
  624. package/.build/next/server/chunks/node_modules_@aws-sdk_0h_fcdlqd8s5n._.js +0 -3
  625. package/.build/next/server/chunks/node_modules_@aws-sdk_0jpc8oc6b6i93._.js +0 -3
  626. package/.build/next/server/chunks/node_modules_@aws-sdk_0rr7gmwwe5-dh._.js +0 -3
  627. package/.build/next/server/chunks/node_modules_@aws-sdk_0v_xskgrff6wd._.js +0 -3
  628. package/.build/next/server/chunks/node_modules_@aws-sdk_0zuuhl2wpxt8p._.js +0 -3
  629. package/.build/next/server/chunks/node_modules_@aws-sdk_11ckwzfy422am._.js +0 -3
  630. package/.build/next/server/chunks/node_modules_@aws-sdk_11d97npmgf-3r._.js +0 -3
  631. package/.build/next/server/chunks/node_modules_@aws-sdk_12_vv1aumcw9-._.js +0 -3
  632. package/.build/next/server/chunks/node_modules_@aws-sdk_18d7kh8fes7vc._.js +0 -3
  633. package/.build/next/server/chunks/node_modules_@aws-sdk_1d2_q1k2wkf5s._.js +0 -3
  634. package/.build/next/server/chunks/node_modules_@aws-sdk_1glhxo4bsedyk._.js +0 -3
  635. package/.build/next/server/chunks/node_modules_@aws-sdk_1jk-2_ih5r8hp._.js +0 -3
  636. package/.build/next/server/chunks/node_modules_@aws-sdk_1mq27hyj74pss._.js +0 -3
  637. package/.build/next/server/chunks/node_modules_@aws-sdk_1n6-p7yy8md7l._.js +0 -3
  638. package/.build/next/server/chunks/node_modules_@aws-sdk_1os1eoc8tim1y._.js +0 -3
  639. package/.build/next/server/chunks/node_modules_@aws-sdk_1req4zcx_0cnx._.js +0 -3
  640. package/.build/next/server/chunks/node_modules_@aws-sdk_1v244fqkm56j8._.js +0 -3
  641. package/.build/next/server/chunks/node_modules_@aws-sdk_1wwzw_mr_0uhv._.js +0 -3
  642. package/.build/next/server/chunks/node_modules_@aws-sdk_1xyy_nekye31j._.js +0 -3
  643. package/.build/next/server/chunks/node_modules_@aws-sdk_20myne_q7f2m8._.js +0 -3
  644. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_04gwvpkl1nug0.js +0 -3
  645. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0630cbcbg0avk.js +0 -3
  646. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0a--3zhc3833c.js +0 -3
  647. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0cig_ru63jzhj.js +0 -3
  648. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0e_80iimfmh81.js +0 -3
  649. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0hmbodnfjrup6.js +0 -3
  650. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0pbaee_84omvg.js +0 -3
  651. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0xwupvdbu9jfl.js +0 -3
  652. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_0yd50kn037tj7.js +0 -3
  653. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1167_x8-auv93.js +0 -3
  654. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_126xpn2yg3grm.js +0 -3
  655. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_16ku3dxvhzhkk.js +0 -3
  656. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_19bzdp_-n6sq0.js +0 -3
  657. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1_ik1zykfz6zp.js +0 -3
  658. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1dqajoz1ygnbf.js +0 -3
  659. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1o4k7zmx1j2bu.js +0 -3
  660. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1oavue5eviexc.js +0 -3
  661. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1rqp1l_ptnubg.js +0 -3
  662. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1rw3-4dmewdr4.js +0 -3
  663. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1tyx-v56ebpk_.js +0 -3
  664. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_1wn_1b_n7nq-2.js +0 -3
  665. package/.build/next/server/chunks/node_modules_@aws-sdk_credential-provider-sso_dist-es_loadSso_20yftlrkp9ara.js +0 -3
  666. package/.build/next/server/chunks/node_modules_ioredis_built_index_1yvlsm3ny3pj9.js +0 -3
  667. package/.build/next/server/chunks/open-sse_services_0cukrrcbxl1gr._.js +0 -3
  668. package/.build/next/server/chunks/open-sse_services_0ef13xoz5w433._.js +0 -3
  669. package/.build/next/server/chunks/open-sse_services_0hdeb5rg-7ctc._.js +0 -3
  670. package/.build/next/server/chunks/open-sse_services_0jjlzdp9t8t3p._.js +0 -3
  671. package/.build/next/server/chunks/open-sse_services_0jyo433yl_s3-._.js +0 -3
  672. package/.build/next/server/chunks/open-sse_services_0w0o42y4k_0xp._.js +0 -3
  673. package/.build/next/server/chunks/open-sse_services_0x51vcvrd1uy1._.js +0 -3
  674. package/.build/next/server/chunks/open-sse_services_0yenufzwhjgz0._.js +0 -3
  675. package/.build/next/server/chunks/open-sse_services_138omazpx4xu1._.js +0 -3
  676. package/.build/next/server/chunks/open-sse_services_162a5-wghb28k._.js +0 -3
  677. package/.build/next/server/chunks/open-sse_services_1blmj_n8yoazn._.js +0 -3
  678. package/.build/next/server/chunks/open-sse_services_1c2_vovh6b_pe._.js +0 -3
  679. package/.build/next/server/chunks/open-sse_services_1fgkobij47qea._.js +0 -3
  680. package/.build/next/server/chunks/open-sse_services_1iuacwne-axoo._.js +0 -3
  681. package/.build/next/server/chunks/open-sse_services_1ktbqi-1t65pn._.js +0 -3
  682. package/.build/next/server/chunks/open-sse_services_1mdjfnli_1im9._.js +0 -3
  683. package/.build/next/server/chunks/open-sse_services_1s729m6to90v4._.js +0 -3
  684. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0b48oh-otx_ol._.js +0 -3
  685. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0fnwm57tvxp50._.js +0 -3
  686. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0qdw6u_-fb9qe._.js +0 -3
  687. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0u63lwdqoezav._.js +0 -3
  688. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0uw_jlq70rwri._.js +0 -3
  689. package/.build/next/server/chunks/src_lib_plugins_manager_ts_0yxhkyvrf6-x_._.js +0 -3
  690. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1-91nmo9cckkg._.js +0 -3
  691. package/.build/next/server/chunks/src_lib_plugins_manager_ts_11dshqgaqa7k2._.js +0 -3
  692. package/.build/next/server/chunks/src_lib_plugins_manager_ts_12z3np4ktvyaw._.js +0 -3
  693. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1548t2uj3kl8c._.js +0 -3
  694. package/.build/next/server/chunks/src_lib_plugins_manager_ts_198mvq_7kkncw._.js +0 -3
  695. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1cax0u9i8n09r._.js +0 -3
  696. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1dw31gw8gv5b4._.js +0 -3
  697. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1j3eh7kbz5s33._.js +0 -3
  698. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1jgvga752m2_v._.js +0 -3
  699. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1umjhh6i4065t._.js +0 -3
  700. package/.build/next/server/chunks/src_lib_plugins_manager_ts_1ydcm2zxi9w3m._.js +0 -3
  701. package/.build/next/server/chunks/src_lib_quota_1vpqly464si1q._.js +0 -3
  702. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0eqloedth3662._.js +0 -3
  703. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0gsym2up09qbd._.js +0 -3
  704. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0lqr7nuv40xhn._.js +0 -3
  705. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0qo8767hpoa2_._.js +0 -3
  706. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0r56lkpo6ejtl._.js +0 -3
  707. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0u2q7i-ffa3-0._.js +0 -3
  708. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_0y54fg642lkx_._.js +0 -3
  709. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_144c1_26o_xs_._.js +0 -3
  710. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1a5p04dslzkkr._.js +0 -3
  711. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1fqs-9wvkwg8u._.js +0 -3
  712. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1g_t5orpm0h2k._.js +0 -3
  713. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1kydk56tgu8ni._.js +0 -3
  714. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1sd-o-ncs0v_b._.js +0 -3
  715. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1u5q9l5wugo13._.js +0 -3
  716. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1vebln5zz0jh1._.js +0 -3
  717. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1x4r4ykpvtsng._.js +0 -3
  718. package/.build/next/server/chunks/src_lib_quota_quotaKey_ts_1xazcu5ici-w1._.js +0 -3
  719. package/.build/next/server/chunks/src_shared_services_083ix1a7l974z._.js +0 -3
  720. package/.build/next/server/chunks/src_shared_services_093xyaxwtg-ji._.js +0 -3
  721. package/.build/next/server/chunks/src_shared_services_0i9oken9kxj9j._.js +0 -3
  722. package/.build/next/server/chunks/src_shared_services_0r-8-60-r4v_r._.js +0 -3
  723. package/.build/next/server/chunks/src_shared_services_0r7xmlmt1k9hy._.js +0 -3
  724. package/.build/next/server/chunks/src_shared_services_0rg59_7jmlgm-._.js +0 -3
  725. package/.build/next/server/chunks/src_shared_services_0wme2znpr6_8s._.js +0 -3
  726. package/.build/next/server/chunks/src_shared_services_126q0wbgkzp5l._.js +0 -3
  727. package/.build/next/server/chunks/src_shared_services_12se2mvwbr2q0._.js +0 -3
  728. package/.build/next/server/chunks/src_shared_services_1fwlbkehafca_._.js +0 -3
  729. package/.build/next/server/chunks/src_shared_services_1m3xkf85ae5xt._.js +0 -3
  730. package/.build/next/server/chunks/src_shared_services_1obo27zju04g-._.js +0 -3
  731. package/.build/next/server/chunks/src_shared_services_1rnq7eju312ri._.js +0 -3
  732. package/.build/next/server/chunks/src_shared_services_1z51753rm-kau._.js +0 -3
  733. /package/.build/next/static/{9h-Y9U1tfaZmzr5AGgiYn → ScDemTJTEZMscCIzRWSqu}/_buildManifest.js +0 -0
  734. /package/.build/next/static/{9h-Y9U1tfaZmzr5AGgiYn → ScDemTJTEZMscCIzRWSqu}/_clientMiddlewareManifest.js +0 -0
  735. /package/.build/next/static/{9h-Y9U1tfaZmzr5AGgiYn → ScDemTJTEZMscCIzRWSqu}/_ssgManifest.js +0 -0
@@ -11,6 +11,7 @@ import {
11
11
  getKiroUserAgentHeaders,
12
12
  resolveKiroProfileArn,
13
13
  } from "../config/kiroIdentity.ts";
14
+ import { createHash } from "node:crypto";
14
15
  import { v4 as uuidv4 } from "uuid";
15
16
  import { refreshKiroToken } from "../services/tokenRefresh.ts";
16
17
  import {
@@ -30,6 +31,7 @@ import {
30
31
  resolveKiroRuntimeRegion,
31
32
  } from "../services/kiroRegion.ts";
32
33
  import { estimateOutputTokens } from "../utils/usageTracking.ts";
34
+ import { claudeCharsPerToken } from "../config/claudeTokens.ts";
33
35
  import { getModelContextLimit } from "../../src/lib/modelCapabilities.ts";
34
36
 
35
37
  type JsonRecord = Record<string, unknown>;
@@ -61,6 +63,15 @@ type KiroStreamState = {
61
63
  usage?: UsageSummary;
62
64
  hasReasoningContent?: boolean;
63
65
  reasoningChunkCount?: number;
66
+ // Kiro's own stop reason from `metadataEvent` (END_TURN, MAX_TOKENS, CONTENT_FILTERED, ...).
67
+ stopReason?: string;
68
+ // Anthropic `stop_details` of a refusal (category, explanation), sent with the finish chunk.
69
+ refusalDetails?: JsonRecord;
70
+ // Frame types seen and an EventStream exception, for the "ended without a stop reason" log.
71
+ frameCounts?: Record<string, number>;
72
+ exception?: string;
73
+ // The client's stop sequence that ended the answer (applied here: Kiro has none).
74
+ stopSequence?: string;
64
75
  // Inline-thinking splitter state (populated only when thinkingExpected=true).
65
76
  thinking?: KiroThinkingState;
66
77
  };
@@ -133,7 +144,17 @@ function buildKiroFinishChunk(
133
144
  {
134
145
  index: 0,
135
146
  delta: {},
136
- finish_reason: state.hasToolCalls ? "tool_calls" : "stop",
147
+ finish_reason: state.hasToolCalls ? "tool_calls" : kiroFinishReason(state.stopReason),
148
+ // Read by the OpenAI -> Claude step (stop_reason "stop_sequence"); ignored elsewhere.
149
+ ...(state.stopSequence !== undefined && !state.hasToolCalls
150
+ ? { stop_sequence: state.stopSequence }
151
+ : {}),
152
+ // Read by the OpenAI -> Claude step (Anthropic's `stop_details` of a refusal).
153
+ ...(state.refusalDetails &&
154
+ !state.hasToolCalls &&
155
+ kiroFinishReason(state.stopReason) === "content_filter"
156
+ ? { stop_details: state.refusalDetails }
157
+ : {}),
137
158
  },
138
159
  ],
139
160
  };
@@ -145,11 +166,455 @@ function buildKiroFinishChunk(
145
166
  return finishChunk;
146
167
  }
147
168
 
169
+ /** An error inside a Kiro answer, as the client should see it (OpenAI-shaped `error`). */
170
+ export type KiroStreamError = { status: number; type: string; code: string; message: string };
171
+
172
+ /**
173
+ * A Kiro EventStream exception (`:message-type` exception / error) as the error the client gets,
174
+ * by the AWS exception type (CodeWhisperer streaming: ThrottlingException, ValidationException,
175
+ * AccessDeniedException, InternalServerException, ...).
176
+ */
177
+ export function kiroStreamErrorOf(exceptionType: string, message: string): KiroStreamError {
178
+ const t = exceptionType.toLowerCase();
179
+ const text = (message || "").trim() || `Kiro stopped the answer (${exceptionType || "error"})`;
180
+ if (t.includes("throttl") || t.includes("quota")) {
181
+ return { status: 429, type: "rate_limit_error", code: exceptionType, message: text };
182
+ }
183
+ if (t.includes("validation")) {
184
+ return { status: 400, type: "invalid_request_error", code: exceptionType, message: text };
185
+ }
186
+ if (t.includes("accessdenied")) {
187
+ return { status: 403, type: "permission_error", code: exceptionType, message: text };
188
+ }
189
+ return {
190
+ status: 500,
191
+ type: "api_error",
192
+ code: exceptionType || "kiro_stream_error",
193
+ message: text,
194
+ };
195
+ }
196
+
197
+ /** Every complete Kiro answer ends with these (all 16 models, text and tool calls, 2026-11-10). */
198
+ function kiroAnswerClosed(state: KiroStreamState): boolean {
199
+ return !!(state.stopReason || state.hasContextUsage || state.hasMeteringEvent || state.stopSeen);
200
+ }
201
+
202
+ /** A Kiro answer that stopped before its end: Claude Code and other clients retry an error. */
203
+ const KIRO_INCOMPLETE_ANSWER: KiroStreamError = {
204
+ status: 502,
205
+ type: "api_error",
206
+ code: "kiro_stream_incomplete",
207
+ message: "Kiro ended the answer before it was complete. Please retry.",
208
+ };
209
+
210
+ function kiroErrorChunk(error: KiroStreamError): Uint8Array {
211
+ return TEXT_ENCODER.encode(`data: ${JSON.stringify({ error })}\n\n`);
212
+ }
148
213
  const KIRO_DEFAULT_CONTEXT_WINDOW = 200000;
149
214
 
150
- function ensureKiroUsage(state: KiroStreamState) {
151
- // Output estimate covers text, reasoning, code and tool calls (names + final args).
152
- const estimatedOutputTokens = estimateOutputTokens(state.totalContentLength || 0);
215
+ /** The client's `stop` / `max_tokens`, stashed by the request builder as `_clientLimits`. */
216
+ export type KiroClientLimits = { stop?: string[]; maxTokens?: number };
217
+
218
+ function readKiroClientLimits(body: unknown): KiroClientLimits | null {
219
+ const raw = (body as JsonRecord | null | undefined)?._clientLimits as JsonRecord | undefined;
220
+ if (!raw || typeof raw !== "object") return null;
221
+ const stop = Array.isArray(raw.stop)
222
+ ? raw.stop.filter((x): x is string => typeof x === "string" && x.length > 0)
223
+ : [];
224
+ const maxTokens = typeof raw.maxTokens === "number" && raw.maxTokens > 0 ? raw.maxTokens : 0;
225
+ if (!stop.length && !maxTokens) return null;
226
+ return { ...(stop.length ? { stop } : {}), ...(maxTokens ? { maxTokens } : {}) };
227
+ }
228
+
229
+ function kiroHistoryEntries(body: unknown): JsonRecord[] {
230
+ const state = (body as JsonRecord | null | undefined)?.conversationState as
231
+ JsonRecord | undefined;
232
+ return Array.isArray(state?.history) ? (state.history as JsonRecord[]) : [];
233
+ }
234
+
235
+ /** True when the request sends earlier thinking back (assistantResponseMessage.reasoningContent). */
236
+ export function kiroHistoryHasReasoning(body: unknown): boolean {
237
+ return kiroHistoryEntries(body).some(
238
+ (h) => !!(h?.assistantResponseMessage as JsonRecord | undefined)?.reasoningContent
239
+ );
240
+ }
241
+
242
+ /** Remove earlier thinking from the history (in place). */
243
+ export function stripKiroHistoryReasoning(body: unknown): void {
244
+ for (const h of kiroHistoryEntries(body)) {
245
+ const msg = h?.assistantResponseMessage as JsonRecord | undefined;
246
+ if (msg && "reasoningContent" in msg) delete msg.reasoningContent;
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Kiro ends every answer with a `metadataEvent` carrying its stop reason. A model refusal is
252
+ * `{"stopReason":"CONTENT_FILTERED","stopDetails":{"refusal":{"category":"CYBER"|
253
+ * "REASONING_EXTRACTION"|...,"explanation":"The selected model cannot continue this
254
+ * conversation. Please select a different model, ..."}}}` with no content frames at all
255
+ * (seen live 2026-11-10 on Claude Opus 5.5 / Sonnet 5.5 / Opus 5).
256
+ */
257
+ export function readKiroStopMetadata(payload: unknown): {
258
+ stopReason: string;
259
+ refused: boolean;
260
+ category: string;
261
+ explanation: string;
262
+ } | null {
263
+ if (!payload || typeof payload !== "object") return null;
264
+ const p = payload as JsonRecord;
265
+ const stopReason = typeof p.stopReason === "string" ? p.stopReason.toUpperCase() : "";
266
+ const details = p.stopDetails as JsonRecord | undefined;
267
+ const refusal =
268
+ details && typeof details === "object"
269
+ ? (details.refusal as JsonRecord | undefined)
270
+ : undefined;
271
+ if (!stopReason && !refusal) return null;
272
+ const category = refusal && typeof refusal.category === "string" ? refusal.category : "";
273
+ const explanation = refusal && typeof refusal.explanation === "string" ? refusal.explanation : "";
274
+ return {
275
+ stopReason: stopReason || "CONTENT_FILTERED",
276
+ refused: !!refusal || stopReason === "CONTENT_FILTERED",
277
+ category,
278
+ explanation,
279
+ };
280
+ }
281
+
282
+ /**
283
+ * Anthropic's `stop_details` for a refusal: `{type: "refusal", category, explanation}` with the
284
+ * category in lower case ("cyber", "reasoning_extraction", ...) or null when there is none.
285
+ */
286
+ export function kiroRefusalStopDetails(category: string, explanation: string): JsonRecord {
287
+ return {
288
+ type: "refusal",
289
+ category: category ? category.toLowerCase() : null,
290
+ explanation: explanation || null,
291
+ };
292
+ }
293
+
294
+ /** Kiro stop reason → OpenAI finish_reason ("content_filter" becomes Claude's "refusal"). */
295
+ export function kiroFinishReason(stopReason: string | undefined): string {
296
+ switch (stopReason) {
297
+ case "CONTENT_FILTERED":
298
+ case "GUARDRAIL_INTERVENED":
299
+ return "content_filter";
300
+ case "MAX_TOKENS":
301
+ case "MAX_OUTPUT_TOKENS":
302
+ case "LENGTH":
303
+ return "length";
304
+ default:
305
+ return "stop";
306
+ }
307
+ }
308
+
309
+ /**
310
+ * The model to answer with when Kiro's model refuses a request outright. Kiro's own message says
311
+ * "Please select a different model": the newest Claude models carry extra safeguards that refuse
312
+ * some ordinary agent requests (for example Claude Code's auto-mode safety check, which asks for
313
+ * a `<thinking>` section), while the model one step below answers them. Empty = no fallback.
314
+ * `TROUTEAI_KIRO_REFUSAL_FALLBACK=0` switches this off (the refusal is then passed on as is).
315
+ */
316
+ const KIRO_REFUSAL_FALLBACK: Record<string, string> = {
317
+ "claude-opus-5.5": "claude-opus-4.8",
318
+ "claude-opus-5": "claude-opus-4.8",
319
+ "claude-sonnet-5.5": "claude-sonnet-5",
320
+ };
321
+
322
+ export function kiroRefusalFallbackModel(modelId: string): string {
323
+ if (process.env.TROUTEAI_KIRO_REFUSAL_FALLBACK === "0") return "";
324
+ return KIRO_REFUSAL_FALLBACK[modelId] || "";
325
+ }
326
+
327
+ function kiroCurrentModelId(body: Record<string, unknown> | undefined): string {
328
+ const modelId = kiroCurrentUserMessage(body).modelId;
329
+ return typeof modelId === "string" ? modelId : "";
330
+ }
331
+
332
+ /**
333
+ * A Kiro answer that failed before any content (an EventStream exception first, or a stream
334
+ * that ended with no answer and no stop reason) as a plain HTTP error in Kiro's own JSON shape,
335
+ * so the request goes through the normal error path (retry, other account, next combo step)
336
+ * instead of reaching the client as an empty 200 stream. Null when the answer started fine.
337
+ */
338
+ function kiroFailureBeforeContent(
339
+ peeked: { exception: KiroStreamError | null; empty: boolean },
340
+ modelId: string,
341
+ log?: ExecutorLog | null
342
+ ): Response | null {
343
+ const error = peeked.exception
344
+ ? peeked.exception
345
+ : peeked.empty
346
+ ? { ...KIRO_INCOMPLETE_ANSWER, message: "Kiro ended the stream without an answer" }
347
+ : null;
348
+ if (!error) return null;
349
+ log?.warn?.("KIRO", `${modelId} failed before answering: ${error.code} ${error.message}`);
350
+ return new Response(JSON.stringify({ message: error.message, reason: error.code }), {
351
+ status: error.status,
352
+ headers: { "Content-Type": "application/json" },
353
+ });
354
+ }
355
+
356
+ /** The SSE answer for a refusal with no output: an empty turn that stops with "content_filter". */
357
+ function kiroRefusalSseResponse(model: string, category = "", explanation = ""): Response {
358
+ const base = {
359
+ id: `chatcmpl-${Date.now()}`,
360
+ object: "chat.completion.chunk",
361
+ created: Math.floor(Date.now() / 1000),
362
+ model,
363
+ };
364
+ const frames = [
365
+ { ...base, choices: [{ index: 0, delta: { role: "assistant" }, finish_reason: null }] },
366
+ {
367
+ ...base,
368
+ choices: [
369
+ {
370
+ index: 0,
371
+ delta: {},
372
+ finish_reason: "content_filter",
373
+ stop_details: kiroRefusalStopDetails(category, explanation),
374
+ },
375
+ ],
376
+ },
377
+ ];
378
+ const text = frames.map((f) => `data: ${JSON.stringify(f)}\n\n`).join("") + "data: [DONE]\n\n";
379
+ return new Response(text, {
380
+ status: 200,
381
+ headers: {
382
+ "Content-Type": "text/event-stream",
383
+ "Cache-Control": "no-cache",
384
+ Connection: "keep-alive",
385
+ },
386
+ });
387
+ }
388
+
389
+ function kiroCurrentUserMessage(body: Record<string, unknown> | undefined): JsonRecord {
390
+ const state = body?.conversationState as JsonRecord | undefined;
391
+ const current = state?.currentMessage as JsonRecord | undefined;
392
+ return (current?.userInputMessage as JsonRecord | undefined) || {};
393
+ }
394
+
395
+ function kiroThinkingDirectiveSent(body: Record<string, unknown> | undefined): boolean {
396
+ const content = kiroCurrentUserMessage(body).content;
397
+ return typeof content === "string" && content.includes("<thinking_mode>enabled</thinking_mode>");
398
+ }
399
+
400
+ function kiroBodyWithModel(
401
+ body: Record<string, unknown> | undefined,
402
+ fromModelId: string,
403
+ toModelId: string
404
+ ): string {
405
+ return JSON.stringify(body)
406
+ .split(`"modelId":${JSON.stringify(fromModelId)}`)
407
+ .join(`"modelId":${JSON.stringify(toModelId)}`);
408
+ }
409
+
410
+ // Helper prompts that a model refused for REASONING_EXTRACTION, kept in memory for a while.
411
+ // Only single-shot requests without tools and history qualify (Claude Code's auto-mode safety
412
+ // check is one): their first 4 KB is the helper's own fixed instruction text, so the key never
413
+ // matches a normal conversation, whose requests always carry tools or history.
414
+ const KIRO_HELPER_REFUSAL_TTL_MS = 30 * 60_000;
415
+ const KIRO_HELPER_REFUSAL_MAX = 200;
416
+ const kiroHelperRefusals = new Map<string, number>();
417
+
418
+ /** The text of a history that is only [system turn, "(empty)"], else null. */
419
+ function kiroSplitSystemTurnText(history: unknown): string | null {
420
+ if (!Array.isArray(history) || history.length !== 2) return null;
421
+ const user = (history[0] as JsonRecord | undefined)?.userInputMessage as JsonRecord | undefined;
422
+ const answer = (history[1] as JsonRecord | undefined)?.assistantResponseMessage as
423
+ JsonRecord | undefined;
424
+ if (!user || typeof user.content !== "string" || user.userInputMessageContext) return null;
425
+ if (!answer || answer.content !== "(empty)" || answer.toolUses) return null;
426
+ return user.content;
427
+ }
428
+
429
+ export function kiroHelperPromptKey(body: Record<string, unknown> | undefined): string {
430
+ const state = body?.conversationState as JsonRecord | undefined;
431
+ const history = state?.history;
432
+ // A helper's system prompt is its own first turn ("(empty)" answer after it, see
433
+ // splitSystemTurn in openai-to-kiro.ts); any other history means a real conversation.
434
+ const systemTurn = kiroSplitSystemTurnText(history);
435
+ if (Array.isArray(history) && history.length > 0 && systemTurn === null) return "";
436
+ const user = kiroCurrentUserMessage(body);
437
+ const context = user.userInputMessageContext as JsonRecord | undefined;
438
+ if (Array.isArray(context?.tools) && context.tools.length > 0) return "";
439
+ if (Array.isArray(context?.toolResults) && context.toolResults.length > 0) return "";
440
+ // The request builder puts per-request lines first (the current time, a thinking directive).
441
+ const content =
442
+ systemTurn ??
443
+ (typeof user.content === "string" ? user.content : "")
444
+ .replace(/^(?:\[Context: Current time is [^\]\n]*\]|<thinking_mode>[^\n]*)\n\n/, "")
445
+ .replace(/^(?:\[Context: Current time is [^\]\n]*\]|<thinking_mode>[^\n]*)\n\n/, "");
446
+ const modelId = typeof user.modelId === "string" ? user.modelId : "";
447
+ if (content.length < 4096 || !modelId) return "";
448
+ return createHash("sha256")
449
+ .update(modelId)
450
+ .update("\n")
451
+ .update(content.slice(0, 4096))
452
+ .digest("hex");
453
+ }
454
+
455
+ function kiroHelperRefusalRemembered(key: string): boolean {
456
+ const until = kiroHelperRefusals.get(key);
457
+ if (!until) return false;
458
+ if (until > Date.now()) return true;
459
+ kiroHelperRefusals.delete(key);
460
+ return false;
461
+ }
462
+
463
+ function rememberKiroHelperRefusal(key: string): void {
464
+ if (kiroHelperRefusals.size >= KIRO_HELPER_REFUSAL_MAX) {
465
+ const oldest = kiroHelperRefusals.keys().next().value;
466
+ if (oldest !== undefined) kiroHelperRefusals.delete(oldest);
467
+ }
468
+ kiroHelperRefusals.set(key, Date.now() + KIRO_HELPER_REFUSAL_TTL_MS);
469
+ }
470
+
471
+ function forgetKiroHelperRefusal(key: string): void {
472
+ kiroHelperRefusals.delete(key);
473
+ }
474
+
475
+ const KIRO_CONTENT_EVENTS = new Set([
476
+ "assistantResponseEvent",
477
+ "reasoningContentEvent",
478
+ "toolUseEvent",
479
+ "codeEvent",
480
+ ]);
481
+ const KIRO_PEEK_LIMIT_BYTES = 256 * 1024;
482
+
483
+ /**
484
+ * Read the start of a Kiro answer until it is clear whether the model refused before writing
485
+ * anything. Returns the verdict and a Response that replays the bytes already read, so nothing
486
+ * is lost and nothing is delayed (the first frame Kiro sends is content or the stop metadata).
487
+ */
488
+ export async function peekKiroRefusal(response: Response): Promise<{
489
+ refused: boolean;
490
+ category: string;
491
+ explanation: string;
492
+ // An EventStream exception before any content, or a stream that ended with no answer at all:
493
+ // the request failed before the client saw anything, so it can go to another account.
494
+ exception: KiroStreamError | null;
495
+ empty: boolean;
496
+ response: Response;
497
+ }> {
498
+ if (!response.body) {
499
+ return {
500
+ refused: false,
501
+ category: "",
502
+ explanation: "",
503
+ exception: null,
504
+ empty: false,
505
+ response,
506
+ };
507
+ }
508
+ const reader = response.body.getReader();
509
+ const chunks: Uint8Array[] = [];
510
+ const queue = new ByteQueue();
511
+ let total = 0;
512
+ let refused = false;
513
+ let category = "";
514
+ let explanation = "";
515
+ let exception: KiroStreamError | null = null;
516
+ let decided = false;
517
+ let ended = false;
518
+ try {
519
+ while (!decided && total < KIRO_PEEK_LIMIT_BYTES) {
520
+ const { done, value } = await reader.read();
521
+ if (done) {
522
+ ended = true;
523
+ break;
524
+ }
525
+ if (!value) continue;
526
+ chunks.push(value);
527
+ total += value.length;
528
+ queue.push(value);
529
+ while (queue.length >= 16) {
530
+ const len = queue.peekUint32BE(0);
531
+ if (!len || len < 16 || len > queue.length) break;
532
+ const frame = queue.read(len);
533
+ if (!frame) break;
534
+ const event = parseEventFrame(frame);
535
+ if (!event) continue;
536
+ const type = event.headers[":event-type"] || "";
537
+ const messageType = event.headers[":message-type"] || "";
538
+ if (messageType === "exception" || messageType === "error") {
539
+ const p = event.payload as JsonRecord | undefined;
540
+ const text =
541
+ typeof p?.message === "string" ? p.message : event.headers[":error-message"] || "";
542
+ exception = kiroStreamErrorOf(
543
+ event.headers[":exception-type"] || event.headers[":error-code"] || "",
544
+ text
545
+ );
546
+ decided = true;
547
+ break;
548
+ }
549
+ if (KIRO_CONTENT_EVENTS.has(type)) {
550
+ decided = true;
551
+ break;
552
+ }
553
+ if (type === "metadataEvent") {
554
+ const meta = readKiroStopMetadata(event.payload);
555
+ if (meta) {
556
+ decided = true;
557
+ refused = meta.refused;
558
+ category = meta.category;
559
+ explanation = meta.explanation;
560
+ break;
561
+ }
562
+ }
563
+ }
564
+ }
565
+ } catch (error) {
566
+ await reader.cancel().catch(() => {});
567
+ throw error;
568
+ }
569
+ const empty = ended && !decided;
570
+
571
+ // The caller cancels this replay when it asks another model or reports the failure.
572
+ let index = 0;
573
+ const replay = new ReadableStream<Uint8Array>({
574
+ async pull(controller) {
575
+ if (index < chunks.length) {
576
+ controller.enqueue(chunks[index++]);
577
+ return;
578
+ }
579
+ if (ended) {
580
+ controller.close();
581
+ return;
582
+ }
583
+ try {
584
+ const { done, value } = await reader.read();
585
+ if (done) controller.close();
586
+ else if (value) controller.enqueue(value);
587
+ } catch (error) {
588
+ controller.error(error);
589
+ }
590
+ },
591
+ cancel(reason) {
592
+ return reader.cancel(reason).catch(() => {});
593
+ },
594
+ });
595
+ return {
596
+ refused,
597
+ category,
598
+ explanation,
599
+ exception,
600
+ empty,
601
+ response: new Response(replay, {
602
+ status: response.status,
603
+ statusText: response.statusText,
604
+ headers: response.headers,
605
+ }),
606
+ };
607
+ }
608
+
609
+ function ensureKiroUsage(state: KiroStreamState, model = "") {
610
+ // Output estimate covers text, reasoning, code and tool calls (names + final args). Claude's
611
+ // tokenizer makes about 2.5 characters a token (5.x), not 3.5 (config/claudeTokens.ts).
612
+ const charsPerToken = claudeCharsPerToken(model);
613
+ const contentLength = state.totalContentLength || 0;
614
+ const estimatedOutputTokens =
615
+ charsPerToken && contentLength > 0
616
+ ? Math.max(1, Math.ceil(contentLength / charsPerToken))
617
+ : estimateOutputTokens(contentLength);
153
618
 
154
619
  if (state.usage) {
155
620
  // Keep real metricsEvent counts; only backfill a missing output count.
@@ -162,19 +627,23 @@ function ensureKiroUsage(state: KiroStreamState) {
162
627
 
163
628
  // Kiro reports how full the model's window is, not a token count. Use the model's own
164
629
  // window (1M for Claude Opus/Sonnet 5.x): a fixed 200k reported a fifth of the real input,
165
- // so agents such as Claude Code never compacted in time.
630
+ // so agents such as Claude Code never compacted in time. The share already includes this
631
+ // answer, hidden thinking too (measured 2026-11-10: +1500 for a 3,460-character answer; a
632
+ // 4000-token thinking budget filled exactly), so the input is that total minus the output.
166
633
  const windowTokens = state.contextWindowTokens || KIRO_DEFAULT_CONTEXT_WINDOW;
167
- const estimatedInputTokens =
634
+ const contextTokens =
168
635
  state.contextUsagePercentage && state.contextUsagePercentage > 0
169
636
  ? Math.floor((state.contextUsagePercentage * windowTokens) / 100)
170
637
  : 0;
638
+ const estimatedInputTokens =
639
+ contextTokens > 0 ? Math.max(0, contextTokens - estimatedOutputTokens) : 0;
171
640
 
172
641
  if (estimatedInputTokens <= 0 && estimatedOutputTokens <= 0) return;
173
642
 
174
643
  state.usage = {
175
644
  prompt_tokens: estimatedInputTokens,
176
645
  completion_tokens: estimatedOutputTokens,
177
- total_tokens: estimatedInputTokens + estimatedOutputTokens,
646
+ total_tokens: contextTokens > 0 ? contextTokens : estimatedOutputTokens,
178
647
  };
179
648
  }
180
649
 
@@ -338,17 +807,129 @@ export class KiroExecutor extends BaseExecutor {
338
807
  Record<string, unknown> | undefined;
339
808
  if (profileArn && transformedBody?.conversationState) transformedBody.profileArn = profileArn;
340
809
 
341
- const response = await fetch(url, {
810
+ // A helper prompt (no tools, no history) that this model refused a moment ago for asking
811
+ // it to write out its reasoning will be refused again: go to the fallback model directly
812
+ // and save the refused round trip (about 5 s and a full prompt of credits each time).
813
+ const helperKey = kiroHelperPromptKey(transformedBody);
814
+ const knownRefusalFallback =
815
+ helperKey && kiroHelperRefusalRemembered(helperKey)
816
+ ? kiroRefusalFallbackModel(kiroCurrentModelId(transformedBody))
817
+ : "";
818
+ if (knownRefusalFallback) {
819
+ const direct = await fetch(url, {
820
+ method: "POST",
821
+ headers,
822
+ body: kiroBodyWithModel(
823
+ transformedBody,
824
+ kiroCurrentModelId(transformedBody),
825
+ knownRefusalFallback
826
+ ),
827
+ signal,
828
+ });
829
+ if (direct.ok) {
830
+ const tbDirect = transformedBody as Record<string, unknown>;
831
+ const peekedDirect = await peekKiroRefusal(direct);
832
+ const failedDirect = kiroFailureBeforeContent(peekedDirect, knownRefusalFallback, log);
833
+ if (failedDirect) {
834
+ await peekedDirect.response.body?.cancel().catch(() => {});
835
+ return { response: failedDirect, url, headers, transformedBody };
836
+ }
837
+ // The answer comes from the fallback model, and says so (as the real API's `model`).
838
+ const directResponse = this.transformEventStreamToSSE(
839
+ peekedDirect.response,
840
+ knownRefusalFallback,
841
+ {
842
+ thinkingExpected: kiroThinkingDirectiveSent(tbDirect),
843
+ limits: readKiroClientLimits(body),
844
+ }
845
+ );
846
+ directResponse.headers.set("x-trouteai-answering-model", knownRefusalFallback);
847
+ return { response: directResponse, url, headers, transformedBody };
848
+ }
849
+ await direct.body?.cancel().catch(() => {});
850
+ forgetKiroHelperRefusal(helperKey);
851
+ }
852
+
853
+ let response = await fetch(url, {
342
854
  method: "POST",
343
855
  headers,
344
856
  body: JSON.stringify(transformedBody),
345
857
  signal,
346
858
  });
347
859
 
860
+ // Earlier thinking whose signature Kiro did not issue (for example one written by another
861
+ // provider of a combo) gets 400 THINKING_SIGNATURE_INVALID. Send once more without it.
862
+ if (response.status === 400 && kiroHistoryHasReasoning(transformedBody)) {
863
+ const errorText = await response
864
+ .clone()
865
+ .text()
866
+ .catch(() => "");
867
+ if (errorText.includes("THINKING_SIGNATURE_INVALID")) {
868
+ await response.body?.cancel().catch(() => {});
869
+ stripKiroHistoryReasoning(transformedBody);
870
+ log?.warn?.(
871
+ "KIRO",
872
+ "Kiro did not accept the signature of earlier thinking; sending the request without it"
873
+ );
874
+ response = await fetch(url, {
875
+ method: "POST",
876
+ headers,
877
+ body: JSON.stringify(transformedBody),
878
+ signal,
879
+ });
880
+ }
881
+ }
882
+
348
883
  if (!response.ok) {
349
884
  return { response, url, headers, transformedBody };
350
885
  }
351
886
 
887
+ // A refusal before any output ("The selected model cannot continue this conversation.
888
+ // Please select a different model"): ask the fallback model once, as Kiro suggests. Without
889
+ // a fallback (or when it cannot be asked) the refusal goes to the client as a refusal stop.
890
+ const sentModelId = kiroCurrentModelId(transformedBody);
891
+ const fallbackModelId = kiroRefusalFallbackModel(sentModelId);
892
+ // The model named in the answer: the fallback model when it answered (as the Messages API
893
+ // reports the model that produced the message), else the requested one.
894
+ let answeringModel = model;
895
+ const peeked = await peekKiroRefusal(response);
896
+ response = peeked.response;
897
+ const failedBeforeContent = kiroFailureBeforeContent(peeked, sentModelId, log);
898
+ if (failedBeforeContent) {
899
+ await response.body?.cancel().catch(() => {});
900
+ return { response: failedBeforeContent, url, headers, transformedBody };
901
+ }
902
+ if (fallbackModelId && peeked.refused) {
903
+ await response.body?.cancel().catch(() => {});
904
+ log?.warn?.(
905
+ "KIRO",
906
+ `${sentModelId} refused this request (${peeked.category || "content filtered"}); asking ${fallbackModelId} instead`
907
+ );
908
+ if (helperKey && peeked.category === "REASONING_EXTRACTION") {
909
+ rememberKiroHelperRefusal(helperKey);
910
+ }
911
+ const retry = await fetch(url, {
912
+ method: "POST",
913
+ headers,
914
+ body: kiroBodyWithModel(transformedBody, sentModelId, fallbackModelId),
915
+ signal,
916
+ });
917
+ if (retry.ok) {
918
+ response = retry;
919
+ answeringModel = fallbackModelId;
920
+ } else {
921
+ // The fallback could not be asked (limit, model not on this plan, ...): the answer
922
+ // stays what Kiro gave, a refusal. It must not become an error or a second charge.
923
+ await retry.body?.cancel().catch(() => {});
924
+ return {
925
+ response: kiroRefusalSseResponse(model, peeked.category, peeked.explanation),
926
+ url,
927
+ headers,
928
+ transformedBody,
929
+ };
930
+ }
931
+ }
932
+
352
933
  // For Kiro, we need to transform the binary EventStream to SSE.
353
934
  // Create a TransformStream to convert binary to SSE text.
354
935
  //
@@ -358,20 +939,14 @@ export class KiroExecutor extends BaseExecutor {
358
939
  // `reasoningContentEvent` frames. We pass a hint so the transform stream
359
940
  // can split that inline reasoning into the OpenAI `delta.reasoning_content`
360
941
  // channel.
361
- const tb = transformedBody as Record<string, unknown>;
362
- const userContent =
363
- ((
364
- (
365
- (tb?.conversationState as Record<string, unknown>)?.currentMessage as Record<
366
- string,
367
- unknown
368
- >
369
- )?.userInputMessage as Record<string, unknown>
370
- )?.content as string) || "";
371
- const thinkingExpected = userContent.includes("<thinking_mode>enabled</thinking_mode>");
372
- const transformedResponse = this.transformEventStreamToSSE(response, model, {
942
+ const thinkingExpected = kiroThinkingDirectiveSent(transformedBody as Record<string, unknown>);
943
+ const transformedResponse = this.transformEventStreamToSSE(response, answeringModel, {
373
944
  thinkingExpected,
945
+ limits: readKiroClientLimits(body),
374
946
  });
947
+ if (answeringModel !== model) {
948
+ transformedResponse.headers.set("x-trouteai-answering-model", answeringModel);
949
+ }
375
950
 
376
951
  return { response: transformedResponse, url, headers, transformedBody };
377
952
  }
@@ -393,9 +968,22 @@ export class KiroExecutor extends BaseExecutor {
393
968
  transformEventStreamToSSE(
394
969
  response: Response,
395
970
  model: string,
396
- opts: { thinkingExpected?: boolean } = {}
971
+ opts: { thinkingExpected?: boolean; limits?: KiroClientLimits | null } = {}
397
972
  ) {
398
973
  const thinkingExpected = !!opts.thinkingExpected;
974
+ // The client's stop sequences and max_tokens, applied to the visible text (Kiro applies
975
+ // neither).
976
+ const stopList = (opts.limits?.stop || []).filter((x) => typeof x === "string" && x.length > 0);
977
+ // Characters per token: about 2.5 on Claude 5.x (config/claudeTokens.ts), 4 otherwise.
978
+ const maxChars =
979
+ opts.limits?.maxTokens && opts.limits.maxTokens > 0
980
+ ? Math.ceil(opts.limits.maxTokens * (claudeCharsPerToken(model) || 4))
981
+ : 0;
982
+ const gated = stopList.length > 0 || maxChars > 0;
983
+ let heldText = "";
984
+ let emittedChars = 0;
985
+ let cut = false;
986
+ let cutAt = 0;
399
987
  const buffer = new ByteQueue();
400
988
  let chunkIndex = 0;
401
989
  const responseId = `chatcmpl-${Date.now()}`;
@@ -416,9 +1004,94 @@ export class KiroExecutor extends BaseExecutor {
416
1004
  contextWindowTokens: getModelContextLimit("kiro", model) || KIRO_DEFAULT_CONTEXT_WINDOW,
417
1005
  };
418
1006
 
1007
+ type Sink = { enqueue: (chunk: Uint8Array) => void };
1008
+ const emitText = (controller: Sink, text: string) => {
1009
+ if (!text) return;
1010
+ const out: JsonRecord = {
1011
+ id: responseId,
1012
+ object: "chat.completion.chunk",
1013
+ created,
1014
+ model,
1015
+ choices: [
1016
+ {
1017
+ index: 0,
1018
+ delta: chunkIndex === 0 ? { role: "assistant", content: text } : { content: text },
1019
+ finish_reason: null,
1020
+ },
1021
+ ],
1022
+ };
1023
+ chunkIndex++;
1024
+ controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(out)}\n\n`));
1025
+ };
1026
+ // Visible text goes through here. With limits it stops at the first stop sequence (holding
1027
+ // back a tail that may be the start of one) or at the max_tokens estimate.
1028
+ const writeText = (controller: Sink, text: string, final = false) => {
1029
+ if (!gated) {
1030
+ emitText(controller, text);
1031
+ return;
1032
+ }
1033
+ if (cut) return;
1034
+ const buf = heldText + text;
1035
+ heldText = "";
1036
+ let stopIdx = -1;
1037
+ let stopSeq = "";
1038
+ for (const seq of stopList) {
1039
+ const i = buf.indexOf(seq);
1040
+ if (i !== -1 && (stopIdx === -1 || i < stopIdx)) {
1041
+ stopIdx = i;
1042
+ stopSeq = seq;
1043
+ }
1044
+ }
1045
+ let out = stopIdx !== -1 ? buf.slice(0, stopIdx) : buf;
1046
+ if (stopIdx === -1 && !final) {
1047
+ let hold = 0;
1048
+ for (const seq of stopList) {
1049
+ for (let k = Math.min(seq.length - 1, buf.length); k > hold; k--) {
1050
+ if (buf.endsWith(seq.slice(0, k))) {
1051
+ hold = k;
1052
+ break;
1053
+ }
1054
+ }
1055
+ }
1056
+ if (hold > 0) {
1057
+ heldText = buf.slice(buf.length - hold);
1058
+ out = buf.slice(0, buf.length - hold);
1059
+ }
1060
+ }
1061
+ let hitMax = false;
1062
+ if (maxChars > 0 && emittedChars + out.length > maxChars) {
1063
+ out = out.slice(0, Math.max(0, maxChars - emittedChars));
1064
+ hitMax = true;
1065
+ }
1066
+ if (out) {
1067
+ emittedChars += out.length;
1068
+ state.totalContentLength = (state.totalContentLength || 0) + out.length;
1069
+ emitText(controller, out);
1070
+ }
1071
+ if (hitMax) state.stopReason = "MAX_TOKENS";
1072
+ else if (stopIdx !== -1) state.stopSequence = stopSeq;
1073
+ if (hitMax || stopIdx !== -1) {
1074
+ cut = true;
1075
+ cutAt = Date.now();
1076
+ heldText = "";
1077
+ }
1078
+ };
1079
+ // After a cut the rest of Kiro's answer is not needed: finish now and stop reading it.
1080
+ const finishEarly = (controller: TransformStreamDefaultController<Uint8Array>) => {
1081
+ if (!state.finishEmitted) {
1082
+ state.finishEmitted = true;
1083
+ ensureKiroUsage(state, model);
1084
+ const finishChunk = buildKiroFinishChunk(state, responseId, created, model, true);
1085
+ controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(finishChunk)}\n\n`));
1086
+ controller.enqueue(TEXT_ENCODER.encode("data: [DONE]\n\n"));
1087
+ }
1088
+ controller.terminate();
1089
+ };
1090
+
419
1091
  const transformStream = new TransformStream(
420
1092
  {
421
1093
  async transform(chunk, controller) {
1094
+ if (state.finishEmitted) return;
422
1095
  buffer.push(chunk);
423
1096
 
424
1097
  // Parse events from buffer
@@ -471,10 +1144,56 @@ export class KiroExecutor extends BaseExecutor {
471
1144
 
472
1145
  const eventType = event.headers[":event-type"] || "";
473
1146
 
1147
+ // Every normal Kiro answer ends with metadataEvent + contextUsageEvent +
1148
+ // meteringEvent (40+ real answers, 2026-11-10). Count what arrives, and keep an
1149
+ // EventStream exception (`:message-type` exception/error), so an answer that ends
1150
+ // without a stop reason can be explained in the log.
1151
+ {
1152
+ const messageType = event.headers[":message-type"] || "";
1153
+ const key =
1154
+ messageType === "exception" || messageType === "error"
1155
+ ? `${messageType}:${event.headers[":exception-type"] || event.headers[":error-code"] || "-"}`
1156
+ : eventType || "-";
1157
+ state.frameCounts = state.frameCounts || {};
1158
+ state.frameCounts[key] = (state.frameCounts[key] || 0) + 1;
1159
+ if (messageType === "exception" || messageType === "error") {
1160
+ const p = event.payload as JsonRecord | undefined;
1161
+ const text =
1162
+ typeof p?.message === "string"
1163
+ ? p.message
1164
+ : event.headers[":error-message"] || "";
1165
+ state.exception = `${key} ${String(text).slice(0, 200)}`.trim();
1166
+ // An exception before Kiro's stop reason ends an unfinished answer: send it to
1167
+ // the client as an error (Claude Code retries one) instead of a normal finish
1168
+ // with a cut-off answer, and stop reading.
1169
+ if (!state.stopReason && !cut && !state.finishEmitted) {
1170
+ const exceptionType =
1171
+ event.headers[":exception-type"] || event.headers[":error-code"] || "";
1172
+ console.warn(
1173
+ `[Kiro] ${model} answer stopped by ${state.exception}: frames ${JSON.stringify(state.frameCounts)}; sent to the client as an error`
1174
+ );
1175
+ state.finishEmitted = true;
1176
+ controller.enqueue(kiroErrorChunk(kiroStreamErrorOf(exceptionType, text)));
1177
+ controller.terminate();
1178
+ return;
1179
+ }
1180
+ }
1181
+ }
1182
+
474
1183
  // Track total content length for token estimation
475
1184
  if (!state.totalContentLength) state.totalContentLength = 0;
476
1185
  if (!state.contextUsagePercentage) state.contextUsagePercentage = 0;
477
1186
 
1187
+ // After a stop sequence / max_tokens cut only the closing usage frames matter;
1188
+ // they normally follow at once. Do not wait long for a model that keeps writing.
1189
+ if (cut && KIRO_CONTENT_EVENTS.has(eventType)) {
1190
+ if (Date.now() - cutAt > 2500) {
1191
+ finishEarly(controller);
1192
+ return;
1193
+ }
1194
+ continue;
1195
+ }
1196
+
478
1197
  // Native reasoning frames. Verified against the live CodeWhisperer
479
1198
  // stream (2026-07): with adaptive thinking enabled (via
480
1199
  // additionalModelRequestFields), Kiro streams reasoning as a dedicated
@@ -520,6 +1239,53 @@ export class KiroExecutor extends BaseExecutor {
520
1239
  state.reasoningChunkCount = (state.reasoningChunkCount ?? 0) + 1;
521
1240
  controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
522
1241
  }
1242
+ // The reasoning block ends with one `{signature}` frame (measured 2026-11-10:
1243
+ // 740-1408 characters). It is passed on as `reasoning_signature` so a Claude
1244
+ // client gets `signature_delta` and can send the block back; Kiro checks it then
1245
+ // (a changed one gets 400 THINKING_SIGNATURE_INVALID). Only after reasoning text:
1246
+ // with thinking switched off (display "omitted") the client gets no thinking block.
1247
+ const signature =
1248
+ typeof rp?.signature === "string"
1249
+ ? rp.signature
1250
+ : rt &&
1251
+ typeof rt === "object" &&
1252
+ typeof (rt as JsonRecord).signature === "string"
1253
+ ? ((rt as JsonRecord).signature as string)
1254
+ : "";
1255
+ if (signature && (state.reasoningChunkCount ?? 0) > 0) {
1256
+ state.hasReasoningContent = true;
1257
+ const chunk: JsonRecord = {
1258
+ id: responseId,
1259
+ object: "chat.completion.chunk",
1260
+ created,
1261
+ model,
1262
+ choices: [
1263
+ { index: 0, delta: { reasoning_signature: signature }, finish_reason: null },
1264
+ ],
1265
+ };
1266
+ chunkIndex++;
1267
+ controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
1268
+ }
1269
+ // Encrypted reasoning (`{redactedContent}`, the SDK's ReasoningContentEvent
1270
+ // shape): passed on as `reasoning_redacted` so a Claude client gets a
1271
+ // `redacted_thinking` block and sends it back; Kiro reads it from
1272
+ // `reasoningContent.redactedContent` in the history.
1273
+ const redacted =
1274
+ typeof rp?.redactedContent === "string" ? (rp.redactedContent as string) : "";
1275
+ if (redacted) {
1276
+ state.hasReasoningContent = true;
1277
+ const chunk: JsonRecord = {
1278
+ id: responseId,
1279
+ object: "chat.completion.chunk",
1280
+ created,
1281
+ model,
1282
+ choices: [
1283
+ { index: 0, delta: { reasoning_redacted: redacted }, finish_reason: null },
1284
+ ],
1285
+ };
1286
+ chunkIndex++;
1287
+ controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
1288
+ }
523
1289
  // Consume the reasoning frame (incl. signature-only) so it never
524
1290
  // falls through to the content handlers below.
525
1291
  continue;
@@ -534,7 +1300,8 @@ export class KiroExecutor extends BaseExecutor {
534
1300
  continue;
535
1301
  }
536
1302
  // Raw length before the inline <thinking> split, so text and reasoning count once.
537
- state.totalContentLength += content.length;
1303
+ // With client limits the text is counted as it is written (writeText).
1304
+ if (!gated) state.totalContentLength += content.length;
538
1305
 
539
1306
  if (thinkingExpected && state.thinking) {
540
1307
  // Claude on Kiro emits reasoning inline as `<thinking>…</thinking>`
@@ -545,29 +1312,11 @@ export class KiroExecutor extends BaseExecutor {
545
1312
  splitInlineThinking(
546
1313
  thinkingState,
547
1314
  content,
548
- (text) => {
549
- if (!text) return;
550
- const chunk: JsonRecord = {
551
- id: responseId,
552
- object: "chat.completion.chunk",
553
- created,
554
- model,
555
- choices: [
556
- {
557
- index: 0,
558
- delta:
559
- chunkIndex === 0
560
- ? { role: "assistant", content: text }
561
- : { content: text },
562
- finish_reason: null,
563
- },
564
- ],
565
- };
566
- chunkIndex++;
567
- controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
568
- },
1315
+ (text) => writeText(controller, text),
569
1316
  (reasoning) => {
570
1317
  if (!reasoning) return;
1318
+ if (gated)
1319
+ state.totalContentLength = (state.totalContentLength || 0) + reasoning.length;
571
1320
  state.hasReasoningContent = true;
572
1321
  const reasoningDelta: JsonRecord =
573
1322
  (state.reasoningChunkCount ?? 0) === 0 && chunkIndex === 0
@@ -592,42 +1341,14 @@ export class KiroExecutor extends BaseExecutor {
592
1341
  }
593
1342
  );
594
1343
  } else {
595
- const chunk: JsonRecord = {
596
- id: responseId,
597
- object: "chat.completion.chunk",
598
- created,
599
- model,
600
- choices: [
601
- {
602
- index: 0,
603
- delta: chunkIndex === 0 ? { role: "assistant", content } : { content },
604
- finish_reason: null,
605
- },
606
- ],
607
- };
608
- chunkIndex++;
609
- controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
1344
+ writeText(controller, content);
610
1345
  }
611
1346
  }
612
1347
 
613
1348
  // Handle codeEvent
614
1349
  if (eventType === "codeEvent" && event.payload?.content) {
615
- state.totalContentLength += String(event.payload.content).length;
616
- const chunk: JsonRecord = {
617
- id: responseId,
618
- object: "chat.completion.chunk",
619
- created,
620
- model,
621
- choices: [
622
- {
623
- index: 0,
624
- delta: { content: event.payload.content },
625
- finish_reason: null,
626
- },
627
- ],
628
- };
629
- chunkIndex++;
630
- controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
1350
+ if (!gated) state.totalContentLength += String(event.payload.content).length;
1351
+ writeText(controller, String(event.payload.content));
631
1352
  }
632
1353
 
633
1354
  // Handle toolUseEvent
@@ -732,6 +1453,18 @@ export class KiroExecutor extends BaseExecutor {
732
1453
  }
733
1454
  }
734
1455
 
1456
+ // Kiro's stop reason (END_TURN, MAX_TOKENS, CONTENT_FILTERED + refusal details).
1457
+ if (eventType === "metadataEvent") {
1458
+ const meta = readKiroStopMetadata(event.payload);
1459
+ // After our own cut (stop sequence / max_tokens) that cut is the stop reason.
1460
+ if (meta && !cut) {
1461
+ state.stopReason = meta.stopReason;
1462
+ if (meta.refused) {
1463
+ state.refusalDetails = kiroRefusalStopDetails(meta.category, meta.explanation);
1464
+ }
1465
+ }
1466
+ }
1467
+
735
1468
  // Handle messageStopEvent
736
1469
  if (eventType === "messageStopEvent") {
737
1470
  flushBufferedToolArgs(state, controller, { responseId, created, model });
@@ -750,6 +1483,10 @@ export class KiroExecutor extends BaseExecutor {
750
1483
  state.contextUsagePercentage = contextUsage;
751
1484
  // Mark that we received context usage event
752
1485
  state.hasContextUsage = true;
1486
+ if (cut) {
1487
+ finishEarly(controller);
1488
+ return;
1489
+ }
753
1490
  }
754
1491
 
755
1492
  // Handle meteringEvent - mark that we received it
@@ -812,18 +1549,7 @@ export class KiroExecutor extends BaseExecutor {
812
1549
  const thinkingState = state.thinking;
813
1550
  flushPendingThinking(
814
1551
  thinkingState,
815
- (text) => {
816
- if (!text) return;
817
- const chunk: JsonRecord = {
818
- id: responseId,
819
- object: "chat.completion.chunk",
820
- created,
821
- model,
822
- choices: [{ index: 0, delta: { content: text }, finish_reason: null }],
823
- };
824
- chunkIndex++;
825
- controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(chunk)}\n\n`));
826
- },
1552
+ (text) => writeText(controller, text),
827
1553
  (reasoning) => {
828
1554
  if (!reasoning) return;
829
1555
  const chunk: JsonRecord = {
@@ -841,14 +1567,42 @@ export class KiroExecutor extends BaseExecutor {
841
1567
  );
842
1568
  }
843
1569
 
844
- // Emit finish chunk if not already sent
845
- if (!state.finishEmitted) {
1570
+ // Text held back as a possible start of a stop sequence that never completed.
1571
+ if (gated && !cut) writeText(controller, "", true);
1572
+
1573
+ // Already finished early (stop sequence / max_tokens): nothing more to send.
1574
+ if (state.finishEmitted) return;
1575
+
1576
+ // No stop reason and none of Kiro's closing frames: the answer was cut off (seen on
1577
+ // long Opus 5.5 answers, 6 in 7,800 on 2026-11-10). A normal finish would hand the
1578
+ // client half an answer as complete (Claude Code then ends its turn); an error makes
1579
+ // it retry.
1580
+ if (!cut && !kiroAnswerClosed(state)) {
1581
+ console.warn(
1582
+ `[Kiro] ${model} answer ended without a stop reason: frames ${JSON.stringify(state.frameCounts || {})}` +
1583
+ `, reasoning ${state.reasoningChunkCount || 0} chunks, tool calls ${state.hasToolCalls ? "yes" : "no"}` +
1584
+ (state.exception ? `, exception ${state.exception}` : "") +
1585
+ "; sent to the client as an error"
1586
+ );
846
1587
  state.finishEmitted = true;
847
- ensureKiroUsage(state);
848
- const finishChunk = buildKiroFinishChunk(state, responseId, created, model, true);
849
- controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(finishChunk)}\n\n`));
1588
+ controller.enqueue(kiroErrorChunk(KIRO_INCOMPLETE_ANSWER));
1589
+ return;
1590
+ }
1591
+
1592
+ if (!state.stopReason) {
1593
+ console.warn(
1594
+ `[Kiro] ${model} answer ended without a stop reason: frames ${JSON.stringify(state.frameCounts || {})}` +
1595
+ `, reasoning ${state.reasoningChunkCount || 0} chunks, tool calls ${state.hasToolCalls ? "yes" : "no"}` +
1596
+ (state.exception ? `, exception ${state.exception}` : "")
1597
+ );
850
1598
  }
851
1599
 
1600
+ // Emit the finish chunk
1601
+ state.finishEmitted = true;
1602
+ ensureKiroUsage(state, model);
1603
+ const finishChunk = buildKiroFinishChunk(state, responseId, created, model, true);
1604
+ controller.enqueue(TEXT_ENCODER.encode(`data: ${JSON.stringify(finishChunk)}\n\n`));
1605
+
852
1606
  // Send final done message
853
1607
  controller.enqueue(TEXT_ENCODER.encode("data: [DONE]\n\n"));
854
1608
  },