@yina-npm/openrouterx 0.4.11 → 0.4.19

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 (640) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +6 -1
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/routes-manifest.json +35 -3
  5. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js +2 -2
  6. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page.js.nft.json +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/admin/keys/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js +2 -2
  9. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page.js.nft.json +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/admin/users/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  12. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  15. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  21. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  24. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +23 -17
  27. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +5 -0
  33. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -0
  34. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -0
  35. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  36. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  42. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  45. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  48. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  51. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  54. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +5 -3
  57. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  60. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  61. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +2 -0
  63. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -0
  64. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -0
  65. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  66. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  67. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  68. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  69. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  70. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  71. package/app/.next/server/app/(dashboard)/dashboard/user/page.js +3 -3
  72. package/app/.next/server/app/(dashboard)/dashboard/user/page.js.nft.json +1 -1
  73. package/app/.next/server/app/(dashboard)/dashboard/user/page_client-reference-manifest.js +1 -1
  74. package/app/.next/server/app/_global-error/page.js +3 -3
  75. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  76. package/app/.next/server/app/_global-error.html +1 -1
  77. package/app/.next/server/app/_global-error.rsc +1 -1
  78. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  79. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  80. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  81. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  82. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  83. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next/server/app/_not-found/page.js +2 -2
  85. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  86. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/app/.next/server/app/_not-found.html +1 -1
  88. package/app/.next/server/app/_not-found.rsc +4 -4
  89. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  90. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  91. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  92. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  93. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  94. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  95. package/app/.next/server/app/api/auth/login/route.js +1 -1
  96. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  97. package/app/.next/server/app/api/auth/me/route.js +1 -1
  98. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  99. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  100. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  101. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  102. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  103. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  104. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  105. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +2 -0
  106. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -0
  107. package/app/.next/server/app/api/cli-tools/cowork-settings/route_client-reference-manifest.js +1 -0
  108. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  109. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  110. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  111. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  112. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  113. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  114. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  115. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  116. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  117. package/app/.next/server/app/api/combos/route.js +1 -1
  118. package/app/.next/server/app/api/health/route.js +1 -1
  119. package/app/.next/server/app/api/init/route.js +1 -1
  120. package/app/.next/server/app/api/init/route.js.nft.json +1 -1
  121. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  122. package/app/.next/server/app/api/keys/route.js +1 -1
  123. package/app/.next/server/app/api/locale/route.js +1 -1
  124. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  125. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  126. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  127. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  128. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  129. package/app/.next/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  130. package/app/.next/server/app/api/models/alias/route.js +1 -1
  131. package/app/.next/server/app/api/models/availability/route.js +1 -1
  132. package/app/.next/server/app/api/models/custom/route.js +1 -1
  133. package/app/.next/server/app/api/models/disabled/route.js +1 -0
  134. package/app/.next/server/app/api/models/disabled/route.js.nft.json +1 -0
  135. package/app/.next/server/app/api/models/disabled/route_client-reference-manifest.js +1 -0
  136. package/app/.next/server/app/api/models/route.js +1 -1
  137. package/app/.next/server/app/api/models/test/route.js +1 -1
  138. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +6 -1
  139. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  140. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  141. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  142. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  143. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  144. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  145. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  146. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  147. package/app/.next/server/app/api/pricing/route.js +1 -1
  148. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  149. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  150. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  151. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  152. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  153. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  154. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  155. package/app/.next/server/app/api/providers/client/route.js +1 -1
  156. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  157. package/app/.next/server/app/api/providers/route.js +1 -1
  158. package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
  159. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  160. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  161. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  162. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  163. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  164. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  165. package/app/.next/server/app/api/settings/database/route.js +1 -1
  166. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  167. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  168. package/app/.next/server/app/api/settings/route.js +1 -1
  169. package/app/.next/server/app/api/shutdown/route.js +1 -1
  170. package/app/.next/server/app/api/tags/route.js +1 -1
  171. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  172. package/app/.next/server/app/api/translator/console-logs/stream/route.js +4 -4
  173. package/app/.next/server/app/api/translator/load/route.js +1 -1
  174. package/app/.next/server/app/api/translator/save/route.js +1 -1
  175. package/app/.next/server/app/api/translator/send/route.js +1 -1
  176. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  177. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  178. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  179. package/app/.next/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  180. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  181. package/app/.next/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  182. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  183. package/app/.next/server/app/api/tunnel/status/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +1 -23
  185. package/app/.next/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  187. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  188. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  189. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  191. package/app/.next/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  192. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +1 -23
  193. package/app/.next/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  194. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  195. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  196. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  197. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  198. package/app/.next/server/app/api/usage/api-keys/route.js +1 -1
  199. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  200. package/app/.next/server/app/api/usage/history/route.js +1 -1
  201. package/app/.next/server/app/api/usage/logs/route.js +1 -1
  202. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  203. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  204. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  205. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  206. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  207. package/app/.next/server/app/api/users/[id]/route.js +1 -1
  208. package/app/.next/server/app/api/users/route.js +1 -1
  209. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  210. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  211. package/app/.next/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  212. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -0
  213. package/app/.next/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -0
  214. package/app/.next/server/app/api/v1/audio/transcriptions/route_client-reference-manifest.js +1 -0
  215. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  216. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  217. package/app/.next/server/app/api/v1/images/generations/route.js +3 -3
  218. package/app/.next/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  219. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  220. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  221. package/app/.next/server/app/api/v1/models/[kind]/route.js +1 -0
  222. package/app/.next/server/app/api/v1/models/[kind]/route.js.nft.json +1 -0
  223. package/app/.next/server/app/api/v1/models/[kind]/route_client-reference-manifest.js +1 -0
  224. package/app/.next/server/app/api/v1/models/route.js +1 -1
  225. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  226. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  227. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  228. package/app/.next/server/app/api/v1/route.js +1 -1
  229. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  230. package/app/.next/server/app/api/v1/search/route.js +1 -1
  231. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  232. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  233. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  234. package/app/.next/server/app/api/version/route.js +1 -1
  235. package/app/.next/server/app/api/version/update/route.js +1 -1
  236. package/app/.next/server/app/callback/page.js +2 -2
  237. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  238. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  239. package/app/.next/server/app/callback.html +1 -1
  240. package/app/.next/server/app/callback.rsc +4 -4
  241. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  242. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  243. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  244. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  245. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  246. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  247. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  248. package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  249. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  250. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  251. package/app/.next/server/app/dashboard/settings/pricing.rsc +5 -5
  252. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  253. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  254. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  255. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  256. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
  257. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  258. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  259. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  260. package/app/.next/server/app/favicon.ico/route.js +1 -1
  261. package/app/.next/server/app/index.html +1 -1
  262. package/app/.next/server/app/index.rsc +4 -4
  263. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  264. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  265. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  266. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  267. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  268. package/app/.next/server/app/landing/page.js +2 -2
  269. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  270. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  271. package/app/.next/server/app/landing.html +1 -1
  272. package/app/.next/server/app/landing.rsc +4 -4
  273. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  274. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  275. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  276. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  277. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  278. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  279. package/app/.next/server/app/login/page.js +2 -2
  280. package/app/.next/server/app/login/page.js.nft.json +1 -1
  281. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  282. package/app/.next/server/app/login.html +1 -1
  283. package/app/.next/server/app/login.rsc +5 -5
  284. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  285. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  286. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  287. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  288. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  289. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  290. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  291. package/app/.next/server/app/page.js +2 -2
  292. package/app/.next/server/app/page.js.nft.json +1 -1
  293. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  294. package/app/.next/server/app-paths-manifest.json +6 -1
  295. package/app/.next/server/chunks/1256.js +1 -1
  296. package/app/.next/server/chunks/1263.js +2 -2
  297. package/app/.next/server/chunks/2238.js +23 -0
  298. package/app/.next/server/chunks/2343.js +1 -0
  299. package/app/.next/server/chunks/2549.js +1 -1
  300. package/app/.next/server/chunks/3245.js +1 -1
  301. package/app/.next/server/chunks/3855.js +1 -1
  302. package/app/.next/server/chunks/412.js +3 -3
  303. package/app/.next/server/chunks/4122.js +1 -1
  304. package/app/.next/server/chunks/4664.js +1 -1
  305. package/app/.next/server/chunks/4989.js +2 -2
  306. package/app/.next/server/chunks/5434.js +1 -0
  307. package/app/.next/server/chunks/5627.js +15 -0
  308. package/app/.next/server/chunks/5681.js +1 -1
  309. package/app/.next/server/chunks/6182.js +15 -0
  310. package/app/.next/server/chunks/7595.js +1 -1
  311. package/app/.next/server/chunks/7937.js +9 -43
  312. package/app/.next/server/chunks/8590.js +1 -1
  313. package/app/.next/server/chunks/8760.js +1 -1
  314. package/app/.next/server/chunks/8895.js +42 -2
  315. package/app/.next/server/chunks/9489.js +1 -1
  316. package/app/.next/server/chunks/9609.js +1 -1
  317. package/app/.next/server/chunks/9718.js +1 -1
  318. package/app/.next/server/functions-config-manifest.json +3 -0
  319. package/app/.next/server/middleware-build-manifest.js +1 -1
  320. package/app/.next/server/middleware.js +1 -1
  321. package/app/.next/server/pages/404.html +1 -1
  322. package/app/.next/server/pages/500.html +1 -1
  323. package/app/.next/server/server-reference-manifest.js +1 -1
  324. package/app/.next/server/server-reference-manifest.json +1 -1
  325. package/app/.next/static/NtU3O4mCJYjlmlBWGF7gX/_buildManifest.js +1 -0
  326. package/app/.next/static/chunks/1321-7e9aeddc67afb663.js +1 -0
  327. package/app/.next/static/chunks/4295-fbaece639df900b6.js +23 -0
  328. package/app/.next/static/chunks/5497-54ae9c6ec04c2fb1.js +7 -0
  329. package/app/.next/static/chunks/5555-9189a6eb2a8e87a5.js +3 -0
  330. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-ba226c8b3c01dd8d.js +1 -0
  331. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-cee4e0a7455b73ca.js +1 -0
  332. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-e8660483a85aed9d.js +59 -0
  333. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-9ff3dee6ea964428.js +1 -0
  334. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-28a10e3cb86b9581.js +4 -0
  335. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-eefae72167c9579c.js +1 -0
  336. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-99260106103e6a4e.js +1 -0
  337. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-6289612ce5f7c181.js +1 -0
  338. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-08a8f17b396ac1f4.js +1 -0
  339. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-7dac10f6360f52df.js +1 -0
  340. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-abd7d942ceae9293.js +4 -0
  341. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-52fbe722ba5c5393.js +1 -0
  342. package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-d4518d92737b2728.js +1 -0
  343. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-badb7034e478a358.js +1 -0
  344. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-2ae01d48c665f7b4.js +1 -0
  345. package/app/.next/static/chunks/app/_global-error/page-badb7034e478a358.js +1 -0
  346. package/app/.next/static/chunks/app/api/auth/login/route-badb7034e478a358.js +1 -0
  347. package/app/.next/static/chunks/app/api/auth/logout/route-badb7034e478a358.js +1 -0
  348. package/app/.next/static/chunks/app/api/auth/me/route-badb7034e478a358.js +1 -0
  349. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-badb7034e478a358.js +1 -0
  350. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-badb7034e478a358.js +1 -0
  351. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-badb7034e478a358.js +1 -0
  352. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-badb7034e478a358.js +1 -0
  353. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-badb7034e478a358.js +1 -0
  354. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-badb7034e478a358.js +1 -0
  355. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-badb7034e478a358.js +1 -0
  356. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-badb7034e478a358.js +1 -0
  357. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-badb7034e478a358.js +1 -0
  358. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-badb7034e478a358.js +1 -0
  359. package/app/.next/static/chunks/app/api/cloud/auth/route-badb7034e478a358.js +1 -0
  360. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-badb7034e478a358.js +1 -0
  361. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-badb7034e478a358.js +1 -0
  362. package/app/.next/static/chunks/app/api/cloud/models/alias/route-badb7034e478a358.js +1 -0
  363. package/app/.next/static/chunks/app/api/combos/[id]/route-badb7034e478a358.js +1 -0
  364. package/app/.next/static/chunks/app/api/combos/route-badb7034e478a358.js +1 -0
  365. package/app/.next/static/chunks/app/api/health/route-badb7034e478a358.js +1 -0
  366. package/app/.next/static/chunks/app/api/init/route-badb7034e478a358.js +1 -0
  367. package/app/.next/static/chunks/app/api/keys/[id]/route-badb7034e478a358.js +1 -0
  368. package/app/.next/static/chunks/app/api/keys/route-badb7034e478a358.js +1 -0
  369. package/app/.next/static/chunks/app/api/locale/route-badb7034e478a358.js +1 -0
  370. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-badb7034e478a358.js +1 -0
  371. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-badb7034e478a358.js +1 -0
  372. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-badb7034e478a358.js +1 -0
  373. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-badb7034e478a358.js +1 -0
  374. package/app/.next/static/chunks/app/api/models/alias/route-badb7034e478a358.js +1 -0
  375. package/app/.next/static/chunks/app/api/models/availability/route-badb7034e478a358.js +1 -0
  376. package/app/.next/static/chunks/app/api/models/custom/route-badb7034e478a358.js +1 -0
  377. package/app/.next/static/chunks/app/api/models/disabled/route-badb7034e478a358.js +1 -0
  378. package/app/.next/static/chunks/app/api/models/route-badb7034e478a358.js +1 -0
  379. package/app/.next/static/chunks/app/api/models/test/route-badb7034e478a358.js +1 -0
  380. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-badb7034e478a358.js +1 -0
  381. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-badb7034e478a358.js +1 -0
  382. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-badb7034e478a358.js +1 -0
  383. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-badb7034e478a358.js +1 -0
  384. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-badb7034e478a358.js +1 -0
  385. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-badb7034e478a358.js +1 -0
  386. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-badb7034e478a358.js +1 -0
  387. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-badb7034e478a358.js +1 -0
  388. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-badb7034e478a358.js +1 -0
  389. package/app/.next/static/chunks/app/api/pricing/route-badb7034e478a358.js +1 -0
  390. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-badb7034e478a358.js +1 -0
  391. package/app/.next/static/chunks/app/api/provider-nodes/route-badb7034e478a358.js +1 -0
  392. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-badb7034e478a358.js +1 -0
  393. package/app/.next/static/chunks/app/api/providers/[id]/models/route-badb7034e478a358.js +1 -0
  394. package/app/.next/static/chunks/app/api/providers/[id]/route-badb7034e478a358.js +1 -0
  395. package/app/.next/static/chunks/app/api/providers/[id]/test/route-badb7034e478a358.js +1 -0
  396. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-badb7034e478a358.js +1 -0
  397. package/app/.next/static/chunks/app/api/providers/client/route-badb7034e478a358.js +1 -0
  398. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-badb7034e478a358.js +1 -0
  399. package/app/.next/static/chunks/app/api/providers/route-badb7034e478a358.js +1 -0
  400. package/app/.next/static/chunks/app/api/providers/suggested-models/route-badb7034e478a358.js +1 -0
  401. package/app/.next/static/chunks/app/api/providers/test-batch/route-badb7034e478a358.js +1 -0
  402. package/app/.next/static/chunks/app/api/providers/validate/route-badb7034e478a358.js +1 -0
  403. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-badb7034e478a358.js +1 -0
  404. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-badb7034e478a358.js +1 -0
  405. package/app/.next/static/chunks/app/api/proxy-pools/route-badb7034e478a358.js +1 -0
  406. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-badb7034e478a358.js +1 -0
  407. package/app/.next/static/chunks/app/api/settings/database/route-badb7034e478a358.js +1 -0
  408. package/app/.next/static/chunks/app/api/settings/proxy-test/route-badb7034e478a358.js +1 -0
  409. package/app/.next/static/chunks/app/api/settings/require-login/route-badb7034e478a358.js +1 -0
  410. package/app/.next/static/chunks/app/api/settings/route-badb7034e478a358.js +1 -0
  411. package/app/.next/static/chunks/app/api/shutdown/route-badb7034e478a358.js +1 -0
  412. package/app/.next/static/chunks/app/api/tags/route-badb7034e478a358.js +1 -0
  413. package/app/.next/static/chunks/app/api/translator/console-logs/route-badb7034e478a358.js +1 -0
  414. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-badb7034e478a358.js +1 -0
  415. package/app/.next/static/chunks/app/api/translator/load/route-badb7034e478a358.js +1 -0
  416. package/app/.next/static/chunks/app/api/translator/save/route-badb7034e478a358.js +1 -0
  417. package/app/.next/static/chunks/app/api/translator/send/route-badb7034e478a358.js +1 -0
  418. package/app/.next/static/chunks/app/api/translator/translate/route-badb7034e478a358.js +1 -0
  419. package/app/.next/static/chunks/app/api/tunnel/disable/route-badb7034e478a358.js +1 -0
  420. package/app/.next/static/chunks/app/api/tunnel/enable/route-badb7034e478a358.js +1 -0
  421. package/app/.next/static/chunks/app/api/tunnel/status/route-badb7034e478a358.js +1 -0
  422. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-badb7034e478a358.js +1 -0
  423. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-badb7034e478a358.js +1 -0
  424. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-badb7034e478a358.js +1 -0
  425. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-badb7034e478a358.js +1 -0
  426. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-badb7034e478a358.js +1 -0
  427. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-badb7034e478a358.js +1 -0
  428. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-badb7034e478a358.js +1 -0
  429. package/app/.next/static/chunks/app/api/usage/api-keys/route-badb7034e478a358.js +1 -0
  430. package/app/.next/static/chunks/app/api/usage/chart/route-badb7034e478a358.js +1 -0
  431. package/app/.next/static/chunks/app/api/usage/history/route-badb7034e478a358.js +1 -0
  432. package/app/.next/static/chunks/app/api/usage/logs/route-badb7034e478a358.js +1 -0
  433. package/app/.next/static/chunks/app/api/usage/providers/route-badb7034e478a358.js +1 -0
  434. package/app/.next/static/chunks/app/api/usage/request-details/route-badb7034e478a358.js +1 -0
  435. package/app/.next/static/chunks/app/api/usage/request-logs/route-badb7034e478a358.js +1 -0
  436. package/app/.next/static/chunks/app/api/usage/stats/route-badb7034e478a358.js +1 -0
  437. package/app/.next/static/chunks/app/api/usage/stream/route-badb7034e478a358.js +1 -0
  438. package/app/.next/static/chunks/app/api/users/[id]/route-badb7034e478a358.js +1 -0
  439. package/app/.next/static/chunks/app/api/users/route-badb7034e478a358.js +1 -0
  440. package/app/.next/static/chunks/app/api/v1/api/chat/route-badb7034e478a358.js +1 -0
  441. package/app/.next/static/chunks/app/api/v1/audio/speech/route-badb7034e478a358.js +1 -0
  442. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-badb7034e478a358.js +1 -0
  443. package/app/.next/static/chunks/app/api/v1/chat/completions/route-badb7034e478a358.js +1 -0
  444. package/app/.next/static/chunks/app/api/v1/embeddings/route-badb7034e478a358.js +1 -0
  445. package/app/.next/static/chunks/app/api/v1/images/generations/route-badb7034e478a358.js +1 -0
  446. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-badb7034e478a358.js +1 -0
  447. package/app/.next/static/chunks/app/api/v1/messages/route-badb7034e478a358.js +1 -0
  448. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-badb7034e478a358.js +1 -0
  449. package/app/.next/static/chunks/app/api/v1/models/route-badb7034e478a358.js +1 -0
  450. package/app/.next/static/chunks/app/api/v1/responses/compact/route-badb7034e478a358.js +1 -0
  451. package/app/.next/static/chunks/app/api/v1/responses/route-badb7034e478a358.js +1 -0
  452. package/app/.next/static/chunks/app/api/v1/route-badb7034e478a358.js +1 -0
  453. package/app/.next/static/chunks/app/api/v1/search/route-badb7034e478a358.js +1 -0
  454. package/app/.next/static/chunks/app/api/v1/web/fetch/route-badb7034e478a358.js +1 -0
  455. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-badb7034e478a358.js +1 -0
  456. package/app/.next/static/chunks/app/api/v1beta/models/route-badb7034e478a358.js +1 -0
  457. package/app/.next/static/chunks/app/api/version/route-badb7034e478a358.js +1 -0
  458. package/app/.next/static/chunks/app/api/version/update/route-badb7034e478a358.js +1 -0
  459. package/app/.next/static/chunks/app/dashboard/settings/pricing/page-ac222da48f591dee.js +1 -0
  460. package/app/.next/static/chunks/app/login/page-163a87388cf383cc.js +1 -0
  461. package/app/.next/static/chunks/app/manifest.webmanifest/route-badb7034e478a358.js +1 -0
  462. package/app/.next/static/chunks/app/page-badb7034e478a358.js +1 -0
  463. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-badb7034e478a358.js +1 -0
  464. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-badb7034e478a358.js +1 -0
  465. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-badb7034e478a358.js +1 -0
  466. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-badb7034e478a358.js +1 -0
  467. package/app/.next/static/css/326fa3d6432d4810.css +1 -0
  468. package/app/package.json +1 -1
  469. package/app/public/i18n/literals/zh-CN.json +397 -120
  470. package/app/public/providers/alicode-intl.png +0 -0
  471. package/app/public/providers/alicode.png +0 -0
  472. package/app/public/providers/aws-polly.png +0 -0
  473. package/app/public/providers/black-forest-labs.png +0 -0
  474. package/app/public/providers/byteplus.png +0 -0
  475. package/app/public/providers/cloudflare-ai.png +0 -0
  476. package/app/public/providers/fal-ai.png +0 -0
  477. package/app/public/providers/jina-ai.png +0 -0
  478. package/app/public/providers/nebius.png +0 -0
  479. package/app/public/providers/nvidia.png +0 -0
  480. package/app/public/providers/ollama-local.png +0 -0
  481. package/app/public/providers/ollama.png +0 -0
  482. package/app/public/providers/recraft.png +0 -0
  483. package/app/public/providers/runwayml.png +0 -0
  484. package/app/public/providers/stability-ai.png +0 -0
  485. package/app/public/providers/topaz.png +0 -0
  486. package/app/public/providers/vertex-partner.png +0 -0
  487. package/app/public/providers/vertex.png +0 -0
  488. package/app/public/providers/volcengine-ark.png +0 -0
  489. package/app/public/providers/xiaomi-mimo.png +0 -0
  490. package/app/src/mitm/dns/dnsConfig.js +77 -32
  491. package/app/src/mitm/manager.js +109 -28
  492. package/app/src/mitm/server.js +9 -8
  493. package/app/src/mitm/winElevated.js +8 -6
  494. package/app/src/shared/constants/mitmToolHosts.js +1 -0
  495. package/package.json +1 -1
  496. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js +0 -5
  497. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page.js.nft.json +0 -1
  498. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page_client-reference-manifest.js +0 -1
  499. package/app/.next/server/chunks/5599.js +0 -23
  500. package/app/.next/server/chunks/6555.js +0 -1
  501. package/app/.next/server/chunks/9501.js +0 -37
  502. package/app/.next/static/chunks/1321-e040e8704e8038e6.js +0 -1
  503. package/app/.next/static/chunks/5497-4da88480a15dec4c.js +0 -7
  504. package/app/.next/static/chunks/5555-91932fc7b159e521.js +0 -3
  505. package/app/.next/static/chunks/698-64c9bb7a1ba1f521.js +0 -23
  506. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/page-4a745b1296f08667.js +0 -1
  507. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/page-842b00e6db9de7ae.js +0 -1
  508. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-0494f10cf7d2cae0.js +0 -53
  509. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/page-521aecf4ccb7b03e.js +0 -1
  510. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/combo/[id]/page-d594f315360645f3.js +0 -4
  511. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/web/page-ec14043bae22768d.js +0 -1
  512. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/page-f8681cfb4c894f96.js +0 -1
  513. package/app/.next/static/chunks/app/(dashboard)/dashboard/profile/page-f0bbe6b3b1bfb85e.js +0 -1
  514. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7985e45ad78144eb.js +0 -1
  515. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-d6d08994d9d6d690.js +0 -1
  516. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-b2443c6d810b0207.js +0 -2
  517. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/page-fae4c95586692227.js +0 -1
  518. package/app/.next/static/chunks/app/(dashboard)/dashboard/translator/page-24023a32c248257e.js +0 -1
  519. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-48fc1f090d936818.js +0 -1
  520. package/app/.next/static/chunks/app/_global-error/page-24023a32c248257e.js +0 -1
  521. package/app/.next/static/chunks/app/api/auth/login/route-24023a32c248257e.js +0 -1
  522. package/app/.next/static/chunks/app/api/auth/logout/route-24023a32c248257e.js +0 -1
  523. package/app/.next/static/chunks/app/api/auth/me/route-24023a32c248257e.js +0 -1
  524. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-24023a32c248257e.js +0 -1
  525. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-24023a32c248257e.js +0 -1
  526. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-24023a32c248257e.js +0 -1
  527. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-24023a32c248257e.js +0 -1
  528. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-24023a32c248257e.js +0 -1
  529. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-24023a32c248257e.js +0 -1
  530. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-24023a32c248257e.js +0 -1
  531. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-24023a32c248257e.js +0 -1
  532. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-24023a32c248257e.js +0 -1
  533. package/app/.next/static/chunks/app/api/cloud/auth/route-24023a32c248257e.js +0 -1
  534. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-24023a32c248257e.js +0 -1
  535. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-24023a32c248257e.js +0 -1
  536. package/app/.next/static/chunks/app/api/cloud/models/alias/route-24023a32c248257e.js +0 -1
  537. package/app/.next/static/chunks/app/api/combos/[id]/route-24023a32c248257e.js +0 -1
  538. package/app/.next/static/chunks/app/api/combos/route-24023a32c248257e.js +0 -1
  539. package/app/.next/static/chunks/app/api/health/route-24023a32c248257e.js +0 -1
  540. package/app/.next/static/chunks/app/api/init/route-24023a32c248257e.js +0 -1
  541. package/app/.next/static/chunks/app/api/keys/[id]/route-24023a32c248257e.js +0 -1
  542. package/app/.next/static/chunks/app/api/keys/route-24023a32c248257e.js +0 -1
  543. package/app/.next/static/chunks/app/api/locale/route-24023a32c248257e.js +0 -1
  544. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-24023a32c248257e.js +0 -1
  545. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-24023a32c248257e.js +0 -1
  546. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-24023a32c248257e.js +0 -1
  547. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-24023a32c248257e.js +0 -1
  548. package/app/.next/static/chunks/app/api/models/alias/route-24023a32c248257e.js +0 -1
  549. package/app/.next/static/chunks/app/api/models/availability/route-24023a32c248257e.js +0 -1
  550. package/app/.next/static/chunks/app/api/models/custom/route-24023a32c248257e.js +0 -1
  551. package/app/.next/static/chunks/app/api/models/route-24023a32c248257e.js +0 -1
  552. package/app/.next/static/chunks/app/api/models/test/route-24023a32c248257e.js +0 -1
  553. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-24023a32c248257e.js +0 -1
  554. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-24023a32c248257e.js +0 -1
  555. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-24023a32c248257e.js +0 -1
  556. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-24023a32c248257e.js +0 -1
  557. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-24023a32c248257e.js +0 -1
  558. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-24023a32c248257e.js +0 -1
  559. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-24023a32c248257e.js +0 -1
  560. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-24023a32c248257e.js +0 -1
  561. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-24023a32c248257e.js +0 -1
  562. package/app/.next/static/chunks/app/api/pricing/route-24023a32c248257e.js +0 -1
  563. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-24023a32c248257e.js +0 -1
  564. package/app/.next/static/chunks/app/api/provider-nodes/route-24023a32c248257e.js +0 -1
  565. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-24023a32c248257e.js +0 -1
  566. package/app/.next/static/chunks/app/api/providers/[id]/models/route-24023a32c248257e.js +0 -1
  567. package/app/.next/static/chunks/app/api/providers/[id]/route-24023a32c248257e.js +0 -1
  568. package/app/.next/static/chunks/app/api/providers/[id]/test/route-24023a32c248257e.js +0 -1
  569. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-24023a32c248257e.js +0 -1
  570. package/app/.next/static/chunks/app/api/providers/client/route-24023a32c248257e.js +0 -1
  571. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-24023a32c248257e.js +0 -1
  572. package/app/.next/static/chunks/app/api/providers/route-24023a32c248257e.js +0 -1
  573. package/app/.next/static/chunks/app/api/providers/suggested-models/route-24023a32c248257e.js +0 -1
  574. package/app/.next/static/chunks/app/api/providers/test-batch/route-24023a32c248257e.js +0 -1
  575. package/app/.next/static/chunks/app/api/providers/validate/route-24023a32c248257e.js +0 -1
  576. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-24023a32c248257e.js +0 -1
  577. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-24023a32c248257e.js +0 -1
  578. package/app/.next/static/chunks/app/api/proxy-pools/route-24023a32c248257e.js +0 -1
  579. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-24023a32c248257e.js +0 -1
  580. package/app/.next/static/chunks/app/api/settings/database/route-24023a32c248257e.js +0 -1
  581. package/app/.next/static/chunks/app/api/settings/proxy-test/route-24023a32c248257e.js +0 -1
  582. package/app/.next/static/chunks/app/api/settings/require-login/route-24023a32c248257e.js +0 -1
  583. package/app/.next/static/chunks/app/api/settings/route-24023a32c248257e.js +0 -1
  584. package/app/.next/static/chunks/app/api/shutdown/route-24023a32c248257e.js +0 -1
  585. package/app/.next/static/chunks/app/api/tags/route-24023a32c248257e.js +0 -1
  586. package/app/.next/static/chunks/app/api/translator/console-logs/route-24023a32c248257e.js +0 -1
  587. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-24023a32c248257e.js +0 -1
  588. package/app/.next/static/chunks/app/api/translator/load/route-24023a32c248257e.js +0 -1
  589. package/app/.next/static/chunks/app/api/translator/save/route-24023a32c248257e.js +0 -1
  590. package/app/.next/static/chunks/app/api/translator/send/route-24023a32c248257e.js +0 -1
  591. package/app/.next/static/chunks/app/api/translator/translate/route-24023a32c248257e.js +0 -1
  592. package/app/.next/static/chunks/app/api/tunnel/disable/route-24023a32c248257e.js +0 -1
  593. package/app/.next/static/chunks/app/api/tunnel/enable/route-24023a32c248257e.js +0 -1
  594. package/app/.next/static/chunks/app/api/tunnel/status/route-24023a32c248257e.js +0 -1
  595. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-24023a32c248257e.js +0 -1
  596. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-24023a32c248257e.js +0 -1
  597. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-24023a32c248257e.js +0 -1
  598. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-24023a32c248257e.js +0 -1
  599. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-24023a32c248257e.js +0 -1
  600. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-24023a32c248257e.js +0 -1
  601. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-24023a32c248257e.js +0 -1
  602. package/app/.next/static/chunks/app/api/usage/api-keys/route-24023a32c248257e.js +0 -1
  603. package/app/.next/static/chunks/app/api/usage/chart/route-24023a32c248257e.js +0 -1
  604. package/app/.next/static/chunks/app/api/usage/history/route-24023a32c248257e.js +0 -1
  605. package/app/.next/static/chunks/app/api/usage/logs/route-24023a32c248257e.js +0 -1
  606. package/app/.next/static/chunks/app/api/usage/providers/route-24023a32c248257e.js +0 -1
  607. package/app/.next/static/chunks/app/api/usage/request-details/route-24023a32c248257e.js +0 -1
  608. package/app/.next/static/chunks/app/api/usage/request-logs/route-24023a32c248257e.js +0 -1
  609. package/app/.next/static/chunks/app/api/usage/stats/route-24023a32c248257e.js +0 -1
  610. package/app/.next/static/chunks/app/api/usage/stream/route-24023a32c248257e.js +0 -1
  611. package/app/.next/static/chunks/app/api/users/[id]/route-24023a32c248257e.js +0 -1
  612. package/app/.next/static/chunks/app/api/users/route-24023a32c248257e.js +0 -1
  613. package/app/.next/static/chunks/app/api/v1/api/chat/route-24023a32c248257e.js +0 -1
  614. package/app/.next/static/chunks/app/api/v1/audio/speech/route-24023a32c248257e.js +0 -1
  615. package/app/.next/static/chunks/app/api/v1/chat/completions/route-24023a32c248257e.js +0 -1
  616. package/app/.next/static/chunks/app/api/v1/embeddings/route-24023a32c248257e.js +0 -1
  617. package/app/.next/static/chunks/app/api/v1/images/generations/route-24023a32c248257e.js +0 -1
  618. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-24023a32c248257e.js +0 -1
  619. package/app/.next/static/chunks/app/api/v1/messages/route-24023a32c248257e.js +0 -1
  620. package/app/.next/static/chunks/app/api/v1/models/route-24023a32c248257e.js +0 -1
  621. package/app/.next/static/chunks/app/api/v1/responses/compact/route-24023a32c248257e.js +0 -1
  622. package/app/.next/static/chunks/app/api/v1/responses/route-24023a32c248257e.js +0 -1
  623. package/app/.next/static/chunks/app/api/v1/route-24023a32c248257e.js +0 -1
  624. package/app/.next/static/chunks/app/api/v1/search/route-24023a32c248257e.js +0 -1
  625. package/app/.next/static/chunks/app/api/v1/web/fetch/route-24023a32c248257e.js +0 -1
  626. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-24023a32c248257e.js +0 -1
  627. package/app/.next/static/chunks/app/api/v1beta/models/route-24023a32c248257e.js +0 -1
  628. package/app/.next/static/chunks/app/api/version/route-24023a32c248257e.js +0 -1
  629. package/app/.next/static/chunks/app/api/version/update/route-24023a32c248257e.js +0 -1
  630. package/app/.next/static/chunks/app/dashboard/settings/pricing/page-5744fe42b927e4e1.js +0 -1
  631. package/app/.next/static/chunks/app/login/page-f8fd97681568bf8f.js +0 -1
  632. package/app/.next/static/chunks/app/manifest.webmanifest/route-24023a32c248257e.js +0 -1
  633. package/app/.next/static/chunks/app/page-24023a32c248257e.js +0 -1
  634. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-24023a32c248257e.js +0 -1
  635. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-24023a32c248257e.js +0 -1
  636. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-24023a32c248257e.js +0 -1
  637. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-24023a32c248257e.js +0 -1
  638. package/app/.next/static/css/733bbed45c0f373c.css +0 -1
  639. package/app/.next/static/kSw7ik2y0Lphlofn8QbuF/_buildManifest.js +0 -1
  640. /package/app/.next/static/{kSw7ik2y0Lphlofn8QbuF → NtU3O4mCJYjlmlBWGF7gX}/_ssgManifest.js +0 -0
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -4,7 +4,32 @@ const path = require("path");
4
4
  const os = require("os");
