omniroute 3.4.5 → 3.4.6

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 (249) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/build-manifest.json +3 -3
  3. package/app/.next/prerender-manifest.json +3 -3
  4. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  5. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/audit/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/cache/page.js.nft.json +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/cache/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/costs/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/health/page_client-reference-manifest.js +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/limits/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/media/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/memory/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/onboarding/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/search-tools/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/settings/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/_global-error.html +1 -1
  41. package/app/.next/server/app/_global-error.rsc +1 -1
  42. package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  43. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  44. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  45. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  46. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  47. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/api/monitoring/health/route.js +3 -3
  49. package/app/.next/server/app/api/provider-models/route.js +2 -2
  50. package/app/.next/server/app/api/provider-nodes/[id]/route.js +2 -2
  51. package/app/.next/server/app/api/provider-nodes/route.js +3 -3
  52. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  53. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  54. package/app/.next/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  55. package/app/.next/server/app/api/providers/[id]/sync-models/route.js +3 -3
  56. package/app/.next/server/app/api/providers/[id]/sync-models/route.js.nft.json +1 -1
  57. package/app/.next/server/app/api/providers/[id]/test/route.js +6 -6
  58. package/app/.next/server/app/api/providers/route.js +4 -4
  59. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  60. package/app/.next/server/app/api/providers/test-batch/route.js +5 -5
  61. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  62. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  63. package/app/.next/server/app/api/system/version/route.js.nft.json +1 -1
  64. package/app/.next/server/app/api/usage/[connectionId]/route.js +2 -2
  65. package/app/.next/server/app/api/usage/provider-limits/route.js +5 -5
  66. package/app/.next/server/app/api/usage/provider-limits/route.js.nft.json +1 -1
  67. package/app/.next/server/app/api/v1/models/route.js +4 -4
  68. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  69. package/app/.next/server/app/api/v1/route.js +4 -4
  70. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  71. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  82. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  83. package/app/.next/server/chunks/[root-of-the-server]__0.7zz6j._.js +1 -1
  84. package/app/.next/server/chunks/[root-of-the-server]__0.lz97q._.js +1 -1
  85. package/app/.next/server/chunks/[root-of-the-server]__0.m9_5-._.js +1 -1
  86. package/app/.next/server/chunks/[root-of-the-server]__00-bzx_._.js +1 -1
  87. package/app/.next/server/chunks/[root-of-the-server]__00hsd7k._.js +1 -1
  88. package/app/.next/server/chunks/[root-of-the-server]__00i_ryi._.js +1 -1
  89. package/app/.next/server/chunks/[root-of-the-server]__01fudn9._.js +1 -1
  90. package/app/.next/server/chunks/[root-of-the-server]__024slax._.js +1 -1
  91. package/app/.next/server/chunks/[root-of-the-server]__030_-af._.js +2 -2
  92. package/app/.next/server/chunks/[root-of-the-server]__03gl9dh._.js +2 -2
  93. package/app/.next/server/chunks/[root-of-the-server]__03x69ll._.js +1 -1
  94. package/app/.next/server/chunks/[root-of-the-server]__047np0t._.js +2 -2
  95. package/app/.next/server/chunks/[root-of-the-server]__04lc9.m._.js +2 -2
  96. package/app/.next/server/chunks/[root-of-the-server]__05u48b-._.js +1 -1
  97. package/app/.next/server/chunks/[root-of-the-server]__06dr~pl._.js +1 -1
  98. package/app/.next/server/chunks/[root-of-the-server]__06hr_sx._.js +1 -1
  99. package/app/.next/server/chunks/[root-of-the-server]__06r5eje._.js +2 -2
  100. package/app/.next/server/chunks/[root-of-the-server]__07.ui7z._.js +1 -1
  101. package/app/.next/server/chunks/[root-of-the-server]__075j.5s._.js +1 -1
  102. package/app/.next/server/chunks/[root-of-the-server]__07ju0wx._.js +1 -1
  103. package/app/.next/server/chunks/[root-of-the-server]__07wj.c4._.js +1 -1
  104. package/app/.next/server/chunks/[root-of-the-server]__08-9vz.._.js +1 -1
  105. package/app/.next/server/chunks/[root-of-the-server]__0908q-_._.js +1 -1
  106. package/app/.next/server/chunks/[root-of-the-server]__09blmoy._.js +1 -1
  107. package/app/.next/server/chunks/[root-of-the-server]__09c50mp._.js +1 -1
  108. package/app/.next/server/chunks/[root-of-the-server]__0a.3c_r._.js +1 -1
  109. package/app/.next/server/chunks/[root-of-the-server]__0bkx9sd._.js +1 -1
  110. package/app/.next/server/chunks/[root-of-the-server]__0c4v_hg._.js +2 -2
  111. package/app/.next/server/chunks/[root-of-the-server]__0c5t729._.js +1 -1
  112. package/app/.next/server/chunks/[root-of-the-server]__0cem6i6._.js +1 -1
  113. package/app/.next/server/chunks/[root-of-the-server]__0d-qyrk._.js +2 -2
  114. package/app/.next/server/chunks/[root-of-the-server]__0d-rd-n._.js +1 -1
  115. package/app/.next/server/chunks/[root-of-the-server]__0djfz6n._.js +1 -1
  116. package/app/.next/server/chunks/[root-of-the-server]__0dmb7bd._.js +1 -1
  117. package/app/.next/server/chunks/[root-of-the-server]__0e7dp.z._.js +2 -2
  118. package/app/.next/server/chunks/[root-of-the-server]__0el_v65._.js +1 -1
  119. package/app/.next/server/chunks/[root-of-the-server]__0enebbv._.js +2 -2
  120. package/app/.next/server/chunks/[root-of-the-server]__0enecpa._.js +1 -1
  121. package/app/.next/server/chunks/[root-of-the-server]__0eps0zu._.js +1 -1
  122. package/app/.next/server/chunks/[root-of-the-server]__0fbv0zh._.js +1 -1
  123. package/app/.next/server/chunks/[root-of-the-server]__0fmf-tk._.js +1 -1
  124. package/app/.next/server/chunks/[root-of-the-server]__0fw0v5q._.js +2 -2
  125. package/app/.next/server/chunks/[root-of-the-server]__0g0b9au._.js +1 -1
  126. package/app/.next/server/chunks/[root-of-the-server]__0gukblk._.js +1 -1
  127. package/app/.next/server/chunks/[root-of-the-server]__0h-q5l0._.js +1 -1
  128. package/app/.next/server/chunks/[root-of-the-server]__0h1fgwr._.js +1 -1
  129. package/app/.next/server/chunks/[root-of-the-server]__0h86b7i._.js +1 -1
  130. package/app/.next/server/chunks/[root-of-the-server]__0h~a5f1._.js +1 -1
  131. package/app/.next/server/chunks/[root-of-the-server]__0irqapk._.js +1 -1
  132. package/app/.next/server/chunks/[root-of-the-server]__0j0ez8_._.js +2 -2
  133. package/app/.next/server/chunks/[root-of-the-server]__0jacr87._.js +1 -1
  134. package/app/.next/server/chunks/[root-of-the-server]__0jnihz9._.js +1 -1
  135. package/app/.next/server/chunks/[root-of-the-server]__0jp3yj4._.js +1 -1
  136. package/app/.next/server/chunks/[root-of-the-server]__0llqbda._.js +2 -2
  137. package/app/.next/server/chunks/[root-of-the-server]__0m-356c._.js +1 -1
  138. package/app/.next/server/chunks/[root-of-the-server]__0mj7x5~._.js +8 -8
  139. package/app/.next/server/chunks/[root-of-the-server]__0mpnloa._.js +1 -1
  140. package/app/.next/server/chunks/[root-of-the-server]__0n-~kvf._.js +1 -1
  141. package/app/.next/server/chunks/[root-of-the-server]__0n.gjo8._.js +2 -2
  142. package/app/.next/server/chunks/[root-of-the-server]__0n0nara._.js +1 -1
  143. package/app/.next/server/chunks/[root-of-the-server]__0ncz8xj._.js +1 -1
  144. package/app/.next/server/chunks/[root-of-the-server]__0oph175._.js +1 -1
  145. package/app/.next/server/chunks/[root-of-the-server]__0p3a7_l._.js +1 -1
  146. package/app/.next/server/chunks/[root-of-the-server]__0pl_899._.js +1 -1
  147. package/app/.next/server/chunks/[root-of-the-server]__0prott7._.js +2 -2
  148. package/app/.next/server/chunks/[root-of-the-server]__0pwiejj._.js +1 -1
  149. package/app/.next/server/chunks/[root-of-the-server]__0pxqo8v._.js +1 -1
  150. package/app/.next/server/chunks/[root-of-the-server]__0q04t~4._.js +1 -1
  151. package/app/.next/server/chunks/[root-of-the-server]__0q9h_5u._.js +1 -1
  152. package/app/.next/server/chunks/[root-of-the-server]__0qaruz-._.js +1 -1
  153. package/app/.next/server/chunks/[root-of-the-server]__0qka2s7._.js +1 -1
  154. package/app/.next/server/chunks/[root-of-the-server]__0rnvi83._.js +1 -1
  155. package/app/.next/server/chunks/[root-of-the-server]__0rpwwig._.js +1 -1
  156. package/app/.next/server/chunks/[root-of-the-server]__0rs2ec_._.js +1 -1
  157. package/app/.next/server/chunks/[root-of-the-server]__0s1dq3.._.js +1 -1
  158. package/app/.next/server/chunks/[root-of-the-server]__0s1ya.l._.js +5 -5
  159. package/app/.next/server/chunks/[root-of-the-server]__0svm~lc._.js +1 -1
  160. package/app/.next/server/chunks/[root-of-the-server]__0t83olx._.js +1 -1
  161. package/app/.next/server/chunks/[root-of-the-server]__0tsl88m._.js +1 -1
  162. package/app/.next/server/chunks/[root-of-the-server]__0uctzvq._.js +1 -1
  163. package/app/.next/server/chunks/[root-of-the-server]__0vkqjj1._.js +2 -2
  164. package/app/.next/server/chunks/[root-of-the-server]__0vwq47l._.js +1 -1
  165. package/app/.next/server/chunks/[root-of-the-server]__0vx1juw._.js +1 -1
  166. package/app/.next/server/chunks/[root-of-the-server]__0vzvfbd._.js +2 -2
  167. package/app/.next/server/chunks/[root-of-the-server]__0w39cdo._.js +1 -1
  168. package/app/.next/server/chunks/[root-of-the-server]__0wc__c~._.js +1 -1
  169. package/app/.next/server/chunks/[root-of-the-server]__0y2h760._.js +1 -1
  170. package/app/.next/server/chunks/[root-of-the-server]__0y_c7uk._.js +2 -2
  171. package/app/.next/server/chunks/[root-of-the-server]__0~8fltv._.js +1 -1
  172. package/app/.next/server/chunks/[root-of-the-server]__0~dj8ev._.js +2 -2
  173. package/app/.next/server/chunks/[root-of-the-server]__10.x-iq._.js +4 -4
  174. package/app/.next/server/chunks/[root-of-the-server]__10e1a_z._.js +2 -2
  175. package/app/.next/server/chunks/[root-of-the-server]__10o_k-p._.js +2 -2
  176. package/app/.next/server/chunks/[root-of-the-server]__10smy7g._.js +1 -1
  177. package/app/.next/server/chunks/[root-of-the-server]__11wa4b~._.js +1 -1
  178. package/app/.next/server/chunks/[root-of-the-server]__11xpr8u._.js +1 -1
  179. package/app/.next/server/chunks/[root-of-the-server]__122-jdl._.js +8 -8
  180. package/app/.next/server/chunks/[root-of-the-server]__12e9-l1._.js +1 -1
  181. package/app/.next/server/chunks/[root-of-the-server]__12gh.g1._.js +1 -1
  182. package/app/.next/server/chunks/[root-of-the-server]__136nal9._.js +1 -1
  183. package/app/.next/server/chunks/[root-of-the-server]__13_i443._.js +1 -1
  184. package/app/.next/server/chunks/[root-of-the-server]__13c-d_4._.js +2 -2
  185. package/app/.next/server/chunks/_0-jnvci._.js +1 -1
  186. package/app/.next/server/chunks/_0-~thzo._.js +1 -1
  187. package/app/.next/server/chunks/_00.pgsp._.js +1 -1
  188. package/app/.next/server/chunks/_013gowh._.js +1 -1
  189. package/app/.next/server/chunks/{_03c-j3o._.js → _02~yzex._.js} +2 -2
  190. package/app/.next/server/chunks/_036lxbr._.js +1 -1
  191. package/app/.next/server/chunks/_05reh6o._.js +1 -1
  192. package/app/.next/server/chunks/_0a3.3sc._.js +1 -1
  193. package/app/.next/server/chunks/_0c.abwr._.js +1 -1
  194. package/app/.next/server/chunks/_0due8oe._.js +2 -2
  195. package/app/.next/server/chunks/_0h-j8c2._.js +1 -1
  196. package/app/.next/server/chunks/_0k43pd6._.js +3 -3
  197. package/app/.next/server/chunks/_0vx-r0i._.js +2 -2
  198. package/app/.next/server/chunks/_10.rw9f._.js +1 -1
  199. package/app/.next/server/chunks/_13mo7j5._.js +1 -1
  200. package/app/.next/server/chunks/src_0f_le~m._.js +1 -1
  201. package/app/.next/server/chunks/ssr/_008ht2n._.js +2 -2
  202. package/app/.next/server/chunks/ssr/_0oo1f90._.js +2 -2
  203. package/app/.next/server/chunks/ssr/_0~laquj._.js +1 -1
  204. package/app/.next/server/chunks/ssr/src_04gjot1._.js +1 -1
  205. package/app/.next/server/chunks/ssr/src_app_(dashboard)_dashboard_cache_04_vca6._.js +1 -1
  206. package/app/.next/server/chunks/ssr/{src_app_(dashboard)_dashboard_settings_0ni3aus._.js → src_app_(dashboard)_dashboard_settings_09gq48u._.js} +2 -2
  207. package/app/.next/server/chunks/ssr/src_i18n_messages_en_json_[json]_cjs_13rg.m2._.js +1 -1
  208. package/app/.next/server/chunks/ssr/src_i18n_messages_pt-BR_json_[json]_cjs_01n5fvn._.js +1 -1
  209. package/app/.next/server/chunks/ssr/src_i18n_messages_pt_json_[json]_cjs_0fwb8p.._.js +1 -1
  210. package/app/.next/server/chunks/ssr/src_shared_0jy4djq._.js +3 -0
  211. package/app/.next/server/chunks/ssr/src_shared_components_0v5o286._.js +3 -0
  212. package/app/.next/server/middleware-build-manifest.js +3 -3
  213. package/app/.next/server/pages/500.html +1 -1
  214. package/app/.next/server/server-reference-manifest.js +1 -1
  215. package/app/.next/server/server-reference-manifest.json +1 -1
  216. package/app/.next/static/chunks/{03~_6b5~n101_.js → 0.ap2gsi3d-1e.js} +1 -1
  217. package/app/.next/static/chunks/08iujr48xci8k.js +1 -0
  218. package/app/.next/static/chunks/{0up_y.7qkqwxz.js → 08n6n76lz~vt6.js} +1 -1
  219. package/app/.next/static/chunks/{060zmf~qn1q6y.js → 0f611s~575pn8.js} +1 -1
  220. package/app/.next/static/chunks/0y5kx9rgeb6~_.js +1 -0
  221. package/app/.next/static/chunks/13xz-222deqiy.js +1 -0
  222. package/app/CHANGELOG.md +18 -0
  223. package/app/docs/openapi.yaml +1 -1
  224. package/app/llm.txt +2 -2
  225. package/app/open-sse/handlers/chatCore.ts +2 -2
  226. package/app/open-sse/package.json +1 -1
  227. package/app/open-sse/translator/request/claude-to-gemini.ts +17 -0
  228. package/app/open-sse/translator/request/openai-to-gemini.ts +14 -3
  229. package/app/open-sse/utils/stream.ts +2 -2
  230. package/app/package-lock.json +3 -3
  231. package/app/package.json +1 -1
  232. package/app/src/app/(dashboard)/dashboard/cache/components/CacheTrends.tsx +19 -12
  233. package/app/src/app/(dashboard)/dashboard/cache/page.tsx +0 -3
  234. package/app/src/app/(dashboard)/dashboard/memory/page.tsx +20 -20
  235. package/app/src/i18n/messages/en.json +55 -1
  236. package/app/src/i18n/messages/pt-BR.json +53 -0
  237. package/app/src/i18n/messages/pt.json +54 -1
  238. package/app/src/shared/constants/providers.ts +40 -0
  239. package/app/src/shared/constants/sidebarVisibility.ts +6 -0
  240. package/app/src/shared/utils/circuitBreaker.ts +14 -4
  241. package/package.json +1 -1
  242. package/app/.next/server/chunks/ssr/src_05ekey-._.js +0 -3
  243. package/app/.next/server/chunks/ssr/src_100xxow._.js +0 -3
  244. package/app/.next/static/chunks/05tcrkqknq.20.js +0 -1
  245. package/app/.next/static/chunks/0eng4c9gz1s4..js +0 -1
  246. package/app/.next/static/chunks/0go~kwn1zgxnd.js +0 -1
  247. /package/app/.next/static/{Dbb1D6OoD7WlyZuPBm3L6 → ImZm5czz4prt8gnJPx7vv}/_buildManifest.js +0 -0
  248. /package/app/.next/static/{Dbb1D6OoD7WlyZuPBm3L6 → ImZm5czz4prt8gnJPx7vv}/_clientMiddlewareManifest.js +0 -0
  249. /package/app/.next/static/{Dbb1D6OoD7WlyZuPBm3L6 → ImZm5czz4prt8gnJPx7vv}/_ssgManifest.js +0 -0
