@hilbras/omnihilbras 2.0.0 → 2.1.0

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 (486) hide show
  1. package/README.md +14 -14
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +18 -18
  4. package/app/.next-cli-build/build-manifest.json +3 -3
  5. package/app/.next-cli-build/prerender-manifest.json +17 -17
  6. package/app/.next-cli-build/react-loadable-manifest.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +12 -12
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  87. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  88. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  89. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  90. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  301. package/app/.next-cli-build/server/app/callback.html +1 -1
  302. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  303. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  304. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  305. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  306. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +23 -21
  308. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +25 -23
  309. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +23 -21
  310. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  311. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +26 -24
  313. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +27 -25
  314. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +26 -24
  315. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  316. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/combos.rsc +27 -25
  318. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +29 -27
  319. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +27 -25
  320. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +25 -23
  323. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +26 -24
  324. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +25 -23
  325. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  326. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +27 -25
  328. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +29 -27
  329. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +27 -25
  330. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  331. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +25 -23
  333. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +27 -25
  334. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +25 -23
  335. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  336. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/profile.rsc +26 -24
  338. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +28 -26
  339. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +26 -24
  340. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  341. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +27 -25
  343. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +29 -27
  344. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +27 -25
  345. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  346. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/providers.rsc +26 -24
  348. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +28 -26
  349. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +26 -24
  350. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  351. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +26 -24
  353. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +28 -26
  354. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +26 -24
  355. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  356. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +26 -24
  358. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +28 -26
  359. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +26 -24
  360. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  361. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/quota.rsc +24 -22
  363. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +26 -24
  364. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +24 -22
  365. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  366. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  370. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  371. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  372. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  373. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  374. package/app/.next-cli-build/server/app/dashboard/skills.rsc +26 -24
  375. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +28 -26
  376. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +26 -24
  377. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  379. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +23 -21
  380. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +25 -23
  381. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +23 -21
  382. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  384. package/app/.next-cli-build/server/app/dashboard/translator.rsc +26 -24
  385. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +28 -26
  386. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +26 -24
  387. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  388. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/usage.rsc +27 -25
  390. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +29 -27
  391. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +27 -25
  392. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  393. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  394. package/app/.next-cli-build/server/app/dashboard.rsc +24 -22
  395. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +24 -22
  396. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +24 -22
  397. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  398. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/index.html +1 -1
  400. package/app/.next-cli-build/server/app/index.rsc +3 -3
  401. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  402. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  403. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  404. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  406. package/app/.next-cli-build/server/app/landing.html +1 -1
  407. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  408. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  409. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  410. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  411. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  413. package/app/.next-cli-build/server/app/login.html +1 -1
  414. package/app/.next-cli-build/server/app/login.rsc +3 -3
  415. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  416. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  417. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  418. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  420. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  421. package/app/.next-cli-build/server/app-paths-manifest.json +18 -18
  422. package/app/.next-cli-build/server/chunks/1019.js +1 -1
  423. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  424. package/app/.next-cli-build/server/chunks/3276.js +3 -3
  425. package/app/.next-cli-build/server/chunks/3799.js +1 -1
  426. package/app/.next-cli-build/server/chunks/4043.js +1 -1
  427. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  428. package/app/.next-cli-build/server/chunks/4199.js +1 -1
  429. package/app/.next-cli-build/server/chunks/436.js +1 -1
  430. package/app/.next-cli-build/server/chunks/4663.js +1 -1
  431. package/app/.next-cli-build/server/chunks/5036.js +1 -0
  432. package/app/.next-cli-build/server/chunks/5245.js +1 -1
  433. package/app/.next-cli-build/server/chunks/5330.js +2 -2
  434. package/app/.next-cli-build/server/chunks/7525.js +1 -1
  435. package/app/.next-cli-build/server/chunks/7557.js +1 -1
  436. package/app/.next-cli-build/server/chunks/827.js +1 -1
  437. package/app/.next-cli-build/server/chunks/8499.js +2 -2
  438. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  439. package/app/.next-cli-build/server/chunks/9100.js +2 -2
  440. package/app/.next-cli-build/server/chunks/915.js +2 -2
  441. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  442. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  444. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  445. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  446. package/app/.next-cli-build/server/pages/404.html +1 -1
  447. package/app/.next-cli-build/server/pages/500.html +1 -1
  448. package/app/.next-cli-build/static/chunks/{761-2556f561563ff774.js → 761-7590878484e89ed1.js} +1 -1
  449. package/app/.next-cli-build/static/chunks/7958-b44b343c4ee9f7e0.js +5 -0
  450. package/app/.next-cli-build/static/chunks/{85-614327c9c3f40a7d.js → 85-e9224bc05bb529c8.js} +1 -1
  451. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-4cf42b10bafdba52.js +1 -0
  452. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-82a7e01a2e463ba2.js +1 -0
  453. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/error-c23142e5f5729b5c.js +1 -0
  454. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-7451e45c01e9f365.js → page-de738056c6c3f5e2.js} +12 -12
  455. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-e32ad708ff93ccbb.js +1 -0
  456. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-1e8ce4fa24e2def5.js +1 -0
  457. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-e478c2c7c2491d20.js +1 -0
  458. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-5b432879d2c3afc9.js → page-5bc45ce6d914f906.js} +1 -1
  459. package/app/.next-cli-build/static/chunks/{webpack-13acc920e6f6a68b.js → webpack-b6470f9f7f52f8e5.js} +1 -1
  460. package/app/.next-cli-build/static/css/c478309e956d6de4.css +1 -0
  461. package/app/cli/.build-home/.omnihilbras/db/data.sqlite +0 -0
  462. package/app/custom-server.js +7 -0
  463. package/app/package.json +1 -1
  464. package/app/public/i18n/literals/fa.json +2 -2
  465. package/app/public/i18n/literals/id.json +2 -2
  466. package/app/public/i18n/literals/km.json +2 -2
  467. package/app/public/i18n/literals/th.json +2 -2
  468. package/app/public/i18n/literals/zh-CN.json +2 -2
  469. package/app/src/mitm/server.js +29 -29
  470. package/cli.js +12 -7
  471. package/hooks/postinstall.js +1 -1
  472. package/package.json +1 -1
  473. package/src/cli/api/client.js +1 -1
  474. package/src/cli/commands/connect.js +6 -6
  475. package/src/cli/terminalUI.js +1 -1
  476. package/src/cli/utils/endpoint.js +2 -2
  477. package/app/.next-cli-build/server/chunks/7960.js +0 -1
  478. package/app/.next-cli-build/static/chunks/7958-7e4ad761a83f2a9e.js +0 -5
  479. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-31316583ab546200.js +0 -1
  480. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-decadb6df9e9b417.js +0 -1
  481. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-a1700bfc6ebb2aac.js +0 -1
  482. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-71f0c81cddbab903.js +0 -1
  483. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-2422a9a60e84a259.js +0 -1
  484. package/app/.next-cli-build/static/css/cf553f425046a901.css +0 -1
  485. /package/app/.next-cli-build/static/{fAJh8_GCT173XCQuAE5si → et6N1f81x-mr8bhwUnwYo}/_buildManifest.js +0 -0
  486. /package/app/.next-cli-build/static/{fAJh8_GCT173XCQuAE5si → et6N1f81x-mr8bhwUnwYo}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=8920,exports.ids=[8920],exports.modules={58920:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>g,ad:()=>k,calculateCostFromTokens:()=>l,gH:()=>i,getPricingForModel:()=>j});let d=["cline-free/"],e={input:0,output:0,cached:0,reasoning:0,cache_creation:0},f={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,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},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-5-5-thinking":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-high":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-medium":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-low":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-fable-5":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"claude-sonnet-5-5":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-thinking":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-high":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-medium":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-low":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"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.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5-mini":{input:.25,output:2,cached:.125,reasoning:2,cache_creation:.25},"gpt-5-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.2-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.6":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-luna":{input:1,output:6,cached:.1,reasoning:6,cache_creation:1},"gpt-5.6-terra":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-sol":{input:5,output:30,cached:.5,reasoning:30,cache_creation:5},"gpt-6-astra":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"gpt-6.1-sol":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"gpt-6-sol":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"gpt-6-luna":{input:.1,output:.5,cached:.01,reasoning:.5,cache_creation:.125},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},"gemini-3.8-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.375},"gemini-3.5-flash-high":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"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-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-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"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},"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},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k3":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},k3:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},"kimi-k2.7-code":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-k2.7-code-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"kimi-for-coding":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-for-coding-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"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},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-k2.6":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4.1-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"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},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"muse-spark-1.3":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.2":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.1":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.3-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},"muse-spark-1.2-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{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},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},g={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},tokenrouter:{"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.2},"anthropic/claude-fable-5":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-haiku-4.5":{input:1,output:5,cached:.1,cache_creation:1.25,reasoning:5},"anthropic/claude-opus-4.5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.6":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7-fast":{input:30,output:150,cached:3,reasoning:150},"anthropic/claude-opus-4.8":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.8-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-opus-5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-5-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-sonnet-4":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.5":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.6":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"claude-opus-4-8-m-aws":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"deepseek/deepseek-v3.2":{input:.26,output:.38,cached:.13,reasoning:.38},"deepseek/deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-flash-0731":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87},"ex/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"google/gemini-2.5-flash-image":{input:.3,output:2.5,reasoning:2.5},"google/gemini-3-flash-preview":{input:.5,output:3,cached:.05,cache_creation:.08333,reasoning:3},"google/gemini-3-pro-image-preview":{input:2,output:12,reasoning:12},"google/gemini-3.1-flash-image-preview":{input:.5,output:3,reasoning:3},"google/gemini-3.1-flash-lite-image":{input:.25,output:1.5,reasoning:1.5},"google/gemini-3.1-pro-preview":{input:2,output:12,cached:.2,cache_creation:.375,reasoning:12},"google/gemini-3.5-flash":{input:1.5,output:9,cached:.15,cache_creation:.08333,reasoning:9},"google/gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,cache_creation:.08333,reasoning:2.5},"google/gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,cache_creation:.08333,reasoning:7.5},"google/gemini-embedding-2":{input:1,output:6,cached:.1,reasoning:6},"google/gemma-4-26b-a4b-it":{input:.06,output:.33,reasoning:.33},"kling-3.0-turbo":{input:2.1,output:2.1,reasoning:2.1},"microsoft/mai-image-2.5":{input:5,output:47,reasoning:47},"minimax/minimax-m2-her":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m2.5":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.7":{input:.3,output:1.2,cached:.06,reasoning:1.2},"minimax/minimax-m2.7-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"miromind/mirothinker-1-7-deepresearch":{input:4,output:25,reasoning:25},"miromind/mirothinker-1-7-deepresearch-mini":{input:1.25,output:10,reasoning:10},"mistralai/devstral-2512":{input:.4,output:2,cached:.04,reasoning:2},"mistralai/mistral-medium-3-5":{input:1.5,output:7.5,reasoning:7.5},"mistralai/mistral-small-2603":{input:.15,output:.6,cached:.015,reasoning:.6},"mistralai/voxtral-small-24b-2507":{input:.1,output:.3,cached:.01,reasoning:.3},"moonshotai/kimi-k2.5":{input:.6,output:3,cached:.1,reasoning:3},"moonshotai/kimi-k2.6":{input:.95,output:4,cached:.16,reasoning:4},"moonshotai/kimi-k2.7-code":{input:.9286,output:3.8571,cached:.1857,reasoning:3.8571},"moonshotai/kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"nvidia/nemotron-3-super-120b-a12b":{input:.3,output:.9,cached:.1,reasoning:.9},"openai/gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.6},"openai/gpt-5":{input:1.25,output:10,cached:.125,reasoning:10},"openai/gpt-5-image":{input:10,output:40,cached:2.5,reasoning:40},"openai/gpt-5-image-mini":{input:2.5,output:8,cached:.25,reasoning:8},"openai/gpt-5-mini":{input:.25,output:2,cached:.025,reasoning:2},"openai/gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"openai/gpt-5.4-image-2":{input:8,output:30,cached:2,reasoning:30},"openai/gpt-5.4-mini":{input:.75,output:4.5,cached:.075,reasoning:4.5},"openai/gpt-5.4-nano":{input:.2,output:1.25,cached:.02,reasoning:1.25},"openai/gpt-5.4-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.5":{input:5,output:30,cached:.5,reasoning:30},"openai/gpt-5.5-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.6-luna":{input:.2,output:1.2,cached:.02,cache_creation:.25,reasoning:1.2},"openai/gpt-5.6-sol":{input:5,output:30,cached:.5,cache_creation:6.25,reasoning:30},"openai/gpt-5.6-terra":{input:2,output:12,cached:.2,cache_creation:2.5,reasoning:12},"openai/gpt-audio":{input:2.5,output:10,reasoning:10},"openai/gpt-audio-mini":{input:.6,output:2.4,reasoning:2.4},"openai/gpt-oss-120b":{input:.039,output:.18,reasoning:.18},"qwen/qwen3-coder-next":{input:.12,output:.75,cached:.06,reasoning:.75},"qwen/qwen3.5-122b-a10b":{input:.26,output:2.08,reasoning:2.08},"qwen/qwen3.5-35b-a3b":{input:.1625,output:1.3,reasoning:1.3},"qwen/qwen3.5-397b-a17b":{input:.39,output:2.34,reasoning:2.34},"qwen/qwen3.5-9b":{input:.1,output:.15,reasoning:.15},"qwen/qwen3.5-flash":{input:.1048,output:.4194,reasoning:.4194},"qwen/qwen3.5-plus-02-15":{input:.26,output:1.56,reasoning:1.56},"qwen/qwen3.6-plus":{input:.54,output:3.21,reasoning:3.21},"qwen/qwen3.7-max":{input:1.25,output:3.75,cached:.25,reasoning:3.75},"qwen/qwen3.7-plus":{input:.4,output:1.6,cached:.08,reasoning:1.6},"qwen/qwen3.8-max":{input:2,output:6,cached:.25,cache_creation:2.5,reasoning:6},"qwen3.5-omni-plus":{input:1,output:5.7143,reasoning:5.7143},"qwen3.6-flash":{input:.171,output:1.029,cached:.017,cache_creation:.214,reasoning:1.029},"sakana/fugu-ultra":{input:5,output:30,cached:.5,reasoning:30},"seed-2-0-code-preview-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"seed-2-0-lite-260428":{input:.5,output:4,cached:.1,cache_creation:.008333,reasoning:4},"seed-2-0-mini-260428":{input:.2,output:.8,cached:.04,cache_creation:.00833,reasoning:.8},"seed-2-0-pro-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"stepfun/step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"stepfun/step-3.7-flash":{input:.2,output:1.15,cached:.04,reasoning:1.15},"tencent/hy3-preview":{input:.066,output:.26,cached:.029,reasoning:.26},"x-ai/grok-4.1-fast":{input:.2,output:.5,cached:.05,reasoning:.5},"x-ai/grok-4.20-beta":{input:2,output:6,cached:.2,reasoning:6},"x-ai/grok-4.3":{input:1.25,output:2.5,cached:.2,reasoning:2.5},"x-ai/grok-4.5":{input:2,output:6,cached:.5,reasoning:6},"x-ai/grok-build-0.1":{input:1,output:2,cached:.2,reasoning:2},"xiaomi/mimo-v2-flash":{input:.1,output:.3,cached:.01,reasoning:.3},"xiaomi/mimo-v2-omni":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2-pro":{input:1,output:3,cached:.2,reasoning:3},"xiaomi/mimo-v2.5":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2.5-pro":{input:1,output:3,cached:.2,reasoning:3},"z-ai/glm-4.5-air":{input:.13,output:.85,cached:.025,reasoning:.85},"z-ai/glm-4.6":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-4.6v":{input:.3,output:.9,reasoning:.9},"z-ai/glm-4.7":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"z-ai/glm-5-turbo":{input:1.2,output:4,cached:.24,reasoning:4},"z-ai/glm-5.1":{input:1.05,output:3.5,cached:.525,reasoning:3.5},"z-ai/glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4},"z-ai/glm-5.3-free":{input:0,output:0,cached:0,reasoning:0}}},h=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-none",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.6-*",pricing:{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-5.3-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.2-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.1-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k3*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function i(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function j(a,b){if(!b)return null;if(a&&g[a]?.[b])return g[a][b];if(function(a){if(!a)return!1;let b=String(a).toLowerCase();return d.some(a=>b.startsWith(a))}(b))return e;let c=b.includes("/")?b.split("/").pop():b;if(f[c])return f[c];if(f[b])return f[b];for(let{pattern:a,pricing:d}of h)if(i(a,c)||i(a,b))return d;return null}function k(){return g}function l(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}}};