5
5
  const { log, err } = require("../logger");
6
6
  const { TOOL_HOSTS } = require("../../shared/constants/mitmToolHosts");
7
- const { runElevatedPowerShell, quotePs, isAdmin } = require("../winElevated.js");
7
+ const { runElevatedPowerShell, isAdmin } = require("../winElevated.js");
8
+
9
+ /**
10
+ * Atomic-ish write for Windows hosts file with rollback on failure.
11
+ * Strategy: write `.new` sibling → rename current to `.bak` → rename `.new` to target.
12
+ * If anything fails mid-way, restore from `.bak`. Same-volume renames are atomic on NTFS.
13
+ */
14
+ function atomicWriteHostsWin(target, originalContent, newContent) {
15
+ const tmpNew = `${target}.9router.new`;
16
+ const tmpBak = `${target}.9router.bak`;
17
+ try {
18
+ fs.writeFileSync(tmpNew, newContent, "utf8");
19
+ try { fs.unlinkSync(tmpBak); } catch { /* none */ }
20
+ fs.renameSync(target, tmpBak);
21
+ try {
22
+ fs.renameSync(tmpNew, target);
23
+ } catch (e) {
24
+ // Rollback: restore original
25
+ try { fs.renameSync(tmpBak, target); } catch { fs.writeFileSync(target, originalContent, "utf8"); }
26
+ throw e;
27
+ }
28
+ try { fs.unlinkSync(tmpBak); } catch { /* best effort */ }
29
+ } finally {
30
+ try { fs.unlinkSync(tmpNew); } catch { /* already moved or never created */ }
31
+ }
32
+ }
8
33
 
