@jheavenknows/bluerouter 2.0.67 → 2.0.72

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 (1177) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +3 -3
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  80. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  92. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  93. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  94. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  95. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  97. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  100. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  109. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  111. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  117. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  119. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  123. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  127. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  135. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +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/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  228. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/version/restart/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  268. package/app/.next-cli-build/server/app/callback.html +1 -1
  269. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  270. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  271. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  273. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  274. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/analytics.rsc +5 -5
  278. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +5 -5
  283. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +4 -4
  285. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
  286. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +6 -6
  288. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  292. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +6 -6
  293. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +4 -4
  295. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +2 -2
  296. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  298. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  299. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  302. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  303. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  305. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  306. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  308. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  309. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  312. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  313. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  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 +6 -6
  318. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  319. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  322. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  323. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  325. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  326. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  328. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  329. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  333. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  335. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  336. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  338. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  343. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  344. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  346. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  347. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  349. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  350. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  353. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  354. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  356. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  357. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  359. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  360. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  363. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  364. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  366. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  367. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +5 -5
  369. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +5 -5
  374. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +4 -4
  376. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
  377. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +5 -5
  379. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +5 -5
  384. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +4 -4
  386. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +2 -2
  387. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  389. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  390. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  394. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  395. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  397. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  398. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  400. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  401. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  404. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  405. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  406. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  407. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  408. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  410. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  411. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  415. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  417. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  418. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  420. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  421. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  424. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  425. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  427. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  432. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  433. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  434. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  435. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  438. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  441. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  442. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  443. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  444. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  445. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  447. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  449. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  450. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  452. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  453. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  455. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  457. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  459. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  460. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  462. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  463. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  467. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  469. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  471. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  472. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  475. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  476. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  478. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  480. package/app/.next-cli-build/server/app/index.html +1 -1
  481. package/app/.next-cli-build/server/app/index.rsc +4 -4
  482. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  483. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  484. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  485. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  486. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  487. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  488. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  489. package/app/.next-cli-build/server/app/landing.html +1 -1
  490. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  491. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  492. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  494. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  496. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  498. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  499. package/app/.next-cli-build/server/app/login.html +1 -1
  500. package/app/.next-cli-build/server/app/login.rsc +4 -4
  501. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  502. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  503. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  504. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  505. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  507. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  508. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  509. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  510. package/app/.next-cli-build/server/app-paths-manifest.json +3 -3
  511. package/app/.next-cli-build/server/chunks/{3941.js → 232.js} +10 -10
  512. package/app/.next-cli-build/server/chunks/2338.js +5 -5
  513. package/app/.next-cli-build/server/chunks/3110.js +1 -1
  514. package/app/.next-cli-build/server/chunks/402.js +12 -34
  515. package/app/.next-cli-build/server/chunks/{3903.js → 4684.js} +3 -3
  516. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  517. package/app/.next-cli-build/server/chunks/6604.js +1 -1
  518. package/app/.next-cli-build/server/chunks/7013.js +64 -0
  519. package/app/.next-cli-build/server/chunks/7130.js +1 -1
  520. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  521. package/app/.next-cli-build/server/chunks/{7887.js → 7324.js} +3 -3
  522. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  523. package/app/.next-cli-build/server/middleware.js +5 -5
  524. package/app/.next-cli-build/server/pages/404.html +1 -1
  525. package/app/.next-cli-build/server/pages/500.html +1 -1
  526. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  527. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  528. package/app/.next-cli-build/static/chunks/{1321-3617d2ecab3c3e4a.js → 1321-58ab0e715ac6f87b.js} +1 -1
  529. package/app/.next-cli-build/static/chunks/2649-64ab34e3d24f7ee7.js +64 -0
  530. package/app/.next-cli-build/static/chunks/{3794-cef5038dc7aa126a.js → 3794-e569667691edc8f7.js} +1 -1
  531. package/app/.next-cli-build/static/chunks/5497-6c5a0c9232ccb4c6.js +7 -0
  532. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/{page-741d830b924870d4.js → page-8b8e3090b0c54012.js} +3 -3
  533. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-1b2283499089d7dc.js → page-11617ff060b8e380.js} +1 -1
  534. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-1adaf9be4107d227.js → page-1a31b657146b9246.js} +1 -1
  535. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-85cb2bafe0526c5d.js → page-b3cf5a8be17a2438.js} +1 -1
  536. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-9740966fa4f6feec.js → page-9e00786c369c0d36.js} +1 -1
  537. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-d26b9256cf41fb19.js → page-b9486365a629c9f1.js} +1 -1
  538. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-da1f6f82eaaa1188.js → page-574d0bda66f62d85.js} +1 -1
  539. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-4377fb8d824f5bde.js → page-dff1de72ceae459c.js} +1 -1
  540. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-3cf8e9de4ed5bf33.js → page-e6f61f04738eb37b.js} +1 -1
  541. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-b2b612e7dedabef1.js → page-c6a3cb969e7d5737.js} +1 -1
  542. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-356120709e5a1a94.js → page-9e6f5fc57b49a332.js} +1 -1
  543. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-161edd90803b7184.js → page-045950c3d0610b2c.js} +1 -1
  544. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/{page-da1f6f82eaaa1188.js → page-574d0bda66f62d85.js} +1 -1
  545. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-430091744aba8721.js → page-0683363a833539b1.js} +1 -1
  546. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-009821d1edc5606b.js → page-744b6755dff5a057.js} +1 -1
  547. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-a714b4089e843f15.js → page-3b122499bad974e3.js} +1 -1
  548. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-0e356884dbb16e9e.js → page-bd47d1f39f0e0745.js} +1 -1
  549. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-383255c4b63ebf3b.js → page-f8982f188901fd41.js} +1 -1
  550. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-de03c9c19092784e.js → page-8cfe1406b57d64da.js} +1 -1
  551. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-fdac9423efa73ccd.js → page-405d0cac8327412d.js} +1 -1
  552. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-df33426c271ac7e1.js → page-49ba52b176b96240.js} +1 -1
  553. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-74847fe2e0e50a38.js → layout-673571386bf76d48.js} +1 -1
  554. package/app/.next-cli-build/static/chunks/{main-80a34745801ef1a2.js → main-eb1b86e4183e86c5.js} +1 -1
  555. package/app/.next-cli-build/static/css/45266bc037984bd5.css +1 -0
  556. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-2.0.62-to-2.0.63-2.0.63-20260615-105338 → upgrade-2.0.63-to-2.0.64-2.0.64-20260615-173323}/data.sqlite +0 -0
  557. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-2.0.63-to-2.0.64-2.0.64-20260615-134136 → upgrade-2.0.64-to-2.0.72-2.0.72-20260615-174007}/data.sqlite +0 -0
  558. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite +0 -0
  559. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  560. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  561. package/app/cli/.build-home/AppData/Roaming/bluerouter/jwt-secret +1 -1
  562. package/app/cli/.build-home/AppData/Roaming/nextjs-nodejs/Config/config.json +3 -3
  563. package/app/node_modules/@next/env/package.json +2 -2
  564. package/app/node_modules/baseline-browser-mapping/dist/index.cjs +1 -1
  565. package/app/node_modules/baseline-browser-mapping/package.json +2 -2
  566. package/app/node_modules/caniuse-lite/data/agents.js +1 -1
  567. package/app/node_modules/caniuse-lite/data/browserVersions.js +1 -1
  568. package/app/node_modules/caniuse-lite/data/features/aac.js +1 -1
  569. package/app/node_modules/caniuse-lite/data/features/abortcontroller.js +1 -1
  570. package/app/node_modules/caniuse-lite/data/features/ac3-ec3.js +1 -1
  571. package/app/node_modules/caniuse-lite/data/features/accelerometer.js +1 -1
  572. package/app/node_modules/caniuse-lite/data/features/addeventlistener.js +1 -1
  573. package/app/node_modules/caniuse-lite/data/features/alternate-stylesheet.js +1 -1
  574. package/app/node_modules/caniuse-lite/data/features/ambient-light.js +1 -1
  575. package/app/node_modules/caniuse-lite/data/features/apng.js +1 -1
  576. package/app/node_modules/caniuse-lite/data/features/array-find-index.js +1 -1
  577. package/app/node_modules/caniuse-lite/data/features/array-find.js +1 -1
  578. package/app/node_modules/caniuse-lite/data/features/array-flat.js +1 -1
  579. package/app/node_modules/caniuse-lite/data/features/array-includes.js +1 -1
  580. package/app/node_modules/caniuse-lite/data/features/arrow-functions.js +1 -1
  581. package/app/node_modules/caniuse-lite/data/features/asmjs.js +1 -1
  582. package/app/node_modules/caniuse-lite/data/features/async-clipboard.js +1 -1
  583. package/app/node_modules/caniuse-lite/data/features/async-functions.js +1 -1
  584. package/app/node_modules/caniuse-lite/data/features/atob-btoa.js +1 -1
  585. package/app/node_modules/caniuse-lite/data/features/audio-api.js +1 -1
  586. package/app/node_modules/caniuse-lite/data/features/audio.js +1 -1
  587. package/app/node_modules/caniuse-lite/data/features/audiotracks.js +1 -1
  588. package/app/node_modules/caniuse-lite/data/features/autofocus.js +1 -1
  589. package/app/node_modules/caniuse-lite/data/features/auxclick.js +1 -1
  590. package/app/node_modules/caniuse-lite/data/features/av1.js +1 -1
  591. package/app/node_modules/caniuse-lite/data/features/avif.js +1 -1
  592. package/app/node_modules/caniuse-lite/data/features/background-attachment.js +1 -1
  593. package/app/node_modules/caniuse-lite/data/features/background-clip-text.js +1 -1
  594. package/app/node_modules/caniuse-lite/data/features/background-img-opts.js +1 -1
  595. package/app/node_modules/caniuse-lite/data/features/background-position-x-y.js +1 -1
  596. package/app/node_modules/caniuse-lite/data/features/background-repeat-round-space.js +1 -1
  597. package/app/node_modules/caniuse-lite/data/features/background-sync.js +1 -1
  598. package/app/node_modules/caniuse-lite/data/features/battery-status.js +1 -1
  599. package/app/node_modules/caniuse-lite/data/features/beacon.js +1 -1
  600. package/app/node_modules/caniuse-lite/data/features/beforeafterprint.js +1 -1
  601. package/app/node_modules/caniuse-lite/data/features/bigint.js +1 -1
  602. package/app/node_modules/caniuse-lite/data/features/blobbuilder.js +1 -1
  603. package/app/node_modules/caniuse-lite/data/features/bloburls.js +1 -1
  604. package/app/node_modules/caniuse-lite/data/features/border-image.js +1 -1
  605. package/app/node_modules/caniuse-lite/data/features/border-radius.js +1 -1
  606. package/app/node_modules/caniuse-lite/data/features/broadcastchannel.js +1 -1
  607. package/app/node_modules/caniuse-lite/data/features/brotli.js +1 -1
  608. package/app/node_modules/caniuse-lite/data/features/calc.js +1 -1
  609. package/app/node_modules/caniuse-lite/data/features/canvas-blending.js +1 -1
  610. package/app/node_modules/caniuse-lite/data/features/canvas-text.js +1 -1
  611. package/app/node_modules/caniuse-lite/data/features/canvas.js +1 -1
  612. package/app/node_modules/caniuse-lite/data/features/ch-unit.js +1 -1
  613. package/app/node_modules/caniuse-lite/data/features/chacha20-poly1305.js +1 -1
  614. package/app/node_modules/caniuse-lite/data/features/channel-messaging.js +1 -1
  615. package/app/node_modules/caniuse-lite/data/features/childnode-remove.js +1 -1
  616. package/app/node_modules/caniuse-lite/data/features/classlist.js +1 -1
  617. package/app/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js +1 -1
  618. package/app/node_modules/caniuse-lite/data/features/clipboard.js +1 -1
  619. package/app/node_modules/caniuse-lite/data/features/colr-v1.js +1 -1
  620. package/app/node_modules/caniuse-lite/data/features/colr.js +1 -1
  621. package/app/node_modules/caniuse-lite/data/features/comparedocumentposition.js +1 -1
  622. package/app/node_modules/caniuse-lite/data/features/console-basic.js +1 -1
  623. package/app/node_modules/caniuse-lite/data/features/console-time.js +1 -1
  624. package/app/node_modules/caniuse-lite/data/features/const.js +1 -1
  625. package/app/node_modules/caniuse-lite/data/features/constraint-validation.js +1 -1
  626. package/app/node_modules/caniuse-lite/data/features/contenteditable.js +1 -1
  627. package/app/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js +1 -1
  628. package/app/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js +1 -1
  629. package/app/node_modules/caniuse-lite/data/features/cookie-store-api.js +1 -1
  630. package/app/node_modules/caniuse-lite/data/features/cors.js +1 -1
  631. package/app/node_modules/caniuse-lite/data/features/createimagebitmap.js +1 -1
  632. package/app/node_modules/caniuse-lite/data/features/credential-management.js +1 -1
  633. package/app/node_modules/caniuse-lite/data/features/cross-document-view-transitions.js +1 -1
  634. package/app/node_modules/caniuse-lite/data/features/cryptography.js +1 -1
  635. package/app/node_modules/caniuse-lite/data/features/css-all.js +1 -1
  636. package/app/node_modules/caniuse-lite/data/features/css-anchor-positioning.js +1 -1
  637. package/app/node_modules/caniuse-lite/data/features/css-animation.js +1 -1
  638. package/app/node_modules/caniuse-lite/data/features/css-any-link.js +1 -1
  639. package/app/node_modules/caniuse-lite/data/features/css-appearance.js +1 -1
  640. package/app/node_modules/caniuse-lite/data/features/css-at-counter-style.js +1 -1
  641. package/app/node_modules/caniuse-lite/data/features/css-autofill.js +1 -1
  642. package/app/node_modules/caniuse-lite/data/features/css-backdrop-filter.js +1 -1
  643. package/app/node_modules/caniuse-lite/data/features/css-background-offsets.js +1 -1
  644. package/app/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js +1 -1
  645. package/app/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js +1 -1
  646. package/app/node_modules/caniuse-lite/data/features/css-boxshadow.js +1 -1
  647. package/app/node_modules/caniuse-lite/data/features/css-canvas.js +1 -1
  648. package/app/node_modules/caniuse-lite/data/features/css-caret-color.js +1 -1
  649. package/app/node_modules/caniuse-lite/data/features/css-cascade-layers.js +1 -1
  650. package/app/node_modules/caniuse-lite/data/features/css-cascade-scope.js +1 -1
  651. package/app/node_modules/caniuse-lite/data/features/css-case-insensitive.js +1 -1
  652. package/app/node_modules/caniuse-lite/data/features/css-clip-path.js +1 -1
  653. package/app/node_modules/caniuse-lite/data/features/css-color-adjust.js +1 -1
  654. package/app/node_modules/caniuse-lite/data/features/css-color-function.js +1 -1
  655. package/app/node_modules/caniuse-lite/data/features/css-conic-gradients.js +1 -1
  656. package/app/node_modules/caniuse-lite/data/features/css-container-queries-style.js +1 -1
  657. package/app/node_modules/caniuse-lite/data/features/css-container-queries.js +1 -1
  658. package/app/node_modules/caniuse-lite/data/features/css-container-query-units.js +1 -1
  659. package/app/node_modules/caniuse-lite/data/features/css-containment.js +1 -1
  660. package/app/node_modules/caniuse-lite/data/features/css-content-visibility.js +1 -1
  661. package/app/node_modules/caniuse-lite/data/features/css-counters.js +1 -1
  662. package/app/node_modules/caniuse-lite/data/features/css-crisp-edges.js +1 -1
  663. package/app/node_modules/caniuse-lite/data/features/css-cross-fade.js +1 -1
  664. package/app/node_modules/caniuse-lite/data/features/css-default-pseudo.js +1 -1
  665. package/app/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js +1 -1
  666. package/app/node_modules/caniuse-lite/data/features/css-deviceadaptation.js +1 -1
  667. package/app/node_modules/caniuse-lite/data/features/css-dir-pseudo.js +1 -1
  668. package/app/node_modules/caniuse-lite/data/features/css-display-contents.js +1 -1
  669. package/app/node_modules/caniuse-lite/data/features/css-element-function.js +1 -1
  670. package/app/node_modules/caniuse-lite/data/features/css-env-function.js +1 -1
  671. package/app/node_modules/caniuse-lite/data/features/css-exclusions.js +1 -1
  672. package/app/node_modules/caniuse-lite/data/features/css-featurequeries.js +1 -1
  673. package/app/node_modules/caniuse-lite/data/features/css-file-selector-button.js +1 -1
  674. package/app/node_modules/caniuse-lite/data/features/css-filter-function.js +1 -1
  675. package/app/node_modules/caniuse-lite/data/features/css-filters.js +1 -1
  676. package/app/node_modules/caniuse-lite/data/features/css-first-letter.js +1 -1
  677. package/app/node_modules/caniuse-lite/data/features/css-first-line.js +1 -1
  678. package/app/node_modules/caniuse-lite/data/features/css-fixed.js +1 -1
  679. package/app/node_modules/caniuse-lite/data/features/css-focus-visible.js +1 -1
  680. package/app/node_modules/caniuse-lite/data/features/css-focus-within.js +1 -1
  681. package/app/node_modules/caniuse-lite/data/features/css-font-palette.js +1 -1
  682. package/app/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js +1 -1
  683. package/app/node_modules/caniuse-lite/data/features/css-font-stretch.js +1 -1
  684. package/app/node_modules/caniuse-lite/data/features/css-gencontent.js +1 -1
  685. package/app/node_modules/caniuse-lite/data/features/css-gradients.js +1 -1
  686. package/app/node_modules/caniuse-lite/data/features/css-grid-animation.js +1 -1
  687. package/app/node_modules/caniuse-lite/data/features/css-grid-lanes.js +1 -1
  688. package/app/node_modules/caniuse-lite/data/features/css-grid.js +1 -1
  689. package/app/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js +1 -1
  690. package/app/node_modules/caniuse-lite/data/features/css-has.js +1 -1
  691. package/app/node_modules/caniuse-lite/data/features/css-hyphens.js +1 -1
  692. package/app/node_modules/caniuse-lite/data/features/css-if.js +1 -1
  693. package/app/node_modules/caniuse-lite/data/features/css-image-orientation.js +1 -1
  694. package/app/node_modules/caniuse-lite/data/features/css-image-set.js +1 -1
  695. package/app/node_modules/caniuse-lite/data/features/css-in-out-of-range.js +1 -1
  696. package/app/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js +1 -1
  697. package/app/node_modules/caniuse-lite/data/features/css-initial-letter.js +1 -1
  698. package/app/node_modules/caniuse-lite/data/features/css-initial-value.js +1 -1
  699. package/app/node_modules/caniuse-lite/data/features/css-lch-lab.js +1 -1
  700. package/app/node_modules/caniuse-lite/data/features/css-letter-spacing.js +1 -1
  701. package/app/node_modules/caniuse-lite/data/features/css-line-clamp.js +1 -1
  702. package/app/node_modules/caniuse-lite/data/features/css-logical-props.js +1 -1
  703. package/app/node_modules/caniuse-lite/data/features/css-marker-pseudo.js +1 -1
  704. package/app/node_modules/caniuse-lite/data/features/css-masks.js +1 -1
  705. package/app/node_modules/caniuse-lite/data/features/css-matches-pseudo.js +1 -1
  706. package/app/node_modules/caniuse-lite/data/features/css-math-functions.js +1 -1
  707. package/app/node_modules/caniuse-lite/data/features/css-media-interaction.js +1 -1
  708. package/app/node_modules/caniuse-lite/data/features/css-media-range-syntax.js +1 -1
  709. package/app/node_modules/caniuse-lite/data/features/css-media-resolution.js +1 -1
  710. package/app/node_modules/caniuse-lite/data/features/css-media-scripting.js +1 -1
  711. package/app/node_modules/caniuse-lite/data/features/css-mediaqueries.js +1 -1
  712. package/app/node_modules/caniuse-lite/data/features/css-mixblendmode.js +1 -1
  713. package/app/node_modules/caniuse-lite/data/features/css-module-scripts.js +1 -1
  714. package/app/node_modules/caniuse-lite/data/features/css-motion-paths.js +1 -1
  715. package/app/node_modules/caniuse-lite/data/features/css-namespaces.js +1 -1
  716. package/app/node_modules/caniuse-lite/data/features/css-nesting.js +1 -1
  717. package/app/node_modules/caniuse-lite/data/features/css-not-sel-list.js +1 -1
  718. package/app/node_modules/caniuse-lite/data/features/css-nth-child-of.js +1 -1
  719. package/app/node_modules/caniuse-lite/data/features/css-opacity.js +1 -1
  720. package/app/node_modules/caniuse-lite/data/features/css-optional-pseudo.js +1 -1
  721. package/app/node_modules/caniuse-lite/data/features/css-overflow-anchor.js +1 -1
  722. package/app/node_modules/caniuse-lite/data/features/css-overflow-overlay.js +1 -1
  723. package/app/node_modules/caniuse-lite/data/features/css-overflow.js +1 -1
  724. package/app/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js +1 -1
  725. package/app/node_modules/caniuse-lite/data/features/css-page-break.js +1 -1
  726. package/app/node_modules/caniuse-lite/data/features/css-paged-media.js +1 -1
  727. package/app/node_modules/caniuse-lite/data/features/css-paint-api.js +1 -1
  728. package/app/node_modules/caniuse-lite/data/features/css-placeholder-shown.js +1 -1
  729. package/app/node_modules/caniuse-lite/data/features/css-placeholder.js +1 -1
  730. package/app/node_modules/caniuse-lite/data/features/css-print-color-adjust.js +1 -1
  731. package/app/node_modules/caniuse-lite/data/features/css-read-only-write.js +1 -1
  732. package/app/node_modules/caniuse-lite/data/features/css-rebeccapurple.js +1 -1
  733. package/app/node_modules/caniuse-lite/data/features/css-reflections.js +1 -1
  734. package/app/node_modules/caniuse-lite/data/features/css-regions.js +1 -1
  735. package/app/node_modules/caniuse-lite/data/features/css-relative-colors.js +1 -1
  736. package/app/node_modules/caniuse-lite/data/features/css-repeating-gradients.js +1 -1
  737. package/app/node_modules/caniuse-lite/data/features/css-resize.js +1 -1
  738. package/app/node_modules/caniuse-lite/data/features/css-revert-value.js +1 -1
  739. package/app/node_modules/caniuse-lite/data/features/css-rrggbbaa.js +1 -1
  740. package/app/node_modules/caniuse-lite/data/features/css-scroll-behavior.js +1 -1
  741. package/app/node_modules/caniuse-lite/data/features/css-scrollbar.js +1 -1
  742. package/app/node_modules/caniuse-lite/data/features/css-sel2.js +1 -1
  743. package/app/node_modules/caniuse-lite/data/features/css-sel3.js +1 -1
  744. package/app/node_modules/caniuse-lite/data/features/css-selection.js +1 -1
  745. package/app/node_modules/caniuse-lite/data/features/css-shapes.js +1 -1
  746. package/app/node_modules/caniuse-lite/data/features/css-snappoints.js +1 -1
  747. package/app/node_modules/caniuse-lite/data/features/css-sticky.js +1 -1
  748. package/app/node_modules/caniuse-lite/data/features/css-subgrid.js +1 -1
  749. package/app/node_modules/caniuse-lite/data/features/css-supports-api.js +1 -1
  750. package/app/node_modules/caniuse-lite/data/features/css-table.js +1 -1
  751. package/app/node_modules/caniuse-lite/data/features/css-text-align-last.js +1 -1
  752. package/app/node_modules/caniuse-lite/data/features/css-text-box-trim.js +1 -1
  753. package/app/node_modules/caniuse-lite/data/features/css-text-indent.js +1 -1
  754. package/app/node_modules/caniuse-lite/data/features/css-text-justify.js +1 -1
  755. package/app/node_modules/caniuse-lite/data/features/css-text-orientation.js +1 -1
  756. package/app/node_modules/caniuse-lite/data/features/css-text-spacing.js +1 -1
  757. package/app/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js +1 -1
  758. package/app/node_modules/caniuse-lite/data/features/css-textshadow.js +1 -1
  759. package/app/node_modules/caniuse-lite/data/features/css-touch-action.js +1 -1
  760. package/app/node_modules/caniuse-lite/data/features/css-transitions.js +1 -1
  761. package/app/node_modules/caniuse-lite/data/features/css-unicode-bidi.js +1 -1
  762. package/app/node_modules/caniuse-lite/data/features/css-unset-value.js +1 -1
  763. package/app/node_modules/caniuse-lite/data/features/css-variables.js +1 -1
  764. package/app/node_modules/caniuse-lite/data/features/css-when-else.js +1 -1
  765. package/app/node_modules/caniuse-lite/data/features/css-widows-orphans.js +1 -1
  766. package/app/node_modules/caniuse-lite/data/features/css-width-stretch.js +1 -1
  767. package/app/node_modules/caniuse-lite/data/features/css-writing-mode.js +1 -1
  768. package/app/node_modules/caniuse-lite/data/features/css-zoom.js +1 -1
  769. package/app/node_modules/caniuse-lite/data/features/css3-attr.js +1 -1
  770. package/app/node_modules/caniuse-lite/data/features/css3-boxsizing.js +1 -1
  771. package/app/node_modules/caniuse-lite/data/features/css3-colors.js +1 -1
  772. package/app/node_modules/caniuse-lite/data/features/css3-cursors-grab.js +1 -1
  773. package/app/node_modules/caniuse-lite/data/features/css3-cursors-newer.js +1 -1
  774. package/app/node_modules/caniuse-lite/data/features/css3-cursors.js +1 -1
  775. package/app/node_modules/caniuse-lite/data/features/css3-tabsize.js +1 -1
  776. package/app/node_modules/caniuse-lite/data/features/currentcolor.js +1 -1
  777. package/app/node_modules/caniuse-lite/data/features/custom-elements.js +1 -1
  778. package/app/node_modules/caniuse-lite/data/features/custom-elementsv1.js +1 -1
  779. package/app/node_modules/caniuse-lite/data/features/customevent.js +1 -1
  780. package/app/node_modules/caniuse-lite/data/features/customizable-select.js +1 -1
  781. package/app/node_modules/caniuse-lite/data/features/datalist.js +1 -1
  782. package/app/node_modules/caniuse-lite/data/features/dataset.js +1 -1
  783. package/app/node_modules/caniuse-lite/data/features/datauri.js +1 -1
  784. package/app/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js +1 -1
  785. package/app/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js +1 -1
  786. package/app/node_modules/caniuse-lite/data/features/decorators.js +1 -1
  787. package/app/node_modules/caniuse-lite/data/features/details.js +1 -1
  788. package/app/node_modules/caniuse-lite/data/features/deviceorientation.js +1 -1
  789. package/app/node_modules/caniuse-lite/data/features/devicepixelratio.js +1 -1
  790. package/app/node_modules/caniuse-lite/data/features/dialog.js +1 -1
  791. package/app/node_modules/caniuse-lite/data/features/dispatchevent.js +1 -1
  792. package/app/node_modules/caniuse-lite/data/features/dnssec.js +1 -1
  793. package/app/node_modules/caniuse-lite/data/features/do-not-track.js +1 -1
  794. package/app/node_modules/caniuse-lite/data/features/document-currentscript.js +1 -1
  795. package/app/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js +1 -1
  796. package/app/node_modules/caniuse-lite/data/features/document-execcommand.js +1 -1
  797. package/app/node_modules/caniuse-lite/data/features/document-policy.js +1 -1
  798. package/app/node_modules/caniuse-lite/data/features/document-scrollingelement.js +1 -1
  799. package/app/node_modules/caniuse-lite/data/features/documenthead.js +1 -1
  800. package/app/node_modules/caniuse-lite/data/features/dom-manip-convenience.js +1 -1
  801. package/app/node_modules/caniuse-lite/data/features/dom-range.js +1 -1
  802. package/app/node_modules/caniuse-lite/data/features/domcontentloaded.js +1 -1
  803. package/app/node_modules/caniuse-lite/data/features/dommatrix.js +1 -1
  804. package/app/node_modules/caniuse-lite/data/features/download.js +1 -1
  805. package/app/node_modules/caniuse-lite/data/features/dragndrop.js +1 -1
  806. package/app/node_modules/caniuse-lite/data/features/element-closest.js +1 -1
  807. package/app/node_modules/caniuse-lite/data/features/element-from-point.js +1 -1
  808. package/app/node_modules/caniuse-lite/data/features/element-scroll-methods.js +1 -1
  809. package/app/node_modules/caniuse-lite/data/features/eme.js +1 -1
  810. package/app/node_modules/caniuse-lite/data/features/eot.js +1 -1
  811. package/app/node_modules/caniuse-lite/data/features/es5.js +1 -1
  812. package/app/node_modules/caniuse-lite/data/features/es6-class.js +1 -1
  813. package/app/node_modules/caniuse-lite/data/features/es6-generators.js +1 -1
  814. package/app/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js +1 -1
  815. package/app/node_modules/caniuse-lite/data/features/es6-module.js +1 -1
  816. package/app/node_modules/caniuse-lite/data/features/es6-number.js +1 -1
  817. package/app/node_modules/caniuse-lite/data/features/es6-string-includes.js +1 -1
  818. package/app/node_modules/caniuse-lite/data/features/es6.js +1 -1
  819. package/app/node_modules/caniuse-lite/data/features/eventsource.js +1 -1
  820. package/app/node_modules/caniuse-lite/data/features/extended-system-fonts.js +1 -1
  821. package/app/node_modules/caniuse-lite/data/features/feature-policy.js +1 -1
  822. package/app/node_modules/caniuse-lite/data/features/fetch.js +1 -1
  823. package/app/node_modules/caniuse-lite/data/features/fieldset-disabled.js +1 -1
  824. package/app/node_modules/caniuse-lite/data/features/fileapi.js +1 -1
  825. package/app/node_modules/caniuse-lite/data/features/filereader.js +1 -1
  826. package/app/node_modules/caniuse-lite/data/features/filereadersync.js +1 -1
  827. package/app/node_modules/caniuse-lite/data/features/filesystem.js +1 -1
  828. package/app/node_modules/caniuse-lite/data/features/flac.js +1 -1
  829. package/app/node_modules/caniuse-lite/data/features/flexbox-gap.js +1 -1
  830. package/app/node_modules/caniuse-lite/data/features/flexbox.js +1 -1
  831. package/app/node_modules/caniuse-lite/data/features/flow-root.js +1 -1
  832. package/app/node_modules/caniuse-lite/data/features/focusin-focusout-events.js +1 -1
  833. package/app/node_modules/caniuse-lite/data/features/font-family-system-ui.js +1 -1
  834. package/app/node_modules/caniuse-lite/data/features/font-feature.js +1 -1
  835. package/app/node_modules/caniuse-lite/data/features/font-kerning.js +1 -1
  836. package/app/node_modules/caniuse-lite/data/features/font-loading.js +1 -1
  837. package/app/node_modules/caniuse-lite/data/features/font-size-adjust.js +1 -1
  838. package/app/node_modules/caniuse-lite/data/features/font-smooth.js +1 -1
  839. package/app/node_modules/caniuse-lite/data/features/font-unicode-range.js +1 -1
  840. package/app/node_modules/caniuse-lite/data/features/font-variant-alternates.js +1 -1
  841. package/app/node_modules/caniuse-lite/data/features/font-variant-numeric.js +1 -1
  842. package/app/node_modules/caniuse-lite/data/features/fontface.js +1 -1
  843. package/app/node_modules/caniuse-lite/data/features/form-attribute.js +1 -1
  844. package/app/node_modules/caniuse-lite/data/features/form-submit-attributes.js +1 -1
  845. package/app/node_modules/caniuse-lite/data/features/form-validation.js +1 -1
  846. package/app/node_modules/caniuse-lite/data/features/forms.js +1 -1
  847. package/app/node_modules/caniuse-lite/data/features/fullscreen.js +1 -1
  848. package/app/node_modules/caniuse-lite/data/features/gamepad.js +1 -1
  849. package/app/node_modules/caniuse-lite/data/features/geolocation.js +1 -1
  850. package/app/node_modules/caniuse-lite/data/features/getboundingclientrect.js +1 -1
  851. package/app/node_modules/caniuse-lite/data/features/getcomputedstyle.js +1 -1
  852. package/app/node_modules/caniuse-lite/data/features/getelementsbyclassname.js +1 -1
  853. package/app/node_modules/caniuse-lite/data/features/getrandomvalues.js +1 -1
  854. package/app/node_modules/caniuse-lite/data/features/gyroscope.js +1 -1
  855. package/app/node_modules/caniuse-lite/data/features/hardwareconcurrency.js +1 -1
  856. package/app/node_modules/caniuse-lite/data/features/hashchange.js +1 -1
  857. package/app/node_modules/caniuse-lite/data/features/heif.js +1 -1
  858. package/app/node_modules/caniuse-lite/data/features/hevc.js +1 -1
  859. package/app/node_modules/caniuse-lite/data/features/hidden.js +1 -1
  860. package/app/node_modules/caniuse-lite/data/features/high-resolution-time.js +1 -1
  861. package/app/node_modules/caniuse-lite/data/features/history.js +1 -1
  862. package/app/node_modules/caniuse-lite/data/features/html-media-capture.js +1 -1
  863. package/app/node_modules/caniuse-lite/data/features/html5semantic.js +1 -1
  864. package/app/node_modules/caniuse-lite/data/features/http-live-streaming.js +1 -1
  865. package/app/node_modules/caniuse-lite/data/features/http2.js +1 -1
  866. package/app/node_modules/caniuse-lite/data/features/http3.js +1 -1
  867. package/app/node_modules/caniuse-lite/data/features/iframe-sandbox.js +1 -1
  868. package/app/node_modules/caniuse-lite/data/features/iframe-seamless.js +1 -1
  869. package/app/node_modules/caniuse-lite/data/features/iframe-srcdoc.js +1 -1
  870. package/app/node_modules/caniuse-lite/data/features/imagecapture.js +1 -1
  871. package/app/node_modules/caniuse-lite/data/features/ime.js +1 -1
  872. package/app/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js +1 -1
  873. package/app/node_modules/caniuse-lite/data/features/import-maps.js +1 -1
  874. package/app/node_modules/caniuse-lite/data/features/imports.js +1 -1
  875. package/app/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js +1 -1
  876. package/app/node_modules/caniuse-lite/data/features/indexeddb.js +1 -1
  877. package/app/node_modules/caniuse-lite/data/features/indexeddb2.js +1 -1
  878. package/app/node_modules/caniuse-lite/data/features/inline-block.js +1 -1
  879. package/app/node_modules/caniuse-lite/data/features/innertext.js +1 -1
  880. package/app/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js +1 -1
  881. package/app/node_modules/caniuse-lite/data/features/input-color.js +1 -1
  882. package/app/node_modules/caniuse-lite/data/features/input-datetime.js +1 -1
  883. package/app/node_modules/caniuse-lite/data/features/input-email-tel-url.js +1 -1
  884. package/app/node_modules/caniuse-lite/data/features/input-event.js +1 -1
  885. package/app/node_modules/caniuse-lite/data/features/input-file-accept.js +1 -1
  886. package/app/node_modules/caniuse-lite/data/features/input-file-directory.js +1 -1
  887. package/app/node_modules/caniuse-lite/data/features/input-file-multiple.js +1 -1
  888. package/app/node_modules/caniuse-lite/data/features/input-inputmode.js +1 -1
  889. package/app/node_modules/caniuse-lite/data/features/input-minlength.js +1 -1
  890. package/app/node_modules/caniuse-lite/data/features/input-number.js +1 -1
  891. package/app/node_modules/caniuse-lite/data/features/input-pattern.js +1 -1
  892. package/app/node_modules/caniuse-lite/data/features/input-placeholder.js +1 -1
  893. package/app/node_modules/caniuse-lite/data/features/input-range.js +1 -1
  894. package/app/node_modules/caniuse-lite/data/features/input-search.js +1 -1
  895. package/app/node_modules/caniuse-lite/data/features/input-selection.js +1 -1
  896. package/app/node_modules/caniuse-lite/data/features/insert-adjacent.js +1 -1
  897. package/app/node_modules/caniuse-lite/data/features/insertadjacenthtml.js +1 -1
  898. package/app/node_modules/caniuse-lite/data/features/internationalization.js +1 -1
  899. package/app/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js +1 -1
  900. package/app/node_modules/caniuse-lite/data/features/intersectionobserver.js +1 -1
  901. package/app/node_modules/caniuse-lite/data/features/intl-pluralrules.js +1 -1
  902. package/app/node_modules/caniuse-lite/data/features/intrinsic-width.js +1 -1
  903. package/app/node_modules/caniuse-lite/data/features/jpeg2000.js +1 -1
  904. package/app/node_modules/caniuse-lite/data/features/jpegxl.js +1 -1
  905. package/app/node_modules/caniuse-lite/data/features/jpegxr.js +1 -1
  906. package/app/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js +1 -1
  907. package/app/node_modules/caniuse-lite/data/features/json.js +1 -1
  908. package/app/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js +1 -1
  909. package/app/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js +1 -1
  910. package/app/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js +1 -1
  911. package/app/node_modules/caniuse-lite/data/features/keyboardevent-code.js +1 -1
  912. package/app/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js +1 -1
  913. package/app/node_modules/caniuse-lite/data/features/keyboardevent-key.js +1 -1
  914. package/app/node_modules/caniuse-lite/data/features/keyboardevent-location.js +1 -1
  915. package/app/node_modules/caniuse-lite/data/features/keyboardevent-which.js +1 -1
  916. package/app/node_modules/caniuse-lite/data/features/lazyload.js +1 -1
  917. package/app/node_modules/caniuse-lite/data/features/let.js +1 -1
  918. package/app/node_modules/caniuse-lite/data/features/link-icon-png.js +1 -1
  919. package/app/node_modules/caniuse-lite/data/features/link-icon-svg.js +1 -1
  920. package/app/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js +1 -1
  921. package/app/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js +1 -1
  922. package/app/node_modules/caniuse-lite/data/features/link-rel-preconnect.js +1 -1
  923. package/app/node_modules/caniuse-lite/data/features/link-rel-prefetch.js +1 -1
  924. package/app/node_modules/caniuse-lite/data/features/link-rel-preload.js +1 -1
  925. package/app/node_modules/caniuse-lite/data/features/link-rel-prerender.js +1 -1
  926. package/app/node_modules/caniuse-lite/data/features/loading-lazy-attr.js +1 -1
  927. package/app/node_modules/caniuse-lite/data/features/loading-lazy-media.js +1 -1
  928. package/app/node_modules/caniuse-lite/data/features/localecompare.js +1 -1
  929. package/app/node_modules/caniuse-lite/data/features/magnetometer.js +1 -1
  930. package/app/node_modules/caniuse-lite/data/features/matchesselector.js +1 -1
  931. package/app/node_modules/caniuse-lite/data/features/matchmedia.js +1 -1
  932. package/app/node_modules/caniuse-lite/data/features/mathml.js +1 -1
  933. package/app/node_modules/caniuse-lite/data/features/maxlength.js +1 -1
  934. package/app/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js +1 -1
  935. package/app/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js +1 -1
  936. package/app/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js +1 -1
  937. package/app/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js +1 -1
  938. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js +1 -1
  939. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js +1 -1
  940. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js +1 -1
  941. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js +1 -1
  942. package/app/node_modules/caniuse-lite/data/features/media-fragments.js +1 -1
  943. package/app/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js +1 -1
  944. package/app/node_modules/caniuse-lite/data/features/mediarecorder.js +1 -1
  945. package/app/node_modules/caniuse-lite/data/features/mediasource.js +1 -1
  946. package/app/node_modules/caniuse-lite/data/features/menu.js +1 -1
  947. package/app/node_modules/caniuse-lite/data/features/meta-theme-color.js +1 -1
  948. package/app/node_modules/caniuse-lite/data/features/meter.js +1 -1
  949. package/app/node_modules/caniuse-lite/data/features/midi.js +1 -1
  950. package/app/node_modules/caniuse-lite/data/features/minmaxwh.js +1 -1
  951. package/app/node_modules/caniuse-lite/data/features/mp3.js +1 -1
  952. package/app/node_modules/caniuse-lite/data/features/mpeg-dash.js +1 -1
  953. package/app/node_modules/caniuse-lite/data/features/mpeg4.js +1 -1
  954. package/app/node_modules/caniuse-lite/data/features/multibackgrounds.js +1 -1
  955. package/app/node_modules/caniuse-lite/data/features/multicolumn.js +1 -1
  956. package/app/node_modules/caniuse-lite/data/features/mutation-events.js +1 -1
  957. package/app/node_modules/caniuse-lite/data/features/mutationobserver.js +1 -1
  958. package/app/node_modules/caniuse-lite/data/features/namevalue-storage.js +1 -1
  959. package/app/node_modules/caniuse-lite/data/features/native-filesystem-api.js +1 -1
  960. package/app/node_modules/caniuse-lite/data/features/nav-timing.js +1 -1
  961. package/app/node_modules/caniuse-lite/data/features/netinfo.js +1 -1
  962. package/app/node_modules/caniuse-lite/data/features/notifications.js +1 -1
  963. package/app/node_modules/caniuse-lite/data/features/object-entries.js +1 -1
  964. package/app/node_modules/caniuse-lite/data/features/object-fit.js +1 -1
  965. package/app/node_modules/caniuse-lite/data/features/object-observe.js +1 -1
  966. package/app/node_modules/caniuse-lite/data/features/object-values.js +1 -1
  967. package/app/node_modules/caniuse-lite/data/features/objectrtc.js +1 -1
  968. package/app/node_modules/caniuse-lite/data/features/offline-apps.js +1 -1
  969. package/app/node_modules/caniuse-lite/data/features/offscreencanvas.js +1 -1
  970. package/app/node_modules/caniuse-lite/data/features/ogg-vorbis.js +1 -1
  971. package/app/node_modules/caniuse-lite/data/features/ogv.js +1 -1
  972. package/app/node_modules/caniuse-lite/data/features/ol-reversed.js +1 -1
  973. package/app/node_modules/caniuse-lite/data/features/once-event-listener.js +1 -1
  974. package/app/node_modules/caniuse-lite/data/features/online-status.js +1 -1
  975. package/app/node_modules/caniuse-lite/data/features/opus.js +1 -1
  976. package/app/node_modules/caniuse-lite/data/features/orientation-sensor.js +1 -1
  977. package/app/node_modules/caniuse-lite/data/features/outline.js +1 -1
  978. package/app/node_modules/caniuse-lite/data/features/pad-start-end.js +1 -1
  979. package/app/node_modules/caniuse-lite/data/features/page-transition-events.js +1 -1
  980. package/app/node_modules/caniuse-lite/data/features/pagevisibility.js +1 -1
  981. package/app/node_modules/caniuse-lite/data/features/passive-event-listener.js +1 -1
  982. package/app/node_modules/caniuse-lite/data/features/passkeys.js +1 -1
  983. package/app/node_modules/caniuse-lite/data/features/passwordrules.js +1 -1
  984. package/app/node_modules/caniuse-lite/data/features/path2d.js +1 -1
  985. package/app/node_modules/caniuse-lite/data/features/payment-request.js +1 -1
  986. package/app/node_modules/caniuse-lite/data/features/pdf-viewer.js +1 -1
  987. package/app/node_modules/caniuse-lite/data/features/permissions-api.js +1 -1
  988. package/app/node_modules/caniuse-lite/data/features/permissions-policy.js +1 -1
  989. package/app/node_modules/caniuse-lite/data/features/picture-in-picture.js +1 -1
  990. package/app/node_modules/caniuse-lite/data/features/picture.js +1 -1
  991. package/app/node_modules/caniuse-lite/data/features/ping.js +1 -1
  992. package/app/node_modules/caniuse-lite/data/features/png-alpha.js +1 -1
  993. package/app/node_modules/caniuse-lite/data/features/pointer-events.js +1 -1
  994. package/app/node_modules/caniuse-lite/data/features/pointer.js +1 -1
  995. package/app/node_modules/caniuse-lite/data/features/pointerlock.js +1 -1
  996. package/app/node_modules/caniuse-lite/data/features/portals.js +1 -1
  997. package/app/node_modules/caniuse-lite/data/features/prefers-color-scheme.js +1 -1
  998. package/app/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js +1 -1
  999. package/app/node_modules/caniuse-lite/data/features/progress.js +1 -1
  1000. package/app/node_modules/caniuse-lite/data/features/promise-finally.js +1 -1
  1001. package/app/node_modules/caniuse-lite/data/features/promises.js +1 -1
  1002. package/app/node_modules/caniuse-lite/data/features/proximity.js +1 -1
  1003. package/app/node_modules/caniuse-lite/data/features/proxy.js +1 -1
  1004. package/app/node_modules/caniuse-lite/data/features/publickeypinning.js +1 -1
  1005. package/app/node_modules/caniuse-lite/data/features/push-api.js +1 -1
  1006. package/app/node_modules/caniuse-lite/data/features/queryselector.js +1 -1
  1007. package/app/node_modules/caniuse-lite/data/features/readonly-attr.js +1 -1
  1008. package/app/node_modules/caniuse-lite/data/features/referrer-policy.js +1 -1
  1009. package/app/node_modules/caniuse-lite/data/features/registerprotocolhandler.js +1 -1
  1010. package/app/node_modules/caniuse-lite/data/features/rel-noopener.js +1 -1
  1011. package/app/node_modules/caniuse-lite/data/features/rel-noreferrer.js +1 -1
  1012. package/app/node_modules/caniuse-lite/data/features/rellist.js +1 -1
  1013. package/app/node_modules/caniuse-lite/data/features/rem.js +1 -1
  1014. package/app/node_modules/caniuse-lite/data/features/requestanimationframe.js +1 -1
  1015. package/app/node_modules/caniuse-lite/data/features/requestidlecallback.js +1 -1
  1016. package/app/node_modules/caniuse-lite/data/features/resizeobserver.js +1 -1
  1017. package/app/node_modules/caniuse-lite/data/features/resource-timing.js +1 -1
  1018. package/app/node_modules/caniuse-lite/data/features/rest-parameters.js +1 -1
  1019. package/app/node_modules/caniuse-lite/data/features/rtcpeerconnection.js +1 -1
  1020. package/app/node_modules/caniuse-lite/data/features/ruby.js +1 -1
  1021. package/app/node_modules/caniuse-lite/data/features/run-in.js +1 -1
  1022. package/app/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js +1 -1
  1023. package/app/node_modules/caniuse-lite/data/features/screen-orientation.js +1 -1
  1024. package/app/node_modules/caniuse-lite/data/features/script-async.js +1 -1
  1025. package/app/node_modules/caniuse-lite/data/features/script-defer.js +1 -1
  1026. package/app/node_modules/caniuse-lite/data/features/scrollintoview.js +1 -1
  1027. package/app/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js +1 -1
  1028. package/app/node_modules/caniuse-lite/data/features/sdch.js +1 -1
  1029. package/app/node_modules/caniuse-lite/data/features/selection-api.js +1 -1
  1030. package/app/node_modules/caniuse-lite/data/features/server-timing.js +1 -1
  1031. package/app/node_modules/caniuse-lite/data/features/serviceworkers.js +1 -1
  1032. package/app/node_modules/caniuse-lite/data/features/setimmediate.js +1 -1
  1033. package/app/node_modules/caniuse-lite/data/features/shadowdom.js +1 -1
  1034. package/app/node_modules/caniuse-lite/data/features/shadowdomv1.js +1 -1
  1035. package/app/node_modules/caniuse-lite/data/features/sharedarraybuffer.js +1 -1
  1036. package/app/node_modules/caniuse-lite/data/features/sharedworkers.js +1 -1
  1037. package/app/node_modules/caniuse-lite/data/features/sni.js +1 -1
  1038. package/app/node_modules/caniuse-lite/data/features/spdy.js +1 -1
  1039. package/app/node_modules/caniuse-lite/data/features/speech-recognition.js +1 -1
  1040. package/app/node_modules/caniuse-lite/data/features/speech-synthesis.js +1 -1
  1041. package/app/node_modules/caniuse-lite/data/features/spellcheck-attribute.js +1 -1
  1042. package/app/node_modules/caniuse-lite/data/features/sql-storage.js +1 -1
  1043. package/app/node_modules/caniuse-lite/data/features/srcset.js +1 -1
  1044. package/app/node_modules/caniuse-lite/data/features/stream.js +1 -1
  1045. package/app/node_modules/caniuse-lite/data/features/streams.js +1 -1
  1046. package/app/node_modules/caniuse-lite/data/features/stricttransportsecurity.js +1 -1
  1047. package/app/node_modules/caniuse-lite/data/features/style-scoped.js +1 -1
  1048. package/app/node_modules/caniuse-lite/data/features/subresource-bundling.js +1 -1
  1049. package/app/node_modules/caniuse-lite/data/features/subresource-integrity.js +1 -1
  1050. package/app/node_modules/caniuse-lite/data/features/svg-css.js +1 -1
  1051. package/app/node_modules/caniuse-lite/data/features/svg-filters.js +1 -1
  1052. package/app/node_modules/caniuse-lite/data/features/svg-fonts.js +1 -1
  1053. package/app/node_modules/caniuse-lite/data/features/svg-fragment.js +1 -1
  1054. package/app/node_modules/caniuse-lite/data/features/svg-html.js +1 -1
  1055. package/app/node_modules/caniuse-lite/data/features/svg-html5.js +1 -1
  1056. package/app/node_modules/caniuse-lite/data/features/svg-img.js +1 -1
  1057. package/app/node_modules/caniuse-lite/data/features/svg-smil.js +1 -1
  1058. package/app/node_modules/caniuse-lite/data/features/svg.js +1 -1
  1059. package/app/node_modules/caniuse-lite/data/features/sxg.js +1 -1
  1060. package/app/node_modules/caniuse-lite/data/features/tabindex-attr.js +1 -1
  1061. package/app/node_modules/caniuse-lite/data/features/template-literals.js +1 -1
  1062. package/app/node_modules/caniuse-lite/data/features/template.js +1 -1
  1063. package/app/node_modules/caniuse-lite/data/features/temporal.js +1 -1
  1064. package/app/node_modules/caniuse-lite/data/features/testfeat.js +1 -1
  1065. package/app/node_modules/caniuse-lite/data/features/text-decoration.js +1 -1
  1066. package/app/node_modules/caniuse-lite/data/features/text-emphasis.js +1 -1
  1067. package/app/node_modules/caniuse-lite/data/features/text-overflow.js +1 -1
  1068. package/app/node_modules/caniuse-lite/data/features/text-size-adjust.js +1 -1
  1069. package/app/node_modules/caniuse-lite/data/features/text-stroke.js +1 -1
  1070. package/app/node_modules/caniuse-lite/data/features/textcontent.js +1 -1
  1071. package/app/node_modules/caniuse-lite/data/features/textencoder.js +1 -1
  1072. package/app/node_modules/caniuse-lite/data/features/tls1-1.js +1 -1
  1073. package/app/node_modules/caniuse-lite/data/features/tls1-2.js +1 -1
  1074. package/app/node_modules/caniuse-lite/data/features/tls1-3.js +1 -1
  1075. package/app/node_modules/caniuse-lite/data/features/touch.js +1 -1
  1076. package/app/node_modules/caniuse-lite/data/features/transforms2d.js +1 -1
  1077. package/app/node_modules/caniuse-lite/data/features/transforms3d.js +1 -1
  1078. package/app/node_modules/caniuse-lite/data/features/trusted-types.js +1 -1
  1079. package/app/node_modules/caniuse-lite/data/features/ttf.js +1 -1
  1080. package/app/node_modules/caniuse-lite/data/features/typedarrays.js +1 -1
  1081. package/app/node_modules/caniuse-lite/data/features/u2f.js +1 -1
  1082. package/app/node_modules/caniuse-lite/data/features/unhandledrejection.js +1 -1
  1083. package/app/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js +1 -1
  1084. package/app/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js +1 -1
  1085. package/app/node_modules/caniuse-lite/data/features/url.js +1 -1
  1086. package/app/node_modules/caniuse-lite/data/features/urlsearchparams.js +1 -1
  1087. package/app/node_modules/caniuse-lite/data/features/use-strict.js +1 -1
  1088. package/app/node_modules/caniuse-lite/data/features/user-select-none.js +1 -1
  1089. package/app/node_modules/caniuse-lite/data/features/user-timing.js +1 -1
  1090. package/app/node_modules/caniuse-lite/data/features/variable-fonts.js +1 -1
  1091. package/app/node_modules/caniuse-lite/data/features/vector-effect.js +1 -1
  1092. package/app/node_modules/caniuse-lite/data/features/vibration.js +1 -1
  1093. package/app/node_modules/caniuse-lite/data/features/video.js +1 -1
  1094. package/app/node_modules/caniuse-lite/data/features/videotracks.js +1 -1
  1095. package/app/node_modules/caniuse-lite/data/features/view-transitions.js +1 -1
  1096. package/app/node_modules/caniuse-lite/data/features/viewport-unit-variants.js +1 -1
  1097. package/app/node_modules/caniuse-lite/data/features/viewport-units.js +1 -1
  1098. package/app/node_modules/caniuse-lite/data/features/wai-aria.js +1 -1
  1099. package/app/node_modules/caniuse-lite/data/features/wake-lock.js +1 -1
  1100. package/app/node_modules/caniuse-lite/data/features/wasm-bigint.js +1 -1
  1101. package/app/node_modules/caniuse-lite/data/features/wasm-bulk-memory.js +1 -1
  1102. package/app/node_modules/caniuse-lite/data/features/wasm-extended-const.js +1 -1
  1103. package/app/node_modules/caniuse-lite/data/features/wasm-gc.js +1 -1
  1104. package/app/node_modules/caniuse-lite/data/features/wasm-multi-memory.js +1 -1
  1105. package/app/node_modules/caniuse-lite/data/features/wasm-multi-value.js +1 -1
  1106. package/app/node_modules/caniuse-lite/data/features/wasm-mutable-globals.js +1 -1
  1107. package/app/node_modules/caniuse-lite/data/features/wasm-nontrapping-fptoint.js +1 -1
  1108. package/app/node_modules/caniuse-lite/data/features/wasm-reference-types.js +1 -1
  1109. package/app/node_modules/caniuse-lite/data/features/wasm-relaxed-simd.js +1 -1
  1110. package/app/node_modules/caniuse-lite/data/features/wasm-signext.js +1 -1
  1111. package/app/node_modules/caniuse-lite/data/features/wasm-simd.js +1 -1
  1112. package/app/node_modules/caniuse-lite/data/features/wasm-tail-calls.js +1 -1
  1113. package/app/node_modules/caniuse-lite/data/features/wasm-threads.js +1 -1
  1114. package/app/node_modules/caniuse-lite/data/features/wasm.js +1 -1
  1115. package/app/node_modules/caniuse-lite/data/features/wav.js +1 -1
  1116. package/app/node_modules/caniuse-lite/data/features/wbr-element.js +1 -1
  1117. package/app/node_modules/caniuse-lite/data/features/web-animation.js +1 -1
  1118. package/app/node_modules/caniuse-lite/data/features/web-app-manifest.js +1 -1
  1119. package/app/node_modules/caniuse-lite/data/features/web-bluetooth.js +1 -1
  1120. package/app/node_modules/caniuse-lite/data/features/web-serial.js +1 -1
  1121. package/app/node_modules/caniuse-lite/data/features/web-share.js +1 -1
  1122. package/app/node_modules/caniuse-lite/data/features/webauthn.js +1 -1
  1123. package/app/node_modules/caniuse-lite/data/features/webcodecs.js +1 -1
  1124. package/app/node_modules/caniuse-lite/data/features/webgl.js +1 -1
  1125. package/app/node_modules/caniuse-lite/data/features/webgl2.js +1 -1
  1126. package/app/node_modules/caniuse-lite/data/features/webgpu.js +1 -1
  1127. package/app/node_modules/caniuse-lite/data/features/webhid.js +1 -1
  1128. package/app/node_modules/caniuse-lite/data/features/webkit-user-drag.js +1 -1
  1129. package/app/node_modules/caniuse-lite/data/features/webm.js +1 -1
  1130. package/app/node_modules/caniuse-lite/data/features/webnfc.js +1 -1
  1131. package/app/node_modules/caniuse-lite/data/features/webp.js +1 -1
  1132. package/app/node_modules/caniuse-lite/data/features/websockets.js +1 -1
  1133. package/app/node_modules/caniuse-lite/data/features/webtransport.js +1 -1
  1134. package/app/node_modules/caniuse-lite/data/features/webusb.js +1 -1
  1135. package/app/node_modules/caniuse-lite/data/features/webvr.js +1 -1
  1136. package/app/node_modules/caniuse-lite/data/features/webvtt.js +1 -1
  1137. package/app/node_modules/caniuse-lite/data/features/webworkers.js +1 -1
  1138. package/app/node_modules/caniuse-lite/data/features/webxr.js +1 -1
  1139. package/app/node_modules/caniuse-lite/data/features/will-change.js +1 -1
  1140. package/app/node_modules/caniuse-lite/data/features/woff.js +1 -1
  1141. package/app/node_modules/caniuse-lite/data/features/woff2.js +1 -1
  1142. package/app/node_modules/caniuse-lite/data/features/word-break.js +1 -1
  1143. package/app/node_modules/caniuse-lite/data/features/wordwrap.js +1 -1
  1144. package/app/node_modules/caniuse-lite/data/features/x-doc-messaging.js +1 -1
  1145. package/app/node_modules/caniuse-lite/data/features/x-frame-options.js +1 -1
  1146. package/app/node_modules/caniuse-lite/data/features/xhr2.js +1 -1
  1147. package/app/node_modules/caniuse-lite/data/features/xhtml.js +1 -1
  1148. package/app/node_modules/caniuse-lite/data/features/xhtmlsmil.js +1 -1
  1149. package/app/node_modules/caniuse-lite/data/features/xml-serializer.js +1 -1
  1150. package/app/node_modules/caniuse-lite/data/features/zstd.js +1 -1
  1151. package/app/node_modules/caniuse-lite/package.json +1 -1
  1152. package/app/node_modules/next/dist/build/swc/index.js +1 -1
  1153. package/app/node_modules/next/dist/build/webpack-config.js +3 -3
  1154. package/app/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  1155. package/app/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +1 -1
  1156. package/app/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  1157. package/app/node_modules/next/dist/server/config.js +1 -1
  1158. package/app/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  1159. package/app/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  1160. package/app/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  1161. package/app/node_modules/next/dist/server/lib/start-server.js +1 -1
  1162. package/app/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  1163. package/app/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  1164. package/app/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  1165. package/app/node_modules/next/dist/telemetry/events/version.js +2 -2
  1166. package/app/node_modules/next/package.json +15 -15
  1167. package/app/package.json +1 -1
  1168. package/package.json +1 -1
  1169. package/app/.next-cli-build/server/chunks/3913.js +0 -64
  1170. package/app/.next-cli-build/static/chunks/1051-eec0f271123ef82f.js +0 -64
  1171. package/app/.next-cli-build/static/chunks/5497-67b2f27c81aedbb6.js +0 -7
  1172. package/app/.next-cli-build/static/css/e0eda78045b5ddef.css +0 -1
  1173. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-2.0.64-to-2.0.65-2.0.65-20260615-134351/data.sqlite +0 -0
  1174. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-2.0.65-to-2.0.66-2.0.66-20260615-134832/data.sqlite +0 -0
  1175. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-2.0.66-to-2.0.67-2.0.67-20260615-160706/data.sqlite +0 -0
  1176. /package/app/.next-cli-build/static/{bR9icFlQc1LSGldh-TjFH → EDMMyBNQq8vlQ-Xb6yK-L}/_buildManifest.js +0 -0
  1177. /package/app/.next-cli-build/static/{bR9icFlQc1LSGldh-TjFH → EDMMyBNQq8vlQ-Xb6yK-L}/_ssgManifest.js +0 -0
