@techysy/10router 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1110) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +57 -0
  3. package/README.zh-CN.md +49 -0
  4. package/app/.next-cli-build/BUILD_ID +1 -1
  5. package/app/.next-cli-build/app-path-routes-manifest.json +9 -7
  6. package/app/.next-cli-build/build-manifest.json +3 -3
  7. package/app/.next-cli-build/prerender-manifest.json +51 -23
  8. package/app/.next-cli-build/react-loadable-manifest.json +1 -1
  9. package/app/.next-cli-build/routes-manifest.json +12 -0
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js +1 -0
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js.nft.json +1 -0
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page_client-reference-manifest.js +1 -0
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +5 -5
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  82. package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
  83. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  85. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  86. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  87. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  90. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  91. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  94. package/app/.next-cli-build/server/app/_not-found.rsc +18 -17
  95. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +18 -17
  96. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +10 -9
  97. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +3 -3
  98. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +2 -2
  111. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +2 -2
  123. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  141. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  157. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/keys/rotate/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/keys/rotate/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +2 -2
  189. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  191. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  195. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/caps/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/caps/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/network/egress-region/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/network/egress-region/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
  263. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  297. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  299. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  303. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  305. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  307. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  309. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  311. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  313. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  315. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  317. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  319. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/security/status/route.js +1 -0
  321. package/app/.next-cli-build/server/app/api/security/status/route.js.nft.json +1 -0
  322. package/app/.next-cli-build/server/app/api/security/status/route_client-reference-manifest.js +1 -0
  323. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  398. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  416. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  430. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  438. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  440. package/app/.next-cli-build/server/app/callback.html +1 -1
  441. package/app/.next-cli-build/server/app/callback.rsc +22 -21
  442. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +22 -21
  443. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +3 -3
  444. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +10 -9
  445. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +20 -19
  447. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +12 -11
  448. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +20 -19
  449. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +3 -3
  450. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +21 -20
  452. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +12 -11
  453. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +21 -20
  454. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +3 -3
  455. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/combos.rsc +23 -22
  457. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +12 -11
  458. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +23 -22
  459. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +3 -3
  460. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  461. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +21 -20
  462. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +12 -11
  463. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +21 -20
  464. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +3 -3
  465. package/app/.next-cli-build/server/app/dashboard/experimental.html +1 -0
  466. package/app/.next-cli-build/server/app/dashboard/experimental.meta +36 -0
  467. package/app/.next-cli-build/server/app/dashboard/experimental.rsc +23 -0
  468. package/app/.next-cli-build/server/app/dashboard/experimental.segments/!KGRhc2hib2FyZCk/dashboard/experimental/__PAGE__.segment.rsc +31 -0
  469. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_full.segment.rsc +23 -0
  470. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_tree.segment.rsc +3 -0
  471. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +23 -22
  473. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +12 -11
  474. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +23 -22
  475. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +3 -3
  476. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +20 -19
  478. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +12 -11
  479. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +20 -19
  480. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +3 -3
  481. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/profile.rsc +23 -22
  483. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +12 -11
  484. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +23 -22
  485. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +3 -3
  486. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +23 -22
  488. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +12 -11
  489. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +23 -22
  490. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +3 -3
  491. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/providers.rsc +23 -22
  493. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +12 -11
  494. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +23 -22
  495. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +3 -3
  496. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +23 -22
  498. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +12 -11
  499. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +23 -22
  500. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +3 -3
  501. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +20 -19
  503. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +12 -11
  504. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +20 -19
  505. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +3 -3
  506. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  507. package/app/.next-cli-build/server/app/dashboard/quota.rsc +21 -20
  508. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +13 -12
  509. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +21 -20
  510. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +3 -3
  511. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +22 -21
  516. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +22 -21
  517. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +3 -3
  518. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +11 -10
  519. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/skills.rsc +23 -22
  521. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +12 -11
  522. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +23 -22
  523. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +3 -3
  524. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +20 -19
  526. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +12 -11
  527. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +20 -19
  528. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +3 -3
  529. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  530. package/app/.next-cli-build/server/app/dashboard/translator.rsc +23 -22
  531. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +12 -11
  532. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +23 -22
  533. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +3 -3
  534. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/usage.rsc +23 -22
  536. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +12 -11
  537. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +23 -22
  538. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +3 -3
  539. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  540. package/app/.next-cli-build/server/app/dashboard.rsc +21 -20
  541. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +12 -11
  542. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +21 -20
  543. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +3 -3
  544. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  545. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  546. package/app/.next-cli-build/server/app/index.html +1 -1
  547. package/app/.next-cli-build/server/app/index.rsc +17 -16
  548. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +10 -9
  549. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +17 -16
  550. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +3 -3
  551. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  552. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  553. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  554. package/app/.next-cli-build/server/app/landing.html +1 -1
  555. package/app/.next-cli-build/server/app/landing.rsc +22 -21
  556. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +22 -21
  557. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +3 -3
  558. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +11 -10
  559. package/app/.next-cli-build/server/app/login/page.js +1 -1
  560. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  561. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  562. package/app/.next-cli-build/server/app/login.html +1 -1
  563. package/app/.next-cli-build/server/app/login.rsc +22 -21
  564. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +22 -21
  565. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +3 -3
  566. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +11 -10
  567. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  568. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  569. package/app/.next-cli-build/server/app/page.js +1 -1
  570. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  571. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  572. package/app/.next-cli-build/server/app-paths-manifest.json +9 -7
  573. package/app/.next-cli-build/server/chunks/112.js +1 -0
  574. package/app/.next-cli-build/server/chunks/1330.js +1 -0
  575. package/app/.next-cli-build/server/chunks/2112.js +1 -1
  576. package/app/.next-cli-build/server/chunks/2120.js +1 -1
  577. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  578. package/app/.next-cli-build/server/chunks/2179.js +1 -1
  579. package/app/.next-cli-build/server/chunks/271.js +1 -0
  580. package/app/.next-cli-build/server/chunks/2812.js +2 -0
  581. package/app/.next-cli-build/server/chunks/3593.js +1 -1
  582. package/app/.next-cli-build/server/chunks/3651.js +3 -3
  583. package/app/.next-cli-build/server/chunks/4037.js +1 -1
  584. package/app/.next-cli-build/server/chunks/4123.js +2 -2
  585. package/app/.next-cli-build/server/chunks/4125.js +1 -1
  586. package/app/.next-cli-build/server/chunks/4126.js +1 -0
  587. package/app/.next-cli-build/server/chunks/4739.js +1 -1
  588. package/app/.next-cli-build/server/chunks/4780.js +1 -1
  589. package/app/.next-cli-build/server/chunks/4990.js +9 -0
  590. package/app/.next-cli-build/server/chunks/507.js +1 -1
  591. package/app/.next-cli-build/server/chunks/5258.js +2 -2
  592. package/app/.next-cli-build/server/chunks/5330.js +4 -4
  593. package/app/.next-cli-build/server/chunks/5485.js +1 -1
  594. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  595. package/app/.next-cli-build/server/chunks/5781.js +2 -2
  596. package/app/.next-cli-build/server/chunks/6051.js +1 -0
  597. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  598. package/app/.next-cli-build/server/chunks/615.js +1 -1
  599. package/app/.next-cli-build/server/chunks/6212.js +1 -1
  600. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  601. package/app/.next-cli-build/server/chunks/6326.js +1 -1
  602. package/app/.next-cli-build/server/chunks/6520.js +1 -1
  603. package/app/.next-cli-build/server/chunks/653.js +1 -1
  604. package/app/.next-cli-build/server/chunks/6756.js +1 -1
  605. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  606. package/app/.next-cli-build/server/chunks/6871.js +1 -1
  607. package/app/.next-cli-build/server/chunks/6960.js +2 -2
  608. package/app/.next-cli-build/server/chunks/698.js +1 -1
  609. package/app/.next-cli-build/server/chunks/6982.js +1 -0
  610. package/app/.next-cli-build/server/chunks/7067.js +1 -1
  611. package/app/.next-cli-build/server/chunks/7122.js +1 -1
  612. package/app/.next-cli-build/server/chunks/7180.js +1 -1
  613. package/app/.next-cli-build/server/chunks/7239.js +4 -4
  614. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  615. package/app/.next-cli-build/server/chunks/7274.js +8 -8
  616. package/app/.next-cli-build/server/chunks/7322.js +1 -1
  617. package/app/.next-cli-build/server/chunks/7365.js +1 -0
  618. package/app/.next-cli-build/server/chunks/75.js +1 -0
  619. package/app/.next-cli-build/server/chunks/7965.js +1 -1
  620. package/app/.next-cli-build/server/chunks/808.js +1 -1
  621. package/app/.next-cli-build/server/chunks/8145.js +1 -1
  622. package/app/.next-cli-build/server/chunks/8410.js +1 -1
  623. package/app/.next-cli-build/server/chunks/8499.js +2 -2
  624. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  625. package/app/.next-cli-build/server/chunks/8546.js +1 -1
  626. package/app/.next-cli-build/server/chunks/8635.js +2 -2
  627. package/app/.next-cli-build/server/chunks/869.js +1 -1
  628. package/app/.next-cli-build/server/chunks/8895.js +10 -7
  629. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  630. package/app/.next-cli-build/server/chunks/9539.js +9 -0
  631. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  632. package/app/.next-cli-build/server/chunks/9896.js +1 -1
  633. package/app/.next-cli-build/server/chunks/9927.js +1 -1
  634. package/app/.next-cli-build/server/instrumentation.js +1 -1
  635. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  636. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  637. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  638. package/app/.next-cli-build/server/middleware.js +8 -8
  639. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  640. package/app/.next-cli-build/server/pages/404.html +1 -1
  641. package/app/.next-cli-build/server/pages/500.html +1 -1
  642. package/app/.next-cli-build/server/prefetch-hints.json +24 -0
  643. package/app/.next-cli-build/static/chunks/1243-d0e0b9458266e912.js +3 -0
  644. package/app/.next-cli-build/static/chunks/1321-23084daf91733d47.js +1 -0
  645. package/app/.next-cli-build/static/chunks/{3346-0ae97d50d86ac1f7.js → 3346-509e8dd58ea4832d.js} +7 -7
  646. package/app/.next-cli-build/static/chunks/{3521.3c9be8ed83af460d.js → 3521.3107c4bff48fe566.js} +1 -1
  647. package/app/.next-cli-build/static/chunks/5497-d050b53817def025.js +7 -0
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-fa4ba47a6bf0da15.js +1 -0
  649. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/experimental/page-4dd5e46a2d6f4486.js +1 -0
  650. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-9ca09f92fcb7be9f.js +59 -0
  651. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-9a471accf206ea43.js +1 -0
  652. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-a2510813ebd64f72.js +1 -0
  653. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-48878e82a437e813.js +1 -0
  654. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-18da0e8d40af56ac.js +14 -0
  655. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-9ec9a9251e22a7c8.js +1 -0
  656. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-e84b8de5542a9dc9.js +1 -0
  657. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-f62700ce9aa54572.js +1 -0
  658. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-7833d8a884ba922a.js +1 -0
  659. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-158175db070fe14c.js → layout-434f2e27f8b21ae1.js} +1 -1
  660. package/app/.next-cli-build/static/chunks/app/_global-error/page-45a30f9960975021.js +1 -0
  661. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-45a30f9960975021.js +1 -0
  662. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-45a30f9960975021.js +1 -0
  663. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-45a30f9960975021.js +1 -0
  664. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-45a30f9960975021.js +1 -0
  665. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-45a30f9960975021.js +1 -0
  666. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-45a30f9960975021.js +1 -0
  667. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-45a30f9960975021.js +1 -0
  668. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-45a30f9960975021.js +1 -0
  669. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-45a30f9960975021.js +1 -0
  670. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-45a30f9960975021.js +1 -0
  671. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-45a30f9960975021.js +1 -0
  672. package/app/.next-cli-build/static/chunks/app/api/auth/verify-password/route-45a30f9960975021.js +1 -0
  673. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-45a30f9960975021.js +1 -0
  674. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-45a30f9960975021.js +1 -0
  675. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-45a30f9960975021.js +1 -0
  676. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-45a30f9960975021.js +1 -0
  677. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-45a30f9960975021.js +1 -0
  678. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-45a30f9960975021.js +1 -0
  679. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-45a30f9960975021.js +1 -0
  680. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-45a30f9960975021.js +1 -0
  681. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-45a30f9960975021.js +1 -0
  682. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-45a30f9960975021.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-45a30f9960975021.js +1 -0
  684. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-45a30f9960975021.js +1 -0
  685. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-45a30f9960975021.js +1 -0
  686. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-45a30f9960975021.js +1 -0
  687. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-45a30f9960975021.js +1 -0
  688. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-45a30f9960975021.js +1 -0
  689. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-45a30f9960975021.js +1 -0
  690. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-45a30f9960975021.js +1 -0
  691. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-45a30f9960975021.js +1 -0
  692. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-45a30f9960975021.js +1 -0
  693. package/app/.next-cli-build/static/chunks/app/api/combos/route-45a30f9960975021.js +1 -0
  694. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-45a30f9960975021.js +1 -0
  695. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-45a30f9960975021.js +1 -0
  696. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-45a30f9960975021.js +1 -0
  697. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-45a30f9960975021.js +1 -0
  698. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-45a30f9960975021.js +1 -0
  699. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-45a30f9960975021.js +1 -0
  700. package/app/.next-cli-build/static/chunks/app/api/health/route-45a30f9960975021.js +1 -0
  701. package/app/.next-cli-build/static/chunks/app/api/init/route-45a30f9960975021.js +1 -0
  702. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-45a30f9960975021.js +1 -0
  703. package/app/.next-cli-build/static/chunks/app/api/keys/rotate/route-45a30f9960975021.js +1 -0
  704. package/app/.next-cli-build/static/chunks/app/api/keys/route-45a30f9960975021.js +1 -0
  705. package/app/.next-cli-build/static/chunks/app/api/locale/route-45a30f9960975021.js +1 -0
  706. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-45a30f9960975021.js +1 -0
  707. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-45a30f9960975021.js +1 -0
  708. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-45a30f9960975021.js +1 -0
  709. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-45a30f9960975021.js +1 -0
  710. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-45a30f9960975021.js +1 -0
  711. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-45a30f9960975021.js +1 -0
  712. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-45a30f9960975021.js +1 -0
  713. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-45a30f9960975021.js +1 -0
  714. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-45a30f9960975021.js +1 -0
  715. package/app/.next-cli-build/static/chunks/app/api/models/caps/route-45a30f9960975021.js +1 -0
  716. package/app/.next-cli-build/static/chunks/app/api/models/custom/bulk/route-45a30f9960975021.js +1 -0
  717. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-45a30f9960975021.js +1 -0
  718. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-45a30f9960975021.js +1 -0
  719. package/app/.next-cli-build/static/chunks/app/api/models/route-45a30f9960975021.js +1 -0
  720. package/app/.next-cli-build/static/chunks/app/api/models/test/route-45a30f9960975021.js +1 -0
  721. package/app/.next-cli-build/static/chunks/app/api/network/egress-region/route-45a30f9960975021.js +1 -0
  722. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-45a30f9960975021.js +1 -0
  723. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-45a30f9960975021.js +1 -0
  724. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/checkin/route-45a30f9960975021.js +1 -0
  725. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/export/route-45a30f9960975021.js +1 -0
  726. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-45a30f9960975021.js +1 -0
  727. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-45a30f9960975021.js +1 -0
  728. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-45a30f9960975021.js +1 -0
  729. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-45a30f9960975021.js +1 -0
  730. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-45a30f9960975021.js +1 -0
  731. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-45a30f9960975021.js +1 -0
  732. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-45a30f9960975021.js +1 -0
  733. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-45a30f9960975021.js +1 -0
  734. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-45a30f9960975021.js +1 -0
  735. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-45a30f9960975021.js +1 -0
  736. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-45a30f9960975021.js +1 -0
  737. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-45a30f9960975021.js +1 -0
  738. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder/checkin/route-45a30f9960975021.js +1 -0
  739. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder-cn/checkin/route-45a30f9960975021.js +1 -0
  740. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/export/route-45a30f9960975021.js +1 -0
  741. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/import/route-45a30f9960975021.js +1 -0
  742. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-45a30f9960975021.js +1 -0
  743. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-45a30f9960975021.js +1 -0
  744. package/app/.next-cli-build/static/chunks/app/api/pricing/route-45a30f9960975021.js +1 -0
  745. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-45a30f9960975021.js +1 -0
  746. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-45a30f9960975021.js +1 -0
  747. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-45a30f9960975021.js +1 -0
  748. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-45a30f9960975021.js +1 -0
  749. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-45a30f9960975021.js +1 -0
  750. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-45a30f9960975021.js +1 -0
  751. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-45a30f9960975021.js +1 -0
  752. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-45a30f9960975021.js +1 -0
  753. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-45a30f9960975021.js +1 -0
  754. package/app/.next-cli-build/static/chunks/app/api/providers/route-45a30f9960975021.js +1 -0
  755. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-45a30f9960975021.js +1 -0
  756. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-45a30f9960975021.js +1 -0
  757. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-45a30f9960975021.js +1 -0
  758. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-45a30f9960975021.js +1 -0
  759. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-45a30f9960975021.js +1 -0
  760. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-45a30f9960975021.js +1 -0
  761. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-45a30f9960975021.js +1 -0
  762. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-45a30f9960975021.js +1 -0
  763. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-45a30f9960975021.js +1 -0
  764. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-45a30f9960975021.js +1 -0
  765. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-45a30f9960975021.js +1 -0
  766. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-45a30f9960975021.js +1 -0
  767. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-45a30f9960975021.js +1 -0
  768. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-45a30f9960975021.js +1 -0
  769. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-45a30f9960975021.js +1 -0
  770. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-45a30f9960975021.js +1 -0
  771. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-45a30f9960975021.js +1 -0
  772. package/app/.next-cli-build/static/chunks/app/api/security/status/route-45a30f9960975021.js +1 -0
  773. package/app/.next-cli-build/static/chunks/app/api/settings/database/import-usage/route-45a30f9960975021.js +1 -0
  774. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-45a30f9960975021.js +1 -0
  775. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-45a30f9960975021.js +1 -0
  776. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-45a30f9960975021.js +1 -0
  777. package/app/.next-cli-build/static/chunks/app/api/settings/route-45a30f9960975021.js +1 -0
  778. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-45a30f9960975021.js +1 -0
  779. package/app/.next-cli-build/static/chunks/app/api/tags/route-45a30f9960975021.js +1 -0
  780. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-45a30f9960975021.js +1 -0
  781. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-45a30f9960975021.js +1 -0
  782. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-45a30f9960975021.js +1 -0
  783. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-45a30f9960975021.js +1 -0
  784. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-45a30f9960975021.js +1 -0
  785. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-45a30f9960975021.js +1 -0
  786. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-45a30f9960975021.js +1 -0
  787. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-45a30f9960975021.js +1 -0
  788. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-45a30f9960975021.js +1 -0
  789. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-45a30f9960975021.js +1 -0
  790. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-45a30f9960975021.js +1 -0
  791. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-45a30f9960975021.js +1 -0
  792. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-45a30f9960975021.js +1 -0
  793. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-45a30f9960975021.js +1 -0
  794. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-45a30f9960975021.js +1 -0
  795. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-45a30f9960975021.js +1 -0
  796. package/app/.next-cli-build/static/chunks/app/api/usage/dashboard/route-45a30f9960975021.js +1 -0
  797. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-45a30f9960975021.js +1 -0
  798. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-45a30f9960975021.js +1 -0
  799. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-45a30f9960975021.js +1 -0
  800. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-45a30f9960975021.js +1 -0
  801. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-45a30f9960975021.js +1 -0
  802. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-45a30f9960975021.js +1 -0
  803. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-45a30f9960975021.js +1 -0
  804. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-45a30f9960975021.js +1 -0
  805. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-45a30f9960975021.js +1 -0
  806. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-45a30f9960975021.js +1 -0
  807. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-45a30f9960975021.js +1 -0
  808. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-45a30f9960975021.js +1 -0
  809. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-45a30f9960975021.js +1 -0
  810. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-45a30f9960975021.js +1 -0
  811. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-45a30f9960975021.js +1 -0
  812. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-45a30f9960975021.js +1 -0
  813. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-45a30f9960975021.js +1 -0
  814. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-45a30f9960975021.js +1 -0
  815. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-45a30f9960975021.js +1 -0
  816. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-45a30f9960975021.js +1 -0
  817. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-45a30f9960975021.js +1 -0
  818. package/app/.next-cli-build/static/chunks/app/api/v1/route-45a30f9960975021.js +1 -0
  819. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-45a30f9960975021.js +1 -0
  820. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-45a30f9960975021.js +1 -0
  821. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-45a30f9960975021.js +1 -0
  822. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-45a30f9960975021.js +1 -0
  823. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-45a30f9960975021.js +1 -0
  824. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-45a30f9960975021.js +1 -0
  825. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-45a30f9960975021.js +1 -0
  826. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-45a30f9960975021.js +1 -0
  827. package/app/.next-cli-build/static/chunks/app/api/version/route-45a30f9960975021.js +1 -0
  828. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-45a30f9960975021.js +1 -0
  829. package/app/.next-cli-build/static/chunks/app/api/version/update/route-45a30f9960975021.js +1 -0
  830. package/app/.next-cli-build/static/chunks/app/dashboard/settings/pricing/{page-9170ddf38e76b3cf.js → page-3659ea13d950adc1.js} +1 -1
  831. package/app/.next-cli-build/static/chunks/app/landing/page-acb1434862d18ac7.js +1 -0
  832. package/app/.next-cli-build/static/chunks/app/layout-ba8ee035fd3fda5f.js +1 -0
  833. package/app/.next-cli-build/static/chunks/app/login/page-f1945d5fab85c48f.js +1 -0
  834. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-45a30f9960975021.js +1 -0
  835. package/app/.next-cli-build/static/chunks/app/page-45a30f9960975021.js +1 -0
  836. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-45a30f9960975021.js +1 -0
  837. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-45a30f9960975021.js +1 -0
  838. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-45a30f9960975021.js +1 -0
  839. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-45a30f9960975021.js +1 -0
  840. package/app/.next-cli-build/static/chunks/{webpack-77a7ed7beb6725df.js → webpack-b43a2a1c513882e9.js} +1 -1
  841. package/app/.next-cli-build/static/css/6e249fe05f9d7227.css +1 -0
  842. package/app/.next-cli-build/static/css/7a3e1568f247f3d0.css +1 -0
  843. package/app/.next-cli-build/static/mzc6AVdJokpIsYjtjKON0/_buildManifest.js +1 -0
  844. package/app/custom-server.js +8 -8
  845. package/app/package.json +1 -1
  846. package/app/public/i18n/changelog/en.md +46 -0
  847. package/app/public/i18n/changelog/zh-CN.md +46 -0
  848. package/app/public/i18n/changelog/zh-TW.md +46 -0
  849. package/app/public/i18n/literals/ar.json +4 -4
  850. package/app/public/i18n/literals/bn.json +4 -4
  851. package/app/public/i18n/literals/cs.json +4 -4
  852. package/app/public/i18n/literals/da.json +4 -4
  853. package/app/public/i18n/literals/de.json +4 -4
  854. package/app/public/i18n/literals/el.json +4 -4
  855. package/app/public/i18n/literals/es.json +4 -4
  856. package/app/public/i18n/literals/fa.json +31 -34
  857. package/app/public/i18n/literals/fi.json +4 -4
  858. package/app/public/i18n/literals/fr.json +4 -4
  859. package/app/public/i18n/literals/he.json +4 -4
  860. package/app/public/i18n/literals/hi.json +4 -4
  861. package/app/public/i18n/literals/hu.json +4 -4
  862. package/app/public/i18n/literals/id.json +4 -4
  863. package/app/public/i18n/literals/it.json +4 -4
  864. package/app/public/i18n/literals/ja.json +4 -4
  865. package/app/public/i18n/literals/km.json +31 -34
  866. package/app/public/i18n/literals/ko.json +4 -4
  867. package/app/public/i18n/literals/nl.json +4 -4
  868. package/app/public/i18n/literals/no.json +4 -4
  869. package/app/public/i18n/literals/pl.json +4 -4
  870. package/app/public/i18n/literals/pt-BR.json +12 -12
  871. package/app/public/i18n/literals/pt-PT.json +4 -4
  872. package/app/public/i18n/literals/ro.json +4 -4
  873. package/app/public/i18n/literals/ru.json +4 -4
  874. package/app/public/i18n/literals/sv.json +4 -4
  875. package/app/public/i18n/literals/th.json +31 -34
  876. package/app/public/i18n/literals/tl.json +4 -4
  877. package/app/public/i18n/literals/tr.json +4 -4
  878. package/app/public/i18n/literals/uk.json +4 -4
  879. package/app/public/i18n/literals/ur.json +4 -4
  880. package/app/public/i18n/literals/vi.json +4 -4
  881. package/app/public/i18n/literals/zh-CN.json +1857 -1792
  882. package/app/public/i18n/literals/zh-TW.json +695 -612
  883. package/app/public/providers/mimo-desktop.png +0 -0
  884. package/app/public/providers/stepfun.png +0 -0
  885. package/app/public/providers/xiaomi-tokenplan.png +0 -0
  886. package/app/src/lib/db/adapters/betterSqliteAdapter.js +6 -2
  887. package/app/src/lib/db/migrate.js +5 -2
  888. package/app/src/lib/oauth/xiaomiIdentity.js +50 -41
  889. package/app/src/lib/updater/updater.js +95 -5
  890. package/app/src/mitm/server.js +14 -14
  891. package/app/src/sse/services/qoderCheckin.js +32 -4
  892. package/cli.js +91 -9
  893. package/hooks/postinstall.js +11 -1
  894. package/hooks/sqliteRuntime.js +27 -9
  895. package/hooks/trayRuntime.js +5 -2
  896. package/package.json +11 -2
  897. package/src/cli/doctor.js +525 -0
  898. package/src/cli/i18n/locales/en/core.json +42 -2
  899. package/src/cli/i18n/locales/en/settings.json +3 -3
  900. package/src/cli/i18n/locales/zh-CN/core.json +42 -2
  901. package/src/cli/i18n/locales/zh-CN/settings.json +3 -3
  902. package/src/cli/i18n/locales/zh-TW/core.json +42 -2
  903. package/src/cli/i18n/locales/zh-TW/settings.json +3 -3
  904. package/src/cli/menus/settings.js +26 -8
  905. package/src/cli/staleServer.js +216 -0
  906. package/app/.next-cli-build/server/chunks/1377.js +0 -1
  907. package/app/.next-cli-build/server/chunks/3007.js +0 -1
  908. package/app/.next-cli-build/server/chunks/4055.js +0 -9
  909. package/app/.next-cli-build/server/chunks/4862.js +0 -1
  910. package/app/.next-cli-build/server/chunks/4985.js +0 -1
  911. package/app/.next-cli-build/server/chunks/5217.js +0 -9
  912. package/app/.next-cli-build/server/chunks/6360.js +0 -1
  913. package/app/.next-cli-build/server/chunks/8910.js +0 -2
  914. package/app/.next-cli-build/server/chunks/8990.js +0 -1
  915. package/app/.next-cli-build/server/chunks/9251.js +0 -1
  916. package/app/.next-cli-build/static/chunks/1243-220f1fd87235cb92.js +0 -3
  917. package/app/.next-cli-build/static/chunks/1321-3c120e93be69e929.js +0 -1
  918. package/app/.next-cli-build/static/chunks/5497-6254f96ca64b6030.js +0 -7
  919. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-395c2359af9bc2a9.js +0 -1
  920. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-b0d4fedb7b84fe8a.js +0 -59
  921. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-502e7efb917191b9.js +0 -1
  922. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-720b5ab2e46fc6bb.js +0 -1
  923. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-4b4f1e8dd8aa7e92.js +0 -1
  924. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-6550d226457d7487.js +0 -14
  925. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-5038d14b38d853a5.js +0 -1
  926. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-5f5434b22c7f7b73.js +0 -1
  927. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-2650e9a5b8e872ce.js +0 -1
  928. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-27bf96f0f2568f09.js +0 -1
  929. package/app/.next-cli-build/static/chunks/app/_global-error/page-dc2c34db3b327370.js +0 -1
  930. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-dc2c34db3b327370.js +0 -1
  931. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-dc2c34db3b327370.js +0 -1
  932. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-dc2c34db3b327370.js +0 -1
  933. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-dc2c34db3b327370.js +0 -1
  934. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-dc2c34db3b327370.js +0 -1
  935. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-dc2c34db3b327370.js +0 -1
  936. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-dc2c34db3b327370.js +0 -1
  937. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-dc2c34db3b327370.js +0 -1
  938. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-dc2c34db3b327370.js +0 -1
  939. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-dc2c34db3b327370.js +0 -1
  940. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-dc2c34db3b327370.js +0 -1
  941. package/app/.next-cli-build/static/chunks/app/api/auth/verify-password/route-dc2c34db3b327370.js +0 -1
  942. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-dc2c34db3b327370.js +0 -1
  943. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-dc2c34db3b327370.js +0 -1
  944. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-dc2c34db3b327370.js +0 -1
  945. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-dc2c34db3b327370.js +0 -1
  946. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-dc2c34db3b327370.js +0 -1
  947. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-dc2c34db3b327370.js +0 -1
  948. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-dc2c34db3b327370.js +0 -1
  949. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-dc2c34db3b327370.js +0 -1
  950. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-dc2c34db3b327370.js +0 -1
  951. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-dc2c34db3b327370.js +0 -1
  952. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-dc2c34db3b327370.js +0 -1
  953. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-dc2c34db3b327370.js +0 -1
  954. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-dc2c34db3b327370.js +0 -1
  955. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-dc2c34db3b327370.js +0 -1
  956. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-dc2c34db3b327370.js +0 -1
  957. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-dc2c34db3b327370.js +0 -1
  958. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-dc2c34db3b327370.js +0 -1
  959. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-dc2c34db3b327370.js +0 -1
  960. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-dc2c34db3b327370.js +0 -1
  961. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-dc2c34db3b327370.js +0 -1
  962. package/app/.next-cli-build/static/chunks/app/api/combos/route-dc2c34db3b327370.js +0 -1
  963. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-dc2c34db3b327370.js +0 -1
  964. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-dc2c34db3b327370.js +0 -1
  965. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-dc2c34db3b327370.js +0 -1
  966. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-dc2c34db3b327370.js +0 -1
  967. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-dc2c34db3b327370.js +0 -1
  968. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-dc2c34db3b327370.js +0 -1
  969. package/app/.next-cli-build/static/chunks/app/api/health/route-dc2c34db3b327370.js +0 -1
  970. package/app/.next-cli-build/static/chunks/app/api/init/route-dc2c34db3b327370.js +0 -1
  971. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-dc2c34db3b327370.js +0 -1
  972. package/app/.next-cli-build/static/chunks/app/api/keys/rotate/route-dc2c34db3b327370.js +0 -1
  973. package/app/.next-cli-build/static/chunks/app/api/keys/route-dc2c34db3b327370.js +0 -1
  974. package/app/.next-cli-build/static/chunks/app/api/locale/route-dc2c34db3b327370.js +0 -1
  975. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-dc2c34db3b327370.js +0 -1
  976. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-dc2c34db3b327370.js +0 -1
  977. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-dc2c34db3b327370.js +0 -1
  978. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-dc2c34db3b327370.js +0 -1
  979. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-dc2c34db3b327370.js +0 -1
  980. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-dc2c34db3b327370.js +0 -1
  981. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-dc2c34db3b327370.js +0 -1
  982. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-dc2c34db3b327370.js +0 -1
  983. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-dc2c34db3b327370.js +0 -1
  984. package/app/.next-cli-build/static/chunks/app/api/models/caps/route-dc2c34db3b327370.js +0 -1
  985. package/app/.next-cli-build/static/chunks/app/api/models/custom/bulk/route-dc2c34db3b327370.js +0 -1
  986. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-dc2c34db3b327370.js +0 -1
  987. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-dc2c34db3b327370.js +0 -1
  988. package/app/.next-cli-build/static/chunks/app/api/models/route-dc2c34db3b327370.js +0 -1
  989. package/app/.next-cli-build/static/chunks/app/api/models/test/route-dc2c34db3b327370.js +0 -1
  990. package/app/.next-cli-build/static/chunks/app/api/network/egress-region/route-dc2c34db3b327370.js +0 -1
  991. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-dc2c34db3b327370.js +0 -1
  992. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/bulk-import/route-dc2c34db3b327370.js +0 -1
  993. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/checkin/route-dc2c34db3b327370.js +0 -1
  994. package/app/.next-cli-build/static/chunks/app/api/oauth/codebuddy-cn/export/route-dc2c34db3b327370.js +0 -1
  995. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-dc2c34db3b327370.js +0 -1
  996. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-dc2c34db3b327370.js +0 -1
  997. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-dc2c34db3b327370.js +0 -1
  998. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-dc2c34db3b327370.js +0 -1
  999. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-dc2c34db3b327370.js +0 -1
  1000. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-dc2c34db3b327370.js +0 -1
  1001. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-dc2c34db3b327370.js +0 -1
  1002. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-dc2c34db3b327370.js +0 -1
  1003. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-dc2c34db3b327370.js +0 -1
  1004. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-dc2c34db3b327370.js +0 -1
  1005. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-dc2c34db3b327370.js +0 -1
  1006. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-dc2c34db3b327370.js +0 -1
  1007. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder/checkin/route-dc2c34db3b327370.js +0 -1
  1008. package/app/.next-cli-build/static/chunks/app/api/oauth/qoder-cn/checkin/route-dc2c34db3b327370.js +0 -1
  1009. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/export/route-dc2c34db3b327370.js +0 -1
  1010. package/app/.next-cli-build/static/chunks/app/api/oauth/transfer/import/route-dc2c34db3b327370.js +0 -1
  1011. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-dc2c34db3b327370.js +0 -1
  1012. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-dc2c34db3b327370.js +0 -1
  1013. package/app/.next-cli-build/static/chunks/app/api/pricing/route-dc2c34db3b327370.js +0 -1
  1014. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-dc2c34db3b327370.js +0 -1
  1015. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-dc2c34db3b327370.js +0 -1
  1016. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-dc2c34db3b327370.js +0 -1
  1017. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-dc2c34db3b327370.js +0 -1
  1018. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-dc2c34db3b327370.js +0 -1
  1019. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-dc2c34db3b327370.js +0 -1
  1020. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-dc2c34db3b327370.js +0 -1
  1021. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-dc2c34db3b327370.js +0 -1
  1022. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-dc2c34db3b327370.js +0 -1
  1023. package/app/.next-cli-build/static/chunks/app/api/providers/route-dc2c34db3b327370.js +0 -1
  1024. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-dc2c34db3b327370.js +0 -1
  1025. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-dc2c34db3b327370.js +0 -1
  1026. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-dc2c34db3b327370.js +0 -1
  1027. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-dc2c34db3b327370.js +0 -1
  1028. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-dc2c34db3b327370.js +0 -1
  1029. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-dc2c34db3b327370.js +0 -1
  1030. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-dc2c34db3b327370.js +0 -1
  1031. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-dc2c34db3b327370.js +0 -1
  1032. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-dc2c34db3b327370.js +0 -1
  1033. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-dc2c34db3b327370.js +0 -1
  1034. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-dc2c34db3b327370.js +0 -1
  1035. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-dc2c34db3b327370.js +0 -1
  1036. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-dc2c34db3b327370.js +0 -1
  1037. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-dc2c34db3b327370.js +0 -1
  1038. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-dc2c34db3b327370.js +0 -1
  1039. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-dc2c34db3b327370.js +0 -1
  1040. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-dc2c34db3b327370.js +0 -1
  1041. package/app/.next-cli-build/static/chunks/app/api/settings/database/import-usage/route-dc2c34db3b327370.js +0 -1
  1042. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-dc2c34db3b327370.js +0 -1
  1043. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-dc2c34db3b327370.js +0 -1
  1044. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-dc2c34db3b327370.js +0 -1
  1045. package/app/.next-cli-build/static/chunks/app/api/settings/route-dc2c34db3b327370.js +0 -1
  1046. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-dc2c34db3b327370.js +0 -1
  1047. package/app/.next-cli-build/static/chunks/app/api/tags/route-dc2c34db3b327370.js +0 -1
  1048. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-dc2c34db3b327370.js +0 -1
  1049. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-dc2c34db3b327370.js +0 -1
  1050. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-dc2c34db3b327370.js +0 -1
  1051. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-dc2c34db3b327370.js +0 -1
  1052. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-dc2c34db3b327370.js +0 -1
  1053. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-dc2c34db3b327370.js +0 -1
  1054. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-dc2c34db3b327370.js +0 -1
  1055. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-dc2c34db3b327370.js +0 -1
  1056. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-dc2c34db3b327370.js +0 -1
  1057. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-dc2c34db3b327370.js +0 -1
  1058. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-dc2c34db3b327370.js +0 -1
  1059. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-dc2c34db3b327370.js +0 -1
  1060. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-dc2c34db3b327370.js +0 -1
  1061. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-dc2c34db3b327370.js +0 -1
  1062. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-dc2c34db3b327370.js +0 -1
  1063. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-dc2c34db3b327370.js +0 -1
  1064. package/app/.next-cli-build/static/chunks/app/api/usage/dashboard/route-dc2c34db3b327370.js +0 -1
  1065. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-dc2c34db3b327370.js +0 -1
  1066. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-dc2c34db3b327370.js +0 -1
  1067. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-dc2c34db3b327370.js +0 -1
  1068. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-dc2c34db3b327370.js +0 -1
  1069. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-dc2c34db3b327370.js +0 -1
  1070. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-dc2c34db3b327370.js +0 -1
  1071. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-dc2c34db3b327370.js +0 -1
  1072. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-dc2c34db3b327370.js +0 -1
  1073. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-dc2c34db3b327370.js +0 -1
  1074. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-dc2c34db3b327370.js +0 -1
  1075. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-dc2c34db3b327370.js +0 -1
  1076. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-dc2c34db3b327370.js +0 -1
  1077. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-dc2c34db3b327370.js +0 -1
  1078. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-dc2c34db3b327370.js +0 -1
  1079. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-dc2c34db3b327370.js +0 -1
  1080. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-dc2c34db3b327370.js +0 -1
  1081. package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-dc2c34db3b327370.js +0 -1
  1082. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-dc2c34db3b327370.js +0 -1
  1083. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-dc2c34db3b327370.js +0 -1
  1084. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-dc2c34db3b327370.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-dc2c34db3b327370.js +0 -1
  1086. package/app/.next-cli-build/static/chunks/app/api/v1/route-dc2c34db3b327370.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-dc2c34db3b327370.js +0 -1
  1088. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-dc2c34db3b327370.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-dc2c34db3b327370.js +0 -1
  1090. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-dc2c34db3b327370.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-dc2c34db3b327370.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-dc2c34db3b327370.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-dc2c34db3b327370.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-dc2c34db3b327370.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/version/route-dc2c34db3b327370.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-dc2c34db3b327370.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/version/update/route-dc2c34db3b327370.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/landing/page-3c92a951f3cc5eee.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/layout-034acae46f56c420.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/login/page-0da5fcc5d841cbb9.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-dc2c34db3b327370.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/page-dc2c34db3b327370.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-dc2c34db3b327370.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-dc2c34db3b327370.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-dc2c34db3b327370.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-dc2c34db3b327370.js +0 -1
  1107. package/app/.next-cli-build/static/css/822bb46e0ce1f8af.css +0 -1
  1108. package/app/.next-cli-build/static/css/8f9ac5a7bd3a79e5.css +0 -1
  1109. package/app/.next-cli-build/static/ywoOd9C5swOj24BZAUkYk/_buildManifest.js +0 -1
  1110. /package/app/.next-cli-build/static/{ywoOd9C5swOj24BZAUkYk → mzc6AVdJokpIsYjtjKON0}/_ssgManifest.js +0 -0