9
34
  const IS_WIN = process.platform === "win32";
10
35
  const IS_MAC = process.platform === "darwin";
@@ -23,6 +48,20 @@ function isSudoAvailable() {
23
48
  }
24
49
  }
25
50
 
51
+ function canRunSudoWithoutPassword() {
52
+ if (IS_WIN || !isSudoAvailable()) return true;
53
+ try {
54
+ execSync("sudo -n true", { stdio: "ignore", windowsHide: true });
55
+ return true;
56
+ } catch {
57
+ return false;
58
+ }
59
+ }
60
+
61
+ function isSudoPasswordRequired() {
62
+ return !IS_WIN && isSudoAvailable() && !canRunSudoWithoutPassword();
63
+ }
64
+
26
65
  /**
27
66
  * Execute command with sudo password via stdin (macOS/Linux only).
28
67
  * Without sudo in PATH (containers), runs via sh — same user, no elevation.
@@ -51,6 +90,14 @@ function execWithPassword(command, password) {
51
90
  });
52
91
  }
53
92
 
93
+ /**
94
+ * Trim trailing blank lines/whitespace, ensure file ends with exactly one newline.
95
+ */
96
+ function normalizeHostsContent(content) {
97
+ const eol = IS_WIN ? "\r\n" : "\n";
98
+ return content.replace(/[\r\n\s]+$/g, "") + eol;
99
+ }
100
+
54
101
  /**
55
102
  * Flush DNS cache (macOS/Linux)
56
103
  */