@@ -3,7 +3,7 @@ exports.id=402,exports.ids=[402],exports.modules={490:(a,b,c)=>{"use strict";c.d
3
3
  ON CONFLICT(id) DO UPDATE SET
4
4
  provider=excluded.provider, authType=excluded.authType, name=excluded.name,
5
5
  email=excluded.email, priority=excluded.priority, isActive=excluded.isActive,
6
- data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}async function j(a={}){let b=await (0,e.c)(),c=[],d=[];a.provider&&(c.push("provider = ?"),d.push(a.provider)),void 0!==a.isActive&&(c.push("isActive = ?"),d.push(+!!a.isActive));let f=`SELECT * FROM providerConnections${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,d).map(h);return g.sort((a,b)=>(a.priority||999)-(b.priority||999)),g}async function k(a){return h((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function l(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(h);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[c+1,b.id])})}async function m(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{let e=c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(h),j=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.chatgptAccountId;j=e.find(c=>{if("oauth"!==c.authType||c.email!==a.email)return!1;let d=c.providerSpecificData?.chatgptAccountId;return!b||!d||b===d})}else"apikey"===a.authType&&a.name&&(j=e.find(b=>"apikey"===b.authType&&b.name===a.name));if(j){let d={...j,...a,updatedAt:f};i(c,d),b=d;return}let k=a.name||null;k||"oauth"!==a.authType&&"access_token"!==a.authType||(k=a.email||`Account ${e.length+1}`);let m=a.priority;m||(m=e.reduce((a,b)=>Math.max(a,b.priority||0),0)+1);let n={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:k,priority:m,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of g)void 0!==a[b]&&null!==a[b]&&(n[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(n.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(n.email=a.email),i(c,n),l(c,a.provider),b=n}),b}async function n(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=h(e),g={...f,...b,updatedAt:new Date().toISOString()};i(d,g),void 0!==b.priority&&l(d,f.provider),c=g}),c}async function o(a){let b=await (0,e.c)(),c=!1;return b.transaction(()=>{let d=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);d&&(b.run("DELETE FROM providerConnections WHERE id = ?",[a]),l(b,d.provider),c=!0)}),c}async function p(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),c?.n||0}},9460:(a,b,c)=>{"use strict";c.d(b,{L9:()=>r,OM:()=>j,S8:()=>o,fv:()=>l,getMitmAlias:()=>q,o5:()=>k,uL:()=>p,uv:()=>n});var d=c(36366),e=c(644),f=c(22846);let g=(0,f.U)("modelAliases"),h=(0,f.U)("customModels"),i=(0,f.U)("mitmAlias");async function j(){return await g.getAll()}async function k(a,b){await g.set(a,b)}async function l(a){await g.remove(a)}function m(a,b,c){return`${a}|${b}|${c}`}async function n(){return Object.values(await h.getAll())}async function o({providerAlias:a,id:b,type:c="llm",name:f}){let g=m(a,b,c),h=await (0,d.c)(),i=!1;return h.transaction(()=>{if(h.get("SELECT 1 FROM kv WHERE scope = 'customModels' AND key = ?",[g]))return;let d=(0,e.s)({providerAlias:a,id:b,type:c,name:f||b});h.run("INSERT INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[g,d]),i=!0}),i}async function p({providerAlias:a,id:b,type:c="llm"}){await h.remove(m(a,b,c))}async function q(a){return a?await i.get(a)||{}:await i.getAll()}async function r(a,b){await i.set(a,b||{})}},22846:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(36366),e=c(644);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},36366:(a,b,c)=>{"use strict";c.d(b,{c:()=>k});var d=c(95658);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,logged:!1});let e=global._dbAdapter;async function f(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(4739).then(c.bind(c,24739));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function g(){if(process.versions.bun)return null;try{let{createBetterSqliteAdapter:a}=await c.e(5258).then(c.bind(c,25258));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(8520).then(c.bind(c,88520));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function i(){try{let{createSqlJsAdapter:a}=await c.e(3593).then(c.bind(c,53593));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function j(){(0,d.Jh)();let a=await f();if(a||(a=await g()),a||(a=await h()),a||(a=await i()),!a)throw Error("[DB] No SQLite driver available (bun/better/node/sql.js all failed)");e.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),e.logged=!0);let{runMigrationOnce:b}=await c.e(3941).then(c.bind(c,43941));return await b(a),a}async function k(){return e.instance?e.instance:(e.initPromise||(e.initPromise=j().then(a=>(e.instance=a,a))),e.initPromise)}},42655:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>j,exportSettings:()=>k,getSettings:()=>i});var d=c(36366),e=c(644);let f={cloudEnabled:!1,tunnelEnabled:!1,tunnelUrl:"",tunnelProvider:"cloudflare",tailscaleEnabled:!1,tailscaleUrl:"",stickyRoundRobinLimit:3,providerStrategies:{},providerSchedules:{},providerHealthChecks:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},requireApiKey:!0,requireLogin:!0,tunnelDashboardAccess:!0,authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcClientSecret:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC",ldapMonitorAdminGroupDn:"",enableObservability:!0,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:20128",dnsToolEnabled:{},rtkEnabled:!0,cavemanEnabled:!1,cavemanLevel:"full",sidebarAdvancedToolsVisible:!0};async function g(){let a=(await (0,d.c)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}function h(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c);return b.requireApiKey=!0,b.requireLogin=!0,b}async function i(){return h(await g())}async function j(a){let b,c=await (0,d.c)();return c.transaction(()=>{let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a,requireApiKey:!0,requireLogin:!0},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),h(b)}async function k(){return await g()}},45903:(a,b,c)=>{"use strict";c.d(b,{AP:()=>m,BY:()=>w,I6:()=>k,L7:()=>l,dX:()=>v,r:()=>j});var d=c(89718),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g);let i={enabled:!1,type:"sqlite",sqlitePath:"",host:"",port:"",database:"",username:"",password:"",ssl:!1,createDatabase:!1,logClientRequest:!0,logSourceRequest:!0,logTargetRequest:!0,logProviderResponse:!1,logErrors:!0,retentionDays:30};function j(a){let b={...a||{}};return b.password&&(b.password="********"),b}function k(a={},b={}){let c={...i,...b||{},...a||{}};c.enabled=!!c.enabled,c.type=["sqlite","postgres","mysql"].includes(c.type)?c.type:"sqlite",c.ssl=!!c.ssl,c.createDatabase=!!c.createDatabase,c.logClientRequest=!1!==c.logClientRequest,c.logSourceRequest=!1!==c.logSourceRequest,c.logTargetRequest=!1!==c.logTargetRequest,c.logProviderResponse=!0===c.logProviderResponse,c.logErrors=!1!==c.logErrors;let d=Number(c.retentionDays);return c.retentionDays=Number.isFinite(d)&&d>0?Math.floor(d):30,"********"===c.password&&(c.password=b?.password||""),c.host=String(c.host||"").trim(),c.port=String(c.port||"").trim(),c.database=String(c.database||"").trim(),c.username=String(c.username||"").trim(),c.password=String(c.password||""),c.sqlitePath=String(c.sqlitePath||"").trim(),c}async function l(){let a=await (0,d.mt)();return{...i,...a?.promptLogDb||{}}}async function m(a){let b=await (0,d.mt)(),c=k(a,b?.promptLogDb||{});return await (0,d.Xx)({promptLogDb:c}),c}async function n(a){let b,d=a.sqlitePath||(b=process.env.DATA_DIR||"/var/lib/bluerouter",f().join(b,"logs","promptLogs.sqlite"));h().mkdirSync(f().dirname(d),{recursive:!0});try{let a=await Promise.resolve().then(c.t.bind(c,87550,23)),b=new(a.default||a)(d);return b.pragma("journal_mode = WAL"),b.pragma("busy_timeout = 5000"),{type:"sqlite",sqlitePath:d,exec(a){b.exec(a)},all:(a,c=[])=>b.prepare(a).all(...c),close(){b.close()}}}catch{let a=new(await Promise.resolve().then(c.t.bind(c,80099,23))).DatabaseSync(d);return a.exec("PRAGMA journal_mode = WAL"),a.exec("PRAGMA busy_timeout = 5000"),{type:"sqlite",sqlitePath:d,exec(b){a.exec(b)},all:(b,c=[])=>a.prepare(b).all(...c),close(){a.close()}}}}async function o(a,b=null){let d=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:b||a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await d.connect(),{type:"postgres",client:d,async exec(a){await d.query(a)},async close(){await d.end()}}}async function p(a,b=!0){let d=await c.e(8491).then(c.t.bind(c,38491,19)),e=await d.createConnection({host:a.host,port:Number(a.port||3306),database:b?a.database:void 0,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,multipleStatements:!0});return{type:"mysql",conn:e,async exec(a){await e.query(a)},async close(){await e.end()}}}async function q(a){let b=new Set(a.all("PRAGMA table_info(prompt_logs)").map(a=>a.name)),c=(c,d)=>{b.has(c)||a.exec(`ALTER TABLE prompt_logs ADD COLUMN ${c} ${d};`)};c("client_ip","TEXT"),c("client_port","TEXT"),c("client_user_agent","TEXT"),c("client_host","TEXT"),c("source_tool","TEXT"),c("source_tool_label","TEXT"),c("source_host","TEXT"),c("provider","TEXT"),c("account_name","TEXT"),c("connection_id","TEXT"),c("display_model","TEXT"),c("content_mode","TEXT"),c("payload_hash","TEXT"),c("payload_size_bytes","INTEGER DEFAULT 0"),a.exec("CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip ON prompt_logs(client_ip);"),a.exec("CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool ON prompt_logs(source_tool);")}async function r(a){await a.exec(`
6
+ data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}async function j(a={}){let b=await (0,e.c)(),c=[],d=[];a.provider&&(c.push("provider = ?"),d.push(a.provider)),void 0!==a.isActive&&(c.push("isActive = ?"),d.push(+!!a.isActive));let f=`SELECT * FROM providerConnections${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,d).map(h);return g.sort((a,b)=>(a.priority||999)-(b.priority||999)),g}async function k(a){return h((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function l(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(h);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[c+1,b.id])})}async function m(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{let e=c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(h),j=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.chatgptAccountId;j=e.find(c=>{if("oauth"!==c.authType||c.email!==a.email)return!1;let d=c.providerSpecificData?.chatgptAccountId;return!b||!d||b===d})}else"apikey"===a.authType&&a.name&&(j=e.find(b=>"apikey"===b.authType&&b.name===a.name));if(j){let d={...j,...a,updatedAt:f};i(c,d),b=d;return}let k=a.name||null;k||"oauth"!==a.authType&&"access_token"!==a.authType||(k=a.email||`Account ${e.length+1}`);let m=a.priority;m||(m=e.reduce((a,b)=>Math.max(a,b.priority||0),0)+1);let n={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:k,priority:m,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of g)void 0!==a[b]&&null!==a[b]&&(n[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(n.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(n.email=a.email),i(c,n),l(c,a.provider),b=n}),b}async function n(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=h(e),g={...f,...b,updatedAt:new Date().toISOString()};i(d,g),void 0!==b.priority&&l(d,f.provider),c=g}),c}async function o(a){let b=await (0,e.c)(),c=!1;return b.transaction(()=>{let d=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);d&&(b.run("DELETE FROM providerConnections WHERE id = ?",[a]),l(b,d.provider),c=!0)}),c}async function p(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),c?.n||0}},9460:(a,b,c)=>{"use strict";c.d(b,{L9:()=>r,OM:()=>j,S8:()=>o,fv:()=>l,getMitmAlias:()=>q,o5:()=>k,uL:()=>p,uv:()=>n});var d=c(36366),e=c(644),f=c(22846);let g=(0,f.U)("modelAliases"),h=(0,f.U)("customModels"),i=(0,f.U)("mitmAlias");async function j(){return await g.getAll()}async function k(a,b){await g.set(a,b)}async function l(a){await g.remove(a)}function m(a,b,c){return`${a}|${b}|${c}`}async function n(){return Object.values(await h.getAll())}async function o({providerAlias:a,id:b,type:c="llm",name:f}){let g=m(a,b,c),h=await (0,d.c)(),i=!1;return h.transaction(()=>{if(h.get("SELECT 1 FROM kv WHERE scope = 'customModels' AND key = ?",[g]))return;let d=(0,e.s)({providerAlias:a,id:b,type:c,name:f||b});h.run("INSERT INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[g,d]),i=!0}),i}async function p({providerAlias:a,id:b,type:c="llm"}){await h.remove(m(a,b,c))}async function q(a){return a?await i.get(a)||{}:await i.getAll()}async function r(a,b){await i.set(a,b||{})}},22846:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(36366),e=c(644);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},36366:(a,b,c)=>{"use strict";c.d(b,{c:()=>k});var d=c(95658);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,logged:!1});let e=global._dbAdapter;async function f(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(4739).then(c.bind(c,24739));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function g(){if(process.versions.bun)return null;try{let{createBetterSqliteAdapter:a}=await c.e(5258).then(c.bind(c,25258));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(8520).then(c.bind(c,88520));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function i(){try{let{createSqlJsAdapter:a}=await c.e(3593).then(c.bind(c,53593));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function j(){(0,d.Jh)();let a=await f();if(a||(a=await g()),a||(a=await h()),a||(a=await i()),!a)throw Error("[DB] No SQLite driver available (bun/better/node/sql.js all failed)");e.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),e.logged=!0);let{runMigrationOnce:b}=await c.e(232).then(c.bind(c,70232));return await b(a),a}async function k(){return e.instance?e.instance:(e.initPromise||(e.initPromise=j().then(a=>(e.instance=a,a))),e.initPromise)}},42655:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>j,exportSettings:()=>k,getSettings:()=>i});var d=c(36366),e=c(644);let f={cloudEnabled:!1,tunnelEnabled:!1,tunnelUrl:"",tunnelProvider:"cloudflare",tailscaleEnabled:!1,tailscaleUrl:"",stickyRoundRobinLimit:3,providerStrategies:{},providerSchedules:{},providerHealthChecks:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},requireApiKey:!0,requireLogin:!0,tunnelDashboardAccess:!0,authMode:"password",oidcIssuerUrl:"",oidcClientId:"",oidcClientSecret:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC",ldapMonitorAdminGroupDn:"",enableObservability:!0,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:20128",dnsToolEnabled:{},rtkEnabled:!0,cavemanEnabled:!1,cavemanLevel:"full",sidebarAdvancedToolsVisible:!0};async function g(){let a=(await (0,d.c)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}function h(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c);return b.requireApiKey=!0,b.requireLogin=!0,b}async function i(){return h(await g())}async function j(a){let b,c=await (0,d.c)();return c.transaction(()=>{let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a,requireApiKey:!0,requireLogin:!0},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),h(b)}async function k(){return await g()}},45903:(a,b,c)=>{"use strict";c.d(b,{AP:()=>m,BY:()=>w,I6:()=>k,L7:()=>l,dX:()=>v,r:()=>j});var d=c(89718),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g);let i={enabled:!1,type:"sqlite",sqlitePath:"",host:"",port:"",database:"",username:"",password:"",ssl:!1,createDatabase:!1,logClientRequest:!0,logSourceRequest:!0,logTargetRequest:!0,logProviderResponse:!1,logErrors:!0,retentionDays:30};function j(a){let b={...a||{}};return b.password&&(b.password="********"),b}function k(a={},b={}){let c={...i,...b||{},...a||{}};c.enabled=!!c.enabled,c.type=["sqlite","postgres","mysql"].includes(c.type)?c.type:"sqlite",c.ssl=!!c.ssl,c.createDatabase=!!c.createDatabase,c.logClientRequest=!1!==c.logClientRequest,c.logSourceRequest=!1!==c.logSourceRequest,c.logTargetRequest=!1!==c.logTargetRequest,c.logProviderResponse=!0===c.logProviderResponse,c.logErrors=!1!==c.logErrors;let d=Number(c.retentionDays);return c.retentionDays=Number.isFinite(d)&&d>0?Math.floor(d):30,"********"===c.password&&(c.password=b?.password||""),c.host=String(c.host||"").trim(),c.port=String(c.port||"").trim(),c.database=String(c.database||"").trim(),c.username=String(c.username||"").trim(),c.password=String(c.password||""),c.sqlitePath=String(c.sqlitePath||"").trim(),c}async function l(){let a=await (0,d.mt)();return{...i,...a?.promptLogDb||{}}}async function m(a){let b=await (0,d.mt)(),c=k(a,b?.promptLogDb||{});return await (0,d.Xx)({promptLogDb:c}),c}async function n(a){let b,d=a.sqlitePath||(b=process.env.DATA_DIR||"/var/lib/bluerouter",f().join(b,"logs","promptLogs.sqlite"));h().mkdirSync(f().dirname(d),{recursive:!0});try{let a=await Promise.resolve().then(c.t.bind(c,87550,23)),b=new(a.default||a)(d);return b.pragma("journal_mode = WAL"),b.pragma("busy_timeout = 5000"),{type:"sqlite",sqlitePath:d,exec(a){b.exec(a)},all:(a,c=[])=>b.prepare(a).all(...c),close(){b.close()}}}catch{let a=new(await Promise.resolve().then(c.t.bind(c,80099,23))).DatabaseSync(d);return a.exec("PRAGMA journal_mode = WAL"),a.exec("PRAGMA busy_timeout = 5000"),{type:"sqlite",sqlitePath:d,exec(b){a.exec(b)},all:(b,c=[])=>a.prepare(b).all(...c),close(){a.close()}}}}async function o(a,b=null){let d=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:b||a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await d.connect(),{type:"postgres",client:d,async exec(a){await d.query(a)},async close(){await d.end()}}}async function p(a,b=!0){let d=await c.e(8491).then(c.t.bind(c,38491,19)),e=await d.createConnection({host:a.host,port:Number(a.port||3306),database:b?a.database:void 0,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,multipleStatements:!0});return{type:"mysql",conn:e,async exec(a){await e.query(a)},async close(){await e.end()}}}async function q(a){let b=new Set(a.all("PRAGMA table_info(prompt_logs)").map(a=>a.name)),c=(c,d)=>{b.has(c)||a.exec(`ALTER TABLE prompt_logs ADD COLUMN ${c} ${d};`)};c("client_ip","TEXT"),c("client_port","TEXT"),c("client_user_agent","TEXT"),c("client_host","TEXT"),c("source_tool","TEXT"),c("source_tool_label","TEXT"),c("source_host","TEXT"),c("provider","TEXT"),c("account_name","TEXT"),c("connection_id","TEXT"),c("display_model","TEXT"),c("content_mode","TEXT"),c("payload_hash","TEXT"),c("payload_size_bytes","INTEGER DEFAULT 0"),a.exec("CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip ON prompt_logs(client_ip);"),a.exec("CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool ON prompt_logs(source_tool);")}async function r(a){await a.exec(`
7
7
  ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_ip TEXT;
8
8
  ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_port TEXT;
9
9
  ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_user_agent TEXT;
@@ -199,20 +199,20 @@ exports.id=402,exports.ids=[402],exports.modules={490:(a,b,c)=>{"use strict";c.d
199
199
  INDEX idx_prompt_log_payloads_created_at (created_at),
200
200
  INDEX idx_prompt_log_payloads_last_seen_at (last_seen_at)
201
201
  ) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
202
- `),await u(a,b),{ok:!0,type:"mysql",message:"MySQL prompt log schema is ready"}}finally{await a.close()}}throw Error(`Unsupported database type: ${b.type}`)}async function w(a=null){let b=k(a||await l());if("sqlite"===b.type){let a=await n(b);try{return a.exec("SELECT 1;"),{ok:!0,type:"sqlite",message:"SQLite connection OK",sqlitePath:a.sqlitePath}}finally{a.close()}}if("postgres"===b.type){let a=await o(b);try{return await a.exec("SELECT 1;"),{ok:!0,type:"postgres",message:"PostgreSQL connection OK"}}finally{await a.close()}}if("mysql"===b.type){let a=await p(b,!0);try{return await a.exec("SELECT 1;"),{ok:!0,type:"mysql",message:"MySQL connection OK"}}finally{await a.close()}}throw Error(`Unsupported database type: ${b.type}`)}},49120:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DATA_DIR:()=>m,getDataDir:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="bluerouter";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function l(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}let m=l()},56403:(a,b,c)=>{"use strict";c.d(b,{S8:()=>E.S8,E5:()=>K.E5,Iq:()=>w.Iq,jd:()=>B,iE:()=>g.iE,i0:()=>m,ZO:()=>t,Lh:()=>w.Lh,CG:()=>D,uL:()=>E.uL,fv:()=>E.fv,fK:()=>g.fK,op:()=>g.op,Pc:()=>o,Yd:()=>v,tm:()=>I,oF:()=>J,zP:()=>X,rg:()=>K.rg,yg:()=>w.yg,mY:()=>w.getApiKeyByKey,PX:()=>w.PX,j$:()=>K.j$,L:()=>z,Dj:()=>A,Uv:()=>y,uv:()=>E.uv,vF:()=>H,c:()=>E.getMitmAlias,OM:()=>E.OM,r4:()=>F.r4,Mc:()=>g.Mc,P:()=>g.getProviderConnections,Qu:()=>l,Fh:()=>k,hr:()=>s,ui:()=>r,Zx:()=>K.Zx,SL:()=>V,mt:()=>f.getSettings,BY:()=>K.BY,K1:()=>Y,VT:()=>F.VT,yF:()=>F.yF,ox:()=>U,sZ:()=>K.sZ,L9:()=>E.L9,o5:()=>E.o5,_V:()=>K._V,uw:()=>K.uw,XW:()=>w.XW,oG:()=>C,KJ:()=>F.KJ,rj:()=>g.rj,ho:()=>n,Q_:()=>u,Xx:()=>f.Xx,ek:()=>w.ek});var d=c(36366),e=c(644),f=c(42655),g=c(5781),h=c(94755);function i(a){return a?{...(0,e.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function j(a,b){let c=function(a){let{id:b,type:c,name:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,type:c??null,name:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO providerNodes(id, type, name, data, createdAt, updatedAt)
202
+ `),await u(a,b),{ok:!0,type:"mysql",message:"MySQL prompt log schema is ready"}}finally{await a.close()}}throw Error(`Unsupported database type: ${b.type}`)}async function w(a=null){let b=k(a||await l());if("sqlite"===b.type){let a=await n(b);try{return a.exec("SELECT 1;"),{ok:!0,type:"sqlite",message:"SQLite connection OK",sqlitePath:a.sqlitePath}}finally{a.close()}}if("postgres"===b.type){let a=await o(b);try{return await a.exec("SELECT 1;"),{ok:!0,type:"postgres",message:"PostgreSQL connection OK"}}finally{await a.close()}}if("mysql"===b.type){let a=await p(b,!0);try{return await a.exec("SELECT 1;"),{ok:!0,type:"mysql",message:"MySQL connection OK"}}finally{await a.close()}}throw Error(`Unsupported database type: ${b.type}`)}},49120:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DATA_DIR:()=>m,getDataDir:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="bluerouter";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function l(){let a=process.env.DATA_DIR;if(!a)return k();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}let m=l()},56403:(a,b,c)=>{"use strict";c.d(b,{S8:()=>E.S8,E5:()=>K.E5,Iq:()=>w.Iq,jd:()=>B,iE:()=>g.iE,i0:()=>m,ZO:()=>t,Lh:()=>w.Lh,CG:()=>D,uL:()=>E.uL,fv:()=>E.fv,fK:()=>g.fK,op:()=>g.op,Pc:()=>o,Yd:()=>v,tm:()=>I,oF:()=>J,zP:()=>$,rg:()=>K.rg,yg:()=>w.yg,mY:()=>w.getApiKeyByKey,PX:()=>w.PX,j$:()=>K.j$,L:()=>z,Dj:()=>A,Uv:()=>y,uv:()=>E.uv,vF:()=>H,c:()=>E.getMitmAlias,OM:()=>E.OM,r4:()=>F.r4,Mc:()=>g.Mc,P:()=>g.getProviderConnections,Qu:()=>l,Fh:()=>k,hr:()=>s,ui:()=>r,Zx:()=>K.Zx,SL:()=>Y,mt:()=>f.getSettings,BY:()=>K.BY,K1:()=>_,VT:()=>F.VT,yF:()=>F.yF,ox:()=>X,sZ:()=>K.sZ,L9:()=>E.L9,o5:()=>E.o5,_V:()=>K._V,uw:()=>K.uw,XW:()=>w.XW,oG:()=>C,KJ:()=>F.KJ,rj:()=>g.rj,ho:()=>n,Q_:()=>u,Xx:()=>f.Xx,ek:()=>w.ek});var d=c(36366),e=c(644),f=c(42655),g=c(5781),h=c(94755);function i(a){return a?{...(0,e.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function j(a,b){let c=function(a){let{id:b,type:c,name:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,type:c??null,name:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO providerNodes(id, type, name, data, createdAt, updatedAt)
203
203
  VALUES(?, ?, ?, ?, ?, ?)
204
204
  ON CONFLICT(id) DO UPDATE SET
205
205
  type=excluded.type, name=excluded.name, data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.type,c.name,c.data,c.createdAt,c.updatedAt])}async function k(a={}){let b=await (0,d.c)(),c=[],e=[];a.type&&(c.push("type = ?"),e.push(a.type));let f=`SELECT * FROM providerNodes${c.length?` WHERE ${c.join(" AND ")}`:""}`;return b.all(f,e).map(i)}async function l(a){return i((await (0,d.c)()).get("SELECT * FROM providerNodes WHERE id = ?",[a]))}async function m(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,h.A)(),type:a.type,name:a.name,prefix:a.prefix,apiType:a.apiType,baseUrl:a.baseUrl,openAICompatibleRuntime:a.openAICompatibleRuntime,createdAt:c,updatedAt:c};return j(b,e),e}async function n(a,b){let c=await (0,d.c)(),e=null;return c.transaction(()=>{let d=c.get("SELECT * FROM providerNodes WHERE id = ?",[a]);if(!d)return;let f={...i(d),...b,updatedAt:new Date().toISOString()};j(c,f),e=f}),e}async function o(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM providerNodes WHERE id = ?",[a]);d&&(c=i(d),b.run("DELETE FROM providerNodes WHERE id = ?",[a]))}),c}function p(a){return a?{...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive||!0===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function q(a,b){let c=function(a){let{id:b,isActive:c,testStatus:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,isActive:+(!1!==c),testStatus:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt)
206
206
  VALUES(?, ?, ?, ?, ?, ?)
207
207
  ON CONFLICT(id) DO UPDATE SET
208
208
  isActive=excluded.isActive, testStatus=excluded.testStatus,
209
- data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.isActive,c.testStatus,c.data,c.createdAt,c.updatedAt])}async function r(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(p);return g.sort((a,b)=>new Date(b.updatedAt||0)-new Date(a.updatedAt||0)),g}async function s(a){return p((await (0,d.c)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))}async function t(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,h.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 q(b,e),e}async function u(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={...p(d),...b,updatedAt:new Date().toISOString()};q(c,f),e=f}),e}async function v(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM proxyPools WHERE id = ?",[a]);d&&(c=p(d),b.run("DELETE FROM proxyPools WHERE id = ?",[a]))}),c}var w=c(74452);function x(a){return a?{id:a.id,name:a.name,kind:a.kind,models:(0,e.q)(a.models,[]),createdAt:a.createdAt,updatedAt:a.updatedAt}:null}async function y(){return(await (0,d.c)()).all("SELECT * FROM combos ORDER BY createdAt ASC").map(x)}async function z(a){return x((await (0,d.c)()).get("SELECT * FROM combos WHERE id = ?",[a]))}async function A(a){return x((await (0,d.c)()).get("SELECT * FROM combos WHERE name = ?",[a]))}async function B(a){let b=await (0,d.c)(),c=new Date().toISOString(),f={id:(0,h.A)(),name:a.name,kind:a.kind||null,models:a.models||[],createdAt:c,updatedAt:c};return b.run("INSERT INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[f.id,f.name,f.kind,(0,e.s)(f.models),f.createdAt,f.updatedAt]),f}async function C(a,b){let c=await (0,d.c)(),f=null;return c.transaction(()=>{let d=c.get("SELECT * FROM combos WHERE id = ?",[a]);if(!d)return;let g={...x(d),...b,updatedAt:new Date().toISOString()};c.run("UPDATE combos SET name = ?, kind = ?, models = ?, updatedAt = ? WHERE id = ?",[g.name,g.kind,(0,e.s)(g.models||[]),g.updatedAt,a]),f=g}),f}async function D(a){let b=(await (0,d.c)()).run("DELETE FROM combos WHERE id = ?",[a]);return(b?.changes??0)>0}var E=c(9460),F=c(97914);let G="disabledModels";async function H(){let a=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[G]),b={};for(let c of a)b[c.key]=(0,e.q)(c.value,[]);return b}async function I(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 = ?",[G,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",[G,a,(0,e.s)(f)])})}async function J(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 = ?",[G,a]);let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[G,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 = ?",[G,a]):c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[G,a,(0,e.s)(h)])})}var K=c(99703),L=c(77638);let M=null,N=0;async function O(){if(M&&Date.now()-N<5e3)return M;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,42655)),b=await a(),d="false"!==process.env.OBSERVABILITY_ENABLED;M={enabled:"boolean"==typeof b.enableObservability?b.enableObservability:d,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{M={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return N=Date.now(),M}let P=[],Q=null,R=!1;function S(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}async function T(){if(!R&&0!==P.length){R=!0;try{for(;P.length>0;){let a=P.splice(0,P.length),b=await O(),c=[];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:S(d.request,b.maxJsonSize),providerRequest:S(d.providerRequest,b.maxJsonSize),providerResponse:S(d.providerResponse,b.maxJsonSize),response:S(d.response,b.maxJsonSize)};c.push(a)}if(!(!(c.length>0)||await (0,L.RT)(c).catch(()=>!1))){let a=await (0,d.c)();a.transaction(()=>{for(let b of c)a.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",[b.id,b.timestamp,b.provider,b.model,b.connectionId,b.status,(0,e.s)(b)]);let d=a.get("SELECT COUNT(*) as c FROM requestDetails");d&&d.c>b.maxRecords&&a.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[d.c-b.maxRecords])})}}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{R=!1}}}async function U(a){let b=await O();b.enabled&&(P.push(a),P.length>=b.batchSize?(Q&&(clearTimeout(Q),Q=null),T().catch(a=>console.error("[requestDetailsRepo] flush err:",a))):Q||(Q=setTimeout(()=>{Q=null,T().catch(()=>{})},b.flushIntervalMs)))}async function V(a={}){let b=await (0,L.Y4)(a).catch(()=>null);if(b)return b;let c=await (0,d.c)(),f=[],g=[];a.provider&&(f.push("provider = ?"),g.push(a.provider)),a.model&&(f.push("model = ?"),g.push(a.model)),a.connectionId&&(f.push("connectionId = ?"),g.push(a.connectionId)),a.status&&(f.push("status = ?"),g.push(a.status)),a.startDate&&(f.push("timestamp >= ?"),g.push(new Date(a.startDate).toISOString())),a.endDate&&(f.push("timestamp <= ?"),g.push(new Date(a.endDate).toISOString()));let h=f.length?`WHERE ${f.join(" AND ")}`:"",i=c.get(`SELECT COUNT(*) as c FROM requestDetails ${h}`,g),j=i?i.c:0,k=a.page||1,l=a.pageSize||50,m=Math.ceil(j/l);return{details:c.all(`SELECT data FROM requestDetails ${h} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...g,l,(k-1)*l]).map(a=>(0,e.q)(a.data,{})),pagination:{page:k,pageSize:l,totalItems:j,totalPages:m,hasNext:k<m,hasPrev:k>1}}}let W=async()=>{Q&&(clearTimeout(Q),Q=null),P.length>0&&await T()};async function X(){let a=await (0,d.c)(),{exportSettings:b}=await Promise.resolve().then(c.bind(c,42655)),f={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,adminDisabled:1===a.adminDisabled,ownerUser:a.ownerUser||"",createdByUser:a.createdByUser||"",createdAt:a.createdAt,allowedModels:(0,e.q)(a.allowedModels,[]),limits:(0,e.q)(a.limits,{})})),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'"))f.modelAliases[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'customModels'"))f.customModels.push((0,e.q)(b.value));for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'mitmAlias'"))f.mitmAlias[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'pricing'"))f.pricing[b.key]=(0,e.q)(b.value);return f}async function Y(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, ?)
209
+ data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.isActive,c.testStatus,c.data,c.createdAt,c.updatedAt])}async function r(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(p);return g.sort((a,b)=>new Date(b.updatedAt||0)-new Date(a.updatedAt||0)),g}async function s(a){return p((await (0,d.c)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))}async function t(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,h.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 q(b,e),e}async function u(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={...p(d),...b,updatedAt:new Date().toISOString()};q(c,f),e=f}),e}async function v(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM proxyPools WHERE id = ?",[a]);d&&(c=p(d),b.run("DELETE FROM proxyPools WHERE id = ?",[a]))}),c}var w=c(74452);function x(a){return a?{id:a.id,name:a.name,kind:a.kind,models:(0,e.q)(a.models,[]),createdAt:a.createdAt,updatedAt:a.updatedAt}:null}async function y(){return(await (0,d.c)()).all("SELECT * FROM combos ORDER BY createdAt ASC").map(x)}async function z(a){return x((await (0,d.c)()).get("SELECT * FROM combos WHERE id = ?",[a]))}async function A(a){return x((await (0,d.c)()).get("SELECT * FROM combos WHERE name = ?",[a]))}async function B(a){let b=await (0,d.c)(),c=new Date().toISOString(),f={id:(0,h.A)(),name:a.name,kind:a.kind||null,models:a.models||[],createdAt:c,updatedAt:c};return b.run("INSERT INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[f.id,f.name,f.kind,(0,e.s)(f.models),f.createdAt,f.updatedAt]),f}async function C(a,b){let c=await (0,d.c)(),f=null;return c.transaction(()=>{let d=c.get("SELECT * FROM combos WHERE id = ?",[a]);if(!d)return;let g={...x(d),...b,updatedAt:new Date().toISOString()};c.run("UPDATE combos SET name = ?, kind = ?, models = ?, updatedAt = ? WHERE id = ?",[g.name,g.kind,(0,e.s)(g.models||[]),g.updatedAt,a]),f=g}),f}async function D(a){let b=(await (0,d.c)()).run("DELETE FROM combos WHERE id = ?",[a]);return(b?.changes??0)>0}var E=c(9460),F=c(97914);let G="disabledModels";async function H(){let a=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[G]),b={};for(let c of a)b[c.key]=(0,e.q)(c.value,[]);return b}async function I(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 = ?",[G,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",[G,a,(0,e.s)(f)])})}async function J(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 = ?",[G,a]);let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[G,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 = ?",[G,a]):c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[G,a,(0,e.s)(h)])})}var K=c(99703),L=c(77638);let M=null,N=0;async function O(){if(M&&Date.now()-N<5e3)return M;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,42655)),b=await a(),d="false"!==process.env.OBSERVABILITY_ENABLED;M={enabled:"boolean"==typeof b.enableObservability?b.enableObservability:d,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{M={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return N=Date.now(),M}let P=[],Q=null,R=!1,S=!1,T=!1;function U(a,b){if("write"===a){if(S)return;S=!0}else{if(T)return;T=!0}console.error(`[requestDetailsRepo] MySQL observability ${a} unavailable; SQLite fallback is disabled.`,b?.message||b||"")}function V(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}async function W(){if(!R&&0!==P.length){R=!0;try{for(;P.length>0;){let a=P.splice(0,P.length),b=await O(),c=[];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:V(d.request,b.maxJsonSize),providerRequest:V(d.providerRequest,b.maxJsonSize),providerResponse:V(d.providerResponse,b.maxJsonSize),response:V(d.response,b.maxJsonSize)};c.push(a)}!(c.length>0)||await (0,L.RT)(c).catch(a=>(U("write",a),!1))||U("write","request_details write returned false")}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{R=!1}}}async function X(a){let b=await O();b.enabled&&(P.push(a),P.length>=b.batchSize?(Q&&(clearTimeout(Q),Q=null),W().catch(a=>console.error("[requestDetailsRepo] flush err:",a))):Q||(Q=setTimeout(()=>{Q=null,W().catch(()=>{})},b.flushIntervalMs)))}async function Y(a={}){let b=Math.max(1,Number(a.page)||1),c=Math.max(1,Math.min(100,Number(a.pageSize)||50)),d=await (0,L.Y4)(a).catch(a=>(U("read",a),null));return d||(U("read","request_details read returned null"),{details:[],pagination:{page:b,pageSize:c,totalItems:0,totalPages:0,hasNext:!1,hasPrev:b>1},dbInfo:{type:"mysql",unavailable:!0,sqliteFallback:!1}})}let Z=async()=>{Q&&(clearTimeout(Q),Q=null),P.length>0&&await W()};async function $(){let a=await (0,d.c)(),{exportSettings:b}=await Promise.resolve().then(c.bind(c,42655)),f={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,adminDisabled:1===a.adminDisabled,ownerUser:a.ownerUser||"",createdByUser:a.createdByUser||"",createdAt:a.createdAt,allowedModels:(0,e.q)(a.allowedModels,[]),limits:(0,e.q)(a.limits,{})})),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'"))f.modelAliases[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'customModels'"))f.customModels.push((0,e.q)(b.value));for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'mitmAlias'"))f.mitmAlias[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'pricing'"))f.pricing[b.key]=(0,e.q)(b.value);return f}async function _(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, ?)
210
210
  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)