@@ -6,4 +6,4 @@ PRAGMA mmap_size = 30000000;
6
6
  PRAGMA cache_size = -64000;
7
7
  PRAGMA foreign_keys = ON;
8
8
  PRAGMA busy_timeout = 5000;
9
- `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
9
+ `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyHash:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_hash ON usageHistory(apiKeyHash)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
@@ -0,0 +1,9 @@
1
+ "use strict";exports.id=4990,exports.ids=[4990],exports.modules={34990:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>G});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(7841),i=c(76040);let j="stepfun",k="stepfun-cn";var l=c(34393),m=c(69128);let n=["mimoPassToken","mimoUserId","mimoCUserId"],o=new Set(["Xiaomi MiMo Desktop","Xiaomi MiMo Desktop Session"]),p="mimo-desktop-session";function q(a){if(!(0,l.ph)(a))return{ok:!0,value:a};try{return{ok:!0,value:(0,l.wu)(a)}}catch{return{ok:!1,value:a}}}function r(a){try{return JSON.parse(a.data||"{}")}catch{return null}}function s(a,b=null){let c=a?.providerSpecificData||{},d=q("string"==typeof a?.accessToken?a.accessToken:null),e="string"==typeof c.uid||"number"==typeof c.uid?String(c.uid):null,f="string"==typeof c.mimoUserId||"number"==typeof c.mimoUserId?String(c.mimoUserId):null,g=c.mimoPassToken;return{token:d.ok?d.value:null,uid:e,mu:f,email:"string"==typeof b&&b?b:null,hasSession:null!=g&&""!==g&&q(g).ok}}let t=[{version:1,name:"initial",up(a){for(let[b,c]of Object.entries(i.CG))for(let d of(a.exec((0,i.zE)(b,c)),c.indexes||[]))a.exec(d)}},{version:2,name:"stepfun-cn-rename",up(a){let b;for(let b of(a.run("UPDATE providerConnections SET provider = ? WHERE provider = ?",[k,j]),a.run("UPDATE kv SET key = ? WHERE scope = 'disabledModels' AND key = ?",[k,j]),["modelCaps","customModels"]))a.run("UPDATE kv SET key = ? || substr(key, ?) WHERE scope = ? AND key LIKE ?",[k,j.length+1,b,`${j}|%`]);let c=a.get("SELECT data FROM settings WHERE id = 1");if(!c?.data)return;try{b=JSON.parse(c.data)}catch{return}if(!b||"object"!=typeof b)return;let d=!1;if(Array.isArray(b.providerCardOrder)){let a=b.providerCardOrder.map(a=>a===j?k:a);a.some((a,c)=>a!==b.providerCardOrder[c])&&(b.providerCardOrder=a,d=!0)}for(let a of["topologyVisibility","providerStrategies"]){let c=b[a];c&&"object"==typeof c&&Object.prototype.hasOwnProperty.call(c,j)&&(k in c||(c[k]=c[j]),delete c[j],d=!0)}d&&a.run("UPDATE settings SET data = ? WHERE id = 1",[JSON.stringify(b)])}},{version:3,name:"encrypt-credentials",up(a){let b;try{b=a.all("SELECT id, data FROM providerConnections")}catch(a){console.warn("[migration] encrypt-credentials: could not read connections:",a?.message||a);return}let c=0,d=0;for(let e of b){let b;try{b=JSON.parse(e.data||"{}")}catch{continue}if((0,l.HG)(b))try{a.run("UPDATE providerConnections SET data = ? WHERE id = ?",[JSON.stringify((0,l.Wl)(b)),e.id]),c+=1}catch(a){1===(d+=1)&&console.warn("[migration] encrypt-credentials: could not encrypt a connection — credentials stay in plain text until they are rewritten:",a?.message||a)}}c&&console.log(`[migration] encrypt-credentials: encrypted ${c} connection row(s)`),d&&console.warn(`[migration] encrypt-credentials: ${d} row(s) left in plain text`)}},{version:4,name:"usage-apikey-digest",up(a){try{a.all("PRAGMA table_info(usageHistory)").map(a=>a.name).includes("apiKeyHash")||(a.exec("ALTER TABLE usageHistory ADD COLUMN apiKeyHash TEXT"),console.log("[migration] usage-apikey-digest: added usageHistory.apiKeyHash")),a.exec("CREATE INDEX IF NOT EXISTS idx_uh_apikey_hash ON usageHistory(apiKeyHash)")}catch(a){console.warn("[migration] usage-apikey-digest: could not ensure apiKeyHash column:",a?.message||a)}let b=0;try{for(let c of a.all("SELECT id, apiKey FROM usageHistory WHERE apiKey IS NOT NULL AND apiKey != ''"))(0,m.f0)(c.apiKey)||(a.run("UPDATE usageHistory SET apiKey = ?, apiKeyHash = ? WHERE id = ?",[(0,m.oO)(c.apiKey),(0,m.kk)(c.apiKey),c.id]),b+=1)}catch(a){console.warn("[migration] usage-apikey-digest: history rows skipped:",a?.message||a)}let c=0;try{for(let b of a.all("SELECT dateKey, data FROM usageDaily")){let d;try{d=JSON.parse(b.data||"{}")}catch{continue}let e=d?.byApiKey;if(!e||"object"!=typeof e)continue;let f={},g=!1;for(let[a,b]of Object.entries(e)){if(!b||"object"!=typeof b){f[a]=b;continue}let c="string"==typeof b.apiKey?b.apiKey:null;if(!c&&b.apiKeyHash||!c){f[a]=b;continue}let{apiKey:d,...e}=b,h=(0,m.kk)(c),i=a.split("|"),j=i.length>1?"|"+i.slice(1).join("|"):"";f[`${h||"local-no-key"}${j}`]={...e,apiKeyHash:h,apiKeyMasked:(0,m.oO)(c)},g=!0}g&&(a.run("UPDATE usageDaily SET data = ? WHERE dateKey = ?",[JSON.stringify({...d,byApiKey:f}),b.dateKey]),c+=1)}}catch(a){console.warn("[migration] usage-apikey-digest: daily aggregates skipped:",a?.message||a)}(b||c)&&console.log(`[migration] usage-apikey-digest: rewrote ${b} history row(s), ${c} day aggregate(s)`)}},{version:5,name:"strip-mimo-main-card-session",up(a){let b,c;try{b=a.all("SELECT id, email, data FROM providerConnections WHERE provider = 'xiaomi-mimo'"),c=a.all("SELECT id, email, data FROM providerConnections WHERE provider = 'mimo-desktop'")}catch(a){console.warn("[migration] strip-mimo-main-card-session: could not read connections:",a?.message||a);return}let d=c.map(a=>{let b=r(a);return b?s(b,a.email):null}).filter(Boolean),e=0,f=0,g=0,h=0;for(let c of b){let b=r(c);if(!b||"object"!=typeof b)continue;let i=b.providerSpecificData&&"object"==typeof b.providerSpecificData?b.providerSpecificData:{};if(!(n.some(a=>void 0!==i[a]&&null!==i[a]&&""!==i[a])||o.has(i.provider)||"desktop-session"===i.authMethod||"string"==typeof b.accessToken&&b.accessToken.startsWith(p)))continue;let j=q("string"==typeof b.accessToken?b.accessToken:null);if(!j.ok||i.mimoPassToken&&!q(i.mimoPassToken).ok){h+=1;continue}if(!("string"!=typeof j.value||""===j.value||j.value.startsWith(p))){let d=function(a){let b={...a};for(let a of n)delete b[a];return o.has(b.provider)&&delete b.provider,b}(i);"desktop-session"===d.authMethod&&(d.authMethod="api_key"),a.run("UPDATE providerConnections SET data = ? WHERE id = ?",[JSON.stringify((0,l.Wl)({...b,providerSpecificData:d})),c.id]),e+=1;continue}let k=s(b,c.email);if(d.find(a=>(!!a.token&&!!k.token&&a.token===k.token||!!a.uid&&!!k.uid&&a.uid===k.uid||!!a.mu&&!!k.mu&&a.mu===k.mu||!!a.uid&&!!k.mu&&a.uid===k.mu||!!a.mu&&!!k.uid&&a.mu===k.uid||!!a.email&&!!k.email&&a.email===k.email||!1)&&a.hasSession)){a.run("DELETE FROM providerConnections WHERE id = ?",[c.id]),g+=1;continue}a.run("UPDATE providerConnections SET provider = 'mimo-desktop', data = ? WHERE id = ?",[JSON.stringify((0,l.Wl)(b)),c.id]),f+=1}(e||f||g||h)&&console.log(`[migration] strip-mimo-main-card-session: stripped ${e} cloud row(s), moved ${f} session-only row(s) to mimo-desktop, removed ${g} duplicate row(s)`+(h?`, ${h} row(s) left untouched (undecryptable credentials)`:""))}}].sort((a,b)=>a.version-b.version);var u=c(91117);let v=null;function w(){if(v)return v;try{let a=g().join(process.cwd(),"package.json");v=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{v="0.0.0"}return v}let x=["requestDetails"];function y(a){(0,h.Jh)();let b=w(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function z(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(3))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var A=c(33323);let B=g().join(h.HG,".migrated-from-json"),C=new WeakSet;class D extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function E(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new D(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function F(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function G(a){if(C.has(a))return;C.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch{return!0}}(a);z(),a.exec((0,i.zE)("_meta",i.CG._meta));let c=parseInt((0,u.dy)(a,"backupSchemaVersion","0"),10)||0;if(!b&&c<i.f$)try{let b=y(`schema-${c}-to-${i.f$}`);!function(a,b,c="data.sqlite"){let d=g().join(b,c);try{e().rmSync(d,{force:!0})}catch{}let f=d.replace(/'/g,"''");a.exec(`ATTACH DATABASE '${f}' AS bak`);try{let b=new Set(x),c=a.all("SELECT name, sql FROM main.sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").filter(a=>!b.has(a.name));a.transaction(()=>{for(let b of c){let c=b.sql.replace(/CREATE TABLE\s+/i,"CREATE TABLE bak.");a.exec(c),a.exec(`INSERT INTO bak.${b.name} SELECT * FROM main.${b.name}`)}})}finally{try{a.exec("DETACH DATABASE bak")}catch{}}}(a,b),z(),console.log(`[DB][migrate] pre-schema backup ${c} → ${i.f$}: ${b}`)}catch(a){console.warn(`[DB][migrate] pre-schema backup failed (continuing): ${a.message}`)}!function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt((0,u.dy)(a,"schemaVersion","0"),10)||0;if(b>=(t.length?t[t.length-1].version:0))return;let c=t.filter(a=>a.version>b);for(let b of c)a.transaction(()=>{b.up(a),(0,u.np)(a,"schemaVersion",b.version)}),b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);c.length}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}(0,u.np)(a,"backupSchemaVersion",i.f$);let d=e().existsSync(B),f=F(h.Or.main),j=F(h.Or.usage),k=F(h.Or.disabled),m=F(h.Or.details);if(b&&(f||j||k||m)&&!d){let b=Date.now(),c=y("migrate-from-json");for(let a of Object.values(h.Or))!function(a,b,c=null){if(!e().existsSync(a))return;let d=c||g().basename(a),f=g().join(b,d);e().copyFileSync(a,f)}(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,A.s)(f.settings)]),E(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...m}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,A.s)((0,l.Wl)(m)),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),E(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,A.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),E(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,A.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),E(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),E(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,A.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,A.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,A.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,A.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,A.s)(c||{})])}if(j&&"object"==typeof j){for(let b of j.history||[]){let c=b.tokens||{};a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.apiKey||null,b.endpoint||null,c.prompt_tokens||c.input_tokens||0,c.completion_tokens||c.output_tokens||0,b.cost||0,b.status||"ok",(0,A.s)(c),(0,A.s)({})])}for(let[b,c]of Object.entries(j.dailySummary||{}))a.run("INSERT OR REPLACE INTO usageDaily(dateKey, data) VALUES(?, ?)",[b,(0,A.s)(c)]);"number"==typeof j.totalRequestsLifetime&&(0,u.np)(a,"totalRequestsLifetime",j.totalRequestsLifetime)}if(k&&"object"==typeof k.disabled)for(let[b,c]of Object.entries(k.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,A.s)(c||[])]);if(m&&Array.isArray(m.records))for(let b of m.records)a.run("INSERT OR REPLACE INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?)",[b.id,b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.status||null,(0,A.s)(b)]);(0,u.np)(a,"appVersion",w()),(0,u.np)(a,"backupSchemaVersion",i.f$),(0,u.np)(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof D)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(B,new Date().toISOString())}catch{}z(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}let n=w();(0,u.dy)(a,"appVersion",null)!==n&&(0,u.np)(a,"appVersion",n)}},76040:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=1,e=`
2
+ PRAGMA journal_mode = WAL;
3
+ PRAGMA synchronous = NORMAL;
4
+ PRAGMA temp_store = MEMORY;
5
+ PRAGMA mmap_size = 30000000;
6
+ PRAGMA cache_size = -64000;
7
+ PRAGMA foreign_keys = ON;
8
+ PRAGMA busy_timeout = 5000;
9
+ `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyHash:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_hash ON usageHistory(apiKeyHash)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
@@ -6,4 +6,4 @@ PRAGMA mmap_size = 30000000;
6
6
  PRAGMA cache_size = -64000;
7
7
  PRAGMA foreign_keys = ON;
8
8
  PRAGMA busy_timeout = 5000;
9
- `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},90507:(a,b,c)=>{c.d(b,{createBetterSqliteAdapter:()=>g});var d=c(87550),e=c.n(d),f=c(76040);function g(a){let b=new(e())(a);b.exec(f.oG);let c=new Map;function d(a){let d=c.get(a);return d||(d=b.prepare(a),c.set(a,d)),d}let g=setInterval(()=>{try{b.pragma("wal_checkpoint(TRUNCATE)")}catch{}},6e4);function h(){try{b.pragma("wal_checkpoint(TRUNCATE)")}catch{}try{c.clear()}catch{}try{b.close()}catch{}}"function"==typeof g.unref&&g.unref();let i=()=>h();return process.once("beforeExit",i),process.once("SIGINT",()=>{i(),process.exit(0)}),process.once("SIGTERM",()=>{i(),process.exit(0)}),{driver:"better-sqlite3",run:(a,b=[])=>d(a).run(...b),get:(a,b=[])=>d(a).get(...b),all:(a,b=[])=>d(a).all(...b),exec:a=>b.exec(a),transaction:a=>b.transaction(a)(),checkpoint(){try{b.pragma("wal_checkpoint(TRUNCATE)")}catch{}},close(){clearInterval(g),h()},raw:b}}}};
9
+ `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyHash:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_hash ON usageHistory(apiKeyHash)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},90507:(a,b,c)=>{c.d(b,{createBetterSqliteAdapter:()=>e});var d=c(76040);function e(a,b){let c=new b(a);c.exec(d.oG);let e=new Map;function f(a){let b=e.get(a);return b||(b=c.prepare(a),e.set(a,b)),b}let g=setInterval(()=>{try{c.pragma("wal_checkpoint(TRUNCATE)")}catch{}},6e4);function h(){try{c.pragma("wal_checkpoint(TRUNCATE)")}catch{}try{e.clear()}catch{}try{c.close()}catch{}}"function"==typeof g.unref&&g.unref();let i=()=>h();return process.once("beforeExit",i),process.once("SIGINT",()=>{i(),process.exit(0)}),process.once("SIGTERM",()=>{i(),process.exit(0)}),{driver:"better-sqlite3",run:(a,b=[])=>f(a).run(...b),get:(a,b=[])=>f(a).get(...b),all:(a,b=[])=>f(a).all(...b),exec:a=>c.exec(a),transaction:a=>c.transaction(a)(),checkpoint(){try{c.pragma("wal_checkpoint(TRUNCATE)")}catch{}},close(){clearInterval(g),h()},raw:c}}}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=5258,exports.ids=[5258],exports.modules={25258:(a,b,c)=>{c.d(b,{createBetterSqliteAdapter:()=>g});var d=c(87550),e=c.n(d),f=c(63775);function g(a){let b=new(e())(a);b.exec(f.oG);let c=new Map;function d(a){let d=c.get(a);return d||(d=b.prepare(a),c.set(a,d)),d}let g=setInterval(()=>{try{b.pragma("wal_checkpoint(TRUNCATE)")}catch{}},6e4);function h(){try{b.pragma("wal_checkpoint(TRUNCATE)")}catch{}try{c.clear()}catch{}try{b.close()}catch{}}"function"==typeof g.unref&&g.unref();let i=()=>h();return process.once("beforeExit",i),process.once("SIGINT",()=>{i(),process.exit(0)}),process.once("SIGTERM",()=>{i(),process.exit(0)}),{driver:"better-sqlite3",run:(a,b=[])=>d(a).run(...b),get:(a,b=[])=>d(a).get(...b),all:(a,b=[])=>d(a).all(...b),exec:a=>b.exec(a),transaction:a=>b.transaction(a)(),checkpoint(){try{b.pragma("wal_checkpoint(TRUNCATE)")}catch{}},close(){clearInterval(g),h()},raw:b}}},63775:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=1,e=`
1
+ "use strict";exports.id=5258,exports.ids=[5258],exports.modules={25258:(a,b,c)=>{c.d(b,{createBetterSqliteAdapter:()=>e});var d=c(63775);function e(a,b){let c=new b(a);c.exec(d.oG);let e=new Map;function f(a){let b=e.get(a);return b||(b=c.prepare(a),e.set(a,b)),b}let g=setInterval(()=>{try{c.pragma("wal_checkpoint(TRUNCATE)")}catch{}},6e4);function h(){try{c.pragma("wal_checkpoint(TRUNCATE)")}catch{}try{e.clear()}catch{}try{c.close()}catch{}}"function"==typeof g.unref&&g.unref();let i=()=>h();return process.once("beforeExit",i),process.once("SIGINT",()=>{i(),process.exit(0)}),process.once("SIGTERM",()=>{i(),process.exit(0)}),{driver:"better-sqlite3",run:(a,b=[])=>f(a).run(...b),get:(a,b=[])=>f(a).get(...b),all:(a,b=[])=>f(a).all(...b),exec:a=>c.exec(a),transaction:a=>c.transaction(a)(),checkpoint(){try{c.pragma("wal_checkpoint(TRUNCATE)")}catch{}},close(){clearInterval(g),h()},raw:c}}},63775:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=1,e=`
2
2
  PRAGMA journal_mode = WAL;
3
3
  PRAGMA synchronous = NORMAL;
4
4
  PRAGMA temp_store = MEMORY;
@@ -6,4 +6,4 @@ PRAGMA mmap_size = 30000000;
6
6
  PRAGMA cache_size = -64000;
7
7
  PRAGMA foreign_keys = ON;
8
8
  PRAGMA busy_timeout = 5000;
9
- `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
9
+ `,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyHash:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_hash ON usageHistory(apiKeyHash)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
@@ -127,13 +127,13 @@ You are producing plain text that will later be styled by the CLI. Follow these
127
127
  `),f.push(k.$U),new Response(f.join(""),{status:200,headers:{...k.pb}})}async refreshCredentials(){return null}}d()}catch(a){d(a)}},1)},23013:(a,b,c)=>{c.d(b,{Ay:()=>z});var d=c(74957),e=c(35024),f=c(78959),g=c(92536);let h=e.xq["perplexity-web"].baseUrl,i="2.18",j={"pplx-auto":["concise","pplx_pro"],"pplx-sonar":["copilot","experimental"],"pplx-gpt":["copilot","gpt54"],"pplx-gemini":["copilot","gemini31pro_high"],"pplx-sonnet":["copilot","claude46sonnet"],"pplx-opus":["copilot","claude46opus"],"pplx-nemotron":["copilot","nv_nemotron_3_super"]},k={"pplx-gpt":"gpt54_thinking","pplx-sonnet":"claude46sonnetthinking","pplx-opus":"claude46opusthinking"},l=/\[\d+\]/g,m=/<grok:[^>]*>.*?<\/grok:[^>]*>/gs,n=/<grok:[^>]*\/>/g,o=/<[?]xml[^?]*[?]>/g,p=/<\/?response\b[^>]*>/gi,q=/ {2,}/g,r=/\n{3,}/g,s=new Map;function t(a){let b=a.map(a=>`${a.role}:${a.content}`).join("\n"),c=0x811c9dc5;for(let a=0;a<b.length;a++)c^=b.charCodeAt(a),c=0x1000193*c>>>0;return c.toString(16).padStart(8,"0")}function u(a,b,c,d){if(!d)return;let e=t([...a,{role:"user",content:b},{role:"assistant",content:c}]);if(s.set(e,{backendUuid:d,ts:Date.now()}),s.size>200){let a=null,b=1/0;for(let[c,d]of s)d.ts<b&&(b=d.ts,a=c);a&&s.delete(a)}}function v(a,b=!0){let c=a;return c=(c=(c=(c=(c=c.replace(o,"")).replace(l,"")).replace(m,"")).replace(n,"")).replace(p,""),b&&(c=(c=(c=c.replace(q," ")).replace(r,"\n\n")).trim()),c}async function*w(a,b){let c=a.getReader(),d=new TextDecoder,e="",f=[];function g(){if(0===f.length)return null;let a=f.join("\n");f=[];let b=a.trim();if(!b||"[DONE]"===b)return"done";try{return JSON.parse(b)}catch{return null}}try{for(;;){if(b?.aborted)return;let{value:a,done:h}=await c.read();if(h)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a);e=e.slice(a+1);let c=b.endsWith("\r")?b.slice(0,-1):b;if(""===c){let a=g();if("done"===a)return;a&&(yield a);continue}if(c.startsWith("data:")&&f.push(c.slice(5).trimStart()),"event: end_of_stream"===c)return}}(e+=d.decode()).trim().startsWith("data:")&&f.push(e.trim().slice(5).trimStart());let a=g();a&&"done"!==a&&(yield a)}finally{c.releaseLock()}}async function*x(a,b){let c="",d=null,e=0,f=new Set;for await(let g of w(a,b)){if(g.error_code||g.error_message)return void(yield{error:g.error_message||`Perplexity error: ${g.error_code}`,done:!0});g.backend_uuid&&(d=g.backend_uuid);let a=g.blocks??[];for(let b of a){let a=b.intended_usage??"";if("pro_search_steps"===a&&b.plan_block?.steps){for(let a of b.plan_block.steps)if("SEARCH_WEB"===a.step_type)for(let b of a.search_web_content?.queries??[]){let a=b.query??"";a&&!f.has(a)&&(f.add(a),yield{thinking:`Searching: ${a}`,backendUuid:d??void 0})}else if("READ_RESULTS"===a.step_type)for(let b of(a.read_results_content?.urls??[]).slice(0,3))b&&!f.has(b)&&(f.add(b),yield{thinking:`Reading: ${b}`,backendUuid:d??void 0})}if("plan"===a&&b.plan_block?.goals)for(let a of b.plan_block.goals){let b=a.description??"";b&&!f.has(b)&&(f.add(b),yield{thinking:b,backendUuid:d??void 0})}if(!a.includes("markdown"))continue;let g=b.markdown_block;if(!g)continue;let h=g.chunks??[];if(0!==h.length)if("DONE"===g.progress)c=h.join("");else{let a=c+h.join("");if(a.length>e){let b=a.slice(e);c=a,e=a.length,yield{delta:b,answer:c,backendUuid:d??void 0}}}}if(0===a.length&&g.text){let a=g.text.trim();if(a.length>e){let b=a.slice(e);c=a,e=a.length,yield{delta:b,answer:c,backendUuid:d??void 0}}}if(g.final||"COMPLETED"===g.status)break}yield{delta:"",answer:c,backendUuid:d??void 0,done:!0}}async function y(a,b,c,d,e,f,g){let h="",i=null,j=[];for await(let b of x(a,g)){if(b.backendUuid&&(i=b.backendUuid),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"PPLX_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){j.push(b.thinking);continue}if(b.done){h=b.answer||h;break}b.answer&&(h=b.answer)}u(e,f,h=v(h),i);let k=j.length>0?j.join("\n"):void 0,l={role:"assistant",content:h};k&&(l.reasoning_content=k);let m=Math.ceil(f.length/4),n=Math.ceil(h.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:null,choices:[{index:0,message:l,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:m,completion_tokens:n,total_tokens:m+n}}),{status:200,headers:{"Content-Type":"application/json"}})}class z extends d.H{constructor(){super("perplexity-web",e.xq["perplexity-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:l}){var m,n,o,p,q;let r,w,z,A,B,C=b?.messages;if(!C||!Array.isArray(C)||0===C.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:h,headers:{},transformedBody:b};(b?.thinking===!0||b?.reasoning_effort!=null&&"none"!==b.reasoning_effort)&&k[a]?(r="copilot",w=k[a],l?.info?.("PPLX-WEB",`Thinking mode → ${a} using ${w}`)):j[a]?[r,w]=j[a]:(r="copilot",w=a,l?.info?.("PPLX-WEB",`Unmapped model ${a}, using as raw preference`));let D=function(a){let b="",c=[];for(let d of a){let a=String(d.role||"user");"developer"===a&&(a="system");let e="";"string"==typeof d.content?e=d.content:Array.isArray(d.content)&&(e=d.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),e.trim()&&("system"===a?b+=e+"\n":("user"===a||"assistant"===a)&&c.push({role:a,content:e}))}let d="";return c.length>0&&"user"===c[c.length-1].role&&(d=c.pop().content),{systemMsg:b,history:c,currentMsg:d}}(C),E=function(a){if(0===a.length)return null;let b=t(a),c=s.get(b);return c?Date.now()-c.ts>36e5?(s.delete(b),null):c.backendUuid:null}(D.history);E&&l?.info?.("PPLX-WEB",`Session continue: ${E.slice(0,12)}...`);let F=function(a,b,c){if(b)return a.currentMsg;let d={},e=[];a.systemMsg.trim()&&e.push(a.systemMsg.trim());let f=function(a){if(!Array.isArray(a)||0===a.length)return"";let b=a.map(a=>{let b=a?.function||a||{},c=b.name||"unnamed",d=(b.description||"").split("\n")[0].slice(0,200);return`- ${c}: ${d}`});return`Available tools (reference only, cannot invoke):
128
128
  ${b.join("\n")}`}(c);f&&e.push(f),e.push("You have built-in web search. Answer questions directly using search results."),d.instructions=e,a.history.length>0&&(d.history=a.history),a.currentMsg?d.query=a.currentMsg:0===a.history.length&&(d.query="");let g=JSON.stringify(d);return g.length>96e3?g.slice(-96e3):g}(D,E,b?.tools);if(!F.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:h,headers:{},transformedBody:b};let G=(m=r,n=w,B="u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",{query_str:F,params:{query_str:F,search_focus:"internet",mode:m,model_preference:n,sources:["web"],attachments:[],frontend_uuid:crypto.randomUUID(),frontend_context_uuid:crypto.randomUUID(),version:i,language:"en-US",timezone:B,search_recency_filter:null,is_incognito:!0,use_schematized_api:!0,last_backend_uuid:E}}),H={"Content-Type":"application/json",Accept:"text/event-stream",Origin:"https://www.perplexity.ai",Referer:"https://www.perplexity.ai/","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","X-App-ApiClient":"default","X-App-ApiVersion":i};d.accessToken?H.Authorization=`Bearer ${d.accessToken}`:d.apiKey&&(H.Cookie=`__Secure-next-auth.session-token=${d.apiKey}`),l?.info?.("PPLX-WEB",`Query to ${a} (pref=${w}, mode=${r}), len=${F.length}`);let I={method:"POST",headers:H,body:JSON.stringify(G)};e&&(I.signal=e);try{z=await fetch(h,I)}catch(a){return l?.error?.("PPLX-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Perplexity connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:h,headers:H,transformedBody:G}}if(!z.ok){let a=z.status,b=`Perplexity returned HTTP ${a}`;return 401===a||403===a?b="Perplexity auth failed — session cookie may be expired. Re-paste your __Secure-next-auth.session-token.":429===a&&(b="Perplexity rate limited. Wait a moment and retry."),l?.warn?.("PPLX-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:h,headers:H,transformedBody:G}}if(!z.body)return{response:new Response(JSON.stringify({error:{message:"Perplexity returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:h,headers:H,transformedBody:G};let J=`chatcmpl-pplx-${crypto.randomUUID().slice(0,12)}`,K=Math.floor(Date.now()/1e3);if(c){let b;A=new Response((o=z.body,p=D.history,q=D.currentMsg,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:J,object:"chat.completion.chunk",created:K,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="",h=null;for await(let f of x(o,e)){if(f.backendUuid&&(h=f.backendUuid),f.error){c.enqueue(b.encode((0,g.N)({id:J,object:"chat.completion.chunk",created:K,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:J,object:"chat.completion.chunk",created:K,model:a,system_fingerprint:null,choices:[{index:0,delta:{reasoning_content:f.thinking+"\n"},finish_reason:null,logprobs:null}]})));continue}if(f.done){d=f.answer||d;break}let e=f.delta||"";e&&(e=v(e,!1))&&c.enqueue(b.encode((0,g.N)({id:J,object:"chat.completion.chunk",created:K,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:e},finish_reason:null,logprobs:null}]}))),f.answer&&(d=f.answer)}c.enqueue(b.encode((0,g.N)({id:J,object:"chat.completion.chunk",created:K,model:a,system_fingerprint:null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U)),u(p,q,v(d),h)}catch(d){c.enqueue(b.encode((0,g.N)({id:J,object:"chat.completion.chunk",created:K,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else A=await y(z.body,a,J,K,D.history,D.currentMsg,e);return{response:A,url:h,headers:H,transformedBody:G}}}},26878:(a,b,c)=>{c.d(b,{F:()=>f});var d=c(96179),e=c(35024);class f extends d.L{constructor(){super("xiaomi-tokenplan")}buildUrl(a,b,c=0,d=null){let f=(0,e.resolveXiaomiTokenplanBaseUrl)(d);return d?.runtimeTransport?.format==="claude"?`${f.replace(/\/v1\/?$/,"")}/anthropic/v1/messages`:`${f}/chat/completions`}}},32447:(a,b,c)=>{c.d(b,{BL:()=>g});var d=c(96179),e=c(52007);let f=["anthropic_version","anthropic_beta","client_metadata","mcp_servers","stop_sequences","thinking","top_k"];class g extends d.L{constructor(){super("kimchi")}transformRequest(a,b,c,d){let g,h=super.transformRequest(a,b,c,d);if(!h||"object"!=typeof h)return h;for(let a of(!function(a){var b;if(!a?.system||!Array.isArray(a.messages))return;let c=("string"==typeof(b=a.system)?b:Array.isArray(b)?b.map(a=>"string"==typeof a?a:"string"==typeof a?.text?a.text:"").filter(Boolean).join("\n"):"").trim();if(!c)return;let d=a.messages.find(a=>a?.role==="system");d?"string"==typeof d.content?d.content=`${c}
129
129
 
130
- ${d.content}`:Array.isArray(d.content)&&d.content.unshift({type:"text",text:c}):a.messages.unshift({role:"system",content:c})}(h),f))void 0!==h[a]&&delete h[a];if(delete h.system,g=(0,e.gK)(a),(g?.provider==="anthropic"||g?.upstreamProvider==="anthropic"||/(^|[-_/])(?:claude|anthropic)(?:[-_/]|$)/i.test(String(a||"")))&&(delete h.reasoning_effort,delete h.reasoning,delete h.thinking),Array.isArray(h?.messages))for(let a of h.messages)a&&"object"==typeof a&&(delete a.cache_control,Array.isArray(a.content)&&(a.content=a.content.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,signature:c,...d}=a;return d})));Array.isArray(h?.tools)&&(h.tools=h.tools.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,...c}=a;return c}));if(Array.isArray(h?.messages))for(let a of h.messages)a&&"assistant"===a.role&&"string"==typeof a.reasoning_content&&a.reasoning_content.length>8&&delete a.reasoning_content;return h}}},36732:(a,b,c)=>{c.d(b,{Rb:()=>i});var d=c(96179),e=c(12132);let f=new Set(["mimo-x-pro-preview","mimo-x-flash-preview"]),g="__mimoAccountCookie";function h(a,b){if(!b||!Array.isArray(a)||a.some(a=>"string"==typeof a.content&&(a.content.includes("Please UltraThinking")||a.content.includes("[Thinking Directive]"))))return a;let c=a.map(a=>({...a})),d=c.find(a=>"system"===a.role);return d?"string"==typeof d.content?d.content=`${d.content}
130
+ ${d.content}`:Array.isArray(d.content)&&d.content.unshift({type:"text",text:c}):a.messages.unshift({role:"system",content:c})}(h),f))void 0!==h[a]&&delete h[a];if(delete h.system,g=(0,e.gK)(a),(g?.provider==="anthropic"||g?.upstreamProvider==="anthropic"||/(^|[-_/])(?:claude|anthropic)(?:[-_/]|$)/i.test(String(a||"")))&&(delete h.reasoning_effort,delete h.reasoning,delete h.thinking),Array.isArray(h?.messages))for(let a of h.messages)a&&"object"==typeof a&&(delete a.cache_control,Array.isArray(a.content)&&(a.content=a.content.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,signature:c,...d}=a;return d})));Array.isArray(h?.tools)&&(h.tools=h.tools.map(a=>{if(!a||"object"!=typeof a)return a;let{cache_control:b,...c}=a;return c}));if(Array.isArray(h?.messages))for(let a of h.messages)a&&"assistant"===a.role&&"string"==typeof a.reasoning_content&&a.reasoning_content.length>8&&delete a.reasoning_content;return h}}},36732:(a,b,c)=>{c.d(b,{Rb:()=>i});var d=c(96179),e=c(12132),f=c(35024);let g="__mimoAccountCookie";function h(a,b){if(!b||!Array.isArray(a)||a.some(a=>"string"==typeof a.content&&(a.content.includes("Please UltraThinking")||a.content.includes("[Thinking Directive]"))))return a;let c=a.map(a=>({...a})),d=c.find(a=>"system"===a.role);return d?"string"==typeof d.content?d.content=`${d.content}
131
131
 
132
132
  [Thinking Directive]
133
133
  ${b}`:Array.isArray(d.content)&&(d.content=[...d.content,{type:"text",text:`
134
134
 
135
135
  [Thinking Directive]
136
- ${b}`}]):c.unshift({role:"system",content:b}),c}class i extends d.L{constructor(){super("xiaomi-mimo")}static isPreviewModel(a){let b,c;return f.has((c=(b=String(a||"")).indexOf("/"))>=0?b.slice(c+1):b)}buildUrl(a,b,c=0,d=null){return i.isPreviewModel(a)?`${e.SE}/api/route/chat/completions`:super.buildUrl(a,b,c,d)}buildHeaders(a,b=!0,c,d){return i.isPreviewModel(d)&&a?.[g]?{"Content-Type":"application/json",Accept:b?"text/event-stream":"application/json","User-Agent":e.$6,Cookie:a[g]}:super.buildHeaders(a,b,c,d)}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);if(i.isPreviewModel(a)&&e&&"object"==typeof e){let a=e.reasoning_effort||b?.reasoning_effort||b?.output_config?.effort,c="string"==typeof a?a.toLowerCase():null;"xhigh"===c||"max"===c||"ultra"===c?(e.messages=h(e.messages,"Please UltraThinking (Extended): conduct an extensive, multi-step chain-of-thought analysis before taking action or answering. Rigorously challenge all assumptions, stress-test edge cases and failure modes, actively construct counterexamples, and strictly adhere to tool invocation schemas if calling tools."),e.max_tokens||(e.max_tokens=65536)):"high"===c?(e.messages=h(e.messages,"Please UltraThinking: conduct a thorough chain-of-thought analysis before taking action or answering. Systematically explore alternative approaches, verify intermediate steps, and address edge cases while strictly adhering to tool invocation schemas if calling tools."),e.max_tokens||(e.max_tokens=32768)):"medium"===c?e.max_tokens||(e.max_tokens=16384):"low"===c?e.max_tokens||(e.max_tokens=8192):e.max_tokens||(e.max_tokens=4096),null==e.thinking&&(e.thinking={type:"enabled"}),null==e.temperature&&(e.temperature=1),null==e.top_p&&(e.top_p=.95)}return e}async execute(a){let{model:b,credentials:c,proxyOptions:d=null}=a;if(!i.isPreviewModel(b))return super.execute(a);let f=await (0,e.getMimoAccountCookie)(c?.providerSpecificData,d);if(!f){let a=Error("This model requires the Xiaomi MiMo desktop account. Sign in to MiMo Desktop once, then retry.");throw a.code="MIMO_DESKTOP_SESSION_REQUIRED",a}c[g]=f;let h=await super.execute(a);if(401===h.response.status){(0,e.Nv)();let b=await (0,e.getMimoAccountCookie)(c?.providerSpecificData,d).catch(()=>null);if(b)return c[g]=b,super.execute(a)}return h}}},38572:(a,b,c)=>{c.d(b,{$:()=>o});var d=c(74957),e=c(35024),f=c(78959),g=c(92536);let h=e.xq["grok-web"].baseUrl,i={"grok-3":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3",isThinking:!1},"grok-3-mini":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_MINI_THINKING",isThinking:!0},"grok-3-thinking":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_THINKING",isThinking:!0},"grok-4":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4",isThinking:!1},"grok-4-mini":{grokModel:"grok-4-mini",modelMode:"MODEL_MODE_GROK_4_MINI_THINKING",isThinking:!0},"grok-4-thinking":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4_THINKING",isThinking:!0},"grok-4-heavy":{grokModel:"grok-4",modelMode:"MODEL_MODE_HEAVY",isThinking:!0},"grok-4.1-mini":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_MINI_THINKING",isThinking:!0},"grok-4.1-fast":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_FAST",isThinking:!1},"grok-4.1-expert":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_EXPERT",isThinking:!0},"grok-4.1-thinking":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_THINKING",isThinking:!0},"grok-4.2":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20-beta":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1}};function j(a,b=!1){let c=b?"abcdefghijklmnopqrstuvwxyz0123456789":"abcdefghijklmnopqrstuvwxyz",d="";for(let b=0;b<a;b++)d+=c[Math.floor(Math.random()*c.length)];return d}function k(a){let b=new Uint8Array(a);return crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join("")}async function*l(a,b){let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a).trim();if(e=e.slice(a+1),b)try{yield JSON.parse(b)}catch{}}}let a=(e+=d.decode()).trim();if(a)try{yield JSON.parse(a)}catch{}}finally{c.releaseLock()}}async function*m(a,b,c){let d="",e="",f=!1;for await(let g of l(a,c)){if(g.error)return void(yield{error:g.error.message||`Grok error: ${g.error.code}`,done:!0});let a=g.result?.response;if(a){if(a.llmInfo?.modelHash&&!d&&(d=a.llmInfo.modelHash),a.responseId&&(e=a.responseId),a.modelResponse){let c=a.modelResponse;f&&b&&(c.message&&(yield{thinking:c.message}),f=!1),c.message&&(yield{fullMessage:c.message,fingerprint:d,responseId:e}),c.metadata?.llm_info?.modelHash&&(d=c.metadata.llm_info.modelHash);continue}null!=a.token&&(yield{delta:a.token,fingerprint:d,responseId:e})}}yield{done:!0,fingerprint:d,responseId:e}}async function n(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of m(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),l=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:l,total_tokens:k+l}}),{status:200,headers:{"Content-Type":"application/json"}})}class o extends d.H{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:l}){let o,p,q=b?.messages;if(!q||!Array.isArray(q)||0===q.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:h,headers:{},transformedBody:b};let r=i[a];r||l?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:s,modelMode:t,isThinking:u}=r||i["grok-4.1-fast"],v=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(q);if(!v.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:h,headers:{},transformedBody:b};let w={temporary:!0,modelName:s,modelMode:t,message:v,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},x=k(16),y=k(8),z={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${j(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${j(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${x}-${y}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),z.Cookie=`sso=${a}`}l?.info?.("GROK-WEB",`Query to ${a} (grok=${s}, mode=${t}), len=${v.length}`);try{o=await fetch(h,{method:"POST",headers:z,body:JSON.stringify(w),signal:e})}catch(a){return l?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:h,headers:z,transformedBody:w}}if(!o.ok){let a=o.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),l?.warn?.("GROK-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:h,headers:z,transformedBody:w}}if(!o.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:h,headers:z,transformedBody:w};let A=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,B=Math.floor(Date.now()/1e3);if(c){var C;let b;p=new Response((C=o.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of m(C,u,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}catch(d){c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else p=await n(o.body,a,A,B,u,e);return{response:p,url:h,headers:z,transformedBody:w}}}},49059:(a,b,c)=>{c.d(b,{Fe:()=>f,vr:()=>e});var d=c(96179);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f="You are a helpful AI assistant that helps with software engineering tasks.",g=/you are claude code|claude.?code.+official.+cli|anthropic.+official.+cli|anxthxropic.+official.+cli|you are (?:cursor|windsurf|cline|aider|continue|copilot|cody)|you are an? (?:ai )?(?:coding |code )?agent|cc_entrypoint\s*=\s*(?:cli|vscode|jetbrains|gui)|claude.?code.+issues|give feedback.+claude.?code|you are .{0,30}(?:powerful )?ai agent|orchestration capabilities|OhMyOpenCode|<agent-identity>|<Role>|<Behavior_Instructions>/i,h=/hermes|10router|9router|\bclaude code by anthropic\b|\bsystem instructions\b|你的身份|你的角色设定/i;Array.isArray(e.messages)&&(e.messages=e.messages.map(a=>{let b;if(!a||"system"!==a.role)return a;let c="string"==typeof(b=a.content)?b:Array.isArray(b)?b.map(a=>a&&"string"==typeof a.text?a.text:"").join("\n"):"";return!c||h.test(c)?a:g.test(c)?"string"==typeof a.content?{...a,content:f}:{...a,content:[{type:"text",text:f}]}:a})),void 0!==e.reasoning_effort&&"string"!=typeof e.reasoning_effort&&delete e.reasoning_effort;let i=e.reasoning_effort;return"string"==typeof a&&/deepseek/i.test(a)&&("auto"===i||"off"===i)?"auto"===i?e.reasoning_effort="high":delete e.reasoning_effort:"none"===i||"off"===i?delete e.reasoning_effort:i&&(e.reasoning_summary="auto"),e}}function f(a){if(!a||"object"!=typeof a)return!1;if(Array.isArray(a.messages)&&a.messages.length>1200||Array.isArray(a.tools)&&a.tools.length>60)return!0;try{if(JSON.stringify(a).length>3355443.2)return!0}catch{}return!1}},49227:(a,b,c)=>{c.d(b,{hG:()=>C});var d=c(77598),e=c.n(d),f=c(74957),g=c(35024),h=c(93943),i=c(37981),j=c(57247),k=c(90737),l=c(41004),m=c(80662),n=c(19713);let o=null;async function p(a="endpoint-proxy-salt"){let b=function(){if(o)return o;try{o=(0,n.machineIdSync)()}catch{o=e().randomUUID()}return o}();return e().createHash("sha256").update(b+a).digest("hex").substring(0,16)}let q=/^(rs|fc|resp|msg)_/,r=new Set(["web_search","x_search","web_search_preview","file_search","image_generation","code_interpreter","mcp","local_shell"]),s=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","include","temperature","top_p","max_output_tokens","parallel_tool_calls","text","metadata","prompt_cache_key"]),t=["low","medium","high","xhigh"],u=/^(?:rs|msg|fc)_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,v={type:"object",properties:{input:{type:"string"}},required:["input"]},w=new Map,x=new WeakMap;function y(a){let b="string"==typeof a?a.trim().toLowerCase():"";return"max"===b?"xhigh":t.includes(b)?b:"high"}function z(a){return"string"==typeof a?a:void 0===a?"":JSON.stringify(a)}function A(a){return"string"==typeof a&&u.test(a)}function B(a){if(!a||"object"!=typeof a||Array.isArray(a))return a;let{internal_chat_message_metadata_passthrough:b,...c}=a;if("reasoning"===a.type)return A(a.id)&&"string"==typeof a.encrypted_content?c:null;if("custom_tool_call"===a.type){let b=a.call_id||a.id,c="string"==typeof a.name?a.name.trim():"";return b&&c?{type:"function_call",call_id:b,name:c,arguments:JSON.stringify({input:z(a.input??a.arguments)})}:null}if("custom_tool_call_output"===a.type||"function_call_output"===a.type){let b=a.call_id||a.id;return b?{type:"function_call_output",call_id:b,output:z(a.output)}:null}if("function_call"===a.type){let b=a.call_id||a.id,c="string"==typeof a.name?a.name.trim():"";return b&&c?{type:"function_call",...A(a.id)?{id:a.id}:{},call_id:b,name:c,arguments:"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments??{}),..."string"==typeof a.status?{status:a.status}:{}}:null}return c}class C extends f.H{constructor(){super("grok-cli",g.xq["grok-cli"]),this._currentSessionId=null,this._currentReqId=null,this._currentTurnIdx=1,this._agentId=null}buildUrl(){return this.config.baseUrl}async refreshCredentials(a,b,c=null){return a?.refreshToken?(0,h.Vq)("grok-cli",a,b,c):null}needsRefresh(a){return(0,h.fp)("grok-cli",a)}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);for(let[a,b]of Object.entries(this.config.headers||{}))null!=b&&void 0===c[a]&&(c[a]=b);c["x-grok-client-identifier"]=this.config.clientIdentifier||c["x-grok-client-identifier"]||k.rK,c["x-grok-client-version"]=this.config.clientVersion||c["x-grok-client-version"]||k.uG;let d=this._currentSessionId||a?.connectionId||e().randomUUID(),f=this._currentReqId||e().randomUUID();c["x-grok-session-id"]=d,c["x-grok-conv-id"]=d,c["x-grok-req-id"]=f,c["x-grok-turn-idx"]=String(this._currentTurnIdx||1),this._agentId&&(c["x-grok-agent-id"]=this._agentId),this._currentModel&&(c["x-grok-model-override"]=this._currentModel);let g=a?.providerSpecificData||{},h=g.email||a?.email,i=g.userId||a?.userId||a?.providerUserId;return h&&(c["x-email"]=h),i&&(c["x-userid"]=i),c}parseError(a,b){if(402===a.status&&b)try{let a=JSON.parse(b),c=a?.code||"",d=a?.error||a?.message||b;return{status:402,message:"string"==typeof d?d:b,code:"string"==typeof c?c:void 0}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){let f;this._currentSessionId=(f={prompt_cache_key:b?.prompt_cache_key,session_id:b?.session_id,conversation_id:b?.conversation_id,metadata:b?.metadata},(0,m.oV)({headers:d?.rawHeaders,body:f,connectionId:d?.connectionId||d?.id,workspaceId:d?.providerSpecificData?.workspaceId,scope:"grok-cli"})),this._currentReqId=e().randomUUID(),this._agentId=d?.providerSpecificData?.deviceId||d?.providerSpecificData?.agentId||null;let g=(0,i.me)(b.input);g&&(b.input=g),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(Array.isArray(b.messages)&&b.messages.length>0?(b.input=b.messages.map(a=>({type:"message",role:a.role||"user",content:"string"==typeof a.content?a.content:JSON.stringify(a.content??"")})),delete b.messages):b.input=[{type:"message",role:"user",content:"..."}]),function(a){if(!Array.isArray(a?.input))return;let b=a.input.map(B).filter(Boolean),c=new Set(b.filter(a=>a?.type==="function_call"&&a.call_id).map(a=>a.call_id));a.input=b.filter(a=>a?.type!=="function_call_output"||c.has(a.call_id))}(b),Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&q.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&q.test(a.id)&&!A(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools)||0===a.tools.length){delete a.tools,delete a.tool_choice;return}let b=new Set,c=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let d="string"==typeof a.type?a.type:"";if("function"!==d){if(r.has(d))return c.add(d),!0;if(!d&&a.function);else if(d&&"string"!=typeof a.name)return!1}if(!("function"===d||""===d||a.function||"string"==typeof a.name)||r.has(d))return r.has(d);let e=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,f=("string"==typeof a.name?a.name:"string"==typeof e?.name?e.name:"").trim();if(!f)return!1;let g="string"==typeof a.description?a.description:"string"==typeof e?.description?e.description:"",h="custom"===d?v:a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:e?.parameters&&"object"==typeof e.parameters&&!Array.isArray(e.parameters)?e.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=f.slice(0,128),g&&(a.description=g),a.parameters=h,b.add(a.name),!0}),0===a.tools.length){delete a.tools,delete a.tool_choice;return}if(a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)){let d="string"==typeof a.tool_choice.type?a.tool_choice.type:"";if("function"===d||"custom"===d){let c=a.tool_choice.name??a.tool_choice.function?.name,d="string"==typeof c?c.trim().slice(0,128):"";d&&b.has(d)?a.tool_choice={type:"function",name:d}:delete a.tool_choice}else c.has(d)||delete a.tool_choice}}(b),this._currentTurnIdx=function(a,b,c=null){let d=function(a){if(!Array.isArray(a))return 1;let b=0;for(let c of a){if(!c||"object"!=typeof c||Array.isArray(c))continue;let a="string"==typeof c.type?c.type:"";"user"!==c.role||a&&"message"!==a||(b+=1)}return Math.max(1,b)}(b);if(!a)return d;if(c&&x.has(c))return x.get(c);let e=Date.now(),f=w.get(a),g=f&&e-f.lastUsed<=l.v1.sessionTtlMs?f.turn:0;f&&w.delete(a);let h=g>0?Math.max(d,g+ +!!c):d;for(;w.size>=5e3;)w.delete(w.keys().next().value);return w.set(a,{turn:h,lastUsed:e}),c&&x.set(c,h),h}(this._currentSessionId,b.input,b),b.stream=!0,b.store=!1;let h=function(a){if(!a||"string"!=typeof a)return null;for(let b of t)if(a.endsWith(`-${b}`))return b;return null}(b.model||a),n=b.model||a;h&&(n=n.replace(RegExp(`-${h}$`),"")),(n=(0,j.kt)("gcli",n)||n)===(b.model||a)&&(n=(0,j.kt)("grok-cli",n)||n),b.model=n,this._currentModel=n;let o=(0,k.Au)(n);if(b.reasoning&&"object"==typeof b.reasoning?(o?b.reasoning.effort=y(b.reasoning.effort||b.reasoning_effort||h):delete b.reasoning.effort,b.reasoning.summary||(b.reasoning.summary="concise")):(b.reasoning={summary:"concise"},o&&(b.reasoning.effort=y(b.reasoning_effort||h))),delete b.reasoning_effort,b.reasoning&&"none"!==b.reasoning.effort){let a=Array.isArray(b.include)?b.include:[];a.includes("reasoning.encrypted_content")||a.push("reasoning.encrypted_content"),b.include=a}for(let a of(delete b.messages,delete b.max_tokens,delete b.max_completion_tokens,delete b.n,delete b.seed,delete b.logprobs,delete b.top_logprobs,delete b.frequency_penalty,delete b.presence_penalty,delete b.logit_bias,delete b.user,delete b.stream_options,delete b.prompt_cache_retention,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))s.has(a)||delete b[a];return b}async execute(a){if(this._agentId||a.credentials?.providerSpecificData?.deviceId)a.credentials?.providerSpecificData?.deviceId&&(this._agentId=a.credentials.providerSpecificData.deviceId);else try{let a=await p("grok-cli-agent");this._agentId=[a.slice(0,8),a.slice(8,12),"5"+a.slice(13,16),"a"+a.slice(17,20),a.slice(0,12).padEnd(12,"0")].join("-")}catch{this._agentId=e().randomUUID()}return super.execute(a)}}},49804:(a,b,c)=>{c.d(b,{Q_:()=>p,Wc:()=>q,k9:()=>w,le:()=>o,qJ:()=>u,w9:()=>B,xK:()=>h,zn:()=>y});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cloud.zed.dev",h={expiredToken:"x-zed-expired-token",outdatedToken:"x-zed-outdated-token",clientSupportsStatus:"x-zed-client-supports-status-messages",clientSupportsStreamEnded:"x-zed-client-supports-stream-ended-request-completion-status",serverSupportsStatus:"x-zed-server-supports-status-messages",clientSupportsXai:"x-zed-client-supports-x-ai",systemId:"x-zed-system-id"},i="zed-rsa-pkcs1:",j=new Map,k=new Map,l=new Map;function m(a,b){return String(a||b).replace(/\/+$/,"")}function n(a,b,c,d){let e=m(a?.[b],d);return`${e}${c}`}function o(a={},b={}){let{publicKey:c,privateKey:d}=e().generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"pem"}}),f=Number(b.nativeAppPort||a.defaultNativeAppPort||58443),g=b.systemId||e().randomUUID(),h=c.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"),j=new URL(`${m(a.webBaseUrl,"https://zed.dev")}/native_app_signin`);return j.searchParams.set("native_app_port",String(f)),j.searchParams.set("native_app_public_key",h),g&&j.searchParams.set("system_id",g),{authUrl:j.toString(),privateKeyVerifier:`${i}${Buffer.from(d).toString("base64url")}`,nativeAppPort:f,systemId:g,publicKey:h}}function p(a){let b=String(a||"").trim();if(!b)throw Error("Missing Zed callback URL");let c={};try{c=JSON.parse(b)}catch{let a;try{a=new URL(b)}catch{try{a=new URL(`http://127.0.0.1/?${b.replace(/^\?/,"")}`)}catch{throw Error("Invalid Zed callback URL")}}a.searchParams.forEach((a,b)=>{c[b]=a})}let d=c.user_id||c.userId,e=c.access_token||c.accessToken||c.token;if(!d||!e)throw Error("Zed callback must include user_id and access_token");return{userId:String(d),encryptedAccessToken:String(e)}}function q(a,b){let c=function(a){var b;let c=String(a||"");if(!c.startsWith(i))throw Error("Missing Zed private key verifier; restart the login flow");return b=c.slice(i.length),Buffer.from(String(b||""),"base64url").toString("utf8")}(b),d=Buffer.from(String(a),"base64url");try{return e().privateDecrypt({key:c,padding:e().constants.RSA_PKCS1_OAEP_PADDING,oaepHash:"sha256"},d).toString("utf8")}catch(a){try{return e().privateDecrypt({key:c,padding:e().constants.RSA_PKCS1_PADDING},d).toString("utf8")}catch{let b=a instanceof Error?a.message:String(a);throw Error(`Failed to decrypt Zed access token: ${b}`)}}}function r(a){let b=(a?.providerSpecificData||{}).userId||a?.userId,c=a?.accessToken||a?.apiKey;if(!b||!c)throw Error("Zed credential is missing userId or accessToken");return`${b} ${c}`}function s(a){return String(a?.providerSpecificData?.systemId||a?.systemId||"")}async function t(a,b){let c=await (0,f.proxyAwareFetch)(a,b),d=await c.text(),e=null;if(d)try{e=JSON.parse(d)}catch{e={raw:d}}if(!c.ok){let a=Error(String(e?.message||e?.error?.message||e?.error||d||`HTTP ${c.status}`));throw a.status=c.status,a.body=e,a}return e}async function u(a,b={}){let c=b.config||{},d={Accept:"application/json",Authorization:r(a)},e=s(a);return e&&(d[h.systemId]=e),t(n(c,"cloudBaseUrl","/client/users/me",g),{method:"GET",headers:d,signal:b.signal??void 0})}function v(a){if(!a)return"";if("string"==typeof a)return a;if("object"==typeof a&&null!==a){if("string"==typeof a[0])return a[0];if("string"==typeof a.id)return a.id}return String(a)}function w(a,b=null){let c=a?.providerSpecificData||{},d=v(c.organizationId||c.defaultOrganizationId);if(d)return d;let e=v(b?.default_organization_id||b?.defaultOrganizationId);if(e)return e;let f=b?.organizations||[],g=f.find(a=>a?.is_personal)||f[0];return v(g?.id)}async function x(a,b={}){var c;let d,e,f=b.config||{},i=b.organizationId||w(a);if(!i){let c=await u(a,b);i=w(a,c)}if(!i)throw Error("No Zed organization selected");let k=(c=i,d=(a?.providerSpecificData||{}).userId||a?.userId||"unknown",e=a?.accessToken||a?.apiKey||"",`${d}:${c||"default"}:${e.slice(-16)}`),l=j.get(k);if(!b.forceRefresh&&l&&l.expiresAt>Date.now())return l.token;let m={"Content-Type":"application/json",Accept:"application/json",Authorization:r(a)},o=s(a);o&&(m[h.systemId]=o);let p=await t(n(f,"cloudBaseUrl","/client/llm_tokens",g),{method:"POST",headers:m,body:JSON.stringify({organization_id:i}),signal:b.signal??void 0}),q="string"==typeof p?.token?p.token:p?.token?.[0]||p?.token?.value;if(!q)throw Error("Zed did not return an LLM token");return j.set(k,{token:q,expiresAt:Date.now()+3e6}),q}async function y(a,b,c={}){var d;let e=n(c.config||{},"llmBaseUrl",b,"https://cloud.zed.dev"),g=async b=>{let d=await x(a,{...c,forceRefresh:b});return(0,f.proxyAwareFetch)(e,{...c.fetchOptions,headers:{...c.fetchOptions?.headers||{},Authorization:`Bearer ${d}`},signal:c.signal??void 0})},i=await g(!1);return d=i,(d?.status===401||d?.headers?.has?.(h.expiredToken)||d?.headers?.has?.(h.outdatedToken))&&(i=await g(!0)),i}function z(a){if(!a)return"";if("string"==typeof a)return a;if("object"==typeof a&&null!==a){if("string"==typeof a[0])return a[0];if("string"==typeof a.id)return a.id}return String(a)}function A(a){let b=z(a?.id);return b?{id:b,name:a.display_name||a.displayName||b,provider:a.provider,isLatest:!!a.is_latest,contextLength:a.max_token_count??a.maxTokenCount,contextLengthInMaxMode:a.max_token_count_in_max_mode??a.maxTokenCountInMaxMode,maxOutputTokens:a.max_output_tokens??a.maxOutputTokens,supportsTools:!!a.supports_tools,supportsImages:!!a.supports_images,supportsThinking:!!a.supports_thinking,supportsDisablingThinking:!!a.supports_disabling_thinking,supportsFastMode:!!a.supports_fast_mode,supportsServerSideCompaction:!!a.supports_server_side_compaction,supportedEffortLevels:a.supported_effort_levels??a.supportedEffortLevels??[],supportsStreamingTools:!!a.supports_streaming_tools,supportsParallelToolCalls:!!a.supports_parallel_tool_calls,isDisabled:!!a.is_disabled,disabledReason:a.disabled_reason??null}:null}async function B(a,b={}){let c,d,e;if(!a?.accessToken)return null;let f=(d=(c=a?.providerSpecificData||{}).organizationId||c.defaultOrganizationId||"default",e=a?.accessToken||a?.apiKey||"",`${c.userId||"unknown"}:${d}:${e.slice(-16)}`),g=k.get(f);if(!b.forceRefresh&&g&&g.expiresAt>Date.now())return g;let i=l.get(f);if(i&&!b.forceRefresh)return i;let j=(async()=>{let c=await y(a,"/models",{...b,fetchOptions:{method:"GET",headers:{Accept:"application/json",[h.clientSupportsXai]:"true"}}});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`Zed models failed: ${c.status} ${a}`)}let d=await c.json(),e=Array.isArray(d?.models)?d.models:[],g=e.map(A).filter(Boolean).filter(a=>!a.isDisabled),i=new Map;for(let a of e){let b=z(a?.id);b&&i.set(b,a)}let j={expiresAt:Date.now()+36e5,models:g,rawModels:e,rawById:i,defaultModel:z(d?.default_model??d?.defaultModel),defaultFastModel:z(d?.default_fast_model??d?.defaultFastModel),recommendedModels:(d?.recommended_models||d?.recommendedModels||[]).map(z).filter(Boolean)};return k.set(f,j),j})();l.set(f,j);try{return await j}finally{l.get(f)===j&&l.delete(f)}}},51349:(a,b,c)=>{c.d(b,{m:()=>e});var d=c(96179);class e extends d.L{constructor(){super("codebuddy-intl")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=Array.isArray(e.messages)?e.messages:[],g=(Array.isArray(b?.messages)?b.messages:f).some(a=>a&&"assistant"===a.role&&Array.isArray(a.tool_calls)&&a.tool_calls.length>0&&!("string"==typeof a.reasoning_content&&a.reasoning_content.trim()));void 0!==e.reasoning_effort&&"string"!=typeof e.reasoning_effort&&delete e.reasoning_effort;let h=e.reasoning_effort;for(let b of("string"==typeof a&&/deepseek/i.test(a)&&"auto"===h&&!g?(e.reasoning_effort="high",e.reasoning_summary="auto"):g||"none"===h||"off"===h?(delete e.reasoning_effort,delete e.reasoning_summary):h&&(e.reasoning_summary="auto"),e.messages=[{role:"system",content:"You are CodeBuddy Code."}],f))!b||"object"!=typeof b||["system","developer"].includes(b.role)||("user"===b.role&&"string"==typeof b.content?e.messages.push({...b,content:[{type:"text",text:b.content}]}):e.messages.push({...b}));return e}}},55330:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{SB:()=>J});var e=c(39536),f=c(98625),g=c(95128),h=c(11655),i=c(61433),j=c(84315),k=c(69704),l=c(76467),m=c(32447),n=c(19932),o=c(19946),p=c(73870),q=c(4493),r=c(13120),s=c(38572),t=c(49227),u=c(23013),v=c(9708),w=c(90926),x=c(26878),y=c(36732),z=c(16046),A=c(49059),B=c(51349),C=c(13961),D=c(85308),E=c(98665),F=c(93509),G=c(96179),H=c(95089);c(74957);var I=a([o]);o=(I.then?(await I)():I)[0];let K={antigravity:new e.c,azure:new f.P,"gemini-cli":new g.V,github:new h.x,iflow:new i.r,qoder:new j.DH,"qoder-cn":new j.DH("qoder-cn",k.R$),kiro:new l.B,kimchi:new m.BL,codex:new n.T,cursor:new o.o,cu:new o.o,vertex:new p.w("vertex"),"vertex-partner":new p.w("vertex-partner"),opencode:new q.j9,"opencode-go":new r.H,"grok-web":new s.$,"grok-cli":new t.hG,gcli:new t.hG,gb:new t.hG,"perplexity-web":new u.Ay,"ollama-local":new v.D,commandcode:new w.A,"xiaomi-tokenplan":new x.F,"xiaomi-mimo":new y.Rb,"mimo-free":new z.Yh,mmf:new z.Yh,"codebuddy-cn":new A.vr,"codebuddy-intl":new B.m,cline:new C.$,cl:new C.$,trae:new D.A,zed:new E.A,windsurf:new F.Ay,"devin-cli":new H.c},L=new Map;function J(a){return K[a]?K[a]:(L.has(a)||L.set(a,new G.L(a)),L.get(a))}d()}catch(a){d(a)}})},61433:(a,b,c)=>{c.d(b,{r:()=>h});var d=c(55511),e=c.n(d),f=c(74957),g=c(35024);class h extends f.H{constructor(){super("iflow",g.xq.iflow)}generateUUID(){return e().randomUUID()}createIFlowSignature(a,b,c,d){if(!d)return"";let f=`${a}:${b}:${c}`,g=e().createHmac("sha256",d);return g.update(f),g.digest("hex")}buildHeaders(a,b=!0){let c=`session-${this.generateUUID()}`,d=Date.now(),e=this.config.headers["User-Agent"]||"iFlow-Cli",f=a.apiKey||a.accessToken||"",g=this.createIFlowSignature(e,c,d,f),h={"Content-Type":"application/json",...this.config.headers,"session-id":c,"x-iflow-timestamp":d.toString(),"x-iflow-signature":g};return a.apiKey&&(h.Authorization=`Bearer ${a.apiKey}`),b&&(h.Accept="text/event-stream"),h}buildUrl(a,b,c=0,d=null){return this.config.baseUrl}transformRequest(a,b,c,d){return c&&b.messages&&!b.stream_options&&(b.stream_options={include_usage:!0}),b}}},73483:(a,b,c)=>{c.d(b,{Gh:()=>k,IF:()=>o,O9:()=>g,OF:()=>n,WL:()=>h,_6:()=>j,_L:()=>m,f5:()=>l,lm:()=>f});var d=c(14170);let e="1"===process.env.LOG_USAGE_VERBOSE,f={reset:"\x1b[0m",red:"\x1b[31m",green:"\x1b[32m",yellow:"\x1b[33m",blue:"\x1b[34m",cyan:"\x1b[36m"};function g(a){if(!a||"object"!=typeof a)return a;let b={...a};return void 0!==b.input_tokens&&(b.input_tokens+=2e3),void 0!==b.prompt_tokens&&(b.prompt_tokens+=2e3),void 0!==b.total_tokens?b.total_tokens+=2e3:void 0!==b.prompt_tokens&&void 0!==b.completion_tokens&&(b.total_tokens=b.prompt_tokens+b.completion_tokens),b}function h(a,b){if(!a||"object"!=typeof a)return a;let c={[d.h.CLAUDE]:["input_tokens","output_tokens","cache_read_input_tokens","cache_creation_input_tokens","estimated"],[d.h.GEMINI]:["promptTokenCount","candidatesTokenCount","totalTokenCount","cachedContentTokenCount","thoughtsTokenCount","estimated"],[d.h.OPENAI_RESPONSES]:["input_tokens","output_tokens","input_tokens_details","output_tokens_details","estimated"],default:["prompt_tokens","completion_tokens","total_tokens","cached_tokens","reasoning_tokens","prompt_tokens_details","completion_tokens_details","estimated"]},e=c[b];b===d.h.GEMINI_CLI||b===d.h.ANTIGRAVITY?e=c[d.h.GEMINI]:b===d.h.OPENAI_RESPONSE?e=c[d.h.OPENAI_RESPONSES]:e||(e=c.default);let f={};for(let b of e)void 0!==a[b]&&(f[b]=a[b]);return f}function i(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b={},c=(a,c)=>{if(null==c)return;let d=Number(c);Number.isFinite(d)&&(b[a]=d)};return(c("prompt_tokens",a?.prompt_tokens),c("completion_tokens",a?.completion_tokens),c("total_tokens",a?.total_tokens),c("cache_read_input_tokens",a?.cache_read_input_tokens),c("cache_creation_input_tokens",a?.cache_creation_input_tokens),c("cached_tokens",a?.cached_tokens),c("reasoning_tokens",a?.reasoning_tokens),a?.prompt_tokens_details&&"object"==typeof a.prompt_tokens_details&&(b.prompt_tokens_details=a.prompt_tokens_details),a?.completion_tokens_details&&"object"==typeof a.completion_tokens_details&&(b.completion_tokens_details=a.completion_tokens_details),0===Object.keys(b).length)?null:b}function j(a){let b;if(!a||"object"!=typeof a||Array.isArray(a))return null;let c=a=>Number.isFinite(Number(a))?Number(a):0,d=c(a.completion_tokens??a.output_tokens),e=c(a.reasoning_tokens),f=c(a.cache_creation_input_tokens??a.prompt_tokens_details?.cache_creation_tokens),g=c(a.prompt_tokens??a.input_tokens);void 0===a.cached_tokens&&(void 0!==a.cache_read_input_tokens||void 0!==a.cache_creation_input_tokens)?g=g+(b=c(a.cache_read_input_tokens))+f:b=c(a.cached_tokens);let h={prompt_tokens:g,completion_tokens:d,total_tokens:g+d,cached_tokens:b,cache_creation_input_tokens:f};return e>0&&(h.reasoning_tokens=e),h}function k(a){if(!a||"object"!=typeof a)return!1;for(let b of["prompt_tokens","completion_tokens","total_tokens","input_tokens","output_tokens","promptTokenCount","candidatesTokenCount"])if("number"==typeof a[b]&&a[b]>0)return!0;return!1}function l(a){if(!a||"object"!=typeof a)return null;if("message_start"===a.type&&a.message?.usage&&"object"==typeof a.message.usage){let b=a.message.usage;return i({prompt_tokens:b.input_tokens||0,completion_tokens:b.output_tokens||0,cache_read_input_tokens:b.cache_read_input_tokens,cache_creation_input_tokens:b.cache_creation_input_tokens})}if("message_delta"===a.type&&a.usage&&"object"==typeof a.usage)return i({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});if(("response.completed"===a.type||"response.done"===a.type)&&a.response?.usage&&"object"==typeof a.response.usage){let b=a.response.usage,c=b.input_tokens_details?.cached_tokens;return i({prompt_tokens:b.input_tokens||b.prompt_tokens||0,completion_tokens:b.output_tokens||b.completion_tokens||0,cached_tokens:c,reasoning_tokens:b.output_tokens_details?.reasoning_tokens,prompt_tokens_details:c?{cached_tokens:c}:void 0})}if(a.usage&&"object"==typeof a.usage&&void 0!==a.usage.prompt_tokens)return i({prompt_tokens:a.usage.prompt_tokens,completion_tokens:a.usage.completion_tokens||0,cached_tokens:a.usage.prompt_tokens_details?.cached_tokens||a.usage.prompt_cache_hit_tokens,reasoning_tokens:a.usage.completion_tokens_details?.reasoning_tokens,prompt_tokens_details:a.usage.prompt_tokens_details,completion_tokens_details:a.usage.completion_tokens_details});let b=a.usageMetadata||a.response?.usageMetadata;return b&&"object"==typeof b?i({prompt_tokens:b.promptTokenCount||0,completion_tokens:b.candidatesTokenCount||0,total_tokens:b.totalTokenCount,cached_tokens:b.cachedContentTokenCount,reasoning_tokens:b.thoughtsTokenCount}):!0===a.done&&"number"==typeof a.prompt_eval_count?i({prompt_tokens:a.prompt_eval_count||0,completion_tokens:a.eval_count||0,total_tokens:(a.prompt_eval_count||0)+(a.eval_count||0)}):null}function m(a,b){if(!a)return b||null;if(!b)return a;let c={...a};for(let[a,d]of Object.entries(b))"number"==typeof d&&Number.isFinite(d)?c[a]=Math.max("number"==typeof c[a]?c[a]:0,d):d&&"object"==typeof d&&(c[a]=d);return c}function n(a,b,c=d.h.OPENAI){var e,f;return e=function(a){if(!a||"object"!=typeof a)return 0;try{let b=JSON.stringify(a).length;return Math.ceil(b/4)}catch(a){return 0}}(a),f=b&&!(b<=0)?Math.max(1,Math.floor(b/4)):0,c===d.h.CLAUDE?g({input_tokens:e,output_tokens:f,estimated:!0}):g({prompt_tokens:e,completion_tokens:f,total_tokens:e+f,estimated:!0})}function o(a,b,c=null,d=null,g=null){if(!b||"object"!=typeof b||!e)return;let h=a?.toUpperCase()||"UNKNOWN",i=b?.prompt_tokens||b?.input_tokens||0,j=b?.completion_tokens||b?.output_tokens||0,k=d?d.slice(0,8)+"...":"unknown",l=`[${new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}] 📊 ${f.green}[USAGE] ${h} | in=${i} | out=${j} | account=${k}${f.reset}`;b.estimated&&(l+=` ${f.yellow}(estimated)${f.reset}`);let m=b.cache_read_input_tokens||b.cached_tokens||b.prompt_tokens_details?.cached_tokens;m&&(l+=` | cache_read=${m}`);let n=b.cache_creation_input_tokens;n&&(l+=` | cache_create=${n}`);let p=b.reasoning_tokens;p&&(l+=` | reasoning=${p}`),console.log(l)}},73870:(a,b,c)=>{c.d(b,{w:()=>k});var d=c(74957),e=c(35024),f=c(8521),g=c(39609);let h=new Map;function i(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("authorized_user"===b.type&&b.client_id&&b.client_secret&&b.refresh_token)return b;return null}catch{return null}}async function j(a){if(h.has(a))return h.get(a);let b=await fetch(`https://aiplatform.googleapis.com/v1/publishers/google/models/__probe__:generateContent?key=${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}),c=await b.json().catch(()=>null),d=(c?.[0]?.error?.message||c?.error?.message||"").match(/projects\/([^/]+)\//),e=d?.[1]||null;return e&&h.set(a,e),e}class k extends d.H{constructor(a="vertex"){super(a,e.xq[a]||{})}buildUrl(a,b,c=0,d=null){let e=(0,f.Sc)(d?.apiKey),g=i(d?.apiKey),h=!!e||!!g||!!d?.accessToken,j=h?null:d?.apiKey,k=e?.project_id||g?.quota_project_id||d?.providerSpecificData?.projectId;if("vertex-partner"===this.provider){if(!k)throw Error("Vertex partner models require a project_id. Add it in providerSpecificData or use Service Account JSON.");let a=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/global/endpoints/openapi/chat/completions`;return j?`${a}?key=${j}`:a}let l=b?"streamGenerateContent":"generateContent";if(h){if(!k)throw Error("Vertex OAuth/ADC requires a project_id. Add quota_project_id to your ADC JSON or set providerSpecificData.projectId.");let c=d?.providerSpecificData?.location||"us-central1",e=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/${c}/publishers/google/models/${a}:${l}`;return b&&(e+="?alt=sse"),e}let m=`https://aiplatform.googleapis.com/v1/publishers/google/models/${a}:${l}`;return b&&(m+="?alt=sse"),j&&(m+=b?`&key=${j}`:`?key=${j}`),m}buildHeaders(a,b=!0){let c={"Content-Type":"application/json"};return a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),b&&(c.Accept="text/event-stream"),c}async refreshCredentials(a,b){let c=(0,f.Sc)(a?.apiKey);if(!c)return null;let d=await (0,f.pb)(c,b);return d?{accessToken:d.accessToken,expiresAt:d.expiresAt}:null}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:h,proxyOptions:k=null}){let l=(0,f.Sc)(d?.apiKey),m=i(d?.apiKey);if(l){let a=await (0,f.pb)(l,h);if(!a?.accessToken)throw Error("Vertex: failed to mint access token from Service Account JSON");d.accessToken=a.accessToken}if(m){let a=await (0,f.I9)(m.refresh_token,m.client_id,m.client_secret,h);if(!a?.accessToken)throw Error("Vertex: failed to refresh access token from ADC JSON (authorized_user)");d.accessToken=a.accessToken}if("vertex-partner"===this.provider&&!l&&!m&&!d?.providerSpecificData?.projectId){let a=await j(d.apiKey);if(!a)throw Error("Vertex: could not resolve project_id from API key. Please add it manually in provider settings.");h?.debug?.("VERTEX",`Resolved project_id: ${a}`),d.providerSpecificData={...d.providerSpecificData,projectId:a}}let n=this.buildUrl(a,c,0,d),o=this.buildHeaders(d,c),p=this.transformRequest(a,b,c,d);return{response:await (0,g.proxyAwareFetch)(n,{method:"POST",headers:o,body:JSON.stringify(p),signal:e},k),url:n,headers:o,transformedBody:p}}}},76467:(a,b,c)=>{c.d(b,{B:()=>L});var d=c(74957),e=c(35024),f=c(6382),g=c(94755),h=c(8521),i=c(78959),j=c(66306),k=c(41004);let l=new Set(["assistantResponseEvent","reasoningContentEvent","codeEvent","toolUseEvent","messageStopEvent","metadataEvent","MetadataEvent","contextUsageEvent","meteringEvent","metricsEvent"]),m=new TextEncoder,n=new TextDecoder,o=Uint32Array.from({length:256},(a,b)=>{let c=b;for(let a=0;a<8;a++)c=c>>>1^(1&c?0xedb88320:0);return c>>>0}),p=Object.freeze({tool:"Retry the previous response because its Kiro tool_call wrapper was malformed. If you use the wrapper tool named tool_call, its input must contain a non-empty name and an arguments field.",ellipsis:"Retry the previous response because it ended with only an ellipsis. Return the complete final answer, not only ... or ….",short_final:"Retry the previous response because its final only announced a future action. Complete the check now and return the result or a concrete blocker."}),q=/^(?:(?:(?:現在|接著|接下來|下一步)[,,::\s]*(?:我(?:只)?(?:會|要|將|再)?\s*)?|我只再)(?:補|查|確認|驗證|追(?:查|蹤)?|繼續|檢查|測試)|我(?:會|要|將)(?:再|重新)?(?:補(?:齊|查)?|抓取|查(?:詢)?|確認|驗證|追(?:查|蹤)?|繼續|檢查|測試)|(?:(?:next|now|then)\b[\s,:-]*)?(?:i(?:'ll| will| am going to| need to)|let me)\s+(?:verify|check|confirm|validate|investigate|trace|continue|follow up|test)\b)/iu,r=/^目前證據顯示[\s\S]{1,700}[。.!?;;]\s*最後補查\s+504\s+access\s+log[,,]\s*確認\s+host[//]路徑與是否為集中流量[。.!]?$/iu,s=/^(?:(?:next|now|then)\b[\s,:-]*)?(?:i(?:'ll| will| am going to| need to)|let me)\s+(?:verify|check|confirm|validate|investigate|trace|continue|follow up|test)\b/iu,t=/(?:[:;\n]|[.!?]\s+\S|\b(?:status|checksum|response|deployment)\s+(?:is|are|was|were|matches?|equals?|returned)\b)/iu,u=/^(?:(?:現在|接著|接下來|下一步)[,,::\s]*(?:我(?:只)?(?:會|要|將|再)?\s*)?|我只再|我(?:會|要|將)(?:再|重新)?)(?:補|抓取|查|確認|驗證|追|繼續|檢查|測試)/u,v=/(?:[。!?]\s*\S|(?:版本|狀態|回應|結果|部署|校驗碼)(?:是|為|等於|顯示))/u,w=/(?:請(?:你|先)|你(?:先|需要|可以|提供|確認|批准|允許)|等待(?:你|使用者)|等你|核准|同意|授權|\b(?:after|when|once)\s+you\b|\byour\s+(?:approval|confirmation|permission|input)\b|\bwait(?:ing)?\s+for\s+you\b|\bplease\s+(?:approve|confirm|provide|send)\b)/iu,x=/(?:已(?:經)?完成|完成(?:了|驗證|確認)|修復完成|確認無誤|驗證(?:完成|通過)|測試(?:均)?通過|結論|總結|\b(?:done|completed|fixed|verified|confirmed|passed|in conclusion|summary)\b|\b(?:is|are) complete\b)/iu,y=/(?:顯示|發現|因此|成功|失敗|正常|無錯誤|沒有錯誤|\b(?:found|shows?|showed|because|therefore|succeeded|failed|healthy|green|no errors?)\b)/iu;function z(a){let b=0xffffffff;for(let c of a)b=o[(b^c)&255]^b>>>8;return(0xffffffff^b)>>>0}function A(a,b){let c=Number.parseInt(process.env?.[a]||"",10);return Number.isFinite(c)&&c>0?c:b}function B(a,b){let c=new Uint8Array(b),d=0;for(let b of a)c.set(b,d),d+=b.byteLength;return c}function C(a){let b=Error(a?.message||a||"Request aborted");return b.name="AbortError",b}async function D(a,b,c,d){let e,f;if(b?.aborted)throw C(b.reason);let g=new Promise((a,b)=>{e=setTimeout(()=>b(Error(d)),c)}),h=new Promise((a,c)=>{f=()=>c(C(b.reason)),b?.addEventListener("abort",f,{once:!0})});try{return await Promise.race([a.read(),g,h])}finally{clearTimeout(e),b?.removeEventListener?.("abort",f)}}async function E(a,b,c,d){let e=a?.body?.getReader?.();if(!e)return"";let f=[],g=0;try{for(;g<c;){let{done:a,value:h}=await D(e,b,d,"Kiro retry error body stalled");if(a)break;let i=c-g,j=h.byteLength>i?h.slice(0,i):h;if(f.push(j),g+=j.byteLength,h.byteLength>i)break}}finally{await e.cancel("bounded Kiro retry error body").catch(()=>{})}return n.decode(B(f,g))}function F(a){let b=String(a||"").trim().replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase().replace(/[\s-]+/g,"_");return["endturn","end_turn","stop","stop_sequence"].includes(b)?"end_turn":["tooluse","tool_use","tool_calls"].includes(b)?"tool_use":["maxtokens","max_tokens","max_output_tokens","length"].includes(b)?"max_tokens":b||null}let G=new Set(["model_context_window_exceeded","max_tokens"]);function H(a,b){return["malformed_model_output","invalid_model_output"].includes(a)?"retryable_protocol_failure":["cancelled","pause_turn","model_context_window_exceeded"].includes(a)?"terminal_incomplete":"refusal"===a||/(?:content.*filter|guardrail|safety|policy|blocked)/u.test(a)?"terminal_refusal":"max_tokens"===a?b?"terminal_incomplete":"length":a&&!["end_turn","tool_use"].includes(a)?"unknown_failure":b||"tool_use"===a?"tool_use":a&&"end_turn"!==a?"unknown_failure":"complete"}function I(a,b){if(!b)return a;if(!a)return b;let c=a=>{let b=H(a,!1);return"terminal_refusal"===b?6:"terminal_incomplete"===b?5:"unknown_failure"===b?4:"retryable_protocol_failure"===b?3:"length"===b?2:1};return c(b)>c(a)?b:a}function J(a){return["...","…"].includes(String(a||"").trim())}function K(a,b,c){return m.encode(`data: ${JSON.stringify({error:{message:b,type:"upstream_error",code:a,...c?{details:c}:{}}})}
136
+ ${b}`}]):c.unshift({role:"system",content:b}),c}class i extends d.L{constructor(a="xiaomi-mimo"){super(a)}usesAccountSession(){return"mimo-desktop"===this.provider}buildUrl(a,b,c=0,d=null){if(this.usesAccountSession())return`${e.SE}/api/route/chat/completions`;let g=d?.runtimeTransport,h=(0,f.normalizeMimoApiBase)(d?.providerSpecificData?.baseUrl);return g?.baseUrl&&h?g.baseUrl.endsWith("/anthropic/v1/messages")?`${h.replace(/\/v1$/,"")}/anthropic/v1/messages`:`${h}/chat/completions`:super.buildUrl(a,b,c,d)}buildHeaders(a,b=!0,c,d){return this.usesAccountSession()&&a?.[g]?{"Content-Type":"application/json",Accept:b?"text/event-stream":"application/json","User-Agent":e.$6,Cookie:a[g]}:super.buildHeaders(a,b,c,d)}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);if(this.usesAccountSession()&&e&&"object"==typeof e){let a=e.reasoning_effort||b?.reasoning_effort||b?.output_config?.effort,c="string"==typeof a?a.toLowerCase():null;"xhigh"===c||"max"===c||"ultra"===c?(e.messages=h(e.messages,"Please UltraThinking (Extended): conduct an extensive, multi-step chain-of-thought analysis before taking action or answering. Rigorously challenge all assumptions, stress-test edge cases and failure modes, actively construct counterexamples, and strictly adhere to tool invocation schemas if calling tools."),e.max_tokens||(e.max_tokens=65536)):"high"===c?(e.messages=h(e.messages,"Please UltraThinking: conduct a thorough chain-of-thought analysis before taking action or answering. Systematically explore alternative approaches, verify intermediate steps, and address edge cases while strictly adhering to tool invocation schemas if calling tools."),e.max_tokens||(e.max_tokens=32768)):"medium"===c?e.max_tokens||(e.max_tokens=16384):"low"===c?e.max_tokens||(e.max_tokens=8192):e.max_tokens||(e.max_tokens=4096),null==e.thinking&&(e.thinking={type:"enabled"}),null==e.temperature&&(e.temperature=1),null==e.top_p&&(e.top_p=.95)}return e}async execute(a){let{model:b,credentials:c,proxyOptions:d=null}=a;if(!this.usesAccountSession())return super.execute(a);let f=await (0,e.getMimoAccountCookie)(c?.providerSpecificData,d);if(!f){let a=Error("This model requires the Xiaomi MiMo desktop account. Sign in to MiMo Desktop once, then retry.");throw a.code="MIMO_DESKTOP_SESSION_REQUIRED",a}c[g]=f;let h=await super.execute(a);if(401===h.response.status){(0,e.Nv)();let b=await (0,e.getMimoAccountCookie)(c?.providerSpecificData,d).catch(()=>null);if(b)return c[g]=b,super.execute(a)}return h}}},38572:(a,b,c)=>{c.d(b,{$:()=>o});var d=c(74957),e=c(35024),f=c(78959),g=c(92536);let h=e.xq["grok-web"].baseUrl,i={"grok-3":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3",isThinking:!1},"grok-3-mini":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_MINI_THINKING",isThinking:!0},"grok-3-thinking":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_THINKING",isThinking:!0},"grok-4":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4",isThinking:!1},"grok-4-mini":{grokModel:"grok-4-mini",modelMode:"MODEL_MODE_GROK_4_MINI_THINKING",isThinking:!0},"grok-4-thinking":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4_THINKING",isThinking:!0},"grok-4-heavy":{grokModel:"grok-4",modelMode:"MODEL_MODE_HEAVY",isThinking:!0},"grok-4.1-mini":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_MINI_THINKING",isThinking:!0},"grok-4.1-fast":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_FAST",isThinking:!1},"grok-4.1-expert":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_EXPERT",isThinking:!0},"grok-4.1-thinking":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_THINKING",isThinking:!0},"grok-4.2":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20-beta":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1}};function j(a,b=!1){let c=b?"abcdefghijklmnopqrstuvwxyz0123456789":"abcdefghijklmnopqrstuvwxyz",d="";for(let b=0;b<a;b++)d+=c[Math.floor(Math.random()*c.length)];return d}function k(a){let b=new Uint8Array(a);return crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join("")}async function*l(a,b){let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a).trim();if(e=e.slice(a+1),b)try{yield JSON.parse(b)}catch{}}}let a=(e+=d.decode()).trim();if(a)try{yield JSON.parse(a)}catch{}}finally{c.releaseLock()}}async function*m(a,b,c){let d="",e="",f=!1;for await(let g of l(a,c)){if(g.error)return void(yield{error:g.error.message||`Grok error: ${g.error.code}`,done:!0});let a=g.result?.response;if(a){if(a.llmInfo?.modelHash&&!d&&(d=a.llmInfo.modelHash),a.responseId&&(e=a.responseId),a.modelResponse){let c=a.modelResponse;f&&b&&(c.message&&(yield{thinking:c.message}),f=!1),c.message&&(yield{fullMessage:c.message,fingerprint:d,responseId:e}),c.metadata?.llm_info?.modelHash&&(d=c.metadata.llm_info.modelHash);continue}null!=a.token&&(yield{delta:a.token,fingerprint:d,responseId:e})}}yield{done:!0,fingerprint:d,responseId:e}}async function n(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of m(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),l=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:l,total_tokens:k+l}}),{status:200,headers:{"Content-Type":"application/json"}})}class o extends d.H{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:l}){let o,p,q=b?.messages;if(!q||!Array.isArray(q)||0===q.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:h,headers:{},transformedBody:b};let r=i[a];r||l?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:s,modelMode:t,isThinking:u}=r||i["grok-4.1-fast"],v=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(q);if(!v.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:h,headers:{},transformedBody:b};let w={temporary:!0,modelName:s,modelMode:t,message:v,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},x=k(16),y=k(8),z={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${j(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${j(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${x}-${y}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),z.Cookie=`sso=${a}`}l?.info?.("GROK-WEB",`Query to ${a} (grok=${s}, mode=${t}), len=${v.length}`);try{o=await fetch(h,{method:"POST",headers:z,body:JSON.stringify(w),signal:e})}catch(a){return l?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:h,headers:z,transformedBody:w}}if(!o.ok){let a=o.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),l?.warn?.("GROK-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:h,headers:z,transformedBody:w}}if(!o.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:h,headers:z,transformedBody:w};let A=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,B=Math.floor(Date.now()/1e3);if(c){var C;let b;p=new Response((C=o.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of m(C,u,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}catch(d){c.enqueue(b.encode((0,g.N)({id:A,object:"chat.completion.chunk",created:B,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else p=await n(o.body,a,A,B,u,e);return{response:p,url:h,headers:z,transformedBody:w}}}},49059:(a,b,c)=>{c.d(b,{Fe:()=>f,vr:()=>e});var d=c(96179);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f="You are a helpful AI assistant that helps with software engineering tasks.",g=/you are claude code|claude.?code.+official.+cli|anthropic.+official.+cli|anxthxropic.+official.+cli|you are (?:cursor|windsurf|cline|aider|continue|copilot|cody)|you are an? (?:ai )?(?:coding |code )?agent|cc_entrypoint\s*=\s*(?:cli|vscode|jetbrains|gui)|claude.?code.+issues|give feedback.+claude.?code|you are .{0,30}(?:powerful )?ai agent|orchestration capabilities|OhMyOpenCode|<agent-identity>|<Role>|<Behavior_Instructions>/i,h=/hermes|10router|9router|\bclaude code by anthropic\b|\bsystem instructions\b|你的身份|你的角色设定/i;Array.isArray(e.messages)&&(e.messages=e.messages.map(a=>{let b;if(!a||"system"!==a.role)return a;let c="string"==typeof(b=a.content)?b:Array.isArray(b)?b.map(a=>a&&"string"==typeof a.text?a.text:"").join("\n"):"";return!c||h.test(c)?a:g.test(c)?"string"==typeof a.content?{...a,content:f}:{...a,content:[{type:"text",text:f}]}:a})),void 0!==e.reasoning_effort&&"string"!=typeof e.reasoning_effort&&delete e.reasoning_effort;let i=e.reasoning_effort;return"string"==typeof a&&/deepseek/i.test(a)&&("auto"===i||"off"===i)?"auto"===i?e.reasoning_effort="high":delete e.reasoning_effort:"none"===i||"off"===i?delete e.reasoning_effort:i&&(e.reasoning_summary="auto"),e}}function f(a){if(!a||"object"!=typeof a)return!1;if(Array.isArray(a.messages)&&a.messages.length>1200||Array.isArray(a.tools)&&a.tools.length>60)return!0;try{if(JSON.stringify(a).length>3355443.2)return!0}catch{}return!1}},49227:(a,b,c)=>{c.d(b,{hG:()=>C});var d=c(77598),e=c.n(d),f=c(74957),g=c(35024),h=c(93943),i=c(37981),j=c(57247),k=c(90737),l=c(41004),m=c(80662),n=c(19713);let o=null;async function p(a="endpoint-proxy-salt"){let b=function(){if(o)return o;try{o=(0,n.machineIdSync)()}catch{o=e().randomUUID()}return o}();return e().createHash("sha256").update(b+a).digest("hex").substring(0,16)}let q=/^(rs|fc|resp|msg)_/,r=new Set(["web_search","x_search","web_search_preview","file_search","image_generation","code_interpreter","mcp","local_shell"]),s=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","include","temperature","top_p","max_output_tokens","parallel_tool_calls","text","metadata","prompt_cache_key"]),t=["low","medium","high","xhigh"],u=/^(?:rs|msg|fc)_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,v={type:"object",properties:{input:{type:"string"}},required:["input"]},w=new Map,x=new WeakMap;function y(a){let b="string"==typeof a?a.trim().toLowerCase():"";return"max"===b?"xhigh":t.includes(b)?b:"high"}function z(a){return"string"==typeof a?a:void 0===a?"":JSON.stringify(a)}function A(a){return"string"==typeof a&&u.test(a)}function B(a){if(!a||"object"!=typeof a||Array.isArray(a))return a;let{internal_chat_message_metadata_passthrough:b,...c}=a;if("reasoning"===a.type)return A(a.id)&&"string"==typeof a.encrypted_content?c:null;if("custom_tool_call"===a.type){let b=a.call_id||a.id,c="string"==typeof a.name?a.name.trim():"";return b&&c?{type:"function_call",call_id:b,name:c,arguments:JSON.stringify({input:z(a.input??a.arguments)})}:null}if("custom_tool_call_output"===a.type||"function_call_output"===a.type){let b=a.call_id||a.id;return b?{type:"function_call_output",call_id:b,output:z(a.output)}:null}if("function_call"===a.type){let b=a.call_id||a.id,c="string"==typeof a.name?a.name.trim():"";return b&&c?{type:"function_call",...A(a.id)?{id:a.id}:{},call_id:b,name:c,arguments:"string"==typeof a.arguments?a.arguments:JSON.stringify(a.arguments??{}),..."string"==typeof a.status?{status:a.status}:{}}:null}return c}class C extends f.H{constructor(){super("grok-cli",g.xq["grok-cli"]),this._currentSessionId=null,this._currentReqId=null,this._currentTurnIdx=1,this._agentId=null}buildUrl(){return this.config.baseUrl}async refreshCredentials(a,b,c=null){return a?.refreshToken?(0,h.Vq)("grok-cli",a,b,c):null}needsRefresh(a){return(0,h.fp)("grok-cli",a)}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);for(let[a,b]of Object.entries(this.config.headers||{}))null!=b&&void 0===c[a]&&(c[a]=b);c["x-grok-client-identifier"]=this.config.clientIdentifier||c["x-grok-client-identifier"]||k.rK,c["x-grok-client-version"]=this.config.clientVersion||c["x-grok-client-version"]||k.uG;let d=this._currentSessionId||a?.connectionId||e().randomUUID(),f=this._currentReqId||e().randomUUID();c["x-grok-session-id"]=d,c["x-grok-conv-id"]=d,c["x-grok-req-id"]=f,c["x-grok-turn-idx"]=String(this._currentTurnIdx||1),this._agentId&&(c["x-grok-agent-id"]=this._agentId),this._currentModel&&(c["x-grok-model-override"]=this._currentModel);let g=a?.providerSpecificData||{},h=g.email||a?.email,i=g.userId||a?.userId||a?.providerUserId;return h&&(c["x-email"]=h),i&&(c["x-userid"]=i),c}parseError(a,b){if(402===a.status&&b)try{let a=JSON.parse(b),c=a?.code||"",d=a?.error||a?.message||b;return{status:402,message:"string"==typeof d?d:b,code:"string"==typeof c?c:void 0}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){let f;this._currentSessionId=(f={prompt_cache_key:b?.prompt_cache_key,session_id:b?.session_id,conversation_id:b?.conversation_id,metadata:b?.metadata},(0,m.oV)({headers:d?.rawHeaders,body:f,connectionId:d?.connectionId||d?.id,workspaceId:d?.providerSpecificData?.workspaceId,scope:"grok-cli"})),this._currentReqId=e().randomUUID(),this._agentId=d?.providerSpecificData?.deviceId||d?.providerSpecificData?.agentId||null;let g=(0,i.me)(b.input);g&&(b.input=g),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(Array.isArray(b.messages)&&b.messages.length>0?(b.input=b.messages.map(a=>({type:"message",role:a.role||"user",content:"string"==typeof a.content?a.content:JSON.stringify(a.content??"")})),delete b.messages):b.input=[{type:"message",role:"user",content:"..."}]),function(a){if(!Array.isArray(a?.input))return;let b=a.input.map(B).filter(Boolean),c=new Set(b.filter(a=>a?.type==="function_call"&&a.call_id).map(a=>a.call_id));a.input=b.filter(a=>a?.type!=="function_call_output"||c.has(a.call_id))}(b),Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&q.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&q.test(a.id)&&!A(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools)||0===a.tools.length){delete a.tools,delete a.tool_choice;return}let b=new Set,c=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let d="string"==typeof a.type?a.type:"";if("function"!==d){if(r.has(d))return c.add(d),!0;if(!d&&a.function);else if(d&&"string"!=typeof a.name)return!1}if(!("function"===d||""===d||a.function||"string"==typeof a.name)||r.has(d))return r.has(d);let e=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,f=("string"==typeof a.name?a.name:"string"==typeof e?.name?e.name:"").trim();if(!f)return!1;let g="string"==typeof a.description?a.description:"string"==typeof e?.description?e.description:"",h="custom"===d?v:a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:e?.parameters&&"object"==typeof e.parameters&&!Array.isArray(e.parameters)?e.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=f.slice(0,128),g&&(a.description=g),a.parameters=h,b.add(a.name),!0}),0===a.tools.length){delete a.tools,delete a.tool_choice;return}if(a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)){let d="string"==typeof a.tool_choice.type?a.tool_choice.type:"";if("function"===d||"custom"===d){let c=a.tool_choice.name??a.tool_choice.function?.name,d="string"==typeof c?c.trim().slice(0,128):"";d&&b.has(d)?a.tool_choice={type:"function",name:d}:delete a.tool_choice}else c.has(d)||delete a.tool_choice}}(b),this._currentTurnIdx=function(a,b,c=null){let d=function(a){if(!Array.isArray(a))return 1;let b=0;for(let c of a){if(!c||"object"!=typeof c||Array.isArray(c))continue;let a="string"==typeof c.type?c.type:"";"user"!==c.role||a&&"message"!==a||(b+=1)}return Math.max(1,b)}(b);if(!a)return d;if(c&&x.has(c))return x.get(c);let e=Date.now(),f=w.get(a),g=f&&e-f.lastUsed<=l.v1.sessionTtlMs?f.turn:0;f&&w.delete(a);let h=g>0?Math.max(d,g+ +!!c):d;for(;w.size>=5e3;)w.delete(w.keys().next().value);return w.set(a,{turn:h,lastUsed:e}),c&&x.set(c,h),h}(this._currentSessionId,b.input,b),b.stream=!0,b.store=!1;let h=function(a){if(!a||"string"!=typeof a)return null;for(let b of t)if(a.endsWith(`-${b}`))return b;return null}(b.model||a),n=b.model||a;h&&(n=n.replace(RegExp(`-${h}$`),"")),(n=(0,j.kt)("gcli",n)||n)===(b.model||a)&&(n=(0,j.kt)("grok-cli",n)||n),b.model=n,this._currentModel=n;let o=(0,k.Au)(n);if(b.reasoning&&"object"==typeof b.reasoning?(o?b.reasoning.effort=y(b.reasoning.effort||b.reasoning_effort||h):delete b.reasoning.effort,b.reasoning.summary||(b.reasoning.summary="concise")):(b.reasoning={summary:"concise"},o&&(b.reasoning.effort=y(b.reasoning_effort||h))),delete b.reasoning_effort,b.reasoning&&"none"!==b.reasoning.effort){let a=Array.isArray(b.include)?b.include:[];a.includes("reasoning.encrypted_content")||a.push("reasoning.encrypted_content"),b.include=a}for(let a of(delete b.messages,delete b.max_tokens,delete b.max_completion_tokens,delete b.n,delete b.seed,delete b.logprobs,delete b.top_logprobs,delete b.frequency_penalty,delete b.presence_penalty,delete b.logit_bias,delete b.user,delete b.stream_options,delete b.prompt_cache_retention,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))s.has(a)||delete b[a];return b}async execute(a){if(this._agentId||a.credentials?.providerSpecificData?.deviceId)a.credentials?.providerSpecificData?.deviceId&&(this._agentId=a.credentials.providerSpecificData.deviceId);else try{let a=await p("grok-cli-agent");this._agentId=[a.slice(0,8),a.slice(8,12),"5"+a.slice(13,16),"a"+a.slice(17,20),a.slice(0,12).padEnd(12,"0")].join("-")}catch{this._agentId=e().randomUUID()}return super.execute(a)}}},49804:(a,b,c)=>{c.d(b,{Q_:()=>p,Wc:()=>q,k9:()=>w,le:()=>o,qJ:()=>u,w9:()=>B,xK:()=>h,zn:()=>y});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cloud.zed.dev",h={expiredToken:"x-zed-expired-token",outdatedToken:"x-zed-outdated-token",clientSupportsStatus:"x-zed-client-supports-status-messages",clientSupportsStreamEnded:"x-zed-client-supports-stream-ended-request-completion-status",serverSupportsStatus:"x-zed-server-supports-status-messages",clientSupportsXai:"x-zed-client-supports-x-ai",systemId:"x-zed-system-id"},i="zed-rsa-pkcs1:",j=new Map,k=new Map,l=new Map;function m(a,b){return String(a||b).replace(/\/+$/,"")}function n(a,b,c,d){let e=m(a?.[b],d);return`${e}${c}`}function o(a={},b={}){let{publicKey:c,privateKey:d}=e().generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"pkcs1",format:"der"},privateKeyEncoding:{type:"pkcs1",format:"pem"}}),f=Number(b.nativeAppPort||a.defaultNativeAppPort||58443),g=b.systemId||e().randomUUID(),h=c.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"),j=new URL(`${m(a.webBaseUrl,"https://zed.dev")}/native_app_signin`);return j.searchParams.set("native_app_port",String(f)),j.searchParams.set("native_app_public_key",h),g&&j.searchParams.set("system_id",g),{authUrl:j.toString(),privateKeyVerifier:`${i}${Buffer.from(d).toString("base64url")}`,nativeAppPort:f,systemId:g,publicKey:h}}function p(a){let b=String(a||"").trim();if(!b)throw Error("Missing Zed callback URL");let c={};try{c=JSON.parse(b)}catch{let a;try{a=new URL(b)}catch{try{a=new URL(`http://127.0.0.1/?${b.replace(/^\?/,"")}`)}catch{throw Error("Invalid Zed callback URL")}}a.searchParams.forEach((a,b)=>{c[b]=a})}let d=c.user_id||c.userId,e=c.access_token||c.accessToken||c.token;if(!d||!e)throw Error("Zed callback must include user_id and access_token");return{userId:String(d),encryptedAccessToken:String(e)}}function q(a,b){let c=function(a){var b;let c=String(a||"");if(!c.startsWith(i))throw Error("Missing Zed private key verifier; restart the login flow");return b=c.slice(i.length),Buffer.from(String(b||""),"base64url").toString("utf8")}(b),d=Buffer.from(String(a),"base64url");try{return e().privateDecrypt({key:c,padding:e().constants.RSA_PKCS1_OAEP_PADDING,oaepHash:"sha256"},d).toString("utf8")}catch(a){try{return e().privateDecrypt({key:c,padding:e().constants.RSA_PKCS1_PADDING},d).toString("utf8")}catch{let b=a instanceof Error?a.message:String(a);throw Error(`Failed to decrypt Zed access token: ${b}`)}}}function r(a){let b=(a?.providerSpecificData||{}).userId||a?.userId,c=a?.accessToken||a?.apiKey;if(!b||!c)throw Error("Zed credential is missing userId or accessToken");return`${b} ${c}`}function s(a){return String(a?.providerSpecificData?.systemId||a?.systemId||"")}async function t(a,b){let c=await (0,f.proxyAwareFetch)(a,b),d=await c.text(),e=null;if(d)try{e=JSON.parse(d)}catch{e={raw:d}}if(!c.ok){let a=Error(String(e?.message||e?.error?.message||e?.error||d||`HTTP ${c.status}`));throw a.status=c.status,a.body=e,a}return e}async function u(a,b={}){let c=b.config||{},d={Accept:"application/json",Authorization:r(a)},e=s(a);return e&&(d[h.systemId]=e),t(n(c,"cloudBaseUrl","/client/users/me",g),{method:"GET",headers:d,signal:b.signal??void 0})}function v(a){if(!a)return"";if("string"==typeof a)return a;if("object"==typeof a&&null!==a){if("string"==typeof a[0])return a[0];if("string"==typeof a.id)return a.id}return String(a)}function w(a,b=null){let c=a?.providerSpecificData||{},d=v(c.organizationId||c.defaultOrganizationId);if(d)return d;let e=v(b?.default_organization_id||b?.defaultOrganizationId);if(e)return e;let f=b?.organizations||[],g=f.find(a=>a?.is_personal)||f[0];return v(g?.id)}async function x(a,b={}){var c;let d,e,f=b.config||{},i=b.organizationId||w(a);if(!i){let c=await u(a,b);i=w(a,c)}if(!i)throw Error("No Zed organization selected");let k=(c=i,d=(a?.providerSpecificData||{}).userId||a?.userId||"unknown",e=a?.accessToken||a?.apiKey||"",`${d}:${c||"default"}:${e.slice(-16)}`),l=j.get(k);if(!b.forceRefresh&&l&&l.expiresAt>Date.now())return l.token;let m={"Content-Type":"application/json",Accept:"application/json",Authorization:r(a)},o=s(a);o&&(m[h.systemId]=o);let p=await t(n(f,"cloudBaseUrl","/client/llm_tokens",g),{method:"POST",headers:m,body:JSON.stringify({organization_id:i}),signal:b.signal??void 0}),q="string"==typeof p?.token?p.token:p?.token?.[0]||p?.token?.value;if(!q)throw Error("Zed did not return an LLM token");return j.set(k,{token:q,expiresAt:Date.now()+3e6}),q}async function y(a,b,c={}){var d;let e=n(c.config||{},"llmBaseUrl",b,"https://cloud.zed.dev"),g=async b=>{let d=await x(a,{...c,forceRefresh:b});return(0,f.proxyAwareFetch)(e,{...c.fetchOptions,headers:{...c.fetchOptions?.headers||{},Authorization:`Bearer ${d}`},signal:c.signal??void 0})},i=await g(!1);return d=i,(d?.status===401||d?.headers?.has?.(h.expiredToken)||d?.headers?.has?.(h.outdatedToken))&&(i=await g(!0)),i}function z(a){if(!a)return"";if("string"==typeof a)return a;if("object"==typeof a&&null!==a){if("string"==typeof a[0])return a[0];if("string"==typeof a.id)return a.id}return String(a)}function A(a){let b=z(a?.id);return b?{id:b,name:a.display_name||a.displayName||b,provider:a.provider,isLatest:!!a.is_latest,contextLength:a.max_token_count??a.maxTokenCount,contextLengthInMaxMode:a.max_token_count_in_max_mode??a.maxTokenCountInMaxMode,maxOutputTokens:a.max_output_tokens??a.maxOutputTokens,supportsTools:!!a.supports_tools,supportsImages:!!a.supports_images,supportsThinking:!!a.supports_thinking,supportsDisablingThinking:!!a.supports_disabling_thinking,supportsFastMode:!!a.supports_fast_mode,supportsServerSideCompaction:!!a.supports_server_side_compaction,supportedEffortLevels:a.supported_effort_levels??a.supportedEffortLevels??[],supportsStreamingTools:!!a.supports_streaming_tools,supportsParallelToolCalls:!!a.supports_parallel_tool_calls,isDisabled:!!a.is_disabled,disabledReason:a.disabled_reason??null}:null}async function B(a,b={}){let c,d,e;if(!a?.accessToken)return null;let f=(d=(c=a?.providerSpecificData||{}).organizationId||c.defaultOrganizationId||"default",e=a?.accessToken||a?.apiKey||"",`${c.userId||"unknown"}:${d}:${e.slice(-16)}`),g=k.get(f);if(!b.forceRefresh&&g&&g.expiresAt>Date.now())return g;let i=l.get(f);if(i&&!b.forceRefresh)return i;let j=(async()=>{let c=await y(a,"/models",{...b,fetchOptions:{method:"GET",headers:{Accept:"application/json",[h.clientSupportsXai]:"true"}}});if(!c.ok){let a=await c.text().catch(()=>"");throw Error(`Zed models failed: ${c.status} ${a}`)}let d=await c.json(),e=Array.isArray(d?.models)?d.models:[],g=e.map(A).filter(Boolean).filter(a=>!a.isDisabled),i=new Map;for(let a of e){let b=z(a?.id);b&&i.set(b,a)}let j={expiresAt:Date.now()+36e5,models:g,rawModels:e,rawById:i,defaultModel:z(d?.default_model??d?.defaultModel),defaultFastModel:z(d?.default_fast_model??d?.defaultFastModel),recommendedModels:(d?.recommended_models||d?.recommendedModels||[]).map(z).filter(Boolean)};return k.set(f,j),j})();l.set(f,j);try{return await j}finally{l.get(f)===j&&l.delete(f)}}},51349:(a,b,c)=>{c.d(b,{m:()=>e});var d=c(96179);class e extends d.L{constructor(){super("codebuddy-intl")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=Array.isArray(e.messages)?e.messages:[],g=(Array.isArray(b?.messages)?b.messages:f).some(a=>a&&"assistant"===a.role&&Array.isArray(a.tool_calls)&&a.tool_calls.length>0&&!("string"==typeof a.reasoning_content&&a.reasoning_content.trim()));void 0!==e.reasoning_effort&&"string"!=typeof e.reasoning_effort&&delete e.reasoning_effort;let h=e.reasoning_effort;for(let b of("string"==typeof a&&/deepseek/i.test(a)&&"auto"===h&&!g?(e.reasoning_effort="high",e.reasoning_summary="auto"):g||"none"===h||"off"===h?(delete e.reasoning_effort,delete e.reasoning_summary):h&&(e.reasoning_summary="auto"),e.messages=[{role:"system",content:"You are CodeBuddy Code."}],f))!b||"object"!=typeof b||["system","developer"].includes(b.role)||("user"===b.role&&"string"==typeof b.content?e.messages.push({...b,content:[{type:"text",text:b.content}]}):e.messages.push({...b}));return e}}},55330:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{SB:()=>J});var e=c(39536),f=c(98625),g=c(95128),h=c(11655),i=c(61433),j=c(84315),k=c(69704),l=c(76467),m=c(32447),n=c(19932),o=c(19946),p=c(73870),q=c(4493),r=c(13120),s=c(38572),t=c(49227),u=c(23013),v=c(9708),w=c(90926),x=c(26878),y=c(36732),z=c(16046),A=c(49059),B=c(51349),C=c(13961),D=c(85308),E=c(98665),F=c(93509),G=c(96179),H=c(95089);c(74957);var I=a([o]);o=(I.then?(await I)():I)[0];let K={antigravity:new e.c,azure:new f.P,"gemini-cli":new g.V,github:new h.x,iflow:new i.r,qoder:new j.DH,"qoder-cn":new j.DH("qoder-cn",k.R$),kiro:new l.B,kimchi:new m.BL,codex:new n.T,cursor:new o.o,cu:new o.o,vertex:new p.w("vertex"),"vertex-partner":new p.w("vertex-partner"),opencode:new q.j9,"opencode-go":new r.H,"grok-web":new s.$,"grok-cli":new t.hG,gcli:new t.hG,gb:new t.hG,"perplexity-web":new u.Ay,"ollama-local":new v.D,commandcode:new w.A,"xiaomi-tokenplan":new x.F,"xiaomi-mimo":new y.Rb,"mimo-desktop":new y.Rb("mimo-desktop"),"mimo-free":new z.Yh,mmf:new z.Yh,"codebuddy-cn":new A.vr,"codebuddy-intl":new B.m,cline:new C.$,cl:new C.$,trae:new D.A,zed:new E.A,windsurf:new F.Ay,"devin-cli":new H.c},L=new Map;function J(a){return K[a]?K[a]:(L.has(a)||L.set(a,new G.L(a)),L.get(a))}d()}catch(a){d(a)}})},61433:(a,b,c)=>{c.d(b,{r:()=>h});var d=c(55511),e=c.n(d),f=c(74957),g=c(35024);class h extends f.H{constructor(){super("iflow",g.xq.iflow)}generateUUID(){return e().randomUUID()}createIFlowSignature(a,b,c,d){if(!d)return"";let f=`${a}:${b}:${c}`,g=e().createHmac("sha256",d);return g.update(f),g.digest("hex")}buildHeaders(a,b=!0){let c=`session-${this.generateUUID()}`,d=Date.now(),e=this.config.headers["User-Agent"]||"iFlow-Cli",f=a.apiKey||a.accessToken||"",g=this.createIFlowSignature(e,c,d,f),h={"Content-Type":"application/json",...this.config.headers,"session-id":c,"x-iflow-timestamp":d.toString(),"x-iflow-signature":g};return a.apiKey&&(h.Authorization=`Bearer ${a.apiKey}`),b&&(h.Accept="text/event-stream"),h}buildUrl(a,b,c=0,d=null){return this.config.baseUrl}transformRequest(a,b,c,d){return c&&b.messages&&!b.stream_options&&(b.stream_options={include_usage:!0}),b}}},73483:(a,b,c)=>{c.d(b,{Gh:()=>k,IF:()=>o,O9:()=>g,OF:()=>n,WL:()=>h,_6:()=>j,_L:()=>m,f5:()=>l,lm:()=>f});var d=c(14170);let e="1"===process.env.LOG_USAGE_VERBOSE,f={reset:"\x1b[0m",red:"\x1b[31m",green:"\x1b[32m",yellow:"\x1b[33m",blue:"\x1b[34m",cyan:"\x1b[36m"};function g(a){if(!a||"object"!=typeof a)return a;let b={...a};return void 0!==b.input_tokens&&(b.input_tokens+=2e3),void 0!==b.prompt_tokens&&(b.prompt_tokens+=2e3),void 0!==b.total_tokens?b.total_tokens+=2e3:void 0!==b.prompt_tokens&&void 0!==b.completion_tokens&&(b.total_tokens=b.prompt_tokens+b.completion_tokens),b}function h(a,b){if(!a||"object"!=typeof a)return a;let c={[d.h.CLAUDE]:["input_tokens","output_tokens","cache_read_input_tokens","cache_creation_input_tokens","estimated"],[d.h.GEMINI]:["promptTokenCount","candidatesTokenCount","totalTokenCount","cachedContentTokenCount","thoughtsTokenCount","estimated"],[d.h.OPENAI_RESPONSES]:["input_tokens","output_tokens","input_tokens_details","output_tokens_details","estimated"],default:["prompt_tokens","completion_tokens","total_tokens","cached_tokens","reasoning_tokens","prompt_tokens_details","completion_tokens_details","estimated"]},e=c[b];b===d.h.GEMINI_CLI||b===d.h.ANTIGRAVITY?e=c[d.h.GEMINI]:b===d.h.OPENAI_RESPONSE?e=c[d.h.OPENAI_RESPONSES]:e||(e=c.default);let f={};for(let b of e)void 0!==a[b]&&(f[b]=a[b]);return f}function i(a){if(!a||"object"!=typeof a||Array.isArray(a))return null;let b={},c=(a,c)=>{if(null==c)return;let d=Number(c);Number.isFinite(d)&&(b[a]=d)};return(c("prompt_tokens",a?.prompt_tokens),c("completion_tokens",a?.completion_tokens),c("total_tokens",a?.total_tokens),c("cache_read_input_tokens",a?.cache_read_input_tokens),c("cache_creation_input_tokens",a?.cache_creation_input_tokens),c("cached_tokens",a?.cached_tokens),c("reasoning_tokens",a?.reasoning_tokens),a?.prompt_tokens_details&&"object"==typeof a.prompt_tokens_details&&(b.prompt_tokens_details=a.prompt_tokens_details),a?.completion_tokens_details&&"object"==typeof a.completion_tokens_details&&(b.completion_tokens_details=a.completion_tokens_details),0===Object.keys(b).length)?null:b}function j(a){let b;if(!a||"object"!=typeof a||Array.isArray(a))return null;let c=a=>Number.isFinite(Number(a))?Number(a):0,d=c(a.completion_tokens??a.output_tokens),e=c(a.reasoning_tokens),f=c(a.cache_creation_input_tokens??a.prompt_tokens_details?.cache_creation_tokens),g=c(a.prompt_tokens??a.input_tokens);void 0===a.cached_tokens&&(void 0!==a.cache_read_input_tokens||void 0!==a.cache_creation_input_tokens)?g=g+(b=c(a.cache_read_input_tokens))+f:b=c(a.cached_tokens);let h={prompt_tokens:g,completion_tokens:d,total_tokens:g+d,cached_tokens:b,cache_creation_input_tokens:f};return e>0&&(h.reasoning_tokens=e),h}function k(a){if(!a||"object"!=typeof a)return!1;for(let b of["prompt_tokens","completion_tokens","total_tokens","input_tokens","output_tokens","promptTokenCount","candidatesTokenCount"])if("number"==typeof a[b]&&a[b]>0)return!0;return!1}function l(a){if(!a||"object"!=typeof a)return null;if("message_start"===a.type&&a.message?.usage&&"object"==typeof a.message.usage){let b=a.message.usage;return i({prompt_tokens:b.input_tokens||0,completion_tokens:b.output_tokens||0,cache_read_input_tokens:b.cache_read_input_tokens,cache_creation_input_tokens:b.cache_creation_input_tokens})}if("message_delta"===a.type&&a.usage&&"object"==typeof a.usage)return i({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});if(("response.completed"===a.type||"response.done"===a.type)&&a.response?.usage&&"object"==typeof a.response.usage){let b=a.response.usage,c=b.input_tokens_details?.cached_tokens;return i({prompt_tokens:b.input_tokens||b.prompt_tokens||0,completion_tokens:b.output_tokens||b.completion_tokens||0,cached_tokens:c,reasoning_tokens:b.output_tokens_details?.reasoning_tokens,prompt_tokens_details:c?{cached_tokens:c}:void 0})}if(a.usage&&"object"==typeof a.usage&&void 0!==a.usage.prompt_tokens)return i({prompt_tokens:a.usage.prompt_tokens,completion_tokens:a.usage.completion_tokens||0,cached_tokens:a.usage.prompt_tokens_details?.cached_tokens||a.usage.prompt_cache_hit_tokens,reasoning_tokens:a.usage.completion_tokens_details?.reasoning_tokens,prompt_tokens_details:a.usage.prompt_tokens_details,completion_tokens_details:a.usage.completion_tokens_details});let b=a.usageMetadata||a.response?.usageMetadata;return b&&"object"==typeof b?i({prompt_tokens:b.promptTokenCount||0,completion_tokens:b.candidatesTokenCount||0,total_tokens:b.totalTokenCount,cached_tokens:b.cachedContentTokenCount,reasoning_tokens:b.thoughtsTokenCount}):!0===a.done&&"number"==typeof a.prompt_eval_count?i({prompt_tokens:a.prompt_eval_count||0,completion_tokens:a.eval_count||0,total_tokens:(a.prompt_eval_count||0)+(a.eval_count||0)}):null}function m(a,b){if(!a)return b||null;if(!b)return a;let c={...a};for(let[a,d]of Object.entries(b))"number"==typeof d&&Number.isFinite(d)?c[a]=Math.max("number"==typeof c[a]?c[a]:0,d):d&&"object"==typeof d&&(c[a]=d);return c}function n(a,b,c=d.h.OPENAI){var e,f;return e=function(a){if(!a||"object"!=typeof a)return 0;try{let b=JSON.stringify(a).length;return Math.ceil(b/4)}catch(a){return 0}}(a),f=b&&!(b<=0)?Math.max(1,Math.floor(b/4)):0,c===d.h.CLAUDE?g({input_tokens:e,output_tokens:f,estimated:!0}):g({prompt_tokens:e,completion_tokens:f,total_tokens:e+f,estimated:!0})}function o(a,b,c=null,d=null,g=null){if(!b||"object"!=typeof b||!e)return;let h=a?.toUpperCase()||"UNKNOWN",i=b?.prompt_tokens||b?.input_tokens||0,j=b?.completion_tokens||b?.output_tokens||0,k=d?d.slice(0,8)+"...":"unknown",l=`[${new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}] 📊 ${f.green}[USAGE] ${h} | in=${i} | out=${j} | account=${k}${f.reset}`;b.estimated&&(l+=` ${f.yellow}(estimated)${f.reset}`);let m=b.cache_read_input_tokens||b.cached_tokens||b.prompt_tokens_details?.cached_tokens;m&&(l+=` | cache_read=${m}`);let n=b.cache_creation_input_tokens;n&&(l+=` | cache_create=${n}`);let p=b.reasoning_tokens;p&&(l+=` | reasoning=${p}`),console.log(l)}},73870:(a,b,c)=>{c.d(b,{w:()=>k});var d=c(74957),e=c(35024),f=c(8521),g=c(39609);let h=new Map;function i(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("authorized_user"===b.type&&b.client_id&&b.client_secret&&b.refresh_token)return b;return null}catch{return null}}async function j(a){if(h.has(a))return h.get(a);let b=await fetch(`https://aiplatform.googleapis.com/v1/publishers/google/models/__probe__:generateContent?key=${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"}),c=await b.json().catch(()=>null),d=(c?.[0]?.error?.message||c?.error?.message||"").match(/projects\/([^/]+)\//),e=d?.[1]||null;return e&&h.set(a,e),e}class k extends d.H{constructor(a="vertex"){super(a,e.xq[a]||{})}buildUrl(a,b,c=0,d=null){let e=(0,f.Sc)(d?.apiKey),g=i(d?.apiKey),h=!!e||!!g||!!d?.accessToken,j=h?null:d?.apiKey,k=e?.project_id||g?.quota_project_id||d?.providerSpecificData?.projectId;if("vertex-partner"===this.provider){if(!k)throw Error("Vertex partner models require a project_id. Add it in providerSpecificData or use Service Account JSON.");let a=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/global/endpoints/openapi/chat/completions`;return j?`${a}?key=${j}`:a}let l=b?"streamGenerateContent":"generateContent";if(h){if(!k)throw Error("Vertex OAuth/ADC requires a project_id. Add quota_project_id to your ADC JSON or set providerSpecificData.projectId.");let c=d?.providerSpecificData?.location||"us-central1",e=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/${c}/publishers/google/models/${a}:${l}`;return b&&(e+="?alt=sse"),e}let m=`https://aiplatform.googleapis.com/v1/publishers/google/models/${a}:${l}`;return b&&(m+="?alt=sse"),j&&(m+=b?`&key=${j}`:`?key=${j}`),m}buildHeaders(a,b=!0){let c={"Content-Type":"application/json"};return a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),b&&(c.Accept="text/event-stream"),c}async refreshCredentials(a,b){let c=(0,f.Sc)(a?.apiKey);if(!c)return null;let d=await (0,f.pb)(c,b);return d?{accessToken:d.accessToken,expiresAt:d.expiresAt}:null}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:h,proxyOptions:k=null}){let l=(0,f.Sc)(d?.apiKey),m=i(d?.apiKey);if(l){let a=await (0,f.pb)(l,h);if(!a?.accessToken)throw Error("Vertex: failed to mint access token from Service Account JSON");d.accessToken=a.accessToken}if(m){let a=await (0,f.I9)(m.refresh_token,m.client_id,m.client_secret,h);if(!a?.accessToken)throw Error("Vertex: failed to refresh access token from ADC JSON (authorized_user)");d.accessToken=a.accessToken}if("vertex-partner"===this.provider&&!l&&!m&&!d?.providerSpecificData?.projectId){let a=await j(d.apiKey);if(!a)throw Error("Vertex: could not resolve project_id from API key. Please add it manually in provider settings.");h?.debug?.("VERTEX",`Resolved project_id: ${a}`),d.providerSpecificData={...d.providerSpecificData,projectId:a}}let n=this.buildUrl(a,c,0,d),o=this.buildHeaders(d,c),p=this.transformRequest(a,b,c,d);return{response:await (0,g.proxyAwareFetch)(n,{method:"POST",headers:o,body:JSON.stringify(p),signal:e},k),url:n,headers:o,transformedBody:p}}}},76467:(a,b,c)=>{c.d(b,{B:()=>L});var d=c(74957),e=c(35024),f=c(6382),g=c(94755),h=c(8521),i=c(78959),j=c(66306),k=c(41004);let l=new Set(["assistantResponseEvent","reasoningContentEvent","codeEvent","toolUseEvent","messageStopEvent","metadataEvent","MetadataEvent","contextUsageEvent","meteringEvent","metricsEvent"]),m=new TextEncoder,n=new TextDecoder,o=Uint32Array.from({length:256},(a,b)=>{let c=b;for(let a=0;a<8;a++)c=c>>>1^(1&c?0xedb88320:0);return c>>>0}),p=Object.freeze({tool:"Retry the previous response because its Kiro tool_call wrapper was malformed. If you use the wrapper tool named tool_call, its input must contain a non-empty name and an arguments field.",ellipsis:"Retry the previous response because it ended with only an ellipsis. Return the complete final answer, not only ... or ….",short_final:"Retry the previous response because its final only announced a future action. Complete the check now and return the result or a concrete blocker."}),q=/^(?:(?:(?:現在|接著|接下來|下一步)[,,::\s]*(?:我(?:只)?(?:會|要|將|再)?\s*)?|我只再)(?:補|查|確認|驗證|追(?:查|蹤)?|繼續|檢查|測試)|我(?:會|要|將)(?:再|重新)?(?:補(?:齊|查)?|抓取|查(?:詢)?|確認|驗證|追(?:查|蹤)?|繼續|檢查|測試)|(?:(?:next|now|then)\b[\s,:-]*)?(?:i(?:'ll| will| am going to| need to)|let me)\s+(?:verify|check|confirm|validate|investigate|trace|continue|follow up|test)\b)/iu,r=/^目前證據顯示[\s\S]{1,700}[。.!?;;]\s*最後補查\s+504\s+access\s+log[,,]\s*確認\s+host[//]路徑與是否為集中流量[。.!]?$/iu,s=/^(?:(?:next|now|then)\b[\s,:-]*)?(?:i(?:'ll| will| am going to| need to)|let me)\s+(?:verify|check|confirm|validate|investigate|trace|continue|follow up|test)\b/iu,t=/(?:[:;\n]|[.!?]\s+\S|\b(?:status|checksum|response|deployment)\s+(?:is|are|was|were|matches?|equals?|returned)\b)/iu,u=/^(?:(?:現在|接著|接下來|下一步)[,,::\s]*(?:我(?:只)?(?:會|要|將|再)?\s*)?|我只再|我(?:會|要|將)(?:再|重新)?)(?:補|抓取|查|確認|驗證|追|繼續|檢查|測試)/u,v=/(?:[。!?]\s*\S|(?:版本|狀態|回應|結果|部署|校驗碼)(?:是|為|等於|顯示))/u,w=/(?:請(?:你|先)|你(?:先|需要|可以|提供|確認|批准|允許)|等待(?:你|使用者)|等你|核准|同意|授權|\b(?:after|when|once)\s+you\b|\byour\s+(?:approval|confirmation|permission|input)\b|\bwait(?:ing)?\s+for\s+you\b|\bplease\s+(?:approve|confirm|provide|send)\b)/iu,x=/(?:已(?:經)?完成|完成(?:了|驗證|確認)|修復完成|確認無誤|驗證(?:完成|通過)|測試(?:均)?通過|結論|總結|\b(?:done|completed|fixed|verified|confirmed|passed|in conclusion|summary)\b|\b(?:is|are) complete\b)/iu,y=/(?:顯示|發現|因此|成功|失敗|正常|無錯誤|沒有錯誤|\b(?:found|shows?|showed|because|therefore|succeeded|failed|healthy|green|no errors?)\b)/iu;function z(a){let b=0xffffffff;for(let c of a)b=o[(b^c)&255]^b>>>8;return(0xffffffff^b)>>>0}function A(a,b){let c=Number.parseInt(process.env?.[a]||"",10);return Number.isFinite(c)&&c>0?c:b}function B(a,b){let c=new Uint8Array(b),d=0;for(let b of a)c.set(b,d),d+=b.byteLength;return c}function C(a){let b=Error(a?.message||a||"Request aborted");return b.name="AbortError",b}async function D(a,b,c,d){let e,f;if(b?.aborted)throw C(b.reason);let g=new Promise((a,b)=>{e=setTimeout(()=>b(Error(d)),c)}),h=new Promise((a,c)=>{f=()=>c(C(b.reason)),b?.addEventListener("abort",f,{once:!0})});try{return await Promise.race([a.read(),g,h])}finally{clearTimeout(e),b?.removeEventListener?.("abort",f)}}async function E(a,b,c,d){let e=a?.body?.getReader?.();if(!e)return"";let f=[],g=0;try{for(;g<c;){let{done:a,value:h}=await D(e,b,d,"Kiro retry error body stalled");if(a)break;let i=c-g,j=h.byteLength>i?h.slice(0,i):h;if(f.push(j),g+=j.byteLength,h.byteLength>i)break}}finally{await e.cancel("bounded Kiro retry error body").catch(()=>{})}return n.decode(B(f,g))}function F(a){let b=String(a||"").trim().replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase().replace(/[\s-]+/g,"_");return["endturn","end_turn","stop","stop_sequence"].includes(b)?"end_turn":["tooluse","tool_use","tool_calls"].includes(b)?"tool_use":["maxtokens","max_tokens","max_output_tokens","length"].includes(b)?"max_tokens":b||null}let G=new Set(["model_context_window_exceeded","max_tokens"]);function H(a,b){return["malformed_model_output","invalid_model_output"].includes(a)?"retryable_protocol_failure":["cancelled","pause_turn","model_context_window_exceeded"].includes(a)?"terminal_incomplete":"refusal"===a||/(?:content.*filter|guardrail|safety|policy|blocked)/u.test(a)?"terminal_refusal":"max_tokens"===a?b?"terminal_incomplete":"length":a&&!["end_turn","tool_use"].includes(a)?"unknown_failure":b||"tool_use"===a?"tool_use":a&&"end_turn"!==a?"unknown_failure":"complete"}function I(a,b){if(!b)return a;if(!a)return b;let c=a=>{let b=H(a,!1);return"terminal_refusal"===b?6:"terminal_incomplete"===b?5:"unknown_failure"===b?4:"retryable_protocol_failure"===b?3:"length"===b?2:1};return c(b)>c(a)?b:a}function J(a){return["...","…"].includes(String(a||"").trim())}function K(a,b,c){return m.encode(`data: ${JSON.stringify({error:{message:b,type:"upstream_error",code:a,...c?{details:c}:{}}})}
137
137
 
138
138
  data: [DONE]
139
139
 
@@ -202,7 +202,7 @@ ${a}`}d.trim()&&("system"===a?b.push(`[System]
202
202
  ${d}`):"assistant"===a?b.push(`[Assistant]
203
203
  ${d}`):"tool"===a?b.push(`[Tool]
204
204
  ${d}`):b.push(`[User]
205
- ${d}`))}return b.join("\n\n")||"(empty)"}(k),p=function(a){let b=[],c=a=>{"string"==typeof a&&a.trim()&&b.push(a.trim())};c(a?.cwd),c(a?.working_directory),c(a?.workdir),c(a?.workspace),c(a?.metadata?.cwd),c(a?.metadata?.working_directory);let d=a=>{if("string"==typeof a)for(let b of a.matchAll(/<cwd>\s*([^<]+?)\s*<\/cwd>/gi))c(b[1])},e=a=>{if(Array.isArray(a)){for(let b of a)if(b){if("string"==typeof b.content)d(b.content);else if(Array.isArray(b.content))for(let a of b.content)"string"==typeof a?d(a):a&&"object"==typeof a&&(d(a.text),d(a.input_text),d(a.content));if("string"==typeof b&&d(b),"message"===b.type&&Array.isArray(b.content))for(let a of b.content)d(a?.text||a?.input_text)}}};for(let c of(e(a?.messages),e(a?.input),b))try{if(f().isAbsolute(c)&&j().existsSync(c)&&j().statSync(c).isDirectory())return c}catch{}return h().tmpdir()}(i),q=function(){let a=process.env.CLI_DEVIN_BIN?.trim();if(a)return a;let b="win32"===process.platform,c=h().homedir();for(let a of b?[f().join(process.env.LOCALAPPDATA||f().join(c,"AppData","Local"),"devin","cli","bin","devin.exe"),f().join(c,".local","bin","devin.exe"),f().join(c,"scoop","shims","devin.exe"),f().join(process.env.LOCALAPPDATA||f().join(c,"AppData","Local"),"Programs","devin","devin.exe")]:[f().join(c,".local","share","devin","bin","devin"),f().join(c,".devin","bin","devin"),f().join(c,".local","bin","devin"),"/opt/homebrew/bin/devin","/usr/local/bin/devin","/usr/bin/devin"])if(j().existsSync(a))return a;return b?"devin.exe":"devin"}();g?.info?.("DEVIN",`devin acp → model=${a}, bin=${q}, cwd=${p}`);let r=null,s={},t=process.env.DEVIN_MCP_SERVERS?.trim();if(t)try{Object.assign(s,JSON.parse(t))}catch(a){g?.info?.("DEVIN",`DEVIN_MCP_SERVERS parse failed: ${a.message}`)}let u=Array.isArray(i.tools)?i.tools.filter(Boolean):[],v=function(a){let b=new Map,c={};for(let d of a){if(d?.role==="assistant"&&Array.isArray(d.tool_calls))for(let a of d.tool_calls){let c=a?.function?.name||a?.name;a?.id&&c&&b.set(a.id,n(c))}if(d?.role==="assistant"&&Array.isArray(d.content))for(let a of d.content)a?.type==="tool_use"&&a.id&&a.name&&b.set(a.id,n(a.name));if(d?.role==="tool"&&d.tool_call_id){let a=b.get(d.tool_call_id);a&&(c[a]="string"==typeof d.content?d.content:JSON.stringify(d.content??""))}if(d?.role==="user"&&Array.isArray(d.content)){for(let a of d.content)if(a?.type==="tool_result"&&a.tool_use_id){let d=b.get(a.tool_use_id);if(d){let b=a.content;c[d]="string"==typeof b?b:JSON.stringify(b??"")}}}}return c}(k),w=function(a,b){let c,d=[];for(let b of a){if(!b)continue;let a=b.function||b;a?.name&&d.push({name:n(a.name),description:a.description||"",inputSchema:a.parameters||a.input_schema||{type:"object",properties:{}}})}if(!d.length)return null;let e={DEVIN_MCP_TOOLS:JSON.stringify(d)};return b&&Object.keys(b).length&&(e.DEVIN_MCP_RESULTS=JSON.stringify(b)),{command:process.execPath,args:[(c=f().join(h().tmpdir(),"9router-devin-client-tools.mjs"),j().writeFileSync(c,l),c)],env:e}}(u,v),x=!!w;if(w){s.clientTools=w;let a=Object.keys(v).length;g?.info?.("DEVIN",`exposing ${u.length} client tool(s) as MCP`+(a?` (seeded ${a} result(s))`:""))}if(Object.keys(s).length)try{r=j().mkdtempSync(f().join(h().tmpdir(),"devin-mcp-"));let a=f().join(r,"devin");j().mkdirSync(a,{recursive:!0}),j().writeFileSync(f().join(a,"config.json"),JSON.stringify({mcpServers:s})),g?.info?.("DEVIN",`mcp config written → ${r}`)}catch(a){g?.info?.("DEVIN",`mcp config write failed: ${a.message}`),r=null}let y=()=>{if(r){try{j().rmSync(r,{recursive:!0,force:!0})}catch{}r=null}};return{response:new Response(new ReadableStream({start(b){let c=new TextEncoder,f=a=>b.enqueue(c.encode(a)),h={...process.env};h.DEVIN_PERMISSION_MODE=process.env.DEVIN_PERMISSION_MODE||"bypass",r&&(h.XDG_CONFIG_HOME=r);let i=process.env.CLI_DEVIN_AGENT_TYPE?.trim(),j=["acp"];i&&j.push("--agent-type",i);let k=(0,d.spawn)(q,j,{env:h,cwd:p,stdio:["pipe","pipe","pipe"],shell:"win32"===process.platform}),l=null,n=!1;k.on("error",a=>{l=a;let c=a.message.includes("ENOENT")||a.message.includes("not found")?`Devin CLI not found: ${q}. Install via https://cli.devin.ai or set CLI_DEVIN_BIN env var.`:`Devin CLI spawn error: ${a.message}`;f(`data: ${JSON.stringify({error:{message:c,type:"devin_cli_error",code:"spawn_failed"}})}
205
+ ${d}`))}return b.join("\n\n")||"(empty)"}(k),p=function(a){let b=[],c=a=>{"string"==typeof a&&a.trim()&&b.push(a.trim())};c(a?.cwd),c(a?.working_directory),c(a?.workdir),c(a?.workspace),c(a?.metadata?.cwd),c(a?.metadata?.working_directory);let d=a=>{if("string"==typeof a)for(let b of a.matchAll(/<cwd>\s*([^<]+?)\s*<\/cwd>/gi))c(b[1])},e=a=>{if(Array.isArray(a)){for(let b of a)if(b){if("string"==typeof b.content)d(b.content);else if(Array.isArray(b.content))for(let a of b.content)"string"==typeof a?d(a):a&&"object"==typeof a&&(d(a.text),d(a.input_text),d(a.content));if("string"==typeof b&&d(b),"message"===b.type&&Array.isArray(b.content))for(let a of b.content)d(a?.text||a?.input_text)}}};for(let c of(e(a?.messages),e(a?.input),b))try{if(f().isAbsolute(c)&&j().existsSync(c)&&j().statSync(c).isDirectory())return c}catch{}return h().tmpdir()}(i),q=function(){let a=process.env.CLI_DEVIN_BIN?.trim();if(a)return a;let b="win32"===process.platform,c=h().homedir();for(let a of b?[f().join(process.env.LOCALAPPDATA||f().join(c,"AppData","Local"),"devin","cli","bin","devin.exe"),f().join(c,".local","bin","devin.exe"),f().join(c,"scoop","shims","devin.exe"),f().join(process.env.LOCALAPPDATA||f().join(c,"AppData","Local"),"Programs","devin","devin.exe")]:[f().join(c,".local","share","devin","bin","devin"),f().join(c,".devin","bin","devin"),f().join(c,".local","bin","devin"),"/opt/homebrew/bin/devin","/usr/local/bin/devin","/usr/bin/devin"])if(j().existsSync(a))return a;return b?"devin.exe":"devin"}();g?.info?.("DEVIN",`devin acp → model=${a}, bin=${q}, cwd=${p}`);let r=null,s={},t=process.env.DEVIN_MCP_SERVERS?.trim();if(t)try{Object.assign(s,JSON.parse(t))}catch(a){g?.info?.("DEVIN",`DEVIN_MCP_SERVERS parse failed: ${a.message}`)}let u=Array.isArray(i.tools)?i.tools.filter(Boolean):[],v=function(a){let b=new Map,c={};for(let d of a){if(d?.role==="assistant"&&Array.isArray(d.tool_calls))for(let a of d.tool_calls){let c=a?.function?.name||a?.name;a?.id&&c&&b.set(a.id,n(c))}if(d?.role==="assistant"&&Array.isArray(d.content))for(let a of d.content)a?.type==="tool_use"&&a.id&&a.name&&b.set(a.id,n(a.name));if(d?.role==="tool"&&d.tool_call_id){let a=b.get(d.tool_call_id);a&&(c[a]="string"==typeof d.content?d.content:JSON.stringify(d.content??""))}if(d?.role==="user"&&Array.isArray(d.content)){for(let a of d.content)if(a?.type==="tool_result"&&a.tool_use_id){let d=b.get(a.tool_use_id);if(d){let b=a.content;c[d]="string"==typeof b?b:JSON.stringify(b??"")}}}}return c}(k),w=function(a,b){let c,d=[];for(let b of a){if(!b)continue;let a=b.function||b;a?.name&&d.push({name:n(a.name),description:a.description||"",inputSchema:a.parameters||a.input_schema||{type:"object",properties:{}}})}if(!d.length)return null;let e={DEVIN_MCP_TOOLS:JSON.stringify(d)};return b&&Object.keys(b).length&&(e.DEVIN_MCP_RESULTS=JSON.stringify(b)),{command:process.execPath,args:[(c=f().join(h().tmpdir(),"10router-devin-client-tools.mjs"),j().writeFileSync(c,l),c)],env:e}}(u,v),x=!!w;if(w){s.clientTools=w;let a=Object.keys(v).length;g?.info?.("DEVIN",`exposing ${u.length} client tool(s) as MCP`+(a?` (seeded ${a} result(s))`:""))}if(Object.keys(s).length)try{r=j().mkdtempSync(f().join(h().tmpdir(),"devin-mcp-"));let a=f().join(r,"devin");j().mkdirSync(a,{recursive:!0}),j().writeFileSync(f().join(a,"config.json"),JSON.stringify({mcpServers:s})),g?.info?.("DEVIN",`mcp config written → ${r}`)}catch(a){g?.info?.("DEVIN",`mcp config write failed: ${a.message}`),r=null}let y=()=>{if(r){try{j().rmSync(r,{recursive:!0,force:!0})}catch{}r=null}};return{response:new Response(new ReadableStream({start(b){let c=new TextEncoder,f=a=>b.enqueue(c.encode(a)),h={...process.env};h.DEVIN_PERMISSION_MODE=process.env.DEVIN_PERMISSION_MODE||"bypass",r&&(h.XDG_CONFIG_HOME=r);let i=process.env.CLI_DEVIN_AGENT_TYPE?.trim(),j=["acp"];i&&j.push("--agent-type",i);let k=(0,d.spawn)(q,j,{env:h,cwd:p,stdio:["pipe","pipe","pipe"],shell:"win32"===process.platform}),l=null,n=!1;k.on("error",a=>{l=a;let c=a.message.includes("ENOENT")||a.message.includes("not found")?`Devin CLI not found: ${q}. Install via https://cli.devin.ai or set CLI_DEVIN_BIN env var.`:`Devin CLI spawn error: ${a.message}`;f(`data: ${JSON.stringify({error:{message:c,type:"devin_cli_error",code:"spawn_failed"}})}
206
206
 
207
207
  `),f("data: [DONE]\n\n"),b.close()}),e&&e.addEventListener("abort",()=>{k.killed||k.kill("SIGTERM")});let s=1,t=null,u=!1,v=!1,w=!1,z=`chatcmpl-devin-${Date.now()}`,A=Math.floor(Date.now()/1e3),B=!1,C="",D=!1,E=(a,b)=>{if(n||k.stdin.destroyed)return;let c=s++;try{let d;k.stdin.write((d={jsonrpc:"2.0",method:a,params:b},void 0!==c&&(d.id=c),JSON.stringify(d)+"\n"))}catch{}return c},F=b=>{B||(f(`data: ${JSON.stringify({id:z,object:"chat.completion.chunk",created:A,model:a,choices:[{index:0,delta:{role:"assistant",content:""},finish_reason:null}]})}
208
208
 
@@ -224,6 +224,6 @@ Respond ONLY with the JSON object, no other text.`,e=Array.isArray(a.messages)?a
224
224
 
225
225
  ${d}`:Array.isArray(f.content)&&f.content.push({type:"text",text:`
226
226
 
227
- ${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null){let e=d?.runtimeTransport;if(e?.baseUrl)return e.urlSuffix?`${e.baseUrl}${e.urlSuffix}`:e.baseUrl;if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.Es).replace(/\/$/,""),b="responses"===(0,g.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.ky).replace(/\/$/,"");return`${a}/messages`}if("gemini"===this.config.format)return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;if(this.config.urlSuffix)return`${this.config.baseUrl}${this.config.urlSuffix}`;let h=this.config.baseUrl;if(h?.includes("{accountId}")){let a=d?.providerSpecificData?.accountId;if(!a)throw Error(`${this.provider} requires accountId in providerSpecificData`);return h.replace("{accountId}",a)}return h}resolveAuthDescriptor(){return this.provider?.startsWith?.("anthropic-compatible-")?{apiKey:{header:"x-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"},anthropicVersion:!0}:this.config?.format==="claude"?{...n,anthropicVersion:!0}:m}buildHeaders(a,b=!0,c,d){let e=a?.runtimeTransport,g={"Content-Type":"application/json",...e?e.headers:this.config.headers},h=e?.auth||o[this.provider]||this.resolveAuthDescriptor();for(let b of h.hooks||[])q[b]?.(g,a);!function(a,b,c){if(b.combined){p(a,b,c.apiKey||c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8);return}c.apiKey?p(a,b.apiKey,c.apiKey):c.accessToken&&p(a,b.oauth,c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8)}(g,h,a);let i="string"==typeof d&&/^claude-/.test(d);if(d&&("claude"===this.provider||this.provider?.startsWith?.("anthropic-compatible-")&&i)&&(g["Anthropic-Beta"]=(0,f.d)(d)),this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let b of(a.apiKey&&!g.Authorization&&(g.Authorization=`Bearer ${a.apiKey}`),delete g["anthropic-dangerous-direct-browser-access"],delete g["Anthropic-Dangerous-Direct-Browser-Access"],delete g["x-app"],delete g["X-App"],["anthropic-beta","Anthropic-Beta"]))if(g[b]){let a=g[b].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");a?g[b]=a:delete g[b]}}}return b&&(g.Accept="text/event-stream"),g}refreshFromGrant(a,b){let c=r[this.provider],d={grant_type:"refresh_token",refresh_token:a.refreshToken,...c.params(this)};return"json"===c.encoding?this.refreshWithJSON(c.url(),d,b):this.refreshWithForm(c.url(),d,b)}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshFromGrant(a,c),codex:()=>this.refreshFromGrant(a,c),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshFromGrant(a,c),kiro:()=>this.refreshKiro(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),kimi:()=>this.refreshKimi(a,c),"kimi-coding":()=>this.refreshKimi(a,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null){let d=await (0,j.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshWithForm(a,b,c=null){let d=await (0,j.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${e.xq.iflow.clientId}:${e.xq.iflow.clientSecret}`),d=await (0,j.proxyAwareFetch)(h.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:e.xq.iflow.clientId,client_secret:e.xq.iflow.clientSecret})},b);if(!d.ok)return null;let f=await d.json();return{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async refreshKiro(a,b=null){let c=await (0,j.proxyAwareFetch)(e.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCline(a,b=null){let c=await (0,j.proxyAwareFetch)(e.xq.cline.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})},b);if(!c.ok)return null;let d=await c.json(),f=d?.data||d,g=f?.expiresAt,h=g?Math.max(1,Math.floor((new Date(g).getTime()-Date.now())/1e3)):void 0,i=f?.accessToken;return i&&!i.startsWith("workos:")&&(i=`workos:${i}`),{accessToken:i,refreshToken:f?.refreshToken||a,expiresIn:h}}async refreshKimi(a,b=null){let c=a.refreshToken,d=e.xq.kimi||e.xq["kimi-coding"];if(!d?.refreshUrl||!d?.clientId)return null;let f=(0,h.buildKimiHeaders)(a?.providerSpecificData?.deviceId),g=await (0,j.proxyAwareFetch)(d.refreshUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...f},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:d.clientId})},b);if(!g.ok)return null;let i=await g.json();return{accessToken:i.access_token,refreshToken:i.refresh_token||c,expiresIn:i.expires_in}}async refreshKilocode(a,b=null){return null}}},96760:(a,b,c)=>{c.d(b,{c:()=>g});var d=c(66306);let e=[{match:/claude/i,drop:["temperature"]},{provider:"github",match:/gpt-5\.4/i,drop:["temperature"]},{provider:"github",match:a=>/claude/i.test(a)&&!/claude.*(opus|sonnet).*4\.6/i.test(a),drop:["thinking","reasoning_effort"]},{provider:"cloudflare-ai",flattenContent:!0},{provider:"xiaomi-mimo",match:/preview/i,flattenContent:!0},{provider:"volcengine-ark",match:/glm-5/i,clampToModelMaxOutput:!0},{provider:"volcengine-ark",match:/kimi/i,maxOutputCap:32768,clampToModelMaxOutput:!0}];function f(a,b,c){"number"==typeof a[b]&&Number.isFinite(a[b])&&a[b]>c&&(a[b]=c)}function g(a,b,c){if(!b||!c||"object"!=typeof c)return c;for(let g of e)if((!g.provider||g.provider===a)&&(!g.match||("function"==typeof g.match?g.match(b):g.match.test(b)))){for(let a of g.drop||[])void 0!==c[a]&&delete c[a];if(g.flattenContent&&Array.isArray(c.messages))for(let a of c.messages)a&&Array.isArray(a.content)&&(a.content=a.content.map(a=>a?.type==="text"&&"string"==typeof a.text?a.text:"").join(""));if(g.clampToModelMaxOutput||Number.isFinite(g.maxOutputCap)){let e=(0,d.nl)(a,b).maxOutput,h=[];if(g.clampToModelMaxOutput&&Number.isFinite(e)&&e>0&&h.push(e),Number.isFinite(g.maxOutputCap)&&g.maxOutputCap>0&&h.push(g.maxOutputCap),h.length>0){let a=Math.min(...h);f(c,"max_tokens",a),f(c,"max_completion_tokens",a),f(c,"max_output_tokens",a)}}}return c}},98625:(a,b,c)=>{c.d(b,{P:()=>e});var d=c(96179);class e extends d.L{constructor(){super("azure")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.azureEndpoint||process.env.AZURE_ENDPOINT||"https://api.openai.com",f=d?.providerSpecificData?.apiVersion||process.env.AZURE_API_VERSION||"2024-10-01-preview",g=d?.providerSpecificData?.deployment||a||process.env.AZURE_DEPLOYMENT||"gpt-4",h=e.replace(/\/$/,"");return`${h}/openai/deployments/${g}/chat/completions?api-version=${f}`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers},d=a?.apiKey||a?.accessToken||process.env.OPENAI_API_KEY;d&&(c["api-key"]=d);let e=a?.providerSpecificData?.organization||process.env.AZURE_ORGANIZATION;return e&&(c["OpenAI-Organization"]=e),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}}},98665:(a,b,c)=>{c.d(b,{A:()=>u});var d=c(74957),e=c(14170),f=c(88499),g=c(19979),h=c(97102),i=c(65377),j=c(29675),k=c(32546),l=c(4845),m=c(49804);let n="Anthropic",o="OpenAi",p="Google";function q(a,b){let c=String(a||"").toLowerCase();if("anthropic"===c)return n;if("openai"===c||"open_ai"===c)return o;if("google"===c||"gemini"===c)return p;if("xai"===c||"x_ai"===c||"x-ai"===c)return"XAi";let d=String(b||"").toLowerCase();return d.includes("claude")?n:d.includes("gemini")?p:d.includes("grok")||d.includes("xai")?"XAi":o}function r(a,b,c){return a===n?(0,j.P)(b,c):a===p?(0,k.o)(b,c):a===o?(0,l.v)(b,c):b}function s(a,b,c){if(c)for(let d of Array.isArray(c)?c:[c])d&&a.enqueue(b.encode(`data: ${JSON.stringify(d)}
227
+ ${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null){let e=d?.runtimeTransport;if(e?.baseUrl)return e.urlSuffix?`${e.baseUrl}${e.urlSuffix}`:e.baseUrl;if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.Es).replace(/\/$/,""),b="responses"===(0,g.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.ky).replace(/\/$/,"");return`${a}/messages`}if("gemini"===this.config.format)return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;if(this.config.urlSuffix)return`${this.config.baseUrl}${this.config.urlSuffix}`;let h=this.config.baseUrl;if(h?.includes("{accountId}")){let a=d?.providerSpecificData?.accountId;if(!a)throw Error(`${this.provider} requires accountId in providerSpecificData`);return h.replace("{accountId}",a)}return h}resolveAuthDescriptor(){return this.provider?.startsWith?.("anthropic-compatible-")?{apiKey:{header:"x-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"},anthropicVersion:!0}:this.config?.format==="claude"?{...n,anthropicVersion:!0}:m}buildHeaders(a,b=!0,c,d){let e=a?.runtimeTransport,g={"Content-Type":"application/json",...e?e.headers:this.config.headers},h=e?.auth||o[this.provider]||this.resolveAuthDescriptor();for(let b of h.hooks||[])q[b]?.(g,a);!function(a,b,c){if(b.combined){p(a,b,c.apiKey||c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8);return}c.apiKey?p(a,b.apiKey,c.apiKey):c.accessToken&&p(a,b.oauth,c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8)}(g,h,a);let i="string"==typeof d&&/^claude-/.test(d);if(d&&("claude"===this.provider||this.provider?.startsWith?.("anthropic-compatible-")&&i)&&(g["Anthropic-Beta"]=(0,f.d)(d)),this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let b of(a.apiKey&&!g.Authorization&&(g.Authorization=`Bearer ${a.apiKey}`),delete g["anthropic-dangerous-direct-browser-access"],delete g["Anthropic-Dangerous-Direct-Browser-Access"],delete g["x-app"],delete g["X-App"],["anthropic-beta","Anthropic-Beta"]))if(g[b]){let a=g[b].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");a?g[b]=a:delete g[b]}}}return b&&(g.Accept="text/event-stream"),g}refreshFromGrant(a,b){let c=r[this.provider],d={grant_type:"refresh_token",refresh_token:a.refreshToken,...c.params(this)};return"json"===c.encoding?this.refreshWithJSON(c.url(),d,b):this.refreshWithForm(c.url(),d,b)}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshFromGrant(a,c),codex:()=>this.refreshFromGrant(a,c),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshFromGrant(a,c),kiro:()=>this.refreshKiro(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),kimi:()=>this.refreshKimi(a,c),"kimi-coding":()=>this.refreshKimi(a,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null){let d=await (0,j.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshWithForm(a,b,c=null){let d=await (0,j.proxyAwareFetch)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b)},c);if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,refreshToken:e.refresh_token||b.refresh_token,expiresIn:e.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${e.xq.iflow.clientId}:${e.xq.iflow.clientSecret}`),d=await (0,j.proxyAwareFetch)(h.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:e.xq.iflow.clientId,client_secret:e.xq.iflow.clientSecret})},b);if(!d.ok)return null;let f=await d.json();return{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async refreshKiro(a,b=null){let c=await (0,j.proxyAwareFetch)(e.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCline(a,b=null){let c=await (0,j.proxyAwareFetch)(e.xq.cline.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})},b);if(!c.ok)return null;let d=await c.json(),f=d?.data||d,g=f?.expiresAt,h=g?Math.max(1,Math.floor((new Date(g).getTime()-Date.now())/1e3)):void 0,i=f?.accessToken;return i&&!i.startsWith("workos:")&&(i=`workos:${i}`),{accessToken:i,refreshToken:f?.refreshToken||a,expiresIn:h}}async refreshKimi(a,b=null){let c=a.refreshToken,d=e.xq.kimi||e.xq["kimi-coding"];if(!d?.refreshUrl||!d?.clientId)return null;let f=(0,h.buildKimiHeaders)(a?.providerSpecificData?.deviceId),g=await (0,j.proxyAwareFetch)(d.refreshUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...f},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:d.clientId})},b);if(!g.ok)return null;let i=await g.json();return{accessToken:i.access_token,refreshToken:i.refresh_token||c,expiresIn:i.expires_in}}async refreshKilocode(a,b=null){return null}}},96760:(a,b,c)=>{c.d(b,{c:()=>g});var d=c(66306);let e=[{match:/claude/i,drop:["temperature"]},{provider:"github",match:/gpt-5\.4/i,drop:["temperature"]},{provider:"github",match:a=>/claude/i.test(a)&&!/claude.*(opus|sonnet).*4\.6/i.test(a),drop:["thinking","reasoning_effort"]},{provider:"cloudflare-ai",flattenContent:!0},{provider:"mimo-desktop",flattenContent:!0},{provider:"volcengine-ark",match:/glm-5/i,clampToModelMaxOutput:!0},{provider:"volcengine-ark",match:/kimi/i,maxOutputCap:32768,clampToModelMaxOutput:!0}];function f(a,b,c){"number"==typeof a[b]&&Number.isFinite(a[b])&&a[b]>c&&(a[b]=c)}function g(a,b,c){if(!b||!c||"object"!=typeof c)return c;for(let g of e)if((!g.provider||g.provider===a)&&(!g.match||("function"==typeof g.match?g.match(b):g.match.test(b)))){for(let a of g.drop||[])void 0!==c[a]&&delete c[a];if(g.flattenContent&&Array.isArray(c.messages))for(let a of c.messages)a&&Array.isArray(a.content)&&(a.content=a.content.map(a=>a?.type==="text"&&"string"==typeof a.text?a.text:"").join(""));if(g.clampToModelMaxOutput||Number.isFinite(g.maxOutputCap)){let e=(0,d.nl)(a,b).maxOutput,h=[];if(g.clampToModelMaxOutput&&Number.isFinite(e)&&e>0&&h.push(e),Number.isFinite(g.maxOutputCap)&&g.maxOutputCap>0&&h.push(g.maxOutputCap),h.length>0){let a=Math.min(...h);f(c,"max_tokens",a),f(c,"max_completion_tokens",a),f(c,"max_output_tokens",a)}}}return c}},98625:(a,b,c)=>{c.d(b,{P:()=>e});var d=c(96179);class e extends d.L{constructor(){super("azure")}buildUrl(a,b,c=0,d=null){let e=d?.providerSpecificData?.azureEndpoint||process.env.AZURE_ENDPOINT||"https://api.openai.com",f=d?.providerSpecificData?.apiVersion||process.env.AZURE_API_VERSION||"2024-10-01-preview",g=d?.providerSpecificData?.deployment||a||process.env.AZURE_DEPLOYMENT||"gpt-4",h=e.replace(/\/$/,"");return`${h}/openai/deployments/${g}/chat/completions?api-version=${f}`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers},d=a?.apiKey||a?.accessToken||process.env.OPENAI_API_KEY;d&&(c["api-key"]=d);let e=a?.providerSpecificData?.organization||process.env.AZURE_ORGANIZATION;return e&&(c["OpenAI-Organization"]=e),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}}},98665:(a,b,c)=>{c.d(b,{A:()=>u});var d=c(74957),e=c(14170),f=c(88499),g=c(19979),h=c(97102),i=c(65377),j=c(29675),k=c(32546),l=c(4845),m=c(49804);let n="Anthropic",o="OpenAi",p="Google";function q(a,b){let c=String(a||"").toLowerCase();if("anthropic"===c)return n;if("openai"===c||"open_ai"===c)return o;if("google"===c||"gemini"===c)return p;if("xai"===c||"x_ai"===c||"x-ai"===c)return"XAi";let d=String(b||"").toLowerCase();return d.includes("claude")?n:d.includes("gemini")?p:d.includes("grok")||d.includes("xai")?"XAi":o}function r(a,b,c){return a===n?(0,j.P)(b,c):a===p?(0,k.o)(b,c):a===o?(0,l.v)(b,c):b}function s(a,b,c){if(c)for(let d of Array.isArray(c)?c:[c])d&&a.enqueue(b.encode(`data: ${JSON.stringify(d)}
228
228
 
229
229
  `))}class t extends d.H{constructor(){super("zed")}async resolveModel(a,b,c,d){try{let d=await (0,m.w9)(b,{config:this.config,signal:c}),e=d?.rawById?.get(a)??null;if(!e){let d=await (0,m.w9)(b,{config:this.config,signal:c,forceRefresh:!0});e=d?.rawById?.get(a)??null}return{raw:e,provider:q(e?.provider,a)}}catch(c){let b=c instanceof Error?c.message:String(c);return d?.warn?.("ZED",`model catalog unavailable, inferring provider for ${a}: ${b}`),{raw:null,provider:q(null,a)}}}async execute({model:a,body:b,stream:c,credentials:d,signal:j,log:k,proxyOptions:l=null}){let{provider:q}=await this.resolveModel(a,d,j,k),t=q===n?(0,g.p)(a,b,!0):q===p?(0,h.m$)(a,b,!0):q===o?(0,i.h)(a,b,!0,d):{...b||{},model:a,stream:!1!==c},u=b||{},v={thread_id:u.thread_id||d?._clientSessionId,prompt_id:u.prompt_id,provider:q,model:a,provider_request:t},w=await (0,m.zn)(d,"/completions",{config:this.config,signal:j,fetchOptions:{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/x-ndjson, text/event-stream, */*","User-Agent":"9router/zed","x-zed-version":this.config?.appVersion?.toString()||"0.200.0",[m.xK.clientSupportsStatus]:"true",[m.xK.clientSupportsStreamEnded]:"true"},body:JSON.stringify(v)}});return{response:w.ok?function(a,b,c){if(!a.ok||!a.body)return a;let d=new TextDecoder,g=new TextEncoder,h=function(a,b){if(a===n)return(0,f.Ws)(e.h.CLAUDE);if(a===p)return(0,f.Ws)(e.h.GEMINI);if(a===o)return(0,f.Ws)(e.h.OPENAI_RESPONSES);let c=(0,f.Ws)(e.h.OPENAI);return c.model=b,c}(b,c),i="",j=!1,k=a=>{j||(s(a,g,r(b,null,h)),a.enqueue(g.encode("data: [DONE]\n\n")),j=!0)},l=(a,d)=>{if(j)return;let e=function(a){let b=a.replace(/\r$/,"").trim();if(!b)return null;if(b.startsWith("data:")&&(b=b.slice(5).trimStart()),"[DONE]"===b)return{done:!0};try{let a=JSON.parse(b);if(a&&Object.prototype.hasOwnProperty.call(a,"event"))return{event:a.event};if(a&&Object.prototype.hasOwnProperty.call(a,"status"))return{status:a.status};return{event:a}}catch{return null}}(a);if(e){if(e.done)return void k(d);if(e.status){let a=function(a){if(!a)return null;if("string"==typeof a)return{type:a};if("object"==typeof a){let b=Object.keys(a)[0];return b&&"object"==typeof a[b]?{type:b,...a[b]}:a}return null}(e.status);if(a?.type==="failed"||a?.failed){let b=a.failed||a,e=String(b.message||b.error||b.code||"request failed");s(d,g,{id:`chatcmpl-zed-error-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:c,choices:[{index:0,delta:{content:`[Zed error] ${e}`},finish_reason:"stop"}]}),k(d)}else(a?.type==="stream_ended"||"stream_ended"===a)&&k(d);return}s(d,g,r(b,e.event,h))}};return new Response(a.body.pipeThrough(new TransformStream({transform(a,b){let c;for(i+=d.decode(a,{stream:!0});-1!==(c=i.indexOf("\n"));){let a=i.slice(0,c);i=i.slice(c+1),l(a,b)}},flush(a){(i+=d.decode())&&(l(i,a),i=""),k(a)}})),{status:a.status,statusText:a.statusText,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache"}})}(w,q,a):w,url:`${this.config?.llmBaseUrl||"https://cloud.zed.dev"}/completions`,headers:{"Content-Type":"application/json",Authorization:"Bearer <zed-llm-token>"},transformedBody:v}}parseError(a,b){let c=null;try{c=JSON.parse(b||"{}")}catch{c=null}let d=c?.error||void 0,e=c?.code||d?.code||"",f=c?.message||d?.message||b||a.statusText;return"trial_blocked"===e?{status:a.status,message:`Zed trial access is blocked upstream. The account can list hosted models, but Zed is refusing completions until trial/billing access is enabled or unblocked. Zed says: ${f}`}:e?{status:a.status,message:`Zed ${e}: ${f}`}:{status:a.status,message:f||`Zed upstream error: ${a.status}`}}async refreshCredentials(){return null}needsRefresh(){return!1}}let u=t}};