@@ -106,19 +153,23 @@ async function addDNSEntry(tool, sudoPassword) {
106
153
  return;
107
154
  }
108
155
 
109
- const entries = entriesToAdd.map(h => `127.0.0.1 ${h}`).join("\n");
110
-
111
156
  try {
112
157
  if (IS_WIN) {
113
- const toAppend = entriesToAdd.map(h => `127.0.0.1 ${h}`).join("`r`n");
114
- // Single elevated script: append to hosts + flush DNS (1 UAC popup, or zero if admin)
115
- const script = `
116
- Add-Content -LiteralPath ${quotePs(HOSTS_FILE)} -Value ${quotePs(toAppend)}
117
- ipconfig /flushdns | Out-Null
118
- `;
119
- await runElevatedPowerShell(script);
158
+ // Read trim → append → atomic write (Node-side, no CLI size limit)
159
+ const current = fs.readFileSync(HOSTS_FILE, "utf8");
160
+ const trimmed = current.replace(/[\r\n\s]+$/g, "");
161
+ const toAppend = entriesToAdd.map(h => `127.0.0.1 ${h}`).join("\r\n");
162
+ const next = `${trimmed}\r\n${toAppend}\r\n`;
163
+ atomicWriteHostsWin(HOSTS_FILE, current, next);
164
+ await runElevatedPowerShell("ipconfig /flushdns | Out-Null");
120
165
  } else {
121
- await execWithPassword(`echo "${entries}" >> ${HOSTS_FILE}`, sudoPassword);
166
+ const current = fs.readFileSync(HOSTS_FILE, "utf8");
167
+ const trimmed = current.replace(/[\r\n\s]+$/g, "");
168
+ const toAppend = entriesToAdd.map(h => `127.0.0.1 ${h}`).join("\n");
169
+ const next = `${trimmed}\n${toAppend}\n`;
170
+ // Use tee via sudo to overwrite atomically — escape single quotes in content
171
+ const escaped = next.replace(/'/g, "'\\''");
172
+ await execWithPassword(`printf '%s' '${escaped}' | tee ${HOSTS_FILE} > /dev/null`, sudoPassword);
122
173
  await flushDNS(sudoPassword);
123
174
  }
124
175
  log(`🌐 DNS ${tool}: ✅ added ${entriesToAdd.join(", ")}`);
@@ -143,26 +194,17 @@ async function removeDNSEntry(tool, sudoPassword) {
143
194
 
144
195
  try {
145
196
  if (IS_WIN) {
146
- // Build PowerShell list literal of hosts to strip
147
- const hostsList = entriesToRemove.map(quotePs).join(",");
148
- const script = `
149
- $hosts = @(${hostsList})
150
- $lines = Get-Content -LiteralPath ${quotePs(HOSTS_FILE)}
151
- $filtered = $lines | Where-Object {
152
- $line = $_
153
- -not ($hosts | Where-Object { $line -match [regex]::Escape($_) })
154
- }
155
- Set-Content -LiteralPath ${quotePs(HOSTS_FILE)} -Value $filtered
156
- ipconfig /flushdns | Out-Null
157
- `;
158
- await runElevatedPowerShell(script);
197
+ const current = fs.readFileSync(HOSTS_FILE, "utf8");
198
+ const filtered = current.split(/\r?\n/).filter(l => !entriesToRemove.some(h => l.includes(h))).join("\r\n");
199
+ const next = filtered.replace(/[\r\n\s]+$/g, "") + "\r\n";
200
+ atomicWriteHostsWin(HOSTS_FILE, current, next);
201
+ await runElevatedPowerShell("ipconfig /flushdns | Out-Null");
159
202
  } else {
160
- for (const host of entriesToRemove) {
161
- const sedCmd = IS_MAC
162
- ? `sed -i '' '/${host}/d' ${HOSTS_FILE}`
163
- : `sed -i '/${host}/d' ${HOSTS_FILE}`;
164
- await execWithPassword(sedCmd, sudoPassword);
165
- }
203
+ const current = fs.readFileSync(HOSTS_FILE, "utf8");
204
+ const filtered = current.split(/\r?\n/).filter(l => !entriesToRemove.some(h => l.includes(h))).join("\n");
205
+ const next = filtered.replace(/[\r\n\s]+$/g, "") + "\n";
206
+ const escaped = next.replace(/'/g, "'\\''");
207
+ await execWithPassword(`printf '%s' '${escaped}' | tee ${HOSTS_FILE} > /dev/null`, sudoPassword);
166
208
  await flushDNS(sudoPassword);
167
209
  }
168
210
  log(`🌐 DNS ${tool}: ✅ removed ${entriesToRemove.join(", ")}`);
@@ -196,8 +238,9 @@ function removeAllDNSEntriesSync() {
196
238
  const content = fs.readFileSync(HOSTS_FILE, "utf8");
197
239
  const eol = IS_WIN ? "\r\n" : "\n";
198
240
  const filtered = content.split(/\r?\n/).filter(l => !allHosts.some(h => l.includes(h))).join(eol);
199
- if (filtered === content) return;
200
- fs.writeFileSync(HOSTS_FILE, filtered, "utf8");
241
+ const next = filtered.replace(/[\r\n\s]+$/g, "") + eol;
242
+ if (next === content) return;
243
+ fs.writeFileSync(HOSTS_FILE, next, "utf8");
201
244
  if (IS_WIN) {
202
245
  try { execSync("ipconfig /flushdns", { windowsHide: true, stdio: "ignore" }); } catch { /* ignore */ }
203
246
  } else if (IS_MAC) {
@@ -216,6 +259,8 @@ module.exports = {
216
259
  removeAllDNSEntriesSync,
217
260
  execWithPassword,
218
261
  isSudoAvailable,
262
+ canRunSudoWithoutPassword,
263
+ isSudoPasswordRequired,
219
264
  checkDNSEntry,
220
265
  checkAllDNSStatus,
221
266
  };
@@ -5,7 +5,8 @@ const os = require("os");
5
5
  const net = require("net");
6
6
  const https = require("https");
7
7
  const crypto = require("crypto");
8
- const { addDNSEntry, removeDNSEntry, removeAllDNSEntries, checkAllDNSStatus, TOOL_HOSTS, isSudoAvailable } = require("./dns/dnsConfig");
8
+ const { addDNSEntry, removeDNSEntry, removeAllDNSEntries, removeAllDNSEntriesSync, checkAllDNSStatus, TOOL_HOSTS, isSudoAvailable, isSudoPasswordRequired } = require("./dns/dnsConfig");
9
+ const { isAdmin } = require("./winElevated.js");
9
10
 
10
11
  const IS_WIN = process.platform === "win32";
11
12
  const IS_MAC = process.platform === "darwin";
@@ -108,9 +109,9 @@ function killProcess(pid, force = false, sudoPassword = null) {
108
109
  } else {
109
110
  const sig = force ? "SIGKILL" : "SIGTERM";
110
111
  const cmd = `pkill -${sig} -P ${pid} 2>/dev/null; kill -${sig} ${pid} 2>/dev/null`;
111
- if (sudoPassword) {
112
+ if (sudoPassword || isSudoAvailable()) {
112
113
  const { execWithPassword } = require("./dns/dnsConfig");
113
- execWithPassword(cmd, sudoPassword).catch(() => exec(cmd, { windowsHide: true }, () => { }));
114
+ execWithPassword(cmd, sudoPassword || "").catch(() => exec(cmd, { windowsHide: true }, () => { }));
114
115
  } else {
115
116
  exec(cmd, { windowsHide: true }, () => { });
116
117
  }
@@ -188,6 +189,55 @@ async function loadEncryptedPassword() {
188
189
  }
189
190
  }
190
191
 
192
+ async function saveDnsToolState(tool, enabled) {
193
+ if (!_updateSettings || !_getSettings) return;
194
+ try {
195
+ const s = await _getSettings();
196
+ const next = { ...(s.dnsToolEnabled || {}), [tool]: enabled };
197
+ await _updateSettings({ dnsToolEnabled: next });
198
+ } catch (e) {
199
+ err(`Failed to save DNS state: ${e.message}`);
200
+ }
201
+ }
202
+
203
+ async function loadDnsToolState() {
204
+ if (!_getSettings) return {};
205
+ try {
206
+ const s = await _getSettings();
207
+ return s.dnsToolEnabled || {};
208
+ } catch {
209
+ return {};
210
+ }
211
+ }
212
+
213
+ /**
214
+ * Re-apply DNS for tools previously enabled — called on app startup after MITM running.
215
+ */
216
+ async function restoreToolDNS(sudoPassword) {
217
+ const state = await loadDnsToolState();
218
+ const password = sudoPassword || getCachedPassword() || await loadEncryptedPassword();
219
+ for (const [tool, enabled] of Object.entries(state)) {
220
+ if (!enabled || !TOOL_HOSTS[tool]) continue;
221
+ try {
222
+ await addDNSEntry(tool, password);
223
+ } catch (e) {
224
+ err(`DNS ${tool}: restore failed — ${e.message}`);
225
+ }
226
+ }
227
+ }
228
+
229
+ /**
230
+ * Check if user has privilege to mutate hosts file.
231
+ * Win: needs admin. Mac/Linux: root OR cached/encrypted sudo password.
232
+ */
233
+ async function hasDnsPrivilege() {
234
+ if (IS_WIN) return isAdmin();
235
+ if (isAdmin()) return true;
236
+ if (!isSudoPasswordRequired()) return true;
237
+ const pwd = getCachedPassword() || await loadEncryptedPassword();
238
+ return !!pwd;
239
+ }
240
+
191
241
  function checkPort443Free() {
192
242
  return new Promise((resolve) => {
193
243
  const tester = net.createServer();
@@ -248,9 +298,9 @@ async function killLeftoverMitm(sudoPassword) {
248
298
  if (!IS_WIN && SERVER_PATH) {
249
299
  try {
250
300
  const escaped = SERVER_PATH.replace(/'/g, "'\\''");
251
- if (sudoPassword) {
301
+ if (sudoPassword || isSudoAvailable()) {
252
302
  const { execWithPassword } = require("./dns/dnsConfig");
253
- await execWithPassword(`pkill -SIGKILL -f "${escaped}" 2>/dev/null || true`, sudoPassword).catch(() => { });
303
+ await execWithPassword(`pkill -SIGKILL -f "${escaped}" 2>/dev/null || true`, sudoPassword || "").catch(() => { });
254
304
  } else {
255
305
  exec(`pkill -SIGKILL -f "${escaped}" 2>/dev/null || true`, { windowsHide: true }, () => { });
256
306
  }
@@ -363,7 +413,26 @@ async function scheduleMitmRestart(apiKey) {
363
413
  /**
364
414
  * Start MITM server only (cert + server, no DNS)
365
415
  */
366
- async function startServer(apiKey, sudoPassword) {
416
+ async function killPort443Owner(owner, sudoPassword) {
417
+ if (!owner || !owner.pid) return;
418
+ if (IS_WIN) {
419
+ try {
420
+ execSync(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${owner.pid} -Force -ErrorAction SilentlyContinue"`, { windowsHide: true });
421
+ } catch { /* best effort */ }
422
+ } else {
423
+ try {
424
+ const { execWithPassword } = require("./dns/dnsConfig");
425
+ if (sudoPassword || isSudoAvailable()) {
426
+ await execWithPassword(`kill -9 ${owner.pid}`, sudoPassword || "");
427
+ } else {
428
+ execSync(`kill -9 ${owner.pid}`, { windowsHide: true });
429
+ }
430
+ } catch { /* best effort */ }
431
+ }
432
+ await new Promise(r => setTimeout(r, 800));
433
+ }
434
+
435
+ async function startServer(apiKey, sudoPassword, forceKillPort443 = false) {
367
436
  if (!serverProcess || serverProcess.killed) {
368
437
  try {
369
438
  if (fs.existsSync(PID_FILE)) {
@@ -391,19 +460,19 @@ async function startServer(apiKey, sudoPassword) {
391
460
  const portStatus = await checkPort443Free();
392
461
  if (portStatus === "in-use" || portStatus === "no-permission") {
393
462
  const owner = await getPort443Owner(sudoPassword);
394
- const ownerIsNode = owner && (owner.name === "node" || owner.name.includes("node"));
395
- if (ownerIsNode) {
396
- log(`Killing orphan node process on port 443 (PID ${owner.pid}, name=${owner.name})...`);
397
- try {
398
- const { execWithPassword } = require("./dns/dnsConfig");
399
- await execWithPassword(`kill -9 ${owner.pid}`, sudoPassword);
400
- await new Promise(r => setTimeout(r, 800));
401
- } catch { /* best effort */ }
402
- } else if (owner) {
463
+ if (owner) {
403
464
  const shortName = owner.name.includes("/")
404
465
  ? owner.name.split("/").filter(Boolean).pop()
405
466
  : owner.name;
406
- throw new Error(`Port 443 is already in use by "${shortName}" (PID ${owner.pid}). Stop that process first.`);
467
+ if (forceKillPort443) {
468
+ log(`Killing process on port 443 (PID ${owner.pid}, name=${shortName})...`);
469
+ await killPort443Owner(owner, sudoPassword);
470
+ } else {
471
+ const e = new Error(`Port 443 is already in use by "${shortName}" (PID ${owner.pid}).`);
472
+ e.code = "PORT_443_BUSY";
473
+ e.portOwner = { pid: owner.pid, name: shortName };
474
+ throw e;
475
+ }
407
476
  }
408
477
  }
409
478
  }
@@ -434,7 +503,7 @@ async function startServer(apiKey, sudoPassword) {
434
503
  if (linuxNoSystemTrust) {
435
504
  log(`🔐 Cert: skipping system trust (no sudo). Install ${rootCACertPath} as a trusted CA on machines that use this proxy.`);
436
505
  } else {
437
- if (!password && !IS_WIN) {
506
+ if (!password && isSudoPasswordRequired()) {
438
507
  throw new Error("Sudo password required to install Root CA certificate");
439
508
  }
440
509
  try {
@@ -452,12 +521,19 @@ async function startServer(apiKey, sudoPassword) {
452
521
  const mitmRouterBase = await resolveMitmRouterBaseUrl();
453
522
  log(`🚀 Starting server... (router: ${mitmRouterBase})`);
454
523
  if (IS_WIN) {
455
- // Kill any process using port 443 before spawning
456
- try {
457
- const psKill = `$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c -and $c.OwningProcess -gt 4) { Stop-Process -Id $c.OwningProcess -Force -ErrorAction SilentlyContinue }`;
458
- execSync(`powershell -NonInteractive -WindowStyle Hidden -Command "${psKill}"`, { windowsHide: true });
459
- await new Promise(r => setTimeout(r, 500));
460
- } catch { /* best effort */ }
524
+ // Check port 443 ask user before killing
525
+ const winOwner = await getPort443Owner(sudoPassword);
526
+ if (winOwner) {
527
+ if (forceKillPort443) {
528
+ log(`Killing process on port 443 (PID ${winOwner.pid}, name=${winOwner.name})...`);
529
+ await killPort443Owner(winOwner, sudoPassword);
530
+ } else {
531
+ const e = new Error(`Port 443 is already in use by "${winOwner.name}" (PID ${winOwner.pid}).`);
532
+ e.code = "PORT_443_BUSY";
533
+ e.portOwner = { pid: winOwner.pid, name: winOwner.name };
534
+ throw e;
535
+ }
536
+ }
461
537
 
462
538
  // Spawn directly — process already has admin rights
463
539
  serverProcess = spawn(
@@ -603,7 +679,8 @@ async function stopServer(sudoPassword) {
603
679
  // Direct fs write — bypass PowerShell to avoid parser pitfalls
604
680
  const content = fs.readFileSync(hostsFile, "utf8");
605
681
  const filtered = content.split(/\r?\n/).filter(l => !allHosts.some(h => l.includes(h))).join("\r\n");
606
- if (filtered !== content) fs.writeFileSync(hostsFile, filtered, "utf8");
682
+ const next = filtered.replace(/[\r\n\s]+$/g, "") + "\r\n";
683
+ if (next !== content) fs.writeFileSync(hostsFile, next, "utf8");
607
684
  try { require("child_process").execSync("ipconfig /flushdns", { windowsHide: true, stdio: "ignore" }); } catch { /* ignore */ }
608
685
  log("🌐 DNS: ✅ all tool hosts removed");
609
686
  } else {
@@ -638,10 +715,10 @@ async function stopServer(sudoPassword) {
638
715
  async function enableToolDNS(tool, sudoPassword) {
639
716
  const status = await getMitmStatus();
640
717
  if (!status.running) throw new Error("MITM server is not running. Start the server first.");
641
-
642
- // Use cached password if not provided
718
+
643
719
  const password = sudoPassword || getCachedPassword() || await loadEncryptedPassword();
644
720
  await addDNSEntry(tool, password);
721
+ await saveDnsToolState(tool, true);
645
722
  return { success: true };
646
723
  }
647
724
 
@@ -649,9 +726,9 @@ async function enableToolDNS(tool, sudoPassword) {
649
726
  * Disable DNS for a specific tool
650
727
  */
651
728
  async function disableToolDNS(tool, sudoPassword) {
652
- // Use cached password if not provided
653
729
  const password = sudoPassword || getCachedPassword() || await loadEncryptedPassword();
654
730
  await removeDNSEntry(tool, password);
731
+ await saveDnsToolState(tool, false);
655
732
  return { success: true };
656
733
  }
657
734
 
@@ -667,7 +744,7 @@ async function trustCert(sudoPassword) {
667
744
  return;
668
745
  }
669
746
  const password = sudoPassword || getCachedPassword() || await loadEncryptedPassword();
670
- if (!password && !IS_WIN) throw new Error("Sudo password required to trust certificate");
747
+ if (!password && isSudoPasswordRequired()) throw new Error("Sudo password required to trust certificate");
671
748
  await installCert(password, rootCACertPath);
672
749
  if (password) setCachedPassword(password);
673
750
  }
@@ -690,5 +767,9 @@ module.exports = {
690
767
  setCachedPassword,
691
768
  loadEncryptedPassword,
692
769
  clearEncryptedPassword,
770
+ isSudoPasswordRequired,
693
771
  initDbHooks,
772
+ restoreToolDNS,
773
+ hasDnsPrivilege,
774
+ removeAllDNSEntriesSync,
694
775
  };
@@ -12,9 +12,15 @@ const { getCertForDomain } = require("./cert/generate");
12
12
  const DB_FILE = path.join(DATA_DIR, "db.json");
13
13
  const LOCAL_PORT = 443;
14
14
  const IS_WIN = process.platform === "win32";
15
- const ENABLE_FILE_LOG = false;
15
+ const ENABLE_FILE_LOG = true;
16
16
  const INTERNAL_REQUEST_HEADER = { name: "x-request-source", value: "local" };
17
17
 
18
+ // Host rewrite for upstream forward: PROD cloudcode-pa is rate-limited (429),
19
+ // daily-cloudcode-pa (dev endpoint) accepts same body+token. Same trick as open-sse.
20
+ const HOST_REWRITE = {
21
+ "cloudcode-pa.googleapis.com": "daily-cloudcode-pa.googleapis.com",
22
+ };
23
+
18
24
  // Load handlers — dev/ overrides handlers/ for private implementations
19
25
  function loadHandler(name) {
20
26
  try { return require(`./dev/${name}`); } catch {}
@@ -44,7 +50,6 @@ function sniCallback(servername, cb) {
44
50
  cert: `${certData.cert}\n${rootCAPem}`
45
51
  });
46
52
  certCache.set(servername, ctx);
47
- log(`🔐 Cert generated: ${servername}`);
48
53
  cb(null, ctx);
49
54
  } catch (e) {
50
55
  err(`SNI error for ${servername}: ${e.message}`);
@@ -124,7 +129,8 @@ function getMappedModel(tool, model) {
124
129
  * Also tees full stream into a dump file when ENABLE_FILE_LOG is on.
125
130
  */
126
131
  async function passthrough(req, res, bodyBuffer, onResponse) {
127
- const targetHost = (req.headers.host || TARGET_HOSTS[0]).split(":")[0];
132
+ const originalHost = (req.headers.host || TARGET_HOSTS[0]).split(":")[0];
133
+ const targetHost = HOST_REWRITE[originalHost] || originalHost;
128
134
  const targetIP = await resolveTargetIP(targetHost);
129
135
  const dumper = ENABLE_FILE_LOG ? createResponseDumper(req, "passthrough") : null;
130
136
 
@@ -195,18 +201,13 @@ const server = https.createServer(sslOptions, async (req, res) => {
195
201
  const isChat = patterns.some(p => req.url.includes(p));
196
202
  if (!isChat) return passthrough(req, res, bodyBuffer);
197
203
 
198
- log(`🔍 [${tool}] url=${req.url} | bodyLen=${bodyBuffer.length}`);
199
-
200
204
  // Cursor uses binary proto — model extraction not possible at this layer.
201
205
  // Delegate directly to handler which decodes proto internally.
202
206
  if (tool === "cursor") {
203
- log(`⚡ intercept | cursor | proto`);
204
207
  return handlers[tool].intercept(req, res, bodyBuffer, null, passthrough);
205
208
  }
206
209
 
207
210
  const model = extractModel(req.url, bodyBuffer);
208
- log(`🔍 [${tool}] model="${model}"`);
209
-
210
211
  const mappedModel = getMappedModel(tool, model);
211
212
  const db = fs.existsSync(DB_FILE) ? JSON.parse(fs.readFileSync(DB_FILE, "utf-8")) : {};
212
213
  const aliasMappings = db.mitmAlias?.[tool] || {};
@@ -7,13 +7,15 @@ const IS_WIN = process.platform === "win32";
7
7
  * Uses `net session` which only succeeds when elevated.
8
8
  */
9
9
  function isAdmin() {
10
- if (!IS_WIN) return false;
11
- try {
12
- execSync("net session >nul 2>&1", { windowsHide: true, stdio: "ignore" });
13
- return true;
14
- } catch {
15
- return false;
10
+ if (IS_WIN) {
11
+ try {
12
+ execSync("net session >nul 2>&1", { windowsHide: true, stdio: "ignore" });
13
+ return true;
14
+ } catch {
15
+ return false;
16
+ }
16
17
  }
18
+ return typeof process.getuid === "function" && process.getuid() === 0;
17
19
  }
18
20
 
19
21
  /**
@@ -7,6 +7,7 @@ const TOOL_HOSTS = {
7
7
  copilot: ["api.individual.githubcopilot.com"],
8
8
  kiro: ["q.us-east-1.amazonaws.com", "codewhisperer.us-east-1.amazonaws.com"],
9
9
  cursor: ["api2.cursor.sh"],
10
+ openrouter: ["openrouter.ai", "api.openrouter.ai"],
10
11
  };
11
12
 
12
13
  module.exports = { TOOL_HOSTS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yina-npm/openrouterx",
3
- "version": "0.4.11",
3
+ "version": "0.4.19",
4
4
  "description": "openrouterX CLI - Start and manage 9Router server",
5
5
  "bin": {
6
6
  "openrouterX": "./cli.js"