@@ -11,6 +11,8 @@ export const HIDEABLE_SIDEBAR_ITEM_IDS = [
11
11
  "cache",
12
12
  "cli-tools",
13
13
  "agents",
14
+ "memory",
15
+ "skills",
14
16
  "translator",
15
17
  "playground",
16
18
  "media",
@@ -55,11 +57,15 @@ const PRIMARY_SIDEBAR_ITEMS: readonly SidebarItemDefinition[] = [
55
57
  { id: "analytics", href: "/dashboard/analytics", i18nKey: "analytics", icon: "analytics" },
56
58
  { id: "limits", href: "/dashboard/limits", i18nKey: "limits", icon: "tune" },
57
59
  { id: "cache", href: "/dashboard/cache", i18nKey: "cache", icon: "cached" },
60
+ { id: "memory", href: "/dashboard/memory", i18nKey: "memory", icon: "psychology" },
61
+ { id: "skills", href: "/dashboard/skills", i18nKey: "skills", icon: "auto_awesome" },
58
62
  ];
59
63
 
60
64
  const CLI_SIDEBAR_ITEMS: readonly SidebarItemDefinition[] = [
61
65
  { id: "cli-tools", href: "/dashboard/cli-tools", i18nKey: "cliToolsShort", icon: "terminal" },
62
66
  { id: "agents", href: "/dashboard/agents", i18nKey: "agents", icon: "smart_toy" },
67
+ { id: "memory", href: "/dashboard/memory", i18nKey: "memory", icon: "psychology" },
68
+ { id: "skills", href: "/dashboard/skills", i18nKey: "skills", icon: "auto_fix_high" },
63
69
  ];
64
70
 
65
71
  const DEBUG_SIDEBAR_ITEMS: readonly SidebarItemDefinition[] = [
@@ -197,13 +197,21 @@ export class CircuitBreaker {
197
197
  // ─── Internal Methods ────────────────────────
198
198
 
199
199
  _onSuccess() {
200
- if (this.state === STATE.HALF_OPEN) {
200
+ if (this.state === STATE.OPEN) {
201
+ // Direct call from combo path: timeout elapsed and request succeeded
202
+ // without going through execute(), so transition OPEN → CLOSED directly
203
+ this._transition(STATE.CLOSED);
204
+ this.failureCount = 0;
205
+ this.successCount = 0;
206
+ this.lastFailureTime = null;
207
+ } else if (this.state === STATE.HALF_OPEN) {
201
208
  this.successCount++;
202
209
  this._transition(STATE.CLOSED);
203
210
  this.failureCount = 0;
211
+ } else {
212
+ // In CLOSED state, just reset failure count
213
+ this.failureCount = 0;
204
214
  }
205
- // In CLOSED state, just reset failure count
206
- this.failureCount = 0;
207
215
  this._persistToDb();
208
216
  }
209
217
 
@@ -211,7 +219,9 @@ export class CircuitBreaker {
211
219
  this.failureCount++;
212
220
  this.lastFailureTime = Date.now();
213
221
 
214
- if (this.state === STATE.HALF_OPEN) {
222
+ if (this.state === STATE.OPEN) {
223
+ // Already OPEN — just update persistence (re-tripped by combo path)
224
+ } else if (this.state === STATE.HALF_OPEN) {
215
225
  this._transition(STATE.OPEN);
216
226
  } else if (this.failureCount >= this.failureThreshold) {
217
227
  this._transition(STATE.OPEN);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
4
4
  "description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,3 +0,0 @@
1
- module.exports=[818465,a=>{"use strict";var b=a.i(497160);a.s(["Badge",()=>b.default])},609754,a=>{"use strict";var b=a.i(336444);a.s(["EmptyState",()=>b.default])},172992,a=>a.a(async(b,c)=>{try{var d=a.i(739906),e=a.i(587377),f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),442308,a=>a.a(async(b,c)=>{try{a.i(674204),a.i(59809),a.i(812955),a.i(436595),a.i(940436),a.i(831097),a.i(936561),a.i(497160),a.i(533285);var d=a.i(604195),e=a.i(561487),f=a.i(811118),g=a.i(303648),h=a.i(33723);a.i(743442);var i=a.i(93225);a.i(646958),a.i(511064),a.i(930510),a.i(883818),a.i(795479),a.i(405309),a.i(505825),a.i(394093),a.i(317291),a.i(296193),a.i(581349),a.i(441581),a.i(336444),a.i(934140),a.i(198106),a.i(690851),a.i(29198);var j=a.i(172992),k=b([d,e,f,g,h,i,j]);[d,e,f,g,h,i,j]=k.then?(await k)():k,a.s([]),c()}catch(a){c(a)}},!1),292216,a=>{"use strict";var b=a.i(436595);a.s(["Card",()=>b.default])},294023,a=>{"use strict";var b=a.i(674204);a.s(["Button",()=>b.default])},489108,a=>{"use strict";var b=a.i(59809);a.s(["Input",()=>b.default])},563203,a=>{"use strict";var b=a.i(940436);a.s(["Modal",()=>b.default])},709918,a=>{"use strict";var b=a.i(533285);a.s(["Toggle",()=>b.default])},248172,a=>{"use strict";var b=a.i(795479);a.s(["ProxyConfigModal",()=>b.default])},669805,a=>{"use strict";a.s(["ROUTING_STRATEGIES",0,[{value:"priority",labelKey:"priority",combosDescKey:"priorityDesc",settingsDescKey:"priorityDesc",icon:"sort"},{value:"weighted",labelKey:"weighted",combosDescKey:"weightedDesc",settingsDescKey:"weightedDesc",icon:"percent"},{value:"round-robin",labelKey:"roundRobin",combosDescKey:"roundRobinDesc",settingsDescKey:"roundRobinDesc",icon:"autorenew"},{value:"fill-first",labelKey:"fillFirst",combosDescKey:"fillFirstDesc",settingsDescKey:"fillFirstDesc",icon:"vertical_align_top"},{value:"p2c",labelKey:"p2c",combosDescKey:"p2cDesc",settingsDescKey:"p2cDesc",icon:"balance"},{value:"random",labelKey:"random",combosDescKey:"randomDesc",settingsDescKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",combosDescKey:"leastUsedDesc",settingsDescKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",combosDescKey:"costOptimizedDesc",settingsDescKey:"costOptDesc",icon:"savings"},{value:"strict-random",labelKey:"strictRandom",combosDescKey:"strictRandomDesc",settingsDescKey:"strictRandomDesc",icon:"casino"}],"SETTINGS_FALLBACK_STRATEGY_VALUES",0,["fill-first","round-robin","p2c","random","least-used","cost-optimized","strict-random"]])},976066,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(415925),i=b([f]);[f]=i.then?(await i)():i;a.s(["default",0,function(){let[a,b]=(0,e.useState)(null),[c,f]=(0,e.useState)(!1),i=(0,h.useTranslations)("cache"),j=(0,e.useCallback)(()=>{fetch("/api/settings/cache-metrics").then(a=>a.json()).then(b).catch(()=>{})},[]);(0,e.useEffect)(()=>{j();let a=setInterval(()=>void j(),1e4);return()=>clearInterval(a)},[j]);let k=async()=>{f(!0);try{await fetch("/api/settings/cache-metrics",{method:"DELETE"}),j()}finally{f(!1)}},l=a&&a.totalInputTokens>0?a.totalCachedTokens/a.totalInputTokens*100:0;return(0,d.jsx)(g.Card,{children:(0,d.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"insights"}),(0,d.jsx)("h2",{className:"font-medium text-sm",children:i("cacheMetrics")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:i("autoRefresh",{seconds:10})}),(0,d.jsx)("button",{onClick:k,disabled:c,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:c?i("resetting"):i("resetMetrics")})]})]}),a?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("totalRequests")}),(0,d.jsx)("p",{className:"font-mono text-lg text-text-main",children:a.totalRequests})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("withCacheControl")}),(0,d.jsx)("p",{className:"font-mono text-lg text-text-main",children:a.requestsWithCacheControl})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("inputTokens")}),(0,d.jsx)("p",{className:"font-mono text-lg text-text-main",children:a.totalInputTokens.toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("cachedTokensRead")}),(0,d.jsx)("p",{className:"font-mono text-lg text-green-400",children:a.totalCachedTokens.toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("cacheCreationWrite")}),(0,d.jsx)("p",{className:"font-mono text-lg text-blue-400",children:a.totalCacheCreationTokens.toLocaleString()})]})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-surface/50 border border-border/30 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-text-main",children:i("cacheReuseRatio")}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:i("cacheReuseRatioDesc")})]}),(0,d.jsxs)("p",{className:"font-mono text-xl text-green-400",children:[l.toFixed(1),"%"]})]}),(0,d.jsx)("div",{className:"mt-2 h-2 rounded-full bg-border/30 overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-green-500 transition-all duration-300",style:{width:`${Math.min(l,100)}%`}})})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("tokensSaved")}),(0,d.jsx)("p",{className:"font-mono text-lg text-green-400",children:a.tokensSaved.toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("estCostSaved")}),(0,d.jsxs)("p",{className:"font-mono text-lg text-green-400",children:["$",a.estimatedCostSaved.toFixed(4)]})]})]}),Object.keys(a.byProvider).length>0&&(0,d.jsxs)("div",{className:"pt-3 border-t border-border/30",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-text-muted mb-2",children:i("byProvider")}),(0,d.jsx)("div",{className:"space-y-2",children:Object.entries(a.byProvider).map(([a,b])=>{let c=b.inputTokens>0?b.cachedTokens/b.inputTokens*100:0;return(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded bg-surface/30 text-xs",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"text-text-main capitalize w-24",children:a}),(0,d.jsxs)("span",{className:"text-text-muted",children:[b.requests," ",i("requestsShort")]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-4 font-mono",children:[(0,d.jsxs)("span",{className:"text-text-muted",title:i("inputTokens"),children:[i("inputShort"),": ",b.inputTokens.toLocaleString()]}),(0,d.jsxs)("span",{className:"text-green-400",title:i("cachedTokensRead"),children:[i("cachedShort"),": ",b.cachedTokens.toLocaleString()]}),(0,d.jsxs)("span",{className:"text-blue-400",title:i("cacheCreationWrite"),children:[i("writeShort"),": ",b.cacheCreationTokens.toLocaleString()]}),(0,d.jsxs)("span",{className:"text-green-400 w-12 text-right",children:[c.toFixed(0),"%"]})]})]},a)})})]})]}):(0,d.jsx)("p",{className:"text-sm text-text-muted",children:i("loading")})]})})}]),c()}catch(a){c(a)}},!1)];
2
-
3
- //# sourceMappingURL=src_05ekey-._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[172992,a=>a.a(async(b,c)=>{try{var d=a.i(739906),e=a.i(587377),f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),442308,a=>a.a(async(b,c)=>{try{a.i(674204),a.i(59809),a.i(812955),a.i(436595),a.i(940436),a.i(831097),a.i(936561),a.i(497160),a.i(533285);var d=a.i(604195),e=a.i(561487),f=a.i(811118),g=a.i(303648),h=a.i(33723);a.i(743442);var i=a.i(93225);a.i(646958),a.i(511064),a.i(930510),a.i(883818),a.i(795479),a.i(405309),a.i(505825),a.i(394093),a.i(317291),a.i(296193),a.i(581349),a.i(441581),a.i(336444),a.i(934140),a.i(198106),a.i(690851),a.i(29198);var j=a.i(172992),k=b([d,e,f,g,h,i,j]);[d,e,f,g,h,i,j]=k.then?(await k)():k,a.s([]),c()}catch(a){c(a)}},!1),292216,a=>{"use strict";var b=a.i(436595);a.s(["Card",()=>b.default])},294023,a=>{"use strict";var b=a.i(674204);a.s(["Button",()=>b.default])},609754,a=>{"use strict";var b=a.i(336444);a.s(["EmptyState",()=>b.default])},976066,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(572131),f=a.i(442308),g=a.i(292216),h=a.i(415925),i=b([f]);[f]=i.then?(await i)():i;a.s(["default",0,function(){let[a,b]=(0,e.useState)(null),[c,f]=(0,e.useState)(!1),i=(0,h.useTranslations)("cache"),j=(0,e.useCallback)(()=>{fetch("/api/settings/cache-metrics").then(a=>a.json()).then(b).catch(()=>{})},[]);(0,e.useEffect)(()=>{j();let a=setInterval(()=>void j(),1e4);return()=>clearInterval(a)},[j]);let k=async()=>{f(!0);try{await fetch("/api/settings/cache-metrics",{method:"DELETE"}),j()}finally{f(!1)}},l=a&&a.totalInputTokens>0?a.totalCachedTokens/a.totalInputTokens*100:0;return(0,d.jsx)(g.Card,{children:(0,d.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"insights"}),(0,d.jsx)("h2",{className:"font-medium text-sm",children:i("cacheMetrics")})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted",children:i("autoRefresh",{seconds:10})}),(0,d.jsx)("button",{onClick:k,disabled:c,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:c?i("resetting"):i("resetMetrics")})]})]}),a?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("totalRequests")}),(0,d.jsx)("p",{className:"font-mono text-lg text-text-main",children:a.totalRequests})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("withCacheControl")}),(0,d.jsx)("p",{className:"font-mono text-lg text-text-main",children:a.requestsWithCacheControl})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("inputTokens")}),(0,d.jsx)("p",{className:"font-mono text-lg text-text-main",children:a.totalInputTokens.toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("cachedTokensRead")}),(0,d.jsx)("p",{className:"font-mono text-lg text-green-400",children:a.totalCachedTokens.toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("cacheCreationWrite")}),(0,d.jsx)("p",{className:"font-mono text-lg text-blue-400",children:a.totalCacheCreationTokens.toLocaleString()})]})]}),(0,d.jsxs)("div",{className:"rounded-lg bg-surface/50 border border-border/30 p-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium text-text-main",children:i("cacheReuseRatio")}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:i("cacheReuseRatioDesc")})]}),(0,d.jsxs)("p",{className:"font-mono text-xl text-green-400",children:[l.toFixed(1),"%"]})]}),(0,d.jsx)("div",{className:"mt-2 h-2 rounded-full bg-border/30 overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-green-500 transition-all duration-300",style:{width:`${Math.min(l,100)}%`}})})]}),(0,d.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("tokensSaved")}),(0,d.jsx)("p",{className:"font-mono text-lg text-green-400",children:a.tokensSaved.toLocaleString()})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted",children:i("estCostSaved")}),(0,d.jsxs)("p",{className:"font-mono text-lg text-green-400",children:["$",a.estimatedCostSaved.toFixed(4)]})]})]}),Object.keys(a.byProvider).length>0&&(0,d.jsxs)("div",{className:"pt-3 border-t border-border/30",children:[(0,d.jsx)("p",{className:"text-xs font-medium text-text-muted mb-2",children:i("byProvider")}),(0,d.jsx)("div",{className:"space-y-2",children:Object.entries(a.byProvider).map(([a,b])=>{let c=b.inputTokens>0?b.cachedTokens/b.inputTokens*100:0;return(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded bg-surface/30 text-xs",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("span",{className:"text-text-main capitalize w-24",children:a}),(0,d.jsxs)("span",{className:"text-text-muted",children:[b.requests," ",i("requestsShort")]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-4 font-mono",children:[(0,d.jsxs)("span",{className:"text-text-muted",title:i("inputTokens"),children:[i("inputShort"),": ",b.inputTokens.toLocaleString()]}),(0,d.jsxs)("span",{className:"text-green-400",title:i("cachedTokensRead"),children:[i("cachedShort"),": ",b.cachedTokens.toLocaleString()]}),(0,d.jsxs)("span",{className:"text-blue-400",title:i("cacheCreationWrite"),children:[i("writeShort"),": ",b.cacheCreationTokens.toLocaleString()]}),(0,d.jsxs)("span",{className:"text-green-400 w-12 text-right",children:[c.toFixed(0),"%"]})]})]},a)})})]})]}):(0,d.jsx)("p",{className:"text-sm text-text-muted",children:i("loading")})]})})}]),c()}catch(a){c(a)}},!1)];
2
-
3
- //# sourceMappingURL=src_100xxow._.js.map
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,628029,e=>{"use strict";var t=e.i(969353);e.s(["Badge",()=>t.default])},11131,e=>{"use strict";var t=e.i(629342);e.s(["EmptyState",()=>t.default])},565650,e=>{"use strict";e.i(342923),e.i(80173),e.i(907714),e.i(393718),e.i(703166),e.i(454149),e.i(822124),e.i(969353),e.i(635055),e.i(897844),e.i(450222),e.i(647829),e.i(6998),e.i(982131),e.i(116016),e.i(279743),e.i(193464),e.i(548036),e.i(566770),e.i(953789),e.i(8839),e.i(227404),e.i(621745),e.i(567955),e.i(17517),e.i(419947),e.i(323060),e.i(642440),e.i(629342),e.i(816062),e.i(690777),e.i(563201),e.i(115243),e.i(165149),e.i(359505),e.s([],565650)},11477,e=>{"use strict";var t=e.i(393718);e.s(["Card",()=>t.default])},474078,e=>{"use strict";var t=e.i(342923);e.s(["Button",()=>t.default])},339971,e=>{"use strict";var t=e.i(80173);e.s(["Input",()=>t.default])},87855,e=>{"use strict";var t=e.i(703166);e.s(["Modal",()=>t.default])},148943,e=>{"use strict";var t=e.i(635055);e.s(["Toggle",()=>t.default])},105370,e=>{"use strict";var t=e.i(8839);e.s(["ProxyConfigModal",()=>t.default])},516495,e=>{"use strict";e.s(["ROUTING_STRATEGIES",0,[{value:"priority",labelKey:"priority",combosDescKey:"priorityDesc",settingsDescKey:"priorityDesc",icon:"sort"},{value:"weighted",labelKey:"weighted",combosDescKey:"weightedDesc",settingsDescKey:"weightedDesc",icon:"percent"},{value:"round-robin",labelKey:"roundRobin",combosDescKey:"roundRobinDesc",settingsDescKey:"roundRobinDesc",icon:"autorenew"},{value:"fill-first",labelKey:"fillFirst",combosDescKey:"fillFirstDesc",settingsDescKey:"fillFirstDesc",icon:"vertical_align_top"},{value:"p2c",labelKey:"p2c",combosDescKey:"p2cDesc",settingsDescKey:"p2cDesc",icon:"balance"},{value:"random",labelKey:"random",combosDescKey:"randomDesc",settingsDescKey:"randomDesc",icon:"shuffle"},{value:"least-used",labelKey:"leastUsed",combosDescKey:"leastUsedDesc",settingsDescKey:"leastUsedDesc",icon:"low_priority"},{value:"cost-optimized",labelKey:"costOpt",combosDescKey:"costOptimizedDesc",settingsDescKey:"costOptDesc",icon:"savings"},{value:"strict-random",labelKey:"strictRandom",combosDescKey:"strictRandomDesc",settingsDescKey:"strictRandomDesc",icon:"casino"}],"SETTINGS_FALLBACK_STRATEGY_VALUES",0,["fill-first","round-robin","p2c","random","least-used","cost-optimized","strict-random"]])},221559,e=>{"use strict";var t=e.i(843476),s=e.i(271645);e.i(565650);var i=e.i(11477),a=e.i(948148);e.s(["default",0,function(){let[e,c]=(0,s.useState)(null),[l,n]=(0,s.useState)(!1),r=(0,a.useTranslations)("cache"),o=(0,s.useCallback)(()=>{fetch("/api/settings/cache-metrics").then(e=>e.json()).then(c).catch(()=>{})},[]);(0,s.useEffect)(()=>{o();let e=setInterval(()=>void o(),1e4);return()=>clearInterval(e)},[o]);let d=async()=>{n(!0);try{await fetch("/api/settings/cache-metrics",{method:"DELETE"}),o()}finally{n(!1)}},x=e&&e.totalInputTokens>0?e.totalCachedTokens/e.totalInputTokens*100:0;return(0,t.jsx)(i.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"insights"}),(0,t.jsx)("h2",{className:"font-medium text-sm",children:r("cacheMetrics")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-xs text-text-muted",children:r("autoRefresh",{seconds:10})}),(0,t.jsx)("button",{onClick:d,disabled:l,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:l?r("resetting"):r("resetMetrics")})]})]}),e?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("totalRequests")}),(0,t.jsx)("p",{className:"font-mono text-lg text-text-main",children:e.totalRequests})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("withCacheControl")}),(0,t.jsx)("p",{className:"font-mono text-lg text-text-main",children:e.requestsWithCacheControl})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("inputTokens")}),(0,t.jsx)("p",{className:"font-mono text-lg text-text-main",children:e.totalInputTokens.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("cachedTokensRead")}),(0,t.jsx)("p",{className:"font-mono text-lg text-green-400",children:e.totalCachedTokens.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("cacheCreationWrite")}),(0,t.jsx)("p",{className:"font-mono text-lg text-blue-400",children:e.totalCacheCreationTokens.toLocaleString()})]})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-surface/50 border border-border/30 p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-text-main",children:r("cacheReuseRatio")}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:r("cacheReuseRatioDesc")})]}),(0,t.jsxs)("p",{className:"font-mono text-xl text-green-400",children:[x.toFixed(1),"%"]})]}),(0,t.jsx)("div",{className:"mt-2 h-2 rounded-full bg-border/30 overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-green-500 transition-all duration-300",style:{width:`${Math.min(x,100)}%`}})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("tokensSaved")}),(0,t.jsx)("p",{className:"font-mono text-lg text-green-400",children:e.tokensSaved.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:r("estCostSaved")}),(0,t.jsxs)("p",{className:"font-mono text-lg text-green-400",children:["$",e.estimatedCostSaved.toFixed(4)]})]})]}),Object.keys(e.byProvider).length>0&&(0,t.jsxs)("div",{className:"pt-3 border-t border-border/30",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-text-muted mb-2",children:r("byProvider")}),(0,t.jsx)("div",{className:"space-y-2",children:Object.entries(e.byProvider).map(([e,s])=>{let i=s.inputTokens>0?s.cachedTokens/s.inputTokens*100:0;return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded bg-surface/30 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-text-main capitalize w-24",children:e}),(0,t.jsxs)("span",{className:"text-text-muted",children:[s.requests," ",r("requestsShort")]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 font-mono",children:[(0,t.jsxs)("span",{className:"text-text-muted",title:r("inputTokens"),children:[r("inputShort"),": ",s.inputTokens.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-green-400",title:r("cachedTokensRead"),children:[r("cachedShort"),": ",s.cachedTokens.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-blue-400",title:r("cacheCreationWrite"),children:[r("writeShort"),": ",s.cacheCreationTokens.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-green-400 w-12 text-right",children:[i.toFixed(0),"%"]})]})]},e)})})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:r("loading")})]})})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565650,e=>{"use strict";e.i(342923),e.i(80173),e.i(907714),e.i(393718),e.i(703166),e.i(454149),e.i(822124),e.i(969353),e.i(635055),e.i(897844),e.i(450222),e.i(647829),e.i(6998),e.i(982131),e.i(116016),e.i(279743),e.i(193464),e.i(548036),e.i(566770),e.i(953789),e.i(8839),e.i(227404),e.i(621745),e.i(567955),e.i(17517),e.i(419947),e.i(323060),e.i(642440),e.i(629342),e.i(816062),e.i(690777),e.i(563201),e.i(115243),e.i(165149),e.i(359505),e.s([],565650)},11477,e=>{"use strict";var t=e.i(393718);e.s(["Card",()=>t.default])},474078,e=>{"use strict";var t=e.i(342923);e.s(["Button",()=>t.default])},339971,e=>{"use strict";var t=e.i(80173);e.s(["Input",()=>t.default])},961430,e=>{"use strict";var t=e.i(907714);e.s(["Select",()=>t.default])},628029,e=>{"use strict";var t=e.i(969353);e.s(["Badge",()=>t.default])},168903,e=>{"use strict";var t=e.i(843476),s=e.i(271645);e.i(565650);var i=e.i(11477),a=e.i(628029),l=e.i(474078),r=e.i(339971),c=e.i(961430),n=e.i(948148);e.s(["default",0,function(){(0,n.useTranslations)("memory");let[e,d]=(0,s.useState)([]),[o,x]=(0,s.useState)({totalEntries:0,tokensUsed:0,hitRate:0}),[m,h]=(0,s.useState)("all"),[u,j]=(0,s.useState)(""),[p,f]=(0,s.useState)(!0);(0,s.useEffect)(()=>{y()},[]);let y=async()=>{try{let e=await fetch("/api/memory");if(e.ok){let t=await e.json();d(t.memories||[]),x(t.stats||{totalEntries:0,tokensUsed:0,hitRate:0})}}catch(e){console.error("Failed to fetch memories:",e)}finally{f(!1)}},v=async t=>{try{await fetch(`/api/memory/${t}`,{method:"DELETE"}),d(e.filter(e=>e.id!==t))}catch(e){console.error("Failed to delete memory:",e)}},N=e.filter(e=>{let t="all"===m||e.type===m,s=""===u||e.content.toLowerCase().includes(u.toLowerCase())||e.key.toLowerCase().includes(u.toLowerCase());return t&&s});return p?(0,t.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900"})}):(0,t.jsxs)("div",{className:"space-y-6 p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:"Memory Management"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>{let t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),s=URL.createObjectURL(t),i=document.createElement("a");i.href=s,i.download=`memory-export-${new Date().toISOString()}.json`,i.click()},children:"Export"}),(0,t.jsx)(l.Button,{variant:"outline",children:"Import"}),(0,t.jsx)(l.Button,{children:"Add Memory"})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsx)(i.Card,{children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Total Entries"}),(0,t.jsx)("div",{className:"text-2xl font-bold",children:o.totalEntries})]})}),(0,t.jsx)(i.Card,{children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Tokens Used"}),(0,t.jsx)("div",{className:"text-2xl font-bold",children:o.tokensUsed.toLocaleString()})]})}),(0,t.jsx)(i.Card,{children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Hit Rate"}),(0,t.jsxs)("div",{className:"text-2xl font-bold",children:[(100*o.hitRate).toFixed(1),"%"]})]})})]}),(0,t.jsx)(i.Card,{children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:"Memories"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.Input,{placeholder:"Search memories...",value:u,onChange:e=>j(e.target.value),className:"w-64"}),(0,t.jsxs)(c.Select,{value:m,onChange:e=>h(e.target.value),children:[(0,t.jsx)("option",{value:"all",children:"All Types"}),(0,t.jsx)("option",{value:"factual",children:"Factual"}),(0,t.jsx)("option",{value:"episodic",children:"Episodic"}),(0,t.jsx)("option",{value:"procedural",children:"Procedural"}),(0,t.jsx)("option",{value:"semantic",children:"Semantic"})]})]})]}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("th",{className:"text-left py-2 px-4",children:"Type"}),(0,t.jsx)("th",{className:"text-left py-2 px-4",children:"Key"}),(0,t.jsx)("th",{className:"text-left py-2 px-4",children:"Content"}),(0,t.jsx)("th",{className:"text-left py-2 px-4",children:"Created"}),(0,t.jsx)("th",{className:"text-left py-2 px-4",children:"Actions"})]})}),(0,t.jsx)("tbody",{children:N.map(e=>(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"py-2 px-4",children:(0,t.jsx)(a.Badge,{variant:(e=>{switch(e){case"factual":return"info";case"episodic":return"success";case"procedural":return"warning";case"semantic":return"error";default:return"default"}})(e.type),children:e.type})}),(0,t.jsx)("td",{className:"py-2 px-4 font-medium",children:e.key}),(0,t.jsx)("td",{className:"py-2 px-4 max-w-md truncate",children:e.content}),(0,t.jsx)("td",{className:"py-2 px-4",children:new Date(e.createdAt).toLocaleDateString()}),(0,t.jsx)("td",{className:"py-2 px-4",children:(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>v(e.id),children:"Delete"})})]},e.id))})]})})]})})]})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565650,e=>{"use strict";e.i(342923),e.i(80173),e.i(907714),e.i(393718),e.i(703166),e.i(454149),e.i(822124),e.i(969353),e.i(635055),e.i(897844),e.i(450222),e.i(647829),e.i(6998),e.i(982131),e.i(116016),e.i(279743),e.i(193464),e.i(548036),e.i(566770),e.i(953789),e.i(8839),e.i(227404),e.i(621745),e.i(567955),e.i(17517),e.i(419947),e.i(323060),e.i(642440),e.i(629342),e.i(816062),e.i(690777),e.i(563201),e.i(115243),e.i(165149),e.i(359505),e.s([],565650)},11477,e=>{"use strict";var t=e.i(393718);e.s(["Card",()=>t.default])},474078,e=>{"use strict";var t=e.i(342923);e.s(["Button",()=>t.default])},11131,e=>{"use strict";var t=e.i(629342);e.s(["EmptyState",()=>t.default])},221559,e=>{"use strict";var t=e.i(843476),s=e.i(271645);e.i(565650);var a=e.i(11477),l=e.i(948148);e.s(["default",0,function(){let[e,i]=(0,s.useState)(null),[r,c]=(0,s.useState)(!1),d=(0,l.useTranslations)("cache"),n=(0,s.useCallback)(()=>{fetch("/api/settings/cache-metrics").then(e=>e.json()).then(i).catch(()=>{})},[]);(0,s.useEffect)(()=>{n();let e=setInterval(()=>void n(),1e4);return()=>clearInterval(e)},[n]);let x=async()=>{c(!0);try{await fetch("/api/settings/cache-metrics",{method:"DELETE"}),n()}finally{c(!1)}},o=e&&e.totalInputTokens>0?e.totalCachedTokens/e.totalInputTokens*100:0;return(0,t.jsx)(a.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"insights"}),(0,t.jsx)("h2",{className:"font-medium text-sm",children:d("cacheMetrics")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-xs text-text-muted",children:d("autoRefresh",{seconds:10})}),(0,t.jsx)("button",{onClick:x,disabled:r,className:"px-3 py-1.5 text-xs rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors disabled:opacity-50",children:r?d("resetting"):d("resetMetrics")})]})]}),e?(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("totalRequests")}),(0,t.jsx)("p",{className:"font-mono text-lg text-text-main",children:e.totalRequests})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("withCacheControl")}),(0,t.jsx)("p",{className:"font-mono text-lg text-text-main",children:e.requestsWithCacheControl})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("inputTokens")}),(0,t.jsx)("p",{className:"font-mono text-lg text-text-main",children:e.totalInputTokens.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("cachedTokensRead")}),(0,t.jsx)("p",{className:"font-mono text-lg text-green-400",children:e.totalCachedTokens.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("cacheCreationWrite")}),(0,t.jsx)("p",{className:"font-mono text-lg text-blue-400",children:e.totalCacheCreationTokens.toLocaleString()})]})]}),(0,t.jsxs)("div",{className:"rounded-lg bg-surface/50 border border-border/30 p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-text-main",children:d("cacheReuseRatio")}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:d("cacheReuseRatioDesc")})]}),(0,t.jsxs)("p",{className:"font-mono text-xl text-green-400",children:[o.toFixed(1),"%"]})]}),(0,t.jsx)("div",{className:"mt-2 h-2 rounded-full bg-border/30 overflow-hidden",children:(0,t.jsx)("div",{className:"h-full bg-green-500 transition-all duration-300",style:{width:`${Math.min(o,100)}%`}})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("tokensSaved")}),(0,t.jsx)("p",{className:"font-mono text-lg text-green-400",children:e.tokensSaved.toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted",children:d("estCostSaved")}),(0,t.jsxs)("p",{className:"font-mono text-lg text-green-400",children:["$",e.estimatedCostSaved.toFixed(4)]})]})]}),Object.keys(e.byProvider).length>0&&(0,t.jsxs)("div",{className:"pt-3 border-t border-border/30",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-text-muted mb-2",children:d("byProvider")}),(0,t.jsx)("div",{className:"space-y-2",children:Object.entries(e.byProvider).map(([e,s])=>{let a=s.inputTokens>0?s.cachedTokens/s.inputTokens*100:0;return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 rounded bg-surface/30 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-text-main capitalize w-24",children:e}),(0,t.jsxs)("span",{className:"text-text-muted",children:[s.requests," ",d("requestsShort")]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 font-mono",children:[(0,t.jsxs)("span",{className:"text-text-muted",title:d("inputTokens"),children:[d("inputShort"),": ",s.inputTokens.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-green-400",title:d("cachedTokensRead"),children:[d("cachedShort"),": ",s.cachedTokens.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-blue-400",title:d("cacheCreationWrite"),children:[d("writeShort"),": ",s.cacheCreationTokens.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-green-400 w-12 text-right",children:[a.toFixed(0),"%"]})]})]},e)})})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:d("loading")})]})})}])},256765,e=>{"use strict";var t=e.i(843476),s=e.i(271645);e.i(565650);var a=e.i(11477),l=e.i(474078),i=e.i(11131),r=e.i(627949),c=e.i(948148);function d(){let e=(0,c.useTranslations)("cache"),[a,i]=(0,s.useState)([]),[r,d]=(0,s.useState)({page:1,limit:20,total:0,totalPages:0}),[n,x]=(0,s.useState)(!0),[o,m]=(0,s.useState)(""),[h,u]=(0,s.useState)(null),p=(0,s.useCallback)(async(e=1)=>{x(!0);try{let t=new URLSearchParams({page:String(e),limit:String(r.limit)});o&&t.set("search",o);let s=await fetch(`/api/cache/entries?${t}`);if(s.ok){let e=await s.json();i(e.entries),d(e.pagination)}}catch{}finally{x(!1)}},[o,r.limit]);(0,s.useEffect)(()=>{p()},[p]);let j=async e=>{u(e);try{await fetch(`/api/cache/entries?signature=${encodeURIComponent(e)}`,{method:"DELETE"}),await p(r.page)}finally{u(null)}},g=e=>new Date(e).toLocaleString();return(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("input",{type:"text",placeholder:e("searchEntries"),value:o,onChange:e=>m(e.target.value),onKeyDown:e=>"Enter"===e.key&&p(),className:"flex-1 px-3 py-2 text-sm rounded-lg border border-border bg-surface text-text-main placeholder:text-text-muted"}),(0,t.jsx)(l.Button,{variant:"secondary",size:"sm",onClick:()=>p(),children:e("search")})]}),n?(0,t.jsx)("div",{className:"text-sm text-text-muted",children:e("loading")}):0===a.length?(0,t.jsx)("div",{className:"text-sm text-text-muted text-center py-8",children:e("noEntries")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border/30",children:[(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("signature")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("model")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("hits")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("tokensSaved")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("created")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("expires")}),(0,t.jsx)("th",{className:"pb-2",children:e("actions")})]})}),(0,t.jsx)("tbody",{children:a.map(e=>(0,t.jsxs)("tr",{className:"border-b border-border/20",children:[(0,t.jsxs)("td",{className:"py-2 pr-4 font-mono text-xs",children:[e.signature.slice(0,12),"..."]}),(0,t.jsx)("td",{className:"py-2 pr-4",children:e.model}),(0,t.jsx)("td",{className:"py-2 pr-4 tabular-nums",children:e.hit_count}),(0,t.jsx)("td",{className:"py-2 pr-4 tabular-nums text-green-500",children:e.tokens_saved.toLocaleString()}),(0,t.jsx)("td",{className:"py-2 pr-4 text-xs text-text-muted",children:g(e.created_at)}),(0,t.jsx)("td",{className:"py-2 pr-4 text-xs text-text-muted",children:g(e.expires_at)}),(0,t.jsx)("td",{className:"py-2",children:(0,t.jsx)("button",{onClick:()=>j(e.signature),disabled:h===e.signature,className:"text-xs text-red-400 hover:text-red-300 disabled:opacity-50",children:h===e.signature?"...":"🗑️"})})]},e.id))})]})}),r.totalPages>1&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 pt-2",children:[(0,t.jsx)(l.Button,{variant:"secondary",size:"sm",onClick:()=>p(r.page-1),disabled:r.page<=1,children:"←"}),(0,t.jsxs)("span",{className:"text-sm text-text-muted",children:[r.page," / ",r.totalPages]}),(0,t.jsx)(l.Button,{variant:"secondary",size:"sm",onClick:()=>p(r.page+1),disabled:r.page>=r.totalPages,children:"→"})]})]})]})}var n=e.i(221559);function x({icon:e,label:s,value:a,sub:l,valueClass:i="text-text"}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1 p-4 rounded-xl bg-surface-raised border border-border/40",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-text-muted text-xs",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base leading-none","aria-hidden":"true",children:e}),s]}),(0,t.jsx)("div",{className:`text-2xl font-semibold tabular-nums ${i}`,children:a}),l&&(0,t.jsx)("div",{className:"text-xs text-text-muted",children:l})]})}function o({hitRate:e,label:s}){let a=e>=70?"bg-green-500":e>=40?"bg-amber-400":"bg-red-500",l=e>=70?"text-green-500":e>=40?"text-amber-400":"text-red-500";return(0,t.jsxs)("div",{className:"w-full",role:"progressbar","aria-label":s,"aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs mb-1.5",children:[(0,t.jsx)("span",{className:"text-text-muted",children:s}),(0,t.jsxs)("span",{className:`font-semibold tabular-nums ${l}`,children:[e.toFixed(1),"%"]})]}),(0,t.jsx)("div",{className:"w-full h-2 rounded-full bg-surface/50 overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-500 ${a}`,style:{width:`${Math.min(e,100)}%`}})})]})}function m({icon:e,children:s}){return(0,t.jsxs)("div",{className:"flex gap-2 text-sm text-text-muted",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base leading-5 text-blue-400 shrink-0","aria-hidden":"true",children:e}),(0,t.jsx)("span",{children:s})]})}e.s(["default",0,function(){let e=(0,c.useTranslations)("cache"),[h,u]=(0,s.useState)(null),[p,j]=(0,s.useState)(!0),[g,b]=(0,s.useState)(!1),[v,f]=(0,s.useState)("overview"),N=(0,r.useNotificationStore)(),y=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/cache");if(e.ok){let t=await e.json();u(t)}}catch(e){console.error("[CachePage] Failed to fetch cache stats:",e)}finally{j(!1)}},[]);(0,s.useEffect)(()=>{y();let e=setInterval(()=>void y(),1e4);return()=>clearInterval(e)},[y]);let w=async()=>{b(!0);try{let t=await fetch("/api/cache",{method:"DELETE"});if(t.ok){let s=await t.json();N.success(e("clearSuccess",{count:s.expiredRemoved??0})),await y()}else N.error(e("clearError"))}catch(t){console.error("[CachePage] Failed to clear cache:",t),N.error(e("clearError"))}finally{b(!1)}},C=h?.semanticCache,k=h?.promptCache,S=h?.trend??[],T=h?.idempotency,E=C?parseFloat(C.hitRate):0,L=C?C.hits+C.misses:0,R=k&&k.totalRequests>0?k.requestsWithCacheControl/k.totalRequests*100:0,q=k?Object.entries(k.byProvider):[],P=Math.max(1,...S.map(e=>e.requests));return(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:e("description")})]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)(l.Button,{variant:"secondary",icon:"refresh",size:"sm",onClick:()=>void y(),disabled:p,"aria-label":e("refresh"),children:e("refresh")}),(0,t.jsx)(l.Button,{variant:"danger",icon:"delete_sweep",size:"sm",onClick:()=>void w(),disabled:g||p,loading:g,"aria-label":e("clearAll"),children:e("clearAll")})]})]}),(0,t.jsxs)("div",{className:"flex gap-1 p-1 rounded-lg bg-black/5 dark:bg-white/5 w-fit",children:[(0,t.jsx)("button",{onClick:()=>f("overview"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all ${"overview"===v?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"}`,children:e("overview")}),(0,t.jsx)("button",{onClick:()=>f("entries"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all ${"entries"===v?"bg-white dark:bg-white/10 text-text-main shadow-sm":"text-text-muted hover:text-text-main"}`,children:e("entries")})]}),"entries"===v&&(0,t.jsx)(d,{}),"overview"===v&&(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4","aria-busy":"true","aria-label":"Loading cache statistics",children:Array.from({length:4}).map((e,s)=>(0,t.jsx)("div",{className:"h-24 rounded-xl bg-surface-raised animate-pulse"},s))}),!p&&!h&&(0,t.jsx)(i.EmptyState,{icon:"cached",title:e("unavailable"),description:e("unavailableDesc"),actionLabel:e("refresh"),onAction:()=>void y()}),!p&&h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,t.jsx)(x,{icon:"memory",label:e("memoryEntries"),value:C?.memoryEntries??0,sub:e("memoryEntriesSub")}),(0,t.jsx)(x,{icon:"storage",label:e("dbEntries"),value:C?.dbEntries??0,sub:e("dbEntriesSub")}),(0,t.jsx)(x,{icon:"trending_up",label:e("cacheHits"),value:C?.hits??0,sub:e("cacheHitsSub",{total:L}),valueClass:"text-green-500"}),(0,t.jsx)(x,{icon:"token",label:e("tokensSaved"),value:(C?.tokensSaved??0).toLocaleString(),sub:e("tokensSavedSub"),valueClass:"text-blue-400"})]}),(0,t.jsx)(a.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"font-medium text-sm",children:e("performance")}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e("autoRefresh",{seconds:10})})]}),(0,t.jsx)(o,{hitRate:E,label:e("hitRate")}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4 pt-3 border-t border-border/30 text-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums text-green-500",children:C?.hits??0}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("hits")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums text-red-400",children:C?.misses??0}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("misses")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums",children:L}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("total")})]})]})]})}),k&&(0,t.jsx)(a.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"bolt"}),(0,t.jsx)("h2",{className:"font-medium text-sm",children:e("promptCache")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,t.jsxs)("div",{className:"p-3 rounded-lg bg-surface/50",children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums",children:k.requestsWithCacheControl.toLocaleString()}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("cachedRequests")})]}),(0,t.jsxs)("div",{className:"p-3 rounded-lg bg-surface/50",children:[(0,t.jsxs)("div",{className:"text-lg font-semibold tabular-nums text-green-500",children:[R.toFixed(1),"%"]}),(0,t.jsxs)("div",{className:"text-xs text-text-muted mt-0.5",children:[e("cacheHitRate")," (",k.requestsWithCacheControl,"/",k.totalRequests,")"]})]}),(0,t.jsxs)("div",{className:"p-3 rounded-lg bg-surface/50",children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums text-blue-400",children:k.totalCachedTokens.toLocaleString()}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("cachedTokens")})]}),(0,t.jsxs)("div",{className:"p-3 rounded-lg bg-surface/50",children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums text-purple-400",children:k.totalCacheCreationTokens.toLocaleString()}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("cacheCreationTokens")})]})]}),q.length>0&&(0,t.jsxs)("div",{className:"pt-3 border-t border-border/30",children:[(0,t.jsx)("h3",{className:"text-xs font-medium text-text-muted mb-3",children:e("byProvider")}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-xs text-text-muted border-b border-border/30",children:[(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("provider")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("requests")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("inputTokens")}),(0,t.jsx)("th",{className:"pb-2 pr-4",children:e("cachedTokensCol")}),(0,t.jsx)("th",{className:"pb-2",children:e("cacheCreation")})]})}),(0,t.jsx)("tbody",{children:q.map(([e,s])=>(0,t.jsxs)("tr",{className:"border-b border-border/20",children:[(0,t.jsx)("td",{className:"py-2 pr-4 font-medium",children:e}),(0,t.jsx)("td",{className:"py-2 pr-4 tabular-nums",children:s.requests.toLocaleString()}),(0,t.jsx)("td",{className:"py-2 pr-4 tabular-nums",children:s.inputTokens.toLocaleString()}),(0,t.jsx)("td",{className:"py-2 pr-4 tabular-nums text-green-500",children:s.cachedTokens.toLocaleString()}),(0,t.jsx)("td",{className:"py-2 tabular-nums text-purple-400",children:s.cacheCreationTokens.toLocaleString()})]},e))})]})})]})]})}),(0,t.jsx)(n.default,{}),S.length>0&&(0,t.jsx)(a.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"timeline"}),(0,t.jsx)("h2",{className:"font-medium text-sm",children:e("trend24h")})]}),(0,t.jsx)("div",{className:"flex items-end gap-1 h-32",children:S.map(s=>{let a=Math.max(4,s.requests/P*100),l=s.requests>0?Math.max(2,s.cachedRequests/s.requests*a):0,i=new Date(s.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1 group relative",children:[(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 hidden group-hover:block bg-surface-raised border border-border rounded px-2 py-1 text-xs whitespace-nowrap z-10",children:[i,": ",s.requests," ",e("requests").toLowerCase(),","," ",s.cachedRequests," ",e("cached").toLowerCase()]}),(0,t.jsxs)("div",{className:"w-full flex flex-col justify-end h-full gap-px",children:[(0,t.jsx)("div",{className:"w-full bg-green-500/30 rounded-t",style:{height:`${l}%`}}),(0,t.jsx)("div",{className:"w-full bg-text-muted/20 rounded-t",style:{height:`${a-l}%`}})]}),(0,t.jsx)("span",{className:"text-[10px] text-text-muted truncate w-full text-center",children:i.split(":")[0]})]},s.timestamp)})}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-text-muted",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded bg-text-muted/20"}),(0,t.jsx)("span",{children:e("total")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("div",{className:"w-3 h-3 rounded bg-green-500/30"}),(0,t.jsx)("span",{children:e("cached")})]})]})]})}),(0,t.jsx)(a.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-3",children:[(0,t.jsx)("h2",{className:"font-medium text-sm",children:e("behavior")}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,t.jsx)(m,{icon:"info",children:e("behaviorDeterministic")}),(0,t.jsx)(m,{icon:"info",children:e.rich("behaviorBypass",{header:()=>(0,t.jsx)("code",{className:"bg-surface px-1 py-0.5 rounded text-xs font-mono",children:"X-OmniRoute-No-Cache: true"})})}),(0,t.jsx)(m,{icon:"info",children:e("behaviorTwoTier")}),(0,t.jsx)(m,{icon:"info",children:e.rich("behaviorTtl",{envVar:()=>(0,t.jsx)("code",{className:"bg-surface px-1 py-0.5 rounded text-xs font-mono",children:"SEMANTIC_CACHE_TTL_MS"})})})]})]})}),(0,t.jsx)(a.Card,{children:(0,t.jsxs)("div",{className:"p-5 flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted","aria-hidden":"true",children:"fingerprint"}),(0,t.jsx)("h2",{className:"font-medium text-sm",children:e("idempotency")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"p-3 rounded-lg bg-surface/50",children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums",children:T?.activeKeys??0}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("activeDedupKeys")})]}),(0,t.jsxs)("div",{className:"p-3 rounded-lg bg-surface/50",children:[(0,t.jsx)("div",{className:"text-lg font-semibold tabular-nums",children:T?`${(T.windowMs/1e3).toFixed(0)}s`:"—"}),(0,t.jsx)("div",{className:"text-xs text-text-muted mt-0.5",children:e("dedupWindow")})]})]})]})})]})]})]})}],256765)}]);