omniroute 2.3.13 → 2.3.15

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 (268) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +53 -53
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/server/app/(dashboard)/dashboard/a2a/page_client-reference-manifest.js +1 -1
  5. package/app/.next/server/app/(dashboard)/dashboard/agents/page_client-reference-manifest.js +1 -1
  6. package/app/.next/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/api-manager/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/audit-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/page.js +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/auto-combo/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/mcp/page_client-reference-manifest.js +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/media/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/profile/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/settings/page_client-reference-manifest.js +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/settings/pricing/page.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/translator/page_client-reference-manifest.js +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/.well-known/agent.json/route_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/400/page_client-reference-manifest.js +1 -1
  34. package/app/.next/server/app/401/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/403/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/408/page_client-reference-manifest.js +1 -1
  37. package/app/.next/server/app/429/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/500/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/502/page_client-reference-manifest.js +1 -1
  40. package/app/.next/server/app/503/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/_global-error.html +2 -2
  43. package/app/.next/server/app/_global-error.rsc +1 -1
  44. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  45. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  46. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  47. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  48. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  49. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  50. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/a2a/route_client-reference-manifest.js +1 -1
  52. package/app/.next/server/app/api/a2a/status/route_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/api/a2a/tasks/[id]/cancel/route_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/api/a2a/tasks/[id]/route_client-reference-manifest.js +1 -1
  55. package/app/.next/server/app/api/a2a/tasks/route_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/api/acp/agents/route_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  58. package/app/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  60. package/app/.next/server/app/api/cache/route_client-reference-manifest.js +1 -1
  61. package/app/.next/server/app/api/cache/stats/route_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
  63. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
  64. package/app/.next/server/app/api/cli-tools/backups/route_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
  66. package/app/.next/server/app/api/cli-tools/cline-settings/route_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/api/cli-tools/codex-profiles/route_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
  69. package/app/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
  70. package/app/.next/server/app/api/cli-tools/guide-settings/[toolId]/route_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/api/cli-tools/kilo-settings/route_client-reference-manifest.js +1 -1
  72. package/app/.next/server/app/api/cli-tools/openclaw/auto-order/route_client-reference-manifest.js +1 -1
  73. package/app/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/api/cli-tools/runtime/[toolId]/route_client-reference-manifest.js +1 -1
  75. package/app/.next/server/app/api/cli-tools/status/route_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/api/cloud/auth/route_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/api/cloud/credentials/update/route_client-reference-manifest.js +1 -1
  78. package/app/.next/server/app/api/cloud/model/resolve/route_client-reference-manifest.js +1 -1
  79. package/app/.next/server/app/api/cloud/models/alias/route_client-reference-manifest.js +1 -1
  80. package/app/.next/server/app/api/combos/[id]/route_client-reference-manifest.js +1 -1
  81. package/app/.next/server/app/api/combos/auto/route.js +1 -1
  82. package/app/.next/server/app/api/combos/auto/route_client-reference-manifest.js +1 -1
  83. package/app/.next/server/app/api/combos/metrics/route_client-reference-manifest.js +1 -1
  84. package/app/.next/server/app/api/combos/route_client-reference-manifest.js +1 -1
  85. package/app/.next/server/app/api/combos/test/route_client-reference-manifest.js +1 -1
  86. package/app/.next/server/app/api/compliance/audit-log/route_client-reference-manifest.js +1 -1
  87. package/app/.next/server/app/api/db-backups/export/route_client-reference-manifest.js +1 -1
  88. package/app/.next/server/app/api/db-backups/exportAll/route_client-reference-manifest.js +1 -1
  89. package/app/.next/server/app/api/db-backups/import/route_client-reference-manifest.js +1 -1
  90. package/app/.next/server/app/api/db-backups/route_client-reference-manifest.js +1 -1
  91. package/app/.next/server/app/api/evals/[suiteId]/route_client-reference-manifest.js +1 -1
  92. package/app/.next/server/app/api/evals/route_client-reference-manifest.js +1 -1
  93. package/app/.next/server/app/api/fallback/chains/route_client-reference-manifest.js +1 -1
  94. package/app/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
  95. package/app/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
  96. package/app/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
  97. package/app/.next/server/app/api/logs/console/route_client-reference-manifest.js +1 -1
  98. package/app/.next/server/app/api/mcp/audit/route_client-reference-manifest.js +1 -1
  99. package/app/.next/server/app/api/mcp/audit/stats/route_client-reference-manifest.js +1 -1
  100. package/app/.next/server/app/api/mcp/sse/route_client-reference-manifest.js +1 -1
  101. package/app/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
  102. package/app/.next/server/app/api/mcp/stream/route_client-reference-manifest.js +1 -1
  103. package/app/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
  104. package/app/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
  105. package/app/.next/server/app/api/models/availability/route_client-reference-manifest.js +1 -1
  106. package/app/.next/server/app/api/models/catalog/route_client-reference-manifest.js +1 -1
  107. package/app/.next/server/app/api/models/openrouter-catalog/route_client-reference-manifest.js +1 -1
  108. package/app/.next/server/app/api/models/route.js +1 -1
  109. package/app/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  110. package/app/.next/server/app/api/monitoring/health/route.js +1 -1
  111. package/app/.next/server/app/api/monitoring/health/route_client-reference-manifest.js +1 -1
  112. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  113. package/app/.next/server/app/api/oauth/[provider]/[action]/route_client-reference-manifest.js +1 -1
  114. package/app/.next/server/app/api/oauth/cursor/auto-import/route_client-reference-manifest.js +1 -1
  115. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  116. package/app/.next/server/app/api/oauth/cursor/import/route_client-reference-manifest.js +1 -1
  117. package/app/.next/server/app/api/oauth/kiro/auto-import/route_client-reference-manifest.js +1 -1
  118. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  119. package/app/.next/server/app/api/oauth/kiro/import/route_client-reference-manifest.js +1 -1
  120. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  121. package/app/.next/server/app/api/oauth/kiro/social-authorize/route_client-reference-manifest.js +1 -1
  122. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  123. package/app/.next/server/app/api/oauth/kiro/social-exchange/route_client-reference-manifest.js +1 -1
  124. package/app/.next/server/app/api/policies/route_client-reference-manifest.js +1 -1
  125. package/app/.next/server/app/api/pricing/defaults/route.js +1 -1
  126. package/app/.next/server/app/api/pricing/defaults/route_client-reference-manifest.js +1 -1
  127. package/app/.next/server/app/api/pricing/models/route_client-reference-manifest.js +1 -1
  128. package/app/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
  129. package/app/.next/server/app/api/provider-metrics/route_client-reference-manifest.js +1 -1
  130. package/app/.next/server/app/api/provider-models/route_client-reference-manifest.js +1 -1
  131. package/app/.next/server/app/api/provider-nodes/[id]/route_client-reference-manifest.js +1 -1
  132. package/app/.next/server/app/api/provider-nodes/route_client-reference-manifest.js +1 -1
  133. package/app/.next/server/app/api/provider-nodes/validate/route_client-reference-manifest.js +1 -1
  134. package/app/.next/server/app/api/providers/[id]/models/route_client-reference-manifest.js +1 -1
  135. package/app/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -1
  136. package/app/.next/server/app/api/providers/[id]/test/route_client-reference-manifest.js +1 -1
  137. package/app/.next/server/app/api/providers/client/route_client-reference-manifest.js +1 -1
  138. package/app/.next/server/app/api/providers/route.js +1 -1
  139. package/app/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  140. package/app/.next/server/app/api/providers/test-batch/route_client-reference-manifest.js +1 -1
  141. package/app/.next/server/app/api/providers/validate/route_client-reference-manifest.js +1 -1
  142. package/app/.next/server/app/api/rate-limit/route_client-reference-manifest.js +1 -1
  143. package/app/.next/server/app/api/rate-limits/route_client-reference-manifest.js +1 -1
  144. package/app/.next/server/app/api/resilience/reset/route_client-reference-manifest.js +1 -1
  145. package/app/.next/server/app/api/resilience/route_client-reference-manifest.js +1 -1
  146. package/app/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
  147. package/app/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  148. package/app/.next/server/app/api/settings/background-degradation/route_client-reference-manifest.js +1 -1
  149. package/app/.next/server/app/api/settings/combo-defaults/route_client-reference-manifest.js +1 -1
  150. package/app/.next/server/app/api/settings/ip-filter/route_client-reference-manifest.js +1 -1
  151. package/app/.next/server/app/api/settings/model-aliases/route_client-reference-manifest.js +1 -1
  152. package/app/.next/server/app/api/settings/proxy/route_client-reference-manifest.js +1 -1
  153. package/app/.next/server/app/api/settings/proxy/test/route_client-reference-manifest.js +1 -1
  154. package/app/.next/server/app/api/settings/require-login/route_client-reference-manifest.js +1 -1
  155. package/app/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  156. package/app/.next/server/app/api/settings/system-prompt/route_client-reference-manifest.js +1 -1
  157. package/app/.next/server/app/api/settings/thinking-budget/route_client-reference-manifest.js +1 -1
  158. package/app/.next/server/app/api/shutdown/route_client-reference-manifest.js +1 -1
  159. package/app/.next/server/app/api/storage/health/route_client-reference-manifest.js +1 -1
  160. package/app/.next/server/app/api/sync/cloud/route_client-reference-manifest.js +1 -1
  161. package/app/.next/server/app/api/sync/initialize/route_client-reference-manifest.js +1 -1
  162. package/app/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  163. package/app/.next/server/app/api/telemetry/summary/route_client-reference-manifest.js +1 -1
  164. package/app/.next/server/app/api/token-health/route_client-reference-manifest.js +1 -1
  165. package/app/.next/server/app/api/translator/detect/route_client-reference-manifest.js +1 -1
  166. package/app/.next/server/app/api/translator/history/route_client-reference-manifest.js +1 -1
  167. package/app/.next/server/app/api/translator/load/route_client-reference-manifest.js +1 -1
  168. package/app/.next/server/app/api/translator/save/route_client-reference-manifest.js +1 -1
  169. package/app/.next/server/app/api/translator/send/route_client-reference-manifest.js +1 -1
  170. package/app/.next/server/app/api/translator/translate/route_client-reference-manifest.js +1 -1
  171. package/app/.next/server/app/api/usage/[connectionId]/route_client-reference-manifest.js +1 -1
  172. package/app/.next/server/app/api/usage/analytics/route_client-reference-manifest.js +1 -1
  173. package/app/.next/server/app/api/usage/budget/route_client-reference-manifest.js +1 -1
  174. package/app/.next/server/app/api/usage/call-logs/[id]/route_client-reference-manifest.js +1 -1
  175. package/app/.next/server/app/api/usage/call-logs/route_client-reference-manifest.js +1 -1
  176. package/app/.next/server/app/api/usage/history/route_client-reference-manifest.js +1 -1
  177. package/app/.next/server/app/api/usage/logs/route_client-reference-manifest.js +1 -1
  178. package/app/.next/server/app/api/usage/proxy-logs/route_client-reference-manifest.js +1 -1
  179. package/app/.next/server/app/api/usage/quota/route_client-reference-manifest.js +1 -1
  180. package/app/.next/server/app/api/usage/request-logs/route_client-reference-manifest.js +1 -1
  181. package/app/.next/server/app/api/v1/api/chat/route_client-reference-manifest.js +1 -1
  182. package/app/.next/server/app/api/v1/audio/speech/route_client-reference-manifest.js +1 -1
  183. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -1
  184. package/app/.next/server/app/api/v1/chat/completions/route_client-reference-manifest.js +1 -1
  185. package/app/.next/server/app/api/v1/completions/route_client-reference-manifest.js +1 -1
  186. package/app/.next/server/app/api/v1/embeddings/route_client-reference-manifest.js +1 -1
  187. package/app/.next/server/app/api/v1/images/generations/route_client-reference-manifest.js +1 -1
  188. package/app/.next/server/app/api/v1/messages/count_tokens/route_client-reference-manifest.js +1 -1
  189. package/app/.next/server/app/api/v1/messages/route_client-reference-manifest.js +1 -1
  190. package/app/.next/server/app/api/v1/models/route_client-reference-manifest.js +1 -1
  191. package/app/.next/server/app/api/v1/moderations/route_client-reference-manifest.js +1 -1
  192. package/app/.next/server/app/api/v1/music/generations/route_client-reference-manifest.js +1 -1
  193. package/app/.next/server/app/api/v1/providers/[provider]/chat/completions/route_client-reference-manifest.js +1 -1
  194. package/app/.next/server/app/api/v1/providers/[provider]/embeddings/route_client-reference-manifest.js +1 -1
  195. package/app/.next/server/app/api/v1/providers/[provider]/images/generations/route_client-reference-manifest.js +1 -1
  196. package/app/.next/server/app/api/v1/rerank/route_client-reference-manifest.js +1 -1
  197. package/app/.next/server/app/api/v1/responses/route_client-reference-manifest.js +1 -1
  198. package/app/.next/server/app/api/v1/route_client-reference-manifest.js +1 -1
  199. package/app/.next/server/app/api/v1/videos/generations/route_client-reference-manifest.js +1 -1
  200. package/app/.next/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  201. package/app/.next/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  202. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  203. package/app/.next/server/app/docs/page.js +1 -1
  204. package/app/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  205. package/app/.next/server/app/forbidden/page_client-reference-manifest.js +1 -1
  206. package/app/.next/server/app/forgot-password/page_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  208. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  209. package/app/.next/server/app/maintenance/page_client-reference-manifest.js +1 -1
  210. package/app/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  211. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  212. package/app/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  213. package/app/.next/server/app/status/page_client-reference-manifest.js +1 -1
  214. package/app/.next/server/app/terms/page_client-reference-manifest.js +1 -1
  215. package/app/.next/server/app-paths-manifest.json +53 -53
  216. package/app/.next/server/chunks/1248.js +1 -1
  217. package/app/.next/server/chunks/1526.js +1 -1
  218. package/app/.next/server/chunks/1584.js +1 -1
  219. package/app/.next/server/chunks/1623.js +1 -1
  220. package/app/.next/server/chunks/1880.js +1 -1
  221. package/app/.next/server/chunks/1909.js +1 -1
  222. package/app/.next/server/chunks/1960.js +1 -1
  223. package/app/.next/server/chunks/1990.js +1 -1
  224. package/app/.next/server/chunks/2214.js +1 -1
  225. package/app/.next/server/chunks/2372.js +1 -1
  226. package/app/.next/server/chunks/2594.js +1 -1
  227. package/app/.next/server/chunks/3371.js +1 -1
  228. package/app/.next/server/chunks/3699.js +1 -1
  229. package/app/.next/server/chunks/3911.js +1 -1
  230. package/app/.next/server/chunks/4935.js +1 -1
  231. package/app/.next/server/chunks/496.js +1 -1
  232. package/app/.next/server/chunks/5047.js +1 -1
  233. package/app/.next/server/chunks/5094.js +1 -1
  234. package/app/.next/server/chunks/5097.js +1 -1
  235. package/app/.next/server/chunks/5521.js +1 -1
  236. package/app/.next/server/chunks/5945.js +1 -1
  237. package/app/.next/server/chunks/6118.js +1 -1
  238. package/app/.next/server/chunks/6930.js +1 -1
  239. package/app/.next/server/chunks/7011.js +1 -1
  240. package/app/.next/server/chunks/708.js +1 -1
  241. package/app/.next/server/chunks/7650.js +1 -1
  242. package/app/.next/server/chunks/8158.js +1 -1
  243. package/app/.next/server/chunks/8220.js +1 -1
  244. package/app/.next/server/chunks/8464.js +1 -1
  245. package/app/.next/server/chunks/8706.js +1 -1
  246. package/app/.next/server/chunks/8976.js +1 -1
  247. package/app/.next/server/chunks/9119.js +1 -1
  248. package/app/.next/server/chunks/9342.js +1 -1
  249. package/app/.next/server/chunks/944.js +1 -1
  250. package/app/.next/server/chunks/9631.js +1 -1
  251. package/app/.next/server/chunks/9837.js +1 -1
  252. package/app/.next/server/pages/500.html +2 -2
  253. package/app/.next/server/server-reference-manifest.js +1 -1
  254. package/app/.next/server/server-reference-manifest.json +1 -1
  255. package/app/.next/static/chunks/{5846-56c40f2351d4d1dc.js → 5846-7237f07660b67a4b.js} +1 -1
  256. package/app/.next/static/chunks/app/(dashboard)/dashboard/auto-combo/page-799e2f96e9af3fd9.js +1 -0
  257. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-aab023f14c6ff966.js +1 -0
  258. package/app/package.json +1 -1
  259. package/app/src/mitm/cert/generate.js +73 -0
  260. package/app/src/mitm/cert/install.js +137 -0
  261. package/app/src/mitm/dns/dnsConfig.js +118 -0
  262. package/app/src/mitm/manager.js +229 -0
  263. package/app/src/mitm/server.js +265 -0
  264. package/package.json +1 -1
  265. package/app/.next/static/chunks/app/(dashboard)/dashboard/auto-combo/page-851063ded34ab7a6.js +0 -1
  266. package/app/.next/static/chunks/app/(dashboard)/dashboard/settings/pricing/page-d23e0e2c39ee0e0f.js +0 -1
  267. /package/app/.next/static/{BVNxmHsI7LQYBdU_fXC34 → DJl2bxmaQkEJjPXC10cm7}/_buildManifest.js +0 -0
  268. /package/app/.next/static/{BVNxmHsI7LQYBdU_fXC34 → DJl2bxmaQkEJjPXC10cm7}/_ssgManifest.js +0 -0
