9router-proxy 0.6.8 → 0.6.10

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 (463) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +20 -20
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  56. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  57. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  58. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  62. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  63. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  64. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  65. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  66. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  78. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  80. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
  83. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  85. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  91. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  93. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +2 -2
  99. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  101. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +2 -2
  107. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  109. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  112. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  120. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  237. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  241. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  243. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  298. package/app/.next-cli-build/server/app/callback.html +1 -1
  299. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  300. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  301. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  303. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
  305. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
  306. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
  307. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +3 -3
  310. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
  311. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +3 -3
  312. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
  315. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
  316. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
  317. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
  320. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
  325. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
  326. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
  327. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +3 -3
  330. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
  331. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +3 -3
  332. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
  335. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
  336. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
  337. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  339. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
  340. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
  341. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
  342. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  344. package/app/.next-cli-build/server/app/dashboard/providers.rsc +3 -3
  345. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +3 -3
  346. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +3 -3
  347. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
  350. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
  351. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
  352. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  354. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
  355. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
  356. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
  357. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
  360. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  361. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +3 -3
  362. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  367. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  368. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  369. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  370. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
  372. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
  373. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
  374. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +3 -3
  377. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +3 -3
  378. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +3 -3
  379. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
  382. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
  383. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
  384. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  386. package/app/.next-cli-build/server/app/dashboard/usage.rsc +3 -3
  387. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
  388. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
  389. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  391. package/app/.next-cli-build/server/app/dashboard.rsc +3 -3
  392. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
  393. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
  394. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/index.html +1 -1
  397. package/app/.next-cli-build/server/app/index.rsc +3 -3
  398. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  399. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  400. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  401. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  403. package/app/.next-cli-build/server/app/landing.html +1 -1
  404. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  405. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  406. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  408. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  410. package/app/.next-cli-build/server/app/login.html +1 -1
  411. package/app/.next-cli-build/server/app/login.rsc +3 -3
  412. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  413. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  415. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  418. package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  419. package/app/.next-cli-build/server/chunks/1051.js +1 -1
  420. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  421. package/app/.next-cli-build/server/chunks/1757.js +1 -1
  422. package/app/.next-cli-build/server/chunks/1836.js +17 -0
  423. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  424. package/app/.next-cli-build/server/chunks/2375.js +1 -1
  425. package/app/.next-cli-build/server/chunks/3210.js +1 -1
  426. package/app/.next-cli-build/server/chunks/3711.js +1 -1
  427. package/app/.next-cli-build/server/chunks/{4957.js → 3811.js} +1 -1
  428. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  429. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  430. package/app/.next-cli-build/server/chunks/5026.js +1 -1
  431. package/app/.next-cli-build/server/chunks/5330.js +2 -10
  432. package/app/.next-cli-build/server/chunks/5615.js +2 -2
  433. package/app/.next-cli-build/server/chunks/614.js +2 -2
  434. package/app/.next-cli-build/server/chunks/6171.js +7 -0
  435. package/app/.next-cli-build/server/chunks/7525.js +1 -1
  436. package/app/.next-cli-build/server/chunks/7557.js +1 -1
  437. package/app/.next-cli-build/server/chunks/7843.js +1 -1
  438. package/app/.next-cli-build/server/chunks/8499.js +2 -2
  439. package/app/.next-cli-build/server/chunks/869.js +1 -1
  440. package/app/.next-cli-build/server/chunks/8895.js +7 -13
  441. package/app/.next-cli-build/server/chunks/9100.js +2 -2
  442. package/app/.next-cli-build/server/chunks/9604.js +1 -1
  443. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  444. package/app/.next-cli-build/server/chunks/9696.js +1 -1
  445. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  446. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  447. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  448. package/app/.next-cli-build/server/pages/404.html +1 -1
  449. package/app/.next-cli-build/server/pages/500.html +1 -1
  450. package/app/.next-cli-build/server/preview-props.json +3 -3
  451. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  452. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  453. package/app/.next-cli-build/static/chunks/1321-c14ab5f20e75ec51.js +1 -0
  454. package/app/.next-cli-build/static/chunks/5497-76da5aae5c912ea5.js +7 -0
  455. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-ad6e72e4fa047b21.js → page-85d183456bb818fb.js} +1 -1
  456. package/app/package.json +1 -1
  457. package/package.json +1 -1
  458. package/app/.next-cli-build/server/chunks/6249.js +0 -9
  459. package/app/.next-cli-build/server/chunks/7552.js +0 -1
  460. package/app/.next-cli-build/static/chunks/1321-fdac938522ce514f.js +0 -1
  461. package/app/.next-cli-build/static/chunks/5497-35a0641d4dcc62d5.js +0 -7
  462. /package/app/.next-cli-build/static/{Lcce6agtXL-TudJa8EdML → 1OwkUVIMD7I3wwdhcBzuQ}/_buildManifest.js +0 -0
  463. /package/app/.next-cli-build/static/{Lcce6agtXL-TudJa8EdML → 1OwkUVIMD7I3wwdhcBzuQ}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=4957,exports.ids=[4957],exports.modules={49426:(a,b,c)=>{c.d(b,{S:()=>f,n:()=>e});var d=c(41004);function e(a=null,b=d.pH){let c=new AbortController,f=Error("fetch connect timeout"),g=!1,h=setTimeout(()=>{g=!0,c.abort(f)},b);return{signal:a?AbortSignal.any([a,c.signal]):c.signal,get timedOut(){return g},clear(){clearTimeout(h)},settleError:a=>g?f:a}}async function f(a,b={},c=d.pH){let g=e(b.signal,c);try{return await fetch(a,{...b,signal:g.signal})}catch(a){throw g.settleError(a)}finally{g.clear()}}},57647:(a,b,c)=>{c.d(b,{SZ:()=>n,Tz:()=>k,jD:()=>j,jJ:()=>l,oF:()=>m});var d=c(35024),e=c(74129);let f={baseUrl:e.Es},g={baseUrl:e.ky};function h(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function i(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function j(a,b=null){let c=b?.providerSpecificData?.apiType;return"chat"===c||"responses"===c?c:"string"==typeof a&&a.includes("responses")?"responses":"chat"}function k(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function l(a,b=null){return h(a)?"responses"===j(a,b)?"openai-responses":"openai":i(a)?"claude":function(a,b=null){if(h(a)){let c=j(a,b);return{...d.xq.openai,format:"responses"===c?"openai-responses":"openai",baseUrl:f.baseUrl}}return i(a)?{...d.xq.anthropic,format:"claude",baseUrl:g.baseUrl}:d.xq[a]||d.xq.openai}(a,b).format||"openai"}function m(a,b){let c=d.xq[a],e=c?.transports;return Array.isArray(e)&&e.length&&e.find(a=>a.format===b)||null}function n(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&delete a.thinking,a}},74957:(a,b,c)=>{c.d(b,{H:()=>l});var d=c(41004),e=c(93943),f=c(39609),g=c(49426),h=c(92306),i=c(74129),j=c(57647);function k(a){try{let b=a?.body?.cancel?.();b?.catch&&b.catch(()=>{})}catch{}}class l{constructor(a,b){this.provider=a,this.config=b,this.noAuth=b?.noAuth||!1}getProvider(){return this.provider}getBaseUrls(){return this.config.baseUrls||(this.config.baseUrl?[this.config.baseUrl]:[])}getFallbackCount(){return this.getBaseUrls().length||1}buildUrl(a,b,c=0,d=null,e={}){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||i.Es).replace(/\/$/,""),b="responses"===(0,j.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||i.ky).replace(/\/$/,"");return`${a}/messages`}let f=this.getBaseUrls();return f[c]||f[0]||this.config.baseUrl}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};return this.provider?.startsWith?.("anthropic-compatible-")?(a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]=i.b8)):a.accessToken?c.Authorization=`Bearer ${a.accessToken}`:a.apiKey&&(c.Authorization=`Bearer ${a.apiKey}`),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}shouldRetry(a,b){return a===d.gx.RATE_LIMITED&&b+1<this.getFallbackCount()}async refreshCredentials(a,b,c=null){return null}needsRefresh(a){return(0,e.fp)(this.provider,a)}parseError(a,b){return{status:a.status,message:b||`HTTP ${a.status}`}}async execute({model:a,body:b,stream:c,credentials:e,signal:i,log:j,proxyOptions:l=null,providerOverrides:m=null,hookCtx:n=null}){let o=n||{},p=this.getFallbackCount(),q=null,r=0,s={},t={...d.cI,...this.config.retry},u=async(a,b,c,e=null)=>{let{attempts:f,delayMs:g}=(0,d.DR)(t[b]);if(f<=0||s[a]>=f)return!1;let h=(0,d.pD)(g,s[a]+1);if(e&&this.computeRetryDelay){let b=await this.computeRetryDelay(e,s[a]+1,g);if(!1===b)return!1;null!=b&&(h=b)}return s[a]++,j?.debug?.("RETRY",`${c} retry ${s[a]}/${f} after ${h/1e3}s`),await new Promise(a=>setTimeout(a,h)),!0};for(let n=0;n<p;n++){let t=this.buildUrl(a,c,n,e,o),v=this.transformRequest(a,b,c,e,o),w=this.buildHeaders(e,c,t,a,v,o);m?.headers&&Object.assign(w,m.headers),s[n]||(s[n]=0);let x=this.config?.timeoutMs||d.pH,y=(0,g.n)(i,x);try{let a=JSON.stringify(v),b=Date.now();(0,h.s)("FETCH",`${this.provider.toUpperCase()} → ${t} | body=${a.length}B | connectTimeout=${x}ms`);let c=await (0,f.proxyAwareFetch)(t,{method:"POST",headers:w,body:a,signal:y.signal},l);y.clear();let d=c.headers?.get?.("content-type")||"",e=c.headers?.get?.("content-length")||"?";if((0,h.s)("FETCH",`${this.provider.toUpperCase()} ← ${c.status} | ttft=${Date.now()-b}ms | ct=${d} | cl=${e}`),await u(n,c.status,`status ${c.status}`,c)){k(c),n--;continue}if(this.shouldRetry(c.status,n)){j?.debug?.("RETRY",`${c.status} on ${t}, trying fallback ${n+1}`),r=c.status,k(c);continue}return{response:c,url:t,headers:w,transformedBody:v,bodyStr:a}}catch(b){y.clear();let a=y.timedOut;if(q=y.settleError(b),(0,h.s)("FETCH",`${this.provider.toUpperCase()} ✖ ${q.name}: ${q.message}${a?" (connect timeout)":""}`),"AbortError"===b.name&&!a)throw b;if(await u(n,d.gx.BAD_GATEWAY,`network "${b.message}"`)){n--;continue}if(n+1<p){j?.debug?.("RETRY",`Error on ${t}, trying fallback ${n+1}`);continue}throw q}}throw q||Error(`All ${p} URLs failed with status ${r}`)}}},92306:(a,b,c)=>{function d(a,b){}c.d(b,{T:()=>e,s:()=>d});let e=!1}};
