9router 0.3.85 → 0.3.87

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 (641) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +2 -4
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/prerender-manifest.json +3 -3
  5. package/app/.next/routes-manifest.json +6 -18
  6. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  7. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  13. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  15. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  16. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  18. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  19. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +12 -7
  22. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  25. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  27. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  28. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  30. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  31. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  33. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  34. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  36. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  37. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  40. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  42. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  43. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  45. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  46. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  48. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  49. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  51. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  52. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  54. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  55. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  57. package/app/.next/server/app/_global-error/page.js +3 -3
  58. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/_global-error.html +1 -1
  60. package/app/.next/server/app/_global-error.rsc +1 -1
  61. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  62. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  63. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  64. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  65. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  66. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  67. package/app/.next/server/app/_not-found/page.js +2 -2
  68. package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
  69. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  70. package/app/.next/server/app/_not-found.html +1 -1
  71. package/app/.next/server/app/_not-found.rsc +4 -4
  72. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  73. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  74. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  75. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  76. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  77. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  78. package/app/.next/server/app/api/auth/login/route.js +1 -1
  79. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  80. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  81. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +2 -2
  82. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  83. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +3 -3
  84. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  85. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  86. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  87. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  88. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  89. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  90. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  91. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  92. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  93. package/app/.next/server/app/api/combos/route.js +1 -1
  94. package/app/.next/server/app/api/health/route.js +1 -1
  95. package/app/.next/server/app/api/init/route.js +1 -1
  96. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  97. package/app/.next/server/app/api/keys/route.js +1 -1
  98. package/app/.next/server/app/api/locale/route.js +1 -1
  99. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  100. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  101. package/app/.next/server/app/api/models/alias/route.js +1 -1
  102. package/app/.next/server/app/api/models/availability/route.js +1 -1
  103. package/app/.next/server/app/api/models/route.js +1 -1
  104. package/app/.next/server/app/api/models/route.js.nft.json +1 -1
  105. package/app/.next/server/app/api/models/test/route.js +1 -1
  106. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  107. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  108. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  109. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  110. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  111. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  112. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  113. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  114. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  115. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  116. package/app/.next/server/app/api/pricing/route.js +1 -1
  117. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  118. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  119. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  120. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  121. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  122. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  123. package/app/.next/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  124. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  125. package/app/.next/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  126. package/app/.next/server/app/api/providers/client/route.js +1 -1
  127. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  128. package/app/.next/server/app/api/providers/route.js +1 -1
  129. package/app/.next/server/app/api/providers/route.js.nft.json +1 -1
  130. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  131. package/app/.next/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  132. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  133. package/app/.next/server/app/api/providers/validate/route.js.nft.json +1 -1
  134. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  135. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  136. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  137. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +33 -0
  138. package/app/.next/server/app/api/{9remote/install → proxy-pools/vercel-deploy}/route.js.nft.json +1 -1
  139. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route_client-reference-manifest.js +1 -0
  140. package/app/.next/server/app/api/settings/database/route.js +1 -1
  141. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  142. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  143. package/app/.next/server/app/api/settings/route.js +1 -1
  144. package/app/.next/server/app/api/shutdown/route.js +1 -1
  145. package/app/.next/server/app/api/tags/route.js +1 -1
  146. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  147. package/app/.next/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  148. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  149. package/app/.next/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  150. package/app/.next/server/app/api/translator/load/route.js +1 -1
  151. package/app/.next/server/app/api/translator/save/route.js +1 -1
  152. package/app/.next/server/app/api/translator/send/route.js +1 -1
  153. package/app/.next/server/app/api/translator/send/route.js.nft.json +1 -1
  154. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  155. package/app/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
  156. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  157. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  158. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  159. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +2 -2
  160. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  161. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  162. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +3 -3
  163. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +2 -2
  164. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  165. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  166. package/app/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  167. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  168. package/app/.next/server/app/api/usage/history/route.js +1 -1
  169. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  170. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  171. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  172. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  173. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  174. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  175. package/app/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  176. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  177. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  178. package/app/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  179. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  180. package/app/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  181. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  182. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  183. package/app/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
  184. package/app/.next/server/app/api/v1/models/route.js +1 -1
  185. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  186. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  187. package/app/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
  188. package/app/.next/server/app/api/v1/route.js +1 -1
  189. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  190. package/app/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  191. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  192. package/app/.next/server/app/api/v1beta/models/route.js.nft.json +1 -1
  193. package/app/.next/server/app/api/version/route.js +1 -1
  194. package/app/.next/server/app/callback/page.js +2 -2
  195. package/app/.next/server/app/callback/page.js.nft.json +1 -1
  196. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  197. package/app/.next/server/app/callback.html +1 -1
  198. package/app/.next/server/app/callback.rsc +4 -4
  199. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  200. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  201. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  202. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  203. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  204. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  205. package/app/.next/server/app/dashboard/basic-chat.html +1 -1
  206. package/app/.next/server/app/dashboard/basic-chat.rsc +6 -6
  207. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  208. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  209. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  210. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  211. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  212. package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  213. package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  214. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  215. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  216. package/app/.next/server/app/dashboard/cli-tools.rsc +6 -6
  217. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  218. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  219. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  220. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  221. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  222. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  223. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  224. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  225. package/app/.next/server/app/dashboard/combos.html +1 -1
  226. package/app/.next/server/app/dashboard/combos.rsc +6 -6
  227. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  228. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  229. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  230. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  231. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  232. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  233. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  234. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  235. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  236. package/app/.next/server/app/dashboard/endpoint.rsc +6 -6
  237. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  238. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  239. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  240. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  241. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  242. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  243. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  244. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  245. package/app/.next/server/app/dashboard/mitm.html +1 -1
  246. package/app/.next/server/app/dashboard/mitm.rsc +6 -6
  247. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  248. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  249. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  250. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  251. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  252. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  253. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  254. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  255. package/app/.next/server/app/dashboard/profile.html +1 -1
  256. package/app/.next/server/app/dashboard/profile.rsc +6 -6
  257. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  258. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  259. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  260. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  261. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  262. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  263. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  264. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  265. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  266. package/app/.next/server/app/dashboard/providers/new.rsc +6 -6
  267. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  268. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  269. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  271. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  272. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  273. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  274. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  275. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  276. package/app/.next/server/app/dashboard/providers.html +1 -1
  277. package/app/.next/server/app/dashboard/providers.rsc +6 -6
  278. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  279. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  280. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  283. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  284. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  285. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  286. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  287. package/app/.next/server/app/dashboard/proxy-pools.rsc +6 -6
  288. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  289. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  290. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  291. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  292. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  293. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  294. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  295. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  296. package/app/.next/server/app/dashboard/quota.html +2 -2
  297. package/app/.next/server/app/dashboard/quota.rsc +7 -7
  298. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  299. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  300. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  301. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  302. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  303. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  304. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  305. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  306. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  307. package/app/.next/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  308. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  309. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  310. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  311. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  312. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  313. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  314. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  315. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  316. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  317. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  318. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  319. package/app/.next/server/app/dashboard/translator.html +1 -1
  320. package/app/.next/server/app/dashboard/translator.rsc +6 -6
  321. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  322. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  323. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  324. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  325. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  326. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  327. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  328. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  329. package/app/.next/server/app/dashboard/usage.html +1 -1
  330. package/app/.next/server/app/dashboard/usage.rsc +6 -6
  331. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  332. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  333. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  334. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  335. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  336. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  337. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  338. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  339. package/app/.next/server/app/dashboard.html +1 -1
  340. package/app/.next/server/app/dashboard.rsc +6 -6
  341. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  342. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  343. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  344. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +6 -6
  345. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  346. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  347. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  348. package/app/.next/server/app/favicon.ico/route.js +1 -1
  349. package/app/.next/server/app/index.html +1 -1
  350. package/app/.next/server/app/index.rsc +4 -4
  351. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  352. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  353. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  354. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  355. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  356. package/app/.next/server/app/landing/page.js +2 -2
  357. package/app/.next/server/app/landing/page.js.nft.json +1 -1
  358. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  359. package/app/.next/server/app/landing.html +1 -1
  360. package/app/.next/server/app/landing.rsc +4 -4
  361. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  362. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  363. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  364. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  365. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  366. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  367. package/app/.next/server/app/login/page.js +2 -2
  368. package/app/.next/server/app/login/page.js.nft.json +1 -1
  369. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  370. package/app/.next/server/app/login.html +1 -1
  371. package/app/.next/server/app/login.rsc +5 -5
  372. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  373. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  374. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  375. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  376. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  377. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  378. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  379. package/app/.next/server/app/page.js +2 -2
  380. package/app/.next/server/app/page.js.nft.json +1 -1
  381. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  382. package/app/.next/server/app-paths-manifest.json +2 -4
  383. package/app/.next/server/chunks/149.js +1 -1
  384. package/app/.next/server/chunks/1574.js +2 -2
  385. package/app/.next/server/chunks/2049.js +1 -1
  386. package/app/.next/server/chunks/242.js +1 -1
  387. package/app/.next/server/chunks/3159.js +1 -1
  388. package/app/.next/server/chunks/3774.js +2 -4
  389. package/app/.next/server/chunks/450.js +1 -1
  390. package/app/.next/server/chunks/6379.js +2 -2
  391. package/app/.next/server/chunks/7770.js +1 -1
  392. package/app/.next/server/chunks/7973.js +1 -1
  393. package/app/.next/server/chunks/8202.js +5 -5
  394. package/app/.next/server/chunks/8354.js +1 -0
  395. package/app/.next/server/chunks/8443.js +1 -1
  396. package/app/.next/server/chunks/{4891.js → 8838.js} +1 -1
  397. package/app/.next/server/chunks/8872.js +1 -1
  398. package/app/.next/server/chunks/9489.js +1 -1
  399. package/app/.next/server/middleware-build-manifest.js +1 -1
  400. package/app/.next/server/middleware.js +1 -1
  401. package/app/.next/server/pages/404.html +1 -1
  402. package/app/.next/server/pages/500.html +1 -1
  403. package/app/.next/server/server-reference-manifest.js +1 -1
  404. package/app/.next/server/server-reference-manifest.json +1 -1
  405. package/app/.next/static/ISW3Q3vhKNz3nIX0Um5qA/_buildManifest.js +1 -0
  406. package/app/.next/static/chunks/4156-79259ee78f702b12.js +7 -0
  407. package/app/.next/static/chunks/505-534835b087aaa3a0.js +1 -0
  408. package/app/.next/static/chunks/8035-f895fe0642100959.js +3 -0
  409. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-187f6bdd95bc5640.js +22 -0
  410. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-f532b1565bd8f227.js +1 -0
  411. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-34d04900ddd6932a.js +2 -0
  412. package/app/.next/static/chunks/app/(dashboard)/dashboard/quota/{page-61704bd0d8bd2bdf.js → page-3849d2b36c38ef3d.js} +1 -1
  413. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-1308b9d445962823.js +1 -0
  414. package/app/.next/static/chunks/app/(dashboard)/{layout-28cec0ea8271c92a.js → layout-757a35dbb4539aad.js} +1 -1
  415. package/app/.next/static/chunks/app/_global-error/page-ceb851f470785140.js +1 -0
  416. package/app/.next/static/chunks/app/api/auth/login/route-ceb851f470785140.js +1 -0
  417. package/app/.next/static/chunks/app/api/auth/logout/route-ceb851f470785140.js +1 -0
  418. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-ceb851f470785140.js +1 -0
  419. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-ceb851f470785140.js +1 -0
  420. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-ceb851f470785140.js +1 -0
  421. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-ceb851f470785140.js +1 -0
  422. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-ceb851f470785140.js +1 -0
  423. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-ceb851f470785140.js +1 -0
  424. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-ceb851f470785140.js +1 -0
  425. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-ceb851f470785140.js +1 -0
  426. package/app/.next/static/chunks/app/api/cloud/auth/route-ceb851f470785140.js +1 -0
  427. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-ceb851f470785140.js +1 -0
  428. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-ceb851f470785140.js +1 -0
  429. package/app/.next/static/chunks/app/api/cloud/models/alias/route-ceb851f470785140.js +1 -0
  430. package/app/.next/static/chunks/app/api/combos/[id]/route-ceb851f470785140.js +1 -0
  431. package/app/.next/static/chunks/app/api/combos/route-ceb851f470785140.js +1 -0
  432. package/app/.next/static/chunks/app/api/health/route-ceb851f470785140.js +1 -0
  433. package/app/.next/static/chunks/app/api/init/route-ceb851f470785140.js +1 -0
  434. package/app/.next/static/chunks/app/api/keys/[id]/route-ceb851f470785140.js +1 -0
  435. package/app/.next/static/chunks/app/api/keys/route-ceb851f470785140.js +1 -0
  436. package/app/.next/static/chunks/app/api/locale/route-ceb851f470785140.js +1 -0
  437. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-ceb851f470785140.js +1 -0
  438. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-ceb851f470785140.js +1 -0
  439. package/app/.next/static/chunks/app/api/models/alias/route-ceb851f470785140.js +1 -0
  440. package/app/.next/static/chunks/app/api/models/availability/route-ceb851f470785140.js +1 -0
  441. package/app/.next/static/chunks/app/api/models/route-ceb851f470785140.js +1 -0
  442. package/app/.next/static/chunks/app/api/models/test/route-ceb851f470785140.js +1 -0
  443. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-ceb851f470785140.js +1 -0
  444. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-ceb851f470785140.js +1 -0
  445. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-ceb851f470785140.js +1 -0
  446. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-ceb851f470785140.js +1 -0
  447. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-ceb851f470785140.js +1 -0
  448. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-ceb851f470785140.js +1 -0
  449. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-ceb851f470785140.js +1 -0
  450. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-ceb851f470785140.js +1 -0
  451. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-ceb851f470785140.js +1 -0
  452. package/app/.next/static/chunks/app/api/pricing/route-ceb851f470785140.js +1 -0
  453. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-ceb851f470785140.js +1 -0
  454. package/app/.next/static/chunks/app/api/provider-nodes/route-ceb851f470785140.js +1 -0
  455. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-ceb851f470785140.js +1 -0
  456. package/app/.next/static/chunks/app/api/providers/[id]/models/route-ceb851f470785140.js +1 -0
  457. package/app/.next/static/chunks/app/api/providers/[id]/route-ceb851f470785140.js +1 -0
  458. package/app/.next/static/chunks/app/api/providers/[id]/test/route-ceb851f470785140.js +1 -0
  459. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-ceb851f470785140.js +1 -0
  460. package/app/.next/static/chunks/app/api/providers/client/route-ceb851f470785140.js +1 -0
  461. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-ceb851f470785140.js +1 -0
  462. package/app/.next/static/chunks/app/api/providers/route-ceb851f470785140.js +1 -0
  463. package/app/.next/static/chunks/app/api/providers/test-batch/route-ceb851f470785140.js +1 -0
  464. package/app/.next/static/chunks/app/api/providers/validate/route-ceb851f470785140.js +1 -0
  465. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-ceb851f470785140.js +1 -0
  466. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-ceb851f470785140.js +1 -0
  467. package/app/.next/static/chunks/app/api/proxy-pools/route-ceb851f470785140.js +1 -0
  468. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-ceb851f470785140.js +1 -0
  469. package/app/.next/static/chunks/app/api/settings/database/route-ceb851f470785140.js +1 -0
  470. package/app/.next/static/chunks/app/api/settings/proxy-test/route-ceb851f470785140.js +1 -0
  471. package/app/.next/static/chunks/app/api/settings/require-login/route-ceb851f470785140.js +1 -0
  472. package/app/.next/static/chunks/app/api/settings/route-ceb851f470785140.js +1 -0
  473. package/app/.next/static/chunks/app/api/shutdown/route-ceb851f470785140.js +1 -0
  474. package/app/.next/static/chunks/app/api/tags/route-ceb851f470785140.js +1 -0
  475. package/app/.next/static/chunks/app/api/translator/console-logs/route-ceb851f470785140.js +1 -0
  476. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-ceb851f470785140.js +1 -0
  477. package/app/.next/static/chunks/app/api/translator/load/route-ceb851f470785140.js +1 -0
  478. package/app/.next/static/chunks/app/api/translator/save/route-ceb851f470785140.js +1 -0
  479. package/app/.next/static/chunks/app/api/translator/send/route-ceb851f470785140.js +1 -0
  480. package/app/.next/static/chunks/app/api/translator/translate/route-ceb851f470785140.js +1 -0
  481. package/app/.next/static/chunks/app/api/tunnel/disable/route-ceb851f470785140.js +1 -0
  482. package/app/.next/static/chunks/app/api/tunnel/enable/route-ceb851f470785140.js +1 -0
  483. package/app/.next/static/chunks/app/api/tunnel/status/route-ceb851f470785140.js +1 -0
  484. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-ceb851f470785140.js +1 -0
  485. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-ceb851f470785140.js +1 -0
  486. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-ceb851f470785140.js +1 -0
  487. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-ceb851f470785140.js +1 -0
  488. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-ceb851f470785140.js +1 -0
  489. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-ceb851f470785140.js +1 -0
  490. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-ceb851f470785140.js +1 -0
  491. package/app/.next/static/chunks/app/api/usage/chart/route-ceb851f470785140.js +1 -0
  492. package/app/.next/static/chunks/app/api/usage/history/route-ceb851f470785140.js +1 -0
  493. package/app/.next/static/chunks/app/api/usage/providers/route-ceb851f470785140.js +1 -0
  494. package/app/.next/static/chunks/app/api/usage/request-details/route-ceb851f470785140.js +1 -0
  495. package/app/.next/static/chunks/app/api/usage/request-logs/route-ceb851f470785140.js +1 -0
  496. package/app/.next/static/chunks/app/api/usage/stats/route-ceb851f470785140.js +1 -0
  497. package/app/.next/static/chunks/app/api/usage/stream/route-ceb851f470785140.js +1 -0
  498. package/app/.next/static/chunks/app/api/v1/api/chat/route-ceb851f470785140.js +1 -0
  499. package/app/.next/static/chunks/app/api/v1/audio/speech/route-ceb851f470785140.js +1 -0
  500. package/app/.next/static/chunks/app/api/v1/chat/completions/route-ceb851f470785140.js +1 -0
  501. package/app/.next/static/chunks/app/api/v1/embeddings/route-ceb851f470785140.js +1 -0
  502. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-ceb851f470785140.js +1 -0
  503. package/app/.next/static/chunks/app/api/v1/messages/route-ceb851f470785140.js +1 -0
  504. package/app/.next/static/chunks/app/api/v1/models/route-ceb851f470785140.js +1 -0
  505. package/app/.next/static/chunks/app/api/v1/responses/route-ceb851f470785140.js +1 -0
  506. package/app/.next/static/chunks/app/api/v1/route-ceb851f470785140.js +1 -0
  507. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-ceb851f470785140.js +1 -0
  508. package/app/.next/static/chunks/app/api/v1beta/models/route-ceb851f470785140.js +1 -0
  509. package/app/.next/static/chunks/app/api/version/route-ceb851f470785140.js +1 -0
  510. package/app/.next/static/chunks/app/manifest.webmanifest/route-ceb851f470785140.js +1 -0
  511. package/app/.next/static/chunks/app/page-ceb851f470785140.js +1 -0
  512. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-ceb851f470785140.js +1 -0
  513. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-ceb851f470785140.js +1 -0
  514. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-ceb851f470785140.js +1 -0
  515. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ceb851f470785140.js +1 -0
  516. package/app/.next/static/css/357a3570ee0fa8c1.css +1 -0
  517. package/app/package.json +1 -1
  518. package/app/src/mitm/server.js +1 -1
  519. package/package.json +1 -1
  520. package/app/.next/server/app/api/9remote/install/route.js +0 -1
  521. package/app/.next/server/app/api/9remote/install/route_client-reference-manifest.js +0 -1
  522. package/app/.next/server/app/api/9remote/start/route.js +0 -1
  523. package/app/.next/server/app/api/9remote/start/route.js.nft.json +0 -1
  524. package/app/.next/server/app/api/9remote/start/route_client-reference-manifest.js +0 -1
  525. package/app/.next/server/app/api/9remote/status/route.js +0 -1
  526. package/app/.next/server/app/api/9remote/status/route.js.nft.json +0 -1
  527. package/app/.next/server/app/api/9remote/status/route_client-reference-manifest.js +0 -1
  528. package/app/.next/server/chunks/1006.js +0 -1
  529. package/app/.next/static/SehCxEE1ZuRUt421fya-V/_buildManifest.js +0 -1
  530. package/app/.next/static/chunks/4156-f1ab9a44800f6c78.js +0 -7
  531. package/app/.next/static/chunks/505-3855c8d4dc4c4bcd.js +0 -1
  532. package/app/.next/static/chunks/8035-3dd25fa581b0cc7e.js +0 -3
  533. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-fca6728573e41e33.js +0 -17
  534. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-4f00b19622563066.js +0 -1
  535. package/app/.next/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-44d61ed9744d1025.js +0 -2
  536. package/app/.next/static/chunks/app/(dashboard)/dashboard/usage/page-ac2806ccdfd6ecae.js +0 -1
  537. package/app/.next/static/chunks/app/_global-error/page-c110d4ffccc765c0.js +0 -1
  538. package/app/.next/static/chunks/app/api/9remote/install/route-c110d4ffccc765c0.js +0 -1
  539. package/app/.next/static/chunks/app/api/9remote/start/route-c110d4ffccc765c0.js +0 -1
  540. package/app/.next/static/chunks/app/api/9remote/status/route-c110d4ffccc765c0.js +0 -1
  541. package/app/.next/static/chunks/app/api/auth/login/route-c110d4ffccc765c0.js +0 -1
  542. package/app/.next/static/chunks/app/api/auth/logout/route-c110d4ffccc765c0.js +0 -1
  543. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-c110d4ffccc765c0.js +0 -1
  544. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-c110d4ffccc765c0.js +0 -1
  545. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-c110d4ffccc765c0.js +0 -1
  546. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-c110d4ffccc765c0.js +0 -1
  547. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-c110d4ffccc765c0.js +0 -1
  548. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-c110d4ffccc765c0.js +0 -1
  549. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-c110d4ffccc765c0.js +0 -1
  550. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-c110d4ffccc765c0.js +0 -1
  551. package/app/.next/static/chunks/app/api/cloud/auth/route-c110d4ffccc765c0.js +0 -1
  552. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-c110d4ffccc765c0.js +0 -1
  553. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-c110d4ffccc765c0.js +0 -1
  554. package/app/.next/static/chunks/app/api/cloud/models/alias/route-c110d4ffccc765c0.js +0 -1
  555. package/app/.next/static/chunks/app/api/combos/[id]/route-c110d4ffccc765c0.js +0 -1
  556. package/app/.next/static/chunks/app/api/combos/route-c110d4ffccc765c0.js +0 -1
  557. package/app/.next/static/chunks/app/api/health/route-c110d4ffccc765c0.js +0 -1
  558. package/app/.next/static/chunks/app/api/init/route-c110d4ffccc765c0.js +0 -1
  559. package/app/.next/static/chunks/app/api/keys/[id]/route-c110d4ffccc765c0.js +0 -1
  560. package/app/.next/static/chunks/app/api/keys/route-c110d4ffccc765c0.js +0 -1
  561. package/app/.next/static/chunks/app/api/locale/route-c110d4ffccc765c0.js +0 -1
  562. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-c110d4ffccc765c0.js +0 -1
  563. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-c110d4ffccc765c0.js +0 -1
  564. package/app/.next/static/chunks/app/api/models/alias/route-c110d4ffccc765c0.js +0 -1
  565. package/app/.next/static/chunks/app/api/models/availability/route-c110d4ffccc765c0.js +0 -1
  566. package/app/.next/static/chunks/app/api/models/route-c110d4ffccc765c0.js +0 -1
  567. package/app/.next/static/chunks/app/api/models/test/route-c110d4ffccc765c0.js +0 -1
  568. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-c110d4ffccc765c0.js +0 -1
  569. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-c110d4ffccc765c0.js +0 -1
  570. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-c110d4ffccc765c0.js +0 -1
  571. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-c110d4ffccc765c0.js +0 -1
  572. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-c110d4ffccc765c0.js +0 -1
  573. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-c110d4ffccc765c0.js +0 -1
  574. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-c110d4ffccc765c0.js +0 -1
  575. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-c110d4ffccc765c0.js +0 -1
  576. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-c110d4ffccc765c0.js +0 -1
  577. package/app/.next/static/chunks/app/api/pricing/route-c110d4ffccc765c0.js +0 -1
  578. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-c110d4ffccc765c0.js +0 -1
  579. package/app/.next/static/chunks/app/api/provider-nodes/route-c110d4ffccc765c0.js +0 -1
  580. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-c110d4ffccc765c0.js +0 -1
  581. package/app/.next/static/chunks/app/api/providers/[id]/models/route-c110d4ffccc765c0.js +0 -1
  582. package/app/.next/static/chunks/app/api/providers/[id]/route-c110d4ffccc765c0.js +0 -1
  583. package/app/.next/static/chunks/app/api/providers/[id]/test/route-c110d4ffccc765c0.js +0 -1
  584. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-c110d4ffccc765c0.js +0 -1
  585. package/app/.next/static/chunks/app/api/providers/client/route-c110d4ffccc765c0.js +0 -1
  586. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-c110d4ffccc765c0.js +0 -1
  587. package/app/.next/static/chunks/app/api/providers/route-c110d4ffccc765c0.js +0 -1
  588. package/app/.next/static/chunks/app/api/providers/test-batch/route-c110d4ffccc765c0.js +0 -1
  589. package/app/.next/static/chunks/app/api/providers/validate/route-c110d4ffccc765c0.js +0 -1
  590. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-c110d4ffccc765c0.js +0 -1
  591. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-c110d4ffccc765c0.js +0 -1
  592. package/app/.next/static/chunks/app/api/proxy-pools/route-c110d4ffccc765c0.js +0 -1
  593. package/app/.next/static/chunks/app/api/settings/database/route-c110d4ffccc765c0.js +0 -1
  594. package/app/.next/static/chunks/app/api/settings/proxy-test/route-c110d4ffccc765c0.js +0 -1
  595. package/app/.next/static/chunks/app/api/settings/require-login/route-c110d4ffccc765c0.js +0 -1
  596. package/app/.next/static/chunks/app/api/settings/route-c110d4ffccc765c0.js +0 -1
  597. package/app/.next/static/chunks/app/api/shutdown/route-c110d4ffccc765c0.js +0 -1
  598. package/app/.next/static/chunks/app/api/tags/route-c110d4ffccc765c0.js +0 -1
  599. package/app/.next/static/chunks/app/api/translator/console-logs/route-c110d4ffccc765c0.js +0 -1
  600. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-c110d4ffccc765c0.js +0 -1
  601. package/app/.next/static/chunks/app/api/translator/load/route-c110d4ffccc765c0.js +0 -1
  602. package/app/.next/static/chunks/app/api/translator/save/route-c110d4ffccc765c0.js +0 -1
  603. package/app/.next/static/chunks/app/api/translator/send/route-c110d4ffccc765c0.js +0 -1
  604. package/app/.next/static/chunks/app/api/translator/translate/route-c110d4ffccc765c0.js +0 -1
  605. package/app/.next/static/chunks/app/api/tunnel/disable/route-c110d4ffccc765c0.js +0 -1
  606. package/app/.next/static/chunks/app/api/tunnel/enable/route-c110d4ffccc765c0.js +0 -1
  607. package/app/.next/static/chunks/app/api/tunnel/status/route-c110d4ffccc765c0.js +0 -1
  608. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-c110d4ffccc765c0.js +0 -1
  609. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-c110d4ffccc765c0.js +0 -1
  610. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-c110d4ffccc765c0.js +0 -1
  611. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-c110d4ffccc765c0.js +0 -1
  612. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-c110d4ffccc765c0.js +0 -1
  613. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-c110d4ffccc765c0.js +0 -1
  614. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-c110d4ffccc765c0.js +0 -1
  615. package/app/.next/static/chunks/app/api/usage/chart/route-c110d4ffccc765c0.js +0 -1
  616. package/app/.next/static/chunks/app/api/usage/history/route-c110d4ffccc765c0.js +0 -1
  617. package/app/.next/static/chunks/app/api/usage/providers/route-c110d4ffccc765c0.js +0 -1
  618. package/app/.next/static/chunks/app/api/usage/request-details/route-c110d4ffccc765c0.js +0 -1
  619. package/app/.next/static/chunks/app/api/usage/request-logs/route-c110d4ffccc765c0.js +0 -1
  620. package/app/.next/static/chunks/app/api/usage/stats/route-c110d4ffccc765c0.js +0 -1
  621. package/app/.next/static/chunks/app/api/usage/stream/route-c110d4ffccc765c0.js +0 -1
  622. package/app/.next/static/chunks/app/api/v1/api/chat/route-c110d4ffccc765c0.js +0 -1
  623. package/app/.next/static/chunks/app/api/v1/audio/speech/route-c110d4ffccc765c0.js +0 -1
  624. package/app/.next/static/chunks/app/api/v1/chat/completions/route-c110d4ffccc765c0.js +0 -1
  625. package/app/.next/static/chunks/app/api/v1/embeddings/route-c110d4ffccc765c0.js +0 -1
  626. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-c110d4ffccc765c0.js +0 -1
  627. package/app/.next/static/chunks/app/api/v1/messages/route-c110d4ffccc765c0.js +0 -1
  628. package/app/.next/static/chunks/app/api/v1/models/route-c110d4ffccc765c0.js +0 -1
  629. package/app/.next/static/chunks/app/api/v1/responses/route-c110d4ffccc765c0.js +0 -1
  630. package/app/.next/static/chunks/app/api/v1/route-c110d4ffccc765c0.js +0 -1
  631. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-c110d4ffccc765c0.js +0 -1
  632. package/app/.next/static/chunks/app/api/v1beta/models/route-c110d4ffccc765c0.js +0 -1
  633. package/app/.next/static/chunks/app/api/version/route-c110d4ffccc765c0.js +0 -1
  634. package/app/.next/static/chunks/app/manifest.webmanifest/route-c110d4ffccc765c0.js +0 -1
  635. package/app/.next/static/chunks/app/page-c110d4ffccc765c0.js +0 -1
  636. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-c110d4ffccc765c0.js +0 -1
  637. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-c110d4ffccc765c0.js +0 -1
  638. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-c110d4ffccc765c0.js +0 -1
  639. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c110d4ffccc765c0.js +0 -1
  640. package/app/.next/static/css/3c8c3188174785a1.css +0 -1
  641. /package/app/.next/static/{SehCxEE1ZuRUt421fya-V → ISW3Q3vhKNz3nIX0Um5qA}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=2919,a.ids=[2919],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},37085:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{POST:()=>x});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(37770);async function x(a){try{let b,{model:c,kind:d}=await a.json();if(!c)return v.NextResponse.json({error:"Model required"},{status:400});let e=process.env.BASE_URL||(b=new URL(a.url),`${b.protocol}//${b.host}`),f=null;try{let a=await (0,w.getApiKeys)();f=a.find(a=>!1!==a.isActive)?.key||null}catch{}let g={"Content-Type":"application/json"};f&&(g.Authorization=`Bearer ${f}`);let h=Date.now();if("embedding"===d){let a=await fetch(`${e}/api/v1/embeddings`,{method:"POST",headers:g,body:JSON.stringify({model:c,input:"test"}),signal:AbortSignal.timeout(15e3)}),b=Date.now()-h,d=await a.text().catch(()=>""),f=null;try{f=d?JSON.parse(d):null}catch{}if(!a.ok){let c=f?.error?.message||f?.error||d;return v.NextResponse.json({ok:!1,latencyMs:b,error:`HTTP ${a.status}${c?`: ${String(c).slice(0,240)}`:""}`,status:a.status})}if(!(Array.isArray(f?.data)&&f.data.length>0&&Array.isArray(f.data[0]?.embedding)))return v.NextResponse.json({ok:!1,latencyMs:b,status:a.status,error:"Provider returned no embedding data"});return v.NextResponse.json({ok:!0,latencyMs:b,error:null,status:a.status})}let i=await fetch(`${e}/api/v1/chat/completions`,{method:"POST",headers:g,body:JSON.stringify({model:c,max_tokens:1,stream:!1,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(15e3)}),j=Date.now()-h,k=await i.text().catch(()=>""),l=null;try{l=k?JSON.parse(k):null}catch{}if(!i.ok){let a=l?.error?.message||l?.msg||l?.message||l?.error||k,b=`HTTP ${i.status}${a?`: ${String(a).slice(0,240)}`:""}`;return v.NextResponse.json({ok:!1,latencyMs:j,error:b,status:i.status})}let m=l?.status,n=l?.msg||l?.message;if(null!=m&&"200"!==String(m)&&"0"!==String(m)&&n)return v.NextResponse.json({ok:!1,latencyMs:j,status:i.status,error:`Provider status ${m}: ${String(n).slice(0,240)}`});if(l?.error){let a=l?.error?.message||l?.error||"Provider returned an error";return v.NextResponse.json({ok:!1,latencyMs:j,status:i.status,error:String(a).slice(0,240)})}if(!(Array.isArray(l?.choices)&&l.choices.length>0))return v.NextResponse.json({ok:!1,latencyMs:j,status:i.status,error:"Provider returned no completion choices for this model"});return v.NextResponse.json({ok:!0,latencyMs:j,error:null,status:i.status})}catch(a){return v.NextResponse.json({ok:!1,error:a.message},{status:500})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/models/test/route",pathname:"/api/models/test",filename:"route",bundlePath:"app/api/models/test/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/models/test/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/models/test/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=37085));module.exports=c})();