1
+ "use strict";exports.id=8920,exports.ids=[8920],exports.modules={58920:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>g,calculateCostFromTokens:()=>k,gH:()=>i,getPricingForModel:()=>j});let d=["cline-free/"],e={input:0,output:0,cached:0,reasoning:0,cache_creation:0},f={"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,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},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-5-5-thinking":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-high":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-medium":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-low":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-fable-5":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"claude-sonnet-5-5":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-thinking":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-high":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-medium":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-low":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"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.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5-mini":{input:.25,output:2,cached:.125,reasoning:2,cache_creation:.25},"gpt-5-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.2-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.6":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-luna":{input:1,output:6,cached:.1,reasoning:6,cache_creation:1},"gpt-5.6-terra":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-sol":{input:5,output:30,cached:.5,reasoning:30,cache_creation:5},"gpt-6-astra":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"gpt-6.1-sol":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"gpt-6-sol":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"gpt-6-luna":{input:.1,output:.5,cached:.01,reasoning:.5,cache_creation:.125},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},"gemini-3.8-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.375},"gemini-3.5-flash-high":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"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-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-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"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},"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},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k3":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},k3:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},"kimi-k2.7-code":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-k2.7-code-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"kimi-for-coding":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-for-coding-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"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},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-k2.6":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4.1-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"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},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"muse-spark-1.3":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.2":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.1":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.3-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},"muse-spark-1.2-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{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},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},g={gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},tokenrouter:{"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.2},"anthropic/claude-fable-5":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-haiku-4.5":{input:1,output:5,cached:.1,cache_creation:1.25,reasoning:5},"anthropic/claude-opus-4.5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.6":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7-fast":{input:30,output:150,cached:3,reasoning:150},"anthropic/claude-opus-4.8":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.8-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-opus-5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-5-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-sonnet-4":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.5":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.6":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"claude-opus-4-8-m-aws":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"deepseek/deepseek-v3.2":{input:.26,output:.38,cached:.13,reasoning:.38},"deepseek/deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-flash-0731":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87},"ex/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"google/gemini-2.5-flash-image":{input:.3,output:2.5,reasoning:2.5},"google/gemini-3-flash-preview":{input:.5,output:3,cached:.05,cache_creation:.08333,reasoning:3},"google/gemini-3-pro-image-preview":{input:2,output:12,reasoning:12},"google/gemini-3.1-flash-image-preview":{input:.5,output:3,reasoning:3},"google/gemini-3.1-flash-lite-image":{input:.25,output:1.5,reasoning:1.5},"google/gemini-3.1-pro-preview":{input:2,output:12,cached:.2,cache_creation:.375,reasoning:12},"google/gemini-3.5-flash":{input:1.5,output:9,cached:.15,cache_creation:.08333,reasoning:9},"google/gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,cache_creation:.08333,reasoning:2.5},"google/gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,cache_creation:.08333,reasoning:7.5},"google/gemini-embedding-2":{input:1,output:6,cached:.1,reasoning:6},"google/gemma-4-26b-a4b-it":{input:.06,output:.33,reasoning:.33},"kling-3.0-turbo":{input:2.1,output:2.1,reasoning:2.1},"microsoft/mai-image-2.5":{input:5,output:47,reasoning:47},"minimax/minimax-m2-her":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m2.5":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.7":{input:.3,output:1.2,cached:.06,reasoning:1.2},"minimax/minimax-m2.7-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"miromind/mirothinker-1-7-deepresearch":{input:4,output:25,reasoning:25},"miromind/mirothinker-1-7-deepresearch-mini":{input:1.25,output:10,reasoning:10},"mistralai/devstral-2512":{input:.4,output:2,cached:.04,reasoning:2},"mistralai/mistral-medium-3-5":{input:1.5,output:7.5,reasoning:7.5},"mistralai/mistral-small-2603":{input:.15,output:.6,cached:.015,reasoning:.6},"mistralai/voxtral-small-24b-2507":{input:.1,output:.3,cached:.01,reasoning:.3},"moonshotai/kimi-k2.5":{input:.6,output:3,cached:.1,reasoning:3},"moonshotai/kimi-k2.6":{input:.95,output:4,cached:.16,reasoning:4},"moonshotai/kimi-k2.7-code":{input:.9286,output:3.8571,cached:.1857,reasoning:3.8571},"moonshotai/kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"nvidia/nemotron-3-super-120b-a12b":{input:.3,output:.9,cached:.1,reasoning:.9},"openai/gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.6},"openai/gpt-5":{input:1.25,output:10,cached:.125,reasoning:10},"openai/gpt-5-image":{input:10,output:40,cached:2.5,reasoning:40},"openai/gpt-5-image-mini":{input:2.5,output:8,cached:.25,reasoning:8},"openai/gpt-5-mini":{input:.25,output:2,cached:.025,reasoning:2},"openai/gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"openai/gpt-5.4-image-2":{input:8,output:30,cached:2,reasoning:30},"openai/gpt-5.4-mini":{input:.75,output:4.5,cached:.075,reasoning:4.5},"openai/gpt-5.4-nano":{input:.2,output:1.25,cached:.02,reasoning:1.25},"openai/gpt-5.4-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.5":{input:5,output:30,cached:.5,reasoning:30},"openai/gpt-5.5-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.6-luna":{input:.2,output:1.2,cached:.02,cache_creation:.25,reasoning:1.2},"openai/gpt-5.6-sol":{input:5,output:30,cached:.5,cache_creation:6.25,reasoning:30},"openai/gpt-5.6-terra":{input:2,output:12,cached:.2,cache_creation:2.5,reasoning:12},"openai/gpt-audio":{input:2.5,output:10,reasoning:10},"openai/gpt-audio-mini":{input:.6,output:2.4,reasoning:2.4},"openai/gpt-oss-120b":{input:.039,output:.18,reasoning:.18},"qwen/qwen3-coder-next":{input:.12,output:.75,cached:.06,reasoning:.75},"qwen/qwen3.5-122b-a10b":{input:.26,output:2.08,reasoning:2.08},"qwen/qwen3.5-35b-a3b":{input:.1625,output:1.3,reasoning:1.3},"qwen/qwen3.5-397b-a17b":{input:.39,output:2.34,reasoning:2.34},"qwen/qwen3.5-9b":{input:.1,output:.15,reasoning:.15},"qwen/qwen3.5-flash":{input:.1048,output:.4194,reasoning:.4194},"qwen/qwen3.5-plus-02-15":{input:.26,output:1.56,reasoning:1.56},"qwen/qwen3.6-plus":{input:.54,output:3.21,reasoning:3.21},"qwen/qwen3.7-max":{input:1.25,output:3.75,cached:.25,reasoning:3.75},"qwen/qwen3.7-plus":{input:.4,output:1.6,cached:.08,reasoning:1.6},"qwen/qwen3.8-max":{input:2,output:6,cached:.25,cache_creation:2.5,reasoning:6},"qwen3.5-omni-plus":{input:1,output:5.7143,reasoning:5.7143},"qwen3.6-flash":{input:.171,output:1.029,cached:.017,cache_creation:.214,reasoning:1.029},"sakana/fugu-ultra":{input:5,output:30,cached:.5,reasoning:30},"seed-2-0-code-preview-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"seed-2-0-lite-260428":{input:.5,output:4,cached:.1,cache_creation:.008333,reasoning:4},"seed-2-0-mini-260428":{input:.2,output:.8,cached:.04,cache_creation:.00833,reasoning:.8},"seed-2-0-pro-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"stepfun/step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"stepfun/step-3.7-flash":{input:.2,output:1.15,cached:.04,reasoning:1.15},"tencent/hy3-preview":{input:.066,output:.26,cached:.029,reasoning:.26},"x-ai/grok-4.1-fast":{input:.2,output:.5,cached:.05,reasoning:.5},"x-ai/grok-4.20-beta":{input:2,output:6,cached:.2,reasoning:6},"x-ai/grok-4.3":{input:1.25,output:2.5,cached:.2,reasoning:2.5},"x-ai/grok-4.5":{input:2,output:6,cached:.5,reasoning:6},"x-ai/grok-build-0.1":{input:1,output:2,cached:.2,reasoning:2},"xiaomi/mimo-v2-flash":{input:.1,output:.3,cached:.01,reasoning:.3},"xiaomi/mimo-v2-omni":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2-pro":{input:1,output:3,cached:.2,reasoning:3},"xiaomi/mimo-v2.5":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2.5-pro":{input:1,output:3,cached:.2,reasoning:3},"z-ai/glm-4.5-air":{input:.13,output:.85,cached:.025,reasoning:.85},"z-ai/glm-4.6":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-4.6v":{input:.3,output:.9,reasoning:.9},"z-ai/glm-4.7":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"z-ai/glm-5-turbo":{input:1.2,output:4,cached:.24,reasoning:4},"z-ai/glm-5.1":{input:1.05,output:3.5,cached:.525,reasoning:3.5},"z-ai/glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4},"z-ai/glm-5.3-free":{input:0,output:0,cached:0,reasoning:0}}},h=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-none",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.6-*",pricing:{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-5.3-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.2-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.1-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k3*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function i(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function j(a,b){if(!b)return null;if(a&&g[a]?.[b])return g[a][b];if(function(a){if(!a)return!1;let b=String(a).toLowerCase();return d.some(a=>b.startsWith(a))}(b))return e;let c=b.includes("/")?b.split("/").pop():b;if(f[c])return f[c];if(f[b])return f[b];for(let{pattern:a,pricing:d}of h)if(i(a,c)||i(a,b))return d;return null}function k(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}}};
@@ -10,7 +10,7 @@ exports.id=9100,exports.ids=[9100],exports.modules={644:(a,b,c)=>{"use strict";f
10
10
  VALUES(?, ?, ?, ?, ?, ?)
11
11
  ON CONFLICT(id) DO UPDATE SET
12
12
  isActive=excluded.isActive, testStatus=excluded.testStatus,
13
- data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.isActive,c.testStatus,c.data,c.createdAt,c.updatedAt])}async function n(a={}){let b=await (0,d.c)(),c=[],e=[];void 0!==a.isActive&&(c.push("isActive = ?"),e.push(+!!a.isActive)),a.testStatus&&(c.push("testStatus = ?"),e.push(a.testStatus));let f=`SELECT * FROM proxyPools${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,e).map(l);return g.sort((a,b)=>new Date(b.updatedAt||0)-new Date(a.updatedAt||0)),g}async function o(a){return l((await (0,d.c)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))}async function p(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,k.A)(),name:a.name,proxyUrl:a.proxyUrl,noProxy:a.noProxy||"",type:a.type||"http",isActive:void 0===a.isActive||a.isActive,strictProxy:!0===a.strictProxy,testStatus:a.testStatus||"unknown",lastTestedAt:a.lastTestedAt||null,lastError:a.lastError||null,createdAt:c,updatedAt:c};return m(b,e),e}async function q(a,b){let c=await (0,d.c)(),e=null;return c.transaction(()=>{let d=c.get("SELECT * FROM proxyPools WHERE id = ?",[a]);if(!d)return;let f={...l(d),...b,updatedAt:new Date().toISOString()};m(c,f),e=f}),e}async function r(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM proxyPools WHERE id = ?",[a]);d&&(c=l(d),b.run("DELETE FROM proxyPools WHERE id = ?",[a]))}),c}var s=c(74452),t=c(1541),u=c(9460),v=c(97914);let w="disabledModels";async function x(){let a=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[w]),b={};for(let c of a)b[c.key]=(0,e.q)(c.value,[]);return b}async function y(a,b){if(!a||!Array.isArray(b))return;let c=await (0,d.c)();c.transaction(()=>{let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[w,a]),f=[...new Set([...d&&(0,e.q)(d.value,[])||[],...b])];c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[w,a,(0,e.s)(f)])})}async function z(a,b){if(!a)return;let c=await (0,d.c)();c.transaction(()=>{if(!Array.isArray(b)||0===b.length)return void c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[w,a]);let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[w,a]),f=d&&(0,e.q)(d.value,[])||[],g=new Set(b),h=f.filter(a=>!g.has(a));0===h.length?c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[w,a]):c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[w,a,(0,e.s)(h)])})}var A=c(94735);function B(a){if(!a||"string"!=typeof a)return null;let b=a.trim();return b.length<=12?b.charAt(0)+"***":b.slice(0,8)+"***"+b.slice(-4)}c(62674);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new A.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null});let C=global._pendingRequests,D=global._lastErrorProvider,E=global._pendingTimers,F=global._recentRing,G=global._connectionMapCache,H=global._statsEmitTimers,I=global._statsEmitter;function J(a,b=150){let c="update"===a?"update":"pending";H[c]||(H[c]=setTimeout(()=>{H[c]=null,I.emit(a)},b),H[c]?.unref?.())}function K(a,b,c){a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cachedTokens+=c.cachedTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta)}async function L(){if(Date.now()-G.ts<3e4)return G.map;try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781)),b=await a(),d={};for(let a of b)d[a.id]=a.name||a.email||a.id;G.map=d,G.ts=Date.now()}catch{}return G.map}async function M(){if(!F.initialized){F.initialized=!0;try{F.items=(await (0,d.c)()).all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, cost, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[50]).reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,tokens:(0,e.q)(a.tokens,{})}))}catch{}}}async function N(a,b,d){if(!d||!a||!b)return 0;try{let{getPricingForModel:e}=await Promise.resolve().then(c.bind(c,97914)),f=await e(a,b);if(!f)return 0;let{calculateCostFromTokens:g}=await c.e(8920).then(c.bind(c,58920));return g(d,f)}catch(a){return console.error("Error calculating cost:",a),0}}function O(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,g=`${c}|${f}`;C.byModel[f]||(C.byModel[f]=0),C.byModel[f]=Math.max(0,C.byModel[f]+(d?1:-1)),0===C.byModel[f]&&delete C.byModel[f],c&&(C.byAccount[c]||(C.byAccount[c]={}),C.byAccount[c][f]||(C.byAccount[c][f]=0),C.byAccount[c][f]=Math.max(0,C.byAccount[c][f]+(d?1:-1)),0===C.byAccount[c][f]&&(delete C.byAccount[c][f],0===Object.keys(C.byAccount[c]).length&&delete C.byAccount[c])),d?(clearTimeout(E[g]),E[g]=setTimeout(()=>{delete E[g],C.byModel[f]>0&&(C.byModel[f]=0),c&&C.byAccount[c]?.[f]>0&&(C.byAccount[c][f]=0),J("pending")},6e4)):(clearTimeout(E[g]),delete E[g]),!d&&e&&b&&(D.provider=b.toLowerCase(),D.ts=Date.now()),J("pending")}async function P(){let a=[],b=await L();for(let[c,d]of Object.entries(C.byAccount))for(let[e,f]of Object.entries(d))if(f>0){let d=b[c]||`Account ${c.slice(0,8)}...`,g=e.match(/^(.*) \((.*)\)$/);a.push({model:g?g[1]:e,provider:g?g[2]:"unknown",account:d,count:f})}await M();let c=new Set;return{activeRequests:a,recentRequests:[...F.items].sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp)).map(a=>{let b=a.tokens||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",d=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!c.has(d)&&(c.add(d),!0)}).slice(0,20),errorProvider:Date.now()-D.ts<1e4?D.provider:""}}async function Q(a){try{let b=await (0,d.c)();a.timestamp||(a.timestamp=new Date().toISOString()),a.cost=await N(a.provider,a.model,a.tokens);let c=a.tokens||{},f=c.prompt_tokens||c.input_tokens||0,g=c.completion_tokens||c.output_tokens||0,h=!1;(b.transaction(()=>{var d;let i,j,k,l,m,n,o,p,q,r,s,t=b.get(`SELECT id, endpoint FROM usageHistory
13
+ data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.isActive,c.testStatus,c.data,c.createdAt,c.updatedAt])}async function n(a={}){let b=await (0,d.c)(),c=[],e=[];void 0!==a.isActive&&(c.push("isActive = ?"),e.push(+!!a.isActive)),a.testStatus&&(c.push("testStatus = ?"),e.push(a.testStatus));let f=`SELECT * FROM proxyPools${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,e).map(l);return g.sort((a,b)=>new Date(b.updatedAt||0)-new Date(a.updatedAt||0)),g}async function o(a){return l((await (0,d.c)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))}async function p(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,k.A)(),name:a.name,proxyUrl:a.proxyUrl,noProxy:a.noProxy||"",type:a.type||"http",isActive:void 0===a.isActive||a.isActive,strictProxy:!0===a.strictProxy,testStatus:a.testStatus||"unknown",lastTestedAt:a.lastTestedAt||null,lastError:a.lastError||null,createdAt:c,updatedAt:c};return m(b,e),e}async function q(a,b){let c=await (0,d.c)(),e=null;return c.transaction(()=>{let d=c.get("SELECT * FROM proxyPools WHERE id = ?",[a]);if(!d)return;let f={...l(d),...b,updatedAt:new Date().toISOString()};m(c,f),e=f}),e}async function r(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM proxyPools WHERE id = ?",[a]);d&&(c=l(d),b.run("DELETE FROM proxyPools WHERE id = ?",[a]))}),c}var s=c(74452),t=c(1541),u=c(9460),v=c(97914);let w="disabledModels";async function x(){let a=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[w]),b={};for(let c of a)b[c.key]=(0,e.q)(c.value,[]);return b}async function y(a,b){if(!a||!Array.isArray(b))return;let c=await (0,d.c)();c.transaction(()=>{let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[w,a]),f=[...new Set([...d&&(0,e.q)(d.value,[])||[],...b])];c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[w,a,(0,e.s)(f)])})}async function z(a,b){if(!a)return;let c=await (0,d.c)();c.transaction(()=>{if(!Array.isArray(b)||0===b.length)return void c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[w,a]);let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[w,a]),f=d&&(0,e.q)(d.value,[])||[],g=new Set(b),h=f.filter(a=>!g.has(a));0===h.length?c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[w,a]):c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[w,a,(0,e.s)(h)])})}var A=c(94735);function B(a){if(!a||"string"!=typeof a)return null;let b=a.trim();return b.length<=12?b.charAt(0)+"***":b.slice(0,8)+"***"+b.slice(-4)}c(62674);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new A.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null});let C=global._pendingRequests,D=global._lastErrorProvider,E=global._pendingTimers,F=global._recentRing,G=global._connectionMapCache,H=global._statsEmitTimers,I=global._statsEmitter;function J(a,b=150){let c="update"===a?"update":"pending";H[c]||(H[c]=setTimeout(()=>{H[c]=null,I.emit(a)},b),H[c]?.unref?.())}function K(a,b,c){a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cachedTokens+=c.cachedTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta)}async function L(){if(Date.now()-G.ts<3e4)return G.map;try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781)),b=await a(),d={};for(let a of b)d[a.id]=a.name||a.email||a.id;G.map=d,G.ts=Date.now()}catch{}return G.map}async function M(){if(!F.initialized){F.initialized=!0;try{F.items=(await (0,d.c)()).all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, cost, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[50]).reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,tokens:(0,e.q)(a.tokens,{})}))}catch{}}}async function N(a,b,d){if(!d||!a||!b)return 0;try{let{getPricingForModel:e}=await Promise.resolve().then(c.bind(c,97914)),f=await e(a,b);if(!f)return 0;let{calculateCostFromTokens:g}=await c.e(8920).then(c.bind(c,58920));return g(d,f)}catch(a){return console.error("Error calculating cost:",a),0}}function O(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,g=`${c}|${f}`;C.byModel[f]||(C.byModel[f]=0),C.byModel[f]=Math.max(0,C.byModel[f]+(d?1:-1)),0===C.byModel[f]&&delete C.byModel[f],c&&(C.byAccount[c]||(C.byAccount[c]={}),C.byAccount[c][f]||(C.byAccount[c][f]=0),C.byAccount[c][f]=Math.max(0,C.byAccount[c][f]+(d?1:-1)),0===C.byAccount[c][f]&&(delete C.byAccount[c][f],0===Object.keys(C.byAccount[c]).length&&delete C.byAccount[c])),d?(clearTimeout(E[g]),E[g]=setTimeout(()=>{delete E[g],C.byModel[f]>0&&(C.byModel[f]=0),c&&C.byAccount[c]?.[f]>0&&(C.byAccount[c][f]=0),J("pending")},6e4)):(clearTimeout(E[g]),delete E[g]),!d&&e&&b&&(D.provider=b.toLowerCase(),D.ts=Date.now()),J("pending")}async function P(){let a=[],b=await L();for(let[c,d]of Object.entries(C.byAccount))for(let[e,f]of Object.entries(d))if(f>0){let d=b[c]||`Account ${c.slice(0,8)}...`,g=e.match(/^(.*) \((.*)\)$/);a.push({model:g?g[1]:e,provider:g?g[2]:"unknown",account:d,count:f})}await M();let c=new Set;return{activeRequests:a,recentRequests:[...F.items].sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp)).map(a=>{let b=a.tokens||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",d=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!c.has(d)&&(c.add(d),!0)}).slice(0,20),errorProvider:Date.now()-D.ts<1e4?D.provider:""}}async function Q(a){try{let b=await (0,d.c)();a.timestamp||(a.timestamp=new Date().toISOString()),a.cost=await N(a.provider,a.model,a.tokens);let c=a.tokens||{},f=c.prompt_tokens||c.input_tokens||0,g=c.completion_tokens||c.output_tokens||0,h=!1;(b.transaction(()=>{var d;let i,j=b.get(`SELECT id, endpoint FROM usageHistory
14
14
  WHERE timestamp = ?
15
15
  AND COALESCE(provider, '') = COALESCE(?, '')
16
16
  AND COALESCE(model, '') = COALESCE(?, '')
@@ -18,4 +18,4 @@ exports.id=9100,exports.ids=[9100],exports.modules={644:(a,b,c)=>{"use strict";f
18
18
  AND COALESCE(apiKey, '') = COALESCE(?, '')
19
19
  AND promptTokens = ?
20
20
  AND completionTokens = ?
21
- ORDER BY id DESC LIMIT 1`,[a.timestamp,a.provider||null,a.model||null,a.connectionId||null,a.apiKey||null,f,g]);if(t){!t.endpoint&&a.endpoint&&b.run("UPDATE usageHistory SET endpoint = ? WHERE id = ?",[a.endpoint,t.id]);return}b.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[a.timestamp,a.provider||null,a.model||null,a.connectionId||null,a.apiKey||null,a.endpoint||null,f,g,a.cost||0,a.status||"ok",(0,e.s)(c),(0,e.s)({})]);let u=(i=(d=a.timestamp)?new Date(d):new Date,`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`),v=b.get("SELECT data FROM usageDaily WHERE dateKey = ?",[u]),w=v?(0,e.q)(v.data,{}):{requests:0,promptTokens:0,completionTokens:0,cost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{}};j=a.tokens?.prompt_tokens||a.tokens?.input_tokens||0,k=a.tokens?.completion_tokens||a.tokens?.output_tokens||0,l=a.tokens?.cached_tokens||a.tokens?.cache_read_input_tokens||0,n={promptTokens:j,completionTokens:k,cachedTokens:l,cost:m=a.cost||0},w.requests=(w.requests||0)+1,w.promptTokens=(w.promptTokens||0)+j,w.completionTokens=(w.completionTokens||0)+k,w.cachedTokens=(w.cachedTokens||0)+l,w.cost=(w.cost||0)+m,w.byProvider||={},w.byModel||={},w.byAccount||={},w.byApiKey||={},w.byEndpoint||={},a.provider&&K(w.byProvider,a.provider,n),o=a.provider?`${a.model}|${a.provider}`:a.model,K(w.byModel,o,{...n,meta:{rawModel:a.model,provider:a.provider}}),a.connectionId&&K(w.byAccount,a.connectionId,{...n,meta:{rawModel:a.model,provider:a.provider}}),p=a.apiKey&&"string"==typeof a.apiKey?a.apiKey:"local-no-key",q=`${p}|${a.model}|${a.provider||"unknown"}`,K(w.byApiKey,q,{...n,meta:{rawModel:a.model,provider:a.provider,apiKey:a.apiKey||null}}),r=a.endpoint||"Unknown",s=`${r}|${a.model}|${a.provider||"unknown"}`,K(w.byEndpoint,s,{...n,meta:{endpoint:r,rawModel:a.model,provider:a.provider}}),b.run("INSERT INTO usageDaily(dateKey, data) VALUES(?, ?) ON CONFLICT(dateKey) DO UPDATE SET data = excluded.data",[u,(0,e.s)(w)]);let x=b.get("SELECT value FROM _meta WHERE key = 'totalRequestsLifetime'"),y=(x?parseInt(x.value,10):0)+1;b.run("INSERT INTO _meta(key, value) VALUES('totalRequestsLifetime', ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[String(y)]),h=!0}),h)&&(F.items.push(a),F.items.length>50&&(F.items=F.items.slice(-50)),J("update",250))}catch(a){console.error("Failed to save usage stats:",a)}}function R(a,b){if(null==b)return a.all("SELECT dateKey, data FROM usageDaily ORDER BY dateKey ASC");let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()-b+1),e=`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`;return a.all("SELECT dateKey, data FROM usageDaily WHERE dateKey >= ? ORDER BY dateKey ASC",[e])}async function S(a="all"){let b=await (0,d.c)(),[{getProviderConnections:f},{getApiKeys:g},{getProviderNodes:h}]=await Promise.all([Promise.resolve().then(c.bind(c,5781)),Promise.resolve().then(c.bind(c,74452)),Promise.resolve().then(c.bind(c,1129))]),i=[];try{i=await f()}catch{}let j={};for(let a of i)j[a.id]=a.name||a.email||a.id;let k={};try{for(let a of(await h()))a.id&&a.name&&(k[a.id]=a.name)}catch{}let l=[];try{l=await g()}catch{}let m={};for(let a of l)a.key&&(m[a.key.trim()]={name:a.name,id:a.id,createdAt:a.createdAt});let n=b.all("SELECT timestamp, provider, model, tokens, status FROM usageHistory ORDER BY id DESC LIMIT 100"),o=new Set,p={totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCachedTokens:0,totalCost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{},last10Minutes:[],pending:C,activeRequests:[],recentRequests:n.map(a=>{let b=(0,e.q)(a.tokens,{})||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,cachedTokens:b.cached_tokens||b.cache_read_input_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",c=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!o.has(c)&&(o.add(c),!0)}).slice(0,20),errorProvider:Date.now()-D.ts<1e4?D.provider:""};for(let[a,b]of Object.entries(C.byAccount))for(let[c,d]of Object.entries(b))if(d>0){let b=j[a]||`Account ${a.slice(0,8)}...`,e=c.match(/^(.*) \((.*)\)$/);p.activeRequests.push({model:e?e[1]:c,provider:e?e[2]:"unknown",account:b,count:d})}let q=new Date,r=new Date(6e4*Math.floor(q.getTime()/6e4)),s=new Date(r.getTime()-54e4),t={};for(let a=0;a<10;a++){let b=r.getTime()-(9-a)*6e4;t[b]={requests:0,promptTokens:0,completionTokens:0,cost:0},p.last10Minutes.push(t[b])}for(let a of b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ? AND timestamp <= ?",[s.toISOString(),q.toISOString()])){let b=6e4*Math.floor(new Date(a.timestamp).getTime()/6e4);t[b]&&(t[b].requests++,t[b].promptTokens+=a.promptTokens||0,t[b].completionTokens+=a.completionTokens||0,t[b].cost+=a.cost||0)}if("24h"!==a&&"today"!==a){let c={"7d":7,"30d":30,"60d":60}[a]||null;for(let a of R(b,c)){let b=a.dateKey,c=(0,e.q)(a.data,{});for(let[a,b]of(p.totalPromptTokens+=c.promptTokens||0,p.totalCompletionTokens+=c.completionTokens||0,p.totalCachedTokens+=c.cachedTokens||0,p.totalCost+=c.cost||0,Object.entries(c.byProvider||{})))p.byProvider[a]||(p.byProvider[a]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),p.byProvider[a].requests+=b.requests||0,p.byProvider[a].promptTokens+=b.promptTokens||0,p.byProvider[a].completionTokens+=b.completionTokens||0,p.byProvider[a].cachedTokens+=b.cachedTokens||0,p.byProvider[a].cost+=b.cost||0;for(let[a,d]of Object.entries(c.byModel||{})){let c=d.rawModel||a.split("|")[0],e=d.provider||a.split("|")[1]||"",f=e?`${c} (${e})`:c,g=k[e]||e;p.byModel[f]||(p.byModel[f]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:g,lastUsed:b}),p.byModel[f].requests+=d.requests||0,p.byModel[f].promptTokens+=d.promptTokens||0,p.byModel[f].completionTokens+=d.completionTokens||0,p.byModel[f].cachedTokens+=d.cachedTokens||0,p.byModel[f].cost+=d.cost||0,b>(p.byModel[f].lastUsed||"")&&(p.byModel[f].lastUsed=b)}for(let[a,d]of Object.entries(c.byAccount||{})){let c=j[a]||`Account ${a.slice(0,8)}...`,e=d.rawModel||"",f=d.provider||"",g=k[f]||f,h=`${e} (${f} - ${c})`;p.byAccount[h]||(p.byAccount[h]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:e,provider:g,connectionId:a,accountName:c,lastUsed:b}),p.byAccount[h].requests+=d.requests||0,p.byAccount[h].promptTokens+=d.promptTokens||0,p.byAccount[h].completionTokens+=d.completionTokens||0,p.byAccount[h].cachedTokens+=d.cachedTokens||0,p.byAccount[h].cost+=d.cost||0,b>(p.byAccount[h].lastUsed||"")&&(p.byAccount[h].lastUsed=b)}for(let[a,d]of Object.entries(c.byApiKey||{})){let c=d.rawModel||"",e=d.provider||"",f=k[e]||e,g=d.apiKey?d.apiKey.trim():null,h=g?m[g]:null,i=B(g),j=h?.name||(g?i||g.slice(0,8)+"...":"Local (No API Key)"),l=i||"local-no-key";p.byApiKey[a]||(p.byApiKey[a]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:f,apiKeyMasked:i,keyName:j,apiKeyKey:l,lastUsed:b}),p.byApiKey[a].requests+=d.requests||0,p.byApiKey[a].promptTokens+=d.promptTokens||0,p.byApiKey[a].completionTokens+=d.completionTokens||0,p.byApiKey[a].cachedTokens+=d.cachedTokens||0,p.byApiKey[a].cost+=d.cost||0,b>(p.byApiKey[a].lastUsed||"")&&(p.byApiKey[a].lastUsed=b)}for(let[a,d]of Object.entries(c.byEndpoint||{})){let c=d.endpoint||a.split("|")[0]||"Unknown",e=d.rawModel||"",f=d.provider||"",g=k[f]||f;p.byEndpoint[a]||(p.byEndpoint[a]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:c,rawModel:e,provider:g,lastUsed:b}),p.byEndpoint[a].requests+=d.requests||0,p.byEndpoint[a].promptTokens+=d.promptTokens||0,p.byEndpoint[a].completionTokens+=d.completionTokens||0,p.byEndpoint[a].cachedTokens+=d.cachedTokens||0,p.byEndpoint[a].cost+=d.cost||0,b>(p.byEndpoint[a].lastUsed||"")&&(p.byEndpoint[a].lastUsed=b)}}let d=Math.max(c?Date.now()-864e5*c:0,Date.now()-1728e5);for(let a of b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint FROM usageHistory WHERE timestamp >= ?",[new Date(d).toISOString()])){let b=a.timestamp,c=a.provider?`${a.model} (${a.provider})`:a.model;if(p.byModel[c]&&new Date(b)>new Date(p.byModel[c].lastUsed)&&(p.byModel[c].lastUsed=b),a.connectionId){let c=j[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,d=`${a.model} (${a.provider} - ${c})`;p.byAccount[d]&&new Date(b)>new Date(p.byAccount[d].lastUsed)&&(p.byAccount[d].lastUsed=b)}let d=a.apiKey&&"string"==typeof a.apiKey?`${a.apiKey}|${a.model}|${a.provider||"unknown"}`:"local-no-key";p.byApiKey[d]&&new Date(b)>new Date(p.byApiKey[d].lastUsed)&&(p.byApiKey[d].lastUsed=b);let e=a.endpoint||"Unknown",f=`${e}|${a.model}|${a.provider||"unknown"}`;p.byEndpoint[f]&&new Date(b)>new Date(p.byEndpoint[f].lastUsed)&&(p.byEndpoint[f].lastUsed=b)}}else{let c;if("today"===a){let a=new Date;a.setHours(0,0,0,0),c=a.toISOString()}else c=new Date(Date.now()-864e5).toISOString();for(let a of b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, tokens FROM usageHistory WHERE timestamp >= ?",[c])){let b=(0,e.q)(a.tokens,{})||{},c=b.prompt_tokens||b.input_tokens||a.promptTokens||0,d=b.completion_tokens||b.output_tokens||a.completionTokens||0,f=b.cached_tokens||b.cache_read_input_tokens||0,g=a.cost||0,h=k[a.provider]||a.provider;p.totalPromptTokens+=c,p.totalCompletionTokens+=d,p.totalCachedTokens+=f,p.totalCost+=g,p.byProvider[a.provider]||(p.byProvider[a.provider]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),p.byProvider[a.provider].requests++,p.byProvider[a.provider].promptTokens+=c,p.byProvider[a.provider].completionTokens+=d,p.byProvider[a.provider].cachedTokens+=f,p.byProvider[a.provider].cost+=g;let i=a.provider?`${a.model} (${a.provider})`:a.model;if(p.byModel[i]||(p.byModel[i]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,lastUsed:a.timestamp}),p.byModel[i].requests++,p.byModel[i].promptTokens+=c,p.byModel[i].completionTokens+=d,p.byModel[i].cachedTokens+=f,p.byModel[i].cost+=g,new Date(a.timestamp)>new Date(p.byModel[i].lastUsed)&&(p.byModel[i].lastUsed=a.timestamp),a.connectionId){let b=j[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,e=`${a.model} (${a.provider} - ${b})`;p.byAccount[e]||(p.byAccount[e]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,connectionId:a.connectionId,accountName:b,lastUsed:a.timestamp}),p.byAccount[e].requests++,p.byAccount[e].promptTokens+=c,p.byAccount[e].completionTokens+=d,p.byAccount[e].cachedTokens+=f,p.byAccount[e].cost+=g,new Date(a.timestamp)>new Date(p.byAccount[e].lastUsed)&&(p.byAccount[e].lastUsed=a.timestamp)}if(a.apiKey&&"string"==typeof a.apiKey){let b=a.apiKey.trim(),e=m[b],i=B(b),j=e?.name||i||a.apiKey.slice(0,8)+"...",k=`${a.apiKey}|${a.model}|${a.provider||"unknown"}`;p.byApiKey[k]||(p.byApiKey[k]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,apiKeyMasked:i,keyName:j,apiKeyKey:i,lastUsed:a.timestamp});let l=p.byApiKey[k];l.requests++,l.promptTokens+=c,l.completionTokens+=d,l.cachedTokens+=f,l.cost+=g,new Date(a.timestamp)>new Date(l.lastUsed)&&(l.lastUsed=a.timestamp)}else{p.byApiKey["local-no-key"]||(p.byApiKey["local-no-key"]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,apiKeyMasked:null,keyName:"Local (No API Key)",apiKeyKey:"local-no-key",lastUsed:a.timestamp});let b=p.byApiKey["local-no-key"];b.requests++,b.promptTokens+=c,b.completionTokens+=d,b.cachedTokens+=f,b.cost+=g,new Date(a.timestamp)>new Date(b.lastUsed)&&(b.lastUsed=a.timestamp)}let l=a.endpoint||"Unknown",n=`${l}|${a.model}|${a.provider||"unknown"}`;p.byEndpoint[n]||(p.byEndpoint[n]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:l,rawModel:a.model,provider:h,lastUsed:a.timestamp});let o=p.byEndpoint[n];o.requests++,o.promptTokens+=c,o.completionTokens+=d,o.cachedTokens+=f,o.cost+=g,new Date(a.timestamp)>new Date(o.lastUsed)&&(o.lastUsed=a.timestamp)}}return p.totalRequests=Object.values(p.byProvider).reduce((a,b)=>a+(b.requests||0),0),p}async function T(a="7d"){let b=await (0,d.c)(),c=Date.now();if("today"===a){let a=new Date;a.setHours(0,0,0,0);let c=a.getTime(),d=c+864e5,e=Array.from({length:24},(a,b)=>({label:new Date(c+36e5*b).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let a of b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(c).toISOString()])){let b=new Date(a.timestamp).getTime();if(b<c||b>=d)continue;let f=Math.floor((b-c)/36e5);f>=0&&f<24&&(e[f].tokens+=(a.promptTokens||0)+(a.completionTokens||0),e[f].cost+=a.cost||0,e[f].requests+=1)}return e}if("24h"===a){let a=c-864e5,d=Array.from({length:24},(b,c)=>({label:new Date(a+36e5*c).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let e of b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(a).toISOString()])){let b=new Date(e.timestamp).getTime();if(b<a||b>c)continue;let f=Math.min(Math.floor((b-a)/36e5),23);d[f].tokens+=(e.promptTokens||0)+(e.completionTokens||0),d[f].cost+=e.cost||0,d[f].requests+=1}return d}let f=a=>a.toLocaleDateString("en-US",{month:"short",day:"numeric"});if("all"===a){let a=R(b,null);if(!a.length)return[];let c={};for(let b of a)c[b.dateKey]=(0,e.q)(b.data,{});let d=new Date(a[0].dateKey+"T00:00:00"),g=new Date;return g.setHours(0,0,0,0),Array.from({length:Math.max(1,Math.round((g-d)/864e5)+1)},(a,b)=>{let e=new Date(d);e.setDate(e.getDate()+b);let g=c[`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`];return{label:f(e),tokens:g?(g.promptTokens||0)+(g.completionTokens||0):0,cost:g&&g.cost||0,requests:g&&g.requests||0}})}let g="7d"===a?7:"30d"===a?30:60,h=new Date,i=R(b,g),j={};for(let a of i)j[a.dateKey]=(0,e.q)(a.data,{});return Array.from({length:g},(a,b)=>{let c=new Date(h);c.setDate(c.getDate()-(g-1-b));let d=j[`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,"0")}-${String(c.getDate()).padStart(2,"0")}`];return{label:f(c),tokens:d?(d.promptTokens||0)+(d.completionTokens||0):0,cost:d&&d.cost||0,requests:d&&d.requests||0}})}async function U(){}async function V(a=200){try{let b=(await (0,d.c)()).all("SELECT timestamp, provider, model, connectionId, promptTokens, completionTokens, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[a]);if(!b.length)return[];let f={};try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781));for(let b of(await a()))f[b.id]=b.name||b.email||""}catch{}return b.map(a=>{let b=function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${b(a.getDate())}-${b(a.getMonth()+1)}-${a.getFullYear()} ${b(a.getHours())}:${b(a.getMinutes())}:${b(a.getSeconds())}`}(new Date(a.timestamp)),c=a.provider?.toUpperCase()||"-",d=a.model||"-",g=f[a.connectionId]||(a.connectionId?a.connectionId.slice(0,8):"-"),h=a.tokens?(0,e.q)(a.tokens,{}):{},i=a.promptTokens??h.prompt_tokens??"-",j=a.completionTokens??h.completion_tokens??"-";return`${b} | ${d} | ${c} | ${g} | ${i} | ${j} | ${a.status||"-"}`})}catch(a){return console.error("[usageRepo] getRecentLogs failed:",a.message),[]}}let W=null,X=0;async function Y(){if(W&&Date.now()-X<5e3)return W;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,42655)),b=await a(),d=process.env.ENABLE_REQUEST_LOGS;if(void 0!==d)return W={enabled:"true"===d.toLowerCase(),maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))},X=Date.now(),W;let e="false"!==process.env.OBSERVABILITY_ENABLED;W={enabled:"boolean"==typeof b.enableObservability?b.enableObservability:e,maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))}}catch{W={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return X=Date.now(),W}let Z=[],$=null,_=!1;function aa(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}async function ab(){if(!_&&0!==Z.length){_=!0;try{for(;Z.length>0;){let a=Z.splice(0,Z.length),b=await (0,d.c)(),c=await Y();b.transaction(()=>{for(let d of a){d.id||(d.id=function(a){let b=new Date().toISOString(),c=Math.random().toString(36).substring(2,8),d=a?a.replace(/[^a-zA-Z0-9-]/g,"-"):"unknown";return`${b}-${c}-${d}`}(d.model)),d.timestamp||(d.timestamp=new Date().toISOString()),d.request?.headers&&(d.request.headers=function(a){if(!a||"object"!=typeof a)return{};let b=["authorization","x-api-key","cookie","token","api-key"],c={...a};for(let a of Object.keys(c))b.some(b=>a.toLowerCase().includes(b))&&delete c[a];return c}(d.request.headers));let a={id:d.id,provider:d.provider||null,model:d.model||null,connectionId:d.connectionId||null,timestamp:d.timestamp,status:d.status||null,latency:d.latency||{},tokens:d.tokens||{},request:aa(d.request,c.maxJsonSize),providerRequest:aa(d.providerRequest,c.maxJsonSize),providerResponse:aa(d.providerResponse,c.maxJsonSize),response:aa(d.response,c.maxJsonSize),pxpipe:d.pxpipe||void 0};b.run("INSERT INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET timestamp = excluded.timestamp, provider = excluded.provider, model = excluded.model, connectionId = excluded.connectionId, status = excluded.status, data = excluded.data",[a.id,a.timestamp,a.provider,a.model,a.connectionId,a.status,(0,e.s)(a)])}let d=b.get("SELECT COUNT(*) as c FROM requestDetails");d&&d.c>c.maxRecords&&b.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[d.c-c.maxRecords])})}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{_=!1}}}async function ac(a){let b=await Y();b.enabled&&(Z.push(a),Z.length>=b.batchSize?($&&(clearTimeout($),$=null),ab().catch(a=>console.error("[requestDetailsRepo] flush err:",a))):$||($=setTimeout(()=>{$=null,ab().catch(()=>{})},b.flushIntervalMs)))}async function ad(a={}){let b=await (0,d.c)(),c=[],f=[];a.provider&&(c.push("provider = ?"),f.push(a.provider)),a.model&&(c.push("model = ?"),f.push(a.model)),a.connectionId&&(c.push("connectionId = ?"),f.push(a.connectionId)),a.status&&(c.push("status = ?"),f.push(a.status)),a.startDate&&(c.push("timestamp >= ?"),f.push(new Date(a.startDate).toISOString())),a.endDate&&(c.push("timestamp <= ?"),f.push(new Date(a.endDate).toISOString()));let g=c.length?`WHERE ${c.join(" AND ")}`:"",h=b.get(`SELECT COUNT(*) as c FROM requestDetails ${g}`,f),i=h?h.c:0,j=a.page||1,k=a.pageSize||50,l=Math.ceil(i/k);return{details:b.all(`SELECT data FROM requestDetails ${g} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...f,k,(j-1)*k]).map(a=>(0,e.q)(a.data,{})),pagination:{page:j,pageSize:k,totalItems:i,totalPages:l,hasNext:j<l,hasPrev:j>1}}}async function ae(){return(await (0,d.c)()).all("SELECT DISTINCT provider FROM requestDetails WHERE provider IS NOT NULL ORDER BY provider ASC").map(a=>a.provider)}let af=async()=>{$&&(clearTimeout($),$=null),Z.length>0&&await ab()};async function ag(){let a=await (0,d.c)(),{exportSettings:b}=await Promise.resolve().then(c.bind(c,42655)),g={settings:await b(),providerConnections:a.all("SELECT * FROM providerConnections").map(a=>({...(0,e.q)(a.data,{}),id:a.id,provider:a.provider,authType:a.authType,name:a.name,email:a.email,priority:a.priority,isActive:1===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt})),providerNodes:a.all("SELECT * FROM providerNodes").map(a=>({...(0,e.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt})),proxyPools:a.all("SELECT * FROM proxyPools").map(a=>({...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt})),apiKeys:a.all("SELECT * FROM apiKeys").map(a=>({id:a.id,key:a.key,name:a.name,machineId:a.machineId,isActive:1===a.isActive,createdAt:a.createdAt,access:(0,f.xE)(a.accessRestricted,a.accessAllow)})),combos:a.all("SELECT * FROM combos").map(a=>({id:a.id,name:a.name,kind:a.kind,models:(0,e.q)(a.models,[]),createdAt:a.createdAt,updatedAt:a.updatedAt})),modelAliases:{},customModels:[],mitmAlias:{},pricing:{}};for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'modelAliases'"))g.modelAliases[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'customModels'"))g.customModels.push((0,e.q)(b.value));for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'mitmAlias'"))g.mitmAlias[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'pricing'"))g.pricing[b.key]=(0,e.q)(b.value);return g}async function ah(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("Invalid database payload");let b=await (0,d.c)();return b.transaction(()=>{for(let c of(b.run("DELETE FROM settings"),b.run("DELETE FROM providerConnections"),b.run("DELETE FROM providerNodes"),b.run("DELETE FROM proxyPools"),b.run("DELETE FROM apiKeys"),b.run("DELETE FROM combos"),b.run("DELETE FROM kv WHERE scope IN ('modelAliases', 'customModels', 'mitmAlias', 'pricing')"),a.settings&&b.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(a.settings)]),a.providerConnections||[])){let{id:a,provider:d,authType:f,name:g,email:h,priority:i,isActive:j,createdAt:k,updatedAt:l,...m}=c;b.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[a,d,f||"oauth",g||null,h||null,i||null,+(!1!==j),(0,e.s)(m),k||new Date().toISOString(),l||new Date().toISOString()])}for(let c of a.providerNodes||[]){let{id:a,type:d,name:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,d||null,f||null,(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.proxyPools||[]){let{id:a,isActive:d,testStatus:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,+(!1!==d),f||"unknown",(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.apiKeys||[]){let a=g.M0;if(void 0!==c.access){let b=(0,f.M7)(c.access);if(!b.ok)throw Error(`apiKeys ${c.id}: ${b.error}`);a=b.value}let d=(0,f.aB)(a);b.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt, accessRestricted, accessAllow) VALUES(?, ?, ?, ?, ?, ?, ?, ?)",[c.id,c.key,c.name||null,c.machineId||null,+(!1!==c.isActive),c.createdAt||new Date().toISOString(),d.accessRestricted,d.accessAllow])}for(let c of a.combos||[])b.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c.id,c.name,c.kind||null,(0,e.s)(c.models||[]),c.createdAt||new Date().toISOString(),c.updatedAt||new Date().toISOString()]);for(let[c,d]of Object.entries(a.modelAliases||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[c,(0,e.s)(d)]);for(let c of a.customModels||[]){let a=`${c.providerAlias}|${c.id}|${c.type||"llm"}`;b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[a,(0,e.s)(c)])}for(let[c,d]of Object.entries(a.mitmAlias||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[c,(0,e.s)(d||{})]);for(let[c,d]of Object.entries(a.pricing||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[c,(0,e.s)(d||{})])}),await ag()}process.off("beforeExit",af),process.off("SIGINT",af),process.off("SIGTERM",af),process.off("exit",af),process.on("beforeExit",af),process.on("SIGINT",af),process.on("SIGTERM",af),process.on("exit",af)},95658:(a,b,c)=>{"use strict";c.d(b,{AL:()=>j,HG:()=>i,Jh:()=>m,KQ:()=>k,Or:()=>l});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(49120);let i=e().join(h.n,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.n,"db.json"),usage:e().join(h.n,"usage.json"),disabled:e().join(h.n,"disabledModels.json"),details:e().join(h.n,"request-details.json")};function m(){for(let a of[h.n,i,k])g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},96487:()=>{},97914:(a,b,c)=>{"use strict";c.d(b,{KJ:()=>l,VT:()=>n,getPricingForModel:()=>k,r4:()=>j,yF:()=>m});var d=c(36366),e=c(644);let f=(0,c(22846).U)("pricing"),g={value:null,expiresAt:0};function h(){g={value:null,expiresAt:0}}async function i(){return await f.getAll()}async function j(){let a=Date.now();if(g.value&&g.expiresAt>a)return g.value;let b=await i(),{PROVIDER_PRICING:d}=await c.e(8920).then(c.bind(c,58920)),e={};for(let[a,c]of Object.entries(d))if(e[a]={...c},b[a])for(let[c,d]of Object.entries(b[a]))e[a][c]=e[a][c]?{...e[a][c],...d}:d;for(let[a,c]of Object.entries(b))if(e[a])for(let[b,d]of Object.entries(c))e[a][b]||(e[a][b]=d);else e[a]={...c};return g={value:e,expiresAt:a+5e3},e}async function k(a,b){if(!b)return null;let d=await i();if(a&&d[a]?.[b])return d[a][b];let{getPricingForModel:e}=await c.e(8920).then(c.bind(c,58920));return e(a,b)}async function l(a){let b=await (0,d.c)();return b.transaction(()=>{for(let[c,d]of Object.entries(a)){let a=b.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[c]),f={...a&&(0,e.q)(a.value,{})||{}};for(let[a,b]of Object.entries(d))f[a]=b;b.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[c,(0,e.s)(f)])}}),h(),await i()}async function m(a,b){if(!a)return await i();let c=await (0,d.c)();return c.transaction(()=>{if(!b)return void c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]);let d=c.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[a]),f=d&&(0,e.q)(d.value,{})||{};delete f[b],0===Object.keys(f).length?c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]):c.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,(0,e.s)(f)])}),h(),await i()}async function n(){return await f.clear(),h(),{}}}};
21
+ ORDER BY id DESC LIMIT 1`,[a.timestamp,a.provider||null,a.model||null,a.connectionId||null,a.apiKey||null,f,g]);if(j){!j.endpoint&&a.endpoint&&b.run("UPDATE usageHistory SET endpoint = ? WHERE id = ?",[a.endpoint,j.id]);return}b.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[a.timestamp,a.provider||null,a.model||null,a.connectionId||null,a.apiKey||null,a.endpoint||null,f,g,a.cost||0,a.status||"ok",(0,e.s)(c),(0,e.s)({})]);let k=(i=(d=a.timestamp)?new Date(d):new Date,`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`),l=b.get("SELECT data FROM usageDaily WHERE dateKey = ?",[k]),m=l?(0,e.q)(l.data,{}):{requests:0,promptTokens:0,completionTokens:0,cost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{}};!function(a,b){let c=b.tokens?.prompt_tokens||b.tokens?.input_tokens||0,d=b.tokens?.completion_tokens||b.tokens?.output_tokens||0,e=b.tokens?.cached_tokens||b.tokens?.cache_read_input_tokens||0,f=b.cost||0,g={promptTokens:c,completionTokens:d,cachedTokens:e,cost:f};a.requests=(a.requests||0)+1,a.promptTokens=(a.promptTokens||0)+c,a.completionTokens=(a.completionTokens||0)+d,a.cachedTokens=(a.cachedTokens||0)+e,a.cost=(a.cost||0)+f,a.byProvider||={},a.byModel||={},a.byAccount||={},a.byApiKey||={},a.byEndpoint||={},b.provider&&K(a.byProvider,b.provider,g);let h=b.provider?`${b.model}|${b.provider}`:b.model;if(K(a.byModel,h,{...g,meta:{rawModel:b.model,provider:b.provider}}),b.connectionId){let c=`${b.connectionId}|${b.model}|${b.provider||"unknown"}`;K(a.byAccount,c,{...g,meta:{rawModel:b.model,provider:b.provider}})}let i=b.apiKey&&"string"==typeof b.apiKey?b.apiKey:"local-no-key",j=`${i}|${b.model}|${b.provider||"unknown"}`;K(a.byApiKey,j,{...g,meta:{rawModel:b.model,provider:b.provider,apiKey:b.apiKey||null}});let k=b.endpoint||"Unknown",l=`${k}|${b.model}|${b.provider||"unknown"}`;K(a.byEndpoint,l,{...g,meta:{endpoint:k,rawModel:b.model,provider:b.provider}})}(m,a),b.run("INSERT INTO usageDaily(dateKey, data) VALUES(?, ?) ON CONFLICT(dateKey) DO UPDATE SET data = excluded.data",[k,(0,e.s)(m)]);let n=b.get("SELECT value FROM _meta WHERE key = 'totalRequestsLifetime'"),o=(n?parseInt(n.value,10):0)+1;b.run("INSERT INTO _meta(key, value) VALUES('totalRequestsLifetime', ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[String(o)]),h=!0}),h)&&(F.items.push(a),F.items.length>50&&(F.items=F.items.slice(-50)),J("update",250))}catch(a){console.error("Failed to save usage stats:",a)}}function R(a,b){if(null==b)return a.all("SELECT dateKey, data FROM usageDaily ORDER BY dateKey ASC");let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()-b+1),e=`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`;return a.all("SELECT dateKey, data FROM usageDaily WHERE dateKey >= ? ORDER BY dateKey ASC",[e])}async function S(a="all"){let b=await (0,d.c)(),[{getProviderConnections:f},{getApiKeys:g},{getProviderNodes:h}]=await Promise.all([Promise.resolve().then(c.bind(c,5781)),Promise.resolve().then(c.bind(c,74452)),Promise.resolve().then(c.bind(c,1129))]),i=[];try{i=await f()}catch{}let j={};for(let a of i)j[a.id]=a.name||a.email||a.id;let k={};try{for(let a of(await h()))a.id&&a.name&&(k[a.id]=a.name)}catch{}let l=[];try{l=await g()}catch{}let m={};for(let a of l)a.key&&(m[a.key.trim()]={name:a.name,id:a.id,createdAt:a.createdAt});let n=b.all("SELECT timestamp, provider, model, tokens, status FROM usageHistory ORDER BY id DESC LIMIT 100"),o=new Set,p={totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCachedTokens:0,totalCost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{},last10Minutes:[],pending:C,activeRequests:[],recentRequests:n.map(a=>{let b=(0,e.q)(a.tokens,{})||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,cachedTokens:b.cached_tokens||b.cache_read_input_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",c=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!o.has(c)&&(o.add(c),!0)}).slice(0,20),errorProvider:Date.now()-D.ts<1e4?D.provider:""};for(let[a,b]of Object.entries(C.byAccount))for(let[c,d]of Object.entries(b))if(d>0){let b=j[a]||`Account ${a.slice(0,8)}...`,e=c.match(/^(.*) \((.*)\)$/);p.activeRequests.push({model:e?e[1]:c,provider:e?e[2]:"unknown",account:b,count:d})}let q=new Date,r=new Date(6e4*Math.floor(q.getTime()/6e4)),s=new Date(r.getTime()-54e4),t={};for(let a=0;a<10;a++){let b=r.getTime()-(9-a)*6e4;t[b]={requests:0,promptTokens:0,completionTokens:0,cost:0},p.last10Minutes.push(t[b])}for(let a of b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ? AND timestamp <= ?",[s.toISOString(),q.toISOString()])){let b=6e4*Math.floor(new Date(a.timestamp).getTime()/6e4);t[b]&&(t[b].requests++,t[b].promptTokens+=a.promptTokens||0,t[b].completionTokens+=a.completionTokens||0,t[b].cost+=a.cost||0)}if("24h"!==a&&"today"!==a){let c={"7d":7,"30d":30,"60d":60}[a]||null;for(let a of R(b,c)){let b=a.dateKey,c=(0,e.q)(a.data,{});for(let[a,b]of(p.totalPromptTokens+=c.promptTokens||0,p.totalCompletionTokens+=c.completionTokens||0,p.totalCachedTokens+=c.cachedTokens||0,p.totalCost+=c.cost||0,Object.entries(c.byProvider||{})))p.byProvider[a]||(p.byProvider[a]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),p.byProvider[a].requests+=b.requests||0,p.byProvider[a].promptTokens+=b.promptTokens||0,p.byProvider[a].completionTokens+=b.completionTokens||0,p.byProvider[a].cachedTokens+=b.cachedTokens||0,p.byProvider[a].cost+=b.cost||0;for(let[a,d]of Object.entries(c.byModel||{})){let c=d.rawModel||a.split("|")[0],e=d.provider||a.split("|")[1]||"",f=e?`${c} (${e})`:c,g=k[e]||e;p.byModel[f]||(p.byModel[f]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:g,lastUsed:b}),p.byModel[f].requests+=d.requests||0,p.byModel[f].promptTokens+=d.promptTokens||0,p.byModel[f].completionTokens+=d.completionTokens||0,p.byModel[f].cachedTokens+=d.cachedTokens||0,p.byModel[f].cost+=d.cost||0,b>(p.byModel[f].lastUsed||"")&&(p.byModel[f].lastUsed=b)}for(let[a,d]of Object.entries(c.byAccount||{})){let c=a,e=d.rawModel||"",f=d.provider||"";if(a.includes("|")){let b=a.split("|");c=b[0],e=b[1]??e,f=b[2]??f}let g=j[c]||`Account ${c.slice(0,8)}...`,h=k[f]||f,i=`${e} (${f} - ${g})`;p.byAccount[i]||(p.byAccount[i]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:e,provider:h,connectionId:c,accountName:g,lastUsed:b}),p.byAccount[i].requests+=d.requests||0,p.byAccount[i].promptTokens+=d.promptTokens||0,p.byAccount[i].completionTokens+=d.completionTokens||0,p.byAccount[i].cachedTokens+=d.cachedTokens||0,p.byAccount[i].cost+=d.cost||0,b>(p.byAccount[i].lastUsed||"")&&(p.byAccount[i].lastUsed=b)}for(let[a,d]of Object.entries(c.byApiKey||{})){let c=d.rawModel||"",e=d.provider||"",f=k[e]||e,g=d.apiKey?d.apiKey.trim():null,h=g?m[g]:null,i=B(g),j=h?.name||(g?i||g.slice(0,8)+"...":"Local (No API Key)"),l=i||"local-no-key";p.byApiKey[a]||(p.byApiKey[a]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:f,apiKeyMasked:i,keyName:j,apiKeyKey:l,lastUsed:b}),p.byApiKey[a].requests+=d.requests||0,p.byApiKey[a].promptTokens+=d.promptTokens||0,p.byApiKey[a].completionTokens+=d.completionTokens||0,p.byApiKey[a].cachedTokens+=d.cachedTokens||0,p.byApiKey[a].cost+=d.cost||0,b>(p.byApiKey[a].lastUsed||"")&&(p.byApiKey[a].lastUsed=b)}for(let[a,d]of Object.entries(c.byEndpoint||{})){let c=d.endpoint||a.split("|")[0]||"Unknown",e=d.rawModel||"",f=d.provider||"",g=k[f]||f;p.byEndpoint[a]||(p.byEndpoint[a]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:c,rawModel:e,provider:g,lastUsed:b}),p.byEndpoint[a].requests+=d.requests||0,p.byEndpoint[a].promptTokens+=d.promptTokens||0,p.byEndpoint[a].completionTokens+=d.completionTokens||0,p.byEndpoint[a].cachedTokens+=d.cachedTokens||0,p.byEndpoint[a].cost+=d.cost||0,b>(p.byEndpoint[a].lastUsed||"")&&(p.byEndpoint[a].lastUsed=b)}}let d=Math.max(c?Date.now()-864e5*c:0,Date.now()-1728e5);for(let a of b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint FROM usageHistory WHERE timestamp >= ?",[new Date(d).toISOString()])){let b=a.timestamp,c=a.provider?`${a.model} (${a.provider})`:a.model;if(p.byModel[c]&&new Date(b)>new Date(p.byModel[c].lastUsed)&&(p.byModel[c].lastUsed=b),a.connectionId){let c=j[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,d=`${a.model} (${a.provider} - ${c})`;p.byAccount[d]&&new Date(b)>new Date(p.byAccount[d].lastUsed)&&(p.byAccount[d].lastUsed=b)}let d=a.apiKey&&"string"==typeof a.apiKey?`${a.apiKey}|${a.model}|${a.provider||"unknown"}`:"local-no-key";p.byApiKey[d]&&new Date(b)>new Date(p.byApiKey[d].lastUsed)&&(p.byApiKey[d].lastUsed=b);let e=a.endpoint||"Unknown",f=`${e}|${a.model}|${a.provider||"unknown"}`;p.byEndpoint[f]&&new Date(b)>new Date(p.byEndpoint[f].lastUsed)&&(p.byEndpoint[f].lastUsed=b)}}else{let c;if("today"===a){let a=new Date;a.setHours(0,0,0,0),c=a.toISOString()}else c=new Date(Date.now()-864e5).toISOString();for(let a of b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, tokens FROM usageHistory WHERE timestamp >= ?",[c])){let b=(0,e.q)(a.tokens,{})||{},c=b.prompt_tokens||b.input_tokens||a.promptTokens||0,d=b.completion_tokens||b.output_tokens||a.completionTokens||0,f=b.cached_tokens||b.cache_read_input_tokens||0,g=a.cost||0,h=k[a.provider]||a.provider;p.totalPromptTokens+=c,p.totalCompletionTokens+=d,p.totalCachedTokens+=f,p.totalCost+=g,p.byProvider[a.provider]||(p.byProvider[a.provider]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),p.byProvider[a.provider].requests++,p.byProvider[a.provider].promptTokens+=c,p.byProvider[a.provider].completionTokens+=d,p.byProvider[a.provider].cachedTokens+=f,p.byProvider[a.provider].cost+=g;let i=a.provider?`${a.model} (${a.provider})`:a.model;if(p.byModel[i]||(p.byModel[i]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,lastUsed:a.timestamp}),p.byModel[i].requests++,p.byModel[i].promptTokens+=c,p.byModel[i].completionTokens+=d,p.byModel[i].cachedTokens+=f,p.byModel[i].cost+=g,new Date(a.timestamp)>new Date(p.byModel[i].lastUsed)&&(p.byModel[i].lastUsed=a.timestamp),a.connectionId){let b=j[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,e=`${a.model} (${a.provider} - ${b})`;p.byAccount[e]||(p.byAccount[e]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,connectionId:a.connectionId,accountName:b,lastUsed:a.timestamp}),p.byAccount[e].requests++,p.byAccount[e].promptTokens+=c,p.byAccount[e].completionTokens+=d,p.byAccount[e].cachedTokens+=f,p.byAccount[e].cost+=g,new Date(a.timestamp)>new Date(p.byAccount[e].lastUsed)&&(p.byAccount[e].lastUsed=a.timestamp)}if(a.apiKey&&"string"==typeof a.apiKey){let b=a.apiKey.trim(),e=m[b],i=B(b),j=e?.name||i||a.apiKey.slice(0,8)+"...",k=`${a.apiKey}|${a.model}|${a.provider||"unknown"}`;p.byApiKey[k]||(p.byApiKey[k]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,apiKeyMasked:i,keyName:j,apiKeyKey:i,lastUsed:a.timestamp});let l=p.byApiKey[k];l.requests++,l.promptTokens+=c,l.completionTokens+=d,l.cachedTokens+=f,l.cost+=g,new Date(a.timestamp)>new Date(l.lastUsed)&&(l.lastUsed=a.timestamp)}else{p.byApiKey["local-no-key"]||(p.byApiKey["local-no-key"]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:h,apiKeyMasked:null,keyName:"Local (No API Key)",apiKeyKey:"local-no-key",lastUsed:a.timestamp});let b=p.byApiKey["local-no-key"];b.requests++,b.promptTokens+=c,b.completionTokens+=d,b.cachedTokens+=f,b.cost+=g,new Date(a.timestamp)>new Date(b.lastUsed)&&(b.lastUsed=a.timestamp)}let l=a.endpoint||"Unknown",n=`${l}|${a.model}|${a.provider||"unknown"}`;p.byEndpoint[n]||(p.byEndpoint[n]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:l,rawModel:a.model,provider:h,lastUsed:a.timestamp});let o=p.byEndpoint[n];o.requests++,o.promptTokens+=c,o.completionTokens+=d,o.cachedTokens+=f,o.cost+=g,new Date(a.timestamp)>new Date(o.lastUsed)&&(o.lastUsed=a.timestamp)}}return p.totalRequests=Object.values(p.byProvider).reduce((a,b)=>a+(b.requests||0),0),p}async function T(a="7d"){let b=await (0,d.c)(),c=Date.now();if("today"===a){let a=new Date;a.setHours(0,0,0,0);let c=a.getTime(),d=c+864e5,e=Array.from({length:24},(a,b)=>({label:new Date(c+36e5*b).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let a of b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(c).toISOString()])){let b=new Date(a.timestamp).getTime();if(b<c||b>=d)continue;let f=Math.floor((b-c)/36e5);f>=0&&f<24&&(e[f].tokens+=(a.promptTokens||0)+(a.completionTokens||0),e[f].cost+=a.cost||0,e[f].requests+=1)}return e}if("24h"===a){let a=c-864e5,d=Array.from({length:24},(b,c)=>({label:new Date(a+36e5*c).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let e of b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(a).toISOString()])){let b=new Date(e.timestamp).getTime();if(b<a||b>c)continue;let f=Math.min(Math.floor((b-a)/36e5),23);d[f].tokens+=(e.promptTokens||0)+(e.completionTokens||0),d[f].cost+=e.cost||0,d[f].requests+=1}return d}let f=a=>a.toLocaleDateString("en-US",{month:"short",day:"numeric"});if("all"===a){let a=R(b,null);if(!a.length)return[];let c={};for(let b of a)c[b.dateKey]=(0,e.q)(b.data,{});let d=new Date(a[0].dateKey+"T00:00:00"),g=new Date;return g.setHours(0,0,0,0),Array.from({length:Math.max(1,Math.round((g-d)/864e5)+1)},(a,b)=>{let e=new Date(d);e.setDate(e.getDate()+b);let g=c[`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`];return{label:f(e),tokens:g?(g.promptTokens||0)+(g.completionTokens||0):0,cost:g&&g.cost||0,requests:g&&g.requests||0}})}let g="7d"===a?7:"30d"===a?30:60,h=new Date,i=R(b,g),j={};for(let a of i)j[a.dateKey]=(0,e.q)(a.data,{});return Array.from({length:g},(a,b)=>{let c=new Date(h);c.setDate(c.getDate()-(g-1-b));let d=j[`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,"0")}-${String(c.getDate()).padStart(2,"0")}`];return{label:f(c),tokens:d?(d.promptTokens||0)+(d.completionTokens||0):0,cost:d&&d.cost||0,requests:d&&d.requests||0}})}async function U(){}async function V(a=200){try{let b=(await (0,d.c)()).all("SELECT timestamp, provider, model, connectionId, promptTokens, completionTokens, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[a]);if(!b.length)return[];let f={};try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781));for(let b of(await a()))f[b.id]=b.name||b.email||""}catch{}return b.map(a=>{let b=function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${b(a.getDate())}-${b(a.getMonth()+1)}-${a.getFullYear()} ${b(a.getHours())}:${b(a.getMinutes())}:${b(a.getSeconds())}`}(new Date(a.timestamp)),c=a.provider?.toUpperCase()||"-",d=a.model||"-",g=f[a.connectionId]||(a.connectionId?a.connectionId.slice(0,8):"-"),h=a.tokens?(0,e.q)(a.tokens,{}):{},i=a.promptTokens??h.prompt_tokens??"-",j=a.completionTokens??h.completion_tokens??"-";return`${b} | ${d} | ${c} | ${g} | ${i} | ${j} | ${a.status||"-"}`})}catch(a){return console.error("[usageRepo] getRecentLogs failed:",a.message),[]}}let W=null,X=0;async function Y(){if(W&&Date.now()-X<5e3)return W;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,42655)),b=await a(),d=process.env.ENABLE_REQUEST_LOGS;if(void 0!==d)return W={enabled:"true"===d.toLowerCase(),maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))},X=Date.now(),W;let e="false"!==process.env.OBSERVABILITY_ENABLED;W={enabled:"boolean"==typeof b.enableObservability?b.enableObservability:e,maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))}}catch{W={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return X=Date.now(),W}let Z=[],$=null,_=!1;function aa(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}async function ab(){if(!_&&0!==Z.length){_=!0;try{for(;Z.length>0;){let a=Z.splice(0,Z.length),b=await (0,d.c)(),c=await Y();b.transaction(()=>{for(let d of a){d.id||(d.id=function(a){let b=new Date().toISOString(),c=Math.random().toString(36).substring(2,8),d=a?a.replace(/[^a-zA-Z0-9-]/g,"-"):"unknown";return`${b}-${c}-${d}`}(d.model)),d.timestamp||(d.timestamp=new Date().toISOString()),d.request?.headers&&(d.request.headers=function(a){if(!a||"object"!=typeof a)return{};let b=["authorization","x-api-key","cookie","token","api-key"],c={...a};for(let a of Object.keys(c))b.some(b=>a.toLowerCase().includes(b))&&delete c[a];return c}(d.request.headers));let a={id:d.id,provider:d.provider||null,model:d.model||null,connectionId:d.connectionId||null,timestamp:d.timestamp,status:d.status||null,latency:d.latency||{},tokens:d.tokens||{},request:aa(d.request,c.maxJsonSize),providerRequest:aa(d.providerRequest,c.maxJsonSize),providerResponse:aa(d.providerResponse,c.maxJsonSize),response:aa(d.response,c.maxJsonSize),pxpipe:d.pxpipe||void 0};b.run("INSERT INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET timestamp = excluded.timestamp, provider = excluded.provider, model = excluded.model, connectionId = excluded.connectionId, status = excluded.status, data = excluded.data",[a.id,a.timestamp,a.provider,a.model,a.connectionId,a.status,(0,e.s)(a)])}let d=b.get("SELECT COUNT(*) as c FROM requestDetails");d&&d.c>c.maxRecords&&b.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[d.c-c.maxRecords])})}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{_=!1}}}async function ac(a){let b=await Y();b.enabled&&(Z.push(a),Z.length>=b.batchSize?($&&(clearTimeout($),$=null),ab().catch(a=>console.error("[requestDetailsRepo] flush err:",a))):$||($=setTimeout(()=>{$=null,ab().catch(()=>{})},b.flushIntervalMs)))}async function ad(a={}){let b=await (0,d.c)(),c=[],f=[];a.provider&&(c.push("provider = ?"),f.push(a.provider)),a.model&&(c.push("model = ?"),f.push(a.model)),a.connectionId&&(c.push("connectionId = ?"),f.push(a.connectionId)),a.status&&(c.push("status = ?"),f.push(a.status)),a.startDate&&(c.push("timestamp >= ?"),f.push(new Date(a.startDate).toISOString())),a.endDate&&(c.push("timestamp <= ?"),f.push(new Date(a.endDate).toISOString()));let g=c.length?`WHERE ${c.join(" AND ")}`:"",h=b.get(`SELECT COUNT(*) as c FROM requestDetails ${g}`,f),i=h?h.c:0,j=a.page||1,k=a.pageSize||50,l=Math.ceil(i/k);return{details:b.all(`SELECT data FROM requestDetails ${g} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...f,k,(j-1)*k]).map(a=>(0,e.q)(a.data,{})),pagination:{page:j,pageSize:k,totalItems:i,totalPages:l,hasNext:j<l,hasPrev:j>1}}}async function ae(){return(await (0,d.c)()).all("SELECT DISTINCT provider FROM requestDetails WHERE provider IS NOT NULL ORDER BY provider ASC").map(a=>a.provider)}let af=async()=>{$&&(clearTimeout($),$=null),Z.length>0&&await ab()};async function ag(){let a=await (0,d.c)(),{exportSettings:b}=await Promise.resolve().then(c.bind(c,42655)),g={settings:await b(),providerConnections:a.all("SELECT * FROM providerConnections").map(a=>({...(0,e.q)(a.data,{}),id:a.id,provider:a.provider,authType:a.authType,name:a.name,email:a.email,priority:a.priority,isActive:1===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt})),providerNodes:a.all("SELECT * FROM providerNodes").map(a=>({...(0,e.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt})),proxyPools:a.all("SELECT * FROM proxyPools").map(a=>({...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt})),apiKeys:a.all("SELECT * FROM apiKeys").map(a=>({id:a.id,key:a.key,name:a.name,machineId:a.machineId,isActive:1===a.isActive,createdAt:a.createdAt,access:(0,f.xE)(a.accessRestricted,a.accessAllow)})),combos:a.all("SELECT * FROM combos").map(a=>({id:a.id,name:a.name,kind:a.kind,models:(0,e.q)(a.models,[]),createdAt:a.createdAt,updatedAt:a.updatedAt})),modelAliases:{},customModels:[],mitmAlias:{},pricing:{}};for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'modelAliases'"))g.modelAliases[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'customModels'"))g.customModels.push((0,e.q)(b.value));for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'mitmAlias'"))g.mitmAlias[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'pricing'"))g.pricing[b.key]=(0,e.q)(b.value);return g}async function ah(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("Invalid database payload");let b=await (0,d.c)();return b.transaction(()=>{for(let c of(b.run("DELETE FROM settings"),b.run("DELETE FROM providerConnections"),b.run("DELETE FROM providerNodes"),b.run("DELETE FROM proxyPools"),b.run("DELETE FROM apiKeys"),b.run("DELETE FROM combos"),b.run("DELETE FROM kv WHERE scope IN ('modelAliases', 'customModels', 'mitmAlias', 'pricing')"),a.settings&&b.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(a.settings)]),a.providerConnections||[])){let{id:a,provider:d,authType:f,name:g,email:h,priority:i,isActive:j,createdAt:k,updatedAt:l,...m}=c;b.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[a,d,f||"oauth",g||null,h||null,i||null,+(!1!==j),(0,e.s)(m),k||new Date().toISOString(),l||new Date().toISOString()])}for(let c of a.providerNodes||[]){let{id:a,type:d,name:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,d||null,f||null,(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.proxyPools||[]){let{id:a,isActive:d,testStatus:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,+(!1!==d),f||"unknown",(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.apiKeys||[]){let a=g.M0;if(void 0!==c.access){let b=(0,f.M7)(c.access);if(!b.ok)throw Error(`apiKeys ${c.id}: ${b.error}`);a=b.value}let d=(0,f.aB)(a);b.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt, accessRestricted, accessAllow) VALUES(?, ?, ?, ?, ?, ?, ?, ?)",[c.id,c.key,c.name||null,c.machineId||null,+(!1!==c.isActive),c.createdAt||new Date().toISOString(),d.accessRestricted,d.accessAllow])}for(let c of a.combos||[])b.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c.id,c.name,c.kind||null,(0,e.s)(c.models||[]),c.createdAt||new Date().toISOString(),c.updatedAt||new Date().toISOString()]);for(let[c,d]of Object.entries(a.modelAliases||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[c,(0,e.s)(d)]);for(let c of a.customModels||[]){let a=`${c.providerAlias}|${c.id}|${c.type||"llm"}`;b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[a,(0,e.s)(c)])}for(let[c,d]of Object.entries(a.mitmAlias||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[c,(0,e.s)(d||{})]);for(let[c,d]of Object.entries(a.pricing||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[c,(0,e.s)(d||{})])}),await ag()}process.off("beforeExit",af),process.off("SIGINT",af),process.off("SIGTERM",af),process.off("exit",af),process.on("beforeExit",af),process.on("SIGINT",af),process.on("SIGTERM",af),process.on("exit",af)},95658:(a,b,c)=>{"use strict";c.d(b,{AL:()=>j,HG:()=>i,Jh:()=>m,KQ:()=>k,Or:()=>l});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(49120);let i=e().join(h.n,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.n,"db.json"),usage:e().join(h.n,"usage.json"),disabled:e().join(h.n,"disabledModels.json"),details:e().join(h.n,"request-details.json")};function m(){for(let a of[h.n,i,k])g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},96487:()=>{},97914:(a,b,c)=>{"use strict";c.d(b,{KJ:()=>l,VT:()=>n,getPricingForModel:()=>k,r4:()=>j,yF:()=>m});var d=c(36366),e=c(644);let f=(0,c(22846).U)("pricing"),g={value:null,expiresAt:0};function h(){g={value:null,expiresAt:0}}async function i(){return await f.getAll()}async function j(){let a=Date.now();if(g.value&&g.expiresAt>a)return g.value;let b=await i(),{PROVIDER_PRICING:d}=await c.e(8920).then(c.bind(c,58920)),e={};for(let[a,c]of Object.entries(d))if(e[a]={...c},b[a])for(let[c,d]of Object.entries(b[a]))e[a][c]=e[a][c]?{...e[a][c],...d}:d;for(let[a,c]of Object.entries(b))if(e[a])for(let[b,d]of Object.entries(c))e[a][b]||(e[a][b]=d);else e[a]={...c};return g={value:e,expiresAt:a+5e3},e}async function k(a,b){if(!b)return null;let d=await i();if(a&&d[a]?.[b])return d[a][b];let{getPricingForModel:e}=await c.e(8920).then(c.bind(c,58920));return e(a,b)}async function l(a){let b=await (0,d.c)();return b.transaction(()=>{for(let[c,d]of Object.entries(a)){let a=b.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[c]),f={...a&&(0,e.q)(a.value,{})||{}};for(let[a,b]of Object.entries(d))f[a]=b;b.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[c,(0,e.s)(f)])}}),h(),await i()}async function m(a,b){if(!a)return await i();let c=await (0,d.c)();return c.transaction(()=>{if(!b)return void c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]);let d=c.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[a]),f=d&&(0,e.q)(d.value,{})||{};delete f[b],0===Object.keys(f).length?c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]):c.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,(0,e.s)(f)])}),h(),await i()}async function n(){return await f.clear(),h(),{}}}};
@@ -50,8 +50,8 @@ ${c}
50
50
  `.replace(/'/g,"'\\''");await t(`printf '%s' '${e}' | tee ${q} > /dev/null`,b),await u(b)}i(`🌐 DNS ${a}: ✅ added ${d.join(", ")}`)}catch(a){throw Error(a.message?.includes("incorrect password")?"Wrong sudo password":`Failed to add DNS entry: ${a.message}`)}}async function x(a,b){let c=k[a];if(!c)throw Error(`Unknown tool: ${a}`);let d=c.filter(a=>v(a));if(0===d.length)return void i(`🌐 DNS ${a}: already inactive`);try{if(o){let a=g.readFileSync(q,"utf8"),b=a.split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";n(q,a,b),await l("ipconfig /flushdns | Out-Null")}else{let a=(g.readFileSync(q,"utf8").split(/\r?\n/).filter(a=>!d.some(b=>a.includes(b))).join("\n").replace(/[\r\n\s]+$/g,"")+"\n").replace(/'/g,"'\\''");await t(`printf '%s' '${a}' | tee ${q} > /dev/null`,b),await u(b)}i(`🌐 DNS ${a}: ✅ removed ${d.join(", ")}`)}catch(a){throw Error(a.message?.includes("incorrect password")?"Wrong sudo password":`Failed to remove DNS entry: ${a.message}`)}}async function y(a){for(let b of Object.keys(k))try{await x(b,a)}catch(a){j(`DNS ${b}: failed to remove — ${a.message}`)}}a.exports={TOOL_HOSTS:k,addDNSEntry:w,removeDNSEntry:x,removeAllDNSEntries:y,removeAllDNSEntriesSync:function(){try{if(!g.existsSync(q))return;let a=Object.values(k).flat(),b=g.readFileSync(q,"utf8"),c=o?"\r\n":"\n",d=b.split(/\r?\n/).filter(b=>!a.some(a=>b.includes(a))).join(c).replace(/[\r\n\s]+$/g,"")+c;if(d===b)return;if(g.writeFileSync(q,d,"utf8"),o)try{f("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}else if(p)try{f("dscacheutil -flushcache && killall -HUP mDNSResponder",{stdio:"ignore"})}catch{}else try{f("resolvectl flush-caches 2>/dev/null || true",{stdio:"ignore"})}catch{}}catch{}},execWithPassword:t,isSudoAvailable:r,canRunSudoWithoutPassword:s,isSudoPasswordRequired:function(){return!o&&r()&&!s()},checkDNSEntry:v,checkAllDNSStatus:function(){try{let a=g.readFileSync(q,"utf8"),b={};for(let[c,d]of Object.entries(k))b[c]=d.every(b=>a.includes(b));return b}catch{return Object.fromEntries(Object.keys(k).map(a=>[a,!1]))}}}},82193:(a,b,c)=>{let d=c(29021),e=c(33873),f=c(21820),g="omnihilbras";function h(){return"win32"===process.platform?e.join(process.env.APPDATA||e.join(f.homedir(),"AppData","Roaming"),g):e.join(f.homedir(),`.${g}`)}let i=function(){let a=process.env.DATA_DIR;if(!a)return h();try{return d.mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${g}`),h();throw b}}(),j=e.join(i,"mitm");a.exports={DATA_DIR:i,MITM_DIR:j}},85341:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["runtime.us-east-1.kiro.dev","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},87777:(a,b,c)=>{let d=c(29021),e=c(33873),f=c(74075),{DATA_DIR:g}=c(82193),{LOG_BLACKLIST_URL_PARTS:h}=c(17511);function i(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let j=e.join(g,"logs","mitm");d.existsSync(j)||d.mkdirSync(j,{recursive:!0});let k=/^\s*(\{\s*\}|\[\s*\]|null)?\s*$/;function l(a,b=80){return String(a).replace(/[^a-zA-Z0-9]/g,"_").substring(0,b)}function m(a){return!!a&&h.some(b=>a.includes(b))}a.exports={log:a=>console.log(`[${i()}] [MITM] ${a}`),err:a=>console.error(`[${i()}] ❌ [MITM] ${a}`),dumpRequest:function(a,b,c="raw"){if(m(a.url))return null;try{let f=new Date().toISOString().replace(/[:.]/g,"-"),g=l((a.headers.host||"")+a.url),h=e.join(j,`${f}_${c}_${g}.req.json`),i=null;try{i=JSON.parse(b.toString())}catch{}return d.writeFileSync(h,JSON.stringify({method:a.method,url:a.url,host:a.headers.host,headers:a.headers,body:i??b.toString("utf8")},null,2)),h}catch{return null}},createResponseDumper:function(a,b="raw"){if(m(a.url))return null;let c=new Date().toISOString().replace(/[:.]/g,"-"),g=l((a.headers.host||"")+a.url),h=e.join(j,`${c}_${b}_${g}.res.txt`),i=0,n={},o=[];return{writeHeader:(a,b)=>{i=a,n=b||{}},writeChunk:a=>{null!=a&&o.push(Buffer.isBuffer(a)?a:Buffer.from(a))},end:()=>{try{let a=Buffer.concat(o),b=n["content-encoding"]||n["Content-Encoding"],c=(function(a,b){if(!a||0===a.length)return a;try{let c=(b||"").toLowerCase();if(c.includes("gzip"))return f.gunzipSync(a);if(c.includes("br"))return f.brotliDecompressSync(a);if(c.includes("deflate"))return f.inflateSync(a)}catch{}return a})(a,b).toString("utf8");if(k.test(c))return;let e={...n};delete e["content-encoding"],delete e["Content-Encoding"];let g=`STATUS: ${i}
51
51
  HEADERS: ${JSON.stringify(e,null,2)}
52
52
  ---BODY---
53
- ${c}`;d.writeFileSync(h,g)}catch{}},file:h}},clearDumpDir:function(){try{if(!d.existsSync(j))return;for(let a of d.readdirSync(j))try{d.rmSync(e.join(j,a),{recursive:!0,force:!0})}catch{}}catch{}}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},96182:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(66936),{isAdmin:u}=c(64809),v="win32"===process.platform,w="darwin"===process.platform,{generateCert:x}=c(26033),{installCert:y,uninstallCert:z}=c(9631),{isCertExpired:A}=c(8578),{DATA_DIR:B,MITM_DIR:C}=c(82193),{log:D,err:E}=c(87777),{LSOF_BIN:F}=c(17511),G="http://localhost:20128";function H(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function I(){if(!_)return G;try{let a=await _(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return G;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return G;return b.replace(/\/+$/,"")}catch{return G}}let J=g.join(C,".mitm.pid"),K=g.join(C,".mitm.lock"),L=[5e3,1e4,2e4,3e4,6e4],M=0,N=0,O=!1;function P(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function Q(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(B,"runtime","mitm"),c=g.join(b,"server.js");if(h.existsSync(c))try{if(h.statSync(a).size===h.statSync(c).size)return c}catch{}return h.mkdirSync(b,{recursive:!0}),h.copyFileSync(a,c),c}catch(b){try{D(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let R=Q(P()),S="aes-256-gcm",T="omnihilbras-mitm-pwd",U=null,V=null;function W(){return globalThis.__mitmSudoPassword||null}function X(a){globalThis.__mitmSudoPassword=a}function Y(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function Z(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(66936);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function $(){try{let{machineIdSync:a}=c(19713),b=a();return l.createHash("sha256").update(b+T).digest()}catch{return l.createHash("sha256").update(T).digest()}}let _=null,aa=null;async function ab(a,b){if(aa)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=$(),d=l.randomBytes(12),e=l.createCipheriv(S,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await aa(h)}catch(a){E(`Failed to save settings: ${a.message}`)}}async function ac(){if(aa)try{await aa({mitmSudoEncrypted:null})}catch(a){E(`Failed to clear encrypted password: ${a.message}`)}}async function ad(){if(!_)return null;try{let a=await _();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=$(),f=l.createDecipheriv(S,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ae(a,b){if(aa&&_)try{let c={...(await _()).dnsToolEnabled||{},[a]:b};await aa({dnsToolEnabled:c})}catch(a){E(`Failed to save DNS state: ${a.message}`)}}async function af(){if(!_)return{};try{return(await _()).dnsToolEnabled||{}}catch{return{}}}async function ag(a){let b=await af(),c=a||W()||await ad();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){E(`DNS ${a}: restore failed — ${b.message}`)}}async function ah(){return v?u():!(!u()&&t())||!!(W()||await ad())}function ai(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d(`${F} -nP -iTCP:443 -sTCP:LISTEN -t`,{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function aj(a){if(U&&!U.killed){try{U.kill("SIGKILL")}catch{}U=null,V=null}try{if(h.existsSync(J)){let b=parseInt(h.readFileSync(J,"utf-8").trim(),10);b&&Y(b)&&(Z(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(J)}}catch{}if(!v&&R)try{let b=R.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(66936);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function ak(){let a=null!==U&&!U.killed,b=V;if(!a)try{if(h.existsSync(J)){let c=parseInt(h.readFileSync(J,"utf-8").trim(),10);c&&Y(c)?(a=!0,b=c):h.unlinkSync(J)}}catch{}let d=q(),e=g.join(C,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(9631),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function al(a){if(O)return;if(O=!0,Date.now()-N>=6e4&&(M=0),M>=5){E("Max restart attempts reached. Giving up."),O=!1;return}let b=L[Math.min(M,L.length-1)];M++,D(`Restarting in ${b/1e3}s... (${M}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=_?await _():null;if(b&&!b.mitmEnabled){D("MITM disabled, skipping restart"),O=!1;return}let c=W()||await ad();if(!c&&!v){E("No cached password, cannot auto-restart"),O=!1;return}await an(a,c),D("\uD83D\uDD04 Restarted successfully"),M=0,O=!1}catch(b){E(`Restart attempt ${M}/5 failed: ${b.message}`),O=!1,al(a)}}async function am(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(66936);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function an(a,b,l=!1){if(!U||U.killed)try{if(h.existsSync(J)){let a=parseInt(h.readFileSync(J,"utf-8").trim(),10);if(a&&Y(a))return V=a,D(`♻️ Reusing existing process (PID: ${a})`),await ab(!0,b),b&&X(b),{running:!0,pid:a};h.unlinkSync(J)}}catch{}if(U&&!U.killed)throw Error("MITM server is already running");try{h.writeFileSync(K,String(process.pid),{flag:"wx"})}catch(a){if("EEXIST"===a.code){let a=!1;try{let b=parseInt(h.readFileSync(K,"utf-8").trim(),10);a=!b||!Y(b)}catch{a=!0}if(!a)throw Error("MITM server is already starting (lock contention)");try{h.unlinkSync(K)}catch{}h.writeFileSync(K,String(process.pid),{flag:"wx"})}else throw a}try{if(await aj(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ai(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(l)D(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await am(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let m=g.join(C,"rootCA.crt"),n=g.join(C,"rootCA.key"),o=h.existsSync(m)&&h.existsSync(n);if(!o||A(m)){if(o){D("\uD83D\uDD10 Cert expired — uninstalling old cert...");let a=b||W()||await ad();try{await z(a,m)}catch{}}D("\uD83D\uDD10 Generating Root CA..."),await x()}let{checkCertInstalled:p}=c(9631),r=await p(m),u=!v&&!w&&!s();if(r)D("\uD83D\uDD10 Cert: already trusted ✅");else{D("\uD83D\uDD10 Cert: not trusted → installing...");let a=b||W()||await ad();if(u)D(`🔐 Cert: skipping system trust (no sudo). Install ${m} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await y(a,m),D("\uD83D\uDD10 Cert: ✅ trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}let B=R;if((!B||!h.existsSync(B))&&(D(`[MITM] server.js missing at ${B} → recopying`),!(B=Q(P()))||!h.existsSync(B)))throw Error(`MITM server.js not found at ${B}. Reinstall omnihilbras.`);let G=await I();if(D(`🚀 Starting server... (router: ${G})`),v){let c=await ai(b);if(c)if(l)D(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await am(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}U=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,OMNIHILBRAS_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}}),aa&&await aa({mitmCertInstalled:!0}).catch(()=>{})}else if(s()){let c=[`HOME=${H(i.homedir())}`,`OMNIHILBRAS_API_KEY=${H(a)}`,`MITM_ROUTER_BASE=${H(G)}`,"NODE_ENV=production",H(process.execPath),H(B)].join(" ");(U=e("sudo",["-S","-E","sh","-c",c],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
54
- `),U.stdin.end()}else U=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,OMNIHILBRAS_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}});if(U&&(V=U.pid,h.writeFileSync(J,String(V)),N=Date.now()),w){let a=g.join(C,"rootCA.crt");h.existsSync(a)&&d(`launchctl setenv NODE_EXTRA_CA_CERTS "${a}"`,{windowsHide:!0},b=>{b?D(`[launchctl] Failed to set NODE_EXTRA_CA_CERTS: ${b.message}`):D(`[launchctl] NODE_EXTRA_CA_CERTS set to ${a}`)})}else if(v){let a=g.join(C,"rootCA.crt");h.existsSync(a)&&d(`setx NODE_EXTRA_CA_CERTS "${a}"`,{windowsHide:!0},a=>{a?D(`[setx] Failed to set NODE_EXTRA_CA_CERTS: ${a.message}`):D("[setx] NODE_EXTRA_CA_CERTS set for current user")})}let L=null;U&&(U.stdout.on("data",a=>{process.stdout.write(a)}),U.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(E(b),L=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(X(null),ac(),O=!0)}),U.on("exit",b=>{D(`Server exited (code: ${b})`),U=null,V=null;try{h.unlinkSync(J)}catch{}try{h.unlinkSync(K)}catch{}0===b||O||al(a)}));let M=await function(a=443){return new Promise(b=>{let c=Date.now()+8e3,d=()=>{let e=k.request({hostname:"127.0.0.1",port:a,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let c="";a.on("data",a=>{c+=a}),a.on("end",()=>{try{let a=JSON.parse(c);b(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{b(null)}})});e.on("error",()=>{Date.now()<c?setTimeout(d,500):b(null)}),e.end()};d()})}(443);if(!M){if(U&&!U.killed){try{U.kill()}catch{}U=null}let a=function(){try{if(v){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f(`${F} -i :443`,{encoding:"utf8",windowsHide:!0}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=L||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}aa&&await aa({mitmCertInstalled:!0}).catch(()=>{}),D(`✅ Server healthy (PID: ${V||M.pid})`);let S=q();for(let[a,b]of Object.entries(S))D(`🌐 DNS ${a}: ${b?"✅ active":"❌ inactive"}`);await ab(!0,b),b&&X(b);try{h.unlinkSync(K)}catch{}return{running:!0,pid:V}}catch(a){try{h.unlinkSync(K)}catch{}throw a}}async function ao(a){O=!0,M=0,D("⏹ Stopping server...");let b=U,e=b&&!b.killed?b.pid:(()=>{try{return parseInt(h.readFileSync(J,"utf-8").trim(),10)}catch{return null}})();if(e&&Y(e)&&(D(`Killing server (PID: ${e})...`),Z(e,!1,a),await new Promise(a=>setTimeout(a,1e3)),Y(e)&&Z(e,!0,a)),U=null,V=null,v){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),b=Object.values(r).flat();try{let{isAdmin:d,runElevatedPowerShell:e,quotePs:f}=c(64809);if(d()){let d=h.readFileSync(a,"utf8"),e=d.split(/\r?\n/).filter(a=>!b.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";e!==d&&h.writeFileSync(a,e,"utf8");try{c(79646).execSync("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}D("\uD83C\uDF10 DNS: ✅ all tool hosts removed")}else{let c=b.map(f).join(","),d=`
53
+ ${c}`;d.writeFileSync(h,g)}catch{}},file:h}},clearDumpDir:function(){try{if(!d.existsSync(j))return;for(let a of d.readdirSync(j))try{d.rmSync(e.join(j,a),{recursive:!0,force:!0})}catch{}}catch{}}}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(83192)},96182:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(66936),{isAdmin:u}=c(64809),v="win32"===process.platform,w="darwin"===process.platform,{generateCert:x}=c(26033),{installCert:y,uninstallCert:z}=c(9631),{isCertExpired:A}=c(8578),{DATA_DIR:B,MITM_DIR:C}=c(82193),{log:D,err:E}=c(87777),{LSOF_BIN:F}=c(17511),G="http://localhost:20128";function H(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function I(){if(!_)return G;try{let a=await _(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return G;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return G;return b.replace(/\/+$/,"")}catch{return G}}let J=g.join(C,".mitm.pid"),K=g.join(C,".mitm.lock"),L=[5e3,1e4,2e4,3e4,6e4],M=0,N=0,O=!1;function P(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function Q(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(B,"runtime","mitm"),c=g.join(b,"server.js");if(h.existsSync(c))try{if(h.statSync(a).size===h.statSync(c).size)return c}catch{}return h.mkdirSync(b,{recursive:!0}),h.copyFileSync(a,c),c}catch(b){try{D(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let R=Q(P()),S="aes-256-gcm",T="omnihilbras-mitm-pwd",U=null,V=null;function W(){return globalThis.__mitmSudoPassword||null}function X(a){globalThis.__mitmSudoPassword=a}function Y(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function Z(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(66936);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function $(){try{let{machineIdSync:a}=c(19713),b=a();return l.createHash("sha256").update(b+T).digest()}catch{return l.createHash("sha256").update(T).digest()}}let _=null,aa=null;async function ab(a,b){if(aa)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=$(),d=l.randomBytes(12),e=l.createCipheriv(S,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await aa(h)}catch(a){E(`Failed to save settings: ${a.message}`)}}async function ac(){if(aa)try{await aa({mitmSudoEncrypted:null})}catch(a){E(`Failed to clear encrypted password: ${a.message}`)}}async function ad(){if(!_)return null;try{let a=await _();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=$(),f=l.createDecipheriv(S,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ae(a,b){if(aa&&_)try{let c={...(await _()).dnsToolEnabled||{},[a]:b};await aa({dnsToolEnabled:c})}catch(a){E(`Failed to save DNS state: ${a.message}`)}}async function af(){if(!_)return{};try{return(await _()).dnsToolEnabled||{}}catch{return{}}}async function ag(a){let b=await af(),c=a||W()||await ad();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){E(`DNS ${a}: restore failed — ${b.message}`)}}async function ah(){return v?u():!(!u()&&t())||!!(W()||await ad())}function ai(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d(`${F} -nP -iTCP:443 -sTCP:LISTEN -t`,{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function aj(a){if(U&&!U.killed){try{U.kill("SIGKILL")}catch{}U=null,V=null}try{if(h.existsSync(J)){let b=parseInt(h.readFileSync(J,"utf-8").trim(),10);b&&Y(b)&&(Z(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(J)}}catch{}if(!v&&R)try{let b=R.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(66936);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function ak(){let a=null!==U&&!U.killed,b=V;if(!a)try{if(h.existsSync(J)){let c=parseInt(h.readFileSync(J,"utf-8").trim(),10);c&&Y(c)?(a=!0,b=c):h.unlinkSync(J)}}catch{}let d=q(),e=g.join(C,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(9631),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function al(a){if(O)return;if(O=!0,Date.now()-N>=6e4&&(M=0),M>=5){E("Max restart attempts reached. Giving up."),O=!1;return}let b=L[Math.min(M,L.length-1)];M++,D(`Restarting in ${b/1e3}s... (${M}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=_?await _():null;if(b&&!b.mitmEnabled){D("MITM disabled, skipping restart"),O=!1;return}let c=W()||await ad();if(!c&&!v){E("No cached password, cannot auto-restart"),O=!1;return}await an(a,c),D("\uD83D\uDD04 Restarted successfully"),M=0,O=!1}catch(b){E(`Restart attempt ${M}/5 failed: ${b.message}`),O=!1,al(a)}}async function am(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(66936);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function an(a,b,l=!1){if(!U||U.killed)try{if(h.existsSync(J)){let a=parseInt(h.readFileSync(J,"utf-8").trim(),10);if(a&&Y(a))return V=a,D(`♻️ Reusing existing process (PID: ${a})`),await ab(!0,b),b&&X(b),{running:!0,pid:a};h.unlinkSync(J)}}catch{}if(U&&!U.killed)throw Error("MITM server is already running");try{h.writeFileSync(K,String(process.pid),{flag:"wx"})}catch(a){if("EEXIST"===a.code){let a=!1;try{let b=parseInt(h.readFileSync(K,"utf-8").trim(),10);a=!b||!Y(b)}catch{a=!0}if(!a)throw Error("MITM server is already starting (lock contention)");try{h.unlinkSync(K)}catch{}h.writeFileSync(K,String(process.pid),{flag:"wx"})}else throw a}try{if(await aj(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ai(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(l)D(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await am(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let m=g.join(C,"rootCA.crt"),n=g.join(C,"rootCA.key"),o=h.existsSync(m)&&h.existsSync(n);if(!o||A(m)){if(o){D("\uD83D\uDD10 Cert expired — uninstalling old cert...");let a=b||W()||await ad();try{await z(a,m)}catch{}}D("\uD83D\uDD10 Generating Root CA..."),await x()}let{checkCertInstalled:p}=c(9631),r=await p(m),u=!v&&!w&&!s();if(r)D("\uD83D\uDD10 Cert: already trusted ✅");else{D("\uD83D\uDD10 Cert: not trusted → installing...");let a=b||W()||await ad();if(u)D(`🔐 Cert: skipping system trust (no sudo). Install ${m} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await y(a,m),D("\uD83D\uDD10 Cert: ✅ trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}let B=R;if((!B||!h.existsSync(B))&&(D(`[MITM] server.js missing at ${B} → recopying`),!(B=Q(P()))||!h.existsSync(B)))throw Error(`MITM server.js not found at ${B}. Reinstall @hilbras/omnihilbras.`);let G=await I();if(D(`🚀 Starting server... (router: ${G})`),v){let c=await ai(b);if(c)if(l)D(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await am(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}U=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,OMNIHILBRAS_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}}),aa&&await aa({mitmCertInstalled:!0}).catch(()=>{})}else if(s()){let c=[`HOME=${H(i.homedir())}`,`OMNIHILBRAS_API_KEY=${H(a)}`,`MITM_ROUTER_BASE=${H(G)}`,"NODE_ENV=production",H(process.execPath),H(B)].join(" ");(U=e("sudo",["-S","-E","sh","-c",c],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
54
+ `),U.stdin.end()}else U=e(process.execPath,[B],{detached:!1,windowsHide:!0,cwd:i.tmpdir(),stdio:["ignore","pipe","pipe"],env:{...process.env,OMNIHILBRAS_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:G}});if(U&&(V=U.pid,h.writeFileSync(J,String(V)),N=Date.now()),w){let a=g.join(C,"rootCA.crt");h.existsSync(a)&&d(`launchctl setenv NODE_EXTRA_CA_CERTS "${a}"`,{windowsHide:!0},b=>{b?D(`[launchctl] Failed to set NODE_EXTRA_CA_CERTS: ${b.message}`):D(`[launchctl] NODE_EXTRA_CA_CERTS set to ${a}`)})}else if(v){let a=g.join(C,"rootCA.crt");h.existsSync(a)&&d(`setx NODE_EXTRA_CA_CERTS "${a}"`,{windowsHide:!0},a=>{a?D(`[setx] Failed to set NODE_EXTRA_CA_CERTS: ${a.message}`):D("[setx] NODE_EXTRA_CA_CERTS set for current user")})}let L=null;U&&(U.stdout.on("data",a=>{process.stdout.write(a)}),U.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(E(b),L=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(X(null),ac(),O=!0)}),U.on("exit",b=>{D(`Server exited (code: ${b})`),U=null,V=null;try{h.unlinkSync(J)}catch{}try{h.unlinkSync(K)}catch{}0===b||O||al(a)}));let M=await function(a=443){return new Promise(b=>{let c=Date.now()+8e3,d=()=>{let e=k.request({hostname:"127.0.0.1",port:a,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let c="";a.on("data",a=>{c+=a}),a.on("end",()=>{try{let a=JSON.parse(c);b(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{b(null)}})});e.on("error",()=>{Date.now()<c?setTimeout(d,500):b(null)}),e.end()};d()})}(443);if(!M){if(U&&!U.killed){try{U.kill()}catch{}U=null}let a=function(){try{if(v){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f(`${F} -i :443`,{encoding:"utf8",windowsHide:!0}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=L||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}aa&&await aa({mitmCertInstalled:!0}).catch(()=>{}),D(`✅ Server healthy (PID: ${V||M.pid})`),O=!1;let S=q();for(let[a,b]of Object.entries(S))D(`🌐 DNS ${a}: ${b?"✅ active":"❌ inactive"}`);await ab(!0,b),b&&X(b);try{h.unlinkSync(K)}catch{}return{running:!0,pid:V}}catch(a){try{h.unlinkSync(K)}catch{}throw a}}async function ao(a){O=!0,M=0,D("⏹ Stopping server...");let b=U,e=b&&!b.killed?b.pid:(()=>{try{return parseInt(h.readFileSync(J,"utf-8").trim(),10)}catch{return null}})();if(e&&Y(e)&&(D(`Killing server (PID: ${e})...`),Z(e,!1,a),await new Promise(a=>setTimeout(a,1e3)),Y(e)&&Z(e,!0,a)),U=null,V=null,v){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),b=Object.values(r).flat();try{let{isAdmin:d,runElevatedPowerShell:e,quotePs:f}=c(64809);if(d()){let d=h.readFileSync(a,"utf8"),e=d.split(/\r?\n/).filter(a=>!b.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";e!==d&&h.writeFileSync(a,e,"utf8");try{c(79646).execSync("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}D("\uD83C\uDF10 DNS: ✅ all tool hosts removed")}else{let c=b.map(f).join(","),d=`
55
55
  $hosts = @(${c})
56
56
  $lines = Get-Content -LiteralPath ${f(a)}
57
57
  $filtered = $lines | Where-Object {
@@ -1 +1 @@
1
- "use strict";exports.id=9609,exports.ids=[3662,9609],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},39609:(a,b,c)=>{c.r(b),c.d(b,{default:()=>u,proxyAwareFetch:()=>s});var d=c(27910),e=c(41004);let f=globalThis.fetch,g=new Map,h=new Map,i=new Set(["SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","CERT_HAS_EXPIRED","ERR_TLS_CERT_ALTNAME_INVALID"]),j=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],k=["8.8.8.8","8.8.4.4"];function l(a){return null==a?"":String(a).trim()}async function m(a){let b=h.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(k);let g=d(f.resolve4.bind(f)),i=await g(a);return h.set(a,{ip:i[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),i[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function n(a,b){let c,d=l(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function o(a){let b=l(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function p(a,b=!1){let d=o(a);if(!d&&!b)return null;let f=`${d||"direct"}::${b?"insecure":"secure"}`;if(!g.has(f)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{Agent:a,ProxyAgent:h}=await c.e(7774).then(c.t.bind(c,47774,19)),i=b?{rejectUnauthorized:!1}:void 0,j=d?new h({uri:d,...b?{requestTls:i}:{}}):new a({connect:i});g.set(f,j)}return g.get(f)}async function q(a,b,c){try{let d=c?await p(c):void 0;return await f(a,d?{...b,dispatcher:d}:b)}catch(e){let d;if("true"!==process.env.STRICT_SSL&&"1"!==process.env.STRICT_SSL&&(d=e?.cause?.code||e?.code,i.has(d))){if(b.body&&"function"==typeof b.body.getReader&&b.body.locked)throw e;console.warn(`[ProxyFetch] TLS cert verification failed (${e.cause?.code||e.code}), retrying with insecure TLS: ${a}`);let d=await p(c,!0);return await f(a,{...b,dispatcher:d})}throw e}}async function r(a,b,e){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket;g.connect(443,b,()=>{let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:e.method||"POST",headers:{...e.headers,Host:a.hostname}},i=h.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)});i.on("error",f),e.body&&i.write("string"==typeof e.body?e.body:JSON.stringify(e.body)),i.end()}),g.on("error",f)})}async function s(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=l(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers instanceof Headers?Object.fromEntries(b.headers.entries()):{...b.headers||{}},"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=l(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=l(b?.noProxy??b?.connectionNoProxy);return d&&n(a,d)?null:o(c)}(d,c),h=g?null:o(function(a){let b;if(n(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),i=g||h;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(d)){if(i)try{return await q(a,b,i)}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await m(a.hostname);if(c)return await r(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(i)try{return await q(a,b,i)}catch(d){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${d.message}`);return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${d.message}`),q(a,b,null)}let k=c?.proxyPoolId||c?.enabled===!0||c?.connectionProxyEnabled===!0||!!l(c?.url??c?.connectionProxyUrl);if(c?.strictProxy===!0&&k)throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");return q(a,b,null)}async function t(a,b={}){return s(a,b,null)}globalThis.fetch!==t&&(globalThis.fetch=t);let u=t},41004:(a,b,c)=>{c.d(b,{C8:()=>q,DR:()=>p,IK:()=>k,Ps:()=>g,SA:()=>n,Uc:()=>l,Z1:()=>i,cI:()=>o,eo:()=>m,gx:()=>d,pH:()=>j,v1:()=>e,xM:()=>h}),c(3662);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20};function f(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}let g=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search",h=f("STREAM_STALL_TIMEOUT_MS",36e4),i=f("STREAM_FIRST_CHUNK_TIMEOUT_MS",2e5),j=f("FETCH_CONNECT_TIMEOUT_MS",6e4),k=f("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3),l=64e3,m=32e3,n="x-omnihilbras-token-saver",o={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function p(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let q=["Please write a 5-10 word title for the following conversation:"]}};
1
+ "use strict";exports.id=9609,exports.ids=[3662,9609],exports.modules={3662:(a,b,c)=>{c.d(b,{EQ:()=>f,LY:()=>d,O:()=>e,fh:()=>h,t2:()=>i,wf:()=>g});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Model not found",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"improperly formed request",cooldownMs:12e4},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}]},39609:(a,b,c)=>{c.r(b),c.d(b,{default:()=>u,proxyAwareFetch:()=>s});var d=c(27910),e=c(41004);let f=globalThis.fetch,g=new Map,h=new Map,i=new Set(["SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_VERIFY_LEAF_SIGNATURE","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","CERT_HAS_EXPIRED","ERR_TLS_CERT_ALTNAME_INVALID"]),j=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],k=["8.8.8.8","8.8.4.4"];function l(a){return null==a?"":String(a).trim()}async function m(a){let b=h.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(k);let g=d(f.resolve4.bind(f)),i=await g(a);return h.set(a,{ip:i[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),i[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function n(a,b){let c,d=l(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function o(a){let b=l(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}async function p(a,b=!1){let d=o(a);if(!d&&!b)return null;let f=`${d||"direct"}::${b?"insecure":"secure"}`;if(!g.has(f)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{Agent:a,ProxyAgent:h}=await c.e(7774).then(c.t.bind(c,47774,19)),i=b?{rejectUnauthorized:!1}:void 0,j=d?new h({uri:d,...b?{requestTls:i}:{}}):new a({connect:i});g.set(f,j)}return g.get(f)}async function q(a,b,c){try{let d=c?await p(c):void 0;return await f(a,d?{...b,dispatcher:d}:b)}catch(e){let d;if("true"!==process.env.STRICT_SSL&&"1"!==process.env.STRICT_SSL&&(d=e?.cause?.code||e?.code,i.has(d))){if(b.body&&"function"==typeof b.body.getReader&&b.body.locked)throw e;console.warn(`[ProxyFetch] TLS cert verification failed (${e.cause?.code||e.code}), retrying with insecure TLS: ${a}`);let d=await p(c,!0);return await f(a,{...b,dispatcher:d})}throw e}}async function r(a,b,e){let f=await Promise.resolve().then(c.t.bind(c,55591,23)),g=await Promise.resolve().then(c.t.bind(c,91645,23)),h=f.default??f,i=g.default??g;return new Promise((c,f)=>{let g=new i.Socket;if(g.connect(443,b,()=>{let b={socket:g,servername:a.hostname,path:a.pathname+a.search,method:e.method||"POST",headers:{...e.headers,Host:a.hostname}},i=h.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};c(b)});i.on("error",f),e.body&&i.write("string"==typeof e.body?e.body:JSON.stringify(e.body)),i.end()}),g.on("error",f),e.signal){let a=!1,b=()=>{a||(a=!0,g.destroy(),f(new DOMException("The operation was aborted","AbortError")))};e.signal.aborted?b():(e.signal.addEventListener("abort",b,{once:!0}),g.once("close",()=>e.signal.removeEventListener("abort",b)))}})}async function s(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=l(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers instanceof Headers?Object.fromEntries(b.headers.entries()):{...b.headers||{}},"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=l(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=l(b?.noProxy??b?.connectionNoProxy);return d&&n(a,d)?null:o(c)}(d,c),h=g?null:o(function(a){let b;if(n(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),i=g||h;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(d)){if(i)try{return await q(a,b,i)}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await m(a.hostname);if(c)return await r(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(i)try{return await q(a,b,i)}catch(d){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${d.message}`);return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${d.message}`),q(a,b,null)}let k=c?.proxyPoolId||c?.enabled===!0||c?.connectionProxyEnabled===!0||!!l(c?.url??c?.connectionProxyUrl);if(c?.strictProxy===!0&&k)throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");return q(a,b,null)}async function t(a,b={}){return s(a,b,null)}globalThis.fetch!==t&&(globalThis.fetch=t);let u=t},41004:(a,b,c)=>{c.d(b,{C8:()=>q,DR:()=>p,IK:()=>k,Ps:()=>g,SA:()=>n,Uc:()=>l,Z1:()=>i,cI:()=>o,eo:()=>m,gx:()=>d,pH:()=>j,v1:()=>e,xM:()=>h}),c(3662);let d={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,NOT_ACCEPTABLE:406,REQUEST_TIMEOUT:408,RATE_LIMITED:429,SERVER_ERROR:500,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},e={sessionTtlMs:72e5,sessionCleanupIntervalMs:18e5,dnsCacheTtlMs:3e5,proxyDispatchersMaxSize:20};function f(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}let g=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search",h=f("STREAM_STALL_TIMEOUT_MS",36e4),i=f("STREAM_FIRST_CHUNK_TIMEOUT_MS",2e5),j=f("FETCH_CONNECT_TIMEOUT_MS",6e4),k=f("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3),l=64e3,m=32e3,n="x-omnihilbras-token-saver",o={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}};function p(a){return null==a?{attempts:0,delayMs:2e3}:"number"==typeof a?{attempts:a,delayMs:2e3}:{attempts:a.attempts||0,delayMs:null!=a.delayMs?a.delayMs:2e3}}let q=["Please write a 5-10 word title for the following conversation:"]}};
@@ -1 +1 @@
1
- {"version":1,"files":["../package.json","chunks/1019.js","chunks/1133.js","chunks/1159.js","chunks/1260.js","chunks/1306.js","chunks/1329.js","chunks/1455.js","chunks/1679.js","chunks/1757.js","chunks/1813.js","chunks/1998.js","chunks/2116.js","chunks/2132.js","chunks/2220.js","chunks/238.js","chunks/2391.js","chunks/24.js","chunks/241.js","chunks/2430.js","chunks/2578.js","chunks/2712.js","chunks/2750.js","chunks/2970.js","chunks/3016.js","chunks/3031.js","chunks/3225.js","chunks/3276.js","chunks/3449.js","chunks/3535.js","chunks/3546.js","chunks/3558.js","chunks/3593.js","chunks/3662.js","chunks/3726.js","chunks/3770.js","chunks/3799.js","chunks/3845.js","chunks/3943.js","chunks/3966.js","chunks/4043.js","chunks/4049.js","chunks/4055.js","chunks/412.js","chunks/4123.js","chunks/4125.js","chunks/4152.js","chunks/4190.js","chunks/4199.js","chunks/4293.js","chunks/436.js","chunks/4663.js","chunks/4730.js","chunks/4739.js","chunks/4780.js","chunks/4882.js","chunks/507.js","chunks/5081.js","chunks/5182.js","chunks/5215.js","chunks/5217.js","chunks/5245.js","chunks/5258.js","chunks/5299.js","chunks/5330.js","chunks/5433.js","chunks/5573.js","chunks/5615.js","chunks/5919.js","chunks/595.js","chunks/6070.js","chunks/6140.js","chunks/615.js","chunks/6155.js","chunks/6249.js","chunks/6457.js","chunks/6708.js","chunks/6763.js","chunks/6777.js","chunks/6844.js","chunks/6921.js","chunks/6922.js","chunks/698.js","chunks/7066.js","chunks/7121.js","chunks/7211.js","chunks/7247.js","chunks/7525.js","chunks/7552.js","chunks/7557.js","chunks/7716.js","chunks/7774.js","chunks/7811.js","chunks/7828.js","chunks/7911.js","chunks/7960.js","chunks/7965.js","chunks/7995.js","chunks/8251.js","chunks/827.js","chunks/8292.js","chunks/8402.js","chunks/8416.js","chunks/8499.js","chunks/8520.js","chunks/8895.js","chunks/8910.js","chunks/8920.js","chunks/9055.js","chunks/9100.js","chunks/915.js","chunks/9489.js","chunks/9609.js","chunks/9696.js","chunks/9713.js","webpack-runtime.js"]}
1
+ {"version":1,"files":["../package.json","chunks/1019.js","chunks/1133.js","chunks/1159.js","chunks/1260.js","chunks/1306.js","chunks/1329.js","chunks/1455.js","chunks/1679.js","chunks/1757.js","chunks/1813.js","chunks/1998.js","chunks/2116.js","chunks/2132.js","chunks/2220.js","chunks/238.js","chunks/2391.js","chunks/24.js","chunks/241.js","chunks/2430.js","chunks/2578.js","chunks/2712.js","chunks/2750.js","chunks/2970.js","chunks/3016.js","chunks/3031.js","chunks/3225.js","chunks/3276.js","chunks/3449.js","chunks/3535.js","chunks/3546.js","chunks/3558.js","chunks/3593.js","chunks/3662.js","chunks/3726.js","chunks/3770.js","chunks/3799.js","chunks/3845.js","chunks/3943.js","chunks/3966.js","chunks/4043.js","chunks/4049.js","chunks/4055.js","chunks/412.js","chunks/4123.js","chunks/4125.js","chunks/4152.js","chunks/4190.js","chunks/4199.js","chunks/4293.js","chunks/436.js","chunks/4663.js","chunks/4730.js","chunks/4739.js","chunks/4780.js","chunks/4882.js","chunks/5036.js","chunks/507.js","chunks/5081.js","chunks/5182.js","chunks/5215.js","chunks/5217.js","chunks/5245.js","chunks/5258.js","chunks/5299.js","chunks/5330.js","chunks/5433.js","chunks/5573.js","chunks/5615.js","chunks/5919.js","chunks/595.js","chunks/6070.js","chunks/6140.js","chunks/615.js","chunks/6155.js","chunks/6249.js","chunks/6457.js","chunks/6708.js","chunks/6763.js","chunks/6777.js","chunks/6844.js","chunks/6921.js","chunks/6922.js","chunks/698.js","chunks/7066.js","chunks/7121.js","chunks/7211.js","chunks/7247.js","chunks/7525.js","chunks/7552.js","chunks/7557.js","chunks/7716.js","chunks/7774.js","chunks/7811.js","chunks/7828.js","chunks/7911.js","chunks/7965.js","chunks/7995.js","chunks/8251.js","chunks/827.js","chunks/8292.js","chunks/8402.js","chunks/8416.js","chunks/8499.js","chunks/8520.js","chunks/8895.js","chunks/8910.js","chunks/8920.js","chunks/9055.js","chunks/9100.js","chunks/915.js","chunks/9489.js","chunks/9609.js","chunks/9696.js","chunks/9713.js","webpack-runtime.js"]}
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/fAJh8_GCT173XCQuAE5si/_buildManifest.js","static/fAJh8_GCT173XCQuAE5si/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-13acc920e6f6a68b.js","static/chunks/4bd1b696-8cd12253b448cc13.js","static/chunks/3794-04350b0fcecd82e5.js","static/chunks/main-app-71b3088720a13691.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/et6N1f81x-mr8bhwUnwYo/_buildManifest.js","static/et6N1f81x-mr8bhwUnwYo/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-b6470f9f7f52f8e5.js","static/chunks/4bd1b696-8cd12253b448cc13.js","static/chunks/3794-04350b0fcecd82e5.js","static/chunks/main-app-71b3088720a13691.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
@@ -1 +1 @@
1
- self.__REACT_LOADABLE_MANIFEST='{"app/(dashboard)/dashboard/translator/page.js -> @monaco-editor/react":{"id":28202,"files":["static/chunks/8202.69dace5daa86686d.js"]},"app/landing/components/Navbar.js -> @/shared/components/ThemeToggle":{"id":38587,"files":["static/chunks/85-614327c9c3f40a7d.js","static/chunks/6.a39be827fd6d332c.js"]},"shared/components/ChangelogModal.js -> marked":{"id":9233,"files":["static/chunks/9233.b5ad25d75f88baa7.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/ProviderBarChart":{"id":82435,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/2435.8a5a02e626c780d0.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/ProviderTopology":{"id":63521,"files":["static/css/e07f2bf4fa519943.css","static/chunks/1a258343.290297ea7c7f28c0.js","static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/6357.99dc54a064c984c0.js","static/chunks/3521.3af5cf89706546d6.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/TopModelsChart":{"id":65462,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/5462.c82c64c26a864ec0.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/UsageChart":{"id":10124,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/1649-772a31b7f3a65900.js","static/chunks/124.c092990b4bdb9713.js"]},"shared/components/layouts/DashboardLayout.js -> @/app/(dashboard)/dashboard/usage/components/ProviderBarChart":{"id":82435,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/2435.8a5a02e626c780d0.js"]},"shared/components/layouts/DashboardLayout.js -> @/app/(dashboard)/dashboard/usage/components/TopModelsChart":{"id":65462,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/5462.c82c64c26a864ec0.js"]},"shared/components/layouts/DashboardLayout.js -> @/app/(dashboard)/dashboard/usage/components/UsageChart":{"id":10124,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/1649-772a31b7f3a65900.js","static/chunks/124.c092990b4bdb9713.js"]},"shared/components/layouts/DashboardLayout.js -> @/shared/components/UsageStats":{"id":6808,"files":["static/chunks/6808-ada8d917f8f60e64.js"]}}';
1
+ self.__REACT_LOADABLE_MANIFEST='{"app/(dashboard)/dashboard/translator/page.js -> @monaco-editor/react":{"id":28202,"files":["static/chunks/8202.69dace5daa86686d.js"]},"app/landing/components/Navbar.js -> @/shared/components/ThemeToggle":{"id":38587,"files":["static/chunks/85-e9224bc05bb529c8.js","static/chunks/6.a39be827fd6d332c.js"]},"shared/components/ChangelogModal.js -> marked":{"id":9233,"files":["static/chunks/9233.b5ad25d75f88baa7.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/ProviderBarChart":{"id":82435,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/2435.8a5a02e626c780d0.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/ProviderTopology":{"id":63521,"files":["static/css/e07f2bf4fa519943.css","static/chunks/1a258343.290297ea7c7f28c0.js","static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/6357.99dc54a064c984c0.js","static/chunks/3521.3af5cf89706546d6.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/TopModelsChart":{"id":65462,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/5462.c82c64c26a864ec0.js"]},"shared/components/UsageStats.js -> @/app/(dashboard)/dashboard/usage/components/UsageChart":{"id":10124,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/1649-772a31b7f3a65900.js","static/chunks/124.c092990b4bdb9713.js"]},"shared/components/layouts/DashboardLayout.js -> @/app/(dashboard)/dashboard/usage/components/ProviderBarChart":{"id":82435,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/2435.8a5a02e626c780d0.js"]},"shared/components/layouts/DashboardLayout.js -> @/app/(dashboard)/dashboard/usage/components/TopModelsChart":{"id":65462,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/8569.df0d706176dc1f57.js","static/chunks/5462.c82c64c26a864ec0.js"]},"shared/components/layouts/DashboardLayout.js -> @/app/(dashboard)/dashboard/usage/components/UsageChart":{"id":10124,"files":["static/chunks/3842-cc4f39fa50ab8b93.js","static/chunks/5815-2eb6990de66e825b.js","static/chunks/1649-772a31b7f3a65900.js","static/chunks/124.c092990b4bdb9713.js"]},"shared/components/layouts/DashboardLayout.js -> @/shared/components/UsageStats":{"id":6808,"files":["static/chunks/6808-ada8d917f8f60e64.js"]}}';