@@ -0,0 +1,265 @@
1
+ const https = require("https");
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const dns = require("dns");
5
+ const { promisify } = require("util");
6
+ const os = require("os");
7
+ // Resolve data directory — mirrors src/lib/dataPaths.ts logic.
8
+ // This file runs as a standalone CommonJS process and cannot import the ES module.
9
+ function getDataDir() {
10
+ if (process.env.DATA_DIR)
11
+ return path.resolve(process.env.DATA_DIR.trim());
12
+ return path.join(os.homedir(), ".omniroute");
13
+ }
14
+ // Configuration
15
+ const TARGET_HOST = "daily-cloudcode-pa.googleapis.com";
16
+ const LOCAL_PORT = 443;
17
+ const ROUTER_URL = "http://localhost:20128/v1/chat/completions";
18
+ const API_KEY = process.env.ROUTER_API_KEY;
19
+ const DATA_DIR = getDataDir();
20
+ const DB_FILE = path.join(DATA_DIR, "db.json");
21
+ const SQLITE_FILE = path.join(DATA_DIR, "storage.sqlite");
22
+ let _sqliteDb = null;
23
+ // Toggle logging (set true to enable file logging for debugging)
24
+ const ENABLE_FILE_LOG = false;
25
+ if (!API_KEY) {
26
+ console.error("❌ ROUTER_API_KEY required");
27
+ process.exit(1);
28
+ }
29
+ // Load SSL certificates
30
+ const certDir = path.join(DATA_DIR, "mitm");
31
+ const sslOptions = {
32
+ key: fs.readFileSync(path.join(certDir, "server.key")),
33
+ cert: fs.readFileSync(path.join(certDir, "server.crt")),
34
+ };
35
+ // Chat endpoints that should be intercepted
36
+ const CHAT_URL_PATTERNS = [":generateContent", ":streamGenerateContent"];
37
+ // Log directory for request/response dumps
38
+ const LOG_DIR = path.join(__dirname, "../../logs/mitm");
39
+ if (ENABLE_FILE_LOG && !fs.existsSync(LOG_DIR))
40
+ fs.mkdirSync(LOG_DIR, { recursive: true });
41
+ // Safe log filename: only alphanumeric + hyphens, anchored inside LOG_DIR
42
+ function safeLogPath(name) {
43
+ const safe = name.replace(/[^a-zA-Z0-9_\-]/g, "_").substring(0, 80);
44
+ const resolved = path.resolve(LOG_DIR, safe);
45
+ if (!resolved.startsWith(path.resolve(LOG_DIR) + path.sep)) {
46
+ throw new Error("Path traversal attempt detected in log filename");
47
+ }
48
+ return resolved;
49
+ }
50
+ function saveRequestLog(url, bodyBuffer) {
51
+ if (!ENABLE_FILE_LOG)
52
+ return;
53
+ try {
54
+ const ts = new Date().toISOString().replace(/[:.]/g, "-");
55
+ const urlSlug = url.replace(/[^a-zA-Z0-9]/g, "_").substring(0, 60);
56
+ const filePath = safeLogPath(`${ts}_${urlSlug}.json`);
57
+ const body = JSON.parse(bodyBuffer.toString());
58
+ fs.writeFileSync(filePath, JSON.stringify(body, null, 2));
59
+ console.log(`💾 Saved request: ${filePath}`);
60
+ }
61
+ catch {
62
+ // Ignore
63
+ }
64
+ }
65
+ function saveResponseLog(url, data) {
66
+ if (!ENABLE_FILE_LOG)
67
+ return;
68
+ try {
69
+ const ts = new Date().toISOString().replace(/[:.]/g, "-");
70
+ const urlSlug = url.replace(/[^a-zA-Z0-9]/g, "_").substring(0, 60);
71
+ const filePath = safeLogPath(`${ts}_${urlSlug}_response.txt`);
72
+ fs.writeFileSync(filePath, data);
73
+ console.log(`💾 Saved response: ${filePath}`);
74
+ }
75
+ catch {
76
+ // Ignore
77
+ }
78
+ }
79
+ // Resolve real IP of target host (bypass /etc/hosts)
80
+ let cachedTargetIP = null;
81
+ async function resolveTargetIP() {
82
+ if (cachedTargetIP)
83
+ return cachedTargetIP;
84
+ const resolver = new dns.Resolver();
85
+ resolver.setServers(["8.8.8.8"]);
86
+ const resolve4 = promisify(resolver.resolve4.bind(resolver));
87
+ const addresses = await resolve4(TARGET_HOST);
88
+ cachedTargetIP = addresses[0];
89
+ return cachedTargetIP;
90
+ }
91
+ function collectBodyRaw(req) {
92
+ return new Promise((resolve, reject) => {
93
+ const chunks = [];
94
+ req.on("data", (chunk) => chunks.push(chunk));
95
+ req.on("end", () => resolve(Buffer.concat(chunks)));
96
+ req.on("error", reject);
97
+ });
98
+ }
99
+ function extractModel(body) {
100
+ try {
101
+ return JSON.parse(body.toString()).model || null;
102
+ }
103
+ catch {
104
+ return null;
105
+ }
106
+ }
107
+ /**
108
+ * Get a lazy SQLite connection for reading MITM aliases.
109
+ * Falls back to null if better-sqlite3 is unavailable.
110
+ */
111
+ function getSqliteDb() {
112
+ if (_sqliteDb)
113
+ return _sqliteDb;
114
+ try {
115
+ const Database = require("better-sqlite3");
116
+ if (fs.existsSync(SQLITE_FILE)) {
117
+ _sqliteDb = new Database(SQLITE_FILE, { readonly: true });
118
+ return _sqliteDb;
119
+ }
120
+ }
121
+ catch {
122
+ // better-sqlite3 not available in this process
123
+ }
124
+ return null;
125
+ }
126
+ function getMappedModel(model) {
127
+ if (!model)
128
+ return null;
129
+ // Primary: read from SQLite key_value table
130
+ try {
131
+ const db = getSqliteDb();
132
+ if (db) {
133
+ const row = db
134
+ .prepare("SELECT value FROM key_value WHERE namespace = 'mitmAlias' AND key = 'antigravity'")
135
+ .get();
136
+ if (row) {
137
+ const mappings = JSON.parse(row.value);
138
+ return mappings[model] || null;
139
+ }
140
+ }
141
+ }
142
+ catch {
143
+ // Fall through to JSON fallback
144
+ }
145
+ // Fallback: read from db.json (legacy installs not yet migrated)
146
+ try {
147
+ if (fs.existsSync(DB_FILE)) {
148
+ const db = JSON.parse(fs.readFileSync(DB_FILE, "utf-8"));
149
+ return db.mitmAlias?.antigravity?.[model] || null;
150
+ }
151
+ }
152
+ catch {
153
+ // Ignore
154
+ }
155
+ return null;
156
+ }
157
+ async function passthrough(req, res, bodyBuffer) {
158
+ const targetIP = await resolveTargetIP();
159
+ // TLS validation is enabled by default. Set MITM_DISABLE_TLS_VERIFY=1 only
160
+ // in controlled local environments where the target uses a self-signed cert.
161
+ const rejectUnauthorized = process.env.MITM_DISABLE_TLS_VERIFY !== "1";
162
+ const forwardReq = https.request({
163
+ hostname: targetIP,
164
+ port: 443,
165
+ path: req.url,
166
+ method: req.method,
167
+ headers: { ...req.headers, host: TARGET_HOST },
168
+ servername: TARGET_HOST,
169
+ rejectUnauthorized,
170
+ }, (forwardRes) => {
171
+ res.writeHead(forwardRes.statusCode, forwardRes.headers);
172
+ forwardRes.pipe(res);
173
+ });
174
+ forwardReq.on("error", (err) => {
175
+ console.error(`❌ Passthrough error: ${err.message}`);
176
+ if (!res.headersSent)
177
+ res.writeHead(502);
178
+ res.end("Bad Gateway");
179
+ });
180
+ if (bodyBuffer.length > 0)
181
+ forwardReq.write(bodyBuffer);
182
+ forwardReq.end();
183
+ }
184
+ async function intercept(req, res, bodyBuffer, mappedModel) {
185
+ try {
186
+ const body = JSON.parse(bodyBuffer.toString());
187
+ body.model = mappedModel;
188
+ const response = await fetch(ROUTER_URL, {
189
+ method: "POST",
190
+ headers: {
191
+ "Content-Type": "application/json",
192
+ Authorization: `Bearer ${API_KEY}`,
193
+ },
194
+ body: JSON.stringify(body),
195
+ });
196
+ if (!response.ok) {
197
+ const errText = await response.text().catch(() => "");
198
+ throw new Error(`OmniRoute ${response.status}: ${errText}`);
199
+ }
200
+ res.writeHead(200, {
201
+ "Content-Type": "text/event-stream",
202
+ "Cache-Control": "no-cache",
203
+ Connection: "keep-alive",
204
+ "X-Accel-Buffering": "no",
205
+ });
206
+ const reader = response.body.getReader();
207
+ const decoder = new TextDecoder();
208
+ while (true) {
209
+ const { done, value } = await reader.read();
210
+ if (done) {
211
+ res.end();
212
+ break;
213
+ }
214
+ res.write(decoder.decode(value, { stream: true }));
215
+ }
216
+ }
217
+ catch (error) {
218
+ console.error(`❌ ${error.message}`);
219
+ if (!res.headersSent)
220
+ res.writeHead(500, { "Content-Type": "application/json" });
221
+ res.end(JSON.stringify({ error: { message: error.message, type: "mitm_error" } }));
222
+ }
223
+ }
224
+ const server = https.createServer(sslOptions, async (req, res) => {
225
+ const bodyBuffer = await collectBodyRaw(req);
226
+ // Save request log if enabled
227
+ if (bodyBuffer.length > 0)
228
+ saveRequestLog(req.url, bodyBuffer);
229
+ // Anti-loop: requests from OmniRoute bypass interception
230
+ if (req.headers["x-omniroute-source"] === "omniroute") {
231
+ return passthrough(req, res, bodyBuffer);
232
+ }
233
+ const isChatRequest = CHAT_URL_PATTERNS.some((p) => req.url.includes(p));
234
+ if (!isChatRequest) {
235
+ return passthrough(req, res, bodyBuffer);
236
+ }
237
+ const model = extractModel(bodyBuffer);
238
+ const mappedModel = getMappedModel(model);
239
+ if (!mappedModel) {
240
+ return passthrough(req, res, bodyBuffer);
241
+ }
242
+ console.log(`🔀 ${model} → ${mappedModel}`);
243
+ return intercept(req, res, bodyBuffer, mappedModel);
244
+ });
245
+ server.listen(LOCAL_PORT, () => {
246
+ console.log(`🚀 MITM ready on :${LOCAL_PORT} → ${ROUTER_URL}`);
247
+ });
248
+ server.on("error", (error) => {
249
+ if (error.code === "EADDRINUSE") {
250
+ console.error(`❌ Port ${LOCAL_PORT} already in use`);
251
+ }
252
+ else if (error.code === "EACCES") {
253
+ console.error(`❌ Permission denied for port ${LOCAL_PORT}`);
254
+ }
255
+ else {
256
+ console.error(`❌ ${error.message}`);
257
+ }
258
+ process.exit(1);
259
+ });
260
+ process.on("SIGTERM", () => {
261
+ server.close(() => process.exit(0));
262
+ });
263
+ process.on("SIGINT", () => {
264
+ server.close(() => process.exit(0));
265
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omniroute",
3
- "version": "2.3.13",
3
+ "version": "2.3.15",
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 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7234],{21262:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>l});var t=a(95155),r=a(12115);function l(){let[e,s]=(0,r.useState)([]),[a,l]=(0,r.useState)([]),[i,d]=(0,r.useState)(!1),[o,n]=(0,r.useState)("ship-fast"),c=(0,r.useCallback)(async()=>{try{let[e,a]=await Promise.allSettled([fetch("/api/combos/auto"),fetch("/api/monitoring/health")]);if("fulfilled"===e.status){let a=await e.value.json(),t=(Array.isArray(a?.combos)?a.combos:[])[0]||null,r=Array.isArray(t?.candidatePool)?t.candidatePool.filter(e=>"string"==typeof e):[],l=t?.weights&&"object"==typeof t.weights&&!Array.isArray(t.weights)?t.weights:{},i=Object.fromEntries(Object.entries(l).map(([e,s])=>[e,"number"==typeof s?s:0])),d=r.length>0?1/r.length:0;s(r.map(e=>({provider:e,model:"auto",score:d,factors:i})))}else s([]);if("fulfilled"===a.status){let e=await a.value.json(),s=e?.providerHealth&&"object"==typeof e.providerHealth?e.providerHealth:{},t=Object.entries(s).map(([e,s])=>({provider:e,state:s?.state||"CLOSED",lastFailure:s?.lastFailure||null})),r=Array.isArray(e?.circuitBreakers)?e.circuitBreakers:[],i=r.length>0?r.map(e=>({provider:e.provider||e.name||"unknown",state:e.state||"CLOSED",lastFailure:e.lastFailure||null})):t,o=i.filter(e=>"OPEN"===e.state);d(o.length/Math.max(i.length,1)>.5),l(o.map(e=>({provider:e.provider,excludedAt:e.lastFailure||new Date().toISOString(),cooldownMs:3e5,reason:"Circuit breaker OPEN"})))}else d(!1),l([])}catch{}},[]);(0,r.useEffect)(()=>{let e=setTimeout(c,0),s=setInterval(c,3e4);return()=>{clearTimeout(e),clearInterval(s)}},[c]);let m={quota:"\uD83D\uDCCA Quota",health:"\uD83D\uDC9A Health",costInv:"\uD83D\uDCB0 Cost",latencyInv:"⚡ Latency",taskFit:"\uD83C\uDFAF Task Fit",stability:"\uD83D\uDCC8 Stability"},x=[{id:"ship-fast",label:"\uD83D\uDE80 Ship Fast"},{id:"cost-saver",label:"\uD83D\uDCB0 Cost Saver"},{id:"quality-first",label:"\uD83C\uDFAF Quality First"},{id:"offline-friendly",label:"\uD83D\uDCE1 Offline Friendly"}];return(0,t.jsxs)("div",{className:"p-6 max-w-7xl mx-auto",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"⚡ Auto-Combo Engine"}),(0,t.jsxs)("div",{className:"flex gap-4 mb-6",children:[(0,t.jsx)("div",{className:`px-3 py-2 rounded-lg text-sm font-medium ${i?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300":"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"}`,children:i?"\uD83D\uDEA8 INCIDENT MODE":"✅ Normal"}),(0,t.jsxs)("div",{className:"px-3 py-2 bg-blue-100 dark:bg-blue-900/30 rounded-lg text-sm",children:["Mode: ",(0,t.jsx)("strong",{children:x.find(e=>e.id===o)?.label||o})]})]}),(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"\uD83C\uDF9Bī¸ Mode Pack"}),(0,t.jsx)("div",{className:"flex gap-2",children:x.map(e=>(0,t.jsx)("button",{onClick:()=>n(e.id),className:`px-4 py-2 rounded-lg text-sm transition-colors ${o===e.id?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:e.label},e.id))})]}),(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"\uD83D\uDCCA Provider Scores"}),0===e.length?(0,t.jsxs)("p",{className:"text-gray-500",children:["No auto-combo configured. Create one via ",(0,t.jsx)("code",{children:"POST /api/combos/auto"}),"."]}):(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>(0,t.jsxs)("div",{className:"p-3 bg-white dark:bg-gray-800 rounded-lg border",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsxs)("span",{className:"font-medium",children:[e.provider," / ",e.model]}),(0,t.jsxs)("span",{className:"font-bold text-lg",children:[(100*e.score).toFixed(0),"%"]})]}),(0,t.jsx)("div",{className:"h-2 bg-gray-200 dark:bg-gray-700 rounded overflow-hidden mb-2",children:(0,t.jsx)("div",{className:"h-full bg-blue-500 rounded",style:{width:`${100*e.score}%`}})}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 text-xs text-gray-500",children:Object.entries(e.factors||{}).map(([e,s])=>(0,t.jsxs)("span",{children:[m[e]||e,": ",(100*s).toFixed(0),"%"]},e))})]},e.provider))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"\uD83D\uDEAB Excluded Providers"}),0===a.length?(0,t.jsx)("p",{className:"text-gray-500",children:"No providers currently excluded."}):(0,t.jsx)("div",{className:"space-y-2",children:a.map(e=>(0,t.jsxs)("div",{className:"p-3 bg-red-50 dark:bg-red-900/10 rounded border border-red-200 dark:border-red-800",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{className:"font-medium text-red-700 dark:text-red-400",children:e.provider}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["Cooldown: ",Math.round(e.cooldownMs/6e4),"min"]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:e.reason})]},e.provider))})]})]})}},66135:(e,s,a)=>{Promise.resolve().then(a.bind(a,21262))}},e=>{e.O(0,[8441,3794,7358],()=>e(e.s=66135)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[410],{50910:(e,t,c)=>{"use strict";c.d(t,{c:()=>i});var a=c(33418);function n(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let i=n(0,a.c3);n(0,a.kc)},67040:(e,t,c)=>{"use strict";function a(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}c.d(t,{cn:()=>a})},73321:(e,t,c)=>{"use strict";var a=c(74645);c.o(a,"useParams")&&c.d(t,{useParams:function(){return a.useParams}}),c.o(a,"usePathname")&&c.d(t,{usePathname:function(){return a.usePathname}}),c.o(a,"useRouter")&&c.d(t,{useRouter:function(){return a.useRouter}}),c.o(a,"useSearchParams")&&c.d(t,{useSearchParams:function(){return a.useSearchParams}})},81060:(e,t,c)=>{"use strict";c.d(t,{default:()=>i});var a=c(95155),n=c(67040);function i({children:e,title:t,subtitle:c,icon:i,action:o,padding:r="md",hover:s=!1,className:u,...d}){return(0,a.jsxs)("div",{className:(0,n.cn)("bg-surface","border border-black/5 dark:border-white/5","rounded-lg shadow-sm",s&&"hover:shadow-md hover:border-primary/30 transition-all cursor-pointer",{none:"",xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8"}[r],u),...d,children:[(t||o)&&(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,a.jsx)("div",{className:"p-2 rounded-lg bg-bg text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i})}),(0,a.jsxs)("div",{children:[t&&(0,a.jsx)("h3",{className:"text-text-main font-semibold",children:t}),c&&(0,a.jsx)("p",{className:"text-sm text-text-muted",children:c})]})]}),o]}),e]})}i.Section=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-4 rounded-lg","bg-black/[0.02] dark:bg-white/[0.02]","border border-black/5 dark:border-white/5",t),...c,children:e})},i.Row=function({children:e,className:t,...c}){return(0,a.jsx)("div",{className:(0,n.cn)("p-3 -mx-3 px-3 transition-colors","border-b border-black/5 dark:border-white/5 last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]",t),...c,children:e})},i.ListItem=function({children:e,actions:t,className:c,...i}){return(0,a.jsxs)("div",{className:(0,n.cn)("group flex items-center justify-between p-3 -mx-3 px-3","border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0","hover:bg-black/[0.02] dark:hover:bg-white/[0.02]","transition-colors",c),...i,children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:e}),t&&(0,a.jsx)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:t})]})}},85109:(e,t,c)=>{Promise.resolve().then(c.bind(c,95204))},95204:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>d});var a=c(95155),n=c(12115),i=c(73321),o=c(81060);let r={cc:{"claude-opus-4-5-20251101":{input:15,output:75,cached:7.5,reasoning:75,cache_creation:15},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4-5-20251001":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}},cx:{"gpt-5.2-codex":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.2":{input:5,output:20,cached:2.5,reasoning:30,cache_creation:5},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5-codex":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-codex-mini":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},gc:{"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},qw:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-next":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},if:{"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"deepseek-r1":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-v3.2-chat":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"deepseek-v3.2-reasoner":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"deepseek-3.1":{input:.27,output:1.1,cached:.07,reasoning:2.2,cache_creation:.27},"deepseek-3.2":{input:.27,output:1.1,cached:.07,reasoning:2.2,cache_creation:.27},"minimax-m2":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},ag:{"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},gh:{"gpt-5":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gpt-5-mini":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"gpt-5.1-codex":{input:4,output:16,cached:2,reasoning:24,cache_creation:4},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"claude-4.5-sonnet":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-4.5-opus":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-4.5-haiku":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"gemini-3-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},openai:{"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},anthropic:{"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:75,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3}},gemini:{"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},openrouter:{auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},glm:{"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},kimi:{"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},minimax:{"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},groq:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b-versatile":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen/qwen3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},blackbox:{"gpt-4o":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gemini-2.5-flash":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"claude-sonnet-4":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-v3":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},blackboxai:{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"blackboxai-pro":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},fireworks:{"accounts/fireworks/models/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/deepseek-v3p1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/llama-v3p3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"accounts/fireworks/models/qwen3-235b-a22b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},cerebras:{"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-glm-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-3.3-70b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"llama-4-scout-17b-16e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-235b-a22b-instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"qwen-3-32b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nvidia:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/kimi-k2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"z-ai/glm4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/deepseek-v3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"nvidia/llama-3.3-70b-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta/llama-4-maverick-17b-128e-instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek/deepseek-r1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},nebius:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},siliconflow:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.2":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3.1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-235B-A22B-Instruct-2507":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen3-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"moonshotai/Kimi-K2.5":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"zai-org/GLM-4.7":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"baidu/ERNIE-4.5-300B-A47B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},hyperbolic:{"openai/gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"gpt-oss-120b":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/QwQ-32B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-R1":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"deepseek-ai/DeepSeek-V3":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.3-70B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"meta-llama/Llama-3.2-3B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-72B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"Qwen/Qwen2.5-Coder-32B-Instruct":{input:0,output:0,cached:0,reasoning:0,cache_creation:0},"NousResearch/Hermes-3-Llama-3.1-70B":{input:0,output:0,cached:0,reasoning:0,cache_creation:0}},kiro:{"claude-sonnet-4.5":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.25,reasoning:2.5,cache_creation:.5}}};function s({isOpen:e,onClose:t,onSave:c}){let[i,o]=(0,n.useState)({}),[s,u]=(0,n.useState)(!0),[d,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&h()},[e]);let h=async()=>{u(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();o(t)}else o(r)}catch(e){console.error("Failed to load pricing:",e),o(r)}finally{u(!1)}},l=async()=>{p(!0);try{let e=await fetch("/api/pricing",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.ok)c?.(),t();else{let t=await e.json();alert(`Failed to save pricing: ${t.error}`)}}catch(e){console.error("Failed to save pricing:",e),alert("Failed to save pricing")}finally{p(!1)}},g=async()=>{if(confirm("Reset all pricing to defaults? This cannot be undone."))try{(await fetch("/api/pricing",{method:"DELETE"})).ok&&o(r)}catch(e){console.error("Failed to reset pricing:",e),alert("Failed to reset pricing")}};if(!e)return null;let m=Object.keys(i).sort(),x=["input","output","cached","reasoning","cache_creation"];return(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,a.jsxs)("div",{className:"bg-bg-base border border-border rounded-lg shadow-xl max-w-6xl w-full max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:"Pricing Configuration"}),(0,a.jsx)("button",{onClick:t,className:"text-text-muted hover:text-text text-2xl leading-none",children:"\xd7"})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-4",children:s?(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"Loading pricing data..."}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"bg-bg-subtle border border-border rounded-lg p-3 text-sm",children:[(0,a.jsx)("p",{className:"font-medium mb-1",children:"Pricing Rates Format"}),(0,a.jsxs)("p",{className:"text-text-muted",children:["All rates are in ",(0,a.jsx)("strong",{children:"dollars per million tokens"})," ($/1M tokens). Example: Input rate of 2.50 means $2.50 per 1,000,000 input tokens."]})]}),m.map(e=>{let t=Object.keys(i[e]).sort();return(0,a.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"bg-bg-subtle px-4 py-2 font-semibold text-sm",children:e.toUpperCase()}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-bg-hover text-text-muted uppercase text-xs",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Model"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Input"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Output"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cached"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Reasoning"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Cache Creation"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-border",children:t.map(t=>(0,a.jsxs)("tr",{className:"hover:bg-bg-subtle/50",children:[(0,a.jsx)("td",{className:"px-3 py-2 font-medium",children:t}),x.map(c=>(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("input",{type:"number",step:"0.01",min:"0",value:i[e][t][c]||0,onChange:a=>{let n;!isNaN(n=parseFloat(a.target.value))&&!(n<0)&&o(a=>{let i={...a};return i[e]||(i[e]={}),i[e][t]||(i[e][t]={}),i[e][t][c]=n,i})},className:"w-20 px-2 py-1 text-right bg-bg-base border border-border rounded focus:outline-none focus:border-primary"})},c))]},t))})]})})]},e)}),0===m.length&&(0,a.jsx)("div",{className:"text-center py-8 text-text-muted",children:"No pricing data available"})]})}),(0,a.jsxs)("div",{className:"p-4 border-t border-border flex items-center justify-between gap-2",children:[(0,a.jsx)("button",{onClick:g,className:"px-4 py-2 text-sm text-red-500 hover:bg-red-500/10 rounded border border-red-500/20 transition-colors",disabled:d,children:"Reset to Defaults"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:t,className:"px-4 py-2 text-sm text-text-muted hover:text-text border border-border rounded transition-colors",disabled:d,children:"Cancel"}),(0,a.jsx)("button",{onClick:l,className:"px-4 py-2 text-sm bg-primary text-white rounded hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:d,children:d?"Saving...":"Save Changes"})]})]})]})})}var u=c(50910);function d(){(0,i.useRouter)();let[e,t]=(0,n.useState)(!1),[c,r]=(0,n.useState)(null),[d,p]=(0,n.useState)(!0),h=(0,u.c)("settings");(0,n.useEffect)(()=>{l()},[]);let l=async()=>{p(!0);try{let e=await fetch("/api/pricing");if(e.ok){let t=await e.json();r(t)}}catch(e){console.error("Failed to load pricing:",e)}finally{p(!1)}};return(0,a.jsxs)("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold",children:h("pricingSettingsTitle")}),(0,a.jsx)("p",{className:"text-text-muted mt-1",children:h("modelPricingDesc")})]}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"px-4 py-2 bg-primary text-white rounded hover:bg-primary/90 transition-colors",children:h("editPricing")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)(o.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:h("totalModels")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(()=>{if(!c)return 0;let e=0;for(let t in c)e+=Object.keys(c[t]).length;return e})()})]}),(0,a.jsxs)(o.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:h("providers")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1",children:d?"...":(!c?[]:Object.keys(c).sort()).length})]}),(0,a.jsxs)(o.default,{className:"p-4",children:[(0,a.jsx)("div",{className:"text-text-muted text-sm uppercase font-semibold",children:h("status")}),(0,a.jsx)("div",{className:"text-2xl font-bold mt-1 text-success",children:d?"...":h("active")})]})]}),(0,a.jsxs)(o.default,{className:"p-6",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold mb-4",children:h("howPricingWorks")}),(0,a.jsxs)("div",{className:"space-y-3 text-sm text-text-muted",children:[(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[h("costCalculation"),":"]})," ",h("costCalculationDesc")]}),(0,a.jsxs)("p",{children:[(0,a.jsxs)("strong",{children:[h("pricingFormat"),":"]})," ",h("pricingFormatDesc")]}),(0,a.jsx)("p",{children:(0,a.jsxs)("strong",{children:[h("tokenTypes"),":"]})}),(0,a.jsxs)("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[h("input"),":"]})," ",h("inputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[h("output"),":"]})," ",h("outputTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[h("cached"),":"]})," ",h("cachedTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[h("reasoning"),":"]})," ",h("reasoningTokenDesc")]}),(0,a.jsxs)("li",{children:[(0,a.jsxs)("strong",{children:[h("cacheCreation"),":"]})," ",h("cacheCreationTokenDesc")]})]}),(0,a.jsx)("p",{children:h("customPricingNote")})]})]}),(0,a.jsxs)(o.default,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:h("currentPricing")}),(0,a.jsx)("button",{onClick:()=>t(!0),className:"text-primary hover:underline text-sm",children:h("viewFullDetails")})]}),d?(0,a.jsx)("div",{className:"text-center py-4 text-text-muted",children:h("loadingPricing")}):c?(0,a.jsxs)("div",{className:"space-y-3",children:[Object.keys(c).slice(0,5).map(e=>(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsxs)("span",{className:"font-semibold",children:[e.toUpperCase(),":"]})," ",(0,a.jsxs)("span",{className:"text-text-muted",children:[Object.keys(c[e]).length," ",h("models")]})]},e)),Object.keys(c).length>5&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["+ ",h("moreProviders",{count:Object.keys(c).length-5})]})]}):(0,a.jsx)("div",{className:"text-text-muted",children:h("noPricing")})]}),e&&(0,a.jsx)(s,{isOpen:e,onClose:()=>t(!1),onSave:()=>{l()}})]})}}},e=>{e.O(0,[3418,8441,3794,7358],()=>e(e.s=85109)),_N_E=e.O()}]);