1
+ (()=>{var a={};a.id=2919,a.ids=[2919],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},69572:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>D,patchFetch:()=>C,routeModule:()=>y,serverHooks:()=>B,workAsyncStorage:()=>z,workUnitAsyncStorage:()=>A});var d={};c.r(d),c.d(d,{POST:()=>x});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(37770);async function x(a){try{let b,{model:c,kind:d}=await a.json();if(!c)return v.NextResponse.json({error:"Model required"},{status:400});let e=process.env.BASE_URL||(b=new URL(a.url),`${b.protocol}//${b.host}`),f=null;try{let a=await (0,w.getApiKeys)();f=a.find(a=>!1!==a.isActive)?.key||null}catch{}let g={"Content-Type":"application/json"};f&&(g.Authorization=`Bearer ${f}`);let h=Date.now();if("embedding"===d){let a=await fetch(`${e}/api/v1/embeddings`,{method:"POST",headers:g,body:JSON.stringify({model:c,input:"test"}),signal:AbortSignal.timeout(15e3)}),b=Date.now()-h,d=await a.text().catch(()=>""),f=null;try{f=d?JSON.parse(d):null}catch{}if(!a.ok){let c=f?.error?.message||f?.error||d;return v.NextResponse.json({ok:!1,latencyMs:b,error:`HTTP ${a.status}${c?`: ${String(c).slice(0,240)}`:""}`,status:a.status})}if(!(Array.isArray(f?.data)&&f.data.length>0&&Array.isArray(f.data[0]?.embedding)))return v.NextResponse.json({ok:!1,latencyMs:b,status:a.status,error:"Provider returned no embedding data"});return v.NextResponse.json({ok:!0,latencyMs:b,error:null,status:a.status})}let i=await fetch(`${e}/api/v1/chat/completions`,{method:"POST",headers:g,body:JSON.stringify({model:c,max_tokens:1,stream:!1,messages:[{role:"user",content:"hi"}]}),signal:AbortSignal.timeout(15e3)}),j=Date.now()-h,k=await i.text().catch(()=>""),l=null;try{l=k?JSON.parse(k):null}catch{}if(!i.ok){let a=l?.error?.message||l?.msg||l?.message||l?.error||k,b=`HTTP ${i.status}${a?`: ${String(a).slice(0,240)}`:""}`;return v.NextResponse.json({ok:!1,latencyMs:j,error:b,status:i.status})}let m=l?.status,n=l?.msg||l?.message;if(null!=m&&"200"!==String(m)&&"0"!==String(m)&&n)return v.NextResponse.json({ok:!1,latencyMs:j,status:i.status,error:`Provider status ${m}: ${String(n).slice(0,240)}`});if(l?.error){let a=l?.error?.message||l?.error||"Provider returned an error";return v.NextResponse.json({ok:!1,latencyMs:j,status:i.status,error:String(a).slice(0,240)})}if(!(Array.isArray(l?.choices)&&l.choices.length>0))return v.NextResponse.json({ok:!1,latencyMs:j,status:i.status,error:"Provider returned no completion choices for this model"});return v.NextResponse.json({ok:!0,latencyMs:j,error:null,status:i.status})}catch(a){return v.NextResponse.json({ok:!1,error:a.message},{status:500})}}let y=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/models/test/route",pathname:"/api/models/test",filename:"route",bundlePath:"app/api/models/test/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/models/test/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:z,workUnitAsyncStorage:A,serverHooks:B}=y;function C(){return(0,g.patchFetch)({workAsyncStorage:z,workUnitAsyncStorage:A})}async function D(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),y.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/models/test/route";"/index"===d&&(d="/");let e=await y.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||y.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===y.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await y.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>y.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>y.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await y.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await y.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await y.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=69572));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9088,a.ids=[9088],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},9988:(a,b,c)=>{c.d(b,{lz:()=>f});var d=c(55511),e=c.n(d);function f(){let a=e().randomBytes(32).toString("base64url"),b=e().createHash("sha256").update(a).digest("base64url");return{codeVerifier:a,codeChallenge:b,state:e().randomBytes(32).toString("base64url")}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11909:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Gj:()=>k,Re:()=>l,Su:()=>m,kP:()=>j,sO:()=>i});var e=c(46379),f=c(9988),g=c(47978),h=a([e]);e=(h.then?(await h)():h)[0];let n={claude:{config:g.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},codex:{config:g.DI,flowType:"authorization_code_pkce",fixedPort:1455,callbackPath:"/auth/callback",buildAuthUrl:(a,b,c,d)=>{let e={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c},f=Object.entries(e).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in})},"gemini-cli":{config:g.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${g.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:getOAuthClientMetadata(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},antigravity:{config:g.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":g.YT.loadCodeAssistUserAgent,"X-Goog-Api-Client":g.YT.loadCodeAssistApiClient,"Client-Metadata":g.YT.loadCodeAssistClientMetadata,"x-request-source":"local"},c={ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"},d=await fetch(`${g.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"}}),e=d.ok?await d.json():{},f="",h="legacy-tier";try{let a=await fetch(g.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c})});if(a.ok){let b=await a.json();if(f=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){h=a.id.trim();break}}}}catch(a){console.log("Failed to load code assist:",a)}return f&&(async()=>{for(let a=0;a<10;a++){try{let a=await fetch(g.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:h,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:e,projectId:f}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},iflow:{config:g.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${g.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qoder:{config:g.hF,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,state:c});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${g.hF.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from Qoder");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qwen:{config:g.Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod})});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c})});return{ok:d.ok,data:await d.json()}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})},github:{config:g.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(g.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":g.Nu.apiVersion,"User-Agent":g.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(g.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":g.Nu.apiVersion,"User-Agent":g.Nu.userAgent}}),e=d.ok?await d.json():{};return{copilotToken:c,userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},kiro:{config:g.Tx,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.registerClientUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl})});if(!b.ok){let a=await b.text();throw Error(`Client registration failed: ${a}`)}let c=await b.json(),d=await fetch(a.deviceAuthUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:c.clientId,clientSecret:c.clientSecret,startUrl:a.startUrl})});if(!d.ok){let a=await d.text();throw Error(`Device authorization failed: ${a}`)}let e=await d.json();return{device_code:e.deviceCode,user_code:e.userCode,verification_uri:e.verificationUri,verification_uri_complete:e.verificationUriComplete,expires_in:e.expiresIn,interval:e.interval||5,_clientId:c.clientId,_clientSecret:c.clientSecret}},pollToken:async(a,b,c,d)=>{let e,f=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await f.json()}catch(b){let a=await f.text();e={error:"invalid_response",error_description:a}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret}})},cursor:{config:g.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},"kimi-coding":{config:g.t,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri||"https://www.kimi.com/code/authorize_device",verification_uri_complete:c.verification_uri_complete||`https://www.kimi.com/code/authorize_device?user_code=${c.user_code}`,expires_in:c.expires_in,interval:c.interval||5}},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in})},kilocode:{config:g.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},cline:{config:g.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},gitlab:{config:g.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=e.clientId||"",h=new URLSearchParams({client_id:g,redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${h.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},codebuddy:{config:g.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:JSON.stringify({state:b})});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer"}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:86400,providerSpecificData:{}})}};function i(a){let b=n[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}function j(a,b,c){let d=i(a),{codeVerifier:e,codeChallenge:g,state:h}=(0,f.lz)();return{authUrl:"device_code"===d.flowType?null:"authorization_code_pkce"===d.flowType?d.buildAuthUrl(d.config,b,h,g,c||{}):d.buildAuthUrl(d.config,b,h,void 0,c||{}),state:h,codeVerifier:e,codeChallenge:g,redirectUri:b,flowType:d.flowType,fixedPort:d.fixedPort,callbackPath:d.callbackPath||"/callback"}}async function k(a,b,c,d,e,f){let g=i(a),h=await g.exchangeToken(g.config,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(h)),g.mapTokens(h,j)}async function l(a,b){let c=i(a);if("device_code"!==c.flowType)throw Error(`Provider ${a} does not support device code flow`);return await c.requestDeviceCode(c.config,b)}async function m(a,b,c,d){let e=i(a);if("device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if(f.ok)if(f.data.access_token){let a=null;return e.postExchange&&(a=await e.postExchange(f.data)),{success:!0,tokens:e.mapTokens(f.data,a)}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}d()}catch(a){d(a)}})},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},15193:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(78644),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/[provider]/[action]/route",pathname:"/api/oauth/[provider]/[action]",filename:"route",bundlePath:"app/api/oauth/[provider]/[action]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/[provider]/[action]/route.js",nextConfigOutput:"standalone",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/[provider]/[action]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34278:(a,b,c)=>{c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47978:(a,b,c)=>{c.d(b,{DI:()=>e,Hp:()=>g,LT:()=>f,MZ:()=>o,Nl:()=>r,Nu:()=>k,OV:()=>d,Tx:()=>l,WN:()=>m,YT:()=>j,ZL:()=>i,f7:()=>q,hF:()=>h,lB:()=>p,t:()=>n}),c(21820);let d={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},e={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},f={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},g={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},h={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},i={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},j={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},k={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},l={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},m={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},n={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},o={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},p={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},q={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},r={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3}},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},73865:(a,b,c)=>{c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},74075:a=>{a.exports=require("zlib")},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},78644:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,POST:()=>j});var e=c(86606),f=c(11909),g=c(89442),h=a([f]);async function i(a,{params:b}){try{let{provider:c,action:d}=await b,{searchParams:g}=new URL(a.url);if("authorize"===d){let a=g.get("redirect_uri")||"http://localhost:8080/callback",b=new Set(["redirect_uri"]),d={};g.forEach((a,c)=>{b.has(c)||(d[c]=a)});let h=(0,f.kP)(c,a,Object.keys(d).length?d:void 0);return e.NextResponse.json(h)}if("device-code"===d){let a,b=(0,f.sO)(c);if("device_code"!==b.flowType)return e.NextResponse.json({error:"Provider does not support device code flow"},{status:400});let d=(0,f.kP)(c,null);return a=["github","kiro","kimi-coding","kilocode","codebuddy"].includes(c)?await (0,f.Re)(c):await (0,f.Re)(c,d.codeChallenge),e.NextResponse.json({...a,codeVerifier:d.codeVerifier})}return e.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return console.log("OAuth GET error:",a),e.NextResponse.json({error:a.message},{status:500})}}async function j(a,{params:b}){try{let c,{provider:d,action:h}=await b;try{c=await a.json()}catch{return e.NextResponse.json({error:"Invalid or empty request body"},{status:400})}if("exchange"===h){let{code:a,redirectUri:b,codeVerifier:h,state:i,meta:j}=c;if(!a||!b||!h&&!["cline"].includes(d))return e.NextResponse.json({error:"Missing required fields"},{status:400});let k=await (0,f.Gj)(d,a,b,h,i,j),l=await (0,g.iE)({provider:d,authType:"oauth",...k,expiresAt:k.expiresIn?new Date(Date.now()+1e3*k.expiresIn).toISOString():null,testStatus:"active"});return e.NextResponse.json({success:!0,connection:{id:l.id,provider:l.provider,email:l.email,displayName:l.displayName}})}if("poll"===h){let a,{deviceCode:b,codeVerifier:h,extraData:i}=c;if(!b)return e.NextResponse.json({error:"Missing device code"},{status:400});if(["github","kimi-coding","kilocode","codebuddy"].includes(d))a=await (0,f.Su)(d,b);else if("kiro"===d)a=await (0,f.Su)(d,b,null,i);else{if(!h)return e.NextResponse.json({error:"Missing code verifier"},{status:400});a=await (0,f.Su)(d,b,h)}if(a.success){let b=await (0,g.iE)({provider:d,authType:"oauth",...a.tokens,expiresAt:a.tokens.expiresIn?new Date(Date.now()+1e3*a.tokens.expiresIn).toISOString():null,testStatus:"active"});return e.NextResponse.json({success:!0,connection:{id:b.id,provider:b.provider}})}let j=a.pending||"authorization_pending"===a.error||"slow_down"===a.error;return e.NextResponse.json({success:!1,error:a.error,errorDescription:a.errorDescription,pending:j})}return e.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return console.log("OAuth POST error:",a),e.NextResponse.json({error:a.message},{status:500})}}f=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},79551:a=>{a.exports=require("url")},80099:a=>{a.exports=require("node:sqlite")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87997:a=>{a.exports=require("node:timers")},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.rj,ui:()=>d.ui});var d=c(37770)},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770,4891,126,1578,8202,6379],()=>b(b.s=15193));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9088,a.ids=[9088],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},643:a=>{a.exports=require("node:perf_hooks")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},9988:(a,b,c)=>{c.d(b,{lz:()=>f});var d=c(55511),e=c.n(d);function f(){let a=e().randomBytes(32).toString("base64url"),b=e().createHash("sha256").update(a).digest("base64url");return{codeVerifier:a,codeChallenge:b,state:e().randomBytes(32).toString("base64url")}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11909:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{Gj:()=>k,Re:()=>l,Su:()=>m,kP:()=>j,sO:()=>i});var e=c(46379),f=c(9988),g=c(47978),h=a([e]);e=(h.then?(await h)():h)[0];let n={claude:{config:g.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},codex:{config:g.DI,flowType:"authorization_code_pkce",fixedPort:1455,callbackPath:"/auth/callback",buildAuthUrl:(a,b,c,d)=>{let e={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c},f=Object.entries(e).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in})},"gemini-cli":{config:g.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${g.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:getOAuthClientMetadata(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},antigravity:{config:g.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":g.YT.loadCodeAssistUserAgent,"X-Goog-Api-Client":g.YT.loadCodeAssistApiClient,"Client-Metadata":g.YT.loadCodeAssistClientMetadata,"x-request-source":"local"},c={ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"},d=await fetch(`${g.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"}}),e=d.ok?await d.json():{},f="",h="legacy-tier";try{let a=await fetch(g.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c})});if(a.ok){let b=await a.json();if(f=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){h=a.id.trim();break}}}}catch(a){console.log("Failed to load code assist:",a)}return f&&(async()=>{for(let a=0;a<10;a++){try{let a=await fetch(g.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:h,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:e,projectId:f}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},iflow:{config:g.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${g.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qoder:{config:g.hF,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,state:c});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${g.hF.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from Qoder");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qwen:{config:g.Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod})});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c})});return{ok:d.ok,data:await d.json()}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})},github:{config:g.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(g.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":g.Nu.apiVersion,"User-Agent":g.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(g.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":g.Nu.apiVersion,"User-Agent":g.Nu.userAgent}}),e=d.ok?await d.json():{};return{copilotToken:c,userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},kiro:{config:g.Tx,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.registerClientUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl})});if(!b.ok){let a=await b.text();throw Error(`Client registration failed: ${a}`)}let c=await b.json(),d=await fetch(a.deviceAuthUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:c.clientId,clientSecret:c.clientSecret,startUrl:a.startUrl})});if(!d.ok){let a=await d.text();throw Error(`Device authorization failed: ${a}`)}let e=await d.json();return{device_code:e.deviceCode,user_code:e.userCode,verification_uri:e.verificationUri,verification_uri_complete:e.verificationUriComplete,expires_in:e.expiresIn,interval:e.interval||5,_clientId:c.clientId,_clientSecret:c.clientSecret}},pollToken:async(a,b,c,d)=>{let e,f=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await f.json()}catch(b){let a=await f.text();e={error:"invalid_response",error_description:a}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret}})},cursor:{config:g.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},"kimi-coding":{config:g.t,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri||"https://www.kimi.com/code/authorize_device",verification_uri_complete:c.verification_uri_complete||`https://www.kimi.com/code/authorize_device?user_code=${c.user_code}`,expires_in:c.expires_in,interval:c.interval||5}},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in})},kilocode:{config:g.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},cline:{config:g.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},gitlab:{config:g.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=e.clientId||"",h=new URLSearchParams({client_id:g,redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${h.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},codebuddy:{config:g.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:JSON.stringify({state:b})});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer"}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:86400,providerSpecificData:{}})}};function i(a){let b=n[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}function j(a,b,c){let d=i(a),{codeVerifier:e,codeChallenge:g,state:h}=(0,f.lz)();return{authUrl:"device_code"===d.flowType?null:"authorization_code_pkce"===d.flowType?d.buildAuthUrl(d.config,b,h,g,c||{}):d.buildAuthUrl(d.config,b,h,void 0,c||{}),state:h,codeVerifier:e,codeChallenge:g,redirectUri:b,flowType:d.flowType,fixedPort:d.fixedPort,callbackPath:d.callbackPath||"/callback"}}async function k(a,b,c,d,e,f){let g=i(a),h=await g.exchangeToken(g.config,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(h)),g.mapTokens(h,j)}async function l(a,b){let c=i(a);if("device_code"!==c.flowType)throw Error(`Provider ${a} does not support device code flow`);return await c.requestDeviceCode(c.config,b)}async function m(a,b,c,d){let e=i(a);if("device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if(f.ok)if(f.data.access_token){let a=null;return e.postExchange&&(a=await e.postExchange(f.data)),{success:!0,tokens:e.mapTokens(f.data,a)}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}d()}catch(a){d(a)}})},12412:a=>{a.exports=require("assert")},14985:a=>{a.exports=require("dns")},16698:a=>{a.exports=require("node:async_hooks")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29021:a=>{a.exports=require("fs")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29906:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{handler:()=>y,patchFetch:()=>x,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(78644),w=a([v]);v=(w.then?(await w)():w)[0];let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/[provider]/[action]/route",pathname:"/api/oauth/[provider]/[action]",filename:"route",bundlePath:"app/api/oauth/[provider]/[action]/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/[provider]/[action]/route.js",nextConfigOutput:"standalone",userland:v}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function x(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function y(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/[provider]/[action]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||z.isDev||y||(K=E,K="/index"===K?"/":K);let L=!0===z.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,w,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await z.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}d()}catch(a){d(a)}})},32467:a=>{a.exports=require("node:http2")},33873:a=>{a.exports=require("path")},34589:a=>{a.exports=require("node:assert")},37067:a=>{a.exports=require("node:http")},37540:a=>{a.exports=require("node:console")},38522:a=>{a.exports=require("node:zlib")},40610:a=>{a.exports=require("node:dns")},41692:a=>{a.exports=require("node:tls")},41792:a=>{a.exports=require("node:querystring")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47978:(a,b,c)=>{c.d(b,{DI:()=>e,Hp:()=>g,LT:()=>f,MZ:()=>o,Nl:()=>r,Nu:()=>k,OV:()=>d,Tx:()=>l,WN:()=>m,YT:()=>j,ZL:()=>i,f7:()=>q,hF:()=>h,lB:()=>p,t:()=>n}),c(21820);let d={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},e={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},f={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},g={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},h={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},i={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},j={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},k={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},l={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},m={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},n={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},o={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},p={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},q={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},r={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3}},48161:a=>{a.exports=require("node:os")},51455:a=>{a.exports=require("node:fs/promises")},53053:a=>{a.exports=require("node:diagnostics_channel")},55511:a=>{a.exports=require("crypto")},55591:a=>{a.exports=require("https")},57075:a=>{a.exports=require("node:stream")},57975:a=>{a.exports=require("node:util")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},73136:a=>{a.exports=require("node:url")},73429:a=>{a.exports=require("node:util/types")},73496:a=>{a.exports=require("http2")},74075:a=>{a.exports=require("zlib")},75919:a=>{a.exports=require("node:worker_threads")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},78474:a=>{a.exports=require("node:events")},78644:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{GET:()=>i,POST:()=>j});var e=c(86606),f=c(11909),g=c(89442),h=a([f]);async function i(a,{params:b}){try{let{provider:c,action:d}=await b,{searchParams:g}=new URL(a.url);if("authorize"===d){let a=g.get("redirect_uri")||"http://localhost:8080/callback",b=new Set(["redirect_uri"]),d={};g.forEach((a,c)=>{b.has(c)||(d[c]=a)});let h=(0,f.kP)(c,a,Object.keys(d).length?d:void 0);return e.NextResponse.json(h)}if("device-code"===d){let a,b=(0,f.sO)(c);if("device_code"!==b.flowType)return e.NextResponse.json({error:"Provider does not support device code flow"},{status:400});let d=(0,f.kP)(c,null);return a=["github","kiro","kimi-coding","kilocode","codebuddy"].includes(c)?await (0,f.Re)(c):await (0,f.Re)(c,d.codeChallenge),e.NextResponse.json({...a,codeVerifier:d.codeVerifier})}return e.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return console.log("OAuth GET error:",a),e.NextResponse.json({error:a.message},{status:500})}}async function j(a,{params:b}){try{let c,{provider:d,action:h}=await b;try{c=await a.json()}catch{return e.NextResponse.json({error:"Invalid or empty request body"},{status:400})}if("exchange"===h){let{code:a,redirectUri:b,codeVerifier:h,state:i,meta:j}=c;if(!a||!b||!h&&!["cline"].includes(d))return e.NextResponse.json({error:"Missing required fields"},{status:400});let k=await (0,f.Gj)(d,a,b,h,i,j),l=await (0,g.iE)({provider:d,authType:"oauth",...k,expiresAt:k.expiresIn?new Date(Date.now()+1e3*k.expiresIn).toISOString():null,testStatus:"active"});return e.NextResponse.json({success:!0,connection:{id:l.id,provider:l.provider,email:l.email,displayName:l.displayName}})}if("poll"===h){let a,{deviceCode:b,codeVerifier:h,extraData:i}=c;if(!b)return e.NextResponse.json({error:"Missing device code"},{status:400});if(["github","kimi-coding","kilocode","codebuddy"].includes(d))a=await (0,f.Su)(d,b);else if("kiro"===d)a=await (0,f.Su)(d,b,null,i);else{if(!h)return e.NextResponse.json({error:"Missing code verifier"},{status:400});a=await (0,f.Su)(d,b,h)}if(a.success){let b=await (0,g.iE)({provider:d,authType:"oauth",...a.tokens,expiresAt:a.tokens.expiresIn?new Date(Date.now()+1e3*a.tokens.expiresIn).toISOString():null,testStatus:"active"});return e.NextResponse.json({success:!0,connection:{id:b.id,provider:b.provider}})}let j=a.pending||"authorization_pending"===a.error||"slow_down"===a.error;return e.NextResponse.json({success:!1,error:a.error,errorDescription:a.errorDescription,pending:j})}return e.NextResponse.json({error:"Unknown action"},{status:400})}catch(a){return console.log("OAuth POST error:",a),e.NextResponse.json({error:a.message},{status:500})}}f=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},79551:a=>{a.exports=require("url")},79646:a=>{a.exports=require("child_process")},80099:a=>{a.exports=require("node:sqlite")},81115:a=>{a.exports=require("constants")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87997:a=>{a.exports=require("node:timers")},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.rj,ui:()=>d.ui});var d=c(37770)},91645:a=>{a.exports=require("net")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,2566,7770,8838,126,1578,8202,6379],()=>b(b.s=29906));module.exports=c})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../../../node_modules/@swc/helpers/package.json","../../../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../../../node_modules/next/package.json","../../../../../../../../node_modules/react/cjs/react.development.js","../../../../../../../../node_modules/react/cjs/react.production.js","../../../../../../../../node_modules/react/index.js","../../../../../../../../node_modules/react/package.json","../../../../../../../../package.json","../../../../../../../package.json","../../../../../../../src/shared/utils/apiKey.js","../../../../../../package.json","../../../../../chunks/1249.js","../../../../../chunks/126.js","../../../../../chunks/1578.js","../../../../../chunks/3656.js","../../../../../chunks/4891.js","../../../../../chunks/523.js","../../../../../chunks/6288.js","../../../../../chunks/6379.js","../../../../../chunks/64.js","../../../../../chunks/6799.js","../../../../../chunks/7690.js","../../../../../chunks/7770.js","../../../../../chunks/7773.js","../../../../../chunks/8202.js","../../../../../webpack-runtime.js","route_client-reference-manifest.js"]}
1
+ {"version":1,"files":["../../../../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../../../../node_modules/@swc/helpers/package.json","../../../../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../../../../node_modules/next/dist/client/components/app-router-headers.js","../../../../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../../../../node_modules/next/dist/client/lib/console.js","../../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../../../../node_modules/next/dist/lib/constants.js","../../../../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../../../../node_modules/next/dist/lib/is-error.js","../../../../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../../../../node_modules/next/dist/server/node-environment.js","../../../../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../../../../node_modules/next/dist/server/require-hook.js","../../../../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../../../../node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js","../../../../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../../../../node_modules/next/dist/shared/lib/router/utils/app-paths.js","../../../../../../../../node_modules/next/dist/shared/lib/segment.js","../../../../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../../../../node_modules/next/package.json","../../../../../../../../node_modules/react/cjs/react.development.js","../../../../../../../../node_modules/react/cjs/react.production.js","../../../../../../../../node_modules/react/index.js","../../../../../../../../node_modules/react/package.json","../../../../../../../../package.json","../../../../../../../package.json","../../../../../../../src/shared/utils/apiKey.js","../../../../../../package.json","../../../../../chunks/1249.js","../../../../../chunks/126.js","../../../../../chunks/1578.js","../../../../../chunks/2566.js","../../../../../chunks/3656.js","../../../../../chunks/523.js","../../../../../chunks/6288.js","../../../../../chunks/6379.js","../../../../../chunks/64.js","../../../../../chunks/6799.js","../../../../../chunks/7690.js","../../../../../chunks/7770.js","../../../../../chunks/7773.js","../../../../../chunks/8202.js","../../../../../chunks/8838.js","../../../../../webpack-runtime.js","route_client-reference-manifest.js"]}
@@ -1,4 +1,4 @@
1
- (()=>{var a={};a.id=7520,a.ids=[7520],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")},96374:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{GET:()=>E});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(79748),x=c(21820),y=c(33873),z=c(79646);let A=(0,c(28354).promisify)(z.execFile),B=["cursorAuth/accessToken","cursorAuth/token"],C=["storage.serviceMachineId","storage.machineId","telemetry.machineId"];async function D(a){let b=a=>{let b=a.trim();try{let a=JSON.parse(b);return"string"==typeof a?a:b}catch{return b}},c=async b=>{let{stdout:c}=await A("sqlite3",[a,b],{timeout:1e4});return c.trim()},d=null;for(let a of B)try{let e=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(e){d=b(e);break}}catch{}let e=null;for(let a of C)try{let d=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(d){e=b(d);break}}catch{}return{accessToken:d,machineId:e}}async function E(){try{let a=process.platform,b=function(a){let b=(0,x.homedir)();if("darwin"===a)return[(0,y.join)(b,"Library/Application Support/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,"Library/Application Support/Cursor - Insiders/User/globalStorage/state.vscdb")];if("win32"===a){let a=process.env.APPDATA||(0,y.join)(b,"AppData","Roaming"),c=process.env.LOCALAPPDATA||(0,y.join)(b,"AppData","Local");return[(0,y.join)(a,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(a,"Cursor - Insiders","User","globalStorage","state.vscdb"),(0,y.join)(c,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(c,"Programs","Cursor","User","globalStorage","state.vscdb")]}return[(0,y.join)(b,".config/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,".config/cursor/User/globalStorage/state.vscdb")]}(a),d=null;for(let a of b)try{await (0,w.access)(a,w.constants.R_OK),d=a;break}catch{}if(!d)return v.NextResponse.json({found:!1,error:`Cursor database not found. Checked locations:
1
+ (()=>{var a={};a.id=7520,a.ids=[7520],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10006:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>K,patchFetch:()=>J,routeModule:()=>F,serverHooks:()=>I,workAsyncStorage:()=>G,workUnitAsyncStorage:()=>H});var d={};c.r(d),c.d(d,{GET:()=>E});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(79748),x=c(21820),y=c(33873),z=c(79646);let A=(0,c(28354).promisify)(z.execFile),B=["cursorAuth/accessToken","cursorAuth/token"],C=["storage.serviceMachineId","storage.machineId","telemetry.machineId"];async function D(a){let b=a=>{let b=a.trim();try{let a=JSON.parse(b);return"string"==typeof a?a:b}catch{return b}},c=async b=>{let{stdout:c}=await A("sqlite3",[a,b],{timeout:1e4});return c.trim()},d=null;for(let a of B)try{let e=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(e){d=b(e);break}}catch{}let e=null;for(let a of C)try{let d=await c(`SELECT value FROM itemTable WHERE key='${a}' LIMIT 1`);if(d){e=b(d);break}}catch{}return{accessToken:d,machineId:e}}async function E(){try{let a=process.platform,b=function(a){let b=(0,x.homedir)();if("darwin"===a)return[(0,y.join)(b,"Library/Application Support/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,"Library/Application Support/Cursor - Insiders/User/globalStorage/state.vscdb")];if("win32"===a){let a=process.env.APPDATA||(0,y.join)(b,"AppData","Roaming"),c=process.env.LOCALAPPDATA||(0,y.join)(b,"AppData","Local");return[(0,y.join)(a,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(a,"Cursor - Insiders","User","globalStorage","state.vscdb"),(0,y.join)(c,"Cursor","User","globalStorage","state.vscdb"),(0,y.join)(c,"Programs","Cursor","User","globalStorage","state.vscdb")]}return[(0,y.join)(b,".config/Cursor/User/globalStorage/state.vscdb"),(0,y.join)(b,".config/cursor/User/globalStorage/state.vscdb")]}(a),d=null;for(let a of b)try{await (0,w.access)(a,w.constants.R_OK),d=a;break}catch{}if(!d)return v.NextResponse.json({found:!1,error:`Cursor database not found. Checked locations:
2
2
  ${b.join("\n")}
3
3
 
4
- Make sure Cursor IDE is installed and opened at least once.`});if("linux"===a){let a=!1;try{await A("which",["cursor"],{timeout:5e3}),a=!0}catch{try{let b=(0,y.join)((0,x.homedir)(),".local/share/applications/cursor.desktop");await (0,w.access)(b,w.constants.R_OK),a=!0}catch{}}if(!a)return v.NextResponse.json({found:!1,error:"Cursor config files found but Cursor IDE does not appear to be installed. Skipping auto-import."})}try{let a=function(a){let b=new(c(87550))(a,{readonly:!0,fileMustExist:!0}),d=a=>{let c=b.prepare("SELECT value FROM itemTable WHERE key=? LIMIT 1").get(a);return c?.value||null},e=a=>{if("string"!=typeof a)return a;try{let b=JSON.parse(a);return"string"==typeof b?b:a}catch{return a}},f=null;for(let a of B){let b=d(a);if(b){f=e(b);break}}let g=null;for(let a of C){let b=d(a);if(b){g=e(b);break}}return b.close(),{accessToken:f,machineId:g}}(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}try{let a=await D(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}return v.NextResponse.json({found:!1,windowsManual:!0,dbPath:d})}catch(a){return console.log("Cursor auto-import error:",a),v.NextResponse.json({found:!1,error:a.message},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/auto-import/route",pathname:"/api/oauth/cursor/auto-import",filename:"route",bundlePath:"app/api/oauth/cursor/auto-import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/auto-import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/auto-import/route";"/index"===d&&(d="/");let e=await F.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||F.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===F.isDev||!I,M=I&&!L;G&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await F.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799],()=>b(b.s=96374));module.exports=c})();
4
+ Make sure Cursor IDE is installed and opened at least once.`});if("linux"===a){let a=!1;try{await A("which",["cursor"],{timeout:5e3}),a=!0}catch{try{let b=(0,y.join)((0,x.homedir)(),".local/share/applications/cursor.desktop");await (0,w.access)(b,w.constants.R_OK),a=!0}catch{}}if(!a)return v.NextResponse.json({found:!1,error:"Cursor config files found but Cursor IDE does not appear to be installed. Skipping auto-import."})}try{let a=function(a){let b=new(c(87550))(a,{readonly:!0,fileMustExist:!0}),d=a=>{let c=b.prepare("SELECT value FROM itemTable WHERE key=? LIMIT 1").get(a);return c?.value||null},e=a=>{if("string"!=typeof a)return a;try{let b=JSON.parse(a);return"string"==typeof b?b:a}catch{return a}},f=null;for(let a of B){let b=d(a);if(b){f=e(b);break}}let g=null;for(let a of C){let b=d(a);if(b){g=e(b);break}}return b.close(),{accessToken:f,machineId:g}}(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}try{let a=await D(d);if(a.accessToken&&a.machineId)return v.NextResponse.json({found:!0,accessToken:a.accessToken,machineId:a.machineId})}catch{}return v.NextResponse.json({found:!1,windowsManual:!0,dbPath:d})}catch(a){return console.log("Cursor auto-import error:",a),v.NextResponse.json({found:!1,error:a.message},{status:500})}}let F=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/auto-import/route",pathname:"/api/oauth/cursor/auto-import",filename:"route",bundlePath:"app/api/oauth/cursor/auto-import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/auto-import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:G,workUnitAsyncStorage:H,serverHooks:I}=F;function J(){return(0,g.patchFetch)({workAsyncStorage:G,workUnitAsyncStorage:H})}async function K(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),F.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/auto-import/route";"/index"===d&&(d="/");let e=await F.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:E,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[D]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[D],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||F.isDev||y||(K="/index"===(K=D)?"/":K);let L=!0===F.isDev||!I,M=I&&!L;G&&E&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:E,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await F.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>F.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>F.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&B&&C&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await F.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),b}},k=await F.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:B,revalidateOnlyGenerated:C,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",B?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await F.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:B})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},79646:a=>{"use strict";a.exports=require("child_process")},79748:a=>{"use strict";a.exports=require("fs/promises")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{"use strict";a.exports=require("better-sqlite3")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,6799],()=>b(b.s=10006));module.exports=c})();
@@ -1 +1 @@
1
- (()=>{var a={};a.id=204,a.ids=[204],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},42063:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>A,POST:()=>z});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(47978);class x{constructor(){this.config=w.WN}generateChecksum(a){let b=Math.floor(Date.now()/1e3).toString(),c=165,d=[];for(let a=0;a<b.length;a++){let e=b.charCodeAt(a);d.push(e^c),c=c+e&255}let e=Buffer.from(d).toString("base64");return`${e},${a}`}buildHeaders(a,b,c=!1){let d=this.generateChecksum(b);return{Authorization:`Bearer ${a}`,"Content-Type":"application/connect+proto","Connect-Protocol-Version":"1","x-cursor-client-version":this.config.clientVersion,"x-cursor-client-type":this.config.clientType,"x-cursor-client-os":this.detectOS(),"x-cursor-client-arch":this.detectArch(),"x-cursor-client-device-type":"desktop","x-cursor-checksum":d,"x-ghost-mode":c?"true":"false"}}detectOS(){if("u">typeof process){let a=process.platform;if("win32"===a)return"windows";if("darwin"===a)return"macos"}return"linux"}detectArch(){if("u">typeof process){let a=process.arch;return"x64"===a?"x86_64":"arm64"===a?"aarch64":a}return"x86_64"}async validateImportToken(a,b){if(!a||"string"!=typeof a)throw Error("Access token is required");if(!b||"string"!=typeof b)throw Error("Machine ID is required");if(a.length<50)throw Error("Invalid token format. Token appears too short.");if(!/^[a-f0-9-]{32,}$/i.test(b.replace(/-/g,"")))throw Error("Invalid machine ID format. Expected UUID format.");return{accessToken:a,machineId:b,expiresIn:86400,authMethod:"imported"}}extractUserInfo(a){try{let b=a.split(".");if(3===b.length){let a=b[1];for(;a.length%4;)a+="=";let c=JSON.parse(Buffer.from(a.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString());return{email:c.email||c.sub,userId:c.sub||c.user_id}}}catch{}return null}getTokenStorageInstructions(){return{title:"How to get your Cursor token",steps:["1. Open Cursor IDE and make sure you're logged in","2. Find the state.vscdb file:",` - Linux: ${this.config.tokenStoragePaths.linux}`,` - macOS: ${this.config.tokenStoragePaths.macos}`,` - Windows: ${this.config.tokenStoragePaths.windows}`,"3. Open the database with SQLite browser or CLI:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='cursorAuth/accessToken'\"","4. Also get the machine ID:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='storage.serviceMachineId'\"","5. Paste both values in the form below"],alternativeMethod:["Or use this one-liner to get both values:","sqlite3 state.vscdb \"SELECT key, value FROM itemTable WHERE key IN ('cursorAuth/accessToken', 'storage.serviceMachineId')\""]}}}var y=c(89442);async function z(a){try{let{accessToken:b,machineId:c}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Access token is required"},{status:400});if(!c||"string"!=typeof c)return v.NextResponse.json({error:"Machine ID is required"},{status:400});let d=new x,e=await d.validateImportToken(b.trim(),c.trim()),f=d.extractUserInfo(e.accessToken),g=await (0,y.iE)({provider:"cursor",authType:"oauth",accessToken:e.accessToken,refreshToken:null,expiresAt:new Date(Date.now()+1e3*e.expiresIn).toISOString(),email:f?.email||null,providerSpecificData:{machineId:e.machineId,authMethod:"imported",provider:"Imported",userId:f?.userId},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:g.id,provider:g.provider,email:g.email}})}catch(a){return console.log("Cursor import token error:",a),v.NextResponse.json({error:a.message},{status:500})}}async function A(){let a=new x().getTokenStorageInstructions();return v.NextResponse.json({provider:"cursor",method:"import_token",instructions:a,requiredFields:[{name:"accessToken",label:"Access Token",description:"From cursorAuth/accessToken in state.vscdb",type:"textarea"},{name:"machineId",label:"Machine ID",description:"From storage.serviceMachineId in state.vscdb",type:"text"}]})}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/import/route",pathname:"/api/oauth/cursor/import",filename:"route",bundlePath:"app/api/oauth/cursor/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),B.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/import/route";"/index"===d&&(d="/");let e=await B.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||B.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===B.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await B.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>B.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>B.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await B.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),b}},k=await B.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await B.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47978:(a,b,c)=>{"use strict";c.d(b,{DI:()=>e,Hp:()=>g,LT:()=>f,MZ:()=>o,Nl:()=>r,Nu:()=>k,OV:()=>d,Tx:()=>l,WN:()=>m,YT:()=>j,ZL:()=>i,f7:()=>q,hF:()=>h,lB:()=>p,t:()=>n}),c(21820);let d={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},e={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},f={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},g={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},h={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},i={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},j={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},k={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},l={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},m={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},n={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},o={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},p={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},q={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},r={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3}},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.rj,ui:()=>d.ui});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=42063));module.exports=c})();
1
+ (()=>{var a={};a.id=204,a.ids=[204],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12412:a=>{"use strict";a.exports=require("assert")},21820:a=>{"use strict";a.exports=require("os")},24429:()=>{},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},34278:(a,b,c)=>{"use strict";c.d(b,{t:()=>d});class d{adapter;data;constructor(a,b){!function(a,b){if(void 0===a)throw Error("lowdb: missing adapter");if(void 0===b)throw Error("lowdb: missing default data")}(a,b),this.adapter=a,this.data=b}async read(){let a=await this.adapter.read();a&&(this.data=a)}async write(){this.data&&await this.adapter.write(this.data)}async update(a){a(this.data),await this.write()}}},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},47978:(a,b,c)=>{"use strict";c.d(b,{DI:()=>e,Hp:()=>g,LT:()=>f,MZ:()=>o,Nl:()=>r,Nu:()=>k,OV:()=>d,Tx:()=>l,WN:()=>m,YT:()=>j,ZL:()=>i,f7:()=>q,hF:()=>h,lB:()=>p,t:()=>n}),c(21820);let d={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},e={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},f={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},g={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},h={apiBaseUrl:"https://api2.qoder.sh",deviceTokenUrl:"https://api2.qoder.sh/api/v1/deviceToken/poll",deviceRefreshUrl:"https://api2.qoder.sh/api/v1/deviceToken/refresh",refreshUrl:"https://api2.qoder.sh/api/v3/user/refresh_token",userInfoUrl:"https://api2.qoder.sh/api/v1/userinfo",statusUrl:"https://api2.qoder.sh/api/v3/user/status",loginUrl:"https://qoder.com/login"},i={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},j={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:"IDE_UNSPECIFIED",platform:"PLATFORM_UNSPECIFIED",pluginType:"GEMINI"})},k={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},l={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},m={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},n={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},o={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},p={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},q={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},r={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3}},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},55511:a=>{"use strict";a.exports=require("crypto")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73451:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>G,patchFetch:()=>F,routeModule:()=>B,serverHooks:()=>E,workAsyncStorage:()=>C,workUnitAsyncStorage:()=>D});var d={};c.r(d),c.d(d,{GET:()=>A,POST:()=>z});var e=c(55103),f=c(30600),g=c(10087),h=c(42431),i=c(27321),j=c(42417),k=c(261),l=c(8555),m=c(87717),n=c(34935),o=c(66116),p=c(99218),q=c(43448),r=c(67162),s=c(80463),t=c(86439),u=c(99509),v=c(86606),w=c(47978);class x{constructor(){this.config=w.WN}generateChecksum(a){let b=Math.floor(Date.now()/1e3).toString(),c=165,d=[];for(let a=0;a<b.length;a++){let e=b.charCodeAt(a);d.push(e^c),c=c+e&255}let e=Buffer.from(d).toString("base64");return`${e},${a}`}buildHeaders(a,b,c=!1){let d=this.generateChecksum(b);return{Authorization:`Bearer ${a}`,"Content-Type":"application/connect+proto","Connect-Protocol-Version":"1","x-cursor-client-version":this.config.clientVersion,"x-cursor-client-type":this.config.clientType,"x-cursor-client-os":this.detectOS(),"x-cursor-client-arch":this.detectArch(),"x-cursor-client-device-type":"desktop","x-cursor-checksum":d,"x-ghost-mode":c?"true":"false"}}detectOS(){if("u">typeof process){let a=process.platform;if("win32"===a)return"windows";if("darwin"===a)return"macos"}return"linux"}detectArch(){if("u">typeof process){let a=process.arch;return"x64"===a?"x86_64":"arm64"===a?"aarch64":a}return"x86_64"}async validateImportToken(a,b){if(!a||"string"!=typeof a)throw Error("Access token is required");if(!b||"string"!=typeof b)throw Error("Machine ID is required");if(a.length<50)throw Error("Invalid token format. Token appears too short.");if(!/^[a-f0-9-]{32,}$/i.test(b.replace(/-/g,"")))throw Error("Invalid machine ID format. Expected UUID format.");return{accessToken:a,machineId:b,expiresIn:86400,authMethod:"imported"}}extractUserInfo(a){try{let b=a.split(".");if(3===b.length){let a=b[1];for(;a.length%4;)a+="=";let c=JSON.parse(Buffer.from(a.replace(/-/g,"+").replace(/_/g,"/"),"base64").toString());return{email:c.email||c.sub,userId:c.sub||c.user_id}}}catch{}return null}getTokenStorageInstructions(){return{title:"How to get your Cursor token",steps:["1. Open Cursor IDE and make sure you're logged in","2. Find the state.vscdb file:",` - Linux: ${this.config.tokenStoragePaths.linux}`,` - macOS: ${this.config.tokenStoragePaths.macos}`,` - Windows: ${this.config.tokenStoragePaths.windows}`,"3. Open the database with SQLite browser or CLI:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='cursorAuth/accessToken'\"","4. Also get the machine ID:"," sqlite3 state.vscdb \"SELECT value FROM itemTable WHERE key='storage.serviceMachineId'\"","5. Paste both values in the form below"],alternativeMethod:["Or use this one-liner to get both values:","sqlite3 state.vscdb \"SELECT key, value FROM itemTable WHERE key IN ('cursorAuth/accessToken', 'storage.serviceMachineId')\""]}}}var y=c(89442);async function z(a){try{let{accessToken:b,machineId:c}=await a.json();if(!b||"string"!=typeof b)return v.NextResponse.json({error:"Access token is required"},{status:400});if(!c||"string"!=typeof c)return v.NextResponse.json({error:"Machine ID is required"},{status:400});let d=new x,e=await d.validateImportToken(b.trim(),c.trim()),f=d.extractUserInfo(e.accessToken),g=await (0,y.iE)({provider:"cursor",authType:"oauth",accessToken:e.accessToken,refreshToken:null,expiresAt:new Date(Date.now()+1e3*e.expiresIn).toISOString(),email:f?.email||null,providerSpecificData:{machineId:e.machineId,authMethod:"imported",provider:"Imported",userId:f?.userId},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:g.id,provider:g.provider,email:g.email}})}catch(a){return console.log("Cursor import token error:",a),v.NextResponse.json({error:a.message},{status:500})}}async function A(){let a=new x().getTokenStorageInstructions();return v.NextResponse.json({provider:"cursor",method:"import_token",instructions:a,requiredFields:[{name:"accessToken",label:"Access Token",description:"From cursorAuth/accessToken in state.vscdb",type:"textarea"},{name:"machineId",label:"Machine ID",description:"From storage.serviceMachineId in state.vscdb",type:"text"}]})}let B=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/cursor/import/route",pathname:"/api/oauth/cursor/import",filename:"route",bundlePath:"app/api/oauth/cursor/import/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/Users/Working/router4/app/src/app/api/oauth/cursor/import/route.js",nextConfigOutput:"standalone",userland:d}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:E}=B;function F(){return(0,g.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})}async function G(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),B.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/cursor/import/route";"/index"===d&&(d="/");let e=await B.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,params:v,nextConfig:w,parsedUrl:x,isDraftMode:y,prerenderManifest:z,routerServerContext:A,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(z.dynamicRoutes[H]||z.routes[E]),J=async()=>((null==A?void 0:A.render404)?await A.render404(a,b,x,!1):b.end("This page could not be found"),null);if(I&&!y){let a=!!z.routes[E],b=z.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(w.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||B.isDev||y||(K="/index"===(K=E)?"/":K);let L=!0===B.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==A?void 0:A.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await B.getIncrementalCache(a,w,z,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:v,previewProps:z.preview,renderOpts:{experimental:{authInterrupts:!!w.experimental.authInterrupts},cacheComponents:!!w.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:w.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>B.onRequestError(a,b,d,e,A)},sharedContext:{buildId:g}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>B.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await B.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),b}},k=await B.handleResponse({req:a,nextConfig:w,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:z,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),y&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await B.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,A),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},73865:(a,b,c)=>{"use strict";c.d(b,{Pv:()=>k}),c(73024);var d=c(51455),e=c(76760),f=c(73136);async function g(a,b,c){for(let d=0;d<b;d++)try{return await a()}catch(a){if(d<b-1)await new Promise(a=>setTimeout(a,c));else throw a}}class h{#a;#b;#c=!1;#d=null;#e=null;#f=null;#g=null;#h(a){return this.#g=a,this.#f||=new Promise((a,b)=>{this.#e=[a,b]}),new Promise((a,b)=>{this.#f?.then(a).catch(b)})}async #i(a){this.#c=!0;try{await (0,d.writeFile)(this.#b,a,"utf-8"),await g(async()=>{await (0,d.rename)(this.#b,this.#a)},10,100),this.#d?.[0]()}catch(a){throw a instanceof Error&&this.#d?.[1](a),a}finally{if(this.#c=!1,this.#d=this.#e,this.#e=this.#f=null,null!==this.#g){let a=this.#g;this.#g=null,await this.write(a)}}}constructor(a){this.#a=a,this.#b=function(a){let b=a instanceof URL?(0,f.fileURLToPath)(a):a.toString();return(0,e.join)((0,e.dirname)(b),`.${(0,e.basename)(b)}.tmp`)}(a)}async write(a){return this.#c?this.#h(a):this.#i(a)}}class i{#a;#j;constructor(a){this.#a=a,this.#j=new h(a)}async read(){let a;try{a=await (0,d.readFile)(this.#a,"utf-8")}catch(a){if("ENOENT"===a.code)return null;throw a}return a}write(a){return this.#j.write(a)}}class j{#k;#l;#m;constructor(a,{parse:b,stringify:c}){this.#k=new i(a),this.#l=b,this.#m=c}async read(){let a=await this.#k.read();return null===a?null:this.#l(a)}write(a){return this.#k.write(this.#m(a))}}class k extends j{constructor(a){super(a,{parse:JSON.parse,stringify:a=>JSON.stringify(a,null,2)})}}},76760:a=>{"use strict";a.exports=require("node:path")},77598:a=>{"use strict";a.exports=require("node:crypto")},81115:a=>{"use strict";a.exports=require("constants")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},89442:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.getProviderNodes,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,o5:()=>d.o5,op:()=>d.op,rj:()=>d.rj,ui:()=>d.ui});var d=c(37770)},94735:a=>{"use strict";a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[7773,3656,6799,7770],()=>b(b.s=73451));module.exports=c})();