9router 0.5.8 → 0.5.12

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 (916) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +10 -8
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +24 -0
  5. package/app/.next-cli-build/required-server-files.json +8 -0
  6. package/app/.next-cli-build/routes-manifest.json +22 -0
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -0
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -0
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -0
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  74. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  85. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  88. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  89. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  90. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  92. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  95. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  110. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  124. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  130. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  132. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  136. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  142. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +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 +1 -1
  146. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  164. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  166. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  196. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -0
  210. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -0
  211. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route_client-reference-manifest.js +1 -0
  212. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  249. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  251. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  255. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +4 -2
  271. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  313. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route_client-reference-manifest.js +1 -1
  351. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/v1beta/models/route_client-reference-manifest.js +1 -1
  354. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  361. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  363. package/app/.next-cli-build/server/app/callback.html +1 -1
  364. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  365. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  366. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  368. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  369. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  373. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  374. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  377. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  378. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  379. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  380. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  381. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  383. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  384. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  387. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  388. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  390. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  391. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  393. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  394. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  397. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  398. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  400. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  401. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  403. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  404. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  406. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  407. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  408. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  410. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  411. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  413. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  418. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  419. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  421. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  422. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  424. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  425. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  429. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  430. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  431. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  432. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  434. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  435. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  439. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  441. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  442. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  444. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  450. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  452. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  453. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  455. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  460. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  462. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  463. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  465. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  470. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  471. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  472. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  473. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  474. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  475. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  476. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  480. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  481. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  482. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  483. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  486. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  488. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  489. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  491. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  492. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  498. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  500. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  501. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  502. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  503. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  505. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  506. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -0
  507. package/app/.next-cli-build/server/app/dashboard/token-saver.meta +17 -0
  508. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +24 -0
  509. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -0
  510. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +5 -0
  511. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +5 -0
  512. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +6 -0
  513. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +24 -0
  514. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +6 -0
  515. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +9 -0
  516. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +5 -0
  517. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  519. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  520. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  521. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  523. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  524. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  526. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  527. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  529. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  530. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  531. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  532. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  534. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  536. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  537. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  538. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  539. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  541. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  542. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  543. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  544. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  545. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  546. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  547. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  548. package/app/.next-cli-build/server/app/index.html +1 -1
  549. package/app/.next-cli-build/server/app/index.rsc +5 -5
  550. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  551. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  552. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  553. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  554. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  555. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  556. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  557. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  558. package/app/.next-cli-build/server/app/landing.html +1 -1
  559. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  560. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  561. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  562. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  563. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  564. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/login/page.js +2 -2
  567. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  568. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  569. package/app/.next-cli-build/server/app/login.html +1 -1
  570. package/app/.next-cli-build/server/app/login.rsc +6 -6
  571. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  572. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  573. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  574. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  575. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  576. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  577. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  578. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  579. package/app/.next-cli-build/server/app/page.js +2 -2
  580. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  581. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  582. package/app/.next-cli-build/server/app-paths-manifest.json +10 -8
  583. package/app/.next-cli-build/server/chunks/1051.js +1 -0
  584. package/app/.next-cli-build/server/chunks/1275.js +4 -4
  585. package/app/.next-cli-build/server/chunks/212.js +1 -0
  586. package/app/.next-cli-build/server/chunks/2231.js +1 -1
  587. package/app/.next-cli-build/server/chunks/318.js +12 -12
  588. package/app/.next-cli-build/server/chunks/3913.js +2 -2
  589. package/app/.next-cli-build/server/chunks/3938.js +1 -0
  590. package/app/.next-cli-build/server/chunks/412.js +2 -2
  591. package/app/.next-cli-build/server/chunks/4632.js +1 -1
  592. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  593. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  594. package/app/.next-cli-build/server/chunks/4884.js +10 -2
  595. package/app/.next-cli-build/server/chunks/5615.js +2 -2
  596. package/app/.next-cli-build/server/chunks/5699.js +1 -1
  597. package/app/.next-cli-build/server/chunks/5961.js +1 -1
  598. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  599. package/app/.next-cli-build/server/chunks/615.js +1 -1
  600. package/app/.next-cli-build/server/chunks/6182.js +3 -3
  601. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  602. package/app/.next-cli-build/server/chunks/6936.js +1 -1
  603. package/app/.next-cli-build/server/chunks/7220.js +1 -0
  604. package/app/.next-cli-build/server/chunks/7879.js +10 -0
  605. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  606. package/app/.next-cli-build/server/chunks/8271.js +1 -1
  607. package/app/.next-cli-build/server/chunks/8895.js +5 -5
  608. package/app/.next-cli-build/server/chunks/9630.js +1 -0
  609. package/app/.next-cli-build/server/chunks/9862.js +2 -2
  610. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  611. package/app/.next-cli-build/server/middleware.js +1 -1
  612. package/app/.next-cli-build/server/pages/404.html +1 -1
  613. package/app/.next-cli-build/server/pages/500.html +1 -1
  614. package/app/.next-cli-build/static/AH3ddxF9BbbDDIRNE6r7m/_buildManifest.js +1 -0
  615. package/app/.next-cli-build/static/chunks/1321-7b9636fd1eaad6c0.js +1 -0
  616. package/app/.next-cli-build/static/chunks/1393-ab87fa950d86db95.js +3 -0
  617. package/app/.next-cli-build/static/chunks/5497-9d0cd9ade93022ac.js +7 -0
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-35001475ad7e170c.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-b295d109cf51dacf.js +1 -0
  620. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-d74b3166213b2057.js → page-c4c59b98f52aba99.js} +3 -3
  621. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-d37d65694bbb71a0.js +1 -0
  622. package/app/.next-cli-build/static/chunks/app/_global-error/{page-610868de98620854.js → page-82541f42a58850f8.js} +1 -1
  623. package/app/.next-cli-build/static/chunks/app/api/auth/login/{route-610868de98620854.js → route-82541f42a58850f8.js} +1 -1
  624. package/app/.next-cli-build/static/chunks/app/api/auth/logout/{route-610868de98620854.js → route-82541f42a58850f8.js} +1 -1
  625. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/{route-610868de98620854.js → route-82541f42a58850f8.js} +1 -1
  626. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-82541f42a58850f8.js +1 -0
  627. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-82541f42a58850f8.js +1 -0
  628. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-82541f42a58850f8.js +1 -0
  629. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-82541f42a58850f8.js +1 -0
  630. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-82541f42a58850f8.js +1 -0
  631. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-82541f42a58850f8.js +1 -0
  632. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-82541f42a58850f8.js +1 -0
  633. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-82541f42a58850f8.js +1 -0
  634. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-82541f42a58850f8.js +1 -0
  635. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-82541f42a58850f8.js +1 -0
  636. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-82541f42a58850f8.js +1 -0
  637. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-82541f42a58850f8.js +1 -0
  638. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-82541f42a58850f8.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-82541f42a58850f8.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-82541f42a58850f8.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-82541f42a58850f8.js +1 -0
  642. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-82541f42a58850f8.js +1 -0
  643. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-82541f42a58850f8.js +1 -0
  644. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-82541f42a58850f8.js +1 -0
  645. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-82541f42a58850f8.js +1 -0
  646. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-82541f42a58850f8.js +1 -0
  647. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-82541f42a58850f8.js +1 -0
  648. package/app/.next-cli-build/static/chunks/app/api/combos/route-82541f42a58850f8.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-82541f42a58850f8.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-82541f42a58850f8.js +1 -0
  651. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-82541f42a58850f8.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/api/health/route-82541f42a58850f8.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/api/init/route-82541f42a58850f8.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-82541f42a58850f8.js +1 -0
  655. package/app/.next-cli-build/static/chunks/app/api/keys/route-82541f42a58850f8.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/api/locale/route-82541f42a58850f8.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-82541f42a58850f8.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-82541f42a58850f8.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-82541f42a58850f8.js +1 -0
  660. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-82541f42a58850f8.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-82541f42a58850f8.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-82541f42a58850f8.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-82541f42a58850f8.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-82541f42a58850f8.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-82541f42a58850f8.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-82541f42a58850f8.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-82541f42a58850f8.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/models/route-82541f42a58850f8.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/models/test/route-82541f42a58850f8.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-82541f42a58850f8.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-82541f42a58850f8.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-82541f42a58850f8.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-82541f42a58850f8.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-82541f42a58850f8.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-82541f42a58850f8.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-82541f42a58850f8.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-82541f42a58850f8.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-82541f42a58850f8.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-82541f42a58850f8.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-82541f42a58850f8.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-82541f42a58850f8.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-82541f42a58850f8.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/pricing/route-82541f42a58850f8.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-82541f42a58850f8.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-82541f42a58850f8.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-82541f42a58850f8.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-82541f42a58850f8.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-82541f42a58850f8.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-82541f42a58850f8.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-82541f42a58850f8.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-82541f42a58850f8.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-82541f42a58850f8.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/providers/route-82541f42a58850f8.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-82541f42a58850f8.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-82541f42a58850f8.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-82541f42a58850f8.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-82541f42a58850f8.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-82541f42a58850f8.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-82541f42a58850f8.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-82541f42a58850f8.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-82541f42a58850f8.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-82541f42a58850f8.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-82541f42a58850f8.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-82541f42a58850f8.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-82541f42a58850f8.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/settings/route-82541f42a58850f8.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-82541f42a58850f8.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/tags/route-82541f42a58850f8.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-82541f42a58850f8.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-82541f42a58850f8.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-82541f42a58850f8.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-82541f42a58850f8.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-82541f42a58850f8.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-82541f42a58850f8.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-82541f42a58850f8.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-82541f42a58850f8.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-82541f42a58850f8.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-82541f42a58850f8.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-82541f42a58850f8.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-82541f42a58850f8.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-82541f42a58850f8.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-82541f42a58850f8.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-82541f42a58850f8.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-82541f42a58850f8.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-82541f42a58850f8.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-82541f42a58850f8.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-82541f42a58850f8.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-82541f42a58850f8.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-82541f42a58850f8.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-82541f42a58850f8.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-82541f42a58850f8.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-82541f42a58850f8.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-82541f42a58850f8.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-82541f42a58850f8.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-82541f42a58850f8.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-82541f42a58850f8.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-82541f42a58850f8.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-82541f42a58850f8.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-82541f42a58850f8.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-82541f42a58850f8.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-82541f42a58850f8.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-82541f42a58850f8.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-82541f42a58850f8.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-82541f42a58850f8.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-82541f42a58850f8.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/v1/route-82541f42a58850f8.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-82541f42a58850f8.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-82541f42a58850f8.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-82541f42a58850f8.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-82541f42a58850f8.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/version/route-82541f42a58850f8.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-82541f42a58850f8.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/version/update/route-82541f42a58850f8.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/login/page-d85ec2350d1528fe.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-82541f42a58850f8.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/page-82541f42a58850f8.js +1 -0
  757. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-82541f42a58850f8.js +1 -0
  758. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-82541f42a58850f8.js +1 -0
  759. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-82541f42a58850f8.js +1 -0
  760. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-82541f42a58850f8.js +1 -0
  761. package/app/.next-cli-build/static/css/e283a5cbab362c6d.css +1 -0
  762. package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.2-to-0.5.3-0.5.3-20260618-172402 → upgrade-0.5.11-to-0.5.12-0.5.12-20260626-180200}/data.sqlite +0 -0
  763. package/app/cli/.build-home/.9router/db/backups/{upgrade-0.5.3-to-0.5.4-0.5.4-20260618-174450 → upgrade-0.5.8-to-0.5.11-0.5.11-20260626-121703}/data.sqlite +0 -0
  764. package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
  765. package/app/package.json +1 -1
  766. package/app/public/i18n/literals/zh-CN.json +1 -0
  767. package/app/server.js +1 -1
  768. package/package.json +1 -1
  769. package/app/.next-cli-build/server/chunks/3390.js +0 -1
  770. package/app/.next-cli-build/server/chunks/4161.js +0 -1
  771. package/app/.next-cli-build/server/chunks/5002.js +0 -1
  772. package/app/.next-cli-build/server/chunks/6445.js +0 -10
  773. package/app/.next-cli-build/server/chunks/7828.js +0 -1
  774. package/app/.next-cli-build/server/chunks/8255.js +0 -1
  775. package/app/.next-cli-build/static/7ERwXV9BRTXKMZpkA8svs/_buildManifest.js +0 -1
  776. package/app/.next-cli-build/static/chunks/1321-18fb8a2c6ea8f9e8.js +0 -1
  777. package/app/.next-cli-build/static/chunks/1393-256d18576757303d.js +0 -3
  778. package/app/.next-cli-build/static/chunks/5497-fc6652e25493d055.js +0 -7
  779. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-88cd993b836dec9c.js +0 -1
  780. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-69a63c8c1b1f84e7.js +0 -1
  781. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-610868de98620854.js +0 -1
  782. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-610868de98620854.js +0 -1
  783. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-610868de98620854.js +0 -1
  784. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-610868de98620854.js +0 -1
  785. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-610868de98620854.js +0 -1
  786. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-610868de98620854.js +0 -1
  787. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-610868de98620854.js +0 -1
  788. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-610868de98620854.js +0 -1
  789. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-610868de98620854.js +0 -1
  790. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-610868de98620854.js +0 -1
  791. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-610868de98620854.js +0 -1
  792. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-610868de98620854.js +0 -1
  793. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-610868de98620854.js +0 -1
  794. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-610868de98620854.js +0 -1
  795. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-610868de98620854.js +0 -1
  796. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-610868de98620854.js +0 -1
  797. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-610868de98620854.js +0 -1
  798. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-610868de98620854.js +0 -1
  799. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-610868de98620854.js +0 -1
  800. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-610868de98620854.js +0 -1
  801. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-610868de98620854.js +0 -1
  802. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-610868de98620854.js +0 -1
  803. package/app/.next-cli-build/static/chunks/app/api/combos/route-610868de98620854.js +0 -1
  804. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-610868de98620854.js +0 -1
  805. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-610868de98620854.js +0 -1
  806. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-610868de98620854.js +0 -1
  807. package/app/.next-cli-build/static/chunks/app/api/health/route-610868de98620854.js +0 -1
  808. package/app/.next-cli-build/static/chunks/app/api/init/route-610868de98620854.js +0 -1
  809. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-610868de98620854.js +0 -1
  810. package/app/.next-cli-build/static/chunks/app/api/keys/route-610868de98620854.js +0 -1
  811. package/app/.next-cli-build/static/chunks/app/api/locale/route-610868de98620854.js +0 -1
  812. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-610868de98620854.js +0 -1
  813. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-610868de98620854.js +0 -1
  814. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-610868de98620854.js +0 -1
  815. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-610868de98620854.js +0 -1
  816. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-610868de98620854.js +0 -1
  817. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-610868de98620854.js +0 -1
  818. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-610868de98620854.js +0 -1
  819. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-610868de98620854.js +0 -1
  820. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-610868de98620854.js +0 -1
  821. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-610868de98620854.js +0 -1
  822. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-610868de98620854.js +0 -1
  823. package/app/.next-cli-build/static/chunks/app/api/models/route-610868de98620854.js +0 -1
  824. package/app/.next-cli-build/static/chunks/app/api/models/test/route-610868de98620854.js +0 -1
  825. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-610868de98620854.js +0 -1
  826. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-610868de98620854.js +0 -1
  827. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-610868de98620854.js +0 -1
  828. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-610868de98620854.js +0 -1
  829. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-610868de98620854.js +0 -1
  830. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-610868de98620854.js +0 -1
  831. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-610868de98620854.js +0 -1
  832. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-610868de98620854.js +0 -1
  833. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-610868de98620854.js +0 -1
  834. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-610868de98620854.js +0 -1
  835. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-610868de98620854.js +0 -1
  836. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-610868de98620854.js +0 -1
  837. package/app/.next-cli-build/static/chunks/app/api/pricing/route-610868de98620854.js +0 -1
  838. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-610868de98620854.js +0 -1
  839. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-610868de98620854.js +0 -1
  840. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-610868de98620854.js +0 -1
  841. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-610868de98620854.js +0 -1
  842. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-610868de98620854.js +0 -1
  843. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-610868de98620854.js +0 -1
  844. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-610868de98620854.js +0 -1
  845. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-610868de98620854.js +0 -1
  846. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-610868de98620854.js +0 -1
  847. package/app/.next-cli-build/static/chunks/app/api/providers/route-610868de98620854.js +0 -1
  848. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-610868de98620854.js +0 -1
  849. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-610868de98620854.js +0 -1
  850. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-610868de98620854.js +0 -1
  851. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-610868de98620854.js +0 -1
  852. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-610868de98620854.js +0 -1
  853. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-610868de98620854.js +0 -1
  854. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-610868de98620854.js +0 -1
  855. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-610868de98620854.js +0 -1
  856. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-610868de98620854.js +0 -1
  857. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-610868de98620854.js +0 -1
  858. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-610868de98620854.js +0 -1
  859. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-610868de98620854.js +0 -1
  860. package/app/.next-cli-build/static/chunks/app/api/settings/route-610868de98620854.js +0 -1
  861. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-610868de98620854.js +0 -1
  862. package/app/.next-cli-build/static/chunks/app/api/tags/route-610868de98620854.js +0 -1
  863. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-610868de98620854.js +0 -1
  864. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-610868de98620854.js +0 -1
  865. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-610868de98620854.js +0 -1
  866. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-610868de98620854.js +0 -1
  867. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-610868de98620854.js +0 -1
  868. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-610868de98620854.js +0 -1
  869. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-610868de98620854.js +0 -1
  870. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-610868de98620854.js +0 -1
  871. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-610868de98620854.js +0 -1
  872. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-610868de98620854.js +0 -1
  873. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-610868de98620854.js +0 -1
  874. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-610868de98620854.js +0 -1
  875. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-610868de98620854.js +0 -1
  876. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-610868de98620854.js +0 -1
  877. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-610868de98620854.js +0 -1
  878. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-610868de98620854.js +0 -1
  879. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-610868de98620854.js +0 -1
  880. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-610868de98620854.js +0 -1
  881. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-610868de98620854.js +0 -1
  882. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-610868de98620854.js +0 -1
  883. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-610868de98620854.js +0 -1
  884. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-610868de98620854.js +0 -1
  885. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-610868de98620854.js +0 -1
  886. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-610868de98620854.js +0 -1
  887. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-610868de98620854.js +0 -1
  888. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-610868de98620854.js +0 -1
  889. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-610868de98620854.js +0 -1
  890. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-610868de98620854.js +0 -1
  891. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-610868de98620854.js +0 -1
  892. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-610868de98620854.js +0 -1
  893. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-610868de98620854.js +0 -1
  894. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-610868de98620854.js +0 -1
  895. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-610868de98620854.js +0 -1
  896. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-610868de98620854.js +0 -1
  897. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-610868de98620854.js +0 -1
  898. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-610868de98620854.js +0 -1
  899. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-610868de98620854.js +0 -1
  900. package/app/.next-cli-build/static/chunks/app/api/v1/route-610868de98620854.js +0 -1
  901. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-610868de98620854.js +0 -1
  902. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-610868de98620854.js +0 -1
  903. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-610868de98620854.js +0 -1
  904. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-610868de98620854.js +0 -1
  905. package/app/.next-cli-build/static/chunks/app/api/version/route-610868de98620854.js +0 -1
  906. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-610868de98620854.js +0 -1
  907. package/app/.next-cli-build/static/chunks/app/api/version/update/route-610868de98620854.js +0 -1
  908. package/app/.next-cli-build/static/chunks/app/login/page-b860537d58a9f64e.js +0 -1
  909. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-610868de98620854.js +0 -1
  910. package/app/.next-cli-build/static/chunks/app/page-610868de98620854.js +0 -1
  911. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-610868de98620854.js +0 -1
  912. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-610868de98620854.js +0 -1
  913. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-610868de98620854.js +0 -1
  914. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-610868de98620854.js +0 -1
  915. package/app/.next-cli-build/static/css/5d0b9d4c746ecd14.css +0 -1
  916. /package/app/.next-cli-build/static/{7ERwXV9BRTXKMZpkA8svs → AH3ddxF9BbbDDIRNE6r7m}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