1
+ "use strict";exports.id=3811,exports.ids=[3811],exports.modules={49426:(a,b,c)=>{c.d(b,{S:()=>f,n:()=>e});var d=c(41004);function e(a=null,b=d.pH){let c=new AbortController,f=Error("fetch connect timeout"),g=!1,h=setTimeout(()=>{g=!0,c.abort(f)},b);return{signal:a?AbortSignal.any([a,c.signal]):c.signal,get timedOut(){return g},clear(){clearTimeout(h)},settleError:a=>g?f:a}}async function f(a,b={},c=d.pH){let g=e(b.signal,c);try{return await fetch(a,{...b,signal:g.signal})}catch(a){throw g.settleError(a)}finally{g.clear()}}},57647:(a,b,c)=>{c.d(b,{SZ:()=>n,Tz:()=>k,jD:()=>j,jJ:()=>l,oF:()=>m});var d=c(35024),e=c(74129);let f={baseUrl:e.Es},g={baseUrl:e.ky};function h(a){return"string"==typeof a&&a.startsWith("openai-compatible-")}function i(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function j(a,b=null){let c=b?.providerSpecificData?.apiType;return"chat"===c||"responses"===c?c:"string"==typeof a&&a.includes("responses")?"responses":"chat"}function k(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function l(a,b=null){return h(a)?"responses"===j(a,b)?"openai-responses":"openai":i(a)?"claude":function(a,b=null){if(h(a)){let c=j(a,b);return{...d.xq.openai,format:"responses"===c?"openai-responses":"openai",baseUrl:f.baseUrl}}return i(a)?{...d.xq.anthropic,format:"claude",baseUrl:g.baseUrl}:d.xq[a]||d.xq.openai}(a,b).format||"openai"}function m(a,b){let c=d.xq[a],e=c?.transports;return Array.isArray(e)&&e.length&&e.find(a=>a.format===b)||null}function n(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&delete a.thinking,a}},74957:(a,b,c)=>{c.d(b,{H:()=>l});var d=c(41004),e=c(93943),f=c(39609),g=c(49426),h=c(92306),i=c(74129),j=c(57647);function k(a){try{let b=a?.body?.cancel?.();b?.catch&&b.catch(()=>{})}catch{}}class l{constructor(a,b){this.provider=a,this.config=b,this.noAuth=b?.noAuth||!1}getProvider(){return this.provider}getBaseUrls(){return this.config.baseUrls||(this.config.baseUrl?[this.config.baseUrl]:[])}getFallbackCount(){return this.getBaseUrls().length||1}buildUrl(a,b,c=0,d=null,e={}){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||i.Es).replace(/\/$/,""),b="responses"===(0,j.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||i.ky).replace(/\/$/,"");return`${a}/messages`}let f=this.getBaseUrls();return f[c]||f[0]||this.config.baseUrl}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};return this.provider?.startsWith?.("anthropic-compatible-")?(a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]=i.b8)):a.accessToken?c.Authorization=`Bearer ${a.accessToken}`:a.apiKey&&(c.Authorization=`Bearer ${a.apiKey}`),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}shouldRetry(a,b){return a===d.gx.RATE_LIMITED&&b+1<this.getFallbackCount()}async refreshCredentials(a,b,c=null){return null}needsRefresh(a){return(0,e.fp)(this.provider,a)}parseError(a,b){return{status:a.status,message:b||`HTTP ${a.status}`}}async execute({model:a,body:b,stream:c,credentials:e,signal:i,log:j,proxyOptions:l=null,providerOverrides:m=null,hookCtx:n=null}){let o=n||{},p=this.getFallbackCount(),q=null,r=0,s={},t={...d.cI,...this.config.retry},u=async(a,b,c,e=null)=>{let{attempts:f,delayMs:g}=(0,d.DR)(t[b]);if(f<=0||s[a]>=f)return!1;let h=(0,d.pD)(g,s[a]+1);if(e&&this.computeRetryDelay){let b=await this.computeRetryDelay(e,s[a]+1,g);if(!1===b)return!1;null!=b&&(h=b)}return s[a]++,j?.debug?.("RETRY",`${c} retry ${s[a]}/${f} after ${h/1e3}s`),await new Promise(a=>setTimeout(a,h)),!0};for(let n=0;n<p;n++){let t=this.buildUrl(a,c,n,e,o),v=this.transformRequest(a,b,c,e,o),w=this.buildHeaders(e,c,t,a,v,o);m?.headers&&Object.assign(w,m.headers),s[n]||(s[n]=0);let x=this.config?.timeoutMs||d.pH,y=(0,g.n)(i,x);try{let a=JSON.stringify(v),b=Date.now();(0,h.s)("FETCH",`${this.provider.toUpperCase()} → ${t} | body=${a.length}B | connectTimeout=${x}ms`);let c=await (0,f.proxyAwareFetch)(t,{method:"POST",headers:w,body:a,signal:y.signal},l);y.clear();let d=c.headers?.get?.("content-type")||"",e=c.headers?.get?.("content-length")||"?";if((0,h.s)("FETCH",`${this.provider.toUpperCase()} ← ${c.status} | ttft=${Date.now()-b}ms | ct=${d} | cl=${e}`),await u(n,c.status,`status ${c.status}`,c)){k(c),n--;continue}if(this.shouldRetry(c.status,n)){j?.debug?.("RETRY",`${c.status} on ${t}, trying fallback ${n+1}`),r=c.status,k(c);continue}return{response:c,url:t,headers:w,transformedBody:v,bodyStr:a}}catch(b){y.clear();let a=y.timedOut;if(q=y.settleError(b),(0,h.s)("FETCH",`${this.provider.toUpperCase()} ✖ ${q.name}: ${q.message}${a?" (connect timeout)":""}`),"AbortError"===b.name&&!a)throw b;if(await u(n,d.gx.BAD_GATEWAY,`network "${b.message}"`)){n--;continue}if(n+1<p){j?.debug?.("RETRY",`Error on ${t}, trying fallback ${n+1}`);continue}throw q}}throw q||Error(`All ${p} URLs failed with status ${r}`)}}},78959:(a,b,c)=>{c.d(b,{$U:()=>d,RK:()=>g,pb:()=>e,uB:()=>f});let d="data: [DONE]\n\n",e={"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"},f={"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Accel-Buffering":"no"},g={"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform","X-Accel-Buffering":"no",Connection:"keep-alive","Access-Control-Allow-Origin":"*"}},92306:(a,b,c)=>{function d(a,b){}c.d(b,{T:()=>e,s:()=>d});let e=!1}};
@@ -1 +1 @@
1
- "use strict";exports.id=3943,exports.ids=[3943],exports.modules={7630:(a,b,c)=>{c.d(b,{Ew:()=>o,WH:()=>q,jg:()=>i,rZ:()=>p,xj:()=>j});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cn.devecostudio.huawei.com",h="1008";function i(){return e().randomUUID().replace(/-/g,"")}function j(a,b){let c=new URLSearchParams({port:String(a),appid:h,code:b});return`${g}/console/DevEcoIDE/apply?${c}`}async function k(a,{headers:b={},params:c={},proxyOptions:d=null}={}){let e=new URL(a);for(let[a,b]of Object.entries(c))e.searchParams.set(a,b);let g=await (0,f.proxyAwareFetch)(e.toString(),{method:"GET",headers:b},d),h=await g.text().catch(()=>"");if(!g.ok){let a=Error(`DevEco auth error ${g.status}: ${h.slice(0,200)}`);throw a.authFailed=g.status>=400&&g.status<500,a}return h}async function l(a,b={}){let c=await k(a,b);try{return JSON.parse(c)}catch{let a=Error(`DevEco auth: non-JSON response (${c.slice(0,80)})`);throw a.authFailed=!0,a}}async function m(a,{proxyOptions:b=null}={}){let c=(await k(`${g}/authrouter/auth/api/temptoken/check`,{params:{tempToken:a.split("&")[0],site:"CN",version:"1.0.0",appid:h},proxyOptions:b})).trim(),d=c;if(!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(d))try{let a=JSON.parse(c);d=String(a.jwtToken||a.data?.jwtToken||a.token||"").trim()}catch{}if(3!==d.split(".").length){let a=Error("DevEco: temptoken check returned no jwtToken in JWT form");throw a.authFailed=!0,a}return d}async function n(a,{refresh:b=!1,proxyOptions:c=null}={}){let d=await l(`${g}/authrouter/auth/api/jwToken/check`,{headers:{jwtToken:a,refresh:b?"true":"false"},proxyOptions:c});if(!d?.status)return null;let e=d.userInfo||d.data?.userInfo;return e?.accessToken?{userId:e.userId||"",userName:e.name||"",accessToken:e.accessToken,refreshToken:e.refreshToken||"",jwtToken:a,countryCode:(e.nationalCode||"CN").trim().toUpperCase(),isRealName:"true"===String(e.realName)}:null}async function o(a,{proxyOptions:b=null}={}){let c=await m(a,{proxyOptions:b}),d=await n(c,{proxyOptions:b});if(!d)throw Error("DevEco: jwtToken check returned no access token");return d.expiresAt=Date.now()+18e5,d}function p(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.accessToken,refreshToken:a.jwtToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",jwtToken:a.jwtToken||"",userId:a.userId||b.userId||"",userName:a.userName||b.userName||"",countryCode:a.countryCode||"",isRealName:a.isRealName??b.isRealName??!1,tokenExpiresAt:new Date(a.expiresAt).toISOString()}}}async function q(a,{proxyOptions:b=null,log:c=null}={}){let d=(a?.providerSpecificData||{}).jwtToken||a?.refreshToken||"";if(!d)return c?.warn?.("TOKEN_REFRESH","DevEco: no jwtToken stored — reconnect required"),{error:"invalid_grant",message:"DevEco: jwtToken missing, please re-login"};try{let a=await n(d,{refresh:!0,proxyOptions:b});if(!a)return c?.warn?.("TOKEN_REFRESH","DevEco refresh returned no access token"),{error:"invalid_grant",message:"DevEco: token revoked, please re-login"};return a.expiresAt=Date.now()+18e5,c?.info?.("TOKEN_REFRESH",`DevEco token renewed until ${new Date(a.expiresAt).toISOString()}`),p(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`DevEco refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},8521:(a,b,c)=>{c.d(b,{oD:()=>F,Og:()=>H,jT:()=>G,Sc:()=>I,Wm:()=>r,jR:()=>w,I9:()=>q,Ql:()=>t,rE:()=>C,$B:()=>N,pb:()=>K,qZ:()=>O});var d=c(35024),e=c(75924),f=c(39609);let g=new Map;async function h(a,b,c,d){if(!b)return c();let e=`${a}:${b}`,f=g.get(e);if(f){if(f.promise)return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),f.promise;if(f.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),f.result;g.delete(e)}let h=(async()=>{try{let a=await c(),b={result:a,expiresAt:Date.now()+1e4};g.set(e,b);let d=setTimeout(()=>{g.get(e)===b&&g.delete(e)},1e4);return d.unref?.(),a}catch(a){throw g.delete(e),a}})();return g.set(e,{promise:h}),h}var i=c(18080);let j=null;async function k(a,b){return a?h("xai",a,async()=>{try{j||(j=new(await Promise.all([c.e(5615),c.e(4730)]).then(c.bind(c,84730))).XaiService);let b=await j.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH",`xai refresh failed: ${c?.message||c}`);let a=String(c?.message||"");if(a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant"};return null}},b):null}let l={claude:{bodyFormat:"json",includeClientSecret:!1,url:()=>e.NA.anthropic.token,dedupKey:"claude"},iflow:{url:()=>e.NA.iflow.token,dedupKey:"iflow",extraHeaders:(a,b)=>({Authorization:`Basic ${btoa(`${b.clientId}:${b.clientSecret}`)}`})},github:{url:()=>e.NA.github.token,dedupKey:"github",includeClientSecret:a=>!!a?.clientSecret},kimi:{dedupKey:"kimi",extraHeaders:a=>(0,e.buildKimiHeaders)(a?.providerSpecificData?.deviceId)}};async function m(a,b,c,e){let f=d.xq[a],g=l[a]||{},i=function(a,b,c){if(c?.url)try{return c.url()}catch{}return b?.refreshUrl||d.sr[a]?.tokenUrl||null}(a,f,g);return f&&i?b?h(g.dedupKey||a,b,async()=>{try{let d,h,j,{format:k,body:l}=(d=g?.bodyFormat==="json"?"json":"form",h=g?.includeClientSecret===void 0||("function"==typeof g.includeClientSecret?g.includeClientSecret(f):g.includeClientSecret),j={grant_type:"refresh_token",refresh_token:b,client_id:f.clientId},(h&&f.clientSecret&&(j.client_secret=f.clientSecret),"json"===d)?{format:"json",body:JSON.stringify(j)}:{format:"form",body:new URLSearchParams(j)}),m={"Content-Type":"json"===k?"application/json":"application/x-www-form-urlencoded",Accept:"application/json",...g.extraHeaders&&g.extraHeaders(c,f)||{}},n=await fetch(i,{method:"POST",headers:m,body:l});if(!n.ok){let b=await n.text();return e?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:n.status,error:b}),null}let o=await n.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!o.access_token,hasNewRefreshToken:!!o.refresh_token,expiresIn:o.expires_in}),{accessToken:o.access_token,refreshToken:o.refresh_token||b,expiresIn:o.expires_in,...g.parse&&g.parse(o)||{}}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function n(a,b,c){return m("kimi",a,b,c)}async function o(a,b){return a?h("cline",a,async()=>{try{let c=await fetch(d.xq.cline?.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Cline token",{status:c.status,error:a}),null}let e=await c.json(),f=e?.data||e;if(!f?.accessToken)return null;let g=f.expiresAt?Math.max(1,Math.floor((new Date(f.expiresAt).getTime()-Date.now())/1e3)):f.expiresIn||f.expires_in||3600;return{accessToken:f.accessToken,refreshToken:f.refreshToken||a,expiresIn:g}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing Cline token: ${a.message}`),null}},b):null}async function p(a,b){return m("claude",a,{},b)}async function q(a,b,c,d){return a?h(`google:${b}`,a,async()=>{try{let f=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function r(a,b){return a?h("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text(),d=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error?.code||c?.error||c?.error_code||"",e=c?.error_description||c?.message||a||"",f=`${d} ${e}`.toLowerCase();return{status:b,code:d,description:e,permanent:["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_grant"].some(a=>f.includes(a))}}(a,c.status);if(d.permanent)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used or invalid. Re-auth required.",{status:c.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a,code:d.code,permanent:d.permanent}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function s(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(7774),c.e(5433),c.e(8920),c.e(24),c.e(2329),c.e(3225),c.e(6922),c.e(7843),c.e(7913),c.e(4957),c.e(614),c.e(9696),c.e(7552),c.e(8499),c.e(6249),c.e(5330),c.e(8895),c.e(4049),c.e(3535)]).then(c.bind(c,74177));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function t(a,b,c,e=null){return a?h("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,j=b?.clientSecret,k=b?.region;if("external_idp"===g){let d;try{d=(0,i.uo)(a,b)}catch(a){return c?.warn?.("TOKEN_REFRESH",`Invalid Kiro external_idp refresh config: ${a.message}`),null}let g=await (0,f.proxyAwareFetch)(d.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:d.body},e);if(!g.ok){let a=await g.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro external_idp token",{status:g.status,error:a}),null}let h=await g.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro external_idp token",{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||a,expiresIn:h.expires_in,providerSpecificData:d.providerSpecificData}}if(h&&j){let d="idc"===g&&k?`https://oidc.${k}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",i=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:j,refreshToken:a,grantType:"refresh_token"})},e);if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:i.status,error:a}),null}let l=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!l.accessToken,expiresIn:l.expiresIn}),{accessToken:l.accessToken,refreshToken:l.refreshToken||a,expiresIn:l.expiresIn,...await s(b,l.accessToken,l.profileArn)}}let l=await (0,f.proxyAwareFetch)(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},e);if(!l.ok){let a=await l.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:l.status,error:a}),null}let m=await l.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!m.accessToken,expiresIn:m.expiresIn}),{accessToken:m.accessToken,refreshToken:m.refreshToken||a,expiresIn:m.expiresIn,...await s(b,m.accessToken,m.profileArn)}},c):null}async function u(a,b){return m("iflow",a,{},b)}async function v(a,b){return m("github",a,{},b)}async function w(a,b){return a?h("copilot",a,async()=>{try{let c=await fetch(d.sr.github?.copilotTokenUrl,{headers:{Authorization:`token ${a}`,"User-Agent":e.x0.USER_AGENT,"Editor-Version":`vscode/${e.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${e.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":e.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!f.token,expiresAt:f.expires_at}),{token:f.token,expiresAt:f.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}},b):null}async function x(a,b){return a?h("codebuddy-cn",a,async()=>{let c=d.sr["codebuddy-cn"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function y(a,b){return a?h("codebuddy-intl",a,async()=>{let c=d.sr["codebuddy-intl"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy intl token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy intl token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy intl token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function z(a,b,c,e="trae"){if(!a)return null;let f=d.sr[e]||{},g=f.exchangeTokenUrl||f.tokenUrl;return g?h(e,a,async()=>{try{let b,d=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"Trae/1.0.0 antigravity-cockpit-tools"},body:JSON.stringify({ClientID:f.clientId||"ono9krqynydwx5",RefreshToken:a,ClientSecret:f.clientSecret||"-",UserID:""})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Trae token",{status:d.status,error:a}),null}let e=await d.json(),h=e?.Result||e?.Data||e?.result||e,i=h?.AccessToken||h?.Token||h?.accessToken;if(!i)return c?.error?.("TOKEN_REFRESH","Trae refresh returned no AccessToken",{payload:e}),null;let j=h?.RefreshToken||h?.refreshToken||a,k=h?.ExpiresAt||h?.TokenExpireAt||h?.expiresAt;if("number"==typeof k){let a=k>1e12?Math.floor(k/1e3):k;b=Math.max(1,a-Math.floor(Date.now()/1e3))}else if("string"==typeof k){let a=new Date(k).getTime()-Date.now();b=a>0?Math.floor(a/1e3):void 0}return c?.info?.("TOKEN_REFRESH","Successfully refreshed Trae token",{hasNewAccessToken:!!i,hasNewRefreshToken:j!==a,expiresIn:b}),{accessToken:i,refreshToken:j,expiresIn:b}}catch(a){return c?.error?.("TOKEN_REFRESH",`Error refreshing Trae token: ${a.message}`),null}},c):(c?.warn?.("TOKEN_REFRESH","No Trae exchangeTokenUrl configured"),null)}async function A(a,b){return b?.info?.("TOKEN_REFRESH","windsurf: apiKey is long-lived (no refresh_token flow) — skipping"),null}let B={"minimax-code":"https://account.minimax.cn/oauth2/token","minimax-code-global":"https://account.minimax.io/oauth2/token"};async function C(a,b,c){let d=B[a];return d&&b?h(a,b,async()=>{try{let e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:"mcode-public",scope:"agent.default",audience:"agent-backend"}).toString(),signal:AbortSignal.timeout(3e4)}),f=await e.json().catch(()=>null);if(!e.ok||f&&"string"==typeof f.error&&f.error){let b=f?.error||`HTTP ${e.status}`;if(400===e.status&&f?.error==="invalid_grant")return c?.warn?.("TOKEN_REFRESH",`MiniMax refresh token spent/rejected (${a}) — sign-in gone`),{error:"invalid_grant"};return c?.error?.("TOKEN_REFRESH",`MiniMax token refresh failed (${a})`,{status:e.status,error:b}),null}if(!f?.access_token)return c?.error?.("TOKEN_REFRESH",`MiniMax refresh returned no access_token (${a})`),null;return{accessToken:f.access_token,refreshToken:f.refresh_token||b,expiresIn:f.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Error refreshing MiniMax token (${a}): ${b.message}`),null}},c):null}var D=c(71547),E=c(7630);let F=3e5;function G(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function H(a){return e.Wu[a]?e.Wu[a]:"kimi-coding"===a&&e.Wu.kimi?e.Wu.kimi:F}function I(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let J=new Map;async function K(a,b){let d=a.client_email,f=J.get(d);if(f&&f.expiresAt-Date.now()>3e5)return{accessToken:f.token,expiresAt:f.expiresAt};try{let{SignJWT:f,importPKCS8:g}=await Promise.all([c.e(8292),c.e(1455)]).then(c.bind(c,71455));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let h=await g(a.private_key.replace(/\\n/g,"\n"),"RS256"),i=Math.floor(Date.now()/1e3),j=await new f({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience(e.NA.google.token).setIssuedAt(i).setExpirationTime(i+3600).sign(h),k=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:j})});if(!k.ok){let a=await k.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:l,expires_in:m}=await k.json(),n=Date.now()+(m??3600)*1e3;return J.set(d,{token:l,expiresAt:n}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:l,expiresAt:n}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}function L(a,b){let c=I(a.apiKey);return c?K(c,b):null}let M={"gemini-cli":(a,b)=>q(a.refreshToken,d.xq["gemini-cli"].clientId,d.xq["gemini-cli"].clientSecret,b),antigravity:(a,b)=>q(a.refreshToken,d.xq.antigravity.clientId,d.xq.antigravity.clientSecret,b),claude:(a,b)=>p(a.refreshToken,b),codex:(a,b)=>r(a.refreshToken,b),iflow:(a,b)=>u(a.refreshToken,b),github:(a,b)=>v(a.refreshToken,b),kiro:(a,b)=>t(a.refreshToken,a.providerSpecificData,b),xai:(a,b)=>k(a.refreshToken,b),"grok-cli":(a,b)=>k(a.refreshToken,b),gcli:(a,b)=>k(a.refreshToken,b),"codebuddy-cn":(a,b)=>x(a.refreshToken,b),"codebuddy-intl":(a,b)=>y(a.refreshToken,b),codearts:(a,b)=>(0,D.J9)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),deveco:(a,b)=>(0,E.WH)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),trae:(a,b)=>z(a.refreshToken,a,b,"trae"),"trae-enterprise":(a,b)=>z(a.refreshToken,a,b,"trae-enterprise"),cline:(a,b)=>o(a.refreshToken,b),clinepass:(a,b)=>o(a.refreshToken,b),zed:()=>null,windsurf:(a,b)=>A(a,b),kimi:(a,b)=>n(a.refreshToken,a,b),"kimi-coding":(a,b)=>n(a.refreshToken,a,b),"minimax-code":(a,b)=>C("minimax-code",a.refreshToken,b),"minimax-code-global":(a,b)=>C("minimax-code-global",a.refreshToken,b),vertex:L,"vertex-partner":L};async function N(a,b,c){if(!b.refreshToken)return null;let d=M[a];return d?d(b,c):m(a,b.refreshToken,b,c)}async function O(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}},18080:(a,b,c)=>{c.d(b,{Xj:()=>i,uo:()=>j});let d=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function e(a){return"string"==typeof a?a.trim():""}function f(a){let b,c=e(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");let f=b.hostname.toLowerCase();if(!d.has(f))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}function g(a){return Array.isArray(a)?a.map(e).filter(Boolean).join(" "):e(a)}function h(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4;return JSON.parse(Buffer.from(`${c}${"=".repeat(d)}`,"base64").toString("utf8"))}catch{return null}}function i(a){let b=a;if("string"==typeof b)try{b=JSON.parse(b)}catch{throw Error("CLIProxyAPI auth JSON is invalid")}if(!b||"object"!=typeof b)throw Error("CLIProxyAPI auth JSON is required");let c=e(b.auth_method||b.authMethod);if(c&&"external_idp"!==c)throw Error("Only external_idp Kiro auth is supported by this importer");let d=e(b.access_token||b.accessToken),i=e(b.refresh_token||b.refreshToken),j=e(b.client_id||b.clientId),k=f(b.token_endpoint||b.tokenEndpoint),l=e(b.profile_arn||b.profileArn),m=e(b.region)||"us-east-1",n=g(b.scopes||b.scope);if(!d)throw Error("access_token is required");if(!i)throw Error("refresh_token is required");if(!j)throw Error("client_id is required");if(!n)throw Error("scopes is required");if(!l)throw Error("profile_arn is required");let o=h(d),p=b.email||o?.email||o?.preferred_username||o?.upn||o?.sub||null;return{accessToken:d,refreshToken:i,expiresAt:function(a){let b=a.expired||a.expires_at||a.expiresAt;if(b){let a=new Date(b).getTime();if(Number.isFinite(a))return new Date(a).toISOString()}let c=Number(a.expires_in||a.expiresIn||0);if(Number.isFinite(c)&&c>0)return new Date(Date.now()+1e3*c).toISOString();let d=h(a.access_token||a.accessToken);return d?.exp?new Date(1e3*d.exp).toISOString():new Date(Date.now()+36e5).toISOString()}(b),email:p,providerSpecificData:{profileArn:l,region:m,authMethod:"external_idp",provider:"CLIProxyAPI",clientId:j,tokenEndpoint:k,scope:n}}}function j(a,b={}){let c=e(b.clientId||b.client_id),d=f(b.tokenEndpoint||b.token_endpoint),h=g(b.scope||b.scopes);if(!a)throw Error("refresh token is required");if(!c)throw Error("clientId is required for external_idp refresh");if(!h)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:d,body:new URLSearchParams({grant_type:"refresh_token",client_id:c,refresh_token:a,scope:h}),providerSpecificData:{...b,authMethod:"external_idp",clientId:c,tokenEndpoint:d,scope:h}}}},71547:(a,b,c)=>{c.d(b,{DK:()=>h,Ew:()=>s,HW:()=>t,J9:()=>w,Qi:()=>j,a_:()=>v,ox:()=>l,xj:()=>n,yn:()=>o,zx:()=>m});var d=c(77598),e=c.n(d),f=c(39609);let g="https://sts.cn-north-4.myhuaweicloud.com",h="https://snap-access.cn-north-4.myhuaweicloud.com",i="CodeArts_Tui",j="codearts/26.9.3";function k(a){return Buffer.from(JSON.stringify(a),"utf8").toString("base64url")}function l(){return e().randomBytes(32).toString("hex")}function m(){let{privateKey:a,publicKey:b}=e().generateKeyPairSync("ec",{namedCurve:"prime256v1"});return{privateKeyJwk:a.export({format:"jwk"}),publicKeyJwk:b.export({format:"jwk"})}}function n({redirectUri:a,codeChallenge:b,ticketId:c,locale:d="zh-cn",portalBase:e="https://codearts.huaweicloud.com/portal"}){let{port:f}=new URL(a),g=new URLSearchParams({locale:d,client_id:i,port:f,code_challenge:b,code_challenge_method:"SHA-256",ticket_id:c});return`${e.replace(/\/+$/,"")}/authorize?${g.toString()}`}function o(a,b="127.0.0.1"){return`http://${b}:${a}/oauth/callback`}async function p(a,b,{extraHeaders:c=null,proxyOptions:d=null,stsBase:h=g}={}){let i=`${h.replace(/\/+$/,"")}/v1/oauth2/tokens`,l=await (0,f.proxyAwareFetch)(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":j,DPoP:function(a,b,c,d=Math.floor(Date.now()/1e3)){if(!a?.privateKeyJwk||!a?.publicKeyJwk)throw Error("CodeArts DPoP key pair is missing; restart the login flow");let f={alg:"ES256",typ:"dpop+jwt",jwk:{crv:"P-256",ext:!0,key_ops:["verify"],kty:"EC",x:a.publicKeyJwk.x,y:a.publicKeyJwk.y}},g={htm:String(b).toUpperCase(),htu:c,iat:d,jti:e().randomBytes(16).toString("hex")},h=`${k(f)}.${k(g)}`,i=e().createPrivateKey({key:a.privateKeyJwk,format:"jwk"}),j=e().sign("sha256",Buffer.from(h),{key:i,dsaEncoding:"ieee-p1363"});return`${h}.${j.toString("base64url")}`}(b,"POST",i),...c||{}},body:new URLSearchParams(a).toString()},d),m=await l.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{n=null}if(!l.ok){var o,q;let a;throw o=l.status,q=n,(a=Error(q?.error_description||q?.error?.message||q?.error||`CodeArts token request failed: HTTP ${o} ${(m||"").slice(0,200)}`)).status=o,(400===o||401===o||403===o)&&(a.authFailed=!0),a}return n}function q({accessKeyId:a,secretAccessKey:b,securityToken:c,expiration:d,refreshToken:e,keyPair:f}){if(!a||!b)return null;let g=Date.parse(d||"");return{accessKeyId:a,secretAccessKey:b,securityToken:c||"",expiresAt:Number.isFinite(g)?g:Date.now()+36e5,refreshToken:e||null,dpopKeyPair:f}}function r(a,b){let c=a?.credentials||a?.Credential||{};return q({accessKeyId:c.access_key_id||c.accessKeyId,secretAccessKey:c.secret_access_key||c.secretAccessKey,securityToken:c.security_token||c.securityToken,expiration:c.expiration,refreshToken:a?.refresh_token||a?.refreshToken,keyPair:b})}async function s({code:a,codeVerifier:b,redirectUri:c,keyPair:d,proxyOptions:e=null,stsBase:f=g}){let h=await p({client_id:i,code:a,code_verifier:b,grant_type:"authorization_code",redirect_uri:c},d,{proxyOptions:e,stsBase:f}),j=r(h,d);if(!j)throw Error("CodeArts token exchange returned no credentials "+JSON.stringify(h?.error||h?.error_description||Object.keys(h||{})));return j}async function t({ticketId:a,secret:b,keyPair:c=null,attempts:d=10,intervalMs:e=1e3,sleep:g=a=>new Promise(b=>setTimeout(b,a)),proxyOptions:i=null,apiBase:k=h}={}){if(!a||!b)throw Error("CodeArts login secret needs its ticket_id");let l=`${k.replace(/\/+$/,"")}/snap-manager/v1/login/ticket?${new URLSearchParams({ticket_id:a,secret:b})}`,m=0;for(let a=1;a<=d;a++){await g(e);let b=await (0,f.proxyAwareFetch)(l,{method:"GET",headers:{Accept:"application/json","User-Agent":j}},i).catch(b=>(m=0,console.log(`[CodeArts] ticket poll ${a}/${d} failed: ${b?.message||b}`),null));if(!b)continue;if(m=b.status,!b.ok){console.log(`[CodeArts] ticket poll ${a}/${d}: HTTP ${b.status}`);continue}let h=await b.text().catch(()=>""),k=null;try{k=h?JSON.parse(h):null}catch{k=null}let n=function(a,b){let c=a?.credential||a?.credentials||{};return q({accessKeyId:c.access||c.access_key_id,secretAccessKey:c.secret||c.secret_access_key,securityToken:c.securitytoken||c.security_token,expiration:c.expires_at||c.expiration,refreshToken:a?.refresh_token,keyPair:b})}(k,c);if(n)return n;console.log(`[CodeArts] ticket poll ${a}/${d}: no credentials in payload`)}throw Error(`CodeArts login ticket never returned credentials (last HTTP ${m||"network error"})`)}async function u({refreshToken:a,accountId:b="",keyPair:c,proxyOptions:d=null,stsBase:e=g}){let f=r(await p({client_id:i,refresh_token:a,grant_type:"refresh_token"},c,{extraHeaders:{"x-agent-user-account":String(b||"")},proxyOptions:d,stsBase:e}),c);if(!f)throw Error("CodeArts refresh returned no credentials");return f.refreshToken||(f.refreshToken=a),f}function v(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.securityToken,refreshToken:a.refreshToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,securityToken:a.securityToken,accountId:a.accountId??b.accountId??"",dpopKeyPair:a.dpopKeyPair||b.dpopKeyPair||null,tokenExpiresAt:new Date(a.expiresAt).toISOString(),...b.userId?{userId:b.userId}:{},...b.domainId?{domainId:b.domainId}:{},...b.userName?{userName:b.userName}:{}}}}async function w(a,{proxyOptions:b=null,log:c=null}={}){let d,e={accessKeyId:(d=a?.providerSpecificData||{}).accessKeyId||"",secretAccessKey:d.secretAccessKey||"",securityToken:d.securityToken||a?.accessToken||"",refreshToken:a?.refreshToken||d.refreshToken||"",accountId:d.accountId||"",dpopKeyPair:d.dpopKeyPair||null};if(!e.refreshToken)return c?.warn?.("TOKEN_REFRESH","CodeArts: connection has no refresh token"),{error:"invalid_grant",message:"CodeArts refresh token missing — reconnect the account"};if(!e.dpopKeyPair?.privateKeyJwk)return c?.warn?.("TOKEN_REFRESH","CodeArts: DPoP key pair was not persisted with the connection"),{error:"invalid_grant",message:"CodeArts DPoP key pair missing — reconnect the account"};try{let a=await u({refreshToken:e.refreshToken,accountId:e.accountId,keyPair:e.dpopKeyPair,proxyOptions:b});if(a.accountId=e.accountId,!a.securityToken)return c?.warn?.("TOKEN_REFRESH","CodeArts refresh returned credentials without a security token"),null;return c?.info?.("TOKEN_REFRESH",`CodeArts AK/SK renewed until ${new Date(a.expiresAt).toISOString()}`),v(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`CodeArts refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},93943:(a,b,c)=>{c.d(b,{Dz:()=>k,MF:()=>m,Vq:()=>n,fp:()=>l});var d=c(16698),e=c(8521),f=c(26070);let g=f.sr.codex?.maxRefreshAgeMs,h=new Map,i=new d.AsyncLocalStorage;function j(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function k(a){return j(a?.expiresAt??a?.tokenExpiresAt)}function l(a,b,c=Date.now()){if(!b)return!1;let d=k(b);if(null!==d&&d-c<(0,e.Og)(a))return!0;let h=f.sr[a]?.maxRefreshAgeMs;return!!(h&&b.refreshToken&&function(a,b=Date.now(),c=g){let d=j(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!d||b-d>=c}(b,c,h))}async function m(a,b,c){let d,e=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),f=i.getStore();if(f?.has(e))return c();let g=h.get(e);if(g)return g;let j=Promise.resolve().then(()=>i.run(new Set([...f||[],e]),c)).finally(()=>{h.delete(e)});return h.set(e,j),j}async function n(a,b,c){return b?m(a,b,async()=>{let d=await (0,e.$B)(a,b,c);return function(a,b,c,d=Date.now()){var g,h;if(!c)return null;if((0,e.jT)(c))return c;let i={},j=new Date(d).toISOString();c.accessToken&&(i.accessToken=c.accessToken),c.apiKey&&(i.apiKey=c.apiKey),c.token&&(i.token=c.token);let k=c.refreshToken??b?.refreshToken;k&&(i.refreshToken=k);let l=c.idToken??b?.idToken;return l&&(i.idToken=l),c.expiresIn?(i.expiresIn=c.expiresIn,i.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,d)):c.expiresAt&&(i.expiresAt=c.expiresAt),c.projectId&&(i.projectId=c.projectId),c.providerSpecificData&&(g=b?.providerSpecificData,i.providerSpecificData=(h=c.providerSpecificData)&&"object"==typeof h?{...g||{},...h}:g),c.copilotToken&&(i.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(i.copilotTokenExpiresAt=c.copilotTokenExpiresAt),(f.sr[a]?.trackRefreshAt||i.accessToken||i.apiKey||i.token||i.refreshToken||i.copilotToken)&&(i.lastRefreshAt=c.lastRefreshAt||j),i}(a,b,d)}):null}}};
1
+ "use strict";exports.id=3943,exports.ids=[3943],exports.modules={7630:(a,b,c)=>{c.d(b,{Ew:()=>o,WH:()=>q,jg:()=>i,rZ:()=>p,xj:()=>j});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cn.devecostudio.huawei.com",h="1008";function i(){return e().randomUUID().replace(/-/g,"")}function j(a,b){let c=new URLSearchParams({port:String(a),appid:h,code:b});return`${g}/console/DevEcoIDE/apply?${c}`}async function k(a,{headers:b={},params:c={},proxyOptions:d=null}={}){let e=new URL(a);for(let[a,b]of Object.entries(c))e.searchParams.set(a,b);let g=await (0,f.proxyAwareFetch)(e.toString(),{method:"GET",headers:b},d),h=await g.text().catch(()=>"");if(!g.ok){let a=Error(`DevEco auth error ${g.status}: ${h.slice(0,200)}`);throw a.authFailed=g.status>=400&&g.status<500,a}return h}async function l(a,b={}){let c=await k(a,b);try{return JSON.parse(c)}catch{let a=Error(`DevEco auth: non-JSON response (${c.slice(0,80)})`);throw a.authFailed=!0,a}}async function m(a,{proxyOptions:b=null}={}){let c=(await k(`${g}/authrouter/auth/api/temptoken/check`,{params:{tempToken:a.split("&")[0],site:"CN",version:"1.0.0",appid:h},proxyOptions:b})).trim(),d=c;if(!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(d))try{let a=JSON.parse(c);d=String(a.jwtToken||a.data?.jwtToken||a.token||"").trim()}catch{}if(3!==d.split(".").length){let a=Error("DevEco: temptoken check returned no jwtToken in JWT form");throw a.authFailed=!0,a}return d}async function n(a,{refresh:b=!1,proxyOptions:c=null}={}){let d=await l(`${g}/authrouter/auth/api/jwToken/check`,{headers:{jwtToken:a,refresh:b?"true":"false"},proxyOptions:c});if(!d?.status)return null;let e=d.userInfo||d.data?.userInfo;return e?.accessToken?{userId:e.userId||"",userName:e.name||"",accessToken:e.accessToken,refreshToken:e.refreshToken||"",jwtToken:a,countryCode:(e.nationalCode||"CN").trim().toUpperCase(),isRealName:"true"===String(e.realName)}:null}async function o(a,{proxyOptions:b=null}={}){let c=await m(a,{proxyOptions:b}),d=await n(c,{proxyOptions:b});if(!d)throw Error("DevEco: jwtToken check returned no access token");return d.expiresAt=Date.now()+18e5,d}function p(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.accessToken,refreshToken:a.jwtToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",jwtToken:a.jwtToken||"",userId:a.userId||b.userId||"",userName:a.userName||b.userName||"",countryCode:a.countryCode||"",isRealName:a.isRealName??b.isRealName??!1,tokenExpiresAt:new Date(a.expiresAt).toISOString()}}}async function q(a,{proxyOptions:b=null,log:c=null}={}){let d=(a?.providerSpecificData||{}).jwtToken||a?.refreshToken||"";if(!d)return c?.warn?.("TOKEN_REFRESH","DevEco: no jwtToken stored — reconnect required"),{error:"invalid_grant",message:"DevEco: jwtToken missing, please re-login"};try{let a=await n(d,{refresh:!0,proxyOptions:b});if(!a)return c?.warn?.("TOKEN_REFRESH","DevEco refresh returned no access token"),{error:"invalid_grant",message:"DevEco: token revoked, please re-login"};return a.expiresAt=Date.now()+18e5,c?.info?.("TOKEN_REFRESH",`DevEco token renewed until ${new Date(a.expiresAt).toISOString()}`),p(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`DevEco refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},8521:(a,b,c)=>{c.d(b,{oD:()=>F,Og:()=>H,jT:()=>G,Sc:()=>I,Wm:()=>r,jR:()=>w,I9:()=>q,Ql:()=>t,rE:()=>C,$B:()=>N,pb:()=>K,qZ:()=>O});var d=c(35024),e=c(75924),f=c(39609);let g=new Map;async function h(a,b,c,d){if(!b)return c();let e=`${a}:${b}`,f=g.get(e);if(f){if(f.promise)return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),f.promise;if(f.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),f.result;g.delete(e)}let h=(async()=>{try{let a=await c(),b={result:a,expiresAt:Date.now()+1e4};g.set(e,b);let d=setTimeout(()=>{g.get(e)===b&&g.delete(e)},1e4);return d.unref?.(),a}catch(a){throw g.delete(e),a}})();return g.set(e,{promise:h}),h}var i=c(18080);let j=null;async function k(a,b){return a?h("xai",a,async()=>{try{j||(j=new(await Promise.all([c.e(5615),c.e(4730)]).then(c.bind(c,84730))).XaiService);let b=await j.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH",`xai refresh failed: ${c?.message||c}`);let a=String(c?.message||"");if(a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant"};return null}},b):null}let l={claude:{bodyFormat:"json",includeClientSecret:!1,url:()=>e.NA.anthropic.token,dedupKey:"claude"},iflow:{url:()=>e.NA.iflow.token,dedupKey:"iflow",extraHeaders:(a,b)=>({Authorization:`Basic ${btoa(`${b.clientId}:${b.clientSecret}`)}`})},github:{url:()=>e.NA.github.token,dedupKey:"github",includeClientSecret:a=>!!a?.clientSecret},kimi:{dedupKey:"kimi",extraHeaders:a=>(0,e.buildKimiHeaders)(a?.providerSpecificData?.deviceId)}};async function m(a,b,c,e){let f=d.xq[a],g=l[a]||{},i=function(a,b,c){if(c?.url)try{return c.url()}catch{}return b?.refreshUrl||d.sr[a]?.tokenUrl||null}(a,f,g);return f&&i?b?h(g.dedupKey||a,b,async()=>{try{let d,h,j,{format:k,body:l}=(d=g?.bodyFormat==="json"?"json":"form",h=g?.includeClientSecret===void 0||("function"==typeof g.includeClientSecret?g.includeClientSecret(f):g.includeClientSecret),j={grant_type:"refresh_token",refresh_token:b,client_id:f.clientId},(h&&f.clientSecret&&(j.client_secret=f.clientSecret),"json"===d)?{format:"json",body:JSON.stringify(j)}:{format:"form",body:new URLSearchParams(j)}),m={"Content-Type":"json"===k?"application/json":"application/x-www-form-urlencoded",Accept:"application/json",...g.extraHeaders&&g.extraHeaders(c,f)||{}},n=await fetch(i,{method:"POST",headers:m,body:l});if(!n.ok){let b=await n.text();return e?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:n.status,error:b}),null}let o=await n.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!o.access_token,hasNewRefreshToken:!!o.refresh_token,expiresIn:o.expires_in}),{accessToken:o.access_token,refreshToken:o.refresh_token||b,expiresIn:o.expires_in,...g.parse&&g.parse(o)||{}}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function n(a,b,c){return m("kimi",a,b,c)}async function o(a,b){return a?h("cline",a,async()=>{try{let c=await fetch(d.xq.cline?.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Cline token",{status:c.status,error:a}),null}let e=await c.json(),f=e?.data||e;if(!f?.accessToken)return null;let g=f.expiresAt?Math.max(1,Math.floor((new Date(f.expiresAt).getTime()-Date.now())/1e3)):f.expiresIn||f.expires_in||3600;return{accessToken:f.accessToken,refreshToken:f.refreshToken||a,expiresIn:g}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing Cline token: ${a.message}`),null}},b):null}async function p(a,b){return m("claude",a,{},b)}async function q(a,b,c,d){return a?h(`google:${b}`,a,async()=>{try{let f=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function r(a,b){return a?h("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text(),d=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error?.code||c?.error||c?.error_code||"",e=c?.error_description||c?.message||a||"",f=`${d} ${e}`.toLowerCase();return{status:b,code:d,description:e,permanent:["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_grant"].some(a=>f.includes(a))}}(a,c.status);if(d.permanent)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used or invalid. Re-auth required.",{status:c.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a,code:d.code,permanent:d.permanent}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function s(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(7774),c.e(5433),c.e(8920),c.e(24),c.e(6922),c.e(7843),c.e(2329),c.e(3225),c.e(7913),c.e(3811),c.e(614),c.e(9696),c.e(8499),c.e(1836),c.e(5330),c.e(6171),c.e(8895),c.e(4049),c.e(3535)]).then(c.bind(c,74177));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function t(a,b,c,e=null){return a?h("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,j=b?.clientSecret,k=b?.region;if("external_idp"===g){let d;try{d=(0,i.uo)(a,b)}catch(a){return c?.warn?.("TOKEN_REFRESH",`Invalid Kiro external_idp refresh config: ${a.message}`),null}let g=await (0,f.proxyAwareFetch)(d.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:d.body},e);if(!g.ok){let a=await g.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro external_idp token",{status:g.status,error:a}),null}let h=await g.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro external_idp token",{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||a,expiresIn:h.expires_in,providerSpecificData:d.providerSpecificData}}if(h&&j){let d="idc"===g&&k?`https://oidc.${k}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",i=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:j,refreshToken:a,grantType:"refresh_token"})},e);if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:i.status,error:a}),null}let l=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!l.accessToken,expiresIn:l.expiresIn}),{accessToken:l.accessToken,refreshToken:l.refreshToken||a,expiresIn:l.expiresIn,...await s(b,l.accessToken,l.profileArn)}}let l=await (0,f.proxyAwareFetch)(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},e);if(!l.ok){let a=await l.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:l.status,error:a}),null}let m=await l.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!m.accessToken,expiresIn:m.expiresIn}),{accessToken:m.accessToken,refreshToken:m.refreshToken||a,expiresIn:m.expiresIn,...await s(b,m.accessToken,m.profileArn)}},c):null}async function u(a,b){return m("iflow",a,{},b)}async function v(a,b){return m("github",a,{},b)}async function w(a,b){return a?h("copilot",a,async()=>{try{let c=await fetch(d.sr.github?.copilotTokenUrl,{headers:{Authorization:`token ${a}`,"User-Agent":e.x0.USER_AGENT,"Editor-Version":`vscode/${e.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${e.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":e.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!f.token,expiresAt:f.expires_at}),{token:f.token,expiresAt:f.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}},b):null}async function x(a,b){return a?h("codebuddy-cn",a,async()=>{let c=d.sr["codebuddy-cn"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function y(a,b){return a?h("codebuddy-intl",a,async()=>{let c=d.sr["codebuddy-intl"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy intl token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy intl token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy intl token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function z(a,b,c,e="trae"){if(!a)return null;let f=d.sr[e]||{},g=f.exchangeTokenUrl||f.tokenUrl;return g?h(e,a,async()=>{try{let b,d=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"Trae/1.0.0 antigravity-cockpit-tools"},body:JSON.stringify({ClientID:f.clientId||"ono9krqynydwx5",RefreshToken:a,ClientSecret:f.clientSecret||"-",UserID:""})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Trae token",{status:d.status,error:a}),null}let e=await d.json(),h=e?.Result||e?.Data||e?.result||e,i=h?.AccessToken||h?.Token||h?.accessToken;if(!i)return c?.error?.("TOKEN_REFRESH","Trae refresh returned no AccessToken",{payload:e}),null;let j=h?.RefreshToken||h?.refreshToken||a,k=h?.ExpiresAt||h?.TokenExpireAt||h?.expiresAt;if("number"==typeof k){let a=k>1e12?Math.floor(k/1e3):k;b=Math.max(1,a-Math.floor(Date.now()/1e3))}else if("string"==typeof k){let a=new Date(k).getTime()-Date.now();b=a>0?Math.floor(a/1e3):void 0}return c?.info?.("TOKEN_REFRESH","Successfully refreshed Trae token",{hasNewAccessToken:!!i,hasNewRefreshToken:j!==a,expiresIn:b}),{accessToken:i,refreshToken:j,expiresIn:b}}catch(a){return c?.error?.("TOKEN_REFRESH",`Error refreshing Trae token: ${a.message}`),null}},c):(c?.warn?.("TOKEN_REFRESH","No Trae exchangeTokenUrl configured"),null)}async function A(a,b){return b?.info?.("TOKEN_REFRESH","windsurf: apiKey is long-lived (no refresh_token flow) — skipping"),null}let B={"minimax-code":"https://account.minimax.cn/oauth2/token","minimax-code-global":"https://account.minimax.io/oauth2/token"};async function C(a,b,c){let d=B[a];return d&&b?h(a,b,async()=>{try{let e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:"mcode-public",scope:"agent.default",audience:"agent-backend"}).toString(),signal:AbortSignal.timeout(3e4)}),f=await e.json().catch(()=>null);if(!e.ok||f&&"string"==typeof f.error&&f.error){let b=f?.error||`HTTP ${e.status}`;if(400===e.status&&f?.error==="invalid_grant")return c?.warn?.("TOKEN_REFRESH",`MiniMax refresh token spent/rejected (${a}) — sign-in gone`),{error:"invalid_grant"};return c?.error?.("TOKEN_REFRESH",`MiniMax token refresh failed (${a})`,{status:e.status,error:b}),null}if(!f?.access_token)return c?.error?.("TOKEN_REFRESH",`MiniMax refresh returned no access_token (${a})`),null;return{accessToken:f.access_token,refreshToken:f.refresh_token||b,expiresIn:f.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Error refreshing MiniMax token (${a}): ${b.message}`),null}},c):null}var D=c(71547),E=c(7630);let F=3e5;function G(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function H(a){return e.Wu[a]?e.Wu[a]:"kimi-coding"===a&&e.Wu.kimi?e.Wu.kimi:F}function I(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let J=new Map;async function K(a,b){let d=a.client_email,f=J.get(d);if(f&&f.expiresAt-Date.now()>3e5)return{accessToken:f.token,expiresAt:f.expiresAt};try{let{SignJWT:f,importPKCS8:g}=await Promise.all([c.e(8292),c.e(1455)]).then(c.bind(c,71455));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let h=await g(a.private_key.replace(/\\n/g,"\n"),"RS256"),i=Math.floor(Date.now()/1e3),j=await new f({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience(e.NA.google.token).setIssuedAt(i).setExpirationTime(i+3600).sign(h),k=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:j})});if(!k.ok){let a=await k.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:l,expires_in:m}=await k.json(),n=Date.now()+(m??3600)*1e3;return J.set(d,{token:l,expiresAt:n}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:l,expiresAt:n}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}function L(a,b){let c=I(a.apiKey);return c?K(c,b):null}let M={"gemini-cli":(a,b)=>q(a.refreshToken,d.xq["gemini-cli"].clientId,d.xq["gemini-cli"].clientSecret,b),antigravity:(a,b)=>q(a.refreshToken,d.xq.antigravity.clientId,d.xq.antigravity.clientSecret,b),claude:(a,b)=>p(a.refreshToken,b),codex:(a,b)=>r(a.refreshToken,b),iflow:(a,b)=>u(a.refreshToken,b),github:(a,b)=>v(a.refreshToken,b),kiro:(a,b)=>t(a.refreshToken,a.providerSpecificData,b),xai:(a,b)=>k(a.refreshToken,b),"grok-cli":(a,b)=>k(a.refreshToken,b),gcli:(a,b)=>k(a.refreshToken,b),"codebuddy-cn":(a,b)=>x(a.refreshToken,b),"codebuddy-intl":(a,b)=>y(a.refreshToken,b),codearts:(a,b)=>(0,D.J9)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),deveco:(a,b)=>(0,E.WH)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),trae:(a,b)=>z(a.refreshToken,a,b,"trae"),"trae-enterprise":(a,b)=>z(a.refreshToken,a,b,"trae-enterprise"),cline:(a,b)=>o(a.refreshToken,b),clinepass:(a,b)=>o(a.refreshToken,b),zed:()=>null,windsurf:(a,b)=>A(a,b),kimi:(a,b)=>n(a.refreshToken,a,b),"kimi-coding":(a,b)=>n(a.refreshToken,a,b),"minimax-code":(a,b)=>C("minimax-code",a.refreshToken,b),"minimax-code-global":(a,b)=>C("minimax-code-global",a.refreshToken,b),vertex:L,"vertex-partner":L};async function N(a,b,c){if(!b.refreshToken)return null;let d=M[a];return d?d(b,c):m(a,b.refreshToken,b,c)}async function O(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}},18080:(a,b,c)=>{c.d(b,{Xj:()=>i,uo:()=>j});let d=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function e(a){return"string"==typeof a?a.trim():""}function f(a){let b,c=e(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");let f=b.hostname.toLowerCase();if(!d.has(f))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}function g(a){return Array.isArray(a)?a.map(e).filter(Boolean).join(" "):e(a)}function h(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4;return JSON.parse(Buffer.from(`${c}${"=".repeat(d)}`,"base64").toString("utf8"))}catch{return null}}function i(a){let b=a;if("string"==typeof b)try{b=JSON.parse(b)}catch{throw Error("CLIProxyAPI auth JSON is invalid")}if(!b||"object"!=typeof b)throw Error("CLIProxyAPI auth JSON is required");let c=e(b.auth_method||b.authMethod);if(c&&"external_idp"!==c)throw Error("Only external_idp Kiro auth is supported by this importer");let d=e(b.access_token||b.accessToken),i=e(b.refresh_token||b.refreshToken),j=e(b.client_id||b.clientId),k=f(b.token_endpoint||b.tokenEndpoint),l=e(b.profile_arn||b.profileArn),m=e(b.region)||"us-east-1",n=g(b.scopes||b.scope);if(!d)throw Error("access_token is required");if(!i)throw Error("refresh_token is required");if(!j)throw Error("client_id is required");if(!n)throw Error("scopes is required");if(!l)throw Error("profile_arn is required");let o=h(d),p=b.email||o?.email||o?.preferred_username||o?.upn||o?.sub||null;return{accessToken:d,refreshToken:i,expiresAt:function(a){let b=a.expired||a.expires_at||a.expiresAt;if(b){let a=new Date(b).getTime();if(Number.isFinite(a))return new Date(a).toISOString()}let c=Number(a.expires_in||a.expiresIn||0);if(Number.isFinite(c)&&c>0)return new Date(Date.now()+1e3*c).toISOString();let d=h(a.access_token||a.accessToken);return d?.exp?new Date(1e3*d.exp).toISOString():new Date(Date.now()+36e5).toISOString()}(b),email:p,providerSpecificData:{profileArn:l,region:m,authMethod:"external_idp",provider:"CLIProxyAPI",clientId:j,tokenEndpoint:k,scope:n}}}function j(a,b={}){let c=e(b.clientId||b.client_id),d=f(b.tokenEndpoint||b.token_endpoint),h=g(b.scope||b.scopes);if(!a)throw Error("refresh token is required");if(!c)throw Error("clientId is required for external_idp refresh");if(!h)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:d,body:new URLSearchParams({grant_type:"refresh_token",client_id:c,refresh_token:a,scope:h}),providerSpecificData:{...b,authMethod:"external_idp",clientId:c,tokenEndpoint:d,scope:h}}}},71547:(a,b,c)=>{c.d(b,{DK:()=>h,Ew:()=>s,HW:()=>t,J9:()=>w,Qi:()=>j,a_:()=>v,ox:()=>l,xj:()=>n,yn:()=>o,zx:()=>m});var d=c(77598),e=c.n(d),f=c(39609);let g="https://sts.cn-north-4.myhuaweicloud.com",h="https://snap-access.cn-north-4.myhuaweicloud.com",i="CodeArts_Tui",j="codearts/26.9.3";function k(a){return Buffer.from(JSON.stringify(a),"utf8").toString("base64url")}function l(){return e().randomBytes(32).toString("hex")}function m(){let{privateKey:a,publicKey:b}=e().generateKeyPairSync("ec",{namedCurve:"prime256v1"});return{privateKeyJwk:a.export({format:"jwk"}),publicKeyJwk:b.export({format:"jwk"})}}function n({redirectUri:a,codeChallenge:b,ticketId:c,locale:d="zh-cn",portalBase:e="https://codearts.huaweicloud.com/portal"}){let{port:f}=new URL(a),g=new URLSearchParams({locale:d,client_id:i,port:f,code_challenge:b,code_challenge_method:"SHA-256",ticket_id:c});return`${e.replace(/\/+$/,"")}/authorize?${g.toString()}`}function o(a,b="127.0.0.1"){return`http://${b}:${a}/oauth/callback`}async function p(a,b,{extraHeaders:c=null,proxyOptions:d=null,stsBase:h=g}={}){let i=`${h.replace(/\/+$/,"")}/v1/oauth2/tokens`,l=await (0,f.proxyAwareFetch)(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":j,DPoP:function(a,b,c,d=Math.floor(Date.now()/1e3)){if(!a?.privateKeyJwk||!a?.publicKeyJwk)throw Error("CodeArts DPoP key pair is missing; restart the login flow");let f={alg:"ES256",typ:"dpop+jwt",jwk:{crv:"P-256",ext:!0,key_ops:["verify"],kty:"EC",x:a.publicKeyJwk.x,y:a.publicKeyJwk.y}},g={htm:String(b).toUpperCase(),htu:c,iat:d,jti:e().randomBytes(16).toString("hex")},h=`${k(f)}.${k(g)}`,i=e().createPrivateKey({key:a.privateKeyJwk,format:"jwk"}),j=e().sign("sha256",Buffer.from(h),{key:i,dsaEncoding:"ieee-p1363"});return`${h}.${j.toString("base64url")}`}(b,"POST",i),...c||{}},body:new URLSearchParams(a).toString()},d),m=await l.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{n=null}if(!l.ok){var o,q;let a;throw o=l.status,q=n,(a=Error(q?.error_description||q?.error?.message||q?.error||`CodeArts token request failed: HTTP ${o} ${(m||"").slice(0,200)}`)).status=o,(400===o||401===o||403===o)&&(a.authFailed=!0),a}return n}function q({accessKeyId:a,secretAccessKey:b,securityToken:c,expiration:d,refreshToken:e,keyPair:f}){if(!a||!b)return null;let g=Date.parse(d||"");return{accessKeyId:a,secretAccessKey:b,securityToken:c||"",expiresAt:Number.isFinite(g)?g:Date.now()+36e5,refreshToken:e||null,dpopKeyPair:f}}function r(a,b){let c=a?.credentials||a?.Credential||{};return q({accessKeyId:c.access_key_id||c.accessKeyId,secretAccessKey:c.secret_access_key||c.secretAccessKey,securityToken:c.security_token||c.securityToken,expiration:c.expiration,refreshToken:a?.refresh_token||a?.refreshToken,keyPair:b})}async function s({code:a,codeVerifier:b,redirectUri:c,keyPair:d,proxyOptions:e=null,stsBase:f=g}){let h=await p({client_id:i,code:a,code_verifier:b,grant_type:"authorization_code",redirect_uri:c},d,{proxyOptions:e,stsBase:f}),j=r(h,d);if(!j)throw Error("CodeArts token exchange returned no credentials "+JSON.stringify(h?.error||h?.error_description||Object.keys(h||{})));return j}async function t({ticketId:a,secret:b,keyPair:c=null,attempts:d=10,intervalMs:e=1e3,sleep:g=a=>new Promise(b=>setTimeout(b,a)),proxyOptions:i=null,apiBase:k=h}={}){if(!a||!b)throw Error("CodeArts login secret needs its ticket_id");let l=`${k.replace(/\/+$/,"")}/snap-manager/v1/login/ticket?${new URLSearchParams({ticket_id:a,secret:b})}`,m=0;for(let a=1;a<=d;a++){await g(e);let b=await (0,f.proxyAwareFetch)(l,{method:"GET",headers:{Accept:"application/json","User-Agent":j}},i).catch(b=>(m=0,console.log(`[CodeArts] ticket poll ${a}/${d} failed: ${b?.message||b}`),null));if(!b)continue;if(m=b.status,!b.ok){console.log(`[CodeArts] ticket poll ${a}/${d}: HTTP ${b.status}`);continue}let h=await b.text().catch(()=>""),k=null;try{k=h?JSON.parse(h):null}catch{k=null}let n=function(a,b){let c=a?.credential||a?.credentials||{};return q({accessKeyId:c.access||c.access_key_id,secretAccessKey:c.secret||c.secret_access_key,securityToken:c.securitytoken||c.security_token,expiration:c.expires_at||c.expiration,refreshToken:a?.refresh_token,keyPair:b})}(k,c);if(n)return n;console.log(`[CodeArts] ticket poll ${a}/${d}: no credentials in payload`)}throw Error(`CodeArts login ticket never returned credentials (last HTTP ${m||"network error"})`)}async function u({refreshToken:a,accountId:b="",keyPair:c,proxyOptions:d=null,stsBase:e=g}){let f=r(await p({client_id:i,refresh_token:a,grant_type:"refresh_token"},c,{extraHeaders:{"x-agent-user-account":String(b||"")},proxyOptions:d,stsBase:e}),c);if(!f)throw Error("CodeArts refresh returned no credentials");return f.refreshToken||(f.refreshToken=a),f}function v(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.securityToken,refreshToken:a.refreshToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,securityToken:a.securityToken,accountId:a.accountId??b.accountId??"",dpopKeyPair:a.dpopKeyPair||b.dpopKeyPair||null,tokenExpiresAt:new Date(a.expiresAt).toISOString(),...b.userId?{userId:b.userId}:{},...b.domainId?{domainId:b.domainId}:{},...b.userName?{userName:b.userName}:{}}}}async function w(a,{proxyOptions:b=null,log:c=null}={}){let d,e={accessKeyId:(d=a?.providerSpecificData||{}).accessKeyId||"",secretAccessKey:d.secretAccessKey||"",securityToken:d.securityToken||a?.accessToken||"",refreshToken:a?.refreshToken||d.refreshToken||"",accountId:d.accountId||"",dpopKeyPair:d.dpopKeyPair||null};if(!e.refreshToken)return c?.warn?.("TOKEN_REFRESH","CodeArts: connection has no refresh token"),{error:"invalid_grant",message:"CodeArts refresh token missing — reconnect the account"};if(!e.dpopKeyPair?.privateKeyJwk)return c?.warn?.("TOKEN_REFRESH","CodeArts: DPoP key pair was not persisted with the connection"),{error:"invalid_grant",message:"CodeArts DPoP key pair missing — reconnect the account"};try{let a=await u({refreshToken:e.refreshToken,accountId:e.accountId,keyPair:e.dpopKeyPair,proxyOptions:b});if(a.accountId=e.accountId,!a.securityToken)return c?.warn?.("TOKEN_REFRESH","CodeArts refresh returned credentials without a security token"),null;return c?.info?.("TOKEN_REFRESH",`CodeArts AK/SK renewed until ${new Date(a.expiresAt).toISOString()}`),v(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`CodeArts refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},93943:(a,b,c)=>{c.d(b,{Dz:()=>k,MF:()=>m,Vq:()=>n,fp:()=>l});var d=c(16698),e=c(8521),f=c(26070);let g=f.sr.codex?.maxRefreshAgeMs,h=new Map,i=new d.AsyncLocalStorage;function j(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function k(a){return j(a?.expiresAt??a?.tokenExpiresAt)}function l(a,b,c=Date.now()){if(!b)return!1;let d=k(b);if(null!==d&&d-c<(0,e.Og)(a))return!0;let h=f.sr[a]?.maxRefreshAgeMs;return!!(h&&b.refreshToken&&function(a,b=Date.now(),c=g){let d=j(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!d||b-d>=c}(b,c,h))}async function m(a,b,c){let d,e=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),f=i.getStore();if(f?.has(e))return c();let g=h.get(e);if(g)return g;let j=Promise.resolve().then(()=>i.run(new Set([...f||[],e]),c)).finally(()=>{h.delete(e)});return h.set(e,j),j}async function n(a,b,c){return b?m(a,b,async()=>{let d=await (0,e.$B)(a,b,c);return function(a,b,c,d=Date.now()){var g,h;if(!c)return null;if((0,e.jT)(c))return c;let i={},j=new Date(d).toISOString();c.accessToken&&(i.accessToken=c.accessToken),c.apiKey&&(i.apiKey=c.apiKey),c.token&&(i.token=c.token);let k=c.refreshToken??b?.refreshToken;k&&(i.refreshToken=k);let l=c.idToken??b?.idToken;return l&&(i.idToken=l),c.expiresIn?(i.expiresIn=c.expiresIn,i.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,d)):c.expiresAt&&(i.expiresAt=c.expiresAt),c.projectId&&(i.projectId=c.projectId),c.providerSpecificData&&(g=b?.providerSpecificData,i.providerSpecificData=(h=c.providerSpecificData)&&"object"==typeof h?{...g||{},...h}:g),c.copilotToken&&(i.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(i.copilotTokenExpiresAt=c.copilotTokenExpiresAt),(f.sr[a]?.trackRefreshAt||i.accessToken||i.apiKey||i.token||i.refreshToken||i.copilotToken)&&(i.lastRefreshAt=c.lastRefreshAt||j),i}(a,b,d)}):null}}};
@@ -4,4 +4,4 @@
4
4
  data: ${d}
5
5
 
6
6
  `)}catch{}}}),f.stderr.on("data",b=>console.log(`[mcp:${a}]`,b.toString().trim())),f.on("exit",c=>{console.log(`[mcp:${a}] exited`,c),b.delete(a)}),c}a.exports={getOrSpawn:j,registerSession:function(a,b){let c=j(a),d=e.randomUUID();return c.sessions.set(d,b),d},unregisterSession:function(a,b){let c=h().get(a);if(c&&(c.sessions.delete(b),0===c.sessions.size)){try{c.proc.kill()}catch{}h().delete(a)}},sendToChild:function(a,b){let c=h().get(a);if(!c?.proc?.stdin?.writable)throw Error(`Bridge not running: ${a}`);c.proc.stdin.write(`${JSON.stringify(b)}
7
- `)},isRunning:function(a){let b=h().get(a);return!!(b?.proc&&!b.proc.killed&&null===b.proc.exitCode)},findPlugin:i,killAllBridges:function(){let a=h();for(let[b,c]of a){try{c.proc.kill()}catch{}a.delete(b)}}}},28286:a=>{a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},76476:(a,b,c)=>{c.d(b,{N:()=>l,v:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(49120);let i=g().join(h.n,"mitm","aliases.json");function j(a){let b=g().dirname(i);e().mkdirSync(b,{recursive:!0});let c=`${i}.tmp`;e().writeFileSync(c,JSON.stringify(a,null,2),"utf8"),e().renameSync(c,i)}async function k(){try{let{getMitmAlias:a}=await Promise.resolve().then(c.bind(c,9460)),b=await a();j(b||{})}catch(a){console.log("[mitmAliasCache] sync failed:",a.message)}}function l(a,b){try{let c={};if(e().existsSync(i))try{c=JSON.parse(e().readFileSync(i,"utf8"))}catch{}c[a]=b||{},j(c)}catch(a){console.log("[mitmAliasCache] write failed:",a.message)}}},94123:(a,b,c)=>{c.d(b,{Ay:()=>v,Zh:()=>u});var d=c(21820),e=c.n(d),f=c(1932),g=c(33873),h=c(29021),i=c(89718),j=c(66457),k=c(96182),l=c(76476),m=c(17113);if(!process.env.MITM_SERVER_PATH)try{let a=(0,f.fileURLToPath)("file:///home/runner/work/9router/9router/src/shared/services/initializeApp.js"),b=(0,g.dirname)((0,g.dirname)(a)),c=(0,g.join)(b,"mitm","server.js");(0,h.existsSync)(c)&&(process.env.MITM_SERVER_PATH=c)}catch{}try{(0,k.initDbHooks)(i.mt,i.Xx)}catch{}process.setMaxListeners(20);let n=global.__appSingleton??={signalHandlersRegistered:!1,watchdogInterval:null,networkMonitorInterval:null,lastNetworkFingerprint:null,lastWatchdogTick:Date.now(),lastOnline:null,mitmStartInProgress:!1,tunnelAutoResumed:!1,tailscaleAutoResumed:!1};async function o(){var a;await (0,i.bI)();let b=await (0,i.mt)();b.tunnelEnabled&&!n.tunnelAutoResumed&&(n.tunnelAutoResumed=!0,console.log("[InitApp] Tunnel was enabled, auto-resuming..."),r("startup").catch(a=>console.log("[InitApp] Tunnel resume failed:",a.message))),b.tailscaleEnabled&&!n.tailscaleAutoResumed&&(n.tailscaleAutoResumed=!0,console.log("[InitApp] Tailscale was enabled, auto-resuming..."),s("startup").catch(a=>console.log("[InitApp] Tailscale resume failed:",a.message))),b.tunnelEnabled&&(0,j.Al)().catch(()=>{}),b.mitmEnabled&&((0,l.v)().catch(()=>{}),p(b)),u(b),a=b,[a?.claudeAutoPing,a?.codexAutoPing].some(a=>Object.values(a?.connections||{}).some(Boolean))&&Promise.all([c.e(7774),c.e(2375),c.e(6070),c.e(869),c.e(8920),c.e(24),c.e(436),c.e(3943),c.e(2329),c.e(3225),c.e(6922),c.e(7843),c.e(7913),c.e(4957),c.e(614),c.e(9696),c.e(7552),c.e(8499),c.e(6249),c.e(8416),c.e(5330),c.e(8895),c.e(7211),c.e(8363)]).then(c.bind(c,1133)).then(({startQuotaAutoPing:a})=>a()).catch(a=>console.log("[AutoPing] scheduler start failed:",a.message)),Promise.all([c.e(2375),c.e(6070),c.e(436),c.e(3943),c.e(1051)]).then(c.bind(c,3256)).then(({startBackgroundTokenRefresh:a})=>a()).catch(a=>console.log("[BackgroundTokenRefresh] scheduler start failed:",a.message))}async function p(a){if(!n.mitmStartInProgress){n.mitmStartInProgress=!0;try{if(!a.mitmEnabled||(await (0,k.getMitmStatus)()).running)return;let b=await (0,k.loadEncryptedPassword)();if(!b&&"win32"!==process.platform)return void console.log("[InitApp] MITM was enabled but no saved password found, skipping auto-start");let c=(await (0,i.PX)()).find(a=>!1!==a.isActive);console.log("[InitApp] MITM was enabled, auto-starting..."),await (0,k.startMitm)(c?.key||"sk_9router",b),console.log("[InitApp] MITM auto-started");try{await (0,k.restoreToolDNS)(b),console.log("[InitApp] DNS restored from saved state")}catch(a){console.log("[InitApp] DNS restore failed:",a.message)}}catch(a){console.log("[InitApp] MITM auto-start failed:",a.message)}finally{n.mitmStartInProgress=!1}}}let q=/^(startup|netchange|sleep|sleep\+netchange|online|unexpected-exit)$/;async function r(a){let b=(0,j.Qn)();if(!(await (0,i.mt)()).tunnelEnabled||b.cancelToken.cancelled||b.spawnInProgress)return;let c=q.test(a);if(!(0,j.nN)()){if(!c&&Date.now()-b.lastRestartAt<j.Lh)return void console.log(`[Tunnel] degraded but cooldown active, skip (${a})`);if(await (0,j.u7)()){console.log(`[Tunnel] safeRestart (${a}) — tunnel unreachable${c?" [force]":""}`);try{await (0,j.cb)(),b.lastRestartAt=Date.now(),console.log("[Tunnel] restart success")}catch(a){/cloudflared killed|tunnel cancelled/.test(a.message)||console.log("[Tunnel] restart failed:",a.message)}}}}async function s(a){let b=(0,j.oN)();if(!(await (0,i.mt)()).tailscaleEnabled||b.cancelToken.cancelled||b.spawnInProgress||("startup"===a?await (0,j.hp)():(0,j.Kp)()))return;if((0,j.si)()&&b.activeLocalPort){try{await (0,j.LC)(b.activeLocalPort),b.lastRestartAt=Date.now(),console.log("[Tailscale] funnel re-established (daemon alive)")}catch(a){console.log("[Tailscale] funnel recovery failed:",a.message)}return}let c=q.test(a);if(!c&&Date.now()-b.lastRestartAt<j.Lh)return void console.log(`[Tailscale] degraded but cooldown active, skip (${a})`);if(await (0,j.u7)()){console.log(`[Tailscale] safeRestart (${a}) — daemon not running${c?" [force]":""}`);try{await (0,j.mh)(),b.lastRestartAt=Date.now(),console.log("[Tailscale] restart success")}catch(a){console.log("[Tailscale] restart failed:",a.message)}}}function t(){let a=e().networkInterfaces(),b=[];for(let[c,d]of Object.entries(a))if(d&&!j.Lx.test(c))for(let a of d)a.internal||"IPv4"!==a.family||b.push(`${c}:${a.address}`);return b.sort().join("|")}function u(a){if(a?.tunnelEnabled||a?.tailscaleEnabled){!n.watchdogInterval&&(n.watchdogInterval=setInterval(()=>{r("watchdog").catch(()=>{}),s("watchdog").catch(()=>{})},j.DA),n.watchdogInterval.unref&&n.watchdogInterval.unref()),!n.networkMonitorInterval&&(n.lastNetworkFingerprint=t(),n.lastWatchdogTick=Date.now(),n.lastOnline=null,n.networkMonitorInterval=setInterval(async()=>{try{let a=Date.now(),b=a-n.lastWatchdogTick;n.lastWatchdogTick=a;let c=t(),d=c!==n.lastNetworkFingerprint,e=b>6*j.rI;d&&(n.lastNetworkFingerprint=c);let f=await (0,j.u7)(),g=!1===n.lastOnline;if(n.lastOnline=f,!f||!d&&!e&&!g)return;await new Promise(a=>setTimeout(a,j.cw));let h=g?"online":e&&d?"sleep+netchange":e?"sleep":"netchange";r(h).catch(()=>{}),s(h).catch(()=>{})}catch(a){console.log("[NetworkMonitor] error:",a.message)}},j.rI),n.networkMonitorInterval.unref&&n.networkMonitorInterval.unref());return}n.watchdogInterval&&(clearInterval(n.watchdogInterval),n.watchdogInterval=null),n.networkMonitorInterval&&(clearInterval(n.networkMonitorInterval),n.networkMonitorInterval=null,n.lastNetworkFingerprint=null,n.lastOnline=null)}let v=async function a(){try{if(!n.signalHandlersRegistered){let a=()=>{try{(0,k.removeAllDNSEntriesSync)()}catch{}try{(0,m.killAllBridges)()}catch{}(0,j.ss)(),process.exit()};process.on("SIGINT",a),process.on("SIGTERM",a),process.on("exit",()=>{try{(0,k.removeAllDNSEntriesSync)()}catch{}}),n.signalHandlersRegistered=!0}(0,j.X$)(()=>{r("unexpected-exit").catch(()=>{})}),setTimeout(()=>{o().catch(a=>console.error("[InitApp] deferred startup failed:",a.message))},3e3)}catch(a){console.error("[InitApp] Error:",a)}}}};
7
+ `)},isRunning:function(a){let b=h().get(a);return!!(b?.proc&&!b.proc.killed&&null===b.proc.exitCode)},findPlugin:i,killAllBridges:function(){let a=h();for(let[b,c]of a){try{c.proc.kill()}catch{}a.delete(b)}}}},28286:a=>{a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},76476:(a,b,c)=>{c.d(b,{N:()=>l,v:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(49120);let i=g().join(h.n,"mitm","aliases.json");function j(a){let b=g().dirname(i);e().mkdirSync(b,{recursive:!0});let c=`${i}.tmp`;e().writeFileSync(c,JSON.stringify(a,null,2),"utf8"),e().renameSync(c,i)}async function k(){try{let{getMitmAlias:a}=await Promise.resolve().then(c.bind(c,9460)),b=await a();j(b||{})}catch(a){console.log("[mitmAliasCache] sync failed:",a.message)}}function l(a,b){try{let c={};if(e().existsSync(i))try{c=JSON.parse(e().readFileSync(i,"utf8"))}catch{}c[a]=b||{},j(c)}catch(a){console.log("[mitmAliasCache] write failed:",a.message)}}},94123:(a,b,c)=>{c.d(b,{Ay:()=>v,Zh:()=>u});var d=c(21820),e=c.n(d),f=c(1932),g=c(33873),h=c(29021),i=c(89718),j=c(66457),k=c(96182),l=c(76476),m=c(17113);if(!process.env.MITM_SERVER_PATH)try{let a=(0,f.fileURLToPath)("file:///home/runner/work/9router/9router/src/shared/services/initializeApp.js"),b=(0,g.dirname)((0,g.dirname)(a)),c=(0,g.join)(b,"mitm","server.js");(0,h.existsSync)(c)&&(process.env.MITM_SERVER_PATH=c)}catch{}try{(0,k.initDbHooks)(i.mt,i.Xx)}catch{}process.setMaxListeners(20);let n=global.__appSingleton??={signalHandlersRegistered:!1,watchdogInterval:null,networkMonitorInterval:null,lastNetworkFingerprint:null,lastWatchdogTick:Date.now(),lastOnline:null,mitmStartInProgress:!1,tunnelAutoResumed:!1,tailscaleAutoResumed:!1};async function o(){var a;await (0,i.bI)();let b=await (0,i.mt)();b.tunnelEnabled&&!n.tunnelAutoResumed&&(n.tunnelAutoResumed=!0,console.log("[InitApp] Tunnel was enabled, auto-resuming..."),r("startup").catch(a=>console.log("[InitApp] Tunnel resume failed:",a.message))),b.tailscaleEnabled&&!n.tailscaleAutoResumed&&(n.tailscaleAutoResumed=!0,console.log("[InitApp] Tailscale was enabled, auto-resuming..."),s("startup").catch(a=>console.log("[InitApp] Tailscale resume failed:",a.message))),b.tunnelEnabled&&(0,j.Al)().catch(()=>{}),b.mitmEnabled&&((0,l.v)().catch(()=>{}),p(b)),u(b),a=b,[a?.claudeAutoPing,a?.codexAutoPing].some(a=>Object.values(a?.connections||{}).some(Boolean))&&Promise.all([c.e(7774),c.e(2375),c.e(6070),c.e(869),c.e(8920),c.e(24),c.e(436),c.e(3943),c.e(6922),c.e(7843),c.e(2329),c.e(3225),c.e(7913),c.e(3811),c.e(614),c.e(9696),c.e(8499),c.e(1836),c.e(8416),c.e(5330),c.e(6171),c.e(8895),c.e(7211),c.e(8363)]).then(c.bind(c,1133)).then(({startQuotaAutoPing:a})=>a()).catch(a=>console.log("[AutoPing] scheduler start failed:",a.message)),Promise.all([c.e(2375),c.e(6070),c.e(436),c.e(3943),c.e(1051)]).then(c.bind(c,3256)).then(({startBackgroundTokenRefresh:a})=>a()).catch(a=>console.log("[BackgroundTokenRefresh] scheduler start failed:",a.message))}async function p(a){if(!n.mitmStartInProgress){n.mitmStartInProgress=!0;try{if(!a.mitmEnabled||(await (0,k.getMitmStatus)()).running)return;let b=await (0,k.loadEncryptedPassword)();if(!b&&"win32"!==process.platform)return void console.log("[InitApp] MITM was enabled but no saved password found, skipping auto-start");let c=(await (0,i.PX)()).find(a=>!1!==a.isActive);console.log("[InitApp] MITM was enabled, auto-starting..."),await (0,k.startMitm)(c?.key||"sk_9router",b),console.log("[InitApp] MITM auto-started");try{await (0,k.restoreToolDNS)(b),console.log("[InitApp] DNS restored from saved state")}catch(a){console.log("[InitApp] DNS restore failed:",a.message)}}catch(a){console.log("[InitApp] MITM auto-start failed:",a.message)}finally{n.mitmStartInProgress=!1}}}let q=/^(startup|netchange|sleep|sleep\+netchange|online|unexpected-exit)$/;async function r(a){let b=(0,j.Qn)();if(!(await (0,i.mt)()).tunnelEnabled||b.cancelToken.cancelled||b.spawnInProgress)return;let c=q.test(a);if(!(0,j.nN)()){if(!c&&Date.now()-b.lastRestartAt<j.Lh)return void console.log(`[Tunnel] degraded but cooldown active, skip (${a})`);if(await (0,j.u7)()){console.log(`[Tunnel] safeRestart (${a}) — tunnel unreachable${c?" [force]":""}`);try{await (0,j.cb)(),b.lastRestartAt=Date.now(),console.log("[Tunnel] restart success")}catch(a){/cloudflared killed|tunnel cancelled/.test(a.message)||console.log("[Tunnel] restart failed:",a.message)}}}}async function s(a){let b=(0,j.oN)();if(!(await (0,i.mt)()).tailscaleEnabled||b.cancelToken.cancelled||b.spawnInProgress||("startup"===a?await (0,j.hp)():(0,j.Kp)()))return;if((0,j.si)()&&b.activeLocalPort){try{await (0,j.LC)(b.activeLocalPort),b.lastRestartAt=Date.now(),console.log("[Tailscale] funnel re-established (daemon alive)")}catch(a){console.log("[Tailscale] funnel recovery failed:",a.message)}return}let c=q.test(a);if(!c&&Date.now()-b.lastRestartAt<j.Lh)return void console.log(`[Tailscale] degraded but cooldown active, skip (${a})`);if(await (0,j.u7)()){console.log(`[Tailscale] safeRestart (${a}) — daemon not running${c?" [force]":""}`);try{await (0,j.mh)(),b.lastRestartAt=Date.now(),console.log("[Tailscale] restart success")}catch(a){console.log("[Tailscale] restart failed:",a.message)}}}function t(){let a=e().networkInterfaces(),b=[];for(let[c,d]of Object.entries(a))if(d&&!j.Lx.test(c))for(let a of d)a.internal||"IPv4"!==a.family||b.push(`${c}:${a.address}`);return b.sort().join("|")}function u(a){if(a?.tunnelEnabled||a?.tailscaleEnabled){!n.watchdogInterval&&(n.watchdogInterval=setInterval(()=>{r("watchdog").catch(()=>{}),s("watchdog").catch(()=>{})},j.DA),n.watchdogInterval.unref&&n.watchdogInterval.unref()),!n.networkMonitorInterval&&(n.lastNetworkFingerprint=t(),n.lastWatchdogTick=Date.now(),n.lastOnline=null,n.networkMonitorInterval=setInterval(async()=>{try{let a=Date.now(),b=a-n.lastWatchdogTick;n.lastWatchdogTick=a;let c=t(),d=c!==n.lastNetworkFingerprint,e=b>6*j.rI;d&&(n.lastNetworkFingerprint=c);let f=await (0,j.u7)(),g=!1===n.lastOnline;if(n.lastOnline=f,!f||!d&&!e&&!g)return;await new Promise(a=>setTimeout(a,j.cw));let h=g?"online":e&&d?"sleep+netchange":e?"sleep":"netchange";r(h).catch(()=>{}),s(h).catch(()=>{})}catch(a){console.log("[NetworkMonitor] error:",a.message)}},j.rI),n.networkMonitorInterval.unref&&n.networkMonitorInterval.unref());return}n.watchdogInterval&&(clearInterval(n.watchdogInterval),n.watchdogInterval=null),n.networkMonitorInterval&&(clearInterval(n.networkMonitorInterval),n.networkMonitorInterval=null,n.lastNetworkFingerprint=null,n.lastOnline=null)}let v=async function a(){try{if(!n.signalHandlersRegistered){let a=()=>{try{(0,k.removeAllDNSEntriesSync)()}catch{}try{(0,m.killAllBridges)()}catch{}(0,j.ss)(),process.exit()};process.on("SIGINT",a),process.on("SIGTERM",a),process.on("exit",()=>{try{(0,k.removeAllDNSEntriesSync)()}catch{}}),n.signalHandlersRegistered=!0}(0,j.X$)(()=>{r("unexpected-exit").catch(()=>{})}),setTimeout(()=>{o().catch(a=>console.error("[InitApp] deferred startup failed:",a.message))},3e3)}catch(a){console.error("[InitApp] Error:",a)}}}};