211
211
  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)
212
212
  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)
213
213
  VALUES(?, ?, ?, ?, ?, ?)`,[a,+(!1!==d),f||"unknown",(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.apiKeys||[])b.run(`INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, adminDisabled, createdAt, allowedModels, limits, ownerUser, createdByUser)
214
214
  VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,[c.id,c.key,c.name||null,c.machineId||null,+(!1!==c.isActive),+(!0===c.adminDisabled),c.createdAt||new Date().toISOString(),(0,e.s)(Array.isArray(c.allowedModels)?c.allowedModels:[]),(0,e.s)(c.limits&&"object"==typeof c.limits&&!Array.isArray(c.limits)?c.limits:{}),String(c.ownerUser||"").trim().toLowerCase(),String(c.createdByUser||c.ownerUser||"").trim().toLowerCase()]);for(let c of a.combos||[])b.run(`INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt)
215
- 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 X()}process.off("beforeExit",W),process.off("SIGINT",W),process.off("SIGTERM",W),process.off("exit",W),process.on("beforeExit",W),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",W)},62674:(a,b,c)=>{"use strict";function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(36366)},74452:(a,b,c)=>{"use strict";c.d(b,{Iq:()=>r,Lh:()=>u,PX:()=>n,Pb:()=>t,XW:()=>s,ek:()=>v,getApiKeyByKey:()=>q,mI:()=>o,yg:()=>p});var d=c(94755),e=c(36366),f=c(644),g=c(490);let h=!1;function i(a){return Array.isArray(a)?[...new Set(a.map(a=>String(a||"").trim()).filter(Boolean))]:[]}function j(a){return String(a||"").trim().toLowerCase()}async function k(a){if(!h)try{let b=a.all("PRAGMA table_info(apiKeys)"),c=new Set(b.map(a=>a.name));c.has("allowedModels")||a.run("ALTER TABLE apiKeys ADD COLUMN allowedModels TEXT DEFAULT '[]'"),c.has("limits")||a.run("ALTER TABLE apiKeys ADD COLUMN limits TEXT DEFAULT '{}'"),c.has("ownerUser")||a.run("ALTER TABLE apiKeys ADD COLUMN ownerUser TEXT DEFAULT ''"),c.has("createdByUser")||a.run("ALTER TABLE apiKeys ADD COLUMN createdByUser TEXT DEFAULT ''"),c.has("adminDisabled")||a.run("ALTER TABLE apiKeys ADD COLUMN adminDisabled INTEGER DEFAULT 0");try{a.run("CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_active ON apiKeys(isActive)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_created_at ON apiKeys(createdAt)")}catch{}h=!0}catch(a){console.log("Could not ensure apiKeys columns:",a?.message||a)}}function l(a={}){let b=[],c=[],d=j(a.ownerUser),e=String(a.search||"").trim().toLowerCase();if(d&&(b.push("(lower(coalesce(ownerUser, '')) = ? OR lower(coalesce(createdByUser, '')) = ?)"),c.push(d,d)),!0===a.isActive?b.push("isActive = 1"):!1===a.isActive&&b.push("(isActive = 0 OR isActive IS NULL)"),e){let a=`%${e}%`;b.push(`(
215
+ 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 $()}process.off("beforeExit",Z),process.off("SIGINT",Z),process.off("SIGTERM",Z),process.off("exit",Z),process.on("beforeExit",Z),process.on("SIGINT",Z),process.on("SIGTERM",Z),process.on("exit",Z)},74452:(a,b,c)=>{"use strict";c.d(b,{Iq:()=>r,Lh:()=>u,PX:()=>n,Pb:()=>t,XW:()=>s,ek:()=>v,getApiKeyByKey:()=>q,mI:()=>o,yg:()=>p});var d=c(94755),e=c(36366),f=c(644),g=c(490);let h=!1;function i(a){return Array.isArray(a)?[...new Set(a.map(a=>String(a||"").trim()).filter(Boolean))]:[]}function j(a){return String(a||"").trim().toLowerCase()}async function k(a){if(!h)try{let b=a.all("PRAGMA table_info(apiKeys)"),c=new Set(b.map(a=>a.name));c.has("allowedModels")||a.run("ALTER TABLE apiKeys ADD COLUMN allowedModels TEXT DEFAULT '[]'"),c.has("limits")||a.run("ALTER TABLE apiKeys ADD COLUMN limits TEXT DEFAULT '{}'"),c.has("ownerUser")||a.run("ALTER TABLE apiKeys ADD COLUMN ownerUser TEXT DEFAULT ''"),c.has("createdByUser")||a.run("ALTER TABLE apiKeys ADD COLUMN createdByUser TEXT DEFAULT ''"),c.has("adminDisabled")||a.run("ALTER TABLE apiKeys ADD COLUMN adminDisabled INTEGER DEFAULT 0");try{a.run("CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_active ON apiKeys(isActive)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_created_at ON apiKeys(createdAt)")}catch{}h=!0}catch(a){console.log("Could not ensure apiKeys columns:",a?.message||a)}}function l(a={}){let b=[],c=[],d=j(a.ownerUser),e=String(a.search||"").trim().toLowerCase();if(d&&(b.push("(lower(coalesce(ownerUser, '')) = ? OR lower(coalesce(createdByUser, '')) = ?)"),c.push(d,d)),!0===a.isActive?b.push("isActive = 1"):!1===a.isActive&&b.push("(isActive = 0 OR isActive IS NULL)"),e){let a=`%${e}%`;b.push(`(
216
216
  lower(coalesce(name, '')) LIKE ?
217
217
  OR lower(coalesce(key, '')) LIKE ?
218
218
  OR lower(coalesce(id, '')) LIKE ?
@@ -220,7 +220,7 @@ exports.id=402,exports.ids=[402],exports.modules={490:(a,b,c)=>{"use strict";c.d
220
220
  OR lower(coalesce(ownerUser, '')) LIKE ?
221
221
  OR lower(coalesce(createdByUser, '')) LIKE ?
222
222
  OR lower(coalesce(allowedModels, '')) LIKE ?
223
- )`),c.push(a,a,a,a,a,a,a)}return{where:b.length?`WHERE ${b.join(" AND ")}`:"",params:c}}function m(a){return a?{id:a.id,key:a.key,name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,adminDisabled:1===a.adminDisabled||!0===a.adminDisabled,allowedModels:i((0,f.q)(a.allowedModels,[])),limits:(0,g.jQ)((0,f.q)(a.limits,{})),ownerUser:j(a.ownerUser),createdByUser:j(a.createdByUser),createdAt:a.createdAt}:null}async function n(a={}){let b,c,d=await (0,e.c)();await k(d);let{where:f,params:g}=l(a),h="desc"===String(a.order||"asc").toLowerCase()?"DESC":"ASC",i=!Number.isFinite(b=Number(a.limit))||b<=0?null:Math.min(500,Math.max(1,Math.floor(b))),j=!Number.isFinite(c=Number(a.offset))||c<=0?0:Math.max(0,Math.floor(c)),o=`SELECT * FROM apiKeys ${f} ORDER BY createdAt ${h}`,p=[...g];return i&&(o+=" LIMIT ? OFFSET ?",p.push(i,j)),(p.length?d.all(o,p):d.all(o)).map(m)}async function o(a={}){let b=await (0,e.c)();await k(b);let{where:c,params:d}=l(a),f=`SELECT COUNT(*) AS count FROM apiKeys ${c}`,g=d.length?b.get(f,d):b.get(f);return Number(g?.count||0)}async function p(a){let b=await (0,e.c)();return await k(b),m(b.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}async function q(a){if(!a)return null;let b=await (0,e.c)();return await k(b),m(b.get("SELECT * FROM apiKeys WHERE key = ?",[a]))}async function r(a,b,h={}){if(!b)throw Error("machineId is required");let l=await (0,e.c)();await k(l);let{generateApiKeyWithMachine:m}=await c.e(6844).then(c.bind(c,86844)),n=m(b),o=j(h.ownerUser||h.createdByUser),p=j(h.createdByUser||o),q={id:(0,d.A)(),name:a,key:n.key,machineId:b,isActive:!0,adminDisabled:!1,allowedModels:i(h.allowedModels),limits:(0,g.jQ)(h.limits||{}),ownerUser:o,createdByUser:p,createdAt:new Date().toISOString()};return l.run("INSERT INTO apiKeys(id, key, name, machineId, isActive, adminDisabled, allowedModels, limits, ownerUser, createdByUser, createdAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[q.id,q.key,q.name,q.machineId,1,0,(0,f.s)(q.allowedModels),(0,f.s)(q.limits),q.ownerUser,q.createdByUser,q.createdAt]),q}async function s(a,b={}){let c=await (0,e.c)();await k(c);let d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let h={...m(e),...b};Object.prototype.hasOwnProperty.call(b,"allowedModels")&&(h.allowedModels=i(b.allowedModels)),Object.prototype.hasOwnProperty.call(b,"limits")&&(h.limits=(0,g.jQ)(b.limits||{})),Object.prototype.hasOwnProperty.call(b,"ownerUser")&&(h.ownerUser=j(b.ownerUser)),Object.prototype.hasOwnProperty.call(b,"createdByUser")&&(h.createdByUser=j(b.createdByUser)),c.run("UPDATE apiKeys SET key = ?, name = ?, machineId = ?, isActive = ?, adminDisabled = ?, allowedModels = ?, limits = ?, ownerUser = ?, createdByUser = ? WHERE id = ?",[h.key,h.name,h.machineId,+!!h.isActive,+!!h.adminDisabled,(0,f.s)(h.allowedModels||[]),(0,f.s)(h.limits||{}),h.ownerUser||"",h.createdByUser||"",a]),d=h}),d}async function t(a,b){if(!a)return null;if(!b)throw Error("machineId is required");let d=await (0,e.c)();if(await k(d),!d.get("SELECT * FROM apiKeys WHERE id = ?",[a]))return null;let{generateApiKeyWithMachine:f}=await c.e(6844).then(c.bind(c,86844));for(let c=0;c<5;c+=1){let e=f(b);try{return d.run("UPDATE apiKeys SET key = ?, machineId = ? WHERE id = ?",[e.key,b,a]),m(d.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}catch(a){if(String(a?.message||a||"").toLowerCase().includes("unique")&&c<4)continue;throw a}}throw Error("Failed to generate a unique API key")}async function u(a){let b=await (0,e.c)();await k(b);let c=b.run("DELETE FROM apiKeys WHERE id = ?",[a]);return(c?.changes??0)>0}async function v(a){let b=await (0,e.c)();await k(b);let c=b.get("SELECT isActive FROM apiKeys WHERE key = ?",[a]);return!!c&&(1===c.isActive||!0===c.isActive)}},77638:(a,b,c)=>{"use strict";c.d(b,{Kc:()=>B,RT:()=>v,Y4:()=>w,d9:()=>A,zW:()=>u});var d=c(55511),e=c.n(d),f=c(45903),g=c(644);let h=Number(process.env.OBSERVABILITY_MYSQL_MAX_JSON_BYTES||262144),i={expiresAt:0,value:null},j=!1,k=new Set;function l(a,b){k.has(a)||(k.add(a),console.warn(b))}function m(a){return String(a??"").trim()}function n(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function o(a){let b=a?new Date(a):new Date;return(Number.isNaN(b.getTime())?new Date().toISOString():b.toISOString()).replace("T"," ").replace("Z","")}function p(a){if(null==a)return null;if("string"==typeof a)try{return JSON.parse(a),a}catch{return JSON.stringify(a)}return(0,g.s)(a)}function q(a){if(null==a)return{};let b=p(a)||"{}";return Buffer.byteLength(b,"utf8")<=h?a:{_truncated:!0,_originalSizeBytes:Buffer.byteLength(b,"utf8"),_preview:b.slice(0,1e3)}}async function r(){let a=Date.now();if(i.value&&i.expiresAt>a)return i.value;try{let b=(0,f.I6)(await (0,f.L7)());i={value:!0===b.enabled&&"mysql"===b.type&&"false"!==process.env.OBSERVABILITY_MYSQL_ENABLED?b:null,expiresAt:a+5e3}}catch(b){l("config",`[observability-mysql] Unable to read MySQL log config: ${b?.message||b}`),i={value:null,expiresAt:a+5e3}}return i.value}async function s(a){return(await c.e(8491).then(c.t.bind(c,38491,19))).createConnection({host:a.host,port:Number(a.port||3306),database:a.database,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,multipleStatements:!0,dateStrings:!0})}async function t(a){j||(await a.query(`
223
+ )`),c.push(a,a,a,a,a,a,a)}return{where:b.length?`WHERE ${b.join(" AND ")}`:"",params:c}}function m(a){return a?{id:a.id,key:a.key,name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,adminDisabled:1===a.adminDisabled||!0===a.adminDisabled,allowedModels:i((0,f.q)(a.allowedModels,[])),limits:(0,g.jQ)((0,f.q)(a.limits,{})),ownerUser:j(a.ownerUser),createdByUser:j(a.createdByUser),createdAt:a.createdAt}:null}async function n(a={}){let b,c,d=await (0,e.c)();await k(d);let{where:f,params:g}=l(a),h="desc"===String(a.order||"asc").toLowerCase()?"DESC":"ASC",i=!Number.isFinite(b=Number(a.limit))||b<=0?null:Math.min(500,Math.max(1,Math.floor(b))),j=!Number.isFinite(c=Number(a.offset))||c<=0?0:Math.max(0,Math.floor(c)),o=`SELECT * FROM apiKeys ${f} ORDER BY createdAt ${h}`,p=[...g];return i&&(o+=" LIMIT ? OFFSET ?",p.push(i,j)),(p.length?d.all(o,p):d.all(o)).map(m)}async function o(a={}){let b=await (0,e.c)();await k(b);let{where:c,params:d}=l(a),f=`SELECT COUNT(*) AS count FROM apiKeys ${c}`,g=d.length?b.get(f,d):b.get(f);return Number(g?.count||0)}async function p(a){let b=await (0,e.c)();return await k(b),m(b.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}async function q(a){if(!a)return null;let b=await (0,e.c)();return await k(b),m(b.get("SELECT * FROM apiKeys WHERE key = ?",[a]))}async function r(a,b,h={}){if(!b)throw Error("machineId is required");let l=await (0,e.c)();await k(l);let{generateApiKeyWithMachine:m}=await c.e(6844).then(c.bind(c,86844)),n=m(b),o=j(h.ownerUser||h.createdByUser),p=j(h.createdByUser||o),q={id:(0,d.A)(),name:a,key:n.key,machineId:b,isActive:!0,adminDisabled:!1,allowedModels:i(h.allowedModels),limits:(0,g.jQ)(h.limits||{}),ownerUser:o,createdByUser:p,createdAt:new Date().toISOString()};return l.run("INSERT INTO apiKeys(id, key, name, machineId, isActive, adminDisabled, allowedModels, limits, ownerUser, createdByUser, createdAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[q.id,q.key,q.name,q.machineId,1,0,(0,f.s)(q.allowedModels),(0,f.s)(q.limits),q.ownerUser,q.createdByUser,q.createdAt]),q}async function s(a,b={}){let c=await (0,e.c)();await k(c);let d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let h={...m(e),...b};Object.prototype.hasOwnProperty.call(b,"allowedModels")&&(h.allowedModels=i(b.allowedModels)),Object.prototype.hasOwnProperty.call(b,"limits")&&(h.limits=(0,g.jQ)(b.limits||{})),Object.prototype.hasOwnProperty.call(b,"ownerUser")&&(h.ownerUser=j(b.ownerUser)),Object.prototype.hasOwnProperty.call(b,"createdByUser")&&(h.createdByUser=j(b.createdByUser)),c.run("UPDATE apiKeys SET key = ?, name = ?, machineId = ?, isActive = ?, adminDisabled = ?, allowedModels = ?, limits = ?, ownerUser = ?, createdByUser = ? WHERE id = ?",[h.key,h.name,h.machineId,+!!h.isActive,+!!h.adminDisabled,(0,f.s)(h.allowedModels||[]),(0,f.s)(h.limits||{}),h.ownerUser||"",h.createdByUser||"",a]),d=h}),d}async function t(a,b){if(!a)return null;if(!b)throw Error("machineId is required");let d=await (0,e.c)();if(await k(d),!d.get("SELECT * FROM apiKeys WHERE id = ?",[a]))return null;let{generateApiKeyWithMachine:f}=await c.e(6844).then(c.bind(c,86844));for(let c=0;c<5;c+=1){let e=f(b);try{return d.run("UPDATE apiKeys SET key = ?, machineId = ? WHERE id = ?",[e.key,b,a]),m(d.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}catch(a){if(String(a?.message||a||"").toLowerCase().includes("unique")&&c<4)continue;throw a}}throw Error("Failed to generate a unique API key")}async function u(a){let b=await (0,e.c)();await k(b);let c=b.run("DELETE FROM apiKeys WHERE id = ?",[a]);return(c?.changes??0)>0}async function v(a){let b=await (0,e.c)();await k(b);let c=b.get("SELECT isActive FROM apiKeys WHERE key = ?",[a]);return!!c&&(1===c.isActive||!0===c.isActive)}},77638:(a,b,c)=>{"use strict";c.d(b,{Kc:()=>C,RT:()=>v,Y4:()=>w,d9:()=>B,zW:()=>u});var d=c(55511),e=c.n(d),f=c(45903),g=c(644);let h=Number(process.env.OBSERVABILITY_MYSQL_MAX_JSON_BYTES||262144),i={expiresAt:0,value:null},j=!1,k=new Set;function l(a,b){k.has(a)||(k.add(a),console.warn(b))}function m(a){return String(a??"").trim()}function n(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function o(a){let b=a?new Date(a):new Date;return(Number.isNaN(b.getTime())?new Date().toISOString():b.toISOString()).replace("T"," ").replace("Z","")}function p(a){if(null==a)return null;if("string"==typeof a)try{return JSON.parse(a),a}catch{return JSON.stringify(a)}return(0,g.s)(a)}function q(a){if(null==a)return{};let b=p(a)||"{}";return Buffer.byteLength(b,"utf8")<=h?a:{_truncated:!0,_originalSizeBytes:Buffer.byteLength(b,"utf8"),_preview:b.slice(0,1e3)}}async function r(){let a=Date.now();if(i.value&&i.expiresAt>a)return i.value;try{let b=(0,f.I6)(await (0,f.L7)());i={value:!0===b.enabled&&"mysql"===b.type&&"false"!==process.env.OBSERVABILITY_MYSQL_ENABLED?b:null,expiresAt:a+5e3}}catch(b){l("config",`[observability-mysql] Unable to read MySQL log config: ${b?.message||b}`),i={value:null,expiresAt:a+5e3}}return i.value}async function s(a){return(await c.e(8491).then(c.t.bind(c,38491,19))).createConnection({host:a.host,port:Number(a.port||3306),database:a.database,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,multipleStatements:!0,dateStrings:!0})}async function t(a){j||(await a.query(`
224
224
  CREATE TABLE IF NOT EXISTS usage_events (
225
225
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
226
226
  dedupe_key VARCHAR(96) NOT NULL,
@@ -349,7 +349,7 @@ exports.id=402,exports.ids=[402],exports.modules={490:(a,b,c)=>{"use strict";c.d
349
349
  prompt_tokens, completion_tokens, total_tokens, cached_tokens, reasoning_tokens, cost,
350
350
  status, tokens_json, meta_json
351
351
  ) VALUES (
352
- ?, NOW(3), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CAST(? AS JSON), CAST(? AS JSON)
352
+ ?, NOW(3), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
353
353
  ) ON DUPLICATE KEY UPDATE
354
354
  timestamp = VALUES(timestamp),
355
355
  provider = VALUES(provider),
@@ -382,7 +382,7 @@ exports.id=402,exports.ids=[402],exports.modules={490:(a,b,c)=>{"use strict";c.d
382
382
  tokens_json = VALUES(tokens_json),
383
383
  meta_json = VALUES(meta_json)`,[g,o(a.timestamp),m(a.provider)||null,m(a.model)||null,m(a.connectionId)||null,m(a.apiKeyFingerprint||a.apiKey)||null,m(a.apiKeyId)||null,m(a.apiKeyName)||null,m(a.apiKeyOwner)||null,m(a.endpoint)||null,m(a.requestId)||null,m(a.sessionId)||null,m(a.clientIp)||null,m(a.clientIpNormalized)||null,m(a.clientHost)||null,m(a.clientUserAgent)||null,m(a.sourceTool)||null,m(a.sourceToolLabel)||null,m(a.sourceHost)||null,n(a.latencyMs,0),n(a.ttftMs,0),null==a.statusCode?null:n(a.statusCode,null),m(a.errorCode)||null,m(a.errorType)||null,m(a.errorMessageShort)||null,+!!a.isStreaming,+!!a.isCombo,m(a.comboName)||null,n(a.promptTokens,0),n(a.completionTokens,0),n(a.totalTokens,0),n(a.cachedTokens,0),n(a.reasoningTokens,0),n(a.cost,0),m(a.status)||null,p(a.tokens||{}),p(a.meta||{})]),!0}catch(a){return l("usage-write",`[observability-mysql] Failed to write usage_events: ${a?.message||a}`),!1}finally{b&&await b.end().catch(()=>{})}}async function v(a=[]){let b,c=await r();if(!c||!Array.isArray(a)||0===a.length)return!1;try{for(let d of(b=await s(c),await t(b),a)){let a={...d,request:q(d.request),providerRequest:q(d.providerRequest),providerResponse:q(d.providerResponse),response:q(d.response)},c=p(a)||"{}";await b.query(`INSERT INTO request_details (
384
384
  id, created_at, timestamp, provider, model, connection_id, status, data_json, data_size_bytes
385
- ) VALUES (?, NOW(3), ?, ?, ?, ?, ?, CAST(? AS JSON), ?)
385
+ ) VALUES (?, NOW(3), ?, ?, ?, ?, ?, ?, ?)
386
386
  ON DUPLICATE KEY UPDATE
387
387
  timestamp = VALUES(timestamp),
388
388
  provider = VALUES(provider),
@@ -390,30 +390,8 @@ exports.id=402,exports.ids=[402],exports.modules={490:(a,b,c)=>{"use strict";c.d
390
390
  connection_id = VALUES(connection_id),
391
391
  status = VALUES(status),
392
392
  data_json = VALUES(data_json),
393
- data_size_bytes = VALUES(data_size_bytes)`,[m(a.id),o(a.timestamp),m(a.provider)||null,m(a.model)||null,m(a.connectionId)||null,m(a.status)||null,c,Buffer.byteLength(c,"utf8")])}return!0}catch(a){return l("request-details-write",`[observability-mysql] Failed to write request_details: ${a?.message||a}`),!1}finally{b&&await b.end().catch(()=>{})}}async function w(a={}){let b,c=await r();if(!c)return null;try{b=await s(c),await t(b);let d=[],e=[];a.provider&&(d.push("provider = ?"),e.push(a.provider)),a.model&&(d.push("model = ?"),e.push(a.model)),a.connectionId&&(d.push("connection_id = ?"),e.push(a.connectionId)),a.status&&(d.push("status = ?"),e.push(a.status)),a.startDate&&(d.push("timestamp >= ?"),e.push(o(a.startDate))),a.endDate&&(d.push("timestamp <= ?"),e.push(o(a.endDate)));let f=d.length?`WHERE ${d.join(" AND ")}`:"",[[h]]=await b.query(`SELECT COUNT(*) AS c FROM request_details ${f}`,e),i=Number(h?.c||0),j=Math.max(1,Number(a.page)||1),k=Math.max(1,Math.min(100,Number(a.pageSize)||50)),l=Math.ceil(i/k),[m]=await b.query(`SELECT data_json FROM request_details ${f} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...e,k,(j-1)*k]);return{details:m.map(a=>(0,g.q)("string"==typeof a.data_json?a.data_json:(0,g.s)(a.data_json),{})),pagination:{page:j,pageSize:k,totalItems:i,totalPages:l,hasNext:j<l,hasPrev:j>1},dbInfo:{type:"mysql",host:c.host,database:c.database}}}catch(a){return l("request-details-read",`[observability-mysql] Failed to read request_details: ${a?.message||a}`),null}finally{b&&await b.end().catch(()=>{})}}function x(a){return"string"!=typeof a?a:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(a)?o(a):a}function y(a){let b=String(a||"");return(b=(b=(b=b.replace(/CAST\(status AS TEXT\)/g,"CAST(status AS CHAR)")).replace(/CAST\(strftime\('%s',\s*timestamp\) AS INTEGER\)/g,"UNIX_TIMESTAMP(timestamp)")).replace(/GLOB\s+'2\[0-9\]\[0-9\]\*'/g,"REGEXP '^2[0-9][0-9].*'")).replace(/GLOB\s+'([^']*)\*'/g,(a,b)=>`LIKE '${String(b).replace(/'/g,"''")}%'`)}async function z(a){let b=await s(a);return await t(b),await b.query("SET SESSION sql_mode = CONCAT_WS(',', REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''), 'PIPES_AS_CONCAT')").catch(()=>{}),b}async function A(){let a=await r();if(!a)return null;let b=await z(a);try{await b.query("SELECT 1 FROM usageHistory LIMIT 1")}catch(a){return l("compat-views-read",`[observability-mysql] MySQL compatibility views are not readable: ${a?.message||a}`),await b.end().catch(()=>{}),null}let c=async(a,c=[])=>{let[d]=await b.query(y(a),(c||[]).map(x));return d};return{type:"mysql",all:async(a,b=[])=>await c(a,b),async get(a,b=[]){let d=await c(a,b);return d?.[0]||null},async run(a,c=[]){let[d]=await b.query(y(a),(c||[]).map(x));return d},async close(){await b.end().catch(()=>{})}}}async function B(a=100){let b=await A();if(!b)return null;try{return await b.all(`SELECT timestamp, provider, model, connectionId, apiKeyFingerprint, endpoint, status, statusCode, errorMessageShort, promptTokens, completionTokens, cost
394
- FROM usageHistory ORDER BY id DESC LIMIT ?`,[Number(a)||100])}finally{await b.close()}}},78335:()=>{},89718:(a,b,c)=>{"use strict";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,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,mY:()=>d.mY,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(56403)},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.DATA_DIR,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.DATA_DIR,"db.json"),usage:e().join(h.DATA_DIR,"usage.json"),disabled:e().join(h.DATA_DIR,"disabledModels.json"),details:e().join(h.DATA_DIR,"request-details.json")};function m(){for(let a of[h.DATA_DIR,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(7341).then(c.bind(c,57341)),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(7341).then(c.bind(c,57341));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(),{}}},99703:(a,b,c)=>{"use strict";c.d(b,{BY:()=>F,E5:()=>H,Py:()=>D,Zx:()=>I,_V:()=>m,j$:()=>G,rg:()=>C,sZ:()=>E,uw:()=>B});var d=c(94735),e=c(36366),f=c(644);c(62674);var g=c(77638);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0});let h=global._pendingRequests,i=global._lastErrorProvider,j=global._pendingTimers,k=global._recentRing,l=global._connectionMapCache,m=global._statsEmitter;function n(a){return String(a||"").trim()}function o(a){return n(a).toLowerCase()}function p(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function q(a){let b=n(a);return b?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key"}function r(a,b){let c=o(a),d=Number(b);return Number.isFinite(d)&&d>=400?c||"error":c||(Number.isFinite(d),"ok")}function s(a){return["pending","running","in_progress","queued","processing"].includes(o(a))}function t(a,b){let c,d=o(a);if(c=o(d),/^(?:error|fail|failed|timeout|network|aborted|abort|rate_limited|provider_error|gateway_error|parse_error|model_error)(?:\b|[\s_-]|$)/.test(c))return!1;let e=Number(b);if(Number.isFinite(e))return e>=200&&e<300;let f=r(a);return!!["ok","success","succeeded","complete","completed","done","200"].includes(f)||/^(?:2\d\d|ok|success|succeeded|complete|completed|done)(?:\b|[\s_-]|$)/.test(f)}function u(a){let b=a?new Date(a):new Date;return`${b.getFullYear()}-${String(b.getMonth()+1).padStart(2,"0")}-${String(b.getDate()).padStart(2,"0")}`}function v(a,b,c){b&&(a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta))}async function w(){if(Date.now()-l.ts<3e4)return l.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;l.map=d,l.ts=Date.now()}catch{}return l.map}async function x(){if(!k.initialized){k.initialized=!0;try{let a=await (0,g.Kc)(50).catch(()=>null);if(a){k.items=a.reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKeyFingerprint||a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,statusCode:a.statusCode,tokens:(0,f.q)(a.tokens,{})}));return}k.items=(await (0,e.c)()).all(`SELECT timestamp, provider, model, connectionId, apiKey, apiKeyFingerprint, endpoint, cost, status, statusCode, tokens
395
- 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.apiKeyFingerprint||a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,statusCode:a.statusCode,tokens:(0,f.q)(a.tokens,{})}))}catch{}}}async function y(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 g=0,h=d.prompt_tokens||d.input_tokens||0,i=d.cached_tokens||d.cache_read_input_tokens||0,j=Math.max(0,h-i);g+=j*(f.input/1e6),i>0&&(g+=i*((f.cached||f.input)/1e6));let k=d.completion_tokens||d.output_tokens||0;g+=k*(f.output/1e6);let l=d.reasoning_tokens||0;l>0&&(g+=l*((f.reasoning||f.output)/1e6));let m=d.cache_creation_input_tokens||0;return m>0&&(g+=m*((f.cache_creation||f.input)/1e6)),g}catch(a){return console.error("Error calculating cost:",a),0}}async function z(a){let b=n(a);if(!b)return{apiKeyId:"",apiKeyFingerprint:"local-no-key",apiKeyName:"Local / kh\xf4ng d\xf9ng API key",apiKeyOwner:""};let d=q(b);try{let{getApiKeyByKey:a}=await Promise.resolve().then(c.bind(c,74452)),e=await a(b);if(e)return{apiKeyId:e.id||"",apiKeyFingerprint:d,apiKeyName:e.name||d,apiKeyOwner:e.ownerUser||e.createdByUser||""}}catch{}return{apiKeyId:"",apiKeyFingerprint:d,apiKeyName:d,apiKeyOwner:""}}function A(a,b,c,d,e,f,g){a.run(`INSERT INTO ${b}(
396
- bucket, dimension, key, requests, success, errors, promptTokens, completionTokens,
397
- totalTokens, cachedTokens, reasoningTokens, cost, lastSeen
398
- ) VALUES(?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?)
399
- ON CONFLICT(bucket, dimension, key) DO UPDATE SET
400
- requests = requests + 1,
401
- success = success + excluded.success,
402
- errors = errors + excluded.errors,
403
- promptTokens = promptTokens + excluded.promptTokens,
404
- completionTokens = completionTokens + excluded.completionTokens,
405
- totalTokens = totalTokens + excluded.totalTokens,
406
- cachedTokens = cachedTokens + excluded.cachedTokens,
407
- reasoningTokens = reasoningTokens + excluded.reasoningTokens,
408
- cost = cost + excluded.cost,
409
- lastSeen = CASE WHEN excluded.lastSeen > COALESCE(lastSeen, '') THEN excluded.lastSeen ELSE lastSeen END`,[c,d,e,+!!g,+!g,f.promptTokens,f.completionTokens,f.totalTokens,f.cachedTokens,f.reasoningTokens,f.cost||0,f.timestamp])}function B(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,g=`${c}|${f}`;h.byModel[f]||(h.byModel[f]=0),h.byModel[f]=Math.max(0,h.byModel[f]+(d?1:-1)),0===h.byModel[f]&&delete h.byModel[f],c&&(h.byAccount[c]||(h.byAccount[c]={}),h.byAccount[c][f]||(h.byAccount[c][f]=0),h.byAccount[c][f]=Math.max(0,h.byAccount[c][f]+(d?1:-1)),0===h.byAccount[c][f]&&(delete h.byAccount[c][f],0===Object.keys(h.byAccount[c]).length&&delete h.byAccount[c])),d?(clearTimeout(j[g]),j[g]=setTimeout(()=>{delete j[g],h.byModel[f]>0&&(h.byModel[f]=0),c&&h.byAccount[c]?.[f]>0&&(h.byAccount[c][f]=0),m.emit("pending")},6e4)):(clearTimeout(j[g]),delete j[g]),!d&&e&&b&&(i.provider=b.toLowerCase(),i.ts=Date.now()),m.emit("pending")}async function C(){let a=[],b=await w();for(let[c,d]of Object.entries(h.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})}return await x(),{activeRequests:a,recentRequests:[...k.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"}}).slice(0,20),errorProvider:Date.now()-i.ts<1e4?i.provider:""}}async function D(a={}){try{if(s(a?.status))return null;let b=await z(a.apiKey),c=function(a={},b={}){let c,d=a.timestamp||new Date().toISOString(),e=a.tokens&&"object"==typeof a.tokens?a.tokens:{},f=p(a.promptTokens,e.prompt_tokens??e.input_tokens??0),g=p(a.completionTokens,e.completion_tokens??e.output_tokens??0),h=p(a.cachedTokens,e.cached_tokens??e.cache_read_input_tokens??e.prompt_tokens_details?.cached_tokens??0),i=p(a.reasoningTokens,e.reasoning_tokens??e.completion_tokens_details?.reasoning_tokens??0),j=p(a.totalTokens,f+g),k=null==a.statusCode?null:p(a.statusCode,null),l=r(a.status,k),m=n(a.clientIp||a.sourceIp),o=(c=n(a.clientIpNormalized||m))?c.split(",")[0].trim().replace(/^::ffff:/,""):"",s=a.meta&&"object"==typeof a.meta?a.meta:{};return{timestamp:d,provider:n(a.provider)||"unknown",model:n(a.model)||"unknown",connectionId:n(a.connectionId),apiKey:b.apiKeyFingerprint||q(a.apiKey),apiKeyId:b.apiKeyId||n(a.apiKeyId),apiKeyFingerprint:b.apiKeyFingerprint||n(a.apiKeyFingerprint)||q(a.apiKey),apiKeyName:b.apiKeyName||n(a.apiKeyName),apiKeyOwner:b.apiKeyOwner||n(a.apiKeyOwner),endpoint:n(a.endpoint),requestId:n(a.requestId||s.requestId),sessionId:n(a.sessionId||s.sessionId),clientIp:m,clientIpNormalized:o,clientHost:n(a.clientHost||s.clientHost),clientUserAgent:n(a.clientUserAgent||s.clientUserAgent),sourceTool:n(a.sourceTool||s.sourceTool),sourceToolLabel:n(a.sourceToolLabel||s.sourceToolLabel),sourceHost:n(a.sourceHost||s.sourceHost),latencyMs:p(a.latencyMs??s.latencyMs,0),ttftMs:p(a.ttftMs??s.ttftMs,0),statusCode:k,errorCode:n(a.errorCode||s.errorCode),errorType:n(a.errorType||s.errorType),errorMessageShort:function(a,b=500){let c=n(a).replace(/\s+/g," ");return c.length>b?`${c.slice(0,b-1)}…`:c}(a.errorMessageShort||a.errorMessage||s.errorMessageShort||s.errorMessage),isStreaming:+!!a.isStreaming,isCombo:+!!a.isCombo,comboName:n(a.comboName||s.comboName),promptTokens:f,completionTokens:g,totalTokens:j,cachedTokens:h,reasoningTokens:i,cost:p(a.cost,0),status:l,tokens:{prompt_tokens:f,completion_tokens:g,cached_tokens:h,reasoning_tokens:i},meta:{...s,apiKeyFingerprint:b.apiKeyFingerprint||n(a.apiKeyFingerprint)||q(a.apiKey),apiKeyId:b.apiKeyId||n(a.apiKeyId)}}}(a,b);if(c.cost||(c.cost=await y(c.provider,c.model,c.tokens)),!await (0,g.zW)(c).catch(()=>!1)){let a=await (0,e.c)();a.transaction(()=>{let b,d,e,g,h,i,j,k,l;a.run(`INSERT INTO usageHistory(
410
- timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, apiKeyOwner,
411
- endpoint, requestId, sessionId, clientIp, clientIpNormalized, clientHost, clientUserAgent,
412
- sourceTool, sourceToolLabel, sourceHost, latencyMs, ttftMs, statusCode, errorCode,
413
- errorType, errorMessageShort, isStreaming, isCombo, comboName, promptTokens, completionTokens,
414
- totalTokens, cachedTokens, reasoningTokens, cost, status, tokens, meta
415
- ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,[c.timestamp,c.provider||null,c.model||null,c.connectionId||null,c.apiKey||null,c.apiKeyId||null,c.apiKeyFingerprint||null,c.apiKeyName||null,c.apiKeyOwner||null,c.endpoint||null,c.requestId||null,c.sessionId||null,c.clientIp||null,c.clientIpNormalized||null,c.clientHost||null,c.clientUserAgent||null,c.sourceTool||null,c.sourceToolLabel||null,c.sourceHost||null,c.latencyMs||0,c.ttftMs||0,c.statusCode,c.errorCode||null,c.errorType||null,c.errorMessageShort||null,+!!c.isStreaming,+!!c.isCombo,c.comboName||null,c.promptTokens||0,c.completionTokens||0,c.totalTokens||0,c.cachedTokens||0,c.reasoningTokens||0,c.cost||0,c.status||"ok",(0,f.s)(c.tokens||{}),(0,f.s)(c.meta||{})]);let m=u(c.timestamp),n=a.get("SELECT data FROM usageDaily WHERE dateKey = ?",[m]),o=n?(0,f.q)(n.data,{}):{requests:0,promptTokens:0,completionTokens:0,cost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{}};b=c.promptTokens||c.tokens?.prompt_tokens||c.tokens?.input_tokens||0,d=c.completionTokens||c.tokens?.completion_tokens||c.tokens?.output_tokens||0,e=c.cost||0,g={promptTokens:b,completionTokens:d,cost:e},o.requests=(o.requests||0)+1,o.promptTokens=(o.promptTokens||0)+b,o.completionTokens=(o.completionTokens||0)+d,o.cost=(o.cost||0)+e,o.byProvider||={},o.byModel||={},o.byAccount||={},o.byApiKey||={},o.byEndpoint||={},c.provider&&v(o.byProvider,c.provider,g),h=c.provider?`${c.model}|${c.provider}`:c.model,v(o.byModel,h,{...g,meta:{rawModel:c.model,provider:c.provider}}),c.connectionId&&v(o.byAccount,c.connectionId,{...g,meta:{rawModel:c.model,provider:c.provider}}),i=c.apiKeyFingerprint||c.apiKey||"local-no-key",j=`${i}|${c.model}|${c.provider||"unknown"}`,v(o.byApiKey,j,{...g,meta:{rawModel:c.model,provider:c.provider,apiKey:i,apiKeyFingerprint:i,apiKeyId:c.apiKeyId||""}}),k=c.endpoint||"Unknown",l=`${k}|${c.model}|${c.provider||"unknown"}`,v(o.byEndpoint,l,{...g,meta:{endpoint:k,rawModel:c.model,provider:c.provider}}),a.run("INSERT INTO usageDaily(dateKey, data) VALUES(?, ?) ON CONFLICT(dateKey) DO UPDATE SET data = excluded.data",[m,(0,f.s)(o)]),function(a,b){var c;let d,e,f=t(b.status,b.statusCode),g=((d=(c=b.timestamp)?new Date(c):new Date).setMinutes(0,0,0),d.toISOString()),h=u(b.timestamp);for(let[c,d]of(e=[["all","all"],["provider",b.provider||"unknown"],["model",b.model||"unknown"],["providerModel",`${b.provider||"unknown"}|${b.model||"unknown"}`],["connection",b.connectionId||"unknown"],["apiKey",b.apiKeyId||b.apiKeyFingerprint||"local-no-key"],["clientIp",b.clientIpNormalized||"unknown"],["sourceTool",b.sourceTool||b.sourceToolLabel||"unknown"],["session",b.sessionId||"unknown"],["endpoint",b.endpoint||"unknown"],["status",b.status||"unknown"]],b.errorType&&e.push(["errorType",b.errorType]),b.isCombo&&b.comboName&&e.push(["combo",b.comboName]),e.filter(([,a])=>!0)))A(a,"usageHourlyRollup",g,c,d,b,f),A(a,"usageDailyRollup",h,c,d,b,f)}(a,c);let p=a.get("SELECT value FROM _meta WHERE key = 'totalRequestsLifetime'"),q=(p?parseInt(p.value,10):0)+1;a.run("INSERT INTO _meta(key, value) VALUES('totalRequestsLifetime', ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[String(q)])})}return k.items.push(c),k.items.length>50&&(k.items=k.items.slice(-50)),m.emit("update"),c}catch(a){return console.error("Failed to save request lifecycle:",a),null}}async function E(a){let b=r(a?.status,a?.statusCode);if(s(b))return null;let c=a?.tokens||{},d=c.prompt_tokens??c.input_tokens??a?.promptTokens??0,e=c.completion_tokens??c.output_tokens??a?.completionTokens??0;return(n(a?.status)||a?.statusCode!==void 0&&a?.statusCode!==null)&&!t(b,a?.statusCode)||0!==d||0!==e?D({...a,status:a?.status||"ok"}):null}async function F(a="all"){let b=await (0,g.d9)().catch(()=>null),c=b||await (0,e.c)(),d={totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{},last10Minutes:[],pending:h,activeRequests:(await C()).activeRequests,recentRequests:(await C()).recentRequests,errorProvider:Date.now()-i.ts<1e4?i.provider:""},f="today"===a?new Date().setHours(0,0,0,0):"24h"===a?Date.now()-864e5:null,j=f?[new Date(f).toISOString()]:[];for(let a of(await c.all(`SELECT provider, model, connectionId, apiKeyFingerprint, endpoint, COUNT(*) AS requests,
416
- SUM(promptTokens) AS promptTokens, SUM(completionTokens) AS completionTokens, SUM(cost) AS cost, MAX(timestamp) AS lastUsed
417
- FROM usageHistory ${f?"WHERE timestamp >= ?":""}
418
- GROUP BY provider, model, connectionId, apiKeyFingerprint, endpoint`,j)))d.totalRequests+=a.requests||0,d.totalPromptTokens+=a.promptTokens||0,d.totalCompletionTokens+=a.completionTokens||0,d.totalCost+=a.cost||0,v(d.byProvider,a.provider||"unknown",{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost}),v(d.byModel,`${a.model||"unknown"} (${a.provider||"unknown"})`,{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{rawModel:a.model,provider:a.provider,lastUsed:a.lastUsed}}),a.connectionId&&v(d.byAccount,a.connectionId,{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{connectionId:a.connectionId,lastUsed:a.lastUsed}}),v(d.byApiKey,a.apiKeyFingerprint||"local-no-key",{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{apiKey:a.apiKeyFingerprint||"local-no-key",lastUsed:a.lastUsed}}),v(d.byEndpoint,a.endpoint||"Unknown",{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{endpoint:a.endpoint||"Unknown",lastUsed:a.lastUsed}});let k=new Date,l=new Date(6e4*Math.floor(k.getTime()/6e4)),m=new Date(l.getTime()-54e4),n={};for(let a=0;a<10;a++){let b=l.getTime()-(9-a)*6e4;n[b]={requests:0,promptTokens:0,completionTokens:0,cost:0},d.last10Minutes.push(n[b])}for(let a of(await c.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ? AND timestamp <= ?",[m.toISOString(),k.toISOString()]))){let b=6e4*Math.floor(new Date(a.timestamp).getTime()/6e4);n[b]&&(n[b].requests++,n[b].promptTokens+=a.promptTokens||0,n[b].completionTokens+=a.completionTokens||0,n[b].cost+=a.cost||0)}return b?.close&&await b.close().catch(()=>{}),d}async function G(a="7d"){let b=await (0,g.d9)().catch(()=>null),c=b||await (0,e.c)(),d=Date.now(),f="today"===a||"24h"===a?24:"7d"===a?7:"30d"===a?30:60,h="today"===a||"24h"===a?36e5:864e5,i="today"===a?new Date(new Date().setHours(0,0,0,0)).getTime():d-f*h,j=await c.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(i).toISOString()]),k=Array.from({length:f},(a,b)=>{let c=i+b*h;return{label:36e5===h?new Date(c).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric"}),tokens:0,cost:0}});for(let a of j){let b=Math.min(f-1,Math.max(0,Math.floor((new Date(a.timestamp).getTime()-i)/h)));k[b].tokens+=(a.promptTokens||0)+(a.completionTokens||0),k[b].cost+=a.cost||0}return b?.close&&await b.close().catch(()=>{}),k}async function H(a={}){if(!a||!(a.tokens||a.status||a.error))return null;let b=a.error?"error":a.status||"ok";return s(b)||!a.error&&t(b,a.statusCode)?null:D({provider:a.provider||"unknown",model:a.model||"unknown",connectionId:a.connectionId,endpoint:a.endpoint,tokens:a.tokens||{},status:b,statusCode:a.statusCode,errorMessage:a.error||a.errorMessage,meta:a})}async function I(a=100){let b=await (0,g.Kc)(a).catch(()=>null);return b?b.map(a=>({...a,apiKey:a.apiKeyFingerprint})):(await (0,e.c)()).all(`SELECT timestamp, provider, model, connectionId, apiKeyFingerprint, endpoint, status, statusCode, errorMessageShort, promptTokens, completionTokens, cost
419
- FROM usageHistory ORDER BY id DESC LIMIT ?`,[Number(a)||100]).map(a=>({...a,apiKey:a.apiKeyFingerprint}))}}};
393
+ data_size_bytes = VALUES(data_size_bytes)`,[m(a.id),o(a.timestamp),m(a.provider)||null,m(a.model)||null,m(a.connectionId)||null,m(a.status)||null,c,Buffer.byteLength(c,"utf8")])}return!0}catch(a){return l("request-details-write",`[observability-mysql] Failed to write request_details: ${a?.message||a}`),!1}finally{b&&await b.end().catch(()=>{})}}async function w(a={}){let b,c=await r();if(!c)return null;try{b=await s(c),await t(b);let d=[],e=[];a.provider&&(d.push("provider = ?"),e.push(a.provider)),a.model&&(d.push("model = ?"),e.push(a.model)),a.connectionId&&(d.push("connection_id = ?"),e.push(a.connectionId)),a.status&&(d.push("status = ?"),e.push(a.status)),a.startDate&&(d.push("timestamp >= ?"),e.push(o(a.startDate))),a.endDate&&(d.push("timestamp <= ?"),e.push(o(a.endDate)));let f=d.length?`WHERE ${d.join(" AND ")}`:"",[[h]]=await b.query(`SELECT COUNT(*) AS c FROM request_details ${f}`,e),i=Number(h?.c||0),j=Math.max(1,Number(a.page)||1),k=Math.max(1,Math.min(100,Number(a.pageSize)||50)),l=Math.ceil(i/k),[m]=await b.query(`SELECT data_json FROM request_details ${f} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...e,k,(j-1)*k]);return{details:m.map(a=>(0,g.q)("string"==typeof a.data_json?a.data_json:(0,g.s)(a.data_json),{})),pagination:{page:j,pageSize:k,totalItems:i,totalPages:l,hasNext:j<l,hasPrev:j>1},dbInfo:{type:"mysql",host:c.host,database:c.database}}}catch(a){return l("request-details-read",`[observability-mysql] Failed to read request_details: ${a?.message||a}`),null}finally{b&&await b.end().catch(()=>{})}}let x=new Set(["requests","requestCount","totalRequests","successRequests","errorRequests","pendingRequests","promptTokens","completionTokens","totalTokens","cachedTokens","reasoningTokens","inputTokens","outputTokens","cost","totalCost","inputCost","outputCost","avgCost","latencyMs","ttftMs","avgLatencyMs","p50LatencyMs","p95LatencyMs","p99LatencyMs","statusCode","httpStatus","count","total","totalItems","totalPages","page","pageSize","errors","success","failures","errorRate","successRate","slowRequestRate","longInputRate","payloadSizeBytes","dataSizeBytes","sizeBytes"]);function y(a){return"string"!=typeof a?a:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(a)?o(a):a}function z(a){let b=String(a||"");return(b=(b=(b=(b=b.replace(/CAST\(status AS TEXT\)/g,"CAST(status AS CHAR)")).replace(/CAST\(strftime\('%s',\s*timestamp\) AS INTEGER\)/g,"UNIX_TIMESTAMP(timestamp)")).replace(/GLOB\s+'2\[0-9\]\[0-9\]\*'/g,"REGEXP '^2[0-9][0-9].*'")).replace(/GLOB\s+'([^']*)\*'/g,(a,b)=>`LIKE '${String(b).replace(/'/g,"''")}%'`)).replace(/\bAS\s+key\b/gi,"AS `key`")}async function A(a){let b=await s(a);return await t(b),await b.query("SET SESSION sql_mode = CONCAT_WS(',', REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''), 'PIPES_AS_CONCAT')").catch(()=>{}),b}async function B(){let a=await r();if(!a)return null;let b=await A(a);try{await b.query("SELECT 1 FROM usageHistory LIMIT 1")}catch(a){return l("compat-views-read",`[observability-mysql] MySQL compatibility views are not readable: ${a?.message||a}`),await b.end().catch(()=>{}),null}let c=async(a,c=[])=>{let[d]=await b.query(z(a),(c||[]).map(y));return Array.isArray(d)?d.map(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return a;let b={...a};for(let a of Object.keys(b))b[a]=function(a,b){let c;if(null==b)return b;if("number"==typeof b)return Number.isFinite(b)?b:0;if("bigint"==typeof b)return Number(b);if("string"==typeof b&&(c=String(a||""),x.has(c)||/(?:Requests|Tokens|Cost|LatencyMs|Rate|Count|Bytes|SizeBytes|Items|Pages|Ms)$/i.test(c)||/^(?:p50|p95|p99|avg|min|max|sum|total|count)$/i.test(c))){let a=b.trim();if(/^-?\d+(?:\.\d+)?$/.test(a)){let b=Number(a);return Number.isFinite(b)?b:0}}return b}(a,b[a]);return b}):d};return{type:"mysql",all:async(a,b=[])=>await c(a,b),async get(a,b=[]){let d=await c(a,b);return d?.[0]||null},async run(a,c=[]){let[d]=await b.query(z(a),(c||[]).map(y));return d},async close(){await b.end().catch(()=>{})}}}async function C(a=100){let b=await B();if(!b)return null;try{return await b.all(`SELECT timestamp, provider, model, connectionId, apiKeyFingerprint, endpoint, status, statusCode, errorMessageShort, promptTokens, completionTokens, cost
394
+ FROM usageHistory ORDER BY id DESC LIMIT ?`,[Number(a)||100])}finally{await b.close()}}},78335:()=>{},89718:(a,b,c)=>{"use strict";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,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,mY:()=>d.mY,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(56403)},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.DATA_DIR,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.DATA_DIR,"db.json"),usage:e().join(h.DATA_DIR,"usage.json"),disabled:e().join(h.DATA_DIR,"disabledModels.json"),details:e().join(h.DATA_DIR,"request-details.json")};function m(){for(let a of[h.DATA_DIR,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(7341).then(c.bind(c,57341)),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(7341).then(c.bind(c,57341));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(),{}}},99703:(a,b,c)=>{"use strict";c.d(b,{BY:()=>E,E5:()=>G,Py:()=>C,Zx:()=>H,_V:()=>m,j$:()=>F,rg:()=>B,sZ:()=>D,uw:()=>A});var d=c(94735),e=c(644),f=c(77638);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0});let g=global._pendingRequests,h=global._lastErrorProvider,i=global._pendingTimers,j=global._recentRing,k=global._connectionMapCache,l=!1,m=global._statsEmitter;function n(a,b){l||(l=!0,console.error(`[usageRepo] MySQL observability ${a} unavailable; SQLite fallback is disabled.`,b?.message||b||""))}function o(a){return String(a||"").trim()}function p(a){return o(a).toLowerCase()}function q(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function r(a){let b=o(a);return b?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key"}function s(a,b){let c=p(a),d=Number(b);return Number.isFinite(d)&&d>=400?c||"error":c||(Number.isFinite(d),"ok")}function t(a){return["pending","running","in_progress","queued","processing"].includes(p(a))}function u(a,b){let c,d=p(a);if(c=p(d),/^(?:error|fail|failed|timeout|network|aborted|abort|rate_limited|provider_error|gateway_error|parse_error|model_error)(?:\b|[\s_-]|$)/.test(c))return!1;let e=Number(b);if(Number.isFinite(e))return e>=200&&e<300;let f=s(a);return!!["ok","success","succeeded","complete","completed","done","200"].includes(f)||/^(?:2\d\d|ok|success|succeeded|complete|completed|done)(?:\b|[\s_-]|$)/.test(f)}function v(a,b,c){b&&(a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta))}async function w(){if(Date.now()-k.ts<3e4)return k.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;k.map=d,k.ts=Date.now()}catch{}return k.map}async function x(){if(!j.initialized){j.initialized=!0;try{let a=await (0,f.Kc)(50).catch(()=>null);if(a){j.items=a.reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKeyFingerprint||a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,statusCode:a.statusCode,tokens:(0,e.q)(a.tokens,{})}));return}n("recent-ring-read","usage_events read returned null")}catch{}}}async function y(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 g=0,h=d.prompt_tokens||d.input_tokens||0,i=d.cached_tokens||d.cache_read_input_tokens||0,j=Math.max(0,h-i);g+=j*(f.input/1e6),i>0&&(g+=i*((f.cached||f.input)/1e6));let k=d.completion_tokens||d.output_tokens||0;g+=k*(f.output/1e6);let l=d.reasoning_tokens||0;l>0&&(g+=l*((f.reasoning||f.output)/1e6));let m=d.cache_creation_input_tokens||0;return m>0&&(g+=m*((f.cache_creation||f.input)/1e6)),g}catch(a){return console.error("Error calculating cost:",a),0}}async function z(a){let b=o(a);if(!b)return{apiKeyId:"",apiKeyFingerprint:"local-no-key",apiKeyName:"Local / kh\xf4ng d\xf9ng API key",apiKeyOwner:""};let d=r(b);try{let{getApiKeyByKey:a}=await Promise.resolve().then(c.bind(c,74452)),e=await a(b);if(e)return{apiKeyId:e.id||"",apiKeyFingerprint:d,apiKeyName:e.name||d,apiKeyOwner:e.ownerUser||e.createdByUser||""}}catch{}return{apiKeyId:"",apiKeyFingerprint:d,apiKeyName:d,apiKeyOwner:""}}function A(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,j=`${c}|${f}`;g.byModel[f]||(g.byModel[f]=0),g.byModel[f]=Math.max(0,g.byModel[f]+(d?1:-1)),0===g.byModel[f]&&delete g.byModel[f],c&&(g.byAccount[c]||(g.byAccount[c]={}),g.byAccount[c][f]||(g.byAccount[c][f]=0),g.byAccount[c][f]=Math.max(0,g.byAccount[c][f]+(d?1:-1)),0===g.byAccount[c][f]&&(delete g.byAccount[c][f],0===Object.keys(g.byAccount[c]).length&&delete g.byAccount[c])),d?(clearTimeout(i[j]),i[j]=setTimeout(()=>{delete i[j],g.byModel[f]>0&&(g.byModel[f]=0),c&&g.byAccount[c]?.[f]>0&&(g.byAccount[c][f]=0),m.emit("pending")},6e4)):(clearTimeout(i[j]),delete i[j]),!d&&e&&b&&(h.provider=b.toLowerCase(),h.ts=Date.now()),m.emit("pending")}async function B(){let a=[],b=await w();for(let[c,d]of Object.entries(g.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})}return await x(),{activeRequests:a,recentRequests:[...j.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"}}).slice(0,20),errorProvider:Date.now()-h.ts<1e4?h.provider:""}}async function C(a={}){try{if(t(a?.status))return null;let b=await z(a.apiKey),c=function(a={},b={}){let c,d=a.timestamp||new Date().toISOString(),e=a.tokens&&"object"==typeof a.tokens?a.tokens:{},f=q(a.promptTokens,e.prompt_tokens??e.input_tokens??0),g=q(a.completionTokens,e.completion_tokens??e.output_tokens??0),h=q(a.cachedTokens,e.cached_tokens??e.cache_read_input_tokens??e.prompt_tokens_details?.cached_tokens??0),i=q(a.reasoningTokens,e.reasoning_tokens??e.completion_tokens_details?.reasoning_tokens??0),j=q(a.totalTokens,f+g),k=null==a.statusCode?null:q(a.statusCode,null),l=s(a.status,k),m=o(a.clientIp||a.sourceIp),n=(c=o(a.clientIpNormalized||m))?c.split(",")[0].trim().replace(/^::ffff:/,""):"",p=a.meta&&"object"==typeof a.meta?a.meta:{};return{timestamp:d,provider:o(a.provider)||"unknown",model:o(a.model)||"unknown",connectionId:o(a.connectionId),apiKey:b.apiKeyFingerprint||r(a.apiKey),apiKeyId:b.apiKeyId||o(a.apiKeyId),apiKeyFingerprint:b.apiKeyFingerprint||o(a.apiKeyFingerprint)||r(a.apiKey),apiKeyName:b.apiKeyName||o(a.apiKeyName),apiKeyOwner:b.apiKeyOwner||o(a.apiKeyOwner),endpoint:o(a.endpoint),requestId:o(a.requestId||p.requestId),sessionId:o(a.sessionId||p.sessionId),clientIp:m,clientIpNormalized:n,clientHost:o(a.clientHost||p.clientHost),clientUserAgent:o(a.clientUserAgent||p.clientUserAgent),sourceTool:o(a.sourceTool||p.sourceTool),sourceToolLabel:o(a.sourceToolLabel||p.sourceToolLabel),sourceHost:o(a.sourceHost||p.sourceHost),latencyMs:q(a.latencyMs??p.latencyMs,0),ttftMs:q(a.ttftMs??p.ttftMs,0),statusCode:k,errorCode:o(a.errorCode||p.errorCode),errorType:o(a.errorType||p.errorType),errorMessageShort:function(a,b=500){let c=o(a).replace(/\s+/g," ");return c.length>b?`${c.slice(0,b-1)}…`:c}(a.errorMessageShort||a.errorMessage||p.errorMessageShort||p.errorMessage),isStreaming:+!!a.isStreaming,isCombo:+!!a.isCombo,comboName:o(a.comboName||p.comboName),promptTokens:f,completionTokens:g,totalTokens:j,cachedTokens:h,reasoningTokens:i,cost:q(a.cost,0),status:l,tokens:{prompt_tokens:f,completion_tokens:g,cached_tokens:h,reasoning_tokens:i},meta:{...p,apiKeyFingerprint:b.apiKeyFingerprint||o(a.apiKeyFingerprint)||r(a.apiKey),apiKeyId:b.apiKeyId||o(a.apiKeyId)}}}(a,b);return c.cost||(c.cost=await y(c.provider,c.model,c.tokens)),await (0,f.zW)(c).catch(a=>(n("write",a),!1))||n("write","usage_events write returned false"),j.items.push(c),j.items.length>50&&(j.items=j.items.slice(-50)),m.emit("update"),c}catch(a){return console.error("Failed to save request lifecycle:",a),null}}async function D(a){let b=s(a?.status,a?.statusCode);if(t(b))return null;let c=a?.tokens||{},d=c.prompt_tokens??c.input_tokens??a?.promptTokens??0,e=c.completion_tokens??c.output_tokens??a?.completionTokens??0;return(o(a?.status)||a?.statusCode!==void 0&&a?.statusCode!==null)&&!u(b,a?.statusCode)||0!==d||0!==e?C({...a,status:a?.status||"ok"}):null}async function E(a="all"){let b={totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{},last10Minutes:[],pending:g,activeRequests:[],recentRequests:[],errorProvider:Date.now()-h.ts<1e4?h.provider:""},c=await B();b.activeRequests=c.activeRequests,b.recentRequests=c.recentRequests;let d=new Date,e=new Date(6e4*Math.floor(d.getTime()/6e4)),i=new Date(e.getTime()-54e4),j={};for(let a=0;a<10;a++){let c=e.getTime()-(9-a)*6e4;j[c]={requests:0,promptTokens:0,completionTokens:0,cost:0},b.last10Minutes.push(j[c])}let k=await (0,f.d9)().catch(a=>(n("stats-read",a),null));if(!k)return n("stats-read","usage_events adapter unavailable"),b;try{let c="today"===a?new Date().setHours(0,0,0,0):"24h"===a?Date.now()-864e5:null,e=c?[new Date(c).toISOString()]:[];for(let a of(await k.all(`SELECT provider, model, connectionId, apiKeyFingerprint, endpoint, COUNT(*) AS requests,
395
+ SUM(promptTokens) AS promptTokens, SUM(completionTokens) AS completionTokens, SUM(cost) AS cost, MAX(timestamp) AS lastUsed
396
+ FROM usageHistory ${c?"WHERE timestamp >= ?":""}
397
+ GROUP BY provider, model, connectionId, apiKeyFingerprint, endpoint`,e)))b.totalRequests+=a.requests||0,b.totalPromptTokens+=a.promptTokens||0,b.totalCompletionTokens+=a.completionTokens||0,b.totalCost+=a.cost||0,v(b.byProvider,a.provider||"unknown",{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost}),v(b.byModel,`${a.model||"unknown"} (${a.provider||"unknown"})`,{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{rawModel:a.model,provider:a.provider,lastUsed:a.lastUsed}}),a.connectionId&&v(b.byAccount,a.connectionId,{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{connectionId:a.connectionId,lastUsed:a.lastUsed}}),v(b.byApiKey,a.apiKeyFingerprint||"local-no-key",{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{apiKey:a.apiKeyFingerprint||"local-no-key",lastUsed:a.lastUsed}}),v(b.byEndpoint,a.endpoint||"Unknown",{requests:a.requests,promptTokens:a.promptTokens,completionTokens:a.completionTokens,cost:a.cost,meta:{endpoint:a.endpoint||"Unknown",lastUsed:a.lastUsed}});for(let a of(await k.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ? AND timestamp <= ?",[i.toISOString(),d.toISOString()]))){let b=6e4*Math.floor(new Date(a.timestamp).getTime()/6e4);j[b]&&(j[b].requests++,j[b].promptTokens+=a.promptTokens||0,j[b].completionTokens+=a.completionTokens||0,j[b].cost+=a.cost||0)}return b}catch(a){return n("stats-read",a),b}finally{k?.close&&await k.close().catch(()=>{})}}async function F(a="7d"){let{start:b,bucketMs:c,bucketCount:d,buckets:e}=function(a="7d"){let b=Date.now(),c="today"===a||"24h"===a?24:"7d"===a?7:"30d"===a?30:60,d="today"===a||"24h"===a?36e5:864e5,e="today"===a?new Date(new Date().setHours(0,0,0,0)).getTime():b-c*d,f=Array.from({length:c},(a,b)=>{let c=e+b*d;return{label:36e5===d?new Date(c).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric"}),tokens:0,cost:0}});return{start:e,bucketMs:d,bucketCount:c,buckets:f}}(a),g=await (0,f.d9)().catch(a=>(n("chart-read",a),null));if(!g)return n("chart-read","usage_events adapter unavailable"),e;try{for(let a of(await g.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(b).toISOString()]))){let f=Math.min(d-1,Math.max(0,Math.floor((new Date(a.timestamp).getTime()-b)/c)));e[f].tokens+=(a.promptTokens||0)+(a.completionTokens||0),e[f].cost+=a.cost||0}return e}catch(a){return n("chart-read",a),e}finally{g?.close&&await g.close().catch(()=>{})}}async function G(a={}){if(!a||!(a.tokens||a.status||a.error))return null;let b=a.error?"error":a.status||"ok";return t(b)||!a.error&&u(b,a.statusCode)?null:C({provider:a.provider||"unknown",model:a.model||"unknown",connectionId:a.connectionId,endpoint:a.endpoint,tokens:a.tokens||{},status:b,statusCode:a.statusCode,errorMessage:a.error||a.errorMessage,meta:a})}async function H(a=100){let b=await (0,f.Kc)(a).catch(a=>(n("recent-read",a),null));return b?b.map(a=>({...a,apiKey:a.apiKeyFingerprint})):(n("recent-read","usage_events read returned null"),[])}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=3903,exports.ids=[3903],exports.modules={34050:(a,b,c)=>{c.d(b,{CG:()=>e,oG:()=>d,zE:()=>f});let d=`
1
+ "use strict";exports.id=4684,exports.ids=[4684],exports.modules={34050:(a,b,c)=>{c.d(b,{CG:()=>e,oG:()=>d,zE:()=>f});let d=`
2
2
  PRAGMA journal_mode = WAL;
3
3
  PRAGMA synchronous = NORMAL;
4
4
  PRAGMA temp_store = MEMORY;
@@ -6,7 +6,7 @@ PRAGMA mmap_size = 30000000;
6
6
  PRAGMA cache_size = -64000;
7
7
  PRAGMA foreign_keys = ON;
8
8
  PRAGMA busy_timeout = 5000;
9
- `,e={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",adminDisabled:"INTEGER DEFAULT 0",allowedModels:"TEXT DEFAULT '[]'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)","CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)","CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)","CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyId:"TEXT",apiKeyFingerprint:"TEXT",apiKeyName:"TEXT",apiKeyOwner:"TEXT",endpoint:"TEXT",requestId:"TEXT",sessionId:"TEXT",clientIp:"TEXT",clientIpNormalized:"TEXT",clientHost:"TEXT",clientUserAgent:"TEXT",sourceTool:"TEXT",sourceToolLabel:"TEXT",sourceHost:"TEXT",latencyMs:"INTEGER DEFAULT 0",ttftMs:"INTEGER DEFAULT 0",statusCode:"INTEGER",errorCode:"TEXT",errorType:"TEXT",errorMessageShort:"TEXT",isStreaming:"INTEGER DEFAULT 0",isCombo:"INTEGER DEFAULT 0",comboName:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_status ON usageHistory(timestamp DESC, status)","CREATE INDEX IF NOT EXISTS idx_uh_ts_provider ON usageHistory(timestamp DESC, provider)","CREATE INDEX IF NOT EXISTS idx_uh_ts_model ON usageHistory(timestamp DESC, model)","CREATE INDEX IF NOT EXISTS idx_uh_ts_conn ON usageHistory(timestamp DESC, connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_endpoint ON usageHistory(timestamp DESC, endpoint)","CREATE INDEX IF NOT EXISTS idx_uh_ts_apikey ON usageHistory(timestamp DESC, apiKey)","CREATE INDEX IF NOT EXISTS idx_uh_provider_model_ts ON usageHistory(provider, model, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_ts ON usageHistory(status, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_endpoint_ts ON usageHistory(endpoint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_ts ON usageHistory(apiKey, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_conn_ts ON usageHistory(connectionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_request_id ON usageHistory(requestId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_id_ts ON usageHistory(apiKeyId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_fp_ts ON usageHistory(apiKeyFingerprint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_ip_ts ON usageHistory(clientIpNormalized, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_tool_ts ON usageHistory(sourceTool, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_session_ts ON usageHistory(sessionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_code_ts ON usageHistory(statusCode, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_error_type_ts ON usageHistory(errorType, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_latency_ts ON usageHistory(timestamp DESC, latencyMs)","CREATE INDEX IF NOT EXISTS idx_uh_combo_ts ON usageHistory(isCombo, comboName, timestamp DESC)"]},usageHourlyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_uhr_dim_bucket ON usageHourlyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_uhr_bucket ON usageHourlyRollup(bucket DESC)"]},usageDailyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_udr_dim_bucket ON usageDailyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_udr_bucket ON usageDailyRollup(bucket DESC)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function f(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},93903:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>B});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(87123),i=c(34050);let j=["CREATE INDEX IF NOT EXISTS idx_uh_ts_status ON usageHistory(timestamp DESC, status)","CREATE INDEX IF NOT EXISTS idx_uh_ts_provider ON usageHistory(timestamp DESC, provider)","CREATE INDEX IF NOT EXISTS idx_uh_ts_model ON usageHistory(timestamp DESC, model)","CREATE INDEX IF NOT EXISTS idx_uh_ts_conn ON usageHistory(timestamp DESC, connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_endpoint ON usageHistory(timestamp DESC, endpoint)","CREATE INDEX IF NOT EXISTS idx_uh_ts_apikey ON usageHistory(timestamp DESC, apiKey)","CREATE INDEX IF NOT EXISTS idx_uh_provider_model_ts ON usageHistory(provider, model, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_ts ON usageHistory(status, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_endpoint_ts ON usageHistory(endpoint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_ts ON usageHistory(apiKey, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_conn_ts ON usageHistory(connectionId, timestamp DESC)"],k={apiKeyId:"TEXT",apiKeyFingerprint:"TEXT",apiKeyName:"TEXT",apiKeyOwner:"TEXT",requestId:"TEXT",sessionId:"TEXT",clientIp:"TEXT",clientIpNormalized:"TEXT",clientHost:"TEXT",clientUserAgent:"TEXT",sourceTool:"TEXT",sourceToolLabel:"TEXT",sourceHost:"TEXT",latencyMs:"INTEGER DEFAULT 0",ttftMs:"INTEGER DEFAULT 0",statusCode:"INTEGER",errorCode:"TEXT",errorType:"TEXT",errorMessageShort:"TEXT",isStreaming:"INTEGER DEFAULT 0",isCombo:"INTEGER DEFAULT 0",comboName:"TEXT",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0"},l=["CREATE INDEX IF NOT EXISTS idx_uh_request_id ON usageHistory(requestId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_id_ts ON usageHistory(apiKeyId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_fp_ts ON usageHistory(apiKeyFingerprint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_ip_ts ON usageHistory(clientIpNormalized, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_tool_ts ON usageHistory(sourceTool, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_session_ts ON usageHistory(sessionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_code_ts ON usageHistory(statusCode, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_error_type_ts ON usageHistory(errorType, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_latency_ts ON usageHistory(timestamp DESC, latencyMs)","CREATE INDEX IF NOT EXISTS idx_uh_combo_ts ON usageHistory(isCombo, comboName, timestamp DESC)"],m=[`CREATE TABLE IF NOT EXISTS usageHourlyRollup(
9
+ `,e={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",adminDisabled:"INTEGER DEFAULT 0",allowedModels:"TEXT DEFAULT '[]'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)","CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)","CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)","CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyId:"TEXT",apiKeyFingerprint:"TEXT",apiKeyName:"TEXT",apiKeyOwner:"TEXT",endpoint:"TEXT",requestId:"TEXT",sessionId:"TEXT",clientIp:"TEXT",clientIpNormalized:"TEXT",clientHost:"TEXT",clientUserAgent:"TEXT",sourceTool:"TEXT",sourceToolLabel:"TEXT",sourceHost:"TEXT",latencyMs:"INTEGER DEFAULT 0",ttftMs:"INTEGER DEFAULT 0",statusCode:"INTEGER",errorCode:"TEXT",errorType:"TEXT",errorMessageShort:"TEXT",isStreaming:"INTEGER DEFAULT 0",isCombo:"INTEGER DEFAULT 0",comboName:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_status ON usageHistory(timestamp DESC, status)","CREATE INDEX IF NOT EXISTS idx_uh_ts_provider ON usageHistory(timestamp DESC, provider)","CREATE INDEX IF NOT EXISTS idx_uh_ts_model ON usageHistory(timestamp DESC, model)","CREATE INDEX IF NOT EXISTS idx_uh_ts_conn ON usageHistory(timestamp DESC, connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_endpoint ON usageHistory(timestamp DESC, endpoint)","CREATE INDEX IF NOT EXISTS idx_uh_ts_apikey ON usageHistory(timestamp DESC, apiKey)","CREATE INDEX IF NOT EXISTS idx_uh_provider_model_ts ON usageHistory(provider, model, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_ts ON usageHistory(status, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_endpoint_ts ON usageHistory(endpoint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_ts ON usageHistory(apiKey, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_conn_ts ON usageHistory(connectionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_request_id ON usageHistory(requestId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_id_ts ON usageHistory(apiKeyId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_fp_ts ON usageHistory(apiKeyFingerprint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_ip_ts ON usageHistory(clientIpNormalized, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_tool_ts ON usageHistory(sourceTool, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_session_ts ON usageHistory(sessionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_code_ts ON usageHistory(statusCode, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_error_type_ts ON usageHistory(errorType, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_latency_ts ON usageHistory(timestamp DESC, latencyMs)","CREATE INDEX IF NOT EXISTS idx_uh_combo_ts ON usageHistory(isCombo, comboName, timestamp DESC)"]},usageHourlyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_uhr_dim_bucket ON usageHourlyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_uhr_bucket ON usageHourlyRollup(bucket DESC)"]},usageDailyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_udr_dim_bucket ON usageDailyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_udr_bucket ON usageDailyRollup(bucket DESC)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function f(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},34684:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>C});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(87123),i=c(34050);let j=["CREATE INDEX IF NOT EXISTS idx_uh_ts_status ON usageHistory(timestamp DESC, status)","CREATE INDEX IF NOT EXISTS idx_uh_ts_provider ON usageHistory(timestamp DESC, provider)","CREATE INDEX IF NOT EXISTS idx_uh_ts_model ON usageHistory(timestamp DESC, model)","CREATE INDEX IF NOT EXISTS idx_uh_ts_conn ON usageHistory(timestamp DESC, connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_endpoint ON usageHistory(timestamp DESC, endpoint)","CREATE INDEX IF NOT EXISTS idx_uh_ts_apikey ON usageHistory(timestamp DESC, apiKey)","CREATE INDEX IF NOT EXISTS idx_uh_provider_model_ts ON usageHistory(provider, model, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_ts ON usageHistory(status, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_endpoint_ts ON usageHistory(endpoint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_ts ON usageHistory(apiKey, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_conn_ts ON usageHistory(connectionId, timestamp DESC)"],k={apiKeyId:"TEXT",apiKeyFingerprint:"TEXT",apiKeyName:"TEXT",apiKeyOwner:"TEXT",requestId:"TEXT",sessionId:"TEXT",clientIp:"TEXT",clientIpNormalized:"TEXT",clientHost:"TEXT",clientUserAgent:"TEXT",sourceTool:"TEXT",sourceToolLabel:"TEXT",sourceHost:"TEXT",latencyMs:"INTEGER DEFAULT 0",ttftMs:"INTEGER DEFAULT 0",statusCode:"INTEGER",errorCode:"TEXT",errorType:"TEXT",errorMessageShort:"TEXT",isStreaming:"INTEGER DEFAULT 0",isCombo:"INTEGER DEFAULT 0",comboName:"TEXT",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0"},l=["CREATE INDEX IF NOT EXISTS idx_uh_request_id ON usageHistory(requestId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_id_ts ON usageHistory(apiKeyId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_fp_ts ON usageHistory(apiKeyFingerprint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_ip_ts ON usageHistory(clientIpNormalized, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_tool_ts ON usageHistory(sourceTool, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_session_ts ON usageHistory(sessionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_code_ts ON usageHistory(statusCode, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_error_type_ts ON usageHistory(errorType, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_latency_ts ON usageHistory(timestamp DESC, latencyMs)","CREATE INDEX IF NOT EXISTS idx_uh_combo_ts ON usageHistory(isCombo, comboName, timestamp DESC)"],m=[`CREATE TABLE IF NOT EXISTS usageHourlyRollup(
10
10
  bucket TEXT NOT NULL,
11
11
  dimension TEXT NOT NULL,
12
12
  key TEXT NOT NULL,
@@ -50,4 +50,4 @@ PRAGMA busy_timeout = 5000;
50
50
  END
51
51
  WHERE apiKeyFingerprint IS NULL OR apiKeyFingerprint = ''`),a.exec(`UPDATE usageHistory
52
52
  SET apiKey = apiKeyFingerprint
53
- WHERE apiKey IS NOT NULL AND apiKey <> '' AND apiKeyFingerprint IS NOT NULL AND apiKeyFingerprint <> ''`)}},{version:4,name:"api-key-admin-disabled",up(a){(function(a,b){try{return new Set((a.all(`PRAGMA table_info(${b})`)||[]).map(a=>a.name))}catch{return new Set}})(a,"apiKeys").has("adminDisabled")||a.exec("ALTER TABLE apiKeys ADD COLUMN adminDisabled INTEGER DEFAULT 0"),a.exec("CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)")}}].sort((a,b)=>a.version-b.version);var p=c(8677);let q=null;function r(){if(q)return q;try{let a=g().join(process.cwd(),"package.json");q=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{q="0.0.0"}return q}function s(a){(0,h.Jh)();let b=r(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function t(a,b,c=null){if(!e().existsSync(a))return null;let d=c||g().basename(a),f=g().join(b,d);return e().copyFileSync(a,f),f}function u(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(5))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var v=c(50743);let w=g().join(h.HG,".migrated-from-json"),x=new WeakSet;class y extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function z(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new y(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function A(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function B(a){if(x.has(a))return;x.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch{return!0}}(a),c=function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt((0,p.dy)(a,"schemaVersion","0"),10)||0;if(b>=(o.length?o[o.length-1].version:0))return{applied:0,from:b,to:b};let c=o.filter(a=>a.version>b),d=b;for(let b of c)a.transaction(()=>{b.up(a),(0,p.np)(a,"schemaVersion",b.version)}),d=b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);return{applied:c.length,from:b,to:d}}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}let d=e().existsSync(w),f=A(h.Or.main),g=A(h.Or.usage),j=A(h.Or.disabled),k=A(h.Or.details);if(b&&(f||g||j||k)&&!d){let b=Date.now(),c=s("migrate-from-json");for(let a of Object.values(h.Or))t(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,v.s)(f.settings)]),z(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,v.s)(l),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),z(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,v.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),z(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,v.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),z(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),z(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,v.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,v.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,v.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,v.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,v.s)(c||{})])}if(g&&"object"==typeof g){for(let b of g.history||[]){let c=b.tokens||{};a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.apiKey||null,b.endpoint||null,c.prompt_tokens||c.input_tokens||0,c.completion_tokens||c.output_tokens||0,b.cost||0,b.status||"ok",(0,v.s)(c),(0,v.s)({})])}for(let[b,c]of Object.entries(g.dailySummary||{}))a.run("INSERT OR REPLACE INTO usageDaily(dateKey, data) VALUES(?, ?)",[b,(0,v.s)(c)]);"number"==typeof g.totalRequestsLifetime&&(0,p.np)(a,"totalRequestsLifetime",g.totalRequestsLifetime)}if(j&&"object"==typeof j.disabled)for(let[b,c]of Object.entries(j.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,v.s)(c||[])]);if(k&&Array.isArray(k.records))for(let b of k.records)a.run("INSERT OR REPLACE INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?)",[b.id,b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.status||null,(0,v.s)(b)]);(0,p.np)(a,"appVersion",r()),(0,p.np)(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof y)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(w,new Date().toISOString())}catch{}u(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}if(b)return void(0,p.np)(a,"appVersion",r());let l=(0,p.dy)(a,"appVersion",null),m=r();if(l&&l!==m){let b=s(`upgrade-${l}-to-${m}`);try{t(h.AL,b)}catch{}(0,p.np)(a,"appVersion",m),u(),console.log(`[DB][migrate] App ${l} → ${m} | schema ${c.from} → ${c.to} | backup: ${b}`)}else if(c.applied>0){let a=s(`schema-${c.from}-to-${c.to}`);try{t(h.AL,a)}catch{}u()}}}};
53
+ WHERE apiKey IS NOT NULL AND apiKey <> '' AND apiKeyFingerprint IS NOT NULL AND apiKeyFingerprint <> ''`)}},{version:4,name:"api-key-admin-disabled",up(a){(function(a,b){try{return new Set((a.all(`PRAGMA table_info(${b})`)||[]).map(a=>a.name))}catch{return new Set}})(a,"apiKeys").has("adminDisabled")||a.exec("ALTER TABLE apiKeys ADD COLUMN adminDisabled INTEGER DEFAULT 0"),a.exec("CREATE INDEX IF NOT EXISTS idx_ak_admin_disabled ON apiKeys(adminDisabled)")}}].sort((a,b)=>a.version-b.version);function p(a,b,c=null){let d=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return d?d.value:c}function q(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c(24081);let r=null;function s(){if(r)return r;try{let a=g().join(process.cwd(),"package.json");r=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{r="0.0.0"}return r}function t(a){(0,h.Jh)();let b=s(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function u(a,b,c=null){if(!e().existsSync(a))return null;let d=c||g().basename(a),f=g().join(b,d);return e().copyFileSync(a,f),f}function v(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(5))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var w=c(50743);let x=g().join(h.HG,".migrated-from-json"),y=new WeakSet;class z extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function A(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new z(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function B(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function C(a){if(y.has(a))return;y.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch{return!0}}(a),c=function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt(p(a,"schemaVersion","0"),10)||0;if(b>=(o.length?o[o.length-1].version:0))return{applied:0,from:b,to:b};let c=o.filter(a=>a.version>b),d=b;for(let b of c)a.transaction(()=>{b.up(a),q(a,"schemaVersion",b.version)}),d=b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);return{applied:c.length,from:b,to:d}}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}let d=e().existsSync(x),f=B(h.Or.main),g=B(h.Or.usage),j=B(h.Or.disabled),k=B(h.Or.details);if(b&&(f||g||j||k)&&!d){let b=Date.now(),c=t("migrate-from-json");for(let a of Object.values(h.Or))u(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,w.s)(f.settings)]),A(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,w.s)(l),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),A(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,w.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),A(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,w.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),A(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),A(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,w.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,w.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,w.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,w.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,w.s)(c||{})])}if(g&&"object"==typeof g){for(let b of g.history||[]){let c=b.tokens||{};a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.apiKey||null,b.endpoint||null,c.prompt_tokens||c.input_tokens||0,c.completion_tokens||c.output_tokens||0,b.cost||0,b.status||"ok",(0,w.s)(c),(0,w.s)({})])}for(let[b,c]of Object.entries(g.dailySummary||{}))a.run("INSERT OR REPLACE INTO usageDaily(dateKey, data) VALUES(?, ?)",[b,(0,w.s)(c)]);"number"==typeof g.totalRequestsLifetime&&q(a,"totalRequestsLifetime",g.totalRequestsLifetime)}if(j&&"object"==typeof j.disabled)for(let[b,c]of Object.entries(j.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,w.s)(c||[])]);if(k&&Array.isArray(k.records))for(let b of k.records)a.run("INSERT OR REPLACE INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?)",[b.id,b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.status||null,(0,w.s)(b)]);q(a,"appVersion",s()),q(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof z)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(x,new Date().toISOString())}catch{}v(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}if(b)return void q(a,"appVersion",s());let l=p(a,"appVersion",null),m=s();if(l&&l!==m){let b=t(`upgrade-${l}-to-${m}`);try{u(h.AL,b)}catch{}q(a,"appVersion",m),v(),console.log(`[DB][migrate] App ${l} → ${m} | schema ${c.from} → ${c.to} | backup: ${b}`)}else if(c.applied>0){let a=t(`schema-${c.from}-to-${c.to}`);try{u(h.AL,a)}catch{}v()}}}};