- "use strict";exports.id=8895,exports.ids=[8895],exports.modules={324:(a,b,c)=>{c.d(b,{J:()=>e,Q:()=>f});let d={claude:["claude","anthropic"],"gemini-cli":["gemini-cli"],antigravity:["antigravity"],codex:["codex"]};function e(a={},b={}){let c=(a["user-agent"]||"").toLowerCase(),d=(a["x-app"]||"").toLowerCase(),f=(a["openai-intent"]||"").toLowerCase(),g=(a["x-initiator"]||a["X-Initiator"]||"").toLowerCase();return"antigravity"===b.userAgent?"antigravity":c.includes("githubcopilotchat")||"conversation-panel"===f||"user"===g?"github-copilot":c.includes("claude-cli")||c.includes("claude-code")||"cli"===d?"claude":c.includes("gemini-cli")?"gemini-cli":c.includes("codex-cli")?"codex":c.includes("deepseek-tui")?"deepseek-tui":null}function f(a,b){if(!a)return!1;let c=d[a];if(!c)return!1;let e=b.startsWith("anthropic-compatible")?"anthropic":b;return c.includes(e)}},5016:(a,b,c)=>{c.d(b,{N:()=>n});var d=c(14170),e=c(78833),f=c(39551),g=c(73483),h=c(43659),i=c(41004),j=c(81626),k=c(86171),l=c(47370),m=c(55399);async function n({providerResponse:a,provider:b,model:c,sourceFormat:o,targetFormat:p,body:q,stream:r,translatedBody:s,finalBody:t,requestStartTime:u,connectionId:v,apiKey:w,clientRawRequest:x,onRequestSuccess:y,reqLogger:z,toolNameMap:A,trackDone:B,appendLog:C}){let D;if(B(),(a.headers.get("content-type")||"").includes("text/event-stream")){let b=await a.text(),d=(0,j.F)(b,c);if(!d)return C({status:`FAILED ${i.gx.BAD_GATEWAY}`}),(0,h.A1)(i.gx.BAD_GATEWAY,"Invalid SSE response for non-streaming request");D=d}else try{D=await a.json()}catch(a){return C({status:`FAILED ${i.gx.BAD_GATEWAY}`}),console.error(`[ChatCore] Failed to parse JSON from ${b}:`,a.message),(0,h.A1)(i.gx.BAD_GATEWAY,`Invalid JSON response from ${b}`)}z.logProviderResponse(a.status,a.statusText,a.headers,D),y&&await y(),D=(0,m.kR)(D,A);let E=(0,k.MK)(D);C({tokens:E,status:"200 OK"}),(0,k.qr)({provider:b,model:c,tokens:E,connectionId:v,apiKey:w,endpoint:x?.endpoint});let F=(0,e.nZ)(p,o)?function(a,b,c){if(b===c||b===d.h.OPENAI)return a;if(b===d.h.GEMINI||b===d.h.ANTIGRAVITY||b===d.h.GEMINI_CLI||b===d.h.VERTEX){let b=a.response||a;if(!b?.candidates?.[0])return a;let c=b.candidates[0],d=c.content,e=b.usageMetadata||a.usageMetadata,f="",g="",h=[];if(d?.parts)for(let a of d.parts){!0===a.thought&&a.text?g+=a.text:void 0!==a.text&&(f+=a.text),a.functionCall&&h.push({id:`call_${a.functionCall.name}_${Date.now()}_${h.length}`,type:"function",function:{name:a.functionCall.name,arguments:JSON.stringify(a.functionCall.args||{})}});let b=a.inlineData||a.inline_data;if(b?.data){let a=b.mimeType||b.mime_type||"image/png";f+=`
1
+ "use strict";exports.id=8895,exports.ids=[8895],exports.modules={324:(a,b,c)=>{c.d(b,{J:()=>e,Q:()=>f});let d={claude:["claude","anthropic"],"gemini-cli":["gemini-cli"],antigravity:["antigravity"],codex:["codex"]};function e(a={},b={}){let c=(a["user-agent"]||"").toLowerCase(),d=(a["x-app"]||"").toLowerCase(),f=(a["openai-intent"]||"").toLowerCase(),g=(a["x-initiator"]||a["X-Initiator"]||"").toLowerCase();return"antigravity"===b.userAgent?"antigravity":c.includes("githubcopilotchat")||"conversation-panel"===f||"user"===g?"github-copilot":c.includes("claude-cli")||c.includes("claude-code")||"cli"===d?"claude":c.includes("gemini-cli")?"gemini-cli":c.includes("codex-cli")?"codex":c.includes("deepseek-tui")?"deepseek-tui":null}function f(a,b){if(!a)return!1;let c=d[a];if(!c)return!1;let e=b.startsWith("anthropic-compatible")?"anthropic":b;return c.includes(e)}},5016:(a,b,c)=>{c.d(b,{N:()=>n});var d=c(14170),e=c(78833),f=c(39551),g=c(73483),h=c(43659),i=c(41004),j=c(81626),k=c(86171),l=c(47370),m=c(55399);async function n({providerResponse:a,provider:b,model:c,sourceFormat:o,targetFormat:p,body:q,stream:r,translatedBody:s,finalBody:t,requestStartTime:u,connectionId:v,apiKey:w,clientRawRequest:x,onRequestSuccess:y,reqLogger:z,toolNameMap:A,trackDone:B,appendLog:C}){let D;if(B(),(a.headers.get("content-type")||"").includes("text/event-stream")){let b=await a.text(),d=(0,j.F)(b,c);if(!d)return C({status:`FAILED ${i.gx.BAD_GATEWAY}`}),(0,h.A1)(i.gx.BAD_GATEWAY,"Invalid SSE response for non-streaming request");D=d}else try{D=await a.json()}catch(a){return C({status:`FAILED ${i.gx.BAD_GATEWAY}`}),console.error(`[ChatCore] Failed to parse JSON from ${b}:`,a.message),(0,h.A1)(i.gx.BAD_GATEWAY,`Invalid JSON response from ${b}`)}z.logProviderResponse(a.status,a.statusText,a.headers,D),y&&Promise.resolve().then(y).catch(a=>{console.error("[ChatCore] onRequestSuccess failed:",a?.message||a)}),D=(0,m.kR)(D,A);let E=(0,k.MK)(D);C({tokens:E,status:"200 OK"}),(0,k.qr)({provider:b,model:c,tokens:E,connectionId:v,apiKey:w,endpoint:x?.endpoint});let F=(0,e.nZ)(p,o)?function(a,b,c){if(b===c||b===d.h.OPENAI)return a;if(b===d.h.GEMINI||b===d.h.ANTIGRAVITY||b===d.h.GEMINI_CLI||b===d.h.VERTEX){let b=a.response||a;if(!b?.candidates?.[0])return a;let c=b.candidates[0],d=c.content,e=b.usageMetadata||a.usageMetadata,f="",g="",h=[];if(d?.parts)for(let a of d.parts){!0===a.thought&&a.text?g+=a.text:void 0!==a.text&&(f+=a.text),a.functionCall&&h.push({id:`call_${a.functionCall.name}_${Date.now()}_${h.length}`,type:"function",function:{name:a.functionCall.name,arguments:JSON.stringify(a.functionCall.args||{})}});let b=a.inlineData||a.inline_data;if(b?.data){let a=b.mimeType||b.mime_type||"image/png";f+=`
2
2
  ![image](data:${a};base64,${b.data})
3
- `}}let i={role:"assistant"};f&&(i.content=f),g&&(i.reasoning_content=g),h.length>0&&(i.tool_calls=h),i.content||i.tool_calls||(i.content="");let j=(c.finishReason||"stop").toLowerCase();"stop"===j&&h.length>0&&(j="tool_calls");let k={id:`chatcmpl-${b.responseId||Date.now()}`,object:"chat.completion",created:Math.floor(new Date(b.createTime||Date.now()).getTime()/1e3),model:b.modelVersion||"gemini",choices:[{index:0,message:i,finish_reason:j}]};return e&&(k.usage={prompt_tokens:(e.promptTokenCount||0)+(e.thoughtsTokenCount||0),completion_tokens:e.candidatesTokenCount||0,total_tokens:e.totalTokenCount||0},e.thoughtsTokenCount>0&&(k.usage.completion_tokens_details={reasoning_tokens:e.thoughtsTokenCount})),k}if(b===d.h.CLAUDE){if(a.choices||a.content&&!Array.isArray(a.content))return a;let b="",c="",d=[];for(let e of a.content||[])"text"===e.type?b+=(e.text??"").replace(/^\s*```\s*json\s*\n?/i,"").replace(/\n?\s*```\s*$/i,""):"thinking"===e.type?c+=e.thinking||"":"tool_use"===e.type&&d.push({id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.input||{})}});let e={role:"assistant"};b&&(e.content=b),c&&(e.reasoning_content=c),d.length>0&&(e.tool_calls=d),e.content||e.tool_calls||(e.content="");let f=a.stop_reason||"stop";"end_turn"===f&&(f="stop"),"tool_use"===f&&(f="tool_calls");let g={id:`chatcmpl-${a.id||Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a.model||"claude",choices:[{index:0,message:e,finish_reason:f}]};return a.usage&&(g.usage={prompt_tokens:a.usage.input_tokens||0,completion_tokens:a.usage.output_tokens||0,total_tokens:(a.usage.input_tokens||0)+(a.usage.output_tokens||0)}),g}return b===d.h.OLLAMA?(0,f._)(a):a}(D,p,o):D;if(F?.choices?.[0]){let a=F.choices[0],b=a.message;Array.isArray(b?.tool_calls)&&b.tool_calls.length>0&&"tool_calls"!==a.finish_reason&&(a.finish_reason="tool_calls")}if(F.object||(F.object="chat.completion"),F.created||(F.created=Math.floor(Date.now()/1e3)),delete F.prompt_filter_results,F?.choices)for(let a of F.choices)delete a.content_filter_results;if(F?.usage&&(F.usage=(0,g.WL)((0,g.O9)(F.usage),o)),F?.choices)for(let a of F.choices)a?.message?.reasoning_content&&a.message.content&&delete a.message.reasoning_content;z.logConvertedResponse(F);let G=Date.now()-u;return(0,l.ox)((0,k.$R)({provider:b,model:c,connectionId:v,latency:{ttft:G,total:G},tokens:E||{prompt_tokens:0,completion_tokens:0},request:(0,k.Fo)(q,r),providerRequest:t||s||null,providerResponse:D||null,response:{content:F?.choices?.[0]?.message?.content||F?.content||null,thinking:F?.choices?.[0]?.message?.reasoning_content||F?.reasoning_content||null,finish_reason:F?.choices?.[0]?.finish_reason||"unknown"},status:"success"},{endpoint:x?.endpoint||null})).catch(a=>{console.error("[RequestDetail] Failed to save:",a.message)}),{success:!0,response:new Response(JSON.stringify(F),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}},5263:(a,b,c)=>{c.d(b,{X:()=>m});var d=c(14170);let e={vision:"[image omitted: model has no vision support]",audioInput:"[audio omitted: model has no audio support]",pdf:"[file omitted: model has no document support]"},f={vision:"[Previous image omitted from context.]",audioInput:"[Previous audio omitted from context.]",pdf:"[Previous file omitted from context.]"},g=(a,b)=>(b?e:f)[a];function h(a){let b=a?.type;return"image_url"===b||"image"===b?"vision":"input_audio"===b||"audio_url"===b?"audioInput":"file"===b?"pdf":null}function i(a){let b=a?.type;return"image"===b?"vision":"document"===b?"pdf":null}function j(a,b,c,d,e){let f=[];for(let e of a){let a=b(e);if(a&&!1===c[a]){d.add(a);continue}f.push(e)}for(let a of d)f.push({type:"text",text:g(a,e)});return f}function k(a,b){if(!Array.isArray(a.messages))return;let c=a.messages.length-1;a.messages.forEach((a,d)=>{if(!Array.isArray(a.content))return;let e=new Set;a.content=j(a.content,h,b,e,d===c)})}function l(a,b){if(!Array.isArray(a))return;let c=a.length-1;a.forEach((a,d)=>{if(!Array.isArray(a.parts))return;let e=new Set;for(let f of(a.parts=a.parts.filter(a=>{var c;let d="string"!=typeof(c=a?.inlineData?.mimeType||a?.fileData?.mimeType)?null:c.startsWith("image/")?"vision":c.startsWith("audio/")?"audioInput":"application/pdf"===c?"pdf":null;return!d||!1!==b[d]||(e.add(d),!1)}),e))a.parts.push({text:g(f,d===c)})})}function m(a,b,c){if(!a||!c||!1!==c.vision&&!1!==c.audioInput&&!1!==c.pdf)return!1;switch(b){case d.h.OPENAI:case d.h.OLLAMA:case d.h.KIRO:case d.h.CURSOR:case d.h.COMMANDCODE:k(a,c);break;case d.h.CLAUDE:!function(a,b){if(!Array.isArray(a.messages))return;let c=a.messages.length-1;a.messages.forEach((a,d)=>{if(!Array.isArray(a.content))return;let e=new Set;a.content=j(a.content,i,b,e,d===c)})}(a,c);break;case d.h.OPENAI_RESPONSES:case d.h.OPENAI_RESPONSE:case d.h.CODEX:!function(a,b){if(!Array.isArray(a.input))return;let c=a.input.length-1;a.input.forEach((a,d)=>{if(!Array.isArray(a.content))return;let e=new Set;for(let f of(a.content=a.content.filter(a=>{let c=a?.type==="input_image"?"vision":a?.type==="input_file"?"pdf":null;return!c||!1!==b[c]||(e.add(c),!1)}),e))a.content.push({type:"input_text",text:g(f,d===c)})})}(a,c);break;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:l(a.contents,c);break;case d.h.ANTIGRAVITY:l(a?.request?.contents,c);break;default:k(a,c)}return!0}},12557:(a,b,c)=>{c.d(b,{Bl:()=>j,Qo:()=>f,S5:()=>l,hk:()=>e,kJ:()=>k});var d=c(3662);function e(a,b,c=0){let f=b?("string"==typeof b?b:JSON.stringify(b)).toLowerCase():"";for(let b of d.t2)if(b.text&&f&&f.includes(b.text)||b.status&&b.status===a){if(b.backoff){let a=Math.min(c+1,d.EQ.maxLevel);return{shouldFallback:!0,cooldownMs:function(a=0){let b=Math.max(0,a-1);return Math.min(d.EQ.base*Math.pow(2,b),d.EQ.max)}(a),newBackoffLevel:a}}return{shouldFallback:!0,cooldownMs:b.cooldownMs}}return{shouldFallback:!0,cooldownMs:d.wf}}function f(a){if(!a)return"";let b=new Date(a).getTime()-Date.now();if(b<=0)return"reset after 0s";let c=Math.ceil(b/1e3),d=Math.floor(c/3600),e=Math.floor(c%3600/60),f=c%60,g=[];return d>0&&g.push(`${d}h`),e>0&&g.push(`${e}m`),(f>0||0===g.length)&&g.push(`${f}s`),`reset after ${g.join(" ")}`}let g="modelLock_",h=`${g}__all`;function i(a){return a?`${g}${a}`:h}function j(a,b){let c=a[i(b)]||a[h];return!!c&&new Date(c).getTime()>Date.now()}function k(a){if(!a)return null;let b=null,c=Date.now();for(let[d,e]of Object.entries(a)){if(!d.startsWith(g)||!e)continue;let a=new Date(e).getTime();a<=c||(!b||a<b)&&(b=a)}return b?new Date(b).toISOString():null}function l(a,b){return{[i(a)]:new Date(Date.now()+b).toISOString()}}},14724:(a,b,c)=>{c.d(b,{F:()=>g});let d=[{triggers:["mcp__exa__web_search_exa","mcp__exa__web_fetch_exa"],strip:["WebSearch","WebFetch","mcp__workspace__web_fetch"]},{triggers:["mcp__tavily__tavily_search","mcp__tavily__tavily_extract"],strip:["WebSearch","WebFetch","mcp__workspace__web_fetch"]},{triggers:[/^mcp__browsermcp__/],strip:[/^mcp__Claude_in_Chrome__/]}];function e(a){return a?.name||a?.function?.name||""}function f(a,b){return"string"==typeof b?a===b:b instanceof RegExp&&b.test(a)}function g(a){if(!Array.isArray(a)||0===a.length)return{tools:a,stripped:[]};let b=a.map(e),c=new Set;for(let a of d)if(b.some(b=>a.triggers.some(a=>f(b,a))))for(let d of b)a.strip.some(a=>f(d,a))&&c.add(d);return 0===c.size?{tools:a,stripped:[]}:{tools:a.filter(a=>!c.has(e(a))),stripped:Array.from(c)}}},20623:(a,b,c)=>{c.d(b,{$:()=>p,M:()=>o});var d=c(14170),e=c(78833),f=c(71857),g=c(59657),h=c(35024),i=c(41004),j=c(30320),k=c(86171),l=c(47370),m=c(78959);let n={[d.h.OPENAI_RESPONSES]:d.h.OPENAI_RESPONSES,[d.h.CLAUDE]:d.h.CLAUDE,[d.h.ANTIGRAVITY]:d.h.ANTIGRAVITY,[d.h.GEMINI]:d.h.ANTIGRAVITY,[d.h.GEMINI_CLI]:d.h.ANTIGRAVITY};function o({providerResponse:a,provider:b,model:c,sourceFormat:p,targetFormat:q,userAgent:r,body:s,stream:t,translatedBody:u,finalBody:v,requestStartTime:w,connectionId:x,apiKey:y,clientRawRequest:z,onRequestSuccess:A,reqLogger:B,toolNameMap:C,streamController:D,onStreamComplete:E}){A&&A();let F=function({provider:a,sourceFormat:b,targetFormat:c,userAgent:g,reqLogger:i,toolNameMap:j,model:k,connectionId:l,body:m,onStreamComplete:o,apiKey:p}){let q=g?.toLowerCase().includes("droid")||g?.toLowerCase().includes("codex-cli");if(h.xq[a]?.format===d.h.OPENAI_RESPONSES&&c===d.h.OPENAI_RESPONSES&&!q){let c=n[b]||d.h.OPENAI;return(0,f.i5)(d.h.OPENAI_RESPONSES,c,a,i,j,k,l,m,o,p)}return(0,e.nZ)(c,b)?(0,f.i5)(c,b,a,i,j,k,l,m,o,p):(0,f.l2)(a,i,k,l,m,o,p)}({provider:b,sourceFormat:p,targetFormat:q,userAgent:r,reqLogger:B,toolNameMap:C,model:c,connectionId:x,body:s,onStreamComplete:E,apiKey:y}),G=p===d.h.OPENAI_RESPONSES&&q===d.h.OPENAI_RESPONSES?j.Hr:null,H=h.xq[b]?.stallTimeoutMs||i.xM,I=(0,g.Jb)(a,F,D,G,H),J=`${Date.now()}-${Math.random().toString(36).slice(2,11)}`;return(0,l.ox)((0,k.$R)({provider:b,model:c,connectionId:x,latency:{ttft:0,total:Date.now()-w},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,k.Fo)(s,t),providerRequest:v||u||null,providerResponse:"[Streaming - raw response not captured]",response:{content:"[Streaming in progress...]",thinking:null,type:"streaming"},status:"success"},{id:J})).catch(a=>{console.error("[RequestDetail] Failed to save streaming request:",a.message)}),{success:!0,response:new Response(I,{headers:m.RK})}}function p({provider:a,model:b,connectionId:c,apiKey:d,requestStartTime:e,body:f,stream:g,finalBody:h,translatedBody:i,clientRawRequest:j}){let m=`${Date.now()}-${Math.random().toString(36).slice(2,11)}`;return{onStreamComplete:(n,o,p)=>{let q={ttft:p?p-e:Date.now()-e,total:Date.now()-e},r=n?.content||"[Empty streaming response]",s=n?.thinking||null;(0,l.ox)((0,k.$R)({provider:a,model:b,connectionId:c,latency:q,tokens:o||{prompt_tokens:0,completion_tokens:0},request:(0,k.Fo)(f,g),providerRequest:h||i||null,providerResponse:r,response:{content:r,thinking:s,type:"streaming"},status:"success"},{id:m})).catch(a=>{console.error("[RequestDetail] Failed to update streaming content:",a.message)}),(0,k.qr)({provider:a,model:b,tokens:o,connectionId:c,apiKey:d,endpoint:j?.endpoint,label:"STREAM USAGE"})},streamDetailId:m}}},24643:(a,b,c)=>{c.d(b,{J:()=>e});var d=c(14170);function e(a,b,c){if(a&&c)switch(b){case d.h.CLAUDE:!function(a,b){if("string"==typeof a.system&&a.system.length>0){a.system=`${a.system}
3
+ `}}let i={role:"assistant"};f&&(i.content=f),g&&(i.reasoning_content=g),h.length>0&&(i.tool_calls=h),i.content||i.tool_calls||(i.content="");let j=(c.finishReason||"stop").toLowerCase();"stop"===j&&h.length>0&&(j="tool_calls");let k={id:`chatcmpl-${b.responseId||Date.now()}`,object:"chat.completion",created:Math.floor(new Date(b.createTime||Date.now()).getTime()/1e3),model:b.modelVersion||"gemini",choices:[{index:0,message:i,finish_reason:j}]};return e&&(k.usage={prompt_tokens:(e.promptTokenCount||0)+(e.thoughtsTokenCount||0),completion_tokens:e.candidatesTokenCount||0,total_tokens:e.totalTokenCount||0},e.thoughtsTokenCount>0&&(k.usage.completion_tokens_details={reasoning_tokens:e.thoughtsTokenCount})),k}if(b===d.h.CLAUDE){if(a.choices||a.content&&!Array.isArray(a.content))return a;let b="",c="",d=[];for(let e of a.content||[])"text"===e.type?b+=(e.text??"").replace(/^\s*```\s*json\s*\n?/i,"").replace(/\n?\s*```\s*$/i,""):"thinking"===e.type?c+=e.thinking||"":"tool_use"===e.type&&d.push({id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.input||{})}});let e={role:"assistant"};b&&(e.content=b),c&&(e.reasoning_content=c),d.length>0&&(e.tool_calls=d),e.content||e.tool_calls||(e.content="");let f=a.stop_reason||"stop";"end_turn"===f&&(f="stop"),"tool_use"===f&&(f="tool_calls");let g={id:`chatcmpl-${a.id||Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a.model||"claude",choices:[{index:0,message:e,finish_reason:f}]};return a.usage&&(g.usage={prompt_tokens:a.usage.input_tokens||0,completion_tokens:a.usage.output_tokens||0,total_tokens:(a.usage.input_tokens||0)+(a.usage.output_tokens||0)}),g}return b===d.h.OLLAMA?(0,f._)(a):a}(D,p,o):D;if(F?.choices?.[0]){let a=F.choices[0],b=a.message;Array.isArray(b?.tool_calls)&&b.tool_calls.length>0&&"tool_calls"!==a.finish_reason&&(a.finish_reason="tool_calls")}if(F.object||(F.object="chat.completion"),F.created||(F.created=Math.floor(Date.now()/1e3)),delete F.prompt_filter_results,F?.choices)for(let a of F.choices)delete a.content_filter_results;if(F?.usage&&(F.usage=(0,g.WL)((0,g.O9)(F.usage),o)),F?.choices)for(let a of F.choices)a?.message?.reasoning_content&&a.message.content&&delete a.message.reasoning_content;z.logConvertedResponse(F);let G=Date.now()-u;return(0,l.ox)((0,k.$R)({provider:b,model:c,connectionId:v,latency:{ttft:G,total:G},tokens:E||{prompt_tokens:0,completion_tokens:0},request:(0,k.Fo)(q,r),providerRequest:t||s||null,providerResponse:D||null,response:{content:F?.choices?.[0]?.message?.content||F?.content||null,thinking:F?.choices?.[0]?.message?.reasoning_content||F?.reasoning_content||null,finish_reason:F?.choices?.[0]?.finish_reason||"unknown"},status:"success"},{endpoint:x?.endpoint||null})).catch(a=>{console.error("[RequestDetail] Failed to save:",a.message)}),{success:!0,response:new Response(JSON.stringify(F),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}},5263:(a,b,c)=>{c.d(b,{X:()=>m});var d=c(14170);let e={vision:"[image omitted: model has no vision support]",audioInput:"[audio omitted: model has no audio support]",pdf:"[file omitted: model has no document support]"},f={vision:"[Previous image omitted from context.]",audioInput:"[Previous audio omitted from context.]",pdf:"[Previous file omitted from context.]"},g=(a,b)=>(b?e:f)[a];function h(a){let b=a?.type;return"image_url"===b||"image"===b?"vision":"input_audio"===b||"audio_url"===b?"audioInput":"file"===b?"pdf":null}function i(a){let b=a?.type;return"image"===b?"vision":"document"===b?"pdf":null}function j(a,b,c,d,e){let f=[];for(let e of a){let a=b(e);if(a&&!1===c[a]){d.add(a);continue}f.push(e)}for(let a of d)f.push({type:"text",text:g(a,e)});return f}function k(a,b){if(!Array.isArray(a.messages))return;let c=a.messages.length-1;a.messages.forEach((a,d)=>{if(!Array.isArray(a.content))return;let e=new Set;a.content=j(a.content,h,b,e,d===c)})}function l(a,b){if(!Array.isArray(a))return;let c=a.length-1;a.forEach((a,d)=>{if(!Array.isArray(a.parts))return;let e=new Set;for(let f of(a.parts=a.parts.filter(a=>{var c;let d="string"!=typeof(c=a?.inlineData?.mimeType||a?.fileData?.mimeType)?null:c.startsWith("image/")?"vision":c.startsWith("audio/")?"audioInput":"application/pdf"===c?"pdf":null;return!d||!1!==b[d]||(e.add(d),!1)}),e))a.parts.push({text:g(f,d===c)})})}function m(a,b,c){if(!a||!c||!1!==c.vision&&!1!==c.audioInput&&!1!==c.pdf)return!1;switch(b){case d.h.OPENAI:case d.h.OLLAMA:case d.h.KIRO:case d.h.CURSOR:case d.h.COMMANDCODE:k(a,c);break;case d.h.CLAUDE:!function(a,b){if(!Array.isArray(a.messages))return;let c=a.messages.length-1;a.messages.forEach((a,d)=>{if(!Array.isArray(a.content))return;let e=new Set;a.content=j(a.content,i,b,e,d===c)})}(a,c);break;case d.h.OPENAI_RESPONSES:case d.h.OPENAI_RESPONSE:case d.h.CODEX:!function(a,b){if(!Array.isArray(a.input))return;let c=a.input.length-1;a.input.forEach((a,d)=>{if(!Array.isArray(a.content))return;let e=new Set;for(let f of(a.content=a.content.filter(a=>{let c=a?.type==="input_image"?"vision":a?.type==="input_file"?"pdf":null;return!c||!1!==b[c]||(e.add(c),!1)}),e))a.content.push({type:"input_text",text:g(f,d===c)})})}(a,c);break;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:l(a.contents,c);break;case d.h.ANTIGRAVITY:l(a?.request?.contents,c);break;default:k(a,c)}return!0}},12557:(a,b,c)=>{c.d(b,{Bl:()=>j,Qo:()=>f,S5:()=>l,hk:()=>e,kJ:()=>k});var d=c(3662);function e(a,b,c=0){let f=b?("string"==typeof b?b:JSON.stringify(b)).toLowerCase():"";for(let b of d.t2)if(b.text&&f&&f.includes(b.text)||b.status&&b.status===a){if(b.backoff){let a=Math.min(c+1,d.EQ.maxLevel);return{shouldFallback:!0,cooldownMs:function(a=0){let b=Math.max(0,a-1);return Math.min(d.EQ.base*Math.pow(2,b),d.EQ.max)}(a),newBackoffLevel:a}}return{shouldFallback:!0,cooldownMs:b.cooldownMs}}return{shouldFallback:!0,cooldownMs:d.wf}}function f(a){if(!a)return"";let b=new Date(a).getTime()-Date.now();if(b<=0)return"reset after 0s";let c=Math.ceil(b/1e3),d=Math.floor(c/3600),e=Math.floor(c%3600/60),f=c%60,g=[];return d>0&&g.push(`${d}h`),e>0&&g.push(`${e}m`),(f>0||0===g.length)&&g.push(`${f}s`),`reset after ${g.join(" ")}`}let g="modelLock_",h=`${g}__all`;function i(a){return a?`${g}${a}`:h}function j(a,b){let c=a[i(b)]||a[h];return!!c&&new Date(c).getTime()>Date.now()}function k(a){if(!a)return null;let b=null,c=Date.now();for(let[d,e]of Object.entries(a)){if(!d.startsWith(g)||!e)continue;let a=new Date(e).getTime();a<=c||(!b||a<b)&&(b=a)}return b?new Date(b).toISOString():null}function l(a,b){return{[i(a)]:new Date(Date.now()+b).toISOString()}}},14724:(a,b,c)=>{c.d(b,{F:()=>g});let d=[{triggers:["mcp__exa__web_search_exa","mcp__exa__web_fetch_exa"],strip:["WebSearch","WebFetch","mcp__workspace__web_fetch"]},{triggers:["mcp__tavily__tavily_search","mcp__tavily__tavily_extract"],strip:["WebSearch","WebFetch","mcp__workspace__web_fetch"]},{triggers:[/^mcp__browsermcp__/],strip:[/^mcp__Claude_in_Chrome__/]}];function e(a){return a?.name||a?.function?.name||""}function f(a,b){return"string"==typeof b?a===b:b instanceof RegExp&&b.test(a)}function g(a){if(!Array.isArray(a)||0===a.length)return{tools:a,stripped:[]};let b=a.map(e),c=new Set;for(let a of d)if(b.some(b=>a.triggers.some(a=>f(b,a))))for(let d of b)a.strip.some(a=>f(d,a))&&c.add(d);return 0===c.size?{tools:a,stripped:[]}:{tools:a.filter(a=>!c.has(e(a))),stripped:Array.from(c)}}},20623:(a,b,c)=>{c.d(b,{$:()=>p,M:()=>o});var d=c(14170),e=c(78833),f=c(71857),g=c(59657),h=c(35024),i=c(41004),j=c(30320),k=c(86171),l=c(47370),m=c(78959);let n={[d.h.OPENAI_RESPONSES]:d.h.OPENAI_RESPONSES,[d.h.CLAUDE]:d.h.CLAUDE,[d.h.ANTIGRAVITY]:d.h.ANTIGRAVITY,[d.h.GEMINI]:d.h.ANTIGRAVITY,[d.h.GEMINI_CLI]:d.h.ANTIGRAVITY};function o({providerResponse:a,provider:b,model:c,sourceFormat:p,targetFormat:q,userAgent:r,body:s,stream:t,translatedBody:u,finalBody:v,requestStartTime:w,connectionId:x,apiKey:y,clientRawRequest:z,onRequestSuccess:A,reqLogger:B,toolNameMap:C,streamController:D,onStreamComplete:E}){A&&Promise.resolve().then(A).catch(a=>{console.error("[ChatCore] onRequestSuccess failed:",a?.message||a)});let F=(a.headers.get("content-type")||"").toLowerCase();!F||F.includes("text/event-stream")||F.includes("application/json")||console.warn("[STREAM] "+b+" | "+c+" | unexpected Content-Type: "+F);let G=function({provider:a,sourceFormat:b,targetFormat:c,userAgent:g,reqLogger:i,toolNameMap:j,model:k,connectionId:l,body:m,onStreamComplete:o,apiKey:p}){let q=g?.toLowerCase().includes("droid")||g?.toLowerCase().includes("codex-cli");if(h.xq[a]?.format===d.h.OPENAI_RESPONSES&&c===d.h.OPENAI_RESPONSES&&!q){let c=n[b]||d.h.OPENAI;return(0,f.i5)(d.h.OPENAI_RESPONSES,c,a,i,j,k,l,m,o,p)}return(0,e.nZ)(c,b)?(0,f.i5)(c,b,a,i,j,k,l,m,o,p):(0,f.l2)(a,i,k,l,m,o,p)}({provider:b,sourceFormat:p,targetFormat:q,userAgent:r,reqLogger:B,toolNameMap:C,model:c,connectionId:x,body:s,onStreamComplete:E,apiKey:y}),H=p===d.h.OPENAI_RESPONSES&&q===d.h.OPENAI_RESPONSES?j.Hr:null,I=h.xq[b]?.stallTimeoutMs||i.xM,J=(0,g.Jb)(a,G,D,H,I),K=`${Date.now()}-${Math.random().toString(36).slice(2,11)}`;return(0,l.ox)((0,k.$R)({provider:b,model:c,connectionId:x,latency:{ttft:0,total:Date.now()-w},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,k.Fo)(s,t),providerRequest:v||u||null,providerResponse:"[Streaming - raw response not captured]",response:{content:"[Streaming in progress...]",thinking:null,type:"streaming"},status:"success"},{id:K})).catch(a=>{console.error("[RequestDetail] Failed to save streaming request:",a.message)}),{success:!0,response:new Response(J,{headers:m.RK})}}function p({provider:a,model:b,connectionId:c,apiKey:d,requestStartTime:e,body:f,stream:g,finalBody:h,translatedBody:i,clientRawRequest:j}){let m=`${Date.now()}-${Math.random().toString(36).slice(2,11)}`;return{onStreamComplete:(n,o,p)=>{let q={ttft:p?p-e:Date.now()-e,total:Date.now()-e},r=n?.content||"[Empty streaming response]",s=n?.thinking||null;(0,l.ox)((0,k.$R)({provider:a,model:b,connectionId:c,latency:q,tokens:o||{prompt_tokens:0,completion_tokens:0},request:(0,k.Fo)(f,g),providerRequest:h||i||null,providerResponse:r,response:{content:r,thinking:s,type:"streaming"},status:"success"},{id:m})).catch(a=>{console.error("[RequestDetail] Failed to update streaming content:",a.message)}),(0,k.qr)({provider:a,model:b,tokens:o,connectionId:c,apiKey:d,endpoint:j?.endpoint,label:"STREAM USAGE"})},streamDetailId:m}}},24643:(a,b,c)=>{c.d(b,{J:()=>e});var d=c(14170);function e(a,b,c){if(a&&c)switch(b){case d.h.CLAUDE:!function(a,b){if("string"==typeof a.system&&a.system.length>0){a.system=`${a.system}
4
4
 
5
5
  ${b}`;return}if(Array.isArray(a.system)){let c={type:"text",text:b},d=-1;for(let b=a.system.length-1;b>=0;b--)if(a.system[b]?.cache_control){d=b;break}d>=0?a.system.splice(d,0,c):a.system.push(c);return}a.system=b}(a,c);return;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:case d.h.ANTIGRAVITY:var e,f;let g,h,i;e=a,f=c,g=e.request&&"object"==typeof e.request?e.request:e,h=Object.prototype.hasOwnProperty.call(g,"system_instruction")?"system_instruction":"systemInstruction",(i=g[h])&&Array.isArray(i.parts)?i.parts.push({text:f}):g[h]={parts:[{text:f}]};return;default:!function(a,b){var c,d;if("string"==typeof a.instructions){a.instructions=a.instructions?`${a.instructions}
6
6
 
@@ -8,10 +8,10 @@ ${b}`:b;return}let e=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)
8
8
 
9
9
  ${d}`:Array.isArray(c.content)?c.content.push({type:"input_text",text:d}):c.content=d):e.unshift({role:"system",content:b})}(a,c)}}},27349:(a,b,c)=>{c.d(b,{c:()=>i});var d=c(57647),e=c(78833),f=c(14170),g=c(41004),h=c(71857);function i(a,b,c="",e=!1){if(!c.includes("claude-cli")||!a.messages?.length)return null;let f=a.messages,h=a=>"string"==typeof a?a:Array.isArray(a)?a.filter(a=>"text"===a.type).map(a=>a.text).join(" "):"",j=!1,m=!1,n=f[f.length-1];if(n?.role==="assistant"&&n.content?.[0]?.text==="{"&&(j=!0),j||"Warmup"===h(f[0]?.content)&&(j=!0),j||1!==f.length||f[0]?.role!=="user"||"count"===h(f[0]?.content)&&(j=!0),!j&&g.C8?.length){let a=f.filter(a=>"user"===a.role).map(a=>h(a.content)).join(" ");g.C8.some(b=>a.includes(b))&&(j=!0)}if(!j&&e){let b=f.find(a=>"system"===a.role),c=h(b?.content),d=Array.isArray(a.system)?a.system.filter(a=>"text"===a.type).map(a=>a.text).join(" "):"string"==typeof a.system?a.system:"";(c||d).includes("isNewTopic")&&(j=!0,m=!0)}if(!j)return null;let o=(0,d.Tz)(a),p=!1!==a.stream;if(m){let a=f.find(a=>"user"===a.role),c=JSON.stringify({isNewTopic:!0,title:h(a?.content).trim().split(/\s+/).slice(0,3).join(" ")});return p?l(o,b,c):k(o,b,c)}return p?l(o,b):k(o,b)}function j(a,b="CLI Command Execution: Clear Terminal"){return{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:a,choices:[{index:0,message:{role:"assistant",content:b},finish_reason:"stop"}],usage:{prompt_tokens:1,completion_tokens:1,total_tokens:2}}}function k(a,b,c){let d=j(b,c);if(a===f.h.OPENAI)return{success:!0,response:new Response(JSON.stringify(d),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})};let g=(0,e.Ws)(a);g.model=b;let h=m(d),i=[];for(let b of h){let c=(0,e.Y8)(f.h.OPENAI,a,b,g);c?.length>0&&i.push(...c)}let k=(0,e.Y8)(f.h.OPENAI,a,null,g);return k?.length>0&&i.push(...k),{success:!0,response:new Response(JSON.stringify(function(a,b){if(!a||0===a.length)return j("unknown");let c=a[a.length-1];if(b===f.h.CLAUDE&&a.find(a=>"message_stop"===a.type)){a.find(a=>"content_block_delta"===a.type);let b=a.find(a=>"message_delta"===a.type),d=a.find(a=>"message_start"===a.type);d?.message&&(c=d.message,b?.usage&&(c.usage=b.usage))}return c}(i,a)),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}function l(a,b,c){let d=j(b,c),g=(0,e.Ws)(a);g.model=b;let i=m(d),k=[];for(let b of i){let c=(0,e.Y8)(f.h.OPENAI,a,b,g);if(c?.length>0)for(let b of c)k.push((0,h.v8)(b,a))}let l=(0,e.Y8)(f.h.OPENAI,a,null,g);if(l?.length>0)for(let b of l)k.push((0,h.v8)(b,a));return k.push("data: [DONE]\n\n"),{success:!0,response:new Response(k.join(""),{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive","Access-Control-Allow-Origin":"*"}})}}function m(a){let{id:b,created:c,model:d,choices:e}=a;return[{id:b,object:"chat.completion.chunk",created:c,model:d,choices:[{index:0,delta:{role:"assistant",content:e[0].message.content},finish_reason:null}]},{id:b,object:"chat.completion.chunk",created:c,model:d,choices:[{index:0,delta:{},finish_reason:"stop"}],usage:a.usage}]}},30320:(a,b,c)=>{c.d(b,{Hr:()=>j,nu:()=>h,u9:()=>k,yx:()=>g});var d=c(14170),e=c(9024);let f=new Set(["response.completed","response.failed","error"]);function g(a,b){return a||(b&&"string"==typeof b.type?b.type:null)}function h(a,b){let c=g(a,b);if(f.has(c))return!0;let d=b?.response?.status;return"completed"===d||"failed"===d}let i=new TextEncoder;function j(){return i.encode(`${k()}data: [DONE]
10
10
 
11
- `)}function k(){return(0,e.v8)({event:"response.failed",data:{type:"response.failed",response:{id:`resp_${Date.now()}`,status:"failed",error:{type:"stream_error",code:"stream_disconnected",message:"stream closed before response.completed"}}}},d.h.OPENAI_RESPONSES)}},43659:(a,b,c)=>{c.d(b,{A1:()=>g,lR:()=>i,wO:()=>h,yj:()=>e,zL:()=>f});var d=c(3662);function e(a,b){let c;return new Response(JSON.stringify((c=d.LY[a]||(a>=500?{type:"server_error",code:"internal_server_error"}:{type:"invalid_request_error",code:""}),{error:{message:b||d.O[a]||"An error occurred",type:c.type,code:c.code}})),{status:a,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}async function f(a,b=null){let c="";try{c=await a.text()}catch{c=""}if(b&&"function"==typeof b.parseError)try{let e=b.parseError(a,c);if(e&&"object"==typeof e){let b=e.message||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:e.status||a.status,message:b,resetsAtMs:e.resetsAtMs}}}catch{}let e="";try{let a=JSON.parse(c);e=a.error?.message||a.message||a.error||c}catch{e=c}let g=("string"==typeof e?e:JSON.stringify(e))||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:a.status,message:g}}function g(a,b,c){return{success:!1,status:a,error:b,resetsAtMs:c,response:e(a,b)}}function h(a,b,c,d){let e=Math.max(Math.ceil((new Date(c).getTime()-Date.now())/1e3),1);return new Response(JSON.stringify({error:{message:`${b} (${d})`}}),{status:a,headers:{"Content-Type":"application/json","Retry-After":String(e)}})}function i(a,b,c,d){let e=d||a.code||"FETCH_FAILED",f=a.message||"Unknown error",g=a.cause?.code,h=a.cause?.message,i=g||h?` (cause: ${[g,h].filter(Boolean).join(": ")})`:"";return`[${e}]: ${f}${i}`}},48895:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{SB:()=>f.SB}),c(39609),c(35024),c(75924),c(41004),c(45699),c(14170),c(78833),c(57647),c(40669),c(12557),c(8521),c(93943);var e=c(92500);c(59657);var f=c(55330);c(43659),c(71857);var g=a([e,f]);[e,f]=g.then?(await g)():g,d()}catch(a){d(a)}})},59657:(a,b,c)=>{c.d(b,{Jb:()=>g,jd:()=>f});var d=c(41004),e=c(92306);function f({onDisconnect:a,onError:b,log:c,provider:d,model:g}={}){let h=new AbortController,i=Date.now(),j=!1,k=null,l=a=>{let b=Date.now()-i,c=d?.toUpperCase()||"UNKNOWN";console.log(`[${new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}] 🌊 [STREAM] ${c} | ${g||"unknown"} | ${b}ms | ${a}`)};return{signal:h.signal,startTime:i,isConnected:()=>!j,handleDisconnect:(b="client_closed")=>{j||(j=!0,l(`disconnect: ${b}`),(0,e.s)("CTRL",`${d}/${g} | disconnect=${b} | dur=${Date.now()-i}ms`),k=setTimeout(()=>{h.abort()},500),a?.({reason:b,duration:Date.now()-i}))},handleComplete:()=>{!j&&(j=!0,l("complete"),k&&(clearTimeout(k),k=null))},handleError:a=>{if(!j){if(j=!0,k&&(clearTimeout(k),k=null),"AbortError"===a.name)return void l("aborted");l(`error: ${a.message}`),b?.(a)}},abort:()=>h.abort()}}function g(a,b,c,f=null,h=d.xM){let i=null,j=0,k=0,l=Date.now(),m=Date.now(),n="STREAM",o=()=>{i&&(clearTimeout(i),i=null)},p=()=>{o(),i=setTimeout(()=>{i=null,(0,e.s)(n,`STALL TIMEOUT ${h}ms | chunks=${j} | bytes=${k} | sinceLast=${Date.now()-l}ms`),c.handleError?.(Error("stream stall timeout")),c.abort?.()},h)},q={signal:c.signal,startTime:c.startTime,isConnected:()=>c.isConnected(),handleComplete:()=>{(0,e.s)(n,`complete | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o(),c.handleComplete()},handleError:a=>{(0,e.s)(n,`error: ${a?.message} | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o(),c.handleError(a)},handleDisconnect:a=>{(0,e.s)(n,`disconnect: ${a} | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o(),c.handleDisconnect(a)},abort:()=>{o(),c.abort()}};p(),(0,e.s)(n,`pipe start | stallTimeout=${h}ms`);let r=new TransformStream({transform(a,b){j++;let c=a?.byteLength||a?.length||0;k+=c;let d=Date.now(),f=d-l;l=d,e.T&&(j<=5||j%20==0||f>5e3)&&(0,e.s)(n,`chunk #${j} | size=${c}B | gap=${f}ms | total=${k}B`),p(),b.enqueue(a)},flush(){(0,e.s)(n,`upstream EOF | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o()}});return function(a,b,c=null){let d=a.readable.getReader(),e=a.writable.getWriter(),f=!1,g=a=>{if(!f&&c){f=!0;try{let b=c();b&&a.enqueue(b)}catch{}}};return new ReadableStream({async pull(a){if(!b.isConnected()){g(a),a.close();return}try{let{done:c,value:e}=await d.read();if(c){b.handleComplete(),a.close();return}a.enqueue(e)}catch(l){let f=b.isConnected(),h=l?.message||"";h.includes("already closed")||h.includes("Invalid state")||b.handleError(l),d.cancel().catch(()=>{}),e.abort().catch(()=>{});let i=l?.message||"",j=l?.code||l?.cause?.code||"",k="AbortError"===l.name||i.includes("aborted")||i.includes("socket hang up")||i.includes("ECONNRESET")||i.includes("ETIMEDOUT")||i.includes("EPIPE")||"ECONNRESET"===j||"ETIMEDOUT"===j||"EPIPE"===j||"UND_ERR_SOCKET"===j;try{!f||k||c?(g(a),a.close()):a.error(l)}catch(a){}}},cancel(a){b.handleDisconnect(a||"cancelled"),d.cancel(),e.abort()}})}({readable:a.body.pipeThrough(r).pipeThrough(b),writable:{getWriter:()=>({abort:()=>Promise.resolve()})}},q,f)}},60125:(a,b,c)=>{c.d(b,{p:()=>j});var d=c(24643);let e="Code blocks, file paths, commands, errors, URLs: keep exact. Security warnings, irreversible action confirmations, multi-step ordered sequences: write normal. Resume terse style after.",f='Not: "Sure! I\'d be happy to help you with that. The issue you\'re experiencing is likely caused by..." Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"',g="Auto-Clarity: drop caveman for security warnings, irreversible actions, multi-step sequences where fragment ambiguity risks misread, or when user repeats a question. Resume after the clear part.",h="ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure.",i={lite:["Respond tersely. Keep grammar and full sentences but drop filler, hedging and pleasantries (just/really/basically/sure/of course/I'd be happy to). Pattern: state the thing, the action, the reason. Then next step.",f,e,g,h].join(" "),full:["Respond like terse caveman. All technical substance stay exact, only fluff die. Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries, hedging. Fragments OK. Short synonyms (big not extensive, fix not implement a solution for). Pattern: [thing] [action] [reason]. [next step].",f,e,g,h].join(" "),ultra:["Respond ultra-terse. Maximum compression. Telegraphic. Abbreviate (DB/auth/config/req/res/fn/impl), strip conjunctions, use arrows for causality (X → Y). One word when one word enough. Pattern: [thing] → [result]. [fix].",f,e,g,h].join(" "),"wenyan-lite":["Respond semi-classical. Drop filler/hedging but keep grammar structure, classical register. Use classical Chinese sentence patterns where natural. Keep English for technical terms.",f,e,g,h].join(" "),wenyan:["Respond classical Chinese (文言文). Maximum classical terseness. 80-90% character reduction. Classical sentence patterns, verbs precede objects, subjects often omitted, classical particles (之/乃/為/其). Keep English for code, commands, function names, API names, error strings.",f,e,g,h].join(" "),"wenyan-ultra":["Respond extreme classical compression (文言文 ultra). Maximum compression, ultra terse. Same classical rules as wenyan-full but even more compressed. One classical particle per clause.",f,e,g,h].join(" ")};function j(a,b,c){(0,d.J)(a,b,i[c])}},60475:(a,b,c)=>{c.d(b,{U:()=>l});var d=c(24643);let e="You are a lazy senior developer. Lazy means efficient, not careless. The best code is the code never written.",f="Before writing code, stop at the first rung that holds: 1) Does this need to exist at all? (YAGNI) 2) Stdlib does it? Use it. 3) Native platform feature covers it? Use it (CSS over JS, DB constraint over app code). 4) Already-installed dependency solves it? Use it; never add a new one for what a few lines can do. 5) Can it be one line? One line. 6) Only then: the minimum code that works.",g='No unrequested abstractions (no interface with one implementation, no factory for one product, no config for a value that never changes). No boilerplate or scaffolding "for later". Deletion over addition. Boring over clever. Fewest files possible; shortest working diff wins. Two stdlib options the same size: take the edge-case-correct one. Mark deliberate simplifications with a `ponytail:` comment naming the ceiling and upgrade path.',h="Code first. Then at most three short lines: what was skipped, when to add it. No essays or design notes. Pattern: `[code] → skipped: [X], add when [Y].`",i="Never simplify away: input validation at trust boundaries, error handling that prevents data loss, security, accessibility, anything explicitly requested. Non-trivial logic leaves ONE runnable check behind (an assert-based self-check or one small test file; no frameworks). Trivial one-liners need no test.",j="ACTIVE EVERY RESPONSE. No drift back to over-building. Still active if unsure.",k={lite:[e,"Lite: build what's asked, but name the lazier alternative in one line. User picks.",f,g,h,i,j].join(" "),full:[e,"Full: the ladder enforced. Stdlib and native first. Shortest diff, shortest explanation.",f,g,h,i,j].join(" "),ultra:[e,"Ultra: YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement in the same response.",f,g,h,i,j].join(" ")};function l(a,b,c){(0,d.J)(a,b,k[c])}},70190:(a,b,c)=>{c.d(b,{N:()=>h,S:()=>g});var d=c(60983),e=c(19979);async function f(a,b,c,d,e){let f=`${String(a).replace(/\/$/,"")}/v1/compress`,g={messages:b,model:c};e&&(g.config={compress_user_messages:!0});let h=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:AbortSignal.timeout(d)});if(!h.ok)return null;let i=await h.json();return Array.isArray(i?.messages)?i:null}async function g(a,{enabled:b,url:c,model:h,format:i,compressUserMessages:j,timeoutMs:k=3e3}={}){if(!b||!c||!a)return null;try{if("claude"===i){let b=(0,d.t)(h,a,!1);if(!Array.isArray(b?.messages))return null;let g=await f(c,b.messages,h,k,j);if(!g)return null;let i=(0,e.p)(h,{...b,messages:g.messages},!1);return Array.isArray(i?.messages)&&(a.messages=i.messages),i?.system!==void 0&&(a.system=i.system),g}let b=Array.isArray(a.messages)?"messages":Array.isArray(a.input)?"input":null;if(!b)return null;let g=await f(c,a[b],h,k,j);if(!g)return null;return a[b]=g.messages,g}catch{return null}}function h(a){if(!a)return null;let b=a.tokens_before||0,c=a.tokens_after||0,d=a.tokens_saved||0,e=b>0?(d/b*100).toFixed(1):"0";return`saved ${d} tokens / ${b} (${e}%) ${c?`after=${c}`:""}`.trim()}},71336:(a,b,c)=>{c.d(b,{q7:()=>m});let d="u">typeof process&&process.versions?.node&&!0,e="u">typeof process&&process.env?.ENABLE_REQUEST_LOGS==="true",f=null,g=null,h=null;async function i(){if(d&&e&&!f)try{f=await Promise.resolve().then(c.t.bind(c,29021,23)),h=(g=await Promise.resolve().then(c.t.bind(c,33873,23))).join("u">typeof process&&process.cwd?process.cwd():".","logs")}catch{}}async function j(a,b,c){if(await i(),!f||!h)return null;try{f.existsSync(h)||f.mkdirSync(h,{recursive:!0});let d=function(a=new Date){let b=a=>String(a).padStart(2,"0"),c=a.getFullYear(),d=b(a.getMonth()+1),e=b(a.getDate()),f=b(a.getHours()),g=b(a.getMinutes()),h=b(a.getSeconds()),i=String(a.getMilliseconds()).padStart(3,"0");return`${c}${d}${e}_${f}${g}${h}_${i}`}(),e=(c||"unknown").replace(/[/:]/g,"-"),i=`${a}_${b}_${e}_${d}`,j=g.join(h,i);return f.mkdirSync(j,{recursive:!0}),j}catch(a){return console.log("[LOG] Failed to create log session:",a.message),null}}function k(a,b,c){if(f&&a)try{let d=g.join(a,b);f.writeFileSync(d,JSON.stringify(c,null,2))}catch(a){console.log(`[LOG] Failed to write ${b}:`,a.message)}}function l(a){return a?{...a}:{}}async function m(a,b,c){if(!e)return{sessionPath:null,logClientRawRequest(){},logRawRequest(){},logOpenAIRequest(){},logTargetRequest(){},logProviderResponse(){},appendProviderChunk(){},appendOpenAIChunk(){},logConvertedResponse(){},appendConvertedChunk(){},logError(){}};let d=await j(a,b,c);return{get sessionPath(){return d},logClientRawRequest(a,b,c={}){k(d,"1_req_client.json",{timestamp:new Date().toISOString(),endpoint:a,headers:l(c),body:b})},logRawRequest(a,b={}){k(d,"2_req_source.json",{timestamp:new Date().toISOString(),headers:l(b),body:a})},logOpenAIRequest(a){k(d,"3_req_openai.json",{timestamp:new Date().toISOString(),body:a})},logTargetRequest(a,b,c){k(d,"4_req_target.json",{timestamp:new Date().toISOString(),url:a,headers:l(b),body:c})},logProviderResponse(a,b,c,e){k(d,"5_res_provider.json",{timestamp:new Date().toISOString(),status:a,statusText:b,headers:c?"function"==typeof c.entries?Object.fromEntries(c.entries()):c:{},body:e})},appendProviderChunk(a){if(f&&d)try{let b=g.join(d,"5_res_provider.txt");f.appendFileSync(b,a)}catch(a){}},appendOpenAIChunk(a){if(f&&d)try{let b=g.join(d,"6_res_openai.txt");f.appendFileSync(b,a)}catch(a){}},logConvertedResponse(a){k(d,"7_res_client.json",{timestamp:new Date().toISOString(),body:a})},appendConvertedChunk(a){if(f&&d)try{let b=g.join(d,"7_res_client.txt");f.appendFileSync(b,a)}catch(a){}},logError(a,b=null){k(d,"6_error.json",{timestamp:new Date().toISOString(),error:a?.message||String(a),stack:a?.stack,requestBody:b})}}}},71857:(a,b,c)=>{c.d(b,{i5:()=>o,l2:()=>p,lm:()=>g.lm,v8:()=>h.v8});var d=c(78833),e=c(14170),f=c(47370),g=c(73483),h=c(9024),i=c(30320),j=c(92306);c(78959);let k=new TextEncoder,l="translate",m="passthrough";function n(a={}){let{mode:b=l,targetFormat:c,sourceFormat:o,provider:p=null,reqLogger:q=null,toolNameMap:r=null,model:s=null,connectionId:t=null,body:u=null,onStreamComplete:v=null,apiKey:w=null}=a,x="",y=null,z=new TextDecoder("utf-8",{fatal:!1}),A=b===l?{...(0,d.Ws)(o),provider:p,toolNameMap:r,model:s}:null,B=0,C="",D="",E=null,F=0,G=0,H={},I=null,J=!1,K=!1;return new TransformStream({transform(a,f){E||(E=Date.now());let n=z.decode(a,{stream:!0});x+=n,q?.appendProviderChunk?.(n);let p=x.split("\n");for(let a of(x=p.pop()||"",p)){let n=a.trim();if(j.T&&n&&(F++,n.startsWith("event:"))){let a=n.slice(6).trim();H[a]=(H[a]||0)+1}if(b===l&&c===e.h.OPENAI_RESPONSES&&n.startsWith("event:")&&(I=n.slice(6).trim()),b===m){let b,c=!1;if(n.startsWith("data:")&&"[DONE]"!==n.slice(5).trim())try{let a=JSON.parse(n.slice(5).trim()),d=(0,h.A4)(a),f=!1;if(void 0!==a.choices&&(a.object||(a.object="chat.completion.chunk",f=!0),a.created||(a.created=Math.floor(Date.now()/1e3),f=!0)),void 0!==a.prompt_filter_results&&(delete a.prompt_filter_results,f=!0),a?.choices)for(let b of a.choices)void 0!==b.content_filter_results&&(delete b.content_filter_results,f=!0);if(!(0,h.c2)(a,e.h.OPENAI))continue;let i=a.choices?.[0]?.delta,j=i?.content,k=i?.reasoning_content;j&&"string"==typeof j&&(B+=j.length,C+=j),k&&"string"==typeof k&&(B+=k.length,D+=k);let l=(0,g.f5)(a);l&&(y=l);let m=a.choices?.[0]?.finish_reason;if(m&&!(0,g.Gh)(a.usage)){let d=(0,g.OF)(u,B,e.h.OPENAI);a.usage=(0,g.WL)(d,e.h.OPENAI),b=`data: ${JSON.stringify(a)}
11
+ `)}function k(){return(0,e.v8)({event:"response.failed",data:{type:"response.failed",response:{id:`resp_${Date.now()}`,status:"failed",error:{type:"stream_error",code:"stream_disconnected",message:"stream closed before response.completed"}}}},d.h.OPENAI_RESPONSES)}},43659:(a,b,c)=>{c.d(b,{A1:()=>g,lR:()=>i,wO:()=>h,yj:()=>e,zL:()=>f});var d=c(3662);function e(a,b){let c;return new Response(JSON.stringify((c=d.LY[a]||(a>=500?{type:"server_error",code:"internal_server_error"}:{type:"invalid_request_error",code:""}),{error:{message:b||d.O[a]||"An error occurred",type:c.type,code:c.code}})),{status:a,headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}async function f(a,b=null){let c="";try{c=await a.text()}catch{c=""}if(b&&"function"==typeof b.parseError)try{let e=b.parseError(a,c);if(e&&"object"==typeof e){let b=e.message||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:e.status||a.status,message:b,resetsAtMs:e.resetsAtMs}}}catch{}let e="";try{let a=JSON.parse(c);e=a.error?.message||a.message||a.error||c}catch{e=c}let g=("string"==typeof e?e:JSON.stringify(e))||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:a.status,message:g}}function g(a,b,c){return{success:!1,status:a,error:b,resetsAtMs:c,response:e(a,b)}}function h(a,b,c,d){let e=Math.max(Math.ceil((new Date(c).getTime()-Date.now())/1e3),1);return new Response(JSON.stringify({error:{message:`${b} (${d})`}}),{status:a,headers:{"Content-Type":"application/json","Retry-After":String(e)}})}function i(a,b,c,d){let e=d||a.code||"FETCH_FAILED",f=a.message||"Unknown error",g=a.cause?.code,h=a.cause?.message,i=g||h?` (cause: ${[g,h].filter(Boolean).join(": ")})`:"";return`[${e}]: ${f}${i}`}},47370:(a,b,c)=>{c.d(b,{BY:()=>d.BY,E5:()=>d.E5,SL:()=>d.SL,Zx:()=>d.Zx,_V:()=>d._V,j$:()=>d.j$,ox:()=>d.ox,rg:()=>d.rg,sZ:()=>d.sZ,uw:()=>d.uw});var d=c(9248)},48895:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{SB:()=>f.SB}),c(39609),c(35024),c(75924),c(41004),c(45699),c(14170),c(78833),c(57647),c(40669),c(12557),c(8521),c(93943);var e=c(92500);c(59657);var f=c(55330);c(43659),c(71857);var g=a([e,f]);[e,f]=g.then?(await g)():g,d()}catch(a){d(a)}})},59657:(a,b,c)=>{c.d(b,{Jb:()=>g,jd:()=>f});var d=c(41004),e=c(92306);function f({onDisconnect:a,onError:b,log:c,provider:d,model:g}={}){let h=new AbortController,i=Date.now(),j=!1,k=null,l=a=>{let b=Date.now()-i,c=d?.toUpperCase()||"UNKNOWN";console.log(`[${new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}] 🌊 [STREAM] ${c} | ${g||"unknown"} | ${b}ms | ${a}`)};return{signal:h.signal,startTime:i,isConnected:()=>!j,handleDisconnect:(b="client_closed")=>{j||(j=!0,l(`disconnect: ${b}`),(0,e.s)("CTRL",`${d}/${g} | disconnect=${b} | dur=${Date.now()-i}ms`),k=setTimeout(()=>{h.abort()},500),a?.({reason:b,duration:Date.now()-i}))},handleComplete:()=>{!j&&(j=!0,l("complete"),k&&(clearTimeout(k),k=null))},handleError:a=>{if(!j){if(j=!0,k&&(clearTimeout(k),k=null),"AbortError"===a.name)return void l("aborted");l(`error: ${a.message}`),b?.(a)}},abort:()=>h.abort()}}function g(a,b,c,f=null,h=d.xM){let i=null,j=0,k=0,l=Date.now(),m=Date.now(),n="STREAM",o=()=>{i&&(clearTimeout(i),i=null)},p=()=>{o(),i=setTimeout(()=>{i=null,(0,e.s)(n,`STALL TIMEOUT ${h}ms | chunks=${j} | bytes=${k} | sinceLast=${Date.now()-l}ms`),c.handleError?.(Error("stream stall timeout")),c.abort?.()},h)},q={signal:c.signal,startTime:c.startTime,isConnected:()=>c.isConnected(),handleComplete:()=>{(0,e.s)(n,`complete | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o(),c.handleComplete()},handleError:a=>{(0,e.s)(n,`error: ${a?.message} | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o(),c.handleError(a)},handleDisconnect:a=>{(0,e.s)(n,`disconnect: ${a} | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o(),c.handleDisconnect(a)},abort:()=>{o(),c.abort()}};p(),(0,e.s)(n,`pipe start | stallTimeout=${h}ms`);let r=new TransformStream({transform(a,b){j++;let c=a?.byteLength||a?.length||0;k+=c;let d=Date.now(),f=d-l;l=d,e.T&&(j<=5||j%20==0||f>5e3)&&(0,e.s)(n,`chunk #${j} | size=${c}B | gap=${f}ms | total=${k}B`),p(),b.enqueue(a)},flush(){(0,e.s)(n,`upstream EOF | chunks=${j} | bytes=${k} | dur=${Date.now()-m}ms`),o()}});return function(a,b,c=null){let d=a.readable.getReader(),e=a.writable.getWriter(),f=!1,g=a=>{if(!f&&c){f=!0;try{let b=c();b&&a.enqueue(b)}catch{}}};return new ReadableStream({async pull(a){if(!b.isConnected()){g(a),a.close();return}try{let{done:c,value:e}=await d.read();if(c){b.handleComplete(),a.close();return}a.enqueue(e)}catch(l){let f=b.isConnected(),h=l?.message||"";h.includes("already closed")||h.includes("Invalid state")||b.handleError(l),d.cancel().catch(()=>{}),e.abort().catch(()=>{});let i=l?.message||"",j=l?.code||l?.cause?.code||"",k="AbortError"===l.name||i.includes("aborted")||i.includes("socket hang up")||i.includes("ECONNRESET")||i.includes("ETIMEDOUT")||i.includes("EPIPE")||"ECONNRESET"===j||"ETIMEDOUT"===j||"EPIPE"===j||"UND_ERR_SOCKET"===j;try{!f||k||c?(g(a),a.close()):a.error(l)}catch(a){}}},cancel(a){b.handleDisconnect(a||"cancelled"),d.cancel(),e.abort()}})}({readable:a.body.pipeThrough(r).pipeThrough(b),writable:{getWriter:()=>({abort:()=>Promise.resolve()})}},q,f)}},60125:(a,b,c)=>{c.d(b,{p:()=>j});var d=c(24643);let e="Code blocks, file paths, commands, errors, URLs: keep exact. Security warnings, irreversible action confirmations, multi-step ordered sequences: write normal. Resume terse style after.",f='Not: "Sure! I\'d be happy to help you with that. The issue you\'re experiencing is likely caused by..." Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"',g="Auto-Clarity: drop caveman for security warnings, irreversible actions, multi-step sequences where fragment ambiguity risks misread, or when user repeats a question. Resume after the clear part.",h="ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure.",i={lite:["Respond tersely. Keep grammar and full sentences but drop filler, hedging and pleasantries (just/really/basically/sure/of course/I'd be happy to). Pattern: state the thing, the action, the reason. Then next step.",f,e,g,h].join(" "),full:["Respond like terse caveman. All technical substance stay exact, only fluff die. Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries, hedging. Fragments OK. Short synonyms (big not extensive, fix not implement a solution for). Pattern: [thing] [action] [reason]. [next step].",f,e,g,h].join(" "),ultra:["Respond ultra-terse. Maximum compression. Telegraphic. Abbreviate (DB/auth/config/req/res/fn/impl), strip conjunctions, use arrows for causality (X → Y). One word when one word enough. Pattern: [thing] → [result]. [fix].",f,e,g,h].join(" "),"wenyan-lite":["Respond semi-classical. Drop filler/hedging but keep grammar structure, classical register. Use classical Chinese sentence patterns where natural. Keep English for technical terms.",f,e,g,h].join(" "),wenyan:["Respond classical Chinese (文言文). Maximum classical terseness. 80-90% character reduction. Classical sentence patterns, verbs precede objects, subjects often omitted, classical particles (之/乃/為/其). Keep English for code, commands, function names, API names, error strings.",f,e,g,h].join(" "),"wenyan-ultra":["Respond extreme classical compression (文言文 ultra). Maximum compression, ultra terse. Same classical rules as wenyan-full but even more compressed. One classical particle per clause.",f,e,g,h].join(" ")};function j(a,b,c){(0,d.J)(a,b,i[c])}},60475:(a,b,c)=>{c.d(b,{U:()=>l});var d=c(24643);let e="You are a lazy senior developer. Lazy means efficient, not careless. The best code is the code never written.",f="Before writing code, stop at the first rung that holds: 1) Does this need to exist at all? (YAGNI) 2) Stdlib does it? Use it. 3) Native platform feature covers it? Use it (CSS over JS, DB constraint over app code). 4) Already-installed dependency solves it? Use it; never add a new one for what a few lines can do. 5) Can it be one line? One line. 6) Only then: the minimum code that works.",g='No unrequested abstractions (no interface with one implementation, no factory for one product, no config for a value that never changes). No boilerplate or scaffolding "for later". Deletion over addition. Boring over clever. Fewest files possible; shortest working diff wins. Two stdlib options the same size: take the edge-case-correct one. Mark deliberate simplifications with a `ponytail:` comment naming the ceiling and upgrade path.',h="Code first. Then at most three short lines: what was skipped, when to add it. No essays or design notes. Pattern: `[code] → skipped: [X], add when [Y].`",i="Never simplify away: input validation at trust boundaries, error handling that prevents data loss, security, accessibility, anything explicitly requested. Non-trivial logic leaves ONE runnable check behind (an assert-based self-check or one small test file; no frameworks). Trivial one-liners need no test.",j="ACTIVE EVERY RESPONSE. No drift back to over-building. Still active if unsure.",k={lite:[e,"Lite: build what's asked, but name the lazier alternative in one line. User picks.",f,g,h,i,j].join(" "),full:[e,"Full: the ladder enforced. Stdlib and native first. Shortest diff, shortest explanation.",f,g,h,i,j].join(" "),ultra:[e,"Ultra: YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement in the same response.",f,g,h,i,j].join(" ")};function l(a,b,c){(0,d.J)(a,b,k[c])}},70190:(a,b,c)=>{c.d(b,{Nv:()=>l,O2:()=>m,SI:()=>k,cB:()=>n});var d=c(60983),e=c(19979),f=c(65377);function g(a){try{return new TextEncoder().encode(JSON.stringify(a)||"").length}catch{return 0}}function h(a){let b=Array.isArray(a?.messages)?a.messages:Array.isArray(a?.input)?a.input:null;return{bodyBytes:g(a),messageBytes:b?g(b):0}}function i(a,b){a&&!a.reason&&(a.reason=b)}async function j(a,b,c,d,e,f){let g,h=function(a){try{let b=new URL(a);return b.pathname=`${b.pathname.replace(/\/$/,"")}/v1/compress`,b.hash="",b.toString()}catch{let[b,c=""]=String(a).replace(/#.*$/,"").split("?",2),d=`${b.replace(/\/$/,"")}/v1/compress`;return c?`${d}?${c}`:d}}(a);f.endpoint=function(a){try{let b=new URL(a);return b.username="",b.password="",b.search="",b.hash="",b.toString()}catch{return String(a).replace(/\/\/[^/@\s]+@/,"//").replace(/[?#].*$/,"")}}(h);let j={messages:b,model:c};e&&(j.config={compress_user_messages:!0});try{g=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j),signal:AbortSignal.timeout(d)})}catch(d){var k;let a,b,c;return i(f,`request failed: ${(k=d,a=k?.cause,b=a?.code||k?.code,c=String(a?.message||k?.message||String(k)).replace(/\/\/[^/@\s]+@/g,"//").replace(/(https?:\/\/[^\s?#]+)[?#][^\s)]*/g,"$1"),b?`${b}: ${c}`:c)}`),null}if(!g.ok)return i(f,`proxy returned HTTP ${g.status}`),null;let l=await g.json();return Array.isArray(l?.messages)?l:(i(f,"proxy response missing messages[]"),null)}async function k(a,{enabled:b,url:c,model:g,format:l,compressUserMessages:m,timeoutMs:n=3e3,diagnostics:o=null}={}){if(!b)return i(o,"disabled"),null;if(!c)return i(o,"missing proxy URL"),null;if(!a)return i(o,"missing request body"),null;try{if(o&&(o.before=h(a)),"claude"===l){let b=(0,d.t)(g,a,!1);if(!Array.isArray(b?.messages))return i(o,"Claude request did not translate to messages[]"),null;let f=await j(c,b.messages,g,n,m,o||{});if(!f)return null;let k=(0,e.p)(g,{...b,messages:f.messages},!1);return Array.isArray(k?.messages)&&(a.messages=k.messages),k?.system!==void 0&&(a.system=k.system),o&&(o.after=h(a)),f}if("openai-responses"===l){let b=(0,f.Z)(g,a,!1);if(!Array.isArray(b?.messages))return null;let d=await j(c,b.messages,g,n,m,o||{});if(!d)return null;let e=(0,f.h)(g,{...b,input:void 0,messages:d.messages},!1);return Array.isArray(e?.input)&&(a.input=e.input),o&&(o.after=h(a)),d}let b=Array.isArray(a.messages)?"messages":Array.isArray(a.input)?"input":null;if(!b)return i(o,`unsupported ${l||"unknown"} request shape`),null;let k=await j(c,a[b],g,n,m,o||{});if(!k)return null;return a[b]=k.messages,o&&(o.after=h(a)),k}catch(a){return i(o,`unexpected error: ${a?.message||String(a)}`),null}}function l(a){if(!a)return null;let b=a.tokens_before||0,c=a.tokens_after||0,d=a.tokens_saved||0,e=b>0?(d/b*100).toFixed(1):"0";return`reported token delta=${d} before=${b}${c?` after=${c}`:""} (${e}%)`.trim()}function m(a){let b=a?.before,c=a?.after;return b&&c?`body=${b.bodyBytes}B→${c.bodyBytes}B messages=${b.messageBytes}B→${c.messageBytes}B`:""}function n(a,b,c=.05){if(!a?.tokens_saved||a.tokens_saved<=0)return!1;let d=b?.before?.bodyBytes||0,e=b?.after?.bodyBytes||0;return!(d<=0)&&!(e<=0)&&e>=d*(1-c)}},71336:(a,b,c)=>{c.d(b,{q7:()=>m});let d="u">typeof process&&process.versions?.node&&!0,e="u">typeof process&&process.env?.ENABLE_REQUEST_LOGS==="true",f=null,g=null,h=null;async function i(){if(d&&e&&!f)try{f=await Promise.resolve().then(c.t.bind(c,29021,23)),h=(g=await Promise.resolve().then(c.t.bind(c,33873,23))).join("u">typeof process&&process.cwd?process.cwd():".","logs")}catch{}}async function j(a,b,c){if(await i(),!f||!h)return null;try{f.existsSync(h)||f.mkdirSync(h,{recursive:!0});let d=function(a=new Date){let b=a=>String(a).padStart(2,"0"),c=a.getFullYear(),d=b(a.getMonth()+1),e=b(a.getDate()),f=b(a.getHours()),g=b(a.getMinutes()),h=b(a.getSeconds()),i=String(a.getMilliseconds()).padStart(3,"0");return`${c}${d}${e}_${f}${g}${h}_${i}`}(),e=(c||"unknown").replace(/[/:]/g,"-"),i=`${a}_${b}_${e}_${d}`,j=g.join(h,i);return f.mkdirSync(j,{recursive:!0}),j}catch(a){return console.log("[LOG] Failed to create log session:",a.message),null}}function k(a,b,c){if(f&&a)try{let d=g.join(a,b);f.writeFileSync(d,JSON.stringify(c,null,2))}catch(a){console.log(`[LOG] Failed to write ${b}:`,a.message)}}function l(a){return a?{...a}:{}}async function m(a,b,c){if(!e)return{sessionPath:null,logClientRawRequest(){},logRawRequest(){},logOpenAIRequest(){},logTargetRequest(){},logProviderResponse(){},appendProviderChunk(){},appendOpenAIChunk(){},logConvertedResponse(){},appendConvertedChunk(){},logError(){}};let d=await j(a,b,c);return{get sessionPath(){return d},logClientRawRequest(a,b,c={}){k(d,"1_req_client.json",{timestamp:new Date().toISOString(),endpoint:a,headers:l(c),body:b})},logRawRequest(a,b={}){k(d,"2_req_source.json",{timestamp:new Date().toISOString(),headers:l(b),body:a})},logOpenAIRequest(a){k(d,"3_req_openai.json",{timestamp:new Date().toISOString(),body:a})},logTargetRequest(a,b,c){k(d,"4_req_target.json",{timestamp:new Date().toISOString(),url:a,headers:l(b),body:c})},logProviderResponse(a,b,c,e){k(d,"5_res_provider.json",{timestamp:new Date().toISOString(),status:a,statusText:b,headers:c?"function"==typeof c.entries?Object.fromEntries(c.entries()):c:{},body:e})},appendProviderChunk(a){if(f&&d)try{let b=g.join(d,"5_res_provider.txt");f.appendFileSync(b,a)}catch(a){}},appendOpenAIChunk(a){if(f&&d)try{let b=g.join(d,"6_res_openai.txt");f.appendFileSync(b,a)}catch(a){}},logConvertedResponse(a){k(d,"7_res_client.json",{timestamp:new Date().toISOString(),body:a})},appendConvertedChunk(a){if(f&&d)try{let b=g.join(d,"7_res_client.txt");f.appendFileSync(b,a)}catch(a){}},logError(a,b=null){k(d,"6_error.json",{timestamp:new Date().toISOString(),error:a?.message||String(a),stack:a?.stack,requestBody:b})}}}},71857:(a,b,c)=>{c.d(b,{i5:()=>o,l2:()=>p,lm:()=>g.lm,v8:()=>h.v8});var d=c(78833),e=c(14170),f=c(47370),g=c(73483),h=c(9024),i=c(30320),j=c(92306);c(78959);let k=new TextEncoder,l="translate",m="passthrough";function n(a={}){let{mode:b=l,targetFormat:c,sourceFormat:o,provider:p=null,reqLogger:q=null,toolNameMap:r=null,model:s=null,connectionId:t=null,body:u=null,onStreamComplete:v=null,apiKey:w=null}=a,x="",y=null,z=new TextDecoder("utf-8",{fatal:!1}),A=b===l?{...(0,d.Ws)(o),provider:p,toolNameMap:r,model:s}:null,B=0,C="",D="",E=null,F=0,G=0,H={},I=null,J=!1,K=!1;return new TransformStream({transform(a,f){E||(E=Date.now());let n=z.decode(a,{stream:!0});x+=n,q?.appendProviderChunk?.(n);let p=x.split("\n");for(let a of(x=p.pop()||"",p)){let n=a.trim();if(j.T&&n&&(F++,n.startsWith("event:"))){let a=n.slice(6).trim();H[a]=(H[a]||0)+1}if(b===l&&c===e.h.OPENAI_RESPONSES&&n.startsWith("event:")&&(I=n.slice(6).trim()),b===m){let b,c=!1;if(n.startsWith("data:")&&"[DONE]"!==n.slice(5).trim())try{let a=JSON.parse(n.slice(5).trim()),d=(0,h.A4)(a),f=!1;if(void 0!==a.choices&&(a.object||(a.object="chat.completion.chunk",f=!0),a.created||(a.created=Math.floor(Date.now()/1e3),f=!0)),void 0!==a.prompt_filter_results&&(delete a.prompt_filter_results,f=!0),a?.choices)for(let b of a.choices)void 0!==b.content_filter_results&&(delete b.content_filter_results,f=!0);if(!(0,h.c2)(a,e.h.OPENAI))continue;let i=a.choices?.[0]?.delta,j=i?.content,k=i?.reasoning_content;j&&"string"==typeof j&&(B+=j.length,C+=j),k&&"string"==typeof k&&(B+=k.length,D+=k);let l=(0,g.f5)(a);l&&(y=l);let m=a.choices?.[0]?.finish_reason;if(m&&!(0,g.Gh)(a.usage)){let d=(0,g.OF)(u,B,e.h.OPENAI);a.usage=(0,g.WL)(d,e.h.OPENAI),b=`data: ${JSON.stringify(a)}
12
12
  `,y=d,c=!0}else if(m&&y){let d=(0,g.O9)(y);a.usage=(0,g.WL)(d,e.h.OPENAI),b=`data: ${JSON.stringify(a)}
13
13
  `,c=!0}else(d||f)&&(b=`data: ${JSON.stringify(a)}
14
- `,c=!0)}catch{}c||(b=a.startsWith("data:")&&!a.startsWith("data: ")?"data: "+a.slice(5)+"\n":a+"\n"),q?.appendConvertedChunk?.(b),f.enqueue(k.encode(b));continue}if(!n)continue;let p=(0,h.tV)(n,c);if(!p)continue;let r=c===e.h.OPENAI_RESPONSES,s=r&&o===e.h.OPENAI_RESPONSES,t=r?(0,i.yx)(I,p):null;if(r&&(0,i.nu)(t,p)&&(J=!0),p&&p.done&&c!==e.h.OLLAMA){if(s&&!J){let a=(0,i.u9)();q?.appendConvertedChunk?.(a),f.enqueue(k.encode(a)),J=!0,G++}let a="data: [DONE]\n\n";q?.appendConvertedChunk?.(a),f.enqueue(k.encode(a)),s&&(K=!0);continue}if(p.delta?.text&&(B+=p.delta.text.length,C+=p.delta.text),p.delta?.thinking&&(B+=p.delta.thinking.length,D+=p.delta.thinking),p.choices?.[0]?.delta?.content&&(B+=p.choices[0].delta.content.length,C+=p.choices[0].delta.content),p.choices?.[0]?.delta?.reasoning_content&&(B+=p.choices[0].delta.reasoning_content.length,D+=p.choices[0].delta.reasoning_content),p.candidates?.[0]?.content?.parts)for(let a of p.candidates[0].content.parts)a.text&&"string"==typeof a.text&&(B+=a.text.length,!0===a.thought?D+=a.text:C+=a.text);let v=(0,g.f5)(p);if(v&&(A.usage=v),s&&t){let a=(0,h.v8)({event:t,data:p},o);q?.appendConvertedChunk?.(a),f.enqueue(k.encode(a)),I=null,G++;continue}I=null;let w=(0,d.Y8)(c,o,p,A);if(w?._openaiIntermediate)for(let a of w._openaiIntermediate){let b=(0,h.v8)(a,e.h.OPENAI);q?.appendOpenAIChunk?.(b)}if(w?.length>0)for(let a of w){if(null==a||!(0,h.c2)(a,o))continue;let b="message_delta"===a.type||a.choices?.[0]?.finish_reason;if(A.finishReason&&b&&!(0,g.Gh)(a.usage)&&B>0){let b=(0,g.OF)(u,B,o);a.usage=(0,g.WL)(b,o),A.usage=b}else if(A.finishReason&&b&&A.usage){let b=(0,g.O9)(A.usage);a.usage=(0,g.WL)(b,o)}let c=(0,h.v8)(a,o);q?.appendConvertedChunk?.(c),f.enqueue(k.encode(c)),G++}}},flush(a){let l=Object.entries(H).map(([a,b])=>`${a}=${b}`).join(",")||"none";(0,j.s)("SSE",`flush | provider=${p} | model=${s} | recvLines=${F} | emitted=${G} | events=[${l}]`),(0,f.uw)(s,p,t,!1);try{let j=z.decode();if(j&&(x+=j),b===m){if(x){let b=x;x.startsWith("data:")&&!x.startsWith("data: ")&&(b="data: "+x.slice(5)),q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b))}!(0,g.Gh)(y)&&B>0&&(y=(0,g.OF)(u,B,e.h.OPENAI)),(0,g.Gh)(y)?(0,g.IF)(p,y,s,t,w):(0,f.E5)({model:s,provider:p,connectionId:t,tokens:null,status:"200 OK"}).catch(()=>{});let b="data: [DONE]\n\n";q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b)),v&&v({content:C,thinking:D},y,E);return}if(x.trim()){let b=(0,h.tV)(x.trim());if(b&&!b.done){let f=(0,d.Y8)(c,o,b,A);if(f?._openaiIntermediate)for(let a of f._openaiIntermediate){let b=(0,h.v8)(a,e.h.OPENAI);q?.appendOpenAIChunk?.(b)}if(f?.length>0)for(let b of f){if(null==b)continue;let c=(0,h.v8)(b,o);q?.appendConvertedChunk?.(c),a.enqueue(k.encode(c))}}}let l=(0,d.Y8)(c,o,null,A);if(l?._openaiIntermediate)for(let a of l._openaiIntermediate){let b=(0,h.v8)(a,e.h.OPENAI);q?.appendOpenAIChunk?.(b)}if(l?.length>0)for(let b of l){if(null==b)continue;let c=(0,h.v8)(b,o);q?.appendConvertedChunk?.(c),a.enqueue(k.encode(c))}let n=c===e.h.OPENAI_RESPONSES&&o===e.h.OPENAI_RESPONSES;if(n&&!J){let b=(0,i.u9)();q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b)),J=!0}if(!n||!K){let b="data: [DONE]\n\n";q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b))}!(0,g.Gh)(A?.usage)&&B>0&&(A.usage=(0,g.OF)(u,B,o)),(0,g.Gh)(A?.usage)?(0,g.IF)(A.provider||c,A.usage,s,t,w):(0,f.E5)({model:s,provider:p,connectionId:t,tokens:null,status:"200 OK"}).catch(()=>{}),v&&v({content:C,thinking:D},A?.usage,E)}catch(a){console.log("Error in flush:",a)}}})}function o(a,b,c=null,d=null,e=null,f=null,g=null,h=null,i=null,j=null){return n({mode:l,targetFormat:a,sourceFormat:b,provider:c,reqLogger:d,toolNameMap:e,model:f,connectionId:g,body:h,onStreamComplete:i,apiKey:j})}function p(a=null,b=null,c=null,d=null,e=null,f=null,g=null){return n({mode:m,provider:a,reqLogger:b,model:c,connectionId:d,body:e,onStreamComplete:f,apiKey:g})}},76083:(a,b,c)=>{c.d(b,{C:()=>h});var d=c(14170),e=c(71301);let f=new Set([d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO]);function g(a){return"string"==typeof a&&(a.startsWith("http://")||a.startsWith("https://"))}async function h(a,b,c,i={}){if(!a||!f.has(c))return 0;let j=function(a,b){let c=[],e=a=>{for(let b of a||[])if(Array.isArray(b.content)){for(let a of b.content)if(a?.type==="image_url"){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;g(b)&&c.push({get:()=>b,set:b=>{"string"==typeof a.image_url?a.image_url=b:a.image_url.url=b}})}}},f=a=>{for(let b of a||[])for(let a of b.parts||[]){let b=a?.fileData?.fileUri;g(b)&&c.push({get:()=>b,part:a})}};switch(b){case d.h.OPENAI:case d.h.OLLAMA:case d.h.KIRO:case d.h.CURSOR:case d.h.COMMANDCODE:e(a.messages);break;case d.h.CLAUDE:for(let b of a.messages||[])if(Array.isArray(b.content))for(let a of b.content)a?.type==="image"&&a.source?.type==="url"&&g(a.source.url)&&c.push({get:()=>a.source.url,claudeBlock:a});break;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:f(a.contents);break;case d.h.ANTIGRAVITY:f(a?.request?.contents);break;default:e(a.messages)}return c}(a,b);if(!j.length)return 0;let k=0;for(let a of j){let b=a.get();if((0,e.W$)(b))continue;let c=await (0,e.ni)(b,i);c&&(a.set?a.set(c.url):a.part?(delete a.part.fileData,a.part.inlineData={mimeType:c.mimeType,data:c.url.split(",")[1]}):a.claudeBlock&&(a.claudeBlock.source={type:"base64",media_type:c.mimeType,data:c.url.split(",")[1]}),k++)}return k}},77256:(a,b,c)=>{c.d(b,{B:()=>D,f:()=>F});let d=["node_modules",".git","target","__pycache__",".next","dist","build",".cache",".turbo",".vercel",".pytest_cache",".mypy_cache",".tox",".venv","venv","env","coverage",".nyc_output",".DS_Store","Thumbs.db",".idea",".vscode",".vs","*.egg-info",".eggs"];function e(a,b=500){let c=[],d="",f=0,g=0,h=!1,i=0,j=0,k=!1;for(let e of a.split("\n")){if(e.startsWith("diff --git")){j>0&&(c.push(` ... (${j} lines truncated)`),k=!0,j=0),d&&(f>0||g>0)&&c.push(` +${f} -${g}`);let a=e.split(" b/");d=a.length>1?a.slice(1).join(" b/"):"unknown",c.push(`
14
+ `,c=!0)}catch{continue}c||(b=a.startsWith("data:")&&!a.startsWith("data: ")?"data: "+a.slice(5)+"\n":a+"\n"),q?.appendConvertedChunk?.(b),f.enqueue(k.encode(b));continue}if(!n)continue;let p=(0,h.tV)(n,c);if(!p)continue;let r=c===e.h.OPENAI_RESPONSES,s=r&&o===e.h.OPENAI_RESPONSES,t=r?(0,i.yx)(I,p):null;if(r&&(0,i.nu)(t,p)&&(J=!0),p&&p.done&&c!==e.h.OLLAMA){if(s&&!J){let a=(0,i.u9)();q?.appendConvertedChunk?.(a),f.enqueue(k.encode(a)),J=!0,G++}K=!0;continue}if(p.delta?.text&&(B+=p.delta.text.length,C+=p.delta.text),p.delta?.thinking&&(B+=p.delta.thinking.length,D+=p.delta.thinking),p.choices?.[0]?.delta?.content&&(B+=p.choices[0].delta.content.length,C+=p.choices[0].delta.content),p.choices?.[0]?.delta?.reasoning_content&&(B+=p.choices[0].delta.reasoning_content.length,D+=p.choices[0].delta.reasoning_content),p.candidates?.[0]?.content?.parts)for(let a of p.candidates[0].content.parts)a.text&&"string"==typeof a.text&&(B+=a.text.length,!0===a.thought?D+=a.text:C+=a.text);let v=(0,g.f5)(p);if(v&&(A.usage=v),s&&t){let a=(0,h.v8)({event:t,data:p},o);q?.appendConvertedChunk?.(a),f.enqueue(k.encode(a)),I=null,G++;continue}I=null;let w=(0,d.Y8)(c,o,p,A);if(w?._openaiIntermediate)for(let a of w._openaiIntermediate){let b=(0,h.v8)(a,e.h.OPENAI);q?.appendOpenAIChunk?.(b)}if(w?.length>0)for(let a of w){if(null==a||!(0,h.c2)(a,o))continue;let b="message_delta"===a.type||a.choices?.[0]?.finish_reason;if(A.finishReason&&b&&!(0,g.Gh)(a.usage)&&B>0){let b=(0,g.OF)(u,B,o);a.usage=(0,g.WL)(b,o),A.usage=b}else if(A.finishReason&&b&&A.usage){let b=(0,g.O9)(A.usage);a.usage=(0,g.WL)(b,o)}let c=(0,h.v8)(a,o);q?.appendConvertedChunk?.(c),f.enqueue(k.encode(c)),G++}}},flush(a){let l=Object.entries(H).map(([a,b])=>`${a}=${b}`).join(",")||"none";(0,j.s)("SSE",`flush | provider=${p} | model=${s} | recvLines=${F} | emitted=${G} | events=[${l}]`),(0,f.uw)(s,p,t,!1);try{let j=z.decode();if(j&&(x+=j),b===m){if(x){let b=x;x.startsWith("data:")&&!x.startsWith("data: ")&&(b="data: "+x.slice(5)),q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b))}if(!(0,g.Gh)(y)&&B>0&&(y=(0,g.OF)(u,B,e.h.OPENAI)),(0,g.Gh)(y)?(0,g.IF)(p,y,s,t,w):(0,f.E5)({model:s,provider:p,connectionId:t,tokens:null,status:"200 OK"}).catch(()=>{}),!K){let b="data: [DONE]\n\n";q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b))}v&&v({content:C,thinking:D},y,E);return}if(x.trim()){let b=(0,h.tV)(x.trim());if(b&&!b.done){let f=(0,d.Y8)(c,o,b,A);if(f?._openaiIntermediate)for(let a of f._openaiIntermediate){let b=(0,h.v8)(a,e.h.OPENAI);q?.appendOpenAIChunk?.(b)}if(f?.length>0)for(let b of f){if(null==b)continue;let c=(0,h.v8)(b,o);q?.appendConvertedChunk?.(c),a.enqueue(k.encode(c))}}}let l=(0,d.Y8)(c,o,null,A);if(l?._openaiIntermediate)for(let a of l._openaiIntermediate){let b=(0,h.v8)(a,e.h.OPENAI);q?.appendOpenAIChunk?.(b)}if(l?.length>0)for(let b of l){if(null==b)continue;let c=(0,h.v8)(b,o);q?.appendConvertedChunk?.(c),a.enqueue(k.encode(c))}if(c===e.h.OPENAI_RESPONSES&&o===e.h.OPENAI_RESPONSES&&!J){let b=(0,i.u9)();q?.appendConvertedChunk?.(b),a.enqueue(k.encode(b)),J=!0}!(0,g.Gh)(A?.usage)&&B>0&&(A.usage=(0,g.OF)(u,B,o)),(0,g.Gh)(A?.usage)?(0,g.IF)(A.provider||c,A.usage,s,t,w):(0,f.E5)({model:s,provider:p,connectionId:t,tokens:null,status:"200 OK"}).catch(()=>{}),v&&v({content:C,thinking:D},A?.usage,E)}catch(a){console.log("Error in flush:",a)}}})}function o(a,b,c=null,d=null,e=null,f=null,g=null,h=null,i=null,j=null){return n({mode:l,targetFormat:a,sourceFormat:b,provider:c,reqLogger:d,toolNameMap:e,model:f,connectionId:g,body:h,onStreamComplete:i,apiKey:j})}function p(a=null,b=null,c=null,d=null,e=null,f=null,g=null){return n({mode:m,provider:a,reqLogger:b,model:c,connectionId:d,body:e,onStreamComplete:f,apiKey:g})}},76083:(a,b,c)=>{c.d(b,{C:()=>h});var d=c(14170),e=c(71301);let f=new Set([d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO]);function g(a){return"string"==typeof a&&(a.startsWith("http://")||a.startsWith("https://"))}async function h(a,b,c,i={}){if(!a||!f.has(c))return 0;let j=function(a,b){let c=[],e=a=>{for(let b of a||[])if(Array.isArray(b.content)){for(let a of b.content)if(a?.type==="image_url"){let b="string"==typeof a.image_url?a.image_url:a.image_url?.url;g(b)&&c.push({get:()=>b,set:b=>{"string"==typeof a.image_url?a.image_url=b:a.image_url.url=b}})}}},f=a=>{for(let b of a||[])for(let a of b.parts||[]){let b=a?.fileData?.fileUri;g(b)&&c.push({get:()=>b,part:a})}};switch(b){case d.h.OPENAI:case d.h.OLLAMA:case d.h.KIRO:case d.h.CURSOR:case d.h.COMMANDCODE:e(a.messages);break;case d.h.CLAUDE:for(let b of a.messages||[])if(Array.isArray(b.content))for(let a of b.content)a?.type==="image"&&a.source?.type==="url"&&g(a.source.url)&&c.push({get:()=>a.source.url,claudeBlock:a});break;case d.h.GEMINI:case d.h.GEMINI_CLI:case d.h.VERTEX:f(a.contents);break;case d.h.ANTIGRAVITY:f(a?.request?.contents);break;default:e(a.messages)}return c}(a,b);if(!j.length)return 0;let k=0;for(let a of j){let b=a.get();if((0,e.W$)(b))continue;let c=await (0,e.ni)(b,i);c&&(a.set?a.set(c.url):a.part?(delete a.part.fileData,a.part.inlineData={mimeType:c.mimeType,data:c.url.split(",")[1]}):a.claudeBlock&&(a.claudeBlock.source={type:"base64",media_type:c.mimeType,data:c.url.split(",")[1]}),k++)}return k}},77256:(a,b,c)=>{c.d(b,{B:()=>D,f:()=>F});let d=["node_modules",".git","target","__pycache__",".next","dist","build",".cache",".turbo",".vercel",".pytest_cache",".mypy_cache",".tox",".venv","venv","env","coverage",".nyc_output",".DS_Store","Thumbs.db",".idea",".vscode",".vs","*.egg-info",".eggs"];function e(a,b=500){let c=[],d="",f=0,g=0,h=!1,i=0,j=0,k=!1;for(let e of a.split("\n")){if(e.startsWith("diff --git")){j>0&&(c.push(` ... (${j} lines truncated)`),k=!0,j=0),d&&(f>0||g>0)&&c.push(` +${f} -${g}`);let a=e.split(" b/");d=a.length>1?a.slice(1).join(" b/"):"unknown",c.push(`
15
15
  ${d}`),f=0,g=0,h=!1,i=0}else e.startsWith("@@")?(j>0&&(c.push(` ... (${j} lines truncated)`),k=!0,j=0),h=!0,i=0,c.push(` ${e}`)):h&&(e.startsWith("+")&&!e.startsWith("+++")?(f+=1,i<100?(c.push(` ${e}`),i+=1):j+=1):e.startsWith("-")&&!e.startsWith("---")?(g+=1,i<100?(c.push(` ${e}`),i+=1):j+=1):i<100&&!e.startsWith("\\")&&i>0&&(c.push(` ${e}`),i+=1));if(c.length>=b){c.push("\n... (more changes truncated)"),k=!0;break}}return j>0&&(c.push(` ... (${j} lines truncated)`),k=!0),d&&(f>0||g>0)&&c.push(` +${f} -${g}`),k&&c.push("[full diff: rtk git diff --no-compact]"),c.join("\n")}function f(a){let b=a.split("\n");if(0===b.length||1===b.length&&!b[0].trim())return"Clean working tree";let c="",d=[],e=[],f=[],g=0,h=0,i=0,j=0;for(let a of b){if(!a.trim())continue;let b=a.match(/^On branch (\S+)/);if(b){c=b[1];continue}if(a.startsWith("##")){c=a.replace(/^##\s*/,"");continue}if(a.length>=3&&/^[ MADRCU?!][ MADRCU?!] /.test(a)){let b=a[0],c=a[1],k=a.slice(3);if("??"===a.slice(0,2)){i++,f.push(k);continue}"MADRC".includes(b)?(g++,d.push(k)):"U"===b&&j++,("M"===c||"D"===c)&&(h++,e.push(k));continue}let k=a.match(/^\s*(modified|new file|deleted|renamed|both modified):\s+(.+)$/);if(k){let a=k[1],b=k[2].trim();"both modified"===a?j++:"modified"===a||"deleted"===a?(h++,e.push(b)):("new file"===a||"renamed"===a)&&(g++,d.push(b));continue}}let k="";if(c&&(k+=`* ${c}
16
16
  `),g>0){for(let a of(k+=`+ Staged: ${g} files
17
17
  `,d.slice(0,10)))k+=` ${a}
@@ -55,4 +55,4 @@ ${e.length} files in ${g.length} dirs:
55
55
  `,b.slice(0,10)))h+=` ${c}
56
56
  `;b.length>10&&(h+=` +${b.length-10}
57
57
  `),h+="\n"}return g.length>20&&(h+=`+${g.length-20} more dirs
58
- `),h.replace(/\n+$/,"")}r.filterName="search-list";let s=/^Result of search in '[^']*' \(total (\d+) files?\):/,t=/^diff --git /m,u=/^@@ /m,v=/^On branch |^nothing to commit|^Changes (not |to be )|^Untracked files:/m,w=/^[ MADRCU?!][ MADRCU?!] \S/m,x=/^(npm (warn|error|ERR!)|yarn (warn|error)|\s*Compiling\s+\S+|\s*Downloading\s+\S+|added \d+ package|\[ERROR\]|BUILD (SUCCESS|FAILED)|\s*Finished\s+|Successfully (installed|built)|ERROR:)/im,y=/[├└]──|│ /,z=/^[-dlbcps][rwx-]{9}/m,A=/^total \d+$/m;function B(a){let b=a.indexOf(":");if(-1===b)return!1;let c=a.indexOf(":",b+1);if(-1===c)return!1;let d=a.slice(b+1,c);return/^\d+$/.test(d)}function C(a){let b=a.trim();return!(0===b.length||b.includes(":"))&&(b.startsWith(".")||b.startsWith("/")||b.includes("/"))}function D(a,b){if(!b||!a)return null;if(a.conversationState){var c=a;let b={bytesBefore:0,bytesAfter:0,hits:[]};try{let a=c.conversationState,d=[...Array.isArray(a?.history)?a.history:[]];for(let c of(a?.currentMessage&&d.push(a.currentMessage),d)){let a=c?.userInputMessage?.userInputMessageContext?.toolResults;if(Array.isArray(a)){for(let c of a)if("error"!==c.status&&Array.isArray(c.content))for(let a of c.content)a&&"string"==typeof a.text&&(a.text=E(a.text,b,"kiro-tool-result"))}}}catch(a){return console.warn("[RTK] compressKiroFormat error:",a.message),null}return b}let d=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(!d)return null;let e={bytesBefore:0,bytesAfter:0,hits:[]};try{for(let a=0;a<d.length;a++){let b=d[a];if(b){if("function_call_output"===b.type){if("string"==typeof b.output)b.output=E(b.output,e,"openai-responses-string");else if(Array.isArray(b.output))for(let a=0;a<b.output.length;a++){let c=b.output[a];c&&"input_text"===c.type&&"string"==typeof c.text&&(c.text=E(c.text,e,"openai-responses-array"))}continue}if("tool"===b.role&&"string"==typeof b.content){b.content=E(b.content,e,"openai-tool");continue}if(Array.isArray(b.content)){if("tool"===b.role){for(let a=0;a<b.content.length;a++){let c=b.content[a];c&&"text"===c.type&&"string"==typeof c.text&&(c.text=E(c.text,e,"openai-tool-array"))}continue}for(let a=0;a<b.content.length;a++){let c=b.content[a];if(c&&"tool_result"===c.type&&!0!==c.is_error){if("string"==typeof c.content)c.content=E(c.content,e,"claude-string");else if(Array.isArray(c.content))for(let a=0;a<c.content.length;a++){let b=c.content[a];b&&"text"===b.type&&"string"==typeof b.text&&(b.text=E(b.text,e,"claude-array"))}}}}}}}catch(a){return console.warn("[RTK] compressMessages error:",a.message),null}return e}function E(a,b,c){let d=a.length;if(b.bytesBefore+=d,d<500||d>0xa00000)return b.bytesAfter+=d,a;let g=function(a){var b,c;let d,g,l=a.length>1024?a.slice(0,1024):a;if(t.test(l)||u.test(l))return e;if(v.test(l))return f;if(x.test(l))return h;if(!((d=l.split("\n").filter(a=>a.trim())).length<3)&&d.filter(a=>w.test(a)).length/d.length>=.6)return f;let D=l.split("\n"),E=D.filter(a=>a.trim().length>0);return E.slice(0,5).some(B)?i:E.length>=3&&E.every(C)?j:y.test(l)?n:A.test(l)||(b=l,g=new RegExp((c=z).source,c.flags.includes("g")?c.flags:c.flags+"g"),(b.match(g)||[]).length>=3)?m:s.test(l)?r:D.length>=250&&function(a){let b=0,c=0;for(let d of a.slice(0,100))0!==d.length&&(c++,q.test(d)&&b++);return!(c<5)&&b/c>=.7}(D)?p:E.length>=5?k:a.split("\n").length>=250?o:null}(a);if(!g)return b.bytesAfter+=d,a;let l=function(a,b){if("function"!=typeof a)return b;try{let c=a(b);if("string"!=typeof c)return b;return c}catch(d){let c=a.filterName||a.name||"anonymous";return console.warn(`[rtk] warning: filter '${c}' panicked — passing through raw output: ${d?.message||d}`),b}}(g,a);return!l||0===l.length||l.length>=d?(b.bytesAfter+=d,a):(b.bytesAfter+=l.length,b.hits.push({shape:c,filter:g.filterName||g.name,saved:d-l.length}),l)}function F(a){if(!a||!a.hits||0===a.hits.length)return null;let b=a.bytesBefore-a.bytesAfter,c=a.bytesBefore>0?(b/a.bytesBefore*100).toFixed(1):"0",d=Array.from(new Set(a.hits.map(a=>a.filter))).join(",");return`[RTK] saved ${b}B / ${a.bytesBefore}B (${c}%) via [${d}] hits=${a.hits.length}`}},81626:(a,b,c)=>{function d(a,b){let c;if(!a.trim())return;let d=a.match(/^event:\s*(.+)$/m),e=a.match(/^data:\s*(.+)$/m);if(!d||!e)return;let f=d[1].trim(),g=e[1].trim();if("[DONE]"!==g){try{c=JSON.parse(g)}catch{return}"response.created"===f?(b.responseId=c.response?.id||b.responseId,b.created=c.response?.created_at||b.created):"response.output_item.done"===f?b.items.set(c.output_index??0,c.item):"response.completed"===f||"response.done"===f?(b.status="completed",c.response?.usage&&(b.usage.input_tokens=c.response.usage.input_tokens||0,b.usage.output_tokens=c.response.usage.output_tokens||0,b.usage.total_tokens=c.response.usage.total_tokens||0)):"response.failed"===f&&(b.status="failed")}}c.d(b,{I:()=>p,F:()=>o});let e={input_tokens:0,output_tokens:0,total_tokens:0};async function f(a){if(!a||"function"!=typeof a.getReader)return{id:`resp_${Date.now()}`,object:"response",created_at:Math.floor(Date.now()/1e3),status:"failed",output:[],usage:{...e}};let b=a.getReader(),c=new TextDecoder,f="",g={responseId:"",created:Math.floor(Date.now()/1e3),status:"in_progress",usage:{...e},items:new Map};try{for(;;){let{done:a,value:e}=await b.read();if(a)break;let h=(f+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(f=h.pop()||"",h))d(a,g)}f.trim()&&d(f,g)}finally{b.releaseLock()}let h=[],i=g.items.size>0?Math.max(...g.items.keys()):-1;for(let a=0;a<=i;a++)h.push(g.items.get(a)||{type:"message",content:[],role:"assistant"});return{id:g.responseId||`resp_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,object:"response",created_at:g.created,status:g.status||"completed",output:h,usage:g.usage}}var g=c(43659),h=c(41004),i=c(14170),j=c(35024),k=c(86171),l=c(47370);let m=a=>j.xq[a]?.format===i.h.OPENAI_RESPONSES;function n(a){if(!a?.content||!Array.isArray(a.content))return"";let b=a.content.find(a=>"output_text"===a.type);if("string"==typeof b?.text)return b.text;let c=a.content.find(a=>"string"==typeof a.text);return"string"==typeof c?.text?c.text:""}function o(a,b){let c=[];for(let b of String(a||"").split("\n")){let a=b.trim();if(!a.startsWith("data:"))continue;let d=a.slice(5).trim();if(d&&"[DONE]"!==d)try{c.push(JSON.parse(d))}catch{}}if(0===c.length)return null;let d=c[0],e=[],f=[],g=new Map,h="stop",i=null;for(let a of c){let b=a?.choices?.[0],c=b?.delta||{};if("string"==typeof c.content&&c.content.length>0&&e.push(c.content),"string"==typeof c.reasoning_content&&c.reasoning_content.length>0&&f.push(c.reasoning_content),b?.finish_reason&&(h=b.finish_reason),a?.usage&&"object"==typeof a.usage&&(i=a.usage),Array.isArray(c.tool_calls))for(let a of c.tool_calls){let b=a.index??0;g.has(b)||g.set(b,{id:a.id||"",type:"function",function:{name:"",arguments:""}});let c=g.get(b);a.id&&(c.id=a.id),a.function?.name&&(c.function.name+=a.function.name),a.function?.arguments&&(c.function.arguments+=a.function.arguments)}}let j={role:"assistant",content:e.join("")||(g.size>0?null:"")};f.length>0&&(j.reasoning_content=f.join("")),g.size>0&&(j.tool_calls=[...g.entries()].sort((a,b)=>a[0]-b[0]).map(([,a])=>a));let k={id:d.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:d.created||Math.floor(Date.now()/1e3),model:d.model||b||"unknown",choices:[{index:0,message:j,finish_reason:h}]};return i&&(k.usage=i),k}async function p({providerResponse:a,sourceFormat:b,provider:c,model:d,body:e,stream:j,translatedBody:q,finalBody:r,requestStartTime:s,connectionId:t,apiKey:u,clientRawRequest:v,onRequestSuccess:w,trackDone:x,appendLog:y}){let z=a.headers.get("content-type")||"";if(!(z.includes("text/event-stream")||""===z&&m(c)))return null;x();let A={provider:c,model:d,connectionId:t,request:(0,k.Fo)(e,j),providerRequest:r||q||null};if(m(c)||b===i.h.OPENAI_RESPONSES)try{let e,g=await f(a.body);w&&await w();let h=g.usage||{};y({tokens:h,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:h,connectionId:t,apiKey:u,endpoint:v?.endpoint});let{msgItem:j,textContent:m}=function(a){if(!Array.isArray(a))return{msgItem:null,textContent:null};let b=a.filter(a=>a?.type==="message");if(0===b.length)return{msgItem:null,textContent:null};for(let a=b.length-1;a>=0;a--){let c=n(b[a]);if(c.length>0)return{msgItem:b[a],textContent:c}}let c=b[b.length-1];return{msgItem:c,textContent:n(c)}}(g.output),o=Date.now()-s;if((0,l.ox)((0,k.$R)({...A,latency:{ttft:o,total:o},tokens:{prompt_tokens:h.input_tokens||0,completion_tokens:h.output_tokens||0},response:{content:m,thinking:null,finish_reason:g.status||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),b===i.h.OPENAI_RESPONSES)return{success:!0,response:new Response(JSON.stringify(g),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})};let p=h.input_tokens||0,q=h.output_tokens||0,r=(g.output||[]).filter(a=>"function_call"===a.type).map((a,b)=>({id:a.call_id||`call_${a.name}_${Date.now()}_${b}`,type:"function",function:{name:a.name,arguments:"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments||{})}})),x=r.length>0;if(b===i.h.ANTIGRAVITY||b===i.h.GEMINI||b===i.h.GEMINI_CLI)e={response:{candidates:[{content:{role:"model",parts:[{text:m||""}]},finishReason:"STOP",index:0}],usageMetadata:{promptTokenCount:p,candidatesTokenCount:q,totalTokenCount:p+q},modelVersion:d,responseId:g.id||`resp_${Date.now()}`}};else{let a={role:"assistant",content:m||(x?null:"")};x&&(a.tool_calls=r);let b="completed"===g.status||"done"===g.status,c=x?"tool_calls":b?"stop":g.status||"stop";e={id:g.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:g.created_at||Math.floor(Date.now()/1e3),model:g.model||d,choices:[{index:0,message:a,finish_reason:c}],usage:{prompt_tokens:p,completion_tokens:q,total_tokens:p+q}}}return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Responses API SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}try{let b=await a.text(),e=o(b,d);if(!e)return(0,g.A1)(h.gx.BAD_GATEWAY,"Invalid SSE response for non-streaming request");w&&await w();let f=e.usage||{};y({tokens:f,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:f,connectionId:t,apiKey:u,endpoint:v?.endpoint});let i=Date.now()-s;if((0,l.ox)((0,k.$R)({...A,latency:{ttft:i,total:i},tokens:f,response:{content:e.choices?.[0]?.message?.content||null,thinking:e.choices?.[0]?.message?.reasoning_content||null,finish_reason:e.choices?.[0]?.finish_reason||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),e?.choices)for(let a of e.choices)a?.message?.reasoning_content&&a.message.content&&delete a.message.reasoning_content;return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Chat Completions SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}}},86171:(a,b,c)=>{c.d(b,{$R:()=>i,Fo:()=>g,MK:()=>h,qr:()=>j});var d=c(47370),e=c(71857);let f=["temperature","top_p","top_k","max_tokens","max_completion_tokens","thinking","reasoning","enable_thinking","presence_penalty","frequency_penalty","seed","stop","tools","tool_choice","response_format","prediction","store","metadata","n","logprobs","top_logprobs","logit_bias","user","parallel_tool_calls"];function g(a,b){let c={messages:a.messages||[],model:a.model,stream:b};for(let b of f)void 0!==a[b]&&(c[b]=a[b]);return c}function h(a){return a&&"object"==typeof a?a.usage?.input_tokens!==void 0?{prompt_tokens:a.usage.input_tokens||0,completion_tokens:a.usage.output_tokens||0,cache_read_input_tokens:a.usage.cache_read_input_tokens,cache_creation_input_tokens:a.usage.cache_creation_input_tokens}:a.usage?.prompt_tokens!==void 0?{prompt_tokens:a.usage.prompt_tokens||0,completion_tokens:a.usage.completion_tokens||0,cached_tokens:a.usage.prompt_tokens_details?.cached_tokens,reasoning_tokens:a.usage.completion_tokens_details?.reasoning_tokens}:a.usageMetadata?{prompt_tokens:a.usageMetadata.promptTokenCount||0,completion_tokens:a.usageMetadata.candidatesTokenCount||0,reasoning_tokens:a.usageMetadata.thoughtsTokenCount}:null:null}function i(a,b={}){return{provider:a.provider||"unknown",model:a.model||"unknown",connectionId:a.connectionId||void 0,timestamp:new Date().toISOString(),latency:a.latency||{ttft:0,total:0},tokens:a.tokens||{prompt_tokens:0,completion_tokens:0},request:a.request,providerRequest:a.providerRequest||null,providerResponse:a.providerResponse||null,response:a.response||{},status:a.status||"success",...b}}function j({provider:a,model:b,tokens:c,connectionId:f,apiKey:g,endpoint:h,label:i="USAGE"}){if(!c||"object"!=typeof c)return;let k=c.input_tokens??c.prompt_tokens??0,l=c.output_tokens??c.completion_tokens??0;if(0===k&&0===l)return;let m=new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),n=f?` | account=${f.slice(0,8)}...`:"";console.log(`${e.lm.green}[${m}] 📊 [${i}] ${a.toUpperCase()} | in=${k} | out=${l}${n}${e.lm.reset}`);let o={prompt_tokens:c.prompt_tokens??c.input_tokens??0,completion_tokens:c.completion_tokens??c.output_tokens??0};(0,d.sZ)({provider:a||"unknown",model:b||"unknown",tokens:o,timestamp:new Date().toISOString(),connectionId:f||void 0,apiKey:g||void 0,endpoint:h||null}).catch(()=>{})}},92500:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{w:()=>H});var e=c(57647),f=c(78833),g=c(14170),h=c(95189),i=c(71857),j=c(59657),k=c(8521),l=c(71336),m=c(45699),n=c(35024),o=c(43659),p=c(41004),q=c(27349),r=c(47370),s=c(55330),t=c(86171),u=c(81626),v=c(5016),w=c(20623),x=c(324),y=c(14724),z=c(60125),A=c(60475),B=c(77256),C=c(70190),D=c(66306),E=c(5263),F=c(76083),G=a([s]);async function H({body:a,modelInfo:b,credentials:c,log:d,onCredentialsRefreshed:G,onRequestSuccess:I,onDisconnect:J,clientRawRequest:K,connectionId:L,userAgent:M,apiKey:N,ccFilterNaming:O,rtkEnabled:P,headroomEnabled:Q,headroomUrl:R,headroomCompressUserMessages:S,cavemanEnabled:T,cavemanLevel:U,ponytailEnabled:V,ponytailLevel:W,sourceFormatOverride:X,providerThinking:Y}){let Z,$,_,aa,ab,ac,{provider:ad,model:ae}=b,af=Date.now(),ag=X||(0,e.Tz)(a),ah=(0,q.c)(a,ae,M,O);if(ah)return ah;let ai=m.Xg[ad]||ad,aj=(0,m.ux)(ai,ae),ak=(0,e.oF)(ad,ag),al=aj||ak?.format||(0,e.jJ)(ad);ak&&c&&(c.runtimeTransport=ak);let am=(0,m.cY)(ai,ae),an=(0,m.kt)(ai,ae);if(Y?.mode&&"auto"!==Y.mode){let b=Y.mode;"on"!==b||a.thinking?"off"!==b||a.thinking?a.reasoning_effort||(a={...a,reasoning_effort:b}):a={...a,thinking:{type:"disabled"}}:(console.log("Injecting provider-level thinking config override: on"),a={...a,thinking:{type:"enabled",budget_tokens:1e4}})}let ao=!0===a.stream||ag===g.h.ANTIGRAVITY||ag===g.h.GEMINI||ag===g.h.GEMINI_CLI,ap=n.xq[ad]?.forceStream===!0,aq=!!ap||!1!==a.stream,ar=(0,m.OA)(ai,ae);("imageGen"===ar||/image|imagen|image-generation/i.test(ae))&&("antigravity"===ad||"gemini-cli"===ad)&&(aq=!1);let as=(0,x.J)(K?.headers||{},a);"deepseek-tui"===as&&!0!==a.stream&&(aq=!1);let at=K?.headers?.accept||"",au=at.includes("application/json"),av=at.includes("text/event-stream");au&&!av&&!0!==a.stream&&(aq=!1);let aw=await (0,l.q7)(ag,al,ae);K&&aw.logClientRawRequest(K.endpoint,K.body,K.headers),aw.logRawRequest(a),d?.debug?.("FORMAT",`${ag} → ${al} | stream=${aq}`);let ax=(0,x.J)(K?.headers||{},a),ay=(0,x.Q)(ax,ad);if(c&&(c.rawHeaders=K?.headers||{}),!ay){let b=(0,D.nl)(ad,ae);(0,E.X)(a,ag,b)&&d?.debug?.("MODALITY",`stripped unsupported media for ${ad}/${ae}`);try{let b=await (0,F.C)(a,ag,al,{signal:void 0});b>0&&d?.debug?.("MODALITY",`prefetched ${b} remote image(s) for ${al}`)}catch(a){d?.warn?.("MODALITY",`image prefetch failed: ${a.message}`)}}if(ay)d?.debug?.("PASSTHROUGH",`${ax} → ${ad} | native lossless`),Z={...a,model:an},"claude"===ax&&(0,h.ui)(Z,an);else{if(!(Z=(0,f.GH)(ag,al,an,a,aq,c,ad,aw,am,L,ax)))return(0,r.uw)(ae,ad,L,!1,!0),(0,o.A1)(p.gx.BAD_REQUEST,`Failed to translate request for ${ag} → ${al}`);$=Z._toolNameMap,delete Z._toolNameMap,Z.model=an}if("claude"===ax&&Array.isArray(Z.tools)){let{tools:a,stripped:b}=(0,y.F)(Z.tools);b.length>0&&(Z.tools=a,d?.debug?.("TOOLDEDUP",`stripped ${b.length}: ${b.slice(0,3).join(", ")}${b.length>3?"...":""}`))}let az=ay?ag:al;"tts"===(0,m.OA)(ai,ae)&&Z.messages&&(Z.messages=Z.messages.filter(a=>"tool"!==a.role),delete Z.tools);let aA=(0,B.B)(Z,P),aB=(0,B.f)(aA);aB&&console.log(aB);let aC=await (0,C.S)(Z,{enabled:Q,url:R,model:an,format:az,compressUserMessages:S}),aD=(0,C.N)(aC);aD&&d?.info?.("HEADROOM",aD),T&&U&&((0,z.p)(Z,az,U),d?.debug?.("CAVEMAN",`${U} | ${az}`)),V&&W&&((0,A.U)(Z,az,W),d?.debug?.("PONYTAIL",`${W} | ${az}`));let aE=(0,s.SB)(ad);(0,r.uw)(ae,ad,L,!0),(0,r.E5)({model:ae,provider:ad,connectionId:L,status:"PENDING"}).catch(()=>{});let aF=Z.messages?.length||Z.input?.length||Z.contents?.length||Z.request?.contents?.length||0;d?.debug?.("REQUEST",`${ad.toUpperCase()} | ${ae} | ${aF} msgs`);let aG=(0,j.jd)({onDisconnect:a=>{(0,r.uw)(ae,ad,L,!1),J&&J(a)},onError:()=>(0,r.uw)(ae,ad,L,!1),log:d,provider:ad,model:ae}),aH={connectionProxyEnabled:c?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:c?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:c?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:c?.providerSpecificData?.vercelRelayUrl||""};if(aH.vercelRelayUrl){let a=c?.connectionName||c?.connectionId||"unknown",b=c?.providerSpecificData?.connectionProxyPoolId||"none";d?.info?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${a} | pool=${b} | vercel-relay=${aH.vercelRelayUrl}`)}else if(aH.connectionProxyEnabled&&aH.connectionProxyUrl){let a=aH.connectionProxyUrl;try{let b=new URL(aH.connectionProxyUrl),c=b.hostname||"",d=b.port?`:${b.port}`:"",e=b.protocol||"http:";a=`${e}//${c}${d}`}catch{}let b=c?.providerSpecificData?.connectionProxyPoolId||"none",e=c?.connectionName||c?.connectionId||"unknown";d?.info?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${e} | pool=${b} | url=${a}`)}if(aH.connectionProxyEnabled&&aH.connectionNoProxy){let a=c?.connectionName||c?.connectionId||"unknown";d?.debug?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${a} | no_proxy=${aH.connectionNoProxy}`)}try{let a=await aE.execute({model:ae,body:Z,stream:aq,credentials:c,signal:aG.signal,log:d,proxyOptions:aH});_=a.response,aa=a.url,ab=a.headers,ac=a.transformedBody,aw.logTargetRequest(aa,ab,ac)}catch(c){if((0,r.uw)(ae,ad,L,!1,!0),(0,r.E5)({model:ae,provider:ad,connectionId:L,status:`FAILED ${"AbortError"===c.name?499:p.gx.BAD_GATEWAY}`}).catch(()=>{}),(0,r.ox)((0,t.$R)({provider:ad,model:ae,connectionId:L,latency:{ttft:0,total:Date.now()-af},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,t.Fo)(a,aq),providerRequest:Z||null,response:{error:c.message||String(c),status:"AbortError"===c.name?499:502,thinking:null},status:"error"})).catch(()=>{}),"AbortError"===c.name)return aG.handleError(c),(0,o.A1)(499,"Request aborted");let b=(0,o.lR)(c,ad,ae,p.gx.BAD_GATEWAY);return console.log(`${i.lm.red}[ERROR] ${b}${i.lm.reset}`),(0,o.A1)(p.gx.BAD_GATEWAY,b)}if(!aE.noAuth&&(_.status===p.gx.UNAUTHORIZED||_.status===p.gx.FORBIDDEN))try{let a=await (0,k.qZ)(()=>aE.refreshCredentials(c,d),3,d);if(a?.accessToken||a?.copilotToken){if(d?.info?.("TOKEN",`${ad.toUpperCase()} | refreshed`),Object.assign(c,a),G)try{await G(a)}catch(a){d?.warn?.("TOKEN",`onCredentialsRefreshed failed: ${a.message}`)}try{let a=await aE.execute({model:ae,body:Z,stream:aq,credentials:c,signal:aG.signal,log:d,proxyOptions:aH});a.response.ok&&(_=a.response,aa=a.url)}catch{d?.warn?.("TOKEN",`${ad.toUpperCase()} | retry after refresh failed`)}}else d?.warn?.("TOKEN",`${ad.toUpperCase()} | refresh failed`)}catch(a){d?.warn?.("TOKEN",`${ad.toUpperCase()} | refresh threw: ${a.message}`)}if(!_.ok){(0,r.uw)(ae,ad,L,!1,!0);let{statusCode:b,message:c,resetsAtMs:d}=await (0,o.zL)(_,aE);(0,r.E5)({model:ae,provider:ad,connectionId:L,status:`FAILED ${b}`}).catch(()=>{}),(0,r.ox)((0,t.$R)({provider:ad,model:ae,connectionId:L,latency:{ttft:0,total:Date.now()-af},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,t.Fo)(a,aq),providerRequest:ac||Z||null,response:{error:c,status:b,thinking:null},status:"error"})).catch(()=>{});let e=(0,o.lR)(Error(c),ad,ae,b);return console.log(`${i.lm.red}[ERROR] ${e}${i.lm.reset}`),aw.logError(Error(c),ac||Z),(0,o.A1)(b,e,d)}let aI={provider:ad,model:ae,body:a,stream:aq,translatedBody:Z,finalBody:ac,requestStartTime:af,connectionId:L,apiKey:N,clientRawRequest:K,onRequestSuccess:I},aJ=a=>(0,r.E5)({model:ae,provider:ad,connectionId:L,...a}).catch(()=>{}),aK=()=>(0,r.uw)(ae,ad,L,!1);if(!ao&&ap){let a=await (0,u.I)({...aI,providerResponse:_,sourceFormat:ag,trackDone:aK,appendLog:aJ});if(a)return aG.handleComplete(),a}if(!aq){let a=await (0,v.N)({...aI,providerResponse:_,sourceFormat:ag,targetFormat:al,reqLogger:aw,toolNameMap:$,trackDone:aK,appendLog:aJ});return aG.handleComplete(),a}let{onStreamComplete:aL}=(0,w.$)({...aI});return(0,w.M)({...aI,providerResponse:_,sourceFormat:ag,targetFormat:al,userAgent:M,reqLogger:aw,toolNameMap:$,streamController:aG,onStreamComplete:aL})}s=(G.then?(await G)():G)[0],d()}catch(a){d(a)}})}};
58
+ `),h.replace(/\n+$/,"")}r.filterName="search-list";let s=/^Result of search in '[^']*' \(total (\d+) files?\):/,t=/^diff --git /m,u=/^@@ /m,v=/^On branch |^nothing to commit|^Changes (not |to be )|^Untracked files:/m,w=/^[ MADRCU?!][ MADRCU?!] \S/m,x=/^(npm (warn|error|ERR!)|yarn (warn|error)|\s*Compiling\s+\S+|\s*Downloading\s+\S+|added \d+ package|\[ERROR\]|BUILD (SUCCESS|FAILED)|\s*Finished\s+|Successfully (installed|built)|ERROR:)/im,y=/[├└]──|│ /,z=/^[-dlbcps][rwx-]{9}/m,A=/^total \d+$/m;function B(a){let b=a.indexOf(":");if(-1===b)return!1;let c=a.indexOf(":",b+1);if(-1===c)return!1;let d=a.slice(b+1,c);return/^\d+$/.test(d)}function C(a){let b=a.trim();return!(0===b.length||b.includes(":"))&&(b.startsWith(".")||b.startsWith("/")||b.includes("/"))}function D(a,b){if(!b||!a)return null;if(a.conversationState){var c=a;let b={bytesBefore:0,bytesAfter:0,hits:[]};try{let a=c.conversationState,d=[...Array.isArray(a?.history)?a.history:[]];for(let c of(a?.currentMessage&&d.push(a.currentMessage),d)){let a=c?.userInputMessage?.userInputMessageContext?.toolResults;if(Array.isArray(a)){for(let c of a)if("error"!==c.status&&Array.isArray(c.content))for(let a of c.content)a&&"string"==typeof a.text&&(a.text=E(a.text,b,"kiro-tool-result"))}}}catch(a){return console.warn("[RTK] compressKiroFormat error:",a.message),null}return b}let d=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(!d)return null;let e={bytesBefore:0,bytesAfter:0,hits:[]};try{for(let a=0;a<d.length;a++){let b=d[a];if(b){if("function_call_output"===b.type){if("string"==typeof b.output)b.output=E(b.output,e,"openai-responses-string");else if(Array.isArray(b.output))for(let a=0;a<b.output.length;a++){let c=b.output[a];c&&"input_text"===c.type&&"string"==typeof c.text&&(c.text=E(c.text,e,"openai-responses-array"))}continue}if("tool"===b.role&&"string"==typeof b.content){b.content=E(b.content,e,"openai-tool");continue}if(Array.isArray(b.content)){if("tool"===b.role){for(let a=0;a<b.content.length;a++){let c=b.content[a];c&&"text"===c.type&&"string"==typeof c.text&&(c.text=E(c.text,e,"openai-tool-array"))}continue}for(let a=0;a<b.content.length;a++){let c=b.content[a];if(c&&"tool_result"===c.type&&!0!==c.is_error){if("string"==typeof c.content)c.content=E(c.content,e,"claude-string");else if(Array.isArray(c.content))for(let a=0;a<c.content.length;a++){let b=c.content[a];b&&"text"===b.type&&"string"==typeof b.text&&(b.text=E(b.text,e,"claude-array"))}}}}}}}catch(a){return console.warn("[RTK] compressMessages error:",a.message),null}return e}function E(a,b,c){let d=a.length;if(b.bytesBefore+=d,d<500||d>0xa00000)return b.bytesAfter+=d,a;let g=function(a){var b,c;let d,g,l=a.length>1024?a.slice(0,1024):a;if(t.test(l)||u.test(l))return e;if(v.test(l))return f;if(x.test(l))return h;if(!((d=l.split("\n").filter(a=>a.trim())).length<3)&&d.filter(a=>w.test(a)).length/d.length>=.6)return f;let D=l.split("\n"),E=D.filter(a=>a.trim().length>0);return E.slice(0,5).some(B)?i:E.length>=3&&E.every(C)?j:y.test(l)?n:A.test(l)||(b=l,g=new RegExp((c=z).source,c.flags.includes("g")?c.flags:c.flags+"g"),(b.match(g)||[]).length>=3)?m:s.test(l)?r:D.length>=250&&function(a){let b=0,c=0;for(let d of a.slice(0,100))0!==d.length&&(c++,q.test(d)&&b++);return!(c<5)&&b/c>=.7}(D)?p:E.length>=5?k:a.split("\n").length>=250?o:null}(a);if(!g)return b.bytesAfter+=d,a;let l=function(a,b){if("function"!=typeof a)return b;try{let c=a(b);if("string"!=typeof c)return b;return c}catch(d){let c=a.filterName||a.name||"anonymous";return console.warn(`[rtk] warning: filter '${c}' panicked — passing through raw output: ${d?.message||d}`),b}}(g,a);return!l||0===l.length||l.length>=d?(b.bytesAfter+=d,a):(b.bytesAfter+=l.length,b.hits.push({shape:c,filter:g.filterName||g.name,saved:d-l.length}),l)}function F(a){if(!a||!a.hits||0===a.hits.length)return null;let b=a.bytesBefore-a.bytesAfter,c=a.bytesBefore>0?(b/a.bytesBefore*100).toFixed(1):"0",d=Array.from(new Set(a.hits.map(a=>a.filter))).join(",");return`[RTK] saved ${b}B / ${a.bytesBefore}B (${c}%) via [${d}] hits=${a.hits.length}`}},81626:(a,b,c)=>{function d(a,b){let c;if(!a.trim())return;let d=a.match(/^event:\s*(.+)$/m),e=a.match(/^data:\s*(.+)$/m);if(!d||!e)return;let f=d[1].trim(),g=e[1].trim();if("[DONE]"!==g){try{c=JSON.parse(g)}catch{return}"response.created"===f?(b.responseId=c.response?.id||b.responseId,b.created=c.response?.created_at||b.created):"response.output_item.done"===f?b.items.set(c.output_index??0,c.item):"response.completed"===f||"response.done"===f?(b.status="completed",c.response?.usage&&(b.usage.input_tokens=c.response.usage.input_tokens||0,b.usage.output_tokens=c.response.usage.output_tokens||0,b.usage.total_tokens=c.response.usage.total_tokens||0)):"response.failed"===f&&(b.status="failed")}}c.d(b,{I:()=>p,F:()=>o});let e={input_tokens:0,output_tokens:0,total_tokens:0};async function f(a){if(!a||"function"!=typeof a.getReader)return{id:`resp_${Date.now()}`,object:"response",created_at:Math.floor(Date.now()/1e3),status:"failed",output:[],usage:{...e}};let b=a.getReader(),c=new TextDecoder,f="",g={responseId:"",created:Math.floor(Date.now()/1e3),status:"in_progress",usage:{...e},items:new Map};try{for(;;){let{done:a,value:e}=await b.read();if(a)break;let h=(f+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(f=h.pop()||"",h))d(a,g)}f.trim()&&d(f,g)}finally{b.releaseLock()}let h=[],i=g.items.size>0?Math.max(...g.items.keys()):-1;for(let a=0;a<=i;a++)h.push(g.items.get(a)||{type:"message",content:[],role:"assistant"});return{id:g.responseId||`resp_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,object:"response",created_at:g.created,status:g.status||"completed",output:h,usage:g.usage}}var g=c(43659),h=c(41004),i=c(14170),j=c(35024),k=c(86171),l=c(47370);let m=a=>j.xq[a]?.format===i.h.OPENAI_RESPONSES;function n(a){if(!a?.content||!Array.isArray(a.content))return"";let b=a.content.find(a=>"output_text"===a.type);if("string"==typeof b?.text)return b.text;let c=a.content.find(a=>"string"==typeof a.text);return"string"==typeof c?.text?c.text:""}function o(a,b){let c=[];for(let b of String(a||"").split("\n")){let a=b.trim();if(!a.startsWith("data:"))continue;let d=a.slice(5).trim();if(d&&"[DONE]"!==d)try{c.push(JSON.parse(d))}catch{}}if(0===c.length)return null;let d=c[0],e=[],f=[],g=new Map,h="stop",i=null;for(let a of c){let b=a?.choices?.[0],c=b?.delta||{};if("string"==typeof c.content&&c.content.length>0&&e.push(c.content),"string"==typeof c.reasoning_content&&c.reasoning_content.length>0&&f.push(c.reasoning_content),b?.finish_reason&&(h=b.finish_reason),a?.usage&&"object"==typeof a.usage&&(i=a.usage),Array.isArray(c.tool_calls))for(let a of c.tool_calls){let b=a.index??0;g.has(b)||g.set(b,{id:a.id||"",type:"function",function:{name:"",arguments:""}});let c=g.get(b);a.id&&(c.id=a.id),a.function?.name&&(c.function.name+=a.function.name),a.function?.arguments&&(c.function.arguments+=a.function.arguments)}}let j={role:"assistant",content:e.join("")||(g.size>0?null:"")};f.length>0&&(j.reasoning_content=f.join("")),g.size>0&&(j.tool_calls=[...g.entries()].sort((a,b)=>a[0]-b[0]).map(([,a])=>a));let k={id:d.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:d.created||Math.floor(Date.now()/1e3),model:d.model||b||"unknown",choices:[{index:0,message:j,finish_reason:h}]};return i&&(k.usage=i),k}async function p({providerResponse:a,sourceFormat:b,provider:c,model:d,body:e,stream:j,translatedBody:q,finalBody:r,requestStartTime:s,connectionId:t,apiKey:u,clientRawRequest:v,onRequestSuccess:w,trackDone:x,appendLog:y}){let z=a.headers.get("content-type")||"";if(!(z.includes("text/event-stream")||""===z&&m(c)))return null;x();let A={provider:c,model:d,connectionId:t,request:(0,k.Fo)(e,j),providerRequest:r||q||null};if(m(c)||b===i.h.OPENAI_RESPONSES)try{let e,g=await f(a.body);w&&await w();let h=g.usage||{};y({tokens:h,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:h,connectionId:t,apiKey:u,endpoint:v?.endpoint});let{msgItem:j,textContent:m}=function(a){if(!Array.isArray(a))return{msgItem:null,textContent:null};let b=a.filter(a=>a?.type==="message");if(0===b.length)return{msgItem:null,textContent:null};for(let a=b.length-1;a>=0;a--){let c=n(b[a]);if(c.length>0)return{msgItem:b[a],textContent:c}}let c=b[b.length-1];return{msgItem:c,textContent:n(c)}}(g.output),o=Date.now()-s;if((0,l.ox)((0,k.$R)({...A,latency:{ttft:o,total:o},tokens:{prompt_tokens:h.input_tokens||0,completion_tokens:h.output_tokens||0},response:{content:m,thinking:null,finish_reason:g.status||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),b===i.h.OPENAI_RESPONSES)return{success:!0,response:new Response(JSON.stringify(g),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})};let p=h.input_tokens||0,q=h.output_tokens||0,r=(g.output||[]).filter(a=>"function_call"===a.type).map((a,b)=>({id:a.call_id||`call_${a.name}_${Date.now()}_${b}`,type:"function",function:{name:a.name,arguments:"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments||{})}})),x=r.length>0;if(b===i.h.ANTIGRAVITY||b===i.h.GEMINI||b===i.h.GEMINI_CLI)e={response:{candidates:[{content:{role:"model",parts:[{text:m||""}]},finishReason:"STOP",index:0}],usageMetadata:{promptTokenCount:p,candidatesTokenCount:q,totalTokenCount:p+q},modelVersion:d,responseId:g.id||`resp_${Date.now()}`}};else{let a={role:"assistant",content:m||(x?null:"")};x&&(a.tool_calls=r);let b="completed"===g.status||"done"===g.status,c=x?"tool_calls":b?"stop":g.status||"stop";e={id:g.id||`chatcmpl-${Date.now()}`,object:"chat.completion",created:g.created_at||Math.floor(Date.now()/1e3),model:g.model||d,choices:[{index:0,message:a,finish_reason:c}],usage:{prompt_tokens:p,completion_tokens:q,total_tokens:p+q}}}return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Responses API SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}try{let b=await a.text(),e=o(b,d);if(!e)return(0,g.A1)(h.gx.BAD_GATEWAY,"Invalid SSE response for non-streaming request");w&&await w();let f=e.usage||{};y({tokens:f,status:"200 OK"}),(0,k.qr)({provider:c,model:d,tokens:f,connectionId:t,apiKey:u,endpoint:v?.endpoint});let i=Date.now()-s;if((0,l.ox)((0,k.$R)({...A,latency:{ttft:i,total:i},tokens:f,response:{content:e.choices?.[0]?.message?.content||null,thinking:e.choices?.[0]?.message?.reasoning_content||null,finish_reason:e.choices?.[0]?.finish_reason||"unknown"},status:"success"},{endpoint:v?.endpoint||null})).catch(()=>{}),e?.choices)for(let a of e.choices)a?.message?.reasoning_content&&a.message.content&&delete a.message.reasoning_content;return{success:!0,response:new Response(JSON.stringify(e),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}catch(a){return console.error("[ChatCore] Chat Completions SSE→JSON failed:",a),(0,g.A1)(h.gx.BAD_GATEWAY,"Failed to convert streaming response to JSON")}}},86171:(a,b,c)=>{c.d(b,{$R:()=>i,Fo:()=>g,MK:()=>h,qr:()=>j});var d=c(47370),e=c(71857);let f=["temperature","top_p","top_k","max_tokens","max_completion_tokens","thinking","reasoning","enable_thinking","presence_penalty","frequency_penalty","seed","stop","tools","tool_choice","response_format","prediction","store","metadata","n","logprobs","top_logprobs","logit_bias","user","parallel_tool_calls"];function g(a,b){let c={messages:a.messages||[],model:a.model,stream:b};for(let b of f)void 0!==a[b]&&(c[b]=a[b]);return c}function h(a){return a&&"object"==typeof a?a.usage?.input_tokens!==void 0?{prompt_tokens:a.usage.input_tokens||0,completion_tokens:a.usage.output_tokens||0,cache_read_input_tokens:a.usage.cache_read_input_tokens,cache_creation_input_tokens:a.usage.cache_creation_input_tokens}:a.usage?.prompt_tokens!==void 0?{prompt_tokens:a.usage.prompt_tokens||0,completion_tokens:a.usage.completion_tokens||0,cached_tokens:a.usage.prompt_tokens_details?.cached_tokens,reasoning_tokens:a.usage.completion_tokens_details?.reasoning_tokens}:a.usageMetadata?{prompt_tokens:a.usageMetadata.promptTokenCount||0,completion_tokens:a.usageMetadata.candidatesTokenCount||0,reasoning_tokens:a.usageMetadata.thoughtsTokenCount}:null:null}function i(a,b={}){return{provider:a.provider||"unknown",model:a.model||"unknown",connectionId:a.connectionId||void 0,timestamp:new Date().toISOString(),latency:a.latency||{ttft:0,total:0},tokens:a.tokens||{prompt_tokens:0,completion_tokens:0},request:a.request,providerRequest:a.providerRequest||null,providerResponse:a.providerResponse||null,response:a.response||{},status:a.status||"success",...b}}function j({provider:a,model:b,tokens:c,connectionId:f,apiKey:g,endpoint:h,label:i="USAGE"}){if(!c||"object"!=typeof c)return;let k=c.input_tokens??c.prompt_tokens??0,l=c.output_tokens??c.completion_tokens??0;if(0===k&&0===l)return;let m=new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),n=f?` | account=${f.slice(0,8)}...`:"";console.log(`${e.lm.green}[${m}] 📊 [${i}] ${a.toUpperCase()} | in=${k} | out=${l}${n}${e.lm.reset}`);let o={prompt_tokens:c.prompt_tokens??c.input_tokens??0,completion_tokens:c.completion_tokens??c.output_tokens??0};(0,d.sZ)({provider:a||"unknown",model:b||"unknown",tokens:o,timestamp:new Date().toISOString(),connectionId:f||void 0,apiKey:g||void 0,endpoint:h||null}).catch(()=>{})}},92500:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{w:()=>H});var e=c(57647),f=c(78833),g=c(14170),h=c(95189),i=c(71857),j=c(59657),k=c(8521),l=c(71336),m=c(45699),n=c(35024),o=c(43659),p=c(41004),q=c(27349),r=c(47370),s=c(55330),t=c(86171),u=c(81626),v=c(5016),w=c(20623),x=c(324),y=c(14724),z=c(60125),A=c(60475),B=c(77256),C=c(70190),D=c(66306),E=c(5263),F=c(76083),G=a([s]);async function H({body:a,modelInfo:b,credentials:c,log:d,onCredentialsRefreshed:G,onRequestSuccess:I,onDisconnect:J,clientRawRequest:K,connectionId:L,userAgent:M,apiKey:N,ccFilterNaming:O,rtkEnabled:P,headroomEnabled:Q,headroomUrl:R,headroomCompressUserMessages:S,cavemanEnabled:T,cavemanLevel:U,ponytailEnabled:V,ponytailLevel:W,sourceFormatOverride:X,providerThinking:Y}){let Z,$,_,aa,ab,ac,{provider:ad,model:ae}=b,af=Date.now(),ag=X||(0,e.Tz)(a),ah=(0,q.c)(a,ae,M,O);if(ah)return ah;let ai=m.Xg[ad]||ad,aj=(0,m.ux)(ai,ae),ak=(0,e.oF)(ad,ag),al=aj||ak?.format||(0,e.jJ)(ad);ak&&c&&(c.runtimeTransport=ak);let am=(0,m.cY)(ai,ae),an=(0,m.kt)(ai,ae);if(Y?.mode&&"auto"!==Y.mode){let b=Y.mode;"on"!==b||a.thinking?"off"!==b||a.thinking?a.reasoning_effort||(a={...a,reasoning_effort:b}):a={...a,thinking:{type:"disabled"}}:(console.log("Injecting provider-level thinking config override: on"),a={...a,thinking:{type:"enabled",budget_tokens:1e4}})}let ao=!0===a.stream||ag===g.h.ANTIGRAVITY||ag===g.h.GEMINI||ag===g.h.GEMINI_CLI,ap=n.xq[ad]?.forceStream===!0,aq=!!ap||!1!==a.stream,ar=(0,m.OA)(ai,ae);("imageGen"===ar||/image|imagen|image-generation/i.test(ae))&&("antigravity"===ad||"gemini-cli"===ad)&&(aq=!1);let as=(0,x.J)(K?.headers||{},a);"deepseek-tui"===as&&!0!==a.stream&&(aq=!1);let at=K?.headers?.accept||"",au=at.includes("application/json"),av=at.includes("text/event-stream");!au||av||!0===a.stream||ap||(aq=!1);let aw=await (0,l.q7)(ag,al,ae);K&&aw.logClientRawRequest(K.endpoint,K.body,K.headers),aw.logRawRequest(a),d?.debug?.("FORMAT",`${ag} → ${al} | stream=${aq}`);let ax=(0,x.J)(K?.headers||{},a),ay=(0,x.Q)(ax,ad);if(c&&(c.rawHeaders=K?.headers||{}),!ay){let b=(0,D.nl)(ad,ae);(0,E.X)(a,ag,b)&&d?.debug?.("MODALITY",`stripped unsupported media for ${ad}/${ae}`);try{let b=await (0,F.C)(a,ag,al,{signal:void 0});b>0&&d?.debug?.("MODALITY",`prefetched ${b} remote image(s) for ${al}`)}catch(a){d?.warn?.("MODALITY",`image prefetch failed: ${a.message}`)}}if(ay)d?.debug?.("PASSTHROUGH",`${ax} → ${ad} | native lossless`),Z={...a,model:an},"claude"===ax&&(0,h.ui)(Z,an);else{if(!(Z=(0,f.GH)(ag,al,an,a,aq,c,ad,aw,am,L,ax)))return(0,r.uw)(ae,ad,L,!1,!0),(0,o.A1)(p.gx.BAD_REQUEST,`Failed to translate request for ${ag} → ${al}`);$=Z._toolNameMap,delete Z._toolNameMap,Z.model=an}if("claude"===ax&&Array.isArray(Z.tools)){let{tools:a,stripped:b}=(0,y.F)(Z.tools);b.length>0&&(Z.tools=a,d?.debug?.("TOOLDEDUP",`stripped ${b.length}: ${b.slice(0,3).join(", ")}${b.length>3?"...":""}`))}let az=ay?ag:al;"tts"===(0,m.OA)(ai,ae)&&Z.messages&&(Z.messages=Z.messages.filter(a=>"tool"!==a.role),delete Z.tools);let aA=(0,B.B)(Z,P),aB=(0,B.f)(aA);aB&&console.log(aB);let aC={},aD=await (0,C.SI)(Z,{enabled:Q,url:R,model:an,format:az,compressUserMessages:S,diagnostics:aC}),aE=(0,C.Nv)(aD),aF=(0,C.O2)(aC);aE?(d?.info?.("HEADROOM",`${aE}${aF?` | ${aF}`:""}`),(0,C.cB)(aD,aC)&&d?.warn?.("HEADROOM",`reported token delta, but outbound JSON shrank <5%; provider may bill near-original payload | ${aF}`)):Q&&d?.warn?.("HEADROOM",`skipped: ${aC.reason||"compression unavailable"}${aC.endpoint?` (${aC.endpoint})`:""}`),T&&U&&((0,z.p)(Z,az,U),d?.debug?.("CAVEMAN",`${U} | ${az}`)),V&&W&&((0,A.U)(Z,az,W),d?.debug?.("PONYTAIL",`${W} | ${az}`));let aG=(0,s.SB)(ad);(0,r.uw)(ae,ad,L,!0),(0,r.E5)({model:ae,provider:ad,connectionId:L,status:"PENDING"}).catch(()=>{});let aH=Z.messages?.length||Z.input?.length||Z.contents?.length||Z.request?.contents?.length||0;d?.debug?.("REQUEST",`${ad.toUpperCase()} | ${ae} | ${aH} msgs`);let aI=(0,j.jd)({onDisconnect:a=>{(0,r.uw)(ae,ad,L,!1),J&&J(a)},onError:()=>(0,r.uw)(ae,ad,L,!1),log:d,provider:ad,model:ae}),aJ={connectionProxyEnabled:c?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:c?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:c?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:c?.providerSpecificData?.vercelRelayUrl||""};if(aJ.vercelRelayUrl){let a=c?.connectionName||c?.connectionId||"unknown",b=c?.providerSpecificData?.connectionProxyPoolId||"none";d?.info?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${a} | pool=${b} | vercel-relay=${aJ.vercelRelayUrl}`)}else if(aJ.connectionProxyEnabled&&aJ.connectionProxyUrl){let a=aJ.connectionProxyUrl;try{let b=new URL(aJ.connectionProxyUrl),c=b.hostname||"",d=b.port?`:${b.port}`:"",e=b.protocol||"http:";a=`${e}//${c}${d}`}catch{}let b=c?.providerSpecificData?.connectionProxyPoolId||"none",e=c?.connectionName||c?.connectionId||"unknown";d?.info?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${e} | pool=${b} | url=${a}`)}if(aJ.connectionProxyEnabled&&aJ.connectionNoProxy){let a=c?.connectionName||c?.connectionId||"unknown";d?.debug?.("PROXY",`${ad.toUpperCase()} | ${ae} | conn=${a} | no_proxy=${aJ.connectionNoProxy}`)}try{let a=await aG.execute({model:ae,body:Z,stream:aq,credentials:c,signal:aI.signal,log:d,proxyOptions:aJ});_=a.response,aa=a.url,ab=a.headers,ac=a.transformedBody,aw.logTargetRequest(aa,ab,ac)}catch(c){if((0,r.uw)(ae,ad,L,!1,!0),(0,r.E5)({model:ae,provider:ad,connectionId:L,status:`FAILED ${"AbortError"===c.name?499:p.gx.BAD_GATEWAY}`}).catch(()=>{}),(0,r.ox)((0,t.$R)({provider:ad,model:ae,connectionId:L,latency:{ttft:0,total:Date.now()-af},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,t.Fo)(a,aq),providerRequest:Z||null,response:{error:c.message||String(c),status:"AbortError"===c.name?499:502,thinking:null},status:"error"})).catch(()=>{}),"AbortError"===c.name)return aI.handleError(c),(0,o.A1)(499,"Request aborted");let b=(0,o.lR)(c,ad,ae,p.gx.BAD_GATEWAY);return console.log(`${i.lm.red}[ERROR] ${b}${i.lm.reset}`),(0,o.A1)(p.gx.BAD_GATEWAY,b)}if(!aG.noAuth&&(_.status===p.gx.UNAUTHORIZED||_.status===p.gx.FORBIDDEN))try{let a=await (0,k.qZ)(()=>aG.refreshCredentials(c,d),3,d);if(a?.accessToken||a?.copilotToken){if(d?.info?.("TOKEN",`${ad.toUpperCase()} | refreshed`),Object.assign(c,a),G)try{await G(a)}catch(a){d?.warn?.("TOKEN",`onCredentialsRefreshed failed: ${a.message}`)}try{let a=await aG.execute({model:ae,body:Z,stream:aq,credentials:c,signal:aI.signal,log:d,proxyOptions:aJ});a.response.ok&&(_=a.response,aa=a.url)}catch{d?.warn?.("TOKEN",`${ad.toUpperCase()} | retry after refresh failed`)}}else d?.warn?.("TOKEN",`${ad.toUpperCase()} | refresh failed`)}catch(a){d?.warn?.("TOKEN",`${ad.toUpperCase()} | refresh threw: ${a.message}`)}if(!_.ok){(0,r.uw)(ae,ad,L,!1,!0);let{statusCode:b,message:c,resetsAtMs:d}=await (0,o.zL)(_,aG);(0,r.E5)({model:ae,provider:ad,connectionId:L,status:`FAILED ${b}`}).catch(()=>{}),(0,r.ox)((0,t.$R)({provider:ad,model:ae,connectionId:L,latency:{ttft:0,total:Date.now()-af},tokens:{prompt_tokens:0,completion_tokens:0},request:(0,t.Fo)(a,aq),providerRequest:ac||Z||null,response:{error:c,status:b,thinking:null},status:"error"})).catch(()=>{});let e=(0,o.lR)(Error(c),ad,ae,b);return console.log(`${i.lm.red}[ERROR] ${e}${i.lm.reset}`),aw.logError(Error(c),ac||Z),(0,o.A1)(b,e,d)}let aK={provider:ad,model:ae,body:a,stream:aq,translatedBody:Z,finalBody:ac,requestStartTime:af,connectionId:L,apiKey:N,clientRawRequest:K,onRequestSuccess:I},aL=a=>(0,r.E5)({model:ae,provider:ad,connectionId:L,...a}).catch(()=>{}),aM=()=>(0,r.uw)(ae,ad,L,!1);if(!ao&&ap){let a=await (0,u.I)({...aK,providerResponse:_,sourceFormat:ag,trackDone:aM,appendLog:aL});if(a)return aI.handleComplete(),a}if(!aq){let a=await (0,v.N)({...aK,providerResponse:_,sourceFormat:ag,targetFormat:al,reqLogger:aw,toolNameMap:$,trackDone:aM,appendLog:aL});return aI.handleComplete(),a}let{onStreamComplete:aN}=(0,w.$)({...aK});return(0,w.M)({...aK,providerResponse:_,sourceFormat:ag,targetFormat:al,userAgent:M,reqLogger:aw,toolNameMap:$,streamController:aI,onStreamComplete:aN})}s=(G.then?(await G)():G)[0],d()}catch(a){d(a)}})}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=9630,exports.ids=[615,9630],exports.modules={7803:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>h,error:()=>k,info:()=>i,maskKey:()=>o,request:()=>l,response:()=>m,stream:()=>n,warn:()=>j});let d={DEBUG:0,INFO:1,WARN:2,ERROR:3},e=d[process.env.LOG_LEVEL?.toUpperCase?.()]??d.INFO;function f(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}function g(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function h(a,b,c){if(e<=d.DEBUG){let d=c?` ${g(c)}`:"";console.log(`[${f()}] 🔍 [${a}] ${b}${d}`)}}function i(a,b,c){if(e<=d.INFO){let d=c?` ${g(c)}`:"";console.log(`[${f()}] ℹ️ [${a}] ${b}${d}`)}}function j(a,b,c){e<=d.WARN&&c&&g(c)}function k(a,b,c){if(e<=d.ERROR){let d=c?` ${g(c)}`:"";console.log(`[${f()}] ❌ [${a}] ${b}${d}`)}}function l(a,b,c){let d=c?` ${g(c)}`:"";console.log(`\x1b[36m[${f()}] 📥 ${a} ${b}${d}\x1b[0m`)}function m(a,b,c){let d=c?` ${g(c)}`:"";console.log(`[${f()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${d}`)}function n(a,b){let c=b?` ${g(b)}`:"";console.log(`[${f()}] 🌊 [STREAM] ${a}${c}`)}function o(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}},38160:(a,b,c)=>{c.d(b,{Ou:()=>i,eG:()=>h});var d=c(75924);let e=new Map,f=new Map,g=null;async function h(a,b){if(!a||!b)return null;let c=e.get(a);if(c&&Date.now()-c.fetchedAt<36e5)return c.projectId;if(f.has(a))return f.get(a).promise;let d=new AbortController,g=(async()=>{try{let c=await j(b,d.signal);if(c)return e.set(a,{projectId:c,fetchedAt:Date.now()}),c;return console.warn("[ProjectId] could not fetch projectId for connection",a.slice(0,8)),null}catch(a){return console.warn(`[ProjectId] Error fetching project ID: ${a.message}`),null}finally{f.delete(a)}})();return f.set(a,{promise:g,controller:d,startedAt:Date.now()}),g}function i(a){e.delete(a)}async function j(a,b){let c=await fetch(d.nZ.loadCodeAssist,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify({metadata:d.zv}),signal:b});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`loadCodeAssist failed: HTTP ${c.status} ${a.slice(0,200)}`)}let e=await c.json(),f=function(a){if(!a)return null;if("string"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.trim();if(b)return b}if(a.cloudaicompanionProject&&"object"==typeof a.cloudaicompanionProject){let b=a.cloudaicompanionProject.id;if("string"==typeof b&&b.trim())return b.trim()}return null}(e);if(f)return f;let g="legacy-tier";if(Array.isArray(e.allowedTiers)){for(let a of e.allowedTiers)if(a&&"object"==typeof a&&!0===a.isDefault&&a.id&&"string"==typeof a.id&&a.id.trim()){g=a.id.trim();break}}return k(a,g,b)}async function k(a,b,c){console.log(`[ProjectId] Onboarding user with tier: ${b}`);let e={tierId:b,metadata:d.zv};for(let b=1;b<=5&&!c?.aborted;b++){let f=new AbortController,g=setTimeout(()=>f.abort(),3e4),h=()=>f.abort();c?.addEventListener("abort",h);try{let c=await fetch(d.nZ.onboardUser,{method:"POST",headers:{...d.Ic,Authorization:`Bearer ${a}`},body:JSON.stringify(e),signal:f.signal});if(clearTimeout(g),!c.ok){let a=await c.text().catch(()=>"");throw Error(`onboardUser HTTP ${c.status}: ${a.slice(0,200)}`)}let h=await c.json();if(!0===h.done){let a=function(a){if(!a?.response)return null;let b=a.response.cloudaicompanionProject;if("string"==typeof b){let a=b.trim();if(a)return a}if(b&&"object"==typeof b){let a=b.id;if("string"==typeof a&&a.trim())return a.trim()}return null}(h);if(a)return console.log(`[ProjectId] Successfully onboarded, project ID: ${a}`),a;throw Error("onboardUser done but no project_id in response")}console.log(`[ProjectId] Onboard attempt ${b}/5: not done yet, waiting...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if(clearTimeout(g),"AbortError"===a.name){if(console.warn(`[ProjectId] onboardUser attempt ${b} aborted (timeout or connection removed)`),c?.aborted)return null;continue}if(5===b)return console.warn(`[ProjectId] onboardUser failed after 5 attempts: ${a.message}`),null;console.warn(`[ProjectId] onboardUser attempt ${b} failed: ${a.message}, retrying...`),await new Promise(a=>setTimeout(a,2e3))}finally{clearTimeout(g),c?.removeEventListener("abort",h)}}return null}g=setInterval(()=>{try{let a=Date.now();for(let[b,c]of e)(!c||a-c.fetchedAt>=36e5)&&e.delete(b);for(let[b,c]of f){if(!c||"number"!=typeof c.startedAt){f.delete(b);continue}if(a-c.startedAt>12e4){try{c.controller.abort()}catch(a){}f.delete(b)}}}catch(a){console.warn("[ProjectId] cleanup sweep error:",a?.message??a)}},6e5),g?.unref?.()},40615:(a,b,c)=>{c.d(b,{AI_PROVIDERS:()=>s,js:()=>w,DI:()=>n,fg:()=>k,Pd:()=>o,IS:()=>h,nJ:()=>i,zN:()=>j,JH:()=>m,jO:()=>y,wb:()=>x,br:()=>l,wG:()=>v,zt:()=>t,gb:()=>q,gC:()=>r,mq:()=>p,rs:()=>u});var d=c(83938);let e="⚠️ Risk Notice: This provider uses a subscription/OAuth session not officially licensed for proxy/router use. Account may be restricted or banned. Use at your own risk.";Object.fromEntries(d.A.filter(a=>a.display).map(a=>{let b;return[a.id,"RISK_NOTICE"===(b=a.display).deprecationNotice?{...b,deprecationNotice:e}:b]}));let f=["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"],g=a=>Object.fromEntries(d.A.filter(b=>b.category===a).map(a=>[a.id,function(a){let b={};for(let c of(a.media&&Object.assign(b,a.media),f))void 0!==a[c]&&(b[c]=a[c]);let c={...a.display||{}};return"RISK_NOTICE"===c.deprecationNotice&&(c.deprecationNotice=e),{...c,id:a.id,alias:a.uiAlias||a.alias,...a.hidden?{hidden:!0}:{},...b,...void 0!==a.priority?{priority:a.priority}:{},...a.hasFree?{hasFree:!0}:{},...a.thinkingConfig?{thinkingConfig:a.thinkingConfig}:{},...a.regions?{regions:a.regions,defaultRegion:a.defaultRegion}:{},...a.hasProviderSpecificData?{hasProviderSpecificData:!0}:{},...a.noAuth?{noAuth:!0}:{},...a.passthroughModels?{passthroughModels:!0}:{},...a.hasOAuth?{hasOAuth:!0}:{},...a.authModes?{authModes:a.authModes}:{},...a.authType?{authType:a.authType}:{},...a.authHint?{authHint:a.authHint}:{}}}(a)])),h=g("free"),i=g("freeTier"),j=g("oauth"),k=g("apikey"),l=g("webCookie"),m="openai-compatible-",n="anthropic-compatible-",o="custom-embedding-";function p(a){return"string"==typeof a&&a.startsWith(m)}function q(a){return"string"==typeof a&&a.startsWith(n)}function r(a){return"string"==typeof a&&a.startsWith(o)}let s={...h,...i,...j,...k,...l};function t(a){for(let b of Object.values(s))if(b.alias===a||b.id===a)return b;return null}function u(a){let b=t(a);return b?.id||a}function v(a){let b=s[a];return b?.alias||a}let w=Object.values(s).reduce((a,b)=>(a[b.alias]=b.id,a),{});Object.values(s).reduce((a,b)=>(a[b.id]=b.alias,a),{});let x=d.A.filter(a=>a.features?.usage).map(a=>a.id),y=d.A.filter(a=>a.features?.usageApikey).map(a=>a.id)},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},67828:(a,b,c)=>{c.d(b,{I9:()=>j,eU:()=>n,vN:()=>m});var d=c(7803),e=c(89718),f=c(38160),g=c(8521),h=c(93943);let i=g.oD,j=(a,b,c)=>(0,g.I9)(a,b,c,d);function k(a){return new Date(Date.now()+1e3*a).toISOString()}function l(a){if(!a)return null;let b=new Date(a);return Number.isFinite(b.getTime())?b.toISOString():null}async function m(a,b){try{let c={};if(b.accessToken&&(c.accessToken=b.accessToken),b.refreshToken&&(c.refreshToken=b.refreshToken),b.idToken&&(c.idToken=b.idToken),b.lastRefreshAt&&(c.lastRefreshAt=b.lastRefreshAt),b.expiresAt&&(c.expiresAt=b.expiresAt),b.expiresIn)c.expiresAt=k(b.expiresIn),c.expiresIn=b.expiresIn;else if(b.expiresAt){let a=l(b.expiresAt);a&&(c.expiresAt=a,c.expiresIn=Math.max(1,Math.floor((new Date(a).getTime()-Date.now())/1e3)))}b.providerSpecificData&&(c.providerSpecificData={...b.existingProviderSpecificData||{},...b.providerSpecificData}),(b.copilotToken||b.copilotTokenExpiresAt)&&(c.providerSpecificData={...c.providerSpecificData||b.existingProviderSpecificData||{},...b.copilotToken?{copilotToken:b.copilotToken}:{},...b.copilotTokenExpiresAt?{copilotTokenExpiresAt:b.copilotTokenExpiresAt}:{}}),b.projectId&&(c.projectId=b.projectId);let f=await (0,e.updateProviderConnection)(a,c);return d.info("TOKEN_REFRESH","Credentials updated in localDb",{connectionId:a,success:!!f}),!!f}catch(b){return d.error("TOKEN_REFRESH","Error updating credentials in localDb",{connectionId:a,error:b.message}),!1}}async function n(a,b){let c={...b};if(!c.connectionId&&c.id&&(c.connectionId=c.id),(0,h.fp)(a,c)){let b=c.expiresAt?new Date(c.expiresAt).getTime():null,e=b?b-Date.now():null,i=(0,g.Og)(a);d.info("TOKEN_REFRESH","Refreshing provider credentials proactively",{provider:a,expiresIn:null===e?null:Math.round(e/1e3),refreshLeadMs:i,lastRefreshAt:c.lastRefreshAt||null});let j=await (0,h.Vq)(a,c,d);if(j?.accessToken||j?.apiKey||j?.copilotToken){let b={...j,existingProviderSpecificData:c.providerSpecificData};await m(c.connectionId,b),function(a,b,c){("antigravity"===a||"gemini-cli"===a)&&b&&c&&((0,f.Ou)(b),(0,f.eG)(b,c).then(a=>{a&&m(b,{projectId:a}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to persist refreshed projectId",{connectionId:b,error:a?.message??a})})}).catch(a=>{d.debug("TOKEN_REFRESH","Failed to fetch projectId after token refresh",{connectionId:b,error:a?.message??a})}))}(a,(c={...c,...j,expiresAt:j.expiresIn?k(j.expiresIn):l(j.expiresAt)||j.expiresAt||c.expiresAt,providerSpecificData:j.providerSpecificData?{...c.providerSpecificData,...j.providerSpecificData}:c.providerSpecificData}).connectionId,c.accessToken)}}if("github"===a){let b=c.providerSpecificData?.copilotToken,e=(c.providerSpecificData?.copilotTokenExpiresAt?1e3*c.providerSpecificData.copilotTokenExpiresAt:0)-Date.now();if(!b||e<i){let f;d.info("TOKEN_REFRESH","Copilot token expiring soon or missing, refreshing proactively",{provider:a,expiresIn:b?Math.round(e/1e3):"missing"});let h=await (f=c.accessToken,(0,g.jR)(f,d));if(h){let a={...c.providerSpecificData,copilotToken:h.token,copilotTokenExpiresAt:h.expiresAt};await m(c.connectionId,{providerSpecificData:a}),c.providerSpecificData=a,c.copilotToken=h.token}}}return c}},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};
@@ -1,3 +1,3 @@
1
- exports.id=9862,exports.ids=[9862],exports.modules={14807:(a,b,c)=>{Promise.resolve().then(c.bind(c,37773))},37773:(a,b,c)=>{"use strict";c.d(b,{default:()=>r});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);c(99258);let j=["zh-CN","zh-TW"],k=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],l=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],m=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}];function n({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:i}){return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(h.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),i]})}function o({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function p({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function q({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}function r({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!0),[E,F]=(0,e.useState)(!0),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!0),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)("http://localhost:8787"),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)({installed:!1,running:!1,python:null,loading:!0}),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(""),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)("full"),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)("full"),[ae,af]=(0,e.useState)("en"),[ag,ah]=(0,e.useState)(!0),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)(""),[ao,ap]=(0,e.useState)(""),[aq,ar]=(0,e.useState)(!1),[as,at]=(0,e.useState)(""),[au,av]=(0,e.useState)(null),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)(!1),[aA,aB]=(0,e.useState)(!1),[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)(""),[aG,aH]=(0,e.useState)(!1),[aI,aJ]=(0,e.useState)(""),[aK,aL]=(0,e.useState)(null),[aM,aN]=(0,e.useState)(""),[aO,aP]=(0,e.useState)(""),[aQ,aR]=(0,e.useState)(null),[aS,aT]=(0,e.useState)(!1),[aU,aV]=(0,e.useState)([]),[aW,aX]=(0,e.useState)(""),[aY,aZ]=(0,e.useState)(!1),[a$,a_]=(0,e.useState)(!1),[a0,a1]=(0,e.useState)(!1),a2=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[a3,a4]=(0,e.useState)(!1),[a5,a6]=(0,e.useState)(!1),[a7,a8]=(0,e.useState)(new Set),[a9,ba]=(0,e.useState)(!1),bb=j.includes(ae)?l:l.filter(a=>!a.wenyan),{copied:bc,copy:bd}=(0,i.C)(),be=!C||!E,bf=C?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let bg=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&H(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},bh=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&B(a)}catch(a){console.log("Error updating requireApiKey:",a)}},bi=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:a})})).ok&&J(a)}catch(a){console.log("Error updating rtkEnabled:",a)}},bj=async a=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.log("Error updating setting:",a)}},bk=async()=>{let a=M.trim()||"http://localhost:8787";N(a),await bj({headroomUrl:a}),bl()},bl=(0,e.useCallback)(async()=>{R(a=>({...a,loading:!0}));try{let a=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),b=await a.json();R({...b,loading:!1})}catch{R({installed:!1,running:!1,python:null,loading:!1})}},[]),bm=(0,e.useCallback)(async()=>{X(""),V(!0);try{let a=await fetch("/api/headroom/start",{method:"POST"}),b=await a.json().catch(()=>({}));if(!a.ok)throw Error(b.error||"Failed to start proxy");await bl()}catch(a){X(a.message)}finally{V(!1)}},[bl]),bn=(0,e.useCallback)(async()=>{V(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await bl()}finally{V(!1)}},[bl]),bo=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},bp=async(...a)=>{ar(!0),at("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return aj(!0),ar(!1),at(""),!0;if((Date.now()-c)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return av({type:"error",message:"Tunnel process stopped unexpectedly."}),ar(!1),at(""),!1}}catch{}}return av({type:"error",message:"Tunnel created but not reachable. Please try again."}),ar(!1),at(""),!1},bq=async()=>{ax(!1),ar(!0),av(null),at("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?at(`Downloading cloudflared... ${c.download.progress}%`):a&&at("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void av({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void av({type:"error",message:"No tunnel URL returned"});an(d),ap(c.publicUrl||""),await bp(c.publicUrl,d)}catch(a){av({type:"error",message:a.message})}finally{a=!1,ar(!1),at("")}},br=async()=>{ar(!0),av(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(aj(!1),an(""),az(!1),av({type:"success",message:"Tunnel disabled"})):av({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){av({type:"error",message:a.message})}finally{ar(!1)}},bs=async()=>{aR(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aR(b.installed),b}}catch{}return aR(!1),{installed:!1}},bt=async()=>{aT(!0),aL(null),aV([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aW})});aX("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aV(a=>[...a.slice(-50),d.message]);else if("done"===c){aR(!0),aT(!1),a_(!1),bx();return}else"error"===c&&aL({type:"error",message:d.error||"Install failed"})}}}catch(a){aL({type:"error",message:a.message})}finally{aT(!1)}},bu=async a=>{aJ("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<3e5;){await new Promise(a=>setTimeout(a,2e3));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},bv=(a,b)=>{aN(a),aP(b)},bw=()=>{aN(""),aP("")},bx=async()=>{a_(!1),aZ(!0),aH(!0),aL(null),aJ("Connecting..."),bw();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aF(b.tunnelUrl||"");let a=await bu(b.tunnelUrl);aB(!0),aL(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){bv(b.authUrl,"Open Login Page"),aJ('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){bw(),aJ("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aF(b.tunnelUrl||"");let a=await bu(b.tunnelUrl);aB(!0),aL(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await by(b.enableUrl):aL({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}bw(),aL({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await by(b.enableUrl);aL({type:"error",message:b.error||"Failed to connect"})}catch(a){aL({type:"error",message:a.message})}finally{aH(!1),aZ(!1),aJ(""),bw()}},by=async a=>{bv(a,"Open Funnel Settings"),aJ('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){bw(),aF(b.tunnelUrl||"");let a=await bu(b.tunnelUrl);aB(!0),aL(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){bw(),aL({type:"error",message:b.error});return}}catch{}}bw(),aL({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bz=async()=>{aH(!0),aL(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(aB(!1),aF(""),a1(!1),aL({type:"success",message:"Tailscale disabled"})):aL({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){aL({type:"error",message:a.message})}finally{aH(!1)}},bA=async()=>{aL(null),aV([]);let a=await bs();a?.installed&&a?.hasCachedPassword?bx():a_(!0)},bB=async()=>{if(u.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:u})}),b=await a.json();a.ok&&(x(b.key),await bo(),v(""),t(!1))}catch(a){console.log("Error creating key:",a)}},bC=async a=>{z({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{z(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),a8(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},bD=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},[bE,bF]=(0,e.useState)("/v1");if(f)return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]});let bG=!!Q.running,bH=!1!==Q.localUrl,bI=!!Q.canStart,bJ=bH&&!!Q.managedPid,bK=Q.loading?"Checking…":bG?"Running":bH&&!Q.installed?"Not installed":bH?"Proxy off":"Unreachable";return(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(n,{label:"Local",url:bE,copyId:"local_url",copied:bc,onCopy:bd}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ai?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),ai&&!aq&&ak?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${ao||am}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>bd(`${ao||am}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===bc?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>az(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ai||aq||ak?aq?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),as||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{ar(!1),at("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):au?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),au.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ax(!0),children:"Enable"})]}):ag?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>ah(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{be?av({type:"error",message:`Security required: ${bf}`}):A?ax(!0):av({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a3?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>az(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${aA?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),aA&&!aG&&aC?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${aE}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>bd(`${aE}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===bc?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>a1(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!aA||aG||aC?aG||aY?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aI||"Connecting..."]}),aM&&(0,d.jsx)(h.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aM,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:aO||"Open"}),(0,d.jsx)("button",{onClick:()=>{aH(!1),aZ(!1),aJ(""),bw()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aK?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aK.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:bA,children:"Enable"})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{be?aL({type:"error",message:`Security required: ${bf}`}):bA()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a5?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>a1(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),be&&!ai&&!aA&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(q,{message:bf,action:{label:"Open settings",href:"/dashboard/profile"}})}),(ai||aA)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!A&&(0,d.jsx)(q,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!C||!E)&&(0,d.jsx)(q,{message:C?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:C?"Change password":"Enable",href:"/dashboard/profile"}})]}),(ai||aA)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(h.lM,{checked:G,onChange:()=>bg(!G)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(p,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(h.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>t(!0),children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(h.lM,{checked:A,onChange:()=>bh(!A)})]}),a9&&!A&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(q,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>t(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,d.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono",children:a7.has(a.id)?a.key:(b=a.key)&&!(b.length<=10)?b.slice(0,6)+"•".repeat(b.length-10)+b.slice(-4):b||""}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.id,void a8(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:a7.has(a.id)?"Hide key":"Show key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a7.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{onClick:()=>bd(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:bc===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(h.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?z({title:"Pause API Key",message:`Pause API key "${a.name}"?
1
+ exports.id=9862,exports.ids=[9862],exports.modules={14807:(a,b,c)=>{Promise.resolve().then(c.bind(c,69232))},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>k,Nv:()=>m,RL:()=>j,ev:()=>l,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>i});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=5,j=1e4,k=5e3,l=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],m=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},69232:(a,b,c)=>{"use strict";c.d(b,{default:()=>o});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377),j=c(67960);function k({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:i}){return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(h.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),i]})}function l({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function m({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function n({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}function o({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(null),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!0),[B,C]=(0,e.useState)(!0),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!0),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(""),[T,U]=(0,e.useState)(null),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(!1),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(""),[ad,ae]=(0,e.useState)(!1),[af,ag]=(0,e.useState)(""),[ah,ai]=(0,e.useState)(null),[aj,ak]=(0,e.useState)(""),[al,am]=(0,e.useState)(""),[an,ao]=(0,e.useState)(null),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)([]),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)(!1),[ax,ay]=(0,e.useState)(!1),[az,aA]=(0,e.useState)(!1),aB=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)(!1),[aG,aH]=(0,e.useState)(new Set),[aI,aJ]=(0,e.useState)(!1),{copied:aK,copy:aL}=(0,i.C)(),aM=!z||!B,aN=z?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=j.t6&&d(!1))},[]);let aO=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&E(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},aP=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&y(a)}catch(a){console.log("Error updating requireApiKey:",a)}},aQ=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},aR=async(...a)=>{Q(!0),S("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<j.Cp;){if(await new Promise(a=>setTimeout(a,j.Hx)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return I(!0),Q(!1),S(""),!0;if((Date.now()-c)%1e4<j.Hx)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return U({type:"error",message:"Tunnel process stopped unexpectedly."}),Q(!1),S(""),!1}}catch{}}return U({type:"error",message:"Tunnel created but not reachable. Please try again."}),Q(!1),S(""),!1},aS=async()=>{W(!1),Q(!0),U(null),S("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?S(`Downloading cloudflared... ${c.download.progress}%`):a&&S("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void U({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void U({type:"error",message:"No tunnel URL returned"});M(d),O(c.publicUrl||""),await aR(c.publicUrl,d)}catch(a){U({type:"error",message:a.message})}finally{a=!1,Q(!1),S("")}},aT=async()=>{Q(!0),U(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(I(!1),M(""),Y(!1),U({type:"success",message:"Tunnel disabled"})):U({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){U({type:"error",message:a.message})}finally{Q(!1)}},aU=async()=>{ao(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return ao(b.installed),b}}catch{}return ao(!1),{installed:!1}},aV=async()=>{aq(!0),ai(null),as([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:at})});au("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)as(a=>[...a.slice(-50),d.message]);else if("done"===c){ao(!0),aq(!1),ay(!1),aZ();return}else"error"===c&&ai({type:"error",message:d.error||"Install failed"})}}}catch(a){ai({type:"error",message:a.message})}finally{aq(!1)}},aW=async a=>{ag("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<j.Cp;){await new Promise(a=>setTimeout(a,j.Hx));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},aX=(a,b)=>{ak(a),am(b)},aY=()=>{ak(""),am("")},aZ=async()=>{ay(!1),aw(!0),ae(!0),ai(null),ag("Connecting..."),aY();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){ac(b.tunnelUrl||"");let a=await aW(b.tunnelUrl);$(!0),ai(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){aX(b.authUrl,"Open Login Page"),ag('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){aY(),ag("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){ac(b.tunnelUrl||"");let a=await aW(b.tunnelUrl);$(!0),ai(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await a$(b.enableUrl):ai({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}aY(),ai({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await a$(b.enableUrl);ai({type:"error",message:b.error||"Failed to connect"})}catch(a){ai({type:"error",message:a.message})}finally{ae(!1),aw(!1),ag(""),aY()}},a$=async a=>{aX(a,"Open Funnel Settings"),ag('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aY(),ac(b.tunnelUrl||"");let a=await aW(b.tunnelUrl);$(!0),ai(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){aY(),ai({type:"error",message:b.error});return}}catch{}}aY(),ai({type:"error",message:"Timed out waiting for Funnel to be enabled."})},a_=async()=>{ae(!0),ai(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?($(!1),ac(""),aA(!1),ai({type:"success",message:"Tailscale disabled"})):ai({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){ai({type:"error",message:a.message})}finally{ae(!1)}},a0=async()=>{ai(null),as([]);let a=await aU();a?.installed&&a?.hasCachedPassword?aZ():ay(!0)},a1=async()=>{if(r.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r})}),b=await a.json();a.ok&&(u(b.key),await aQ(),s(""),q(!1))}catch(a){console.log("Error creating key:",a)}},a2=async a=>{w({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{w(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),aH(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},a3=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},[a4,a5]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(k,{label:"Local",url:a4,copyId:"local_url",copied:aK,onCopy:aL}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${H?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),H&&!P&&J?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${N||L}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aL(`${N||L}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aK?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>Y(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!H||P||J?P?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),R||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{Q(!1),S("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):T?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),T.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>W(!0),children:"Enable"})]}):F?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>G(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{aM?U({type:"error",message:`Security required: ${aN}`}):x?W(!0):U({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aC?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>Y(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${Z?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),Z&&!ad&&_?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${ab}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aL(`${ab}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aK?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aA(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!Z||ad||_?ad||av?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),af||"Connecting..."]}),aj&&(0,d.jsx)(h.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aj,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:al||"Open"}),(0,d.jsx)("button",{onClick:()=>{ae(!1),aw(!1),ag(""),aY()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ah?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ah.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:a0,children:"Enable"})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aM?ai({type:"error",message:`Security required: ${aN}`}):a0()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aE?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aA(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aM&&!H&&!Z&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(n,{message:aN,action:{label:"Open settings",href:"/dashboard/profile"}})}),(H||Z)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!x&&(0,d.jsx)(n,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!z||!B)&&(0,d.jsx)(n,{message:z?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:z?"Change password":"Enable",href:"/dashboard/profile"}})]}),(H||Z)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(h.lM,{checked:D,onChange:()=>aO(!D)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(m,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(h.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>q(!0),children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(h.lM,{checked:x,onChange:()=>aP(!x)})]}),aI&&!x&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(n,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>q(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,d.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono",children:aG.has(a.id)?a.key:(b=a.key)&&!(b.length<=10)?b.slice(0,6)+"•".repeat(b.length-10)+b.slice(-4):b||""}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.id,void aH(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:aG.has(a.id)?"Hide key":"Show key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aG.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{onClick:()=>aL(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aK===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(h.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?w({title:"Pause API Key",message:`Pause API key "${a.name}"?
2
2
 
3
- This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{z(null),bD(a.id,b)}}):bD(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{onClick:()=>bC(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsxs)(h.Zp,{id:"rtk",children:[(0,d.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,d.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,d.jsx)(h.lM,{checked:I,onChange:()=>bi(!I)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between py-4 border-b border-border gap-4 flex-wrap",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,d.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,d.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${bG?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:bK}),(0,d.jsx)("button",{type:"button",onClick:()=>T(!0),className:"text-xs text-primary underline hover:opacity-80",children:bG?"Manage":"Setup"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,d.jsx)(h.lM,{checked:K&&bG,disabled:!bG,onChange:()=>{var a;let b;return a=!K,void(N(b=M.trim()||"http://localhost:8787"),L(a),bj({headroomEnabled:a,headroomUrl:b}))}})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,d.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[Y&&(0,d.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:bb.map(a=>(0,d.jsx)("button",{onClick:()=>{var b;_(b=a.id),bj({cavemanLevel:b})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${$===a.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:a.desc,children:a.label},a.id))}),(0,d.jsx)("p",{className:"text-xs text-primary",children:l.find(a=>a.id===$)?.desc})]}),(0,d.jsx)(h.lM,{checked:Y,onChange:()=>{var a;Z(a=!Y),bj({cavemanEnabled:a})}})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,d.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[aa&&(0,d.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:m.map(a=>(0,d.jsx)("button",{onClick:()=>{var b;ad(b=a.id),bj({ponytailLevel:b})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${ac===a.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:a.desc,children:a.label},a.id))}),(0,d.jsx)("p",{className:"text-xs text-primary",children:m.find(a=>a.id===ac)?.desc})]}),(0,d.jsx)(h.lM,{checked:aa,onChange:()=>{var a;ab(a=!aa),bj({ponytailEnabled:a})}})]})]})]}),(0,d.jsx)(h.aF,{isOpen:s,title:"Create API Key",onClose:()=>{t(!1),v("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Key Name",value:u,onChange:a=>v(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bB,fullWidth:!0,disabled:!u.trim(),children:"Create"}),(0,d.jsx)(h.$n,{onClick:()=>{t(!1),v("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!w,title:"API Key Created",onClose:()=>x(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:w||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===bc?"check":"content_copy",onClick:()=>bd(w,"created_key"),children:"created_key"===bc?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>x(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:aw,title:"Enable Tunnel",onClose:()=>ax(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:k.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bq,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(h.$n,{onClick:()=>ax(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:ay,title:"Disable Tunnel",onClose:()=>!aq&&az(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:br,fullWidth:!0,disabled:aq,variant:"danger",children:aq?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>az(!1),variant:"ghost",fullWidth:!0,disabled:aq,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:a$,title:"Tailscale Funnel",onClose:()=>{aS||(a_(!1),aX(""),aL(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aQ&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aQ&&!aS&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bt,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(h.$n,{onClick:()=>a_(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aS&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aU.length>0&&(0,d.jsx)("div",{ref:a2,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aU.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aQ&&!aS&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>bx(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>a_(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aK&&(0,d.jsx)(o,{status:aK})]})}),(0,d.jsx)(h.aF,{isOpen:a0,title:"Disable Tailscale",onClose:()=>!aG&&a1(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bz,fullWidth:!0,disabled:aG,variant:"danger",children:aG?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>a1(!1),variant:"ghost",fullWidth:!0,disabled:aG,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:S,title:bG?"Headroom":"Setup Headroom",onClose:()=>T(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,d.jsx)("span",{children:"Status"}),(0,d.jsx)("span",{className:bG?"text-success":"text-warning",children:bK})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,d.jsx)(h.pd,{value:M,onChange:a=>N(a.target.value),onBlur:bk,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),bJ?(0,d.jsx)(h.$n,{onClick:bn,variant:"ghost",fullWidth:!0,disabled:U,children:U?"Stopping…":"Stop Headroom"}):bG?(0,d.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):bI?(0,d.jsx)(h.$n,{onClick:bm,fullWidth:!0,disabled:U,children:U?"Starting…":"Start Headroom"}):bH?Q.python?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,d.jsx)(h.$n,{size:"sm",variant:"ghost",onClick:()=>bd('pip install "headroom-ai[proxy]"'),children:bc?"Copied":"Copy"})]})]}):(0,d.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,d.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),W&&(0,d.jsx)("p",{className:"text-sm text-warning",children:W}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>bl(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,d.jsx)(h.$n,{onClick:()=>T(!1),fullWidth:!0,children:"Done"})]})]})}),(0,d.jsx)(h.uo,{isOpen:!!y,onClose:()=>z(null),onConfirm:y?.onConfirm,title:y?.title||"Confirm",message:y?.message,variant:"danger"})]})}r.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},77855:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}}};
3
+ This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{w(null),a3(a.id,b)}}):a3(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{onClick:()=>a2(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsx)(h.aF,{isOpen:p,title:"Create API Key",onClose:()=>{q(!1),s("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Key Name",value:r,onChange:a=>s(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a1,fullWidth:!0,disabled:!r.trim(),children:"Create"}),(0,d.jsx)(h.$n,{onClick:()=>{q(!1),s("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!t,title:"API Key Created",onClose:()=>u(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:t||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===aK?"check":"content_copy",onClick:()=>aL(t,"created_key"),children:"created_key"===aK?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>u(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:V,title:"Enable Tunnel",onClose:()=>W(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:j.oX.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:aS,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(h.$n,{onClick:()=>W(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:X,title:"Disable Tunnel",onClose:()=>!P&&Y(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:aT,fullWidth:!0,disabled:P,variant:"danger",children:P?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>Y(!1),variant:"ghost",fullWidth:!0,disabled:P,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:ax,title:"Tailscale Funnel",onClose:()=>{ap||(ay(!1),au(""),ai(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===an&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===an&&!ap&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:aV,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(h.$n,{onClick:()=>ay(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ap&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),ar.length>0&&(0,d.jsx)("div",{ref:aB,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:ar.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===an&&!ap&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>aZ(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>ay(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ah&&(0,d.jsx)(l,{status:ah})]})}),(0,d.jsx)(h.aF,{isOpen:az,title:"Disable Tailscale",onClose:()=>!ad&&aA(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a_,fullWidth:!0,disabled:ad,variant:"danger",children:ad?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>aA(!1),variant:"ghost",fullWidth:!0,disabled:ad,children:"Cancel"})]})]})}),(0,d.jsx)(h.uo,{isOpen:!!v,onClose:()=>w(null),onConfirm:v?.onConfirm,title:v?.title||"Confirm",message:v?.message,variant:"danger"})]})}o.propTypes={machineId:g().string.isRequired}},77855:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}}};
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/7ERwXV9BRTXKMZpkA8svs/_buildManifest.js","static/7ERwXV9BRTXKMZpkA8svs/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-f482ccef6733ebcc.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-123fdf632563f469.js","static/chunks/main-app-8803a230dfc5c361.js"],rootMainFilesTree:{},pages:{"/_app":[]}};
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:["static/AH3ddxF9BbbDDIRNE6r7m/_buildManifest.js","static/AH3ddxF9BbbDDIRNE6r7m/_ssgManifest.js"],rootMainFiles:["static/chunks/webpack-f482ccef6733ebcc.js","static/chunks/4bd1b696-e356ca5ba0218e27.js","static/chunks/3794-123fdf632563f469.js","static/chunks/main-app-8803a230dfc5c361.js"],rootMainFilesTree:{},pages:{"/_app":[]}};