@techysy/10router 1.6.0 → 1.6.2

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 (652) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +11 -11
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +21 -21
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +4 -4
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.html +2 -2
  88. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  89. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  90. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +6 -6
  91. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +2 -2
  106. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  116. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/claude-profiles/route.js +2 -2
  122. package/app/.next-cli-build/server/app/api/cli-tools/claude-profiles/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  130. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  134. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  142. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  151. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/external-quota/[source]/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/external-quota/[source]/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/gateway-probe/route.js +1 -1
  161. package/app/.next-cli-build/server/app/api/gateway-probe/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  170. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/keys/rotate/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/keys/rotate/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/models/caps/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/models/caps/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/network/egress-region/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/claim-compensation/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/desktop-kill/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/desktop-status/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  269. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  285. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
  287. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  291. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  297. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  300. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/security/status/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/security/status/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/settings/route.js +2 -2
  312. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  318. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  338. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  354. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/usage/quotas/route.js +1 -1
  356. package/app/.next-cli-build/server/app/api/usage/quotas/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  362. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  364. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  378. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/rerank/route.js +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/rerank/route.js.nft.json +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  397. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  398. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  399. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  400. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  401. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  402. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  403. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  409. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  411. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  412. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  413. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  414. package/app/.next-cli-build/server/app/api/version/route.js +2 -2
  415. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  416. package/app/.next-cli-build/server/app/api/version/shell-update/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  422. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  424. package/app/.next-cli-build/server/app/callback.html +2 -2
  425. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  426. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  427. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +6 -6
  429. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +2 -2
  430. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
  431. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +8 -8
  432. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
  433. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +2 -2
  435. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
  436. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +8 -8
  437. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  438. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  439. package/app/.next-cli-build/server/app/dashboard/combos.html +2 -2
  440. package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
  441. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +8 -8
  442. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
  443. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  444. package/app/.next-cli-build/server/app/dashboard/endpoint.html +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
  446. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +8 -8
  447. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  448. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/experimental.html +2 -2
  450. package/app/.next-cli-build/server/app/dashboard/experimental.rsc +8 -8
  451. package/app/.next-cli-build/server/app/dashboard/experimental.segments/!KGRhc2hib2FyZCk/dashboard/experimental/__PAGE__.segment.rsc +8 -8
  452. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_full.segment.rsc +8 -8
  453. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_tree.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +2 -2
  455. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
  456. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +8 -8
  457. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
  458. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  459. package/app/.next-cli-build/server/app/dashboard/mitm.html +2 -2
  460. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
  461. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +8 -8
  462. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
  463. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/dashboard/profile.html +2 -2
  465. package/app/.next-cli-build/server/app/dashboard/profile.rsc +8 -8
  466. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +8 -8
  467. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +8 -8
  468. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/providers/new.html +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
  471. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +8 -8
  472. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
  473. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/dashboard/providers.html +2 -2
  475. package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
  476. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +8 -8
  477. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
  478. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
  481. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +8 -8
  482. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
  483. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +2 -2
  485. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +8 -8
  486. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +8 -8
  487. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +8 -8
  488. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
  491. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +9 -9
  492. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
  493. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  496. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +2 -2
  498. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  499. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  500. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  501. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
  502. package/app/.next-cli-build/server/app/dashboard/skills.html +2 -2
  503. package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
  504. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +8 -8
  505. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
  506. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  507. package/app/.next-cli-build/server/app/dashboard/token-saver.html +2 -2
  508. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +8 -8
  509. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +8 -8
  510. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +8 -8
  511. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  512. package/app/.next-cli-build/server/app/dashboard/translator.html +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
  514. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +8 -8
  515. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
  516. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  517. package/app/.next-cli-build/server/app/dashboard/usage.html +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
  519. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +8 -8
  520. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
  521. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  522. package/app/.next-cli-build/server/app/dashboard.html +2 -2
  523. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  524. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +8 -8
  525. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  526. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  527. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  528. package/app/.next-cli-build/server/app/index.html +1 -1
  529. package/app/.next-cli-build/server/app/index.rsc +6 -6
  530. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +6 -6
  531. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  532. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  534. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  535. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  536. package/app/.next-cli-build/server/app/landing.html +2 -2
  537. package/app/.next-cli-build/server/app/landing.rsc +7 -7
  538. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +7 -7
  539. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +7 -7
  541. package/app/.next-cli-build/server/app/login/page.js +1 -1
  542. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  543. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  544. package/app/.next-cli-build/server/app/login.html +2 -2
  545. package/app/.next-cli-build/server/app/login.rsc +7 -7
  546. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  547. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +7 -7
  549. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  550. package/app/.next-cli-build/server/app/page.js +1 -1
  551. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  552. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  553. package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
  554. package/app/.next-cli-build/server/chunks/1329.js +1 -1
  555. package/app/.next-cli-build/server/chunks/1351.js +1 -0
  556. package/app/.next-cli-build/server/chunks/1622.js +1 -0
  557. package/app/.next-cli-build/server/chunks/1806.js +1 -1
  558. package/app/.next-cli-build/server/chunks/1819.js +1 -1
  559. package/app/.next-cli-build/server/chunks/1884.js +1 -1
  560. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  561. package/app/.next-cli-build/server/chunks/2380.js +21 -0
  562. package/app/.next-cli-build/server/chunks/2557.js +1 -1
  563. package/app/.next-cli-build/server/chunks/318.js +7 -8
  564. package/app/.next-cli-build/server/chunks/{5625.js → 3389.js} +1 -1
  565. package/app/.next-cli-build/server/chunks/3500.js +2 -2
  566. package/app/.next-cli-build/server/chunks/3662.js +1 -1
  567. package/app/.next-cli-build/server/chunks/3792.js +1 -1
  568. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  569. package/app/.next-cli-build/server/chunks/3962.js +1 -1
  570. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  571. package/app/.next-cli-build/server/chunks/4575.js +1 -1
  572. package/app/.next-cli-build/server/chunks/4692.js +1 -1
  573. package/app/.next-cli-build/server/chunks/4775.js +1 -1
  574. package/app/.next-cli-build/server/chunks/4906.js +1 -1
  575. package/app/.next-cli-build/server/chunks/4927.js +3 -3
  576. package/app/.next-cli-build/server/chunks/5210.js +27 -28
  577. package/app/.next-cli-build/server/chunks/539.js +1 -1
  578. package/app/.next-cli-build/server/chunks/5527.js +1 -1
  579. package/app/.next-cli-build/server/chunks/5598.js +1 -1
  580. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  581. package/app/.next-cli-build/server/chunks/5663.js +1 -1
  582. package/app/.next-cli-build/server/chunks/5757.js +1 -1
  583. package/app/.next-cli-build/server/chunks/5781.js +2 -2
  584. package/app/.next-cli-build/server/chunks/5837.js +1 -0
  585. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  586. package/app/.next-cli-build/server/chunks/615.js +1 -1
  587. package/app/.next-cli-build/server/chunks/6212.js +1 -0
  588. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  589. package/app/.next-cli-build/server/chunks/6326.js +1 -1
  590. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  591. package/app/.next-cli-build/server/chunks/6790.js +1 -1
  592. package/app/.next-cli-build/server/chunks/6956.js +1 -1
  593. package/app/.next-cli-build/server/chunks/6960.js +1 -1
  594. package/app/.next-cli-build/server/chunks/7067.js +1 -1
  595. package/app/.next-cli-build/server/chunks/7122.js +1 -1
  596. package/app/.next-cli-build/server/chunks/7209.js +1 -0
  597. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  598. package/app/.next-cli-build/server/chunks/7274.js +1 -1
  599. package/app/.next-cli-build/server/chunks/7729.js +1 -1
  600. package/app/.next-cli-build/server/chunks/8145.js +1 -1
  601. package/app/.next-cli-build/server/chunks/8172.js +2 -2
  602. package/app/.next-cli-build/server/chunks/8318.js +1 -1
  603. package/app/.next-cli-build/server/chunks/8439.js +1 -1
  604. package/app/.next-cli-build/server/chunks/8595.js +1 -1
  605. package/app/.next-cli-build/server/chunks/8775.js +1 -1
  606. package/app/.next-cli-build/server/chunks/8895.js +6 -6
  607. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  608. package/app/.next-cli-build/server/chunks/8936.js +1 -0
  609. package/app/.next-cli-build/server/chunks/9154.js +1 -1
  610. package/app/.next-cli-build/server/chunks/9489.js +3 -3
  611. package/app/.next-cli-build/server/chunks/9536.js +1 -0
  612. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  613. package/app/.next-cli-build/server/chunks/9628.js +1 -1
  614. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  615. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  616. package/app/.next-cli-build/server/middleware.js +5 -5
  617. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  618. package/app/.next-cli-build/server/pages/404.html +2 -2
  619. package/app/.next-cli-build/server/pages/500.html +1 -1
  620. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  621. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  622. package/app/.next-cli-build/static/chunks/1321-3d22643da5d0f152.js +1 -0
  623. package/app/.next-cli-build/static/chunks/5497-ce4781ece1a27ac0.js +7 -0
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-a2f5c1fa12df475b.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-6db03f8140121a40.js → page-6393f6dfae0de3e6.js} +13 -13
  626. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9c29e4e5c17e55ea.js +14 -0
  627. package/app/.next-cli-build/static/chunks/app/landing/page-626d89125b768dcf.js +1 -0
  628. package/app/.next-cli-build/static/css/5922b1ff9e56869d.css +1 -0
  629. package/app/package.json +1 -1
  630. package/app/public/i18n/changelog/en.md +548 -513
  631. package/app/public/i18n/changelog/zh-CN.md +546 -511
  632. package/app/public/i18n/changelog/zh-TW.md +548 -513
  633. package/app/public/i18n/literals/zh-CN.json +2129 -2107
  634. package/app/public/i18n/literals/zh-TW.json +1 -0
  635. package/app/public/providers/oxion.png +0 -0
  636. package/app/public/providers/uc-web.png +0 -0
  637. package/app/public/providers/veoaifree-web.png +0 -0
  638. package/package.json +1 -1
  639. package/app/.next-cli-build/server/chunks/2154.js +0 -1
  640. package/app/.next-cli-build/server/chunks/3267.js +0 -1
  641. package/app/.next-cli-build/server/chunks/4386.js +0 -1
  642. package/app/.next-cli-build/server/chunks/6756.js +0 -1
  643. package/app/.next-cli-build/server/chunks/75.js +0 -1
  644. package/app/.next-cli-build/server/chunks/8499.js +0 -21
  645. package/app/.next-cli-build/static/chunks/1321-77ba328dd4d69fdb.js +0 -1
  646. package/app/.next-cli-build/static/chunks/5497-ec8a6308121a2b70.js +0 -7
  647. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-8f6aadfc8bf2eb7b.js +0 -1
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a6b07fa9d0712cee.js +0 -14
  649. package/app/.next-cli-build/static/chunks/app/landing/page-c6c3a32dd06bc907.js +0 -1
  650. package/app/.next-cli-build/static/css/17275fac82e1641e.css +0 -1
  651. /package/app/.next-cli-build/static/{1q0xTGDYtD52dGw4uiY4- → KyW2U59Ruq5vPQZjvyylc}/_buildManifest.js +0 -0
  652. /package/app/.next-cli-build/static/{1q0xTGDYtD52dGw4uiY4- → KyW2U59Ruq5vPQZjvyylc}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=8920,exports.ids=[8920],exports.modules={58920:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>g,calculateCostFromTokens:()=>k,getPricingForModel:()=>j,matchPattern:()=>i});let d=["cline-free/"],e={input:0,output:0,cached:0,reasoning:0,cache_creation:0},f={"claude-opus-5-5":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-thinking":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-high":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-medium":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-low":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-5-5":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-thinking":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-high":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-medium":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-low":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-fable-5":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5-mini":{input:.25,output:2,cached:.125,reasoning:2,cache_creation:.25},"gpt-5-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.2-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.6":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-luna":{input:1,output:6,cached:.1,reasoning:6,cache_creation:1},"gpt-5.6-terra":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-sol":{input:5,output:30,cached:.5,reasoning:30,cache_creation:5},"gpt-6-astra":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"gpt-6.1-sol":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"gpt-6-sol":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"gpt-6-luna":{input:.1,output:.5,cached:.01,reasoning:.5,cache_creation:.125},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-4-argon":{input:2,output:10},"gemini-3.8-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.375},"gemini-3.5-flash-high":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3.8-max":{input:2,output:6,cached:.2,reasoning:6,cache_creation:2.5},"qwen3.8-max-0902":{input:2,output:6,cached:.2,reasoning:6,cache_creation:2.5},"qwen3.7-max":{input:2.5,output:7.5,cached:.25,reasoning:7.5,cache_creation:3.13},"qwen3.7-max-2026-05-20":{input:2.5,output:7.5,cached:.25,reasoning:7.5,cache_creation:3.13},"qwen3.7-plus":{input:.4,output:1.6,cached:.04,reasoning:1.6,cache_creation:.5},"qwen3.6-plus":{input:.5,output:3,cached:.05,reasoning:3,cache_creation:.63},"qwen3.5-plus":{input:.4,output:2.4,cached:.04,reasoning:2.4,cache_creation:.5},"qwen-plus":{input:.4,output:1.2,cached:.04,reasoning:4,cache_creation:.5},"qwen3.8-flash":{input:.15,output:.47,cached:.015,reasoning:.47,cache_creation:.19},"qwen3.6-flash":{input:.25,output:1.5,cached:.025,reasoning:1.5,cache_creation:.31},"qwen3.5-flash":{input:.1,output:.4,cached:.01,reasoning:.4,cache_creation:.13},"qwen-flash":{input:.05,output:.4,cached:.005,reasoning:.4,cache_creation:.06},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k3":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},k3:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},"kimi-k2.7-code":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-k2.7-code-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"kimi-for-coding":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-for-coding-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-k2.6":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"deepseek-flash":{input:.15,output:.6,cached:.003,reasoning:.6,cache_creation:.15},"deepseek-v4-flash-vision-exp":{input:.15,output:.6,cached:.003,reasoning:.6,cache_creation:.15},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3.1-Flash":{input:.15,output:.6,cached:.015,reasoning:.9,cache_creation:.15},"minimax-m3.1-flash":{input:.15,output:.6,cached:.015,reasoning:.9,cache_creation:.15},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"muse-spark-1.3":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.2":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.1":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.3-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},"muse-spark-1.2-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},"mimo-v2.6-pro":{input:.435,output:.87,cached:.0036,reasoning:.87},"mimo-v2.6-pro-claude":{input:.435,output:.87,cached:.0036,reasoning:.87},"mimo-v2.6-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"mimo-v2.6-pro-ultraspeed":{input:4.35,output:8.7,cached:.036,reasoning:8.7},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},g={deepseek:{"deepseek-v4-flash":{input:.15,output:.6,cached:.003,reasoning:.6},"deepseek-v4-pro":{input:.66,output:1.98,cached:.022,reasoning:1.98},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28}},gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},"siliconflow-cn":{"deepseek-ai/DeepSeek-V3.2":{input:.56,output:.85,cached:.06,reasoning:.85},"deepseek-ai/DeepSeek-V4-Pro":{input:1.68,output:3.36,cached:.14,reasoning:3.36},"deepseek-ai/DeepSeek-V4-Flash":{input:.21,output:.63,cached:.02,reasoning:.63},"moonshotai/Kimi-K2.6":{input:.91,output:3.78,cached:.15,reasoning:3.78}},inception:{"mercury-3":{input:.1,output:.35,cached:.01,reasoning:.35},"mercury-2.5":{input:.2,output:.75,cached:.02,reasoning:.75}},tokenrouter:{"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.2},"anthropic/claude-fable-5":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-haiku-4.5":{input:1,output:5,cached:.1,cache_creation:1.25,reasoning:5},"anthropic/claude-opus-4.5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.6":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7-fast":{input:30,output:150,cached:3,reasoning:150},"anthropic/claude-opus-4.8":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.8-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-opus-5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-5-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-sonnet-4":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.5":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.6":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"claude-opus-4-8-m-aws":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"deepseek/deepseek-v3.2":{input:.26,output:.38,cached:.13,reasoning:.38},"deepseek/deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-flash-0731":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87},"ex/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"google/gemini-2.5-flash-image":{input:.3,output:2.5,reasoning:2.5},"google/gemini-3-flash-preview":{input:.5,output:3,cached:.05,cache_creation:.08333,reasoning:3},"google/gemini-3-pro-image-preview":{input:2,output:12,reasoning:12},"google/gemini-3.1-flash-image-preview":{input:.5,output:3,reasoning:3},"google/gemini-3.1-flash-lite-image":{input:.25,output:1.5,reasoning:1.5},"google/gemini-3.1-pro-preview":{input:2,output:12,cached:.2,cache_creation:.375,reasoning:12},"google/gemini-3.5-flash":{input:1.5,output:9,cached:.15,cache_creation:.08333,reasoning:9},"google/gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,cache_creation:.08333,reasoning:2.5},"google/gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,cache_creation:.08333,reasoning:7.5},"google/gemini-embedding-2":{input:1,output:6,cached:.1,reasoning:6},"google/gemma-4-26b-a4b-it":{input:.06,output:.33,reasoning:.33},"kling-3.0-turbo":{input:2.1,output:2.1,reasoning:2.1},"microsoft/mai-image-2.5":{input:5,output:47,reasoning:47},"minimax/minimax-m2-her":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m2.5":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.7":{input:.3,output:1.2,cached:.06,reasoning:1.2},"minimax/minimax-m2.7-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m3.1-flash":{input:.15,output:.6,cached:.015,reasoning:.6},"minimax/minimax-m3.1-flash:free":{input:.15,output:.6,cached:.015,reasoning:.6},"miromind/mirothinker-1-7-deepresearch":{input:4,output:25,reasoning:25},"miromind/mirothinker-1-7-deepresearch-mini":{input:1.25,output:10,reasoning:10},"mistralai/devstral-2512":{input:.4,output:2,cached:.04,reasoning:2},"mistralai/mistral-medium-3-5":{input:1.5,output:7.5,reasoning:7.5},"mistralai/mistral-small-2603":{input:.15,output:.6,cached:.015,reasoning:.6},"mistralai/voxtral-small-24b-2507":{input:.1,output:.3,cached:.01,reasoning:.3},"moonshotai/kimi-k2.5":{input:.6,output:3,cached:.1,reasoning:3},"moonshotai/kimi-k2.6":{input:.95,output:4,cached:.16,reasoning:4},"moonshotai/kimi-k2.7-code":{input:.9286,output:3.8571,cached:.1857,reasoning:3.8571},"moonshotai/kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"nvidia/nemotron-3-super-120b-a12b":{input:.3,output:.9,cached:.1,reasoning:.9},"openai/gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.6},"openai/gpt-5":{input:1.25,output:10,cached:.125,reasoning:10},"openai/gpt-5-image":{input:10,output:40,cached:2.5,reasoning:40},"openai/gpt-5-image-mini":{input:2.5,output:8,cached:.25,reasoning:8},"openai/gpt-5-mini":{input:.25,output:2,cached:.025,reasoning:2},"openai/gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"openai/gpt-5.4-image-2":{input:8,output:30,cached:2,reasoning:30},"openai/gpt-5.4-mini":{input:.75,output:4.5,cached:.075,reasoning:4.5},"openai/gpt-5.4-nano":{input:.2,output:1.25,cached:.02,reasoning:1.25},"openai/gpt-5.4-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.5":{input:5,output:30,cached:.5,reasoning:30},"openai/gpt-5.5-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.6-luna":{input:.2,output:1.2,cached:.02,cache_creation:.25,reasoning:1.2},"openai/gpt-5.6-sol":{input:5,output:30,cached:.5,cache_creation:6.25,reasoning:30},"openai/gpt-5.6-terra":{input:2,output:12,cached:.2,cache_creation:2.5,reasoning:12},"openai/gpt-audio":{input:2.5,output:10,reasoning:10},"openai/gpt-audio-mini":{input:.6,output:2.4,reasoning:2.4},"openai/gpt-oss-120b":{input:.039,output:.18,reasoning:.18},"qwen/qwen3-coder-next":{input:.12,output:.75,cached:.06,reasoning:.75},"qwen/qwen3.5-122b-a10b":{input:.26,output:2.08,reasoning:2.08},"qwen/qwen3.5-35b-a3b":{input:.1625,output:1.3,reasoning:1.3},"qwen/qwen3.5-397b-a17b":{input:.39,output:2.34,reasoning:2.34},"qwen/qwen3.5-9b":{input:.1,output:.15,reasoning:.15},"qwen/qwen3.5-flash":{input:.1048,output:.4194,reasoning:.4194},"qwen/qwen3.5-plus-02-15":{input:.26,output:1.56,reasoning:1.56},"qwen/qwen3.6-plus":{input:.54,output:3.21,reasoning:3.21},"qwen/qwen3.7-max":{input:1.25,output:3.75,cached:.25,reasoning:3.75},"qwen/qwen3.7-plus":{input:.4,output:1.6,cached:.08,reasoning:1.6},"qwen/qwen3.8-max":{input:2,output:6,cached:.25,cache_creation:2.5,reasoning:6},"qwen3.5-omni-plus":{input:1,output:5.7143,reasoning:5.7143},"qwen3.6-flash":{input:.171,output:1.029,cached:.017,cache_creation:.214,reasoning:1.029},"sakana/fugu-ultra":{input:5,output:30,cached:.5,reasoning:30},"seed-2-0-code-preview-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"seed-2-0-lite-260428":{input:.5,output:4,cached:.1,cache_creation:.008333,reasoning:4},"seed-2-0-mini-260428":{input:.2,output:.8,cached:.04,cache_creation:.00833,reasoning:.8},"seed-2-0-pro-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"stepfun/step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"stepfun/step-3.7-flash":{input:.2,output:1.15,cached:.04,reasoning:1.15},"tencent/hy3-preview":{input:.066,output:.26,cached:.029,reasoning:.26},"tencent/hy4-preview":{input:.834,output:2.501,cached:.042,reasoning:2.501},"x-ai/grok-4.1-fast":{input:.2,output:.5,cached:.05,reasoning:.5},"x-ai/grok-4.20-beta":{input:2,output:6,cached:.2,reasoning:6},"x-ai/grok-4.3":{input:1.25,output:2.5,cached:.2,reasoning:2.5},"x-ai/grok-4.5":{input:2,output:6,cached:.5,reasoning:6},"x-ai/grok-build-0.1":{input:1,output:2,cached:.2,reasoning:2},"xiaomi/mimo-v2-flash":{input:.1,output:.3,cached:.01,reasoning:.3},"xiaomi/mimo-v2-omni":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2-pro":{input:1,output:3,cached:.2,reasoning:3},"xiaomi/mimo-v2.5":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2.5-pro":{input:1,output:3,cached:.2,reasoning:3},"z-ai/glm-4.5-air":{input:.13,output:.85,cached:.025,reasoning:.85},"z-ai/glm-4.6":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-4.6v":{input:.3,output:.9,reasoning:.9},"z-ai/glm-4.7":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"z-ai/glm-5-turbo":{input:1.2,output:4,cached:.24,reasoning:4},"z-ai/glm-5.1":{input:1.05,output:3.5,cached:.525,reasoning:3.5},"z-ai/glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4}},cohere:{"command-a-03-2025":{input:2.5,output:10,reasoning:10},"command-r-plus-08-2024":{input:2.5,output:10,reasoning:10},"command-r-08-2024":{input:.15,output:.6,reasoning:.6}},groq:{"llama-3.3-70b-versatile":{input:.59,output:.79,reasoning:.79},"openai/gpt-oss-120b":{input:.15,output:.6,cached:.075,reasoning:.6}},mistral:{"mistral-large-latest":{input:.5,output:1.5,cached:.05,reasoning:1.5},"codestral-latest":{input:.3,output:.9,cached:.03,reasoning:.9},"mistral-medium-latest":{input:1.5,output:7.5,cached:.15,reasoning:7.5}},morph:{"morph-v3-large":{input:.9,output:1.9,reasoning:1.9},"morph-v3-fast":{input:.8,output:1.2,reasoning:1.2}},perplexity:{sonar:{input:1,output:1,reasoning:1},"sonar-pro":{input:3,output:15,reasoning:15}},"perplexity-agent":{"perplexity/sonar":{input:.25,output:2.5,cached:.0625,reasoning:2.5},"nvidia/nemotron-3-super-120b-a12b":{input:.25,output:2.5,reasoning:2.5}},siliconflow:{"openai/gpt-oss-120b":{input:.05,output:.45,reasoning:.45},"inclusionAI/Ling-flash-2.0":{input:.14,output:.57,reasoning:.57}},stepfun:{"step-5-preview":{input:.959,output:2.741,cached:.048,reasoning:2.741},"step-3.7-flash":{input:.185,output:1.11,cached:.037,reasoning:1.11},"step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"step-3.5-flash-2603":{input:.1,output:.3,cached:.02,reasoning:.3}},"stepfun-cn":{"step-5-preview":{input:1,output:2.7,cached:.05,reasoning:2.7},"step-3.7-flash":{input:.185,output:1.11,cached:.037,reasoning:1.11},"step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"step-3.5-flash-2603":{input:.1,output:.3,cached:.02,reasoning:.3}},venice:{"venice-uncensored-1-2":{input:.2,output:.9,reasoning:.9},"zai-org-glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"llama-3.3-70b":{input:.7,output:2.8,reasoning:2.8},"hermes-3-llama-3.1-405b":{input:1.1,output:3,reasoning:3},"mistral-small-3-2-24b-instruct":{input:.09375,output:.25,reasoning:.25}},cerebras:{"gpt-oss-120b":{input:.35,output:.75,reasoning:.75}},openai:{o3:{input:2,output:8,cached:.5,reasoning:8}},longcat:{"LongCat-2.0":{input:.75,output:2.95,cached:.015,reasoning:2.95},"LongCat-2.5-Preview":{input:.75,output:2.95,cached:.015,reasoning:2.95}},"longcat-intl":{"LongCat-2.0":{input:.75,output:2.95,cached:.015,reasoning:2.95},"LongCat-2.5-Preview":{input:.75,output:2.95,cached:.015,reasoning:2.95}}},h=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-none",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.6-*",pricing:{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-5.3-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.2-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.1-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k3*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function i(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function j(a,b){if(!b)return null;if(a&&g[a]?.[b])return g[a][b];if(function(a){if(!a)return!1;let b=String(a).toLowerCase();return d.some(a=>b.startsWith(a))}(b))return e;let c=b.includes("/")?b.split("/").pop():b;if(f[c])return f[c];if(f[b])return f[b];for(let{pattern:a,pricing:d}of h)if(i(a,c)||i(a,b))return d;return null}function k(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}}};
1
+ "use strict";exports.id=8920,exports.ids=[8920],exports.modules={58920:(a,b,c)=>{c.d(b,{PROVIDER_PRICING:()=>g,calculateCostFromTokens:()=>k,getPricingForModel:()=>j,matchPattern:()=>i});let d=["cline-free/"],e={input:0,output:0,cached:0,reasoning:0,cache_creation:0},f={"claude-opus-5-5":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-thinking":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-high":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-medium":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-5-5-low":{input:4,output:20,cached:.2,reasoning:20,cache_creation:5},"claude-opus-4-6":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-opus-4-5-20251101":{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25},"claude-sonnet-5-5":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-thinking":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-high":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-medium":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-5-5-low":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"claude-sonnet-4-6":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-sonnet-4-5-20250929":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75},"claude-haiku-4-5-20251001":{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25},"claude-sonnet-4-20250514":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-opus-4-20250514":{input:15,output:25,cached:7.5,reasoning:112.5,cache_creation:15},"claude-3-5-sonnet-20241022":{input:3,output:15,cached:1.5,reasoning:15,cache_creation:3},"claude-haiku-4.5":{input:.5,output:2.5,cached:.05,reasoning:3.75,cache_creation:.5},"claude-opus-4.1":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.5":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4.6":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-sonnet-4":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.5":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-sonnet-4.6":{input:3,output:15,cached:.3,reasoning:22.5,cache_creation:3},"claude-opus-4-5-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-opus-4-6-thinking":{input:5,output:25,cached:.5,reasoning:37.5,cache_creation:5},"claude-fable-5":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"gpt-3.5-turbo":{input:.5,output:1.5,cached:.25,reasoning:2.25,cache_creation:.5},"gpt-4":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4-turbo":{input:10,output:30,cached:5,reasoning:45,cache_creation:10},"gpt-4o":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15},"gpt-4.1":{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5},"gpt-5":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5-mini":{input:.25,output:2,cached:.125,reasoning:2,cache_creation:.25},"gpt-5-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex":{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25},"gpt-5.1-codex-mini":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"gpt-5.1-codex-mini-high":{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"gpt-5.1-codex-max":{input:8,output:32,cached:4,reasoning:48,cache_creation:8},"gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.2-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75},"gpt-5.3-codex-spark":{input:3,output:12,cached:.3,reasoning:12,cache_creation:3},"gpt-5.6":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-luna":{input:1,output:6,cached:.1,reasoning:6,cache_creation:1},"gpt-5.6-terra":{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5},"gpt-5.6-sol":{input:5,output:30,cached:.5,reasoning:30,cache_creation:5},"gpt-6-astra":{input:10,output:50,cached:1,reasoning:50,cache_creation:12.5},"gpt-6.1-sol":{input:2,output:10,cached:.1,reasoning:10,cache_creation:2.5},"gpt-6-sol":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2.5},"gpt-6-luna":{input:.1,output:.5,cached:.01,reasoning:.5,cache_creation:.125},o1:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15},"o1-mini":{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3},"gemini-4-argon":{input:2,output:10},"gemini-3.8-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.8-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.7-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-high":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-medium":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.6-flash-low":{input:1.5,output:7.5,cached:.15,reasoning:11.25,cache_creation:1.875},"gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.375},"gemini-3.5-flash-high":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash-preview":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-pro-preview":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-low":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-3.1-pro-high":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-pro-agent":{input:4,output:18,cached:.5,reasoning:27,cache_creation:4},"gemini-3-flash-agent":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3.5-flash-extra-low":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-3-flash":{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5},"gemini-2.5-pro":{input:2,output:12,cached:.25,reasoning:18,cache_creation:2},"gemini-2.5-flash":{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3},"gemini-2.5-flash-lite":{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15},"qwen3.8-max":{input:2,output:6,cached:.2,reasoning:6,cache_creation:2.5},"qwen3.8-max-0902":{input:2,output:6,cached:.2,reasoning:6,cache_creation:2.5},"qwen3.7-max":{input:2.5,output:7.5,cached:.25,reasoning:7.5,cache_creation:3.13},"qwen3.7-max-2026-05-20":{input:2.5,output:7.5,cached:.25,reasoning:7.5,cache_creation:3.13},"qwen3.7-plus":{input:.4,output:1.6,cached:.04,reasoning:1.6,cache_creation:.5},"qwen3.6-plus":{input:.5,output:3,cached:.05,reasoning:3,cache_creation:.63},"qwen3.5-plus":{input:.4,output:2.4,cached:.04,reasoning:2.4,cache_creation:.5},"qwen-plus":{input:.4,output:1.2,cached:.04,reasoning:4,cache_creation:.5},"qwen3.8-flash":{input:.15,output:.47,cached:.015,reasoning:.47,cache_creation:.19},"qwen3.6-flash":{input:.25,output:1.5,cached:.025,reasoning:1.5,cache_creation:.31},"qwen3.5-flash":{input:.1,output:.4,cached:.01,reasoning:.4,cache_creation:.13},"qwen-flash":{input:.05,output:.4,cached:.005,reasoning:.4,cache_creation:.06},"qwen3-coder-plus":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"qwen3-coder-flash":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"kimi-k3":{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},k3:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3},"kimi-k3.1-pro":{input:2,output:10,cached:.2,reasoning:10,cache_creation:2},"kimi-k2.7-code":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-k2.7-code-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"kimi-for-coding":{input:.95,output:4,cached:.19,reasoning:4,cache_creation:.95},"kimi-for-coding-highspeed":{input:1.9,output:8,cached:.38,reasoning:8,cache_creation:1.9},"kimi-k2":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-k2-thinking":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"kimi-k2.5":{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2},"kimi-k2.5-thinking":{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8},"kimi-k2.6":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"kimi-latest":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-r1":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-chat":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v3.2-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14},"deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87,cache_creation:.435},"deepseek-flash":{input:.15,output:.6,cached:.003,reasoning:.6,cache_creation:.15},"deepseek-v4-flash-vision-exp":{input:.15,output:.6,cached:.003,reasoning:.6,cache_creation:.15},"glm-4.6":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"glm-4.6v":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-4.7":{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75},"glm-5":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"MiniMax-M3.1-Flash":{input:.15,output:.6,cached:.015,reasoning:.9,cache_creation:.15},"minimax-m3.1-flash":{input:.15,output:.6,cached:.015,reasoning:.9,cache_creation:.15},"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.8,cache_creation:.3},"MiniMax-M2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.5":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"MiniMax-M2.7":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"minimax-m2.5":{input:.6,output:2.4,cached:.3,reasoning:3.6,cache_creation:.6},"grok-code-fast-1":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"muse-spark-1.3":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.2":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.1":{input:1.25,output:4.25,cached:.15,reasoning:4.25,cache_creation:0},"muse-spark-1.3-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},"muse-spark-1.2-contributor":{input:.1,output:.2,cached:.002,reasoning:.2,cache_creation:0},"mimo-v2.6-pro":{input:.435,output:.87,cached:.0036,reasoning:.87},"mimo-v2.6-pro-claude":{input:.435,output:.87,cached:.0036,reasoning:.87},"mimo-v2.6-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"mimo-v2.6-pro-ultraspeed":{input:4.35,output:8.7,cached:.036,reasoning:8.7},auto:{input:2,output:8,cached:1,reasoning:12,cache_creation:2},"oswe-vscode-prime":{input:1,output:4,cached:.5,reasoning:6,cache_creation:1},"gpt-oss-120b-medium":{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5},"vision-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5},"coder-model":{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},g={deepseek:{"deepseek-v4-flash":{input:.15,output:.6,cached:.003,reasoning:.6},"deepseek-v4-pro":{input:.66,output:1.98,cached:.022,reasoning:1.98},"deepseek-chat":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek-reasoner":{input:.14,output:.28,cached:.0028,reasoning:.28}},gh:{"gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},"siliconflow-cn":{"deepseek-ai/DeepSeek-V3.2":{input:.56,output:.85,cached:.06,reasoning:.85},"deepseek-ai/DeepSeek-V4-Pro":{input:1.68,output:3.36,cached:.14,reasoning:3.36},"deepseek-ai/DeepSeek-V4-Flash":{input:.21,output:.63,cached:.02,reasoning:.63},"moonshotai/Kimi-K2.6":{input:.91,output:3.78,cached:.15,reasoning:3.78}},inception:{"mercury-3":{input:.1,output:.35,cached:.01,reasoning:.35},"mercury-2.5":{input:.2,output:.75,cached:.02,reasoning:.75}},tokenrouter:{"MiniMax-M3":{input:.3,output:1.2,cached:.06,reasoning:1.2},"anthropic/claude-fable-5":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-haiku-4.5":{input:1,output:5,cached:.1,cache_creation:1.25,reasoning:5},"anthropic/claude-opus-4.5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.6":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.7-fast":{input:30,output:150,cached:3,reasoning:150},"anthropic/claude-opus-4.8":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-4.8-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-opus-5":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"anthropic/claude-opus-5-fast":{input:10,output:50,cached:1,cache_creation:12.5,reasoning:50},"anthropic/claude-sonnet-4":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.5":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-4.6":{input:3,output:15,cached:.3,cache_creation:3.75,reasoning:15},"anthropic/claude-sonnet-5":{input:2,output:10,cached:.2,reasoning:10},"claude-opus-4-8-m-aws":{input:5,output:25,cached:.5,cache_creation:6.25,reasoning:25},"deepseek/deepseek-v3.2":{input:.26,output:.38,cached:.13,reasoning:.38},"deepseek/deepseek-v4-flash":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-flash-0731":{input:.14,output:.28,cached:.0028,reasoning:.28},"deepseek/deepseek-v4-pro":{input:.435,output:.87,cached:.003625,reasoning:.87},"ex/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"google/gemini-2.5-flash-image":{input:.3,output:2.5,reasoning:2.5},"google/gemini-3-flash-preview":{input:.5,output:3,cached:.05,cache_creation:.08333,reasoning:3},"google/gemini-3-pro-image-preview":{input:2,output:12,reasoning:12},"google/gemini-3.1-flash-image-preview":{input:.5,output:3,reasoning:3},"google/gemini-3.1-flash-lite-image":{input:.25,output:1.5,reasoning:1.5},"google/gemini-3.1-pro-preview":{input:2,output:12,cached:.2,cache_creation:.375,reasoning:12},"google/gemini-3.5-flash":{input:1.5,output:9,cached:.15,cache_creation:.08333,reasoning:9},"google/gemini-3.5-flash-lite":{input:.3,output:2.5,cached:.03,cache_creation:.08333,reasoning:2.5},"google/gemini-3.6-flash":{input:1.5,output:7.5,cached:.15,cache_creation:.08333,reasoning:7.5},"google/gemini-embedding-2":{input:1,output:6,cached:.1,reasoning:6},"google/gemma-4-26b-a4b-it":{input:.06,output:.33,reasoning:.33},"kling-3.0-turbo":{input:2.1,output:2.1,reasoning:2.1},"microsoft/mai-image-2.5":{input:5,output:47,reasoning:47},"minimax/minimax-m2-her":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.1-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m2.5":{input:.3,output:1.2,cached:.03,reasoning:1.2},"minimax/minimax-m2.7":{input:.3,output:1.2,cached:.06,reasoning:1.2},"minimax/minimax-m2.7-highspeed":{input:.6,output:2.4,cached:.06,reasoning:2.4},"minimax/minimax-m3.1-flash":{input:.15,output:.6,cached:.015,reasoning:.6},"minimax/minimax-m3.1-flash:free":{input:.15,output:.6,cached:.015,reasoning:.6},"miromind/mirothinker-1-7-deepresearch":{input:4,output:25,reasoning:25},"miromind/mirothinker-1-7-deepresearch-mini":{input:1.25,output:10,reasoning:10},"mistralai/devstral-2512":{input:.4,output:2,cached:.04,reasoning:2},"mistralai/mistral-medium-3-5":{input:1.5,output:7.5,reasoning:7.5},"mistralai/mistral-small-2603":{input:.15,output:.6,cached:.015,reasoning:.6},"mistralai/voxtral-small-24b-2507":{input:.1,output:.3,cached:.01,reasoning:.3},"moonshotai/kimi-k2.5":{input:.6,output:3,cached:.1,reasoning:3},"moonshotai/kimi-k2.6":{input:.95,output:4,cached:.16,reasoning:4},"moonshotai/kimi-k2.7-code":{input:.9286,output:3.8571,cached:.1857,reasoning:3.8571},"moonshotai/kimi-k3":{input:3,output:15,cached:.3,reasoning:15},"nvidia/nemotron-3-super-120b-a12b":{input:.3,output:.9,cached:.1,reasoning:.9},"openai/gpt-4o-mini":{input:.15,output:.6,cached:.075,reasoning:.6},"openai/gpt-5":{input:1.25,output:10,cached:.125,reasoning:10},"openai/gpt-5-image":{input:10,output:40,cached:2.5,reasoning:40},"openai/gpt-5-image-mini":{input:2.5,output:8,cached:.25,reasoning:8},"openai/gpt-5-mini":{input:.25,output:2,cached:.025,reasoning:2},"openai/gpt-5.2":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.3-codex":{input:1.75,output:14,cached:.175,reasoning:14},"openai/gpt-5.4":{input:2.5,output:15,cached:.25,reasoning:15},"openai/gpt-5.4-image-2":{input:8,output:30,cached:2,reasoning:30},"openai/gpt-5.4-mini":{input:.75,output:4.5,cached:.075,reasoning:4.5},"openai/gpt-5.4-nano":{input:.2,output:1.25,cached:.02,reasoning:1.25},"openai/gpt-5.4-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.5":{input:5,output:30,cached:.5,reasoning:30},"openai/gpt-5.5-pro":{input:30,output:180,reasoning:180},"openai/gpt-5.6-luna":{input:.2,output:1.2,cached:.02,cache_creation:.25,reasoning:1.2},"openai/gpt-5.6-sol":{input:5,output:30,cached:.5,cache_creation:6.25,reasoning:30},"openai/gpt-5.6-terra":{input:2,output:12,cached:.2,cache_creation:2.5,reasoning:12},"openai/gpt-audio":{input:2.5,output:10,reasoning:10},"openai/gpt-audio-mini":{input:.6,output:2.4,reasoning:2.4},"openai/gpt-oss-120b":{input:.039,output:.18,reasoning:.18},"qwen/qwen3-coder-next":{input:.12,output:.75,cached:.06,reasoning:.75},"qwen/qwen3.5-122b-a10b":{input:.26,output:2.08,reasoning:2.08},"qwen/qwen3.5-35b-a3b":{input:.1625,output:1.3,reasoning:1.3},"qwen/qwen3.5-397b-a17b":{input:.39,output:2.34,reasoning:2.34},"qwen/qwen3.5-9b":{input:.1,output:.15,reasoning:.15},"qwen/qwen3.5-flash":{input:.1048,output:.4194,reasoning:.4194},"qwen/qwen3.5-plus-02-15":{input:.26,output:1.56,reasoning:1.56},"qwen/qwen3.6-plus":{input:.54,output:3.21,reasoning:3.21},"qwen/qwen3.7-max":{input:1.25,output:3.75,cached:.25,reasoning:3.75},"qwen/qwen3.7-plus":{input:.4,output:1.6,cached:.08,reasoning:1.6},"qwen/qwen3.8-max":{input:2,output:6,cached:.25,cache_creation:2.5,reasoning:6},"qwen3.5-omni-plus":{input:1,output:5.7143,reasoning:5.7143},"qwen3.6-flash":{input:.171,output:1.029,cached:.017,cache_creation:.214,reasoning:1.029},"sakana/fugu-ultra":{input:5,output:30,cached:.5,reasoning:30},"seed-2-0-code-preview-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"seed-2-0-lite-260428":{input:.5,output:4,cached:.1,cache_creation:.008333,reasoning:4},"seed-2-0-mini-260428":{input:.2,output:.8,cached:.04,cache_creation:.00833,reasoning:.8},"seed-2-0-pro-260328":{input:1,output:6,cached:.2,cache_creation:.008333,reasoning:6},"stepfun/step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"stepfun/step-3.7-flash":{input:.2,output:1.15,cached:.04,reasoning:1.15},"tencent/hy3-preview":{input:.066,output:.26,cached:.029,reasoning:.26},"tencent/hy4-preview":{input:.834,output:2.501,cached:.042,reasoning:2.501},"x-ai/grok-4.1-fast":{input:.2,output:.5,cached:.05,reasoning:.5},"x-ai/grok-4.20-beta":{input:2,output:6,cached:.2,reasoning:6},"x-ai/grok-4.3":{input:1.25,output:2.5,cached:.2,reasoning:2.5},"x-ai/grok-4.5":{input:2,output:6,cached:.5,reasoning:6},"x-ai/grok-build-0.1":{input:1,output:2,cached:.2,reasoning:2},"xiaomi/mimo-v2-flash":{input:.1,output:.3,cached:.01,reasoning:.3},"xiaomi/mimo-v2-omni":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2-pro":{input:1,output:3,cached:.2,reasoning:3},"xiaomi/mimo-v2.5":{input:.4,output:2,cached:.08,reasoning:2},"xiaomi/mimo-v2.5-pro":{input:1,output:3,cached:.2,reasoning:3},"z-ai/glm-4.5-air":{input:.13,output:.85,cached:.025,reasoning:.85},"z-ai/glm-4.6":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-4.6v":{input:.3,output:.9,reasoning:.9},"z-ai/glm-4.7":{input:.6,output:2.2,cached:.11,reasoning:2.2},"z-ai/glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"z-ai/glm-5-turbo":{input:1.2,output:4,cached:.24,reasoning:4},"z-ai/glm-5.1":{input:1.05,output:3.5,cached:.525,reasoning:3.5},"z-ai/glm-5.2":{input:1.4,output:4.4,cached:.26,reasoning:4.4}},cohere:{"command-a-03-2025":{input:2.5,output:10,reasoning:10},"command-r-plus-08-2024":{input:2.5,output:10,reasoning:10},"command-r-08-2024":{input:.15,output:.6,reasoning:.6}},groq:{"llama-3.3-70b-versatile":{input:.59,output:.79,reasoning:.79},"openai/gpt-oss-120b":{input:.15,output:.6,cached:.075,reasoning:.6}},mistral:{"mistral-large-latest":{input:.5,output:1.5,cached:.05,reasoning:1.5},"codestral-latest":{input:.3,output:.9,cached:.03,reasoning:.9},"mistral-medium-latest":{input:1.5,output:7.5,cached:.15,reasoning:7.5}},morph:{"morph-v3-large":{input:.9,output:1.9,reasoning:1.9},"morph-v3-fast":{input:.8,output:1.2,reasoning:1.2}},perplexity:{sonar:{input:1,output:1,reasoning:1},"sonar-pro":{input:3,output:15,reasoning:15}},"perplexity-agent":{"perplexity/sonar":{input:.25,output:2.5,cached:.0625,reasoning:2.5},"nvidia/nemotron-3-super-120b-a12b":{input:.25,output:2.5,reasoning:2.5}},siliconflow:{"openai/gpt-oss-120b":{input:.05,output:.45,reasoning:.45},"inclusionAI/Ling-flash-2.0":{input:.14,output:.57,reasoning:.57}},stepfun:{"step-5-preview":{input:.959,output:2.741,cached:.048,reasoning:2.741},"step-3.7-flash":{input:.185,output:1.11,cached:.037,reasoning:1.11},"step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"step-3.5-flash-2603":{input:.1,output:.3,cached:.02,reasoning:.3}},"stepfun-cn":{"step-5-preview":{input:1,output:2.7,cached:.05,reasoning:2.7},"step-3.7-flash":{input:.185,output:1.11,cached:.037,reasoning:1.11},"step-3.5-flash":{input:.1,output:.3,cached:.02,reasoning:.3},"step-3.5-flash-2603":{input:.1,output:.3,cached:.02,reasoning:.3}},venice:{"venice-uncensored-1-2":{input:.2,output:.9,reasoning:.9},"zai-org-glm-5":{input:1,output:3.2,cached:.2,reasoning:3.2},"llama-3.3-70b":{input:.7,output:2.8,reasoning:2.8},"hermes-3-llama-3.1-405b":{input:1.1,output:3,reasoning:3},"mistral-small-3-2-24b-instruct":{input:.09375,output:.25,reasoning:.25}},cerebras:{"gpt-oss-120b":{input:.35,output:.75,reasoning:.75}},openai:{o3:{input:2,output:8,cached:.5,reasoning:8}},longcat:{"LongCat-2.0":{input:.75,output:2.95,cached:.015,reasoning:2.95},"LongCat-2.5-Preview":{input:.75,output:2.95,cached:.015,reasoning:2.95}},"longcat-intl":{"LongCat-2.0":{input:.75,output:2.95,cached:.015,reasoning:2.95},"LongCat-2.5-Preview":{input:.75,output:2.95,cached:.015,reasoning:2.95}}},h=[{pattern:"*-codex-xhigh",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"*-codex-high",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-max",pricing:{input:8,output:32,cached:4,reasoning:48,cache_creation:8}},{pattern:"*-codex-mini-*",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-mini",pricing:{input:1.5,output:6,cached:.75,reasoning:9,cache_creation:1.5}},{pattern:"*-codex-low",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-none",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex-spark",pricing:{input:3,output:12,cached:.3,reasoning:12,cache_creation:3}},{pattern:"codex-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"*-codex",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"claude-opus-*",pricing:{input:5,output:25,cached:.5,reasoning:25,cache_creation:6.25}},{pattern:"claude-sonnet-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"claude-haiku-*",pricing:{input:1,output:5,cached:.1,reasoning:5,cache_creation:1.25}},{pattern:"claude-*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3.75}},{pattern:"gemini-*-flash-lite",pricing:{input:.15,output:1.25,cached:.015,reasoning:1.875,cache_creation:.15}},{pattern:"gemini-*-flash",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*-pro",pricing:{input:2,output:12,cached:.25,reasoning:18,cache_creation:2}},{pattern:"gemini-3-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gemini-2.5-*",pricing:{input:.3,output:2.5,cached:.03,reasoning:3.75,cache_creation:.3}},{pattern:"gemini-*",pricing:{input:.5,output:3,cached:.03,reasoning:4.5,cache_creation:.5}},{pattern:"gpt-5.6-*",pricing:{input:2.5,output:15,cached:.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-5.3-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.2-*",pricing:{input:1.75,output:14,cached:.175,reasoning:14,cache_creation:1.75}},{pattern:"gpt-5.1-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5-*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-5*",pricing:{input:1.25,output:10,cached:.625,reasoning:10,cache_creation:1.25}},{pattern:"gpt-4o-*",pricing:{input:.15,output:.6,cached:.075,reasoning:.9,cache_creation:.15}},{pattern:"gpt-4o",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"gpt-4*",pricing:{input:2.5,output:10,cached:1.25,reasoning:15,cache_creation:2.5}},{pattern:"o1-*",pricing:{input:3,output:12,cached:1.5,reasoning:18,cache_creation:3}},{pattern:"o1",pricing:{input:15,output:60,cached:7.5,reasoning:90,cache_creation:15}},{pattern:"o3-*",pricing:{input:10,output:40,cached:5,reasoning:60,cache_creation:10}},{pattern:"o4-*",pricing:{input:2,output:8,cached:1,reasoning:12,cache_creation:2}},{pattern:"qwen3-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*-coder-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"qwen*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"kimi-*-thinking",pricing:{input:1.8,output:7.2,cached:.9,reasoning:10.8,cache_creation:1.8}},{pattern:"kimi-k3*",pricing:{input:3,output:15,cached:.3,reasoning:15,cache_creation:3}},{pattern:"kimi-k2*",pricing:{input:1.2,output:4.8,cached:.6,reasoning:7.2,cache_creation:1.2}},{pattern:"kimi-*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"deepseek-*reasoner*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-r*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-v*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"deepseek-*",pricing:{input:.14,output:.28,cached:.0028,reasoning:.28,cache_creation:.14}},{pattern:"glm-5*",pricing:{input:1,output:4,cached:.5,reasoning:6,cache_creation:1}},{pattern:"glm-4*",pricing:{input:.75,output:3,cached:.375,reasoning:4.5,cache_creation:.75}},{pattern:"glm-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"MiniMax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"minimax-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-code-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}},{pattern:"grok-*",pricing:{input:.5,output:2,cached:.25,reasoning:3,cache_creation:.5}}];function i(a,b){return RegExp("^"+a.split("*").map(a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$","i").test(b)}function j(a,b){if(!b)return null;if(a&&g[a]?.[b])return g[a][b];if(function(a){if(!a)return!1;let b=String(a).toLowerCase();return d.some(a=>b.startsWith(a))}(b))return e;let c=b.includes("/")?b.split("/").pop():b;if(f[c])return f[c];if(f[b])return f[b];for(let{pattern:a,pricing:d}of h)if(i(a,c)||i(a,b))return d;return null}function k(a,b){if(!a||!b)return 0;let c=0,d=a.prompt_tokens||a.input_tokens||0,e=a.cached_tokens||a.cache_read_input_tokens||0,f=a.cache_creation_input_tokens||0;c+=Math.max(0,d-e-f)*(b.input/1e6),e>0&&(c+=e*((b.cached||b.input)/1e6)),c+=(a.completion_tokens||a.output_tokens||0)*(b.output/1e6);let g=a.reasoning_tokens||0;return g>0&&(c+=g*((b.reasoning||b.output)/1e6)),f>0&&(c+=f*((b.cache_creation||b.input)/1e6)),c}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=8936,exports.ids=[8936],exports.modules={16655:(a,b,c)=>{c.d(b,{oF:()=>d.oF,tm:()=>d.tm,vF:()=>d.vF});var d=c(27274)},19225:(a,b,c)=>{a.exports=c(44870)},33839:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>O,OPTIONS:()=>N,buildModelsList:()=>M,dynamic:()=>D});var d=c(81329),e=c(40615),f=c(89718),g=c(66489),h=c(16655),i=c(29679),j=c(52007),k=c(53225),l=c(39609),m=c(75924),n=c(8590);let o=new Map;async function p(a,b){let c=new AbortController,d=setTimeout(()=>c.abort(),1e4);try{let d=await (0,l.proxyAwareFetch)("https://api.githubcopilot.com/models",{method:"GET",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Copilot-Integration-Id":"vscode-chat","editor-version":`vscode/${m.x0.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${m.x0.COPILOT_CHAT_VERSION}`,"user-agent":m.x0.USER_AGENT,"x-github-api-version":m.x0.API_VERSION},cache:"no-store",signal:b||c.signal});if(!d.ok){let a=Error(`Copilot /models returned ${d.status}`);throw a.status=d.status,a}let e=await d.json();return Array.isArray(e?.data)?e.data:[]}finally{clearTimeout(d)}}async function q(a,b={}){let c,d=a?.providerSpecificData?.copilotToken||a?.accessToken;if(!d)return b.log?.debug?.("COPILOT_MODELS","No copilotToken/accessToken; skipping live fetch"),null;let e=a?.providerSpecificData?.copilotToken||a?.accessToken||"copilot-anonymous",f=Date.now();if(!b.forceRefresh){let a=o.get(e);if(a&&a.expiresAt>f)return{models:a.models}}try{c=await p(d,b.signal)}catch(d){if(!d||401!==d.status&&403!==d.status||!a.accessToken)return b.log?.warn?.("COPILOT_MODELS",`Live model fetch failed: ${d?.message||d}`),null;{b.log?.info?.("COPILOT_MODELS",`Got ${d.status}; refreshing Copilot token`);let e=await (0,n.jR)(a.accessToken);if(!e?.token)return b.log?.warn?.("COPILOT_MODELS","Token refresh did not return a token"),null;if("function"==typeof b.onCredentialsRefreshed)try{await b.onCredentialsRefreshed({copilotToken:e.token,copilotTokenExpiresAt:e.expiresAt})}catch(a){b.log?.warn?.("COPILOT_MODELS",`onCredentialsRefreshed failed: ${a?.message||a}`)}try{c=await p(e.token,b.signal)}catch(a){return b.log?.warn?.("COPILOT_MODELS",`Retry after refresh failed: ${a?.message||a}`),null}}}let g=function(a){let b=new Set,c=[];for(let d of a){if(!d||"object"!=typeof d||d.capabilities?.type!=="chat"||d.policy&&"enabled"!==d.policy.state)continue;let a=d.id;!a||b.has(a)||(b.add(a),c.push({id:a,name:d.name||a}))}return c}(c);return g.length?(o.set(e,{expiresAt:f+3e5,models:g}),{models:g}):null}var r=c(52284);async function s(a){let b=!!a?.apiKey,c=b?a.apiKey:a?.accessToken;if(!c)return null;let d=new AbortController,e=setTimeout(()=>d.abort(),5e3);try{let a=b?{Accept:"application/json",Authorization:`Bearer ${c}`}:(0,r.w$)(c,{Accept:"application/json"}),e=await fetch("https://api.cline.bot/api/v1/models",{method:"GET",headers:a,signal:d.signal});if(!e.ok)return null;let f=await e.json(),g=Array.isArray(f)?f:f?.data;if(!Array.isArray(g))return null;let h=g.filter(a=>"string"==typeof a?.id&&a.id.startsWith("cline-pass/")).map(a=>({id:a.id,name:a.name||a.id}));return h.length?{models:h}:null}catch{return null}finally{clearTimeout(e)}}var t=c(77598);let u=new Map;async function v(a,b={}){let c,{log:d=null,proxyOptions:e=null,fetchFn:f=null}=b,g=a?.apiKey||a?.accessToken,h=(c=a?.providerSpecificData?.userId||a?.email||a?.refreshToken||a?.accessToken||a?.apiKey||"anonymous",(0,t.createHash)("sha256").update(`cline:${c}`).digest("hex")),i=u.get(h);if(i&&i.expiresAt>Date.now()&&i.models.length)return{models:i.models};let j=f||l.proxyAwareFetch,k=new AbortController,m=setTimeout(()=>k.abort(),8e3);try{let b=a?.apiKey?{Accept:"application/json",Authorization:`Bearer ${g}`}:(0,r.w$)(g||"",{Accept:"application/json"});g||delete b.Authorization,b["X-Task-ID"]=`10router_models_sync_${Date.now()}`;let c=await j("https://api.cline.bot/api/v1/ai/cline/recommended-models",{method:"GET",headers:b,cache:"no-store",signal:k.signal},e);if(!c.ok)return null;let f=await c.json(),i=(Array.isArray(f?.free)?f.free:[]).filter(a=>"string"==typeof a?.id&&""!==a.id.trim()).map(a=>({id:a.id.trim(),name:a.name||a.id.trim()}));if(!i.length)return null;return u.set(h,{expiresAt:Date.now()+6e5,models:i}),d?.debug?.("CLINE",`synced ${i.length} free models from recommended-models`),{models:i}}catch(a){return d?.debug?.("CLINE",`live model fetch failed: ${a?.message||a}`),null}finally{clearTimeout(m)}}var w=c(38709),x=c(82578),y=c(49804),z=c(67828),A=c(39326),B=c(66306);let C=Number.MAX_SAFE_INTEGER,D="force-dynamic",E=d.Xg.cline||"cline",F={kiro:async a=>{let b=await (0,i.cW)({accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}},{log:console});return b?.models?.length?{models:b.models}:null},qoder:async a=>{let b=await (0,k.EV)({accessToken:a.accessToken,refreshToken:a.refreshToken,email:a.email,displayName:a.displayName,providerSpecificData:a.providerSpecificData||{}});return b?.models?.length?{models:b.models.map(a=>({id:a.id,name:a.name}))}:null},kimchi:async a=>{let b=await (0,j.av)({accessToken:a.accessToken,apiKey:a.apiKey,providerSpecificData:a.providerSpecificData||{}},{log:console});return b?.models?.length?{models:b.models}:null},github:async a=>{let b=await q({accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}},{log:console,onCredentialsRefreshed:async b=>{await (0,z.vN)(a.id,{copilotToken:b.copilotToken,copilotTokenExpiresAt:b.copilotTokenExpiresAt,existingProviderSpecificData:a.providerSpecificData||{}})}});return b?.models?.length?{models:b.models}:null},clinepass:async a=>{let b=await s({accessToken:a.accessToken,apiKey:a.apiKey});return b?.models?.length?{models:b.models}:null},cline:async a=>{let b=(d.vq[E]||[]).filter(a=>a?.id).map(a=>({id:a.id,name:a.name||a.id})),c=await v({accessToken:a.accessToken,apiKey:a.apiKey,email:a.email,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}});if(!c?.models?.length)return null;let e=new Set(b.map(a=>a.id)),f=[...b];for(let a of c.models)!a?.id||e.has(a.id)||(e.add(a.id),f.push({id:a.id,name:a.name||a.id}));return{models:f}},"grok-cli":async a=>{let b=await (0,A.B)(a.providerSpecificData||{}),c=await (0,w.M)({...a,connectionId:a.id},{log:console,proxyOptions:{connectionProxyEnabled:!0===b.connectionProxyEnabled,connectionProxyUrl:b.connectionProxyUrl||"",connectionNoProxy:b.connectionNoProxy||"",vercelRelayUrl:b.vercelRelayUrl||"",strictProxy:!0===b.strictProxy},onCredentialsRefreshed:async b=>{await (0,z.vN)(a.id,{...b,existingProviderSpecificData:a.providerSpecificData||{}})}});return c?.models?.length?{models:c.models}:null},cursor:async a=>{let b=await (0,x.FD)({accessToken:a.accessToken,providerSpecificData:a.providerSpecificData||{}},{log:console});return b?.models?.length?{models:b.models}:null},zed:async a=>{let b=await (0,y.w9)({accessToken:a.accessToken,providerSpecificData:a.providerSpecificData||{}});return b?.models?.length?{models:b.models.filter(a=>!a.isDisabled).map(a=>({id:a.id,name:a.name,capabilities:a.supportsTools?{tools:!0}:void 0}))}:null}},G="x-10r-internal-models-fetch",H={image:"image",tts:"tts",embedding:"embedding",stt:"stt",imageToText:"imageToText",video:"video",rerank:"rerank"};function I(a){let b=a?.kind||a?.type;return b&&H[b]||"llm"}async function J(a){if(!a?.apiKey)return[];let b="string"==typeof a?.providerSpecificData?.baseUrl?a.providerSpecificData.baseUrl.trim().replace(/\/$/,""):"";if(!b)return[];let c=`${b}/models`,d={"Content-Type":"application/json"};if((0,e.mq)(a.provider))d.Authorization=`Bearer ${a.apiKey}`;else{if(!(0,e.gb)(a.provider))return[];c.endsWith("/messages/models")?c=c.slice(0,-9):c.endsWith("/messages")&&(c=`${c.slice(0,-9)}/models`),d["x-api-key"]=a.apiKey,d["anthropic-version"]="2023-06-01",d.Authorization=`Bearer ${a.apiKey}`}try{var f;let a=new AbortController,b=setTimeout(()=>a.abort(),5e3),e=await fetch(c,{method:"GET",headers:{...d,[G]:"1"},cache:"no-store",signal:a.signal});if(clearTimeout(b),!e.ok)return[];let g=(f=await e.json(),Array.isArray(f)?f:f?.data||f?.models||f?.results||[]);return Array.from(new Set(g.map(a=>a?.id||a?.name||a?.model).filter(a=>"string"==typeof a&&""!==a.trim())))}catch{return[]}}function K(a,b){let c=e.AI_PROVIDERS[a],d=Array.isArray(c?.serviceKinds)&&c.serviceKinds.length>0?c.serviceKinds:["llm"];return b.some(a=>d.includes(a))}let L=a=>{let b="string"==typeof a?Number(a):a;return Number.isFinite(b)&&b>0?Math.floor(b):null};async function M(a,b={}){let c=!0===b.skipDynamicFetch,i=[],j=!0;try{i=(i=await (0,f.getProviderConnections)()).filter(a=>!1!==a.isActive)}catch(a){j=!1,console.log("Could not fetch providers, returning all models")}let k=[];try{k=await (0,f.Uv)()}catch(a){console.log("Could not fetch combos")}let l=[];try{l=await (0,f.uv)()}catch(a){console.log("Could not fetch custom models")}let m=[];try{m=await (0,f.Fh)()}catch(a){console.log("Could not fetch provider nodes")}let n=new Set(m.map(a=>a.id)),o=new Set;for(let a of Object.values(e.AI_PROVIDERS))a&&(a.id&&o.add(a.id),a.alias&&o.add(a.alias));let p=a=>{if("string"!=typeof a||""===a.trim())return!1;let b=a.trim();return!!o.has(b)||!!("string"==typeof b&&(b.startsWith("openai-compatible-")||b.startsWith("anthropic-compatible-")))&&n.has(b)&&t.has(b)},q={};try{q=await (0,f.OM)()}catch(a){console.log("Could not fetch model aliases")}let r={};try{r=await (0,h.vF)()}catch(a){console.log("Could not fetch disabled models")}let s=(a,b)=>Array.isArray(r[a])&&r[a].includes(b),t=new Map;for(let a of i)t.has(a.provider)||t.set(a.provider,a);let u=[],v=[];try{let a=await (0,f.getSettings)();Array.isArray(a?.providerCardOrder)&&(u=a.providerCardOrder),Array.isArray(a?.comboCardOrder)&&(v=a.comboCardOrder)}catch(a){console.log("Could not fetch provider card order:",a?.message)}let w={};try{let a=await (0,g.SZ)();a&&"object"==typeof a&&(w=a)}catch(a){console.log("Could not fetch model caps overrides:",a?.message)}let x=function({cardOrder:a=[],aliasToId:b={},priorityOf:c=()=>void 0}={}){let d=new Map;a.forEach((a,b)=>{d.has(a)||d.set(a,b)});let e=a=>b[a]||a,f=a=>{let b=d.get(e(a));return void 0===b?Number.MAX_SAFE_INTEGER:b};return(a,b)=>{let d=f(a),g=f(b);if(d!==g)return d-g;let h=c(e(a))??999,i=c(e(b))??999;return h!==i?h-i:String(e(a)).localeCompare(String(e(b)))}}({cardOrder:u,aliasToId:e.js,priorityOf:a=>e.AI_PROVIDERS[a]?.priority}),y=a=>e.js[a]||a,z=new Map;{let a=new Set(t.keys());for(let b of l)b?.id&&b?.providerAlias&&a.add(String(b.providerAlias));if(0===i.length&&!j)for(let b of Object.keys(d.vq))a.add(b);[...a].sort(x).forEach((a,b)=>{let c=y(a);z.has(c)||z.set(c,b)})}let A=a=>{let b=z.get(y(a||""));return void 0===b?Number.MAX_SAFE_INTEGER:b},D=[],E=0,G=(a,b)=>{D.push({model:a,rank:b,seq:E++})},H=Object.fromEntries(k.map(a=>[a.name,a.models])),N=a=>{let b=a.indexOf("/");if(-1===b)return null;let c=w[a.slice(0,b)]?.[a.slice(b+1)];return c&&(c.contextWindow||c.maxOutput)?c:null},O=(a,{alias:b,providerId:c,modelId:d,kind:e,customRow:f,emitFloor:g=!0})=>{let h="llm"===e?(0,B.nl)(c||b,d):null;if(!h)return a;let i={...h},j=i.contextWindow,k=i.maxOutput,l=j!==B.tq.contextWindow||k!==B.tq.maxOutput;if(f){let a=L(f.contextWindow),b=L(f.maxOutput);a&&(j=a,l=!0),b&&(k=b,l=!0)}let m=w[b]?.[d];m?.contextWindow&&(j=m.contextWindow,l=!0),m?.maxOutput&&(k=m.maxOutput,l=!0),a.capabilities=i,Number.isFinite(j)&&(i.contextWindow=j),Number.isFinite(k)&&(i.maxOutput=k);let n=g||l;return n&&Number.isFinite(j)&&(a.context_length=j,a.context_window=j),n&&Number.isFinite(k)&&(a.max_completion_tokens=k),a};for(let b of[...k].sort(function({cardOrder:a=[]}={}){let b=function(a=[]){let b=new Map;return(a||[]).forEach((a,c)=>{b.has(a)||b.set(a,c)}),a=>b.has(a)?b.get(a):C}(a);return(a,c)=>{let d="object"==typeof a&&null!==a?a.id:a,e="object"==typeof c&&null!==c?c.id:c,f=b(d),g=b(e);if(f!==g)return f-g;let h="object"==typeof a&&a?.createdAt?new Date(a.createdAt).getTime():0,i="object"==typeof c&&c?.createdAt?new Date(c.createdAt).getTime():0;if(h&&i&&h!==i)return h-i;let j="object"==typeof a&&a?.name?a.name:String(a??""),k="object"==typeof c&&c?.name?c.name:String(c??"");return j.localeCompare(k)}}({cardOrder:v}))){if(!function(a,b){let c=a?.kind||"llm";return b.includes(c)}(b,a))continue;let c={id:b.name,object:"model",owned_by:"combo"};if("webSearch"===b.kind||"webFetch"===b.kind)c.kind=b.kind;else{let a=(0,B.Q5)(b.models,H,N);a&&(c.capabilities=a),a&&Number.isFinite(a.contextWindow)&&(c.context_length=a.contextWindow,c.context_window=a.contextWindow),a&&Number.isFinite(a.maxOutput)&&(c.max_completion_tokens=a.maxOutput)}G(c,-1)}if(0===i.length){if(!j){let b=Object.fromEntries(Object.entries(d.Xg).map(([a,b])=>[b,a]));for(let[c,e]of Object.entries(d.vq)){let d=b[c]||c;if(K(d,a))for(let b of e){if(!a.includes(I(b))||s(c,b.id))continue;let e={id:`${c}/${b.id}`,object:"model",owned_by:c};O(e,{alias:c,providerId:d,modelId:b.id,kind:I(b)}),G(e,A(d))}}}for(let b of l){if(!b?.id||b.type&&"llm"!==b.type||!1===b.enabled||!a.includes("llm"))continue;let c=b.providerAlias;if(!p(c))continue;let d=String(b.id).trim();if(!d)continue;let e={id:`${c}/${d}`,object:"model",owned_by:c};O(e,{alias:c,providerId:c,modelId:d,kind:"llm",customRow:b,emitFloor:!1}),G(e,A(c))}}else for(let[b,f]of t.entries()){let g;if(!K(b,a))continue;let h=d.Xg[b]||b,i=(f?.providerSpecificData?.prefix||(0,e.wG)(b)||h).trim(),j=d.vq[h]||[],k=f?.providerSpecificData?.enabledModels,m=Array.isArray(k)&&k.length>0,n=(0,e.mq)(b)||(0,e.gb)(b),o=new Map(j.map(a=>[a.id,I(a)])),p=new Map,r=new Map;g=m?Array.from(new Set(k.filter(a=>"string"==typeof a&&""!==a.trim()))):j.map(a=>a.id),n&&0===g.length&&!c&&(g=await J(f));let t=F[b];if(t&&!m)try{let a=await t(f);a?.models?.length&&(g=a.models.map(a=>a.id),p=new Map(a.models.filter(a=>a?.id).map(a=>[a.id,I(a)])),r=new Map(a.models.filter(a=>a?.id&&a.capabilities).map(a=>[a.id,a.capabilities])))}catch(a){console.log(`Live model fetch failed for ${b}: ${a?.message||a}`)}let u=g.map(a=>a.startsWith(`${i}/`)?a.slice(i.length+1):a.startsWith(`${h}/`)?a.slice(h.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim()),v=new Map,x=new Map,y=Array.from(new Set([...u,...l.filter(c=>{if(!c?.id||!1===c.enabled)return!1;let e=(0,d.CP)(c)||"llm";if(!a.includes(e)&&!("imageToText"===e&&a.includes("llm")))return!1;let f=c.providerAlias;return f===h||f===i||f===b}).map(a=>{let b=String(a.id).trim();return b&&(v.set(b,(0,d.CP)(a)||"llm"),x.set(b,a)),b}).filter(a=>""!==a),...Object.values(q||{}).filter(a=>"string"==typeof a&&!!a.includes("/")&&(a.startsWith(`${i}/`)||a.startsWith(`${h}/`)||a.startsWith(`${b}/`))).map(a=>a.startsWith(`${i}/`)?a.slice(i.length+1):a.startsWith(`${h}/`)?a.slice(h.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim())])),z=w[b]||w[h]||w[i]||null;for(let c of y){let d=v.get(c),e=p.get(c),f=d||e||o.get(c)||function(a){let b=String(a).toLowerCase();return/rerank/.test(b)?"rerank":/embed/.test(b)?"embedding":/tts|speech|audio|voice/.test(b)?"tts":/image|imagen|dall-?e|flux|sdxl|sd-|stable-diffusion/.test(b)?"image":"llm"}(c),g="imageToText"===f&&a.includes("llm");if(!a.includes(f)&&!g||s(i,c)||s(h,c))continue;let j={id:`${i}/${c}`,object:"model",owned_by:i},k="llm"===f?(0,B.nl)(b,c):null,l=(0,B.a0)(d||e),m=r.get(c),n=k?{...k,...l||{},...m||{}}:l||m||null;if(n&&(j.capabilities=n),"llm"===f||g){let a=n?.contextWindow,d=n?.maxOutput;if(!Number.isFinite(a)||!Number.isFinite(d)){let e=(0,B.nl)(b,c);Number.isFinite(a)||(a=e.contextWindow),Number.isFinite(d)||(d=e.maxOutput)}let e=x.get(c);if(e){let b=L(e.contextWindow),c=L(e.maxOutput);b&&(a=b),c&&(d=c)}let f=z?.[c];f?.contextWindow&&(a=f.contextWindow),f?.maxOutput&&(d=f.maxOutput),n&&(Number.isFinite(a)&&(n.contextWindow=a),Number.isFinite(d)&&(n.maxOutput=d)),Number.isFinite(a)&&(j.context_length=a),Number.isFinite(a)&&(j.context_window=a),Number.isFinite(d)&&(j.max_completion_tokens=d)}G(j,A(b))}let C=e.AI_PROVIDERS[b];a.includes("webSearch")&&C?.searchConfig&&G({id:`${i}/search`,object:"model",kind:"webSearch",owned_by:i},A(b)),a.includes("webFetch")&&C?.fetchConfig&&G({id:`${i}/fetch`,object:"model",kind:"webFetch",owned_by:i},A(b))}for(let[b,c]of Object.entries(e.AI_PROVIDERS).filter(([,a])=>a?.noAuth&&a?.exposeStaticModels).sort((a,b)=>(a[1].priority??1/0)-(b[1].priority??1/0)||String(a[0]).localeCompare(String(b[0])))){if(!c?.noAuth||!c?.exposeStaticModels||t.has(b)||!K(b,a))continue;let e=d.Xg[b]||b;for(let c of d.vq[e]||[]){let f=String(c?.id||"").trim();if(!f||s(e,f))continue;let g=(0,d.CP)(c)||"llm";if(!a.includes(g))continue;let h={id:`${e}/${f}`,object:"model",owned_by:e};if("llm"===g){let a=(0,B.nl)(b,f),c=w[e]?.[f];c?.contextWindow&&(a.contextWindow=c.contextWindow),c?.maxOutput&&(a.maxOutput=c.maxOutput),h.capabilities=a,h.context_length=a.contextWindow,h.context_window=a.contextWindow,h.max_completion_tokens=a.maxOutput}G(h,A(e))}}if(i.length>0){let b=new Set;for(let[a]of t.entries()){let c=d.Xg[a]||a;b.add(c);let f=(0,e.wG)(a);f&&b.add(f),b.add(a);let g=t.get(a),h=g?.providerSpecificData?.prefix;h&&b.add(String(h).trim())}for(let c of l){if(!c?.id||!1===c.enabled)continue;let e=(0,d.CP)(c)||"llm";if(!a.includes(e))continue;let f=String(c.providerAlias||"").trim();if(!f||b.has(f)||!p(f))continue;let g=String(c.id).trim();if(!g||s(f,g))continue;let h={id:`${f}/${g}`,object:"model",owned_by:f};if("llm"===e){let a=(0,B.nl)(f,g),b=w[f]?.[g],d=b?.contextWindow??L(c.contextWindow),e=b?.maxOutput??L(c.maxOutput);d&&(a.contextWindow=d),e&&(a.maxOutput=e),h.capabilities=a,h.context_length=a.contextWindow,h.context_window=a.contextWindow,h.max_completion_tokens=a.maxOutput}G(h,A(f))}}let P=[],Q=new Set;for(let a of(D.sort((a,b)=>a.rank-b.rank||a.seq-b.seq),D.map(a=>a.model)))!a?.id||Q.has(a.id)||(Q.add(a.id),P.push(a));return P}async function N(){return new Response(null,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"*"}})}async function O(a){try{let b=a?.headers?.get(G)==="1",d=await M(["llm"],{skipDynamicFetch:b}),e=a.headers.get("Authorization"),f=a.headers.get("x-api-key"),g=e?.startsWith("Bearer ")?e.slice(7):f||null;if(g)try{let{getApiKeyByKey:a}=await Promise.resolve().then(c.bind(c,89718)),b=await a(g);if(b&&(b.allowedModels?.length||b.allowedCombos?.length)){let{matchPattern:a}=await Promise.resolve().then(c.bind(c,58920)),e=b.allowedModels||[],f=(b.allowedCombos||[]).map(a=>a.toLowerCase());d=d.filter(b=>{let c=b.id.toLowerCase();return"combo"===b.owned_by?0===f.length||f.includes(c):!(e.length>0)||e.some(b=>{let d=b.toLowerCase();return!!(d===c||d.includes("*")&&a(d,c)||c.includes("/")&&c.split("/").pop()===d)})})}}catch(a){console.warn("Failed to filter models by API key:",a.message)}return Response.json({object:"list",data:d},{headers:{"Access-Control-Allow-Origin":"*"}})}catch(a){return console.log("Error fetching models:",a),Response.json({error:{message:a.message,type:"server_error"}},{status:500})}}},66489:(a,b,c)=>{c.d(b,{D3:()=>d.D3,SZ:()=>d.SZ,dW:()=>d.dW});var d=c(27274)},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}}};
@@ -1 +1 @@
1
- "use strict";exports.id=9154,exports.ids=[4575,6956,9154],exports.modules={46956:(a,b,c)=>{c.d(b,{proxyAwareFetch:()=>r});var d=c(27910),e=c(8735);let f=globalThis.fetch,g=new Map;function h(a,b){let c=e.v1.directFallbackTimeoutMs;if(b?.signal)return f(a,b);let d=new AbortController,g=setTimeout(()=>d.abort(Error(`fetch connect timeout (${c}ms)`)),c);return f(a,{...b,signal:d.signal}).finally(()=>clearTimeout(g))}let i=new Map,j=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],k=["8.8.8.8","8.8.4.4"];function l(a){return null==a?"":String(a).trim()}async function m(a){let b=i.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(k);let g=d(f.resolve4.bind(f)),h=await g(a);return i.set(a,{ip:h[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),h[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function n(a,b){let c,d=l(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function o(a){let b=l(a);return b?/^[a-z][a-z0-9+.-]*:\/\//i.test(b)?b:`http://${b}`:null}async function p(a){let b=o(a);if(!b)return null;if(!g.has(b)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{ProxyAgent:a}=await c.e(3433).then(c.t.bind(c,3433,19));g.set(b,new a({uri:b}))}return g.get(b)}async function q(a,b,f){let g=await Promise.resolve().then(c.t.bind(c,55591,23)),h=await Promise.resolve().then(c.t.bind(c,91645,23)),i=g.default??g,j=h.default??h;return new Promise((c,g)=>{let h=new j.Socket,k=!1,l=(a,b)=>{k||(k=!0,clearTimeout(m),o(),a(b))},m=setTimeout(()=>{h.destroy(),l(g,Error(`[ProxyFetch] MITM bypass connect timeout after ${e.v1.directFallbackTimeoutMs}ms`))},e.v1.directFallbackTimeoutMs),n=()=>{h.destroy(),l(g,Error("[ProxyFetch] MITM bypass request aborted"))},o=()=>{f.signal&&f.signal.removeEventListener("abort",n)};if(f.signal){if(f.signal.aborted)return void n();f.signal.addEventListener("abort",n,{once:!0})}h.connect(443,b,()=>{let b={socket:h,servername:a.hostname,path:a.pathname+a.search,method:f.method||"POST",headers:{...f.headers,Host:a.hostname}},e=i.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};l(c,b)});e.on("error",a=>l(g,a)),f.body&&e.write("string"==typeof f.body?f.body:JSON.stringify(f.body)),e.end()}),h.on("error",a=>l(g,a))})}async function r(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=l(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=l(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=l(b?.noProxy??b?.connectionNoProxy);return d&&n(a,d)?null:o(c)}(d,c),i=g?null:o(function(a){let b;if(n(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),k=g||i;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(d)){if(k)try{let c=await p(k);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.onProxyFallback)try{c.onProxyFallback(a)}catch{}console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await m(a.hostname);if(c)return await q(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}if(k)return h(d,b)}if(k)try{let c=await p(k);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.onProxyFallback)try{c.onProxyFallback(a)}catch{}return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`),h(d,b)}let s=c?.proxyPoolId||c?.enabled===!0||c?.connectionProxyEnabled===!0||!!l(c?.url??c?.connectionProxyUrl);if(c?.strictProxy===!0&&s)throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");return f(a,b)}async function s(a,b={}){return r(a,b,null)}globalThis.fetch!==s&&(globalThis.fetch=s)},47153:(a,b,c)=>{c.d(b,{$B:()=>o,I9:()=>f.I9,Og:()=>i,Ql:()=>f.Ql,Sc:()=>j,jR:()=>f.jR,jT:()=>h,oD:()=>g,pb:()=>l});var d=c(52776),e=c(48991),f=c(98125);let g=3e5;function h(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 i(a){return e.Wu[a]?e.Wu[a]:"kimi-coding"===a&&e.Wu.kimi?e.Wu.kimi:g}function j(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 k=new Map;async function l(a,b){let d=a.client_email,f=k.get(d);if(f&&f.expiresAt-Date.now()>3e5)return{accessToken:f.token,expiresAt:f.expiresAt};try{let{SignJWT:f,importPKCS8:g}=await c.e(1261).then(c.bind(c,91261));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),l=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(!l.ok){let a=await l.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:m,expires_in:n}=await l.json(),o=Date.now()+(n??3600)*1e3;return k.set(d,{token:m,expiresAt:o}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:m,expiresAt:o}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}function m(a,b){let c=j(a.apiKey);return c?l(c,b):null}let n={"gemini-cli":(a,b)=>(0,f.I9)(a.refreshToken,d.xq["gemini-cli"].clientId,d.xq["gemini-cli"].clientSecret,b),antigravity:(a,b)=>(0,f.I9)(a.refreshToken,d.xq.antigravity.clientId,d.xq.antigravity.clientSecret,b),claude:(a,b)=>(0,f.ge)(a.refreshToken,b),codex:(a,b)=>(0,f.Wm)(a.refreshToken,b),iflow:(a,b)=>(0,f.AH)(a.refreshToken,b),github:(a,b)=>(0,f.EF)(a.refreshToken,b),kiro:(a,b)=>(0,f.Ql)(a.refreshToken,a.providerSpecificData,b),xai:(a,b)=>(0,f.r_)(a.refreshToken,b),"grok-cli":(a,b)=>(0,f.r_)(a.refreshToken,b),gcli:(a,b)=>(0,f.r_)(a.refreshToken,b),"codebuddy-cn":(a,b)=>(0,f.SO)(a.refreshToken,b),"codebuddy-intl":(a,b)=>(0,f.XB)(a.refreshToken,b),trae:(a,b)=>(0,f.RM)(a.refreshToken,a,b),cline:(a,b)=>(0,f.Il)("cline",a.refreshToken,b),clinepass:(a,b)=>(0,f.Il)("clinepass",a.refreshToken,b),zed:()=>(0,f.wt)(),windsurf:(a,b)=>(0,f.p9)(a,b),kimi:(a,b)=>(0,f.ng)(a.refreshToken,a,b),"kimi-coding":(a,b)=>(0,f.ng)(a.refreshToken,a,b),"minimax-code":(a,b)=>(0,f.refreshMinimaxCodeToken)("minimax-code",a.refreshToken,b),"minimax-code-global":(a,b)=>(0,f.refreshMinimaxCodeToken)("minimax-code-global",a.refreshToken,b),vertex:m,"vertex-partner":m};async function o(a,b,c){if(!b.refreshToken)return null;let d=n[a];return d?d(b,c):(0,f.J1)(a,b.refreshToken,b,c)}},48991:(a,b,c)=>{let d;c.d(b,{Cn:()=>n,Co:()=>x,IO:()=>A,Ic:()=>u,J5:()=>r,K:()=>s,NA:()=>z,QH:()=>o,Wu:()=>y,buildKimiHeaders:()=>B,go:()=>i,iO:()=>p,j5:()=>v,nZ:()=>t,sX:()=>j,uR:()=>q,x0:()=>l,zv:()=>w});var e=c(21820),f=c(52776),g=c(63100);let h=f.xq["gemini-cli"]?.cliVersion,i=f.xq["gemini-cli"]?.apiClient;function j(a="unknown"){let b;return`GeminiCLI/${h}/${a||"unknown"} (${(0,e.platform)()}; ${"ia32"===(b=(0,e.arch)())?"x86":b}; terminal)`}f.xq.codex?.cliVersion;let k=f.xq.github?.copilot||{},l={VSCODE_VERSION:k.vscodeVersion,COPILOT_CHAT_VERSION:k.chatVersion,USER_AGENT:k.userAgent,API_VERSION:k.apiVersion};function m(){let a=(0,e.platform)(),b=(0,e.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let n={ideType:9,platform:m(),pluginType:2},o="_ide",p=[{from:"You are a Claude agent, built on Anthropic's Claude Agent SDK.",to:""},{from:/You are Hermes(?: Agent)?(?:,\s*(?:an intelligent AI assistant|an AI assistant|an AI agent))?(?:,?\s*(?:built|created)\s+by\s+Nous Research)?\./gi,to:"You are an AI assistant."},{from:/opencode/gi,to:a=>"OpenCode"===a?"Antigravity":"OPENCODE"===a?"ANTIGRAVITY":"antigravity"},{from:/hermes-agent\.nousresearch\.com/gi,to:"antigravity.google.com"},{from:/hermes agent/gi,to:a=>a.startsWith("H")?"Antigravity":"antigravity"},{from:/nous research/gi,to:a=>a.startsWith("N")?"Google DeepMind":"google deepmind"},{from:/hermes-agent/gi,to:"antigravity"}],q="_ide",r=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),s={"User-Agent":g.Of},t={"gemini-cli":{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},antigravity:{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"}},u={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:m(),pluginType:2})},v={"Content-Type":"application/json","User-Agent":g.Of},w={ideType:9,platform:m(),pluginType:2},x="You are Claude Code, Anthropic's official CLI for Claude.",y=Object.fromEntries(Object.entries(f.sr).filter(([,a])=>a.refreshLeadMs).map(([a,b])=>[a,b.refreshLeadMs])),z={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:f.sr.codex?.tokenUrl,auth:f.sr.codex?.authorizeUrl},anthropic:{token:f.sr.claude?.tokenUrl,auth:"https://api.anthropic.com/v1/oauth/authorize"},iflow:{token:f.sr.iflow?.tokenUrl,auth:f.sr.iflow?.authorizeUrl},github:{token:f.sr.github?.tokenUrl,auth:f.sr.github?.authorizeUrl,deviceCode:f.sr.github?.deviceCodeUrl}};function A(){if(d)return d;try{d=c(90053).rE||"0.0.0"}catch{d=process.env.npm_package_version||"0.0.0"}return d}function B(a){let b=(0,e.platform)(),c=(0,e.arch)(),d=`${b} ${c}`;"darwin"===b?d=`macOS ${c}`:"win32"===b?d=`Windows ${c}`:"linux"===b&&(d=`Linux ${c}`);let f="unknown";try{f=(0,e.hostname)()||"unknown"}catch{f="unknown"}let g="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"9router","X-Msh-Version":A(),"X-Msh-Device-Name":f,"X-Msh-Device-Model":d,"X-Msh-Device-Id":g}}},56463:(a,b,c)=>{c.d(b,{fd:()=>e,w$:()=>f});let d=c(90053).rE||"0.0.0";function e(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}function f(a,b={}){let c,g=(c=e(a))?`Bearer ${c}`:"",h={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`9Router/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"9router","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return g&&(h.Authorization=g),h}},79154:(a,b,c)=>{c.d(b,{Dz:()=>i,Vq:()=>l,fp:()=>j});var d=c(47153),e=c(53223);let f=e.sr.codex?.maxRefreshAgeMs,g=new Map;function h(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 i(a){return h(a?.expiresAt??a?.tokenExpiresAt)}function j(a,b,c=Date.now()){if(!b)return!1;let g=i(b);if(null!==g&&g-c<(0,d.Og)(a))return!0;let k=e.sr[a]?.maxRefreshAgeMs;return!!(k&&b.refreshToken&&function(a,b=Date.now(),c=f){let d=h(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!d||b-d>=c}(b,c,k))}async function k(a,b,c){let d,e=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),f=g.get(e);if(f)return f;let h=Promise.resolve().then(c).finally(()=>{g.delete(e)});return g.set(e,h),h}async function l(a,b,c){return b?k(a,b,async()=>{let f=await (0,d.$B)(a,b,c);return function(a,b,c,f=Date.now()){var g,h;if(!c)return null;if((0,d.jT)(c))return c;let i={},j=new Date(f).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,f)):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),(e.sr[a]?.trackRefreshAt||i.accessToken||i.apiKey||i.token||i.refreshToken||i.copilotToken)&&(i.lastRefreshAt=c.lastRefreshAt||j),i}(a,b,f)}):null}},98125:(a,b,c)=>{c.d(b,{J1:()=>o,ge:()=>q,Il:()=>H,XB:()=>A,SO:()=>z,Wm:()=>t,jR:()=>y,EF:()=>x,I9:()=>r,AH:()=>w,ng:()=>p,Ql:()=>v,refreshMinimaxCodeToken:()=>B,RM:()=>D,p9:()=>G,r_:()=>m,wt:()=>F});var d=c(52776),e=c(48991),f=c(46956);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();return g.set(e,{result:a,expiresAt:Date.now()+1e4}),a}catch(a){throw g.delete(e),a}})();return g.set(e,{promise:h}),h}var i=c(56463);let j=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function k(a){return"string"==typeof a?a.trim():""}let l=null;async function m(a,b){return a?h("xai",a,async()=>{try{l||(l=new(await c.e(8749).then(c.bind(c,38749))).XaiService);let b=await l.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 n={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 o(a,b,c,e){let f=d.xq[a],g=n[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 p(a,b,c){return o("kimi",a,b,c)}async function q(a,b){return o("claude",a,{},b)}async function r(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}function s(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))}}async function t(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=s(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 u(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(3433),c.e(539),c.e(5692),c.e(5210),c.e(6492),c.e(9046)]).then(c.bind(c,46492));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function v(a,b,c,e=null){return a?h("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,i=b?.clientSecret,l=b?.region;if("external_idp"===g){let d;try{d=function(a,b={}){var c;let d=k(b.clientId||b.client_id),e=function(a){let b,c=k(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 d=b.hostname.toLowerCase();if(!j.has(d))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}(b.tokenEndpoint||b.token_endpoint),f=Array.isArray(c=b.scope||b.scopes)?c.map(k).filter(Boolean).join(" "):k(c);if(!a)throw Error("refresh token is required");if(!d)throw Error("clientId is required for external_idp refresh");if(!f)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:e,body:new URLSearchParams({grant_type:"refresh_token",client_id:d,refresh_token:a,scope:f}),providerSpecificData:{...b,authMethod:"external_idp",clientId:d,tokenEndpoint:e,scope:f}}}(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&&i){let d="idc"===g&&l?`https://oidc.${l}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",j=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:i,refreshToken:a,grantType:"refresh_token"})},e);if(!j.ok){let a=await j.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:j.status,error:a}),null}let k=await j.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!k.accessToken,expiresIn:k.expiresIn}),{accessToken:k.accessToken,refreshToken:k.refreshToken||a,expiresIn:k.expiresIn,...await u(b,k.accessToken,k.profileArn)}}let m=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(!m.ok){let a=await m.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:m.status,error:a}),null}let n=await m.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!n.accessToken,expiresIn:n.expiresIn}),{accessToken:n.accessToken,refreshToken:n.refreshToken||a,expiresIn:n.expiresIn,...await u(b,n.accessToken,n.profileArn)}},c):null}async function w(a,b){return o("iflow",a,{},b)}async function x(a,b){return o("github",a,{},b)}async function y(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 z(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 A(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 B(a,b,c,e=null){return b?h(a,b,async()=>{let g=d.sr[a],h=g?.tokenUrl||("minimax-code-global"===a?"https://account.minimax.io/oauth2/token":"https://account.minimax.cn/oauth2/token");try{let d=await (0,f.proxyAwareFetch)(h,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",client_id:g?.clientId||"mcode-public",refresh_token:b}).toString()},e);if(!d.ok){let b=await d.text(),e=s(d.status,b);if(c?.warn?.("TOKEN_REFRESH",`Failed to refresh MiniMax Code token (${a})`,{status:d.status,error:b,code:e.code,permanent:e.permanent}),e.permanent)return{error:e.code||"invalid_grant"};return null}let i=await d.json();return c?.info?.("TOKEN_REFRESH",`Successfully refreshed MiniMax Code token (${a})`,{hasNewAccessToken:!!i.access_token,hasNewRefreshToken:!!i.refresh_token,expiresIn:i.expires_in}),{accessToken:i.access_token,refreshToken:i.refresh_token||b,expiresIn:i.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Network error refreshing MiniMax Code token (${a}): ${b.message}`),null}},c):null}let C={intl:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai"],cn:["https://api.trae.com.cn","https://api.marscode.cn","https://api.trae.cn"]};async function D(a,b,c){if(!a)return null;let e=d.sr.trae||{},f=function(a){let b=a?.providerSpecificData||{},c=String(b.site||"").trim().toLowerCase();if("cn"===c||"intl"===c)return c;let d=String(b.loginHost||b.host||"").trim().toLowerCase();return d.endsWith("trae.cn")||d.endsWith("trae.com.cn")||d.endsWith("marscode.cn")||"marscode-cn"===String(b.scope||"")?"cn":"intl"}(b),g=new URL(e.exchangeTokenUrl||e.tokenUrl||"https://api.marscode.com/cloudide/api/v3/trae/oauth/ExchangeToken").pathname,i=C[f].map(a=>`${a}${g}`);return i.length?h("trae",a,async()=>{for(let b of i){let d=await E(b,a,e,c,f);if(d)return d}return null},c):(c?.warn?.("TOKEN_REFRESH","No Trae exchangeTokenUrl configured"),null)}async function E(a,b,c,d,e){try{let f,g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"Trae/1.0.0 antigravity-cockpit-tools"},body:JSON.stringify({ClientID:c.clientId||"ono9krqynydwx5",RefreshToken:b,ClientSecret:c.clientSecret||"-",UserID:""})});if(!g.ok){let b=await g.text();return d?.warn?.("TOKEN_REFRESH","Trae token refresh rejected",{site:e,origin:new URL(a).origin,status:g.status,error:String(b||"").slice(0,200)}),null}let h=await g.json(),i=h?.Result||h?.result||h,j=i?.AccessToken||i?.accessToken;if(!j)return d?.error?.("TOKEN_REFRESH","Trae refresh returned no AccessToken",{payload:h}),null;let k=i?.RefreshToken||i?.refreshToken||b,l=i?.ExpiresAt||i?.expiresAt;if("number"==typeof l)f=Math.max(1,l-Math.floor(Date.now()/1e3));else if("string"==typeof l){let a=new Date(l).getTime()-Date.now();f=a>0?Math.floor(a/1e3):void 0}return d?.info?.("TOKEN_REFRESH","Successfully refreshed Trae token",{site:e,hasNewAccessToken:!!j,hasNewRefreshToken:k!==b,expiresIn:f}),{accessToken:j,refreshToken:k,expiresIn:f}}catch(a){return d?.error?.("TOKEN_REFRESH",`Error refreshing Trae token (${e}): ${a.message}`),null}}function F(){return null}async function G(a,b){return b?.info?.("TOKEN_REFRESH","windsurf: apiKey is long-lived (no refresh_token flow) — skipping"),null}async function H(a,b,c){if(!b)return null;let e=(d.sr[a]||d.sr.cline||{}).refreshUrl;return e?h(a,b,async()=>{try{let d,f=await fetch(e,{method:"POST",headers:(0,i.w$)(null,{"Content-Type":"application/json",Accept:"application/json"}),body:JSON.stringify({refreshToken:b,grantType:"refresh_token",clientType:"extension"})});if(!f.ok){let b=await f.text(),d=s(b,f.status);if(d.permanent)return c?.error?.("TOKEN_REFRESH",`${a} refresh token invalid or expired — re-auth required`,{status:f.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return c?.error?.("TOKEN_REFRESH",`Failed to refresh ${a} token`,{status:f.status,error:b}),null}let g=await f.json(),h=g?.data||g,j=(0,i.fd)(h?.accessToken);if(!j)return c?.error?.("TOKEN_REFRESH",`${a} refresh returned no accessToken`,{payload:g}),null;let k=h?.refreshToken||b;if(h?.expiresAt){let a=new Date(h.expiresAt).getTime()-Date.now();Number.isFinite(a)&&a>0&&(d=Math.floor(a/1e3))}else"number"==typeof h?.expiresIn&&(d=h.expiresIn);return c?.info?.("TOKEN_REFRESH",`Successfully refreshed ${a} token`,{hasNewAccessToken:!0,hasNewRefreshToken:k!==b,expiresIn:d}),{accessToken:j,refreshToken:k,expiresIn:d}}catch(b){return c?.error?.("TOKEN_REFRESH",`${a} refresh error: ${b.message}`),null}},c):(c?.warn?.("TOKEN_REFRESH",`No Cline refreshUrl configured for ${a}`),null)}}};
1
+ "use strict";exports.id=9154,exports.ids=[4575,6956,9154],exports.modules={46956:(a,b,c)=>{c.d(b,{proxyAwareFetch:()=>r});var d=c(27910),e=c(8735);let f=globalThis.fetch,g=new Map;function h(a,b){let c=e.v1.directFallbackTimeoutMs;if(b?.signal)return f(a,b);let d=new AbortController,g=setTimeout(()=>d.abort(Error(`fetch connect timeout (${c}ms)`)),c);return f(a,{...b,signal:d.signal}).finally(()=>clearTimeout(g))}let i=new Map,j=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],k=["8.8.8.8","8.8.4.4"];function l(a){return null==a?"":String(a).trim()}async function m(a){let b=i.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(k);let g=d(f.resolve4.bind(f)),h=await g(a);return i.set(a,{ip:h[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),h[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function n(a,b){let c,d=l(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function o(a){let b=l(a);return b?/^[a-z][a-z0-9+.-]*:\/\//i.test(b)?b:`http://${b}`:null}async function p(a){let b=o(a);if(!b)return null;if(!g.has(b)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{ProxyAgent:a}=await c.e(3433).then(c.t.bind(c,3433,19));g.set(b,new a({uri:b}))}return g.get(b)}async function q(a,b,f){let g=await Promise.resolve().then(c.t.bind(c,55591,23)),h=await Promise.resolve().then(c.t.bind(c,91645,23)),i=g.default??g,j=h.default??h;return new Promise((c,g)=>{let h=new j.Socket,k=!1,l=(a,b)=>{k||(k=!0,clearTimeout(m),o(),a(b))},m=setTimeout(()=>{h.destroy(),l(g,Error(`[ProxyFetch] MITM bypass connect timeout after ${e.v1.directFallbackTimeoutMs}ms`))},e.v1.directFallbackTimeoutMs),n=()=>{h.destroy(),l(g,Error("[ProxyFetch] MITM bypass request aborted"))},o=()=>{f.signal&&f.signal.removeEventListener("abort",n)};if(f.signal){if(f.signal.aborted)return void n();f.signal.addEventListener("abort",n,{once:!0})}h.connect(443,b,()=>{let b={socket:h,servername:a.hostname,path:a.pathname+a.search,method:f.method||"POST",headers:{...f.headers,Host:a.hostname}},e=i.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};l(c,b)});e.on("error",a=>l(g,a)),f.body&&e.write("string"==typeof f.body?f.body:JSON.stringify(f.body)),e.end()}),h.on("error",a=>l(g,a))})}async function r(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=l(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=l(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=l(b?.noProxy??b?.connectionNoProxy);return d&&n(a,d)?null:o(c)}(d,c),i=g?null:o(function(a){let b,c;try{b=new URL(a).hostname.toLowerCase()}catch{return null}if(function(a){if(!a||"string"!=typeof a)return!1;let b=a.trim().toLowerCase().replace(/^\[|\]$/g,"");if("localhost"===b||b.endsWith(".localhost")||"0.0.0.0"===b||"::"===b||"::1"===b)return!0;let c=b.split(".");if(4===c.length&&c.every(a=>/^\d+$/.test(a)&&Number(a)>=0&&255>=Number(a))){let[a,b]=c.map(Number);return 127===a||10===a||192===a&&168===b||172===a&&!!(b>=16)&&!!(b<=31)||169===a&&254===b||100===a&&!!(b>=64)&&!!(b<=127)}return!!(b.includes(":")&&(b.startsWith("fc")||b.startsWith("fd")||b.startsWith("fe80")))}(b)||n(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{c=new URL(a).protocol}catch{return null}return"https:"===c?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),k=g||i;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(d)){if(k)try{let c=await p(k);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.onProxyFallback)try{c.onProxyFallback(a)}catch{}console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await m(a.hostname);if(c)return await q(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}if(k)return h(d,b)}if(k)try{let c=await p(k);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.onProxyFallback)try{c.onProxyFallback(a)}catch{}return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`),h(d,b)}let s=c?.proxyPoolId||c?.enabled===!0||c?.connectionProxyEnabled===!0||!!l(c?.url??c?.connectionProxyUrl);if(c?.strictProxy===!0&&s)throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");return f(a,b)}async function s(a,b={}){return r(a,b,null)}globalThis.fetch!==s&&(globalThis.fetch=s)},47153:(a,b,c)=>{c.d(b,{$B:()=>o,I9:()=>f.I9,Og:()=>i,Ql:()=>f.Ql,Sc:()=>j,jR:()=>f.jR,jT:()=>h,oD:()=>g,pb:()=>l});var d=c(52776),e=c(48991),f=c(98125);let g=3e5;function h(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 i(a){return e.Wu[a]?e.Wu[a]:"kimi-coding"===a&&e.Wu.kimi?e.Wu.kimi:g}function j(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 k=new Map;async function l(a,b){let d=a.client_email,f=k.get(d);if(f&&f.expiresAt-Date.now()>3e5)return{accessToken:f.token,expiresAt:f.expiresAt};try{let{SignJWT:f,importPKCS8:g}=await c.e(1261).then(c.bind(c,91261));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),l=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(!l.ok){let a=await l.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:m,expires_in:n}=await l.json(),o=Date.now()+(n??3600)*1e3;return k.set(d,{token:m,expiresAt:o}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:m,expiresAt:o}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}function m(a,b){let c=j(a.apiKey);return c?l(c,b):null}let n={"gemini-cli":(a,b)=>(0,f.I9)(a.refreshToken,d.xq["gemini-cli"].clientId,d.xq["gemini-cli"].clientSecret,b),antigravity:(a,b)=>(0,f.I9)(a.refreshToken,d.xq.antigravity.clientId,d.xq.antigravity.clientSecret,b),claude:(a,b)=>(0,f.ge)(a.refreshToken,b),codex:(a,b)=>(0,f.Wm)(a.refreshToken,b),iflow:(a,b)=>(0,f.AH)(a.refreshToken,b),github:(a,b)=>(0,f.EF)(a.refreshToken,b),kiro:(a,b)=>(0,f.Ql)(a.refreshToken,a.providerSpecificData,b),xai:(a,b)=>(0,f.r_)(a.refreshToken,b),"grok-cli":(a,b)=>(0,f.r_)(a.refreshToken,b),gcli:(a,b)=>(0,f.r_)(a.refreshToken,b),"codebuddy-cn":(a,b)=>(0,f.SO)(a.refreshToken,b),"codebuddy-intl":(a,b)=>(0,f.XB)(a.refreshToken,b),trae:(a,b)=>(0,f.RM)(a.refreshToken,a,b),cline:(a,b)=>(0,f.Il)("cline",a.refreshToken,b),clinepass:(a,b)=>(0,f.Il)("clinepass",a.refreshToken,b),zed:()=>(0,f.wt)(),windsurf:(a,b)=>(0,f.p9)(a,b),kimi:(a,b)=>(0,f.ng)(a.refreshToken,a,b),"kimi-coding":(a,b)=>(0,f.ng)(a.refreshToken,a,b),"minimax-code":(a,b)=>(0,f.refreshMinimaxCodeToken)("minimax-code",a.refreshToken,b),"minimax-code-global":(a,b)=>(0,f.refreshMinimaxCodeToken)("minimax-code-global",a.refreshToken,b),vertex:m,"vertex-partner":m};async function o(a,b,c){if(!b.refreshToken)return null;let d=n[a];return d?d(b,c):(0,f.J1)(a,b.refreshToken,b,c)}},48991:(a,b,c)=>{let d;c.d(b,{Cn:()=>n,Co:()=>x,IO:()=>A,Ic:()=>u,J5:()=>r,K:()=>s,NA:()=>z,QH:()=>o,Wu:()=>y,buildKimiHeaders:()=>B,go:()=>i,iO:()=>p,j5:()=>v,nZ:()=>t,sX:()=>j,uR:()=>q,x0:()=>l,zv:()=>w});var e=c(21820),f=c(52776),g=c(63100);let h=f.xq["gemini-cli"]?.cliVersion,i=f.xq["gemini-cli"]?.apiClient;function j(a="unknown"){let b;return`GeminiCLI/${h}/${a||"unknown"} (${(0,e.platform)()}; ${"ia32"===(b=(0,e.arch)())?"x86":b}; terminal)`}f.xq.codex?.cliVersion;let k=f.xq.github?.copilot||{},l={VSCODE_VERSION:k.vscodeVersion,COPILOT_CHAT_VERSION:k.chatVersion,USER_AGENT:k.userAgent,API_VERSION:k.apiVersion};function m(){let a=(0,e.platform)(),b=(0,e.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let n={ideType:9,platform:m(),pluginType:2},o="_ide",p=[{from:"You are a Claude agent, built on Anthropic's Claude Agent SDK.",to:""},{from:/You are Hermes(?: Agent)?(?:,\s*(?:an intelligent AI assistant|an AI assistant|an AI agent))?(?:,?\s*(?:built|created)\s+by\s+Nous Research)?\./gi,to:"You are an AI assistant."},{from:/opencode/gi,to:a=>"OpenCode"===a?"Antigravity":"OPENCODE"===a?"ANTIGRAVITY":"antigravity"},{from:/hermes-agent\.nousresearch\.com/gi,to:"antigravity.google.com"},{from:/hermes agent/gi,to:a=>a.startsWith("H")?"Antigravity":"antigravity"},{from:/nous research/gi,to:a=>a.startsWith("N")?"Google DeepMind":"google deepmind"},{from:/hermes-agent/gi,to:"antigravity"}],q="_ide",r=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),s={"User-Agent":g.Of},t={"gemini-cli":{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},antigravity:{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"}},u={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:m(),pluginType:2})},v={"Content-Type":"application/json","User-Agent":g.Of},w={ideType:9,platform:m(),pluginType:2},x="You are Claude Code, Anthropic's official CLI for Claude.",y=Object.fromEntries(Object.entries(f.sr).filter(([,a])=>a.refreshLeadMs).map(([a,b])=>[a,b.refreshLeadMs])),z={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:f.sr.codex?.tokenUrl,auth:f.sr.codex?.authorizeUrl},anthropic:{token:f.sr.claude?.tokenUrl,auth:"https://api.anthropic.com/v1/oauth/authorize"},iflow:{token:f.sr.iflow?.tokenUrl,auth:f.sr.iflow?.authorizeUrl},github:{token:f.sr.github?.tokenUrl,auth:f.sr.github?.authorizeUrl,deviceCode:f.sr.github?.deviceCodeUrl}};function A(){if(d)return d;try{d=c(90053).rE||"0.0.0"}catch{d=process.env.npm_package_version||"0.0.0"}return d}function B(a){let b=(0,e.platform)(),c=(0,e.arch)(),d=`${b} ${c}`;"darwin"===b?d=`macOS ${c}`:"win32"===b?d=`Windows ${c}`:"linux"===b&&(d=`Linux ${c}`);let f="unknown";try{f=(0,e.hostname)()||"unknown"}catch{f="unknown"}let g="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"9router","X-Msh-Version":A(),"X-Msh-Device-Name":f,"X-Msh-Device-Model":d,"X-Msh-Device-Id":g}}},56463:(a,b,c)=>{c.d(b,{fd:()=>e,w$:()=>f});let d=c(90053).rE||"0.0.0";function e(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}function f(a,b={}){let c,g=(c=e(a))?`Bearer ${c}`:"",h={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`9Router/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"9router","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return g&&(h.Authorization=g),h}},79154:(a,b,c)=>{c.d(b,{Dz:()=>i,Vq:()=>l,fp:()=>j});var d=c(47153),e=c(53223);let f=e.sr.codex?.maxRefreshAgeMs,g=new Map;function h(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 i(a){return h(a?.expiresAt??a?.tokenExpiresAt)}function j(a,b,c=Date.now()){if(!b)return!1;let g=i(b);if(null!==g&&g-c<(0,d.Og)(a))return!0;let k=e.sr[a]?.maxRefreshAgeMs;return!!(k&&b.refreshToken&&function(a,b=Date.now(),c=f){let d=h(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!d||b-d>=c}(b,c,k))}async function k(a,b,c){let d,e=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),f=g.get(e);if(f)return f;let h=Promise.resolve().then(c).finally(()=>{g.delete(e)});return g.set(e,h),h}async function l(a,b,c){return b?k(a,b,async()=>{let f=await (0,d.$B)(a,b,c);return function(a,b,c,f=Date.now()){var g,h;if(!c)return null;if((0,d.jT)(c))return c;let i={},j=new Date(f).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,f)):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),(e.sr[a]?.trackRefreshAt||i.accessToken||i.apiKey||i.token||i.refreshToken||i.copilotToken)&&(i.lastRefreshAt=c.lastRefreshAt||j),i}(a,b,f)}):null}},98125:(a,b,c)=>{c.d(b,{J1:()=>o,ge:()=>q,Il:()=>H,XB:()=>A,SO:()=>z,Wm:()=>t,jR:()=>y,EF:()=>x,I9:()=>r,AH:()=>w,ng:()=>p,Ql:()=>v,refreshMinimaxCodeToken:()=>B,RM:()=>D,p9:()=>G,r_:()=>m,wt:()=>F});var d=c(52776),e=c(48991),f=c(46956);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();return g.set(e,{result:a,expiresAt:Date.now()+1e4}),a}catch(a){throw g.delete(e),a}})();return g.set(e,{promise:h}),h}var i=c(56463);let j=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function k(a){return"string"==typeof a?a.trim():""}let l=null;async function m(a,b){return a?h("xai",a,async()=>{try{l||(l=new(await c.e(8749).then(c.bind(c,38749))).XaiService);let b=await l.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 n={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 o(a,b,c,e){let f=d.xq[a],g=n[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 p(a,b,c){return o("kimi",a,b,c)}async function q(a,b){return o("claude",a,{},b)}async function r(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}function s(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))}}async function t(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=s(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 u(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(3433),c.e(539),c.e(5692),c.e(5210),c.e(6492),c.e(9046)]).then(c.bind(c,46492));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function v(a,b,c,e=null){return a?h("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,i=b?.clientSecret,l=b?.region;if("external_idp"===g){let d;try{d=function(a,b={}){var c;let d=k(b.clientId||b.client_id),e=function(a){let b,c=k(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 d=b.hostname.toLowerCase();if(!j.has(d))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}(b.tokenEndpoint||b.token_endpoint),f=Array.isArray(c=b.scope||b.scopes)?c.map(k).filter(Boolean).join(" "):k(c);if(!a)throw Error("refresh token is required");if(!d)throw Error("clientId is required for external_idp refresh");if(!f)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:e,body:new URLSearchParams({grant_type:"refresh_token",client_id:d,refresh_token:a,scope:f}),providerSpecificData:{...b,authMethod:"external_idp",clientId:d,tokenEndpoint:e,scope:f}}}(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&&i){let d="idc"===g&&l?`https://oidc.${l}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",j=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:i,refreshToken:a,grantType:"refresh_token"})},e);if(!j.ok){let a=await j.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:j.status,error:a}),null}let k=await j.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!k.accessToken,expiresIn:k.expiresIn}),{accessToken:k.accessToken,refreshToken:k.refreshToken||a,expiresIn:k.expiresIn,...await u(b,k.accessToken,k.profileArn)}}let m=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(!m.ok){let a=await m.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:m.status,error:a}),null}let n=await m.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!n.accessToken,expiresIn:n.expiresIn}),{accessToken:n.accessToken,refreshToken:n.refreshToken||a,expiresIn:n.expiresIn,...await u(b,n.accessToken,n.profileArn)}},c):null}async function w(a,b){return o("iflow",a,{},b)}async function x(a,b){return o("github",a,{},b)}async function y(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 z(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 A(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 B(a,b,c,e=null){return b?h(a,b,async()=>{let g=d.sr[a],h=g?.tokenUrl||("minimax-code-global"===a?"https://account.minimax.io/oauth2/token":"https://account.minimax.cn/oauth2/token");try{let d=await (0,f.proxyAwareFetch)(h,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",client_id:g?.clientId||"mcode-public",refresh_token:b}).toString()},e);if(!d.ok){let b=await d.text(),e=s(d.status,b);if(c?.warn?.("TOKEN_REFRESH",`Failed to refresh MiniMax Code token (${a})`,{status:d.status,error:b,code:e.code,permanent:e.permanent}),e.permanent)return{error:e.code||"invalid_grant"};return null}let i=await d.json();return c?.info?.("TOKEN_REFRESH",`Successfully refreshed MiniMax Code token (${a})`,{hasNewAccessToken:!!i.access_token,hasNewRefreshToken:!!i.refresh_token,expiresIn:i.expires_in}),{accessToken:i.access_token,refreshToken:i.refresh_token||b,expiresIn:i.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Network error refreshing MiniMax Code token (${a}): ${b.message}`),null}},c):null}let C={intl:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai"],cn:["https://api.trae.com.cn","https://api.marscode.cn","https://api.trae.cn"]};async function D(a,b,c){if(!a)return null;let e=d.sr.trae||{},f=function(a){let b=a?.providerSpecificData||{},c=String(b.site||"").trim().toLowerCase();if("cn"===c||"intl"===c)return c;let d=String(b.loginHost||b.host||"").trim().toLowerCase();return d.endsWith("trae.cn")||d.endsWith("trae.com.cn")||d.endsWith("marscode.cn")||"marscode-cn"===String(b.scope||"")?"cn":"intl"}(b),g=new URL(e.exchangeTokenUrl||e.tokenUrl||"https://api.marscode.com/cloudide/api/v3/trae/oauth/ExchangeToken").pathname,i=C[f].map(a=>`${a}${g}`);return i.length?h("trae",a,async()=>{for(let b of i){let d=await E(b,a,e,c,f);if(d)return d}return null},c):(c?.warn?.("TOKEN_REFRESH","No Trae exchangeTokenUrl configured"),null)}async function E(a,b,c,d,e){try{let f,g=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"Trae/1.0.0 antigravity-cockpit-tools"},body:JSON.stringify({ClientID:c.clientId||"ono9krqynydwx5",RefreshToken:b,ClientSecret:c.clientSecret||"-",UserID:""})});if(!g.ok){let b=await g.text();return d?.warn?.("TOKEN_REFRESH","Trae token refresh rejected",{site:e,origin:new URL(a).origin,status:g.status,error:String(b||"").slice(0,200)}),null}let h=await g.json(),i=h?.Result||h?.result||h,j=i?.AccessToken||i?.accessToken;if(!j)return d?.error?.("TOKEN_REFRESH","Trae refresh returned no AccessToken",{payload:h}),null;let k=i?.RefreshToken||i?.refreshToken||b,l=i?.ExpiresAt||i?.expiresAt;if("number"==typeof l)f=Math.max(1,l-Math.floor(Date.now()/1e3));else if("string"==typeof l){let a=new Date(l).getTime()-Date.now();f=a>0?Math.floor(a/1e3):void 0}return d?.info?.("TOKEN_REFRESH","Successfully refreshed Trae token",{site:e,hasNewAccessToken:!!j,hasNewRefreshToken:k!==b,expiresIn:f}),{accessToken:j,refreshToken:k,expiresIn:f}}catch(a){return d?.error?.("TOKEN_REFRESH",`Error refreshing Trae token (${e}): ${a.message}`),null}}function F(){return null}async function G(a,b){return b?.info?.("TOKEN_REFRESH","windsurf: apiKey is long-lived (no refresh_token flow) — skipping"),null}async function H(a,b,c){if(!b)return null;let e=(d.sr[a]||d.sr.cline||{}).refreshUrl;return e?h(a,b,async()=>{try{let d,f=await fetch(e,{method:"POST",headers:(0,i.w$)(null,{"Content-Type":"application/json",Accept:"application/json"}),body:JSON.stringify({refreshToken:b,grantType:"refresh_token",clientType:"extension"})});if(!f.ok){let b=await f.text(),d=s(b,f.status);if(d.permanent)return c?.error?.("TOKEN_REFRESH",`${a} refresh token invalid or expired — re-auth required`,{status:f.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return c?.error?.("TOKEN_REFRESH",`Failed to refresh ${a} token`,{status:f.status,error:b}),null}let g=await f.json(),h=g?.data||g,j=(0,i.fd)(h?.accessToken);if(!j)return c?.error?.("TOKEN_REFRESH",`${a} refresh returned no accessToken`,{payload:g}),null;let k=h?.refreshToken||b;if(h?.expiresAt){let a=new Date(h.expiresAt).getTime()-Date.now();Number.isFinite(a)&&a>0&&(d=Math.floor(a/1e3))}else"number"==typeof h?.expiresIn&&(d=h.expiresIn);return c?.info?.("TOKEN_REFRESH",`Successfully refreshed ${a} token`,{hasNewAccessToken:!0,hasNewRefreshToken:k!==b,expiresIn:d}),{accessToken:j,refreshToken:k,expiresIn:d}}catch(b){return c?.error?.("TOKEN_REFRESH",`${a} refresh error: ${b.message}`),null}},c):(c?.warn?.("TOKEN_REFRESH",`No Cline refreshUrl configured for ${a}`),null)}}};
@@ -1,8 +1,8 @@
1
- "use strict";exports.id=9489,exports.ids=[9489],exports.modules={3894:(a,b,c)=>{c.d(b,{F_:()=>g,Nc:()=>h,Qh:()=>t,Su:()=>q,ag:()=>o,kI:()=>p,rl:()=>u,sy:()=>s});var d=c(79646),e=c(33873),f=c.n(e);let g=["code","ml"],h={code:["tree-sitter","tree-sitter-language-pack"],ml:["torch","huggingface-hub"]},i="win32"===process.platform,j=i?"where":"which",k=i?[`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python313\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python312\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python311\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python310\\Scripts`,`${process.env.APPDATA||""}\\Python\\Python313\\Scripts`]:["/usr/local/bin","/opt/homebrew/bin","/Library/Frameworks/Python.framework/Versions/3.13/bin","/Library/Frameworks/Python.framework/Versions/3.12/bin","/Library/Frameworks/Python.framework/Versions/3.11/bin","/Library/Frameworks/Python.framework/Versions/3.10/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],l=[...k,process.env.PATH||""].filter(Boolean).join(f().delimiter),m=["python3.13","python3.12","python3.11","python3.10","python3","python"],n=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]),o=process.env.HEADROOM_URL||"http://localhost:8787";function p(){try{let a=(0,d.execSync)(`${j} headroom`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l}}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function q(){let a=null;for(let b of function(){let a=[],b=p();if(b){let c=f().dirname(b);for(let b of i?["python.exe","python3.exe"]:["python3","python3.13","python"])a.push(f().join(c,b))}for(let b of k)if(b)for(let c of m)a.push(f().join(b,i?`${c}.exe`:c));return a.push(...m),a}())try{let c=(0,d.execSync)(`${b} --version`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l}}).toString().trim().match(/(\d+)\.(\d+)/);if(!c)continue;let[e,f]=[parseInt(c[1],10),parseInt(c[2],10)];if(!(e>3||3===e&&f>=10))continue;a||(a=b);try{return(0,d.execFileSync)(b,["-m","pip","show","headroom-ai"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}),b}catch{}}catch{}return a}async function r(a){if(!a)return!1;let b=String(a).replace(/\/$/,"");try{return(await fetch(`${b}/health`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function s(a){try{let b=new URL(a);return n.has(b.hostname)}catch{return!1}}async function t(a){let b=p(),c=q(),d=!!b,e=await r(a),f=s(a),g=d?u(c):{installed:!1,version:null,extras:{code:!1,ml:!1}};return{installed:d,path:b,running:e,python:c,localUrl:f,canStart:d&&f,version:g.version,extras:g.extras}}function u(a){let b=a||q();if(!b)return{installed:!1,version:null,extras:{code:!1,ml:!1}};try{let a=(0,d.execFileSync)(b,["-m","pip","list","--format=json","--disable-pip-version-check"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}).toString(),c=JSON.parse(a),e=new Set(c.map(a=>String(a.name||"").toLowerCase()));if(!e.has("headroom-ai"))return{installed:!1,version:null,extras:{code:!1,ml:!1}};let f=c.find(a=>a.name?.toLowerCase()==="headroom-ai")?.version||null,i={};for(let a of g)i[a]=h[a].some(a=>e.has(a));return{installed:!0,version:f,extras:i}}catch{return{installed:!1,version:null,extras:{code:!1,ml:!1}}}}},17603:(a,b,c)=>{c.d(b,{R8:()=>j,ar:()=>l,vB:()=>h});var d=c(66306);let e=["vision","pdf","audioInput","videoInput"],f=new Set(e);function g(a,b){var c;let d=Array.isArray(c=b?.capacityAdapter?.[a])?{enabled:!0,roundRobin:!1,models:c.map(a=>a?.model||a).filter(Boolean)}:c&&"object"==typeof c?{enabled:!1!==c.enabled,roundRobin:!!c.roundRobin,models:Array.isArray(c.models)?c.models.filter(Boolean):[]}:{enabled:!1,roundRobin:!1,models:[]};return d.enabled&&0===d.models.length?{...d,models:["oc/mimo-v2.6-flash-free"]}:d}function h(a,b){for(let c of[...a||[]].filter(a=>f.has(a))){let{enabled:a,models:d}=g(c,b);if(a&&0!==d.length)return function(a,b){let{enabled:c,roundRobin:d}=g(a,b);return c&&d?"round-robin":"fallback"}(c,b)}return"fallback"}function i(a,b){let c=a.indexOf("/"),e=c>0?a.slice(0,c):"",f=c>0?a.slice(c+1):a,g=(0,d.nl)(e,f);return b.every(a=>!0===g[a])}function j(a,b,c){let d=[...b||[]].filter(a=>f.has(a));if(0===d.length||!Array.isArray(a)||0===a.length||a.some(a=>i(a,d)))return a;let h=(function(a){let b=new Set,c=[];for(let d of e){let{enabled:e,models:f}=g(d,a);if(e)for(let a of f)b.has(a)||(b.add(a),c.push(a))}return c})(c).filter(b=>!a.includes(b)&&i(b,d));return 0===h.length?a:[...h,...a]}function k(a){return"string"==typeof a?a.length:Array.isArray(a)?a.reduce((a,b)=>a+("string"==typeof b?.text?b.text.length:50),0):0}function l(a,b){let c=new Set(b);return 0===c.size?a:(b,e,...f)=>{if(c.has(e)){let a=e.indexOf("/"),c=a>0?e.slice(0,a):"",f=a>0?e.slice(a+1):e,{contextWindow:g}=(0,d.nl)(c,f);b=function(a,b){let c=Array.isArray(a.messages)?"messages":Array.isArray(a.input)?"input":Array.isArray(a.contents)?"contents":null;if(!c)return a;let d=a[c];if(!d||0===d.length)return a;let e=a=>"system"===a||"developer"===a,f=d.filter(a=>e(a?.role)),g=d.filter(a=>!e(a?.role));if(0===g.length)return a;let h=a=>"assistant"===a||"model"===a,i=g.length-1;for(;i>=0&&!h(g[i]?.role);)i--;let j=g.slice(i+1),l=g.slice(0,i+1);if(0===l.length)return a;let m=a=>a.content??a.parts,n=.8*(b||2e5)*4,o=l.slice(0,6),p=f.concat(o,j).reduce((a,b)=>a+k(m(b)),0);for(;p>n&&o.length>0;)p-=k(m(o.pop()));return o.length===l.length?a:{...a,[c]:[...f,...o,...j]}}(b,g)}return a(b,e,...f)}}},38775:(a,b,c)=>{c.d(b,{getComboModels:()=>j,mA:()=>i});var d=c(89718),e=c(40669),f=c(44386);let g={xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan"},h=new Set(Object.keys(g));for(let a of f.default)for(let b of(h.add(a.id),a.alias&&h.add(a.alias),a.aliases||[]))h.add(b);async function i(a,{inferFallback:b=!0}={}){let c,f=(c=(0,e.Xh)(a),c?.providerAlias&&g[c.providerAlias]?{...c,provider:g[c.providerAlias]}:c);if(!f.isAlias){if(!h.has(f.providerAlias)){let a=(await (0,d.Fh)({type:"openai-compatible"})).find(a=>a.prefix===f.providerAlias);if(a)return{provider:a.id,model:f.model};let b=(await (0,d.Fh)({type:"anthropic-compatible"})).find(a=>a.prefix===f.providerAlias);if(b)return{provider:b.id,model:f.model};let c=(await (0,d.Fh)({type:"custom-embedding"})).find(a=>a.prefix===f.providerAlias);if(c)return{provider:c.id,model:f.model}}return{provider:f.provider,model:f.model}}if(await (0,d.Dj)(f.model))return{provider:null,model:f.model};let j=await (0,e.XO)(a,d.OM);return j||((0,e.hb)(f.model)?{provider:"codex",model:f.model}:b?(0,e.js)(a,d.OM):{provider:null,model:f.model})}async function j(a){if(a.includes("/"))return null;let b=await (0,d.Dj)(a);return b&&b.models&&b.models.length>0?b.models:null}},41255:(a,b,c)=>{let d;c.d(b,{t:()=>q});var e=c(78591),f=c(38775),g=c(83017),h=c(66306),i=c(47370);function j(a,b=2e3){let c=String(a??"").trim();return c.length>b?`${c.slice(0,b)}…`:c}function k(a){return a?"string"==typeof a?a:String(a.name||a.function?.name||""):""}var l=c(7803);async function m(a){try{let b=await (0,f.mA)(a);if(!b?.provider)return null;let c=(0,h.nl)(b.provider,b.model);if(!c)return null;return{name:b.model,provider:b.provider,model:b.model,vision:!!c.vision,tools:!!c.tools,pdf:!!c.pdf,search:!!c.search,contextWindow:c.contextWindow||0}}catch{return null}}let n={at:0,byKey:new Map};async function o(a){if(Date.now()-n.at<6e4)return n.byKey;try{let{getUsageDashboard:a}=await Promise.resolve().then(c.bind(c,47370)),b=await a({minRequests:10}),d=new Map;for(let a of b.models||[])d.set(`${a.provider}|${a.model}`,{health:a.score,successRate:a.successRate});n={at:Date.now(),byKey:d}}catch{}return n.byKey}let p=Number.isFinite(d=parseInt(process.env.COMBO_ROUTER_DECISION_TIMEOUT_MS,10))&&d>0?d:8e3;function q(a){let b;return Promise.race([r(a),new Promise(a=>{b=setTimeout(()=>a(null),p)})]).finally(()=>clearTimeout(b))}async function r({routerModel:a,body:b,candidates:c,logTag:d="COMBO",apiKey:h=null,endpoint:n="/v1/chat/completions"}){try{let p,q;if(!a||!c?.length)return null;let r=await (0,f.mA)(a);if(!r?.provider)return l.warn(d,`router: unknown routerModel '${a}', using fallback order`),null;let s=await o(c),t=new Map;for(let a of c){let b=await m(a)||{},c=b.provider?s.get(`${b.provider}|${b.model}`):null;t.set(a,c?{...b,...c}:b)}let u={...function(a,b=[],c=null){let d=j(function(a){let b=Array.isArray(a?.messages)?a.messages:[];for(let a=b.length-1;a>=0;a--){let c=b[a];if(c?.role!=="user")continue;let d=c.content;if("string"==typeof d)return d;if(Array.isArray(d))return d.filter(a=>a&&"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("\n");break}return""}(a)),e=(Array.isArray(a?.tools)?a.tools:[]).map(k).filter(Boolean).slice(0,12),f=e.length>0||a?.tool_choice!=null,g=a?.stream===!0,h=b.map(a=>{let b=c?c(a):null,d=[];b?.vision&&d.push("vision"),b?.tools&&d.push("tools"),b?.pdf&&d.push("pdf"),b?.search&&d.push("search");let e=b?.contextWindow?` ~${Math.round(b.contextWindow/1e3)}k ctx`:"",f=b?.health!=null?`, health ${b.health}/100 (success ${b.successRate}%)`:"",g=j(b?.name||a,80);return`- ${a} (${g}${e?`,${e}`:""}${d.length?`, ${d.join("/")}`:""}${f})`});return{state:[d?`User request: ${d}`:"User request: (no text content in this turn)",`Client expects: ${g?"streaming":"non-streaming"} reply${f?"; tool/function calling in play":""}`,e.length?`Tools offered: ${e.join(", ")}`:"",`Candidate models (pick exactly one id):
2
- ${h.join("\n")}`].filter(Boolean).join("\n"),questions:{pick_model:{type:"choice",instructions:"Pick the single best candidate model id to answer this request. Answer with the model id only.",options:b.map(a=>j(a,64))}}}}(b,c,a=>t.get(a)||null),model:`${r.provider}/${r.model}`},v=await (0,e.c1)(r.provider,new Set,r.model);if(!v||v.allRateLimited)return l.warn(d,`router: no usable credentials for ${a}, using fallback order`),null;let w=await (0,g.l)({body:u,modelInfo:{provider:r.provider,model:r.model},credentials:v,log:l,onRequestSuccess:async()=>{await (0,e.Pt)(v.connectionId,v,r.model)}});if(!w?.success)return l.warn(d,`router: decision failed (${w?.status}: ${w?.error||"unknown"}), using fallback order`),null;let x=await w.response.json().catch(()=>null);w.usage&&(0,i.sZ)({provider:r.provider,model:r.model,connectionId:v.connectionId,apiKey:h,endpoint:n,tokens:{...w.usage,total_tokens:w.usage.prompt_tokens+w.usage.completion_tokens},status:"success"}).catch(()=>{});let y=(p=x?.answers??x?.result?.answers??x?.result??x,q=function(a){if(null==a)return null;if("string"==typeof a)return a;if("object"!=typeof a)return null;if("string"==typeof a.choice)return a.choice;if(Array.isArray(a.choices)&&a.choices.length>0){let b=a.choices[0];return"string"==typeof b?b:b?.text??b?.value??null}if("string"==typeof a.value)return a.value;if("string"==typeof a.text)return a.text;if("string"==typeof a.answer)return a.answer;if(null!=a.selected){let b=a.selected;return"string"==typeof b?b:b?.text??b?.value??null}return null}(p?.pick_model??(p&&"object"==typeof p&&!Array.isArray(p)?Object.values(p)[0]:null)),"string"!=typeof q?null:q.trim()||null),z=function(a,b=[]){if("string"!=typeof a||!a)return null;if(b.includes(a))return a;let c=b.filter(b=>b.endsWith(`/${a}`));return 1===c.length?c[0]:null}(y,c);if(!z)return l.warn(d,`router: decision picked '${y??"(unparsable)"}' outside the candidate set, using fallback order`),null;return l.info(d,`router: ${a} → ${z} of ${c.length} candidates`),z}catch(a){return l.warn(d,`router: decision errored (${a?.message||a}), using fallback order`),null}}},46634:(a,b,c)=>{c.d(b,{Mo:()=>h,RG:()=>l,V:()=>i,Y8:()=>k,xl:()=>m});var d=c(1932),e=c(87155);let f=null,g=null;function h(){return f?{loaded:!0,version:f.version,loadedAt:f.loadedAt}:{loaded:!1}}async function i(){return f||g||(g=j().finally(()=>{g=null}))}async function j(){let a=(0,e.S1)();if(!a.installed){let a=Error("PXPIPE is not installed");throw a.code="NOT_INSTALLED",a}let b=`${(0,d.pathToFileURL)((0,e.CG)()).href}?v=${encodeURIComponent(a.version||"0")}`,c=await import(b);if("function"!=typeof c.transformAnthropicMessages)throw Error("installed pxpipe package does not export transformAnthropicMessages");return f={module:c,version:a.version,loadedAt:Date.now()}}function k(){let a=!!f;return f=null,a}async function l({autoLoad:a=!0}={}){try{if(!f&&!a)return null;let{module:b}=await i();return b.transformAnthropicMessages}catch{return null}}async function m(){let a=Date.now(),{module:b}=await i(),c=new TextEncoder().encode(JSON.stringify({model:"claude-fable-5",max_tokens:16,messages:[{role:"user",content:"ping"}]})),d=await b.transformAnthropicMessages({body:c,model:"claude-fable-5"});if(!d||"boolean"!=typeof d.applied||!(d.body instanceof Uint8Array))throw Error("transform returned an unexpected shape");return{ok:!0,reason:d.reason,durationMs:Date.now()-a}}},46945:(a,b,c)=>{c.d(b,{V:()=>e});let d=/\[1m\]$/i;function e(a){if("string"!=typeof a)return{model:a,contextMarker:null};let b=a.trim(),c=b.match(d);return c?{model:b.slice(0,-c[0].length),contextMarker:c[0].slice(1,-1).toLowerCase()}:{model:a,contextMarker:null}}},54174:(a,b,c)=>{c.d(b,{Yy:()=>u});var d=c(89718),e=c(66489),f=c(40615),g=c(66306),h=c(14170),i=c(7803);let j="x-10r-internal-compaction",k=/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uac00-\ud7af]/g;function l(a){if(!a)return 0;let b=String(a),c=(b.match(k)||[]).length;return Math.ceil(1.2*c+(b.length-c)/4)}let m=a=>{try{return JSON.stringify(a)}catch{return String(a)}};function n(a,b){if(null==a)return;if("string"==typeof a)return void b.parts.push(a);if(Array.isArray(a)){for(let c of a)n(c,b);return}if("object"!=typeof a)return void b.parts.push(String(a));let c=a.type;"image"===c||"image_url"===c||"input_image"===c||"document"===c||"file"===c?b.flat+=1e3:"tool_use"===c?b.parts.push(String(a.name||""),m(a.input)):"tool_result"===c?n(a.content,b):"string"==typeof a.text?b.parts.push(a.text):b.parts.push(m(a))}function o(a){let b={parts:[],flat:0};n(a?.content,b);let c=b.parts.filter(Boolean).join(" ").replace(/\s+/g," ").trim();if(Array.isArray(a?.tool_calls)&&(c+=" "+a.tool_calls.map(a=>`call:${a?.function?.name}${a?.function?.arguments?`(${String(a.function.arguments).slice(0,200)})`:""}`).join(" ")),Array.isArray(a?.content))for(let b of a.content)b?.type==="tool_use"&&(c+=` call:${b.name}(${m(b.input).slice(0,200)})`),b?.type==="tool_result"&&(c+=" [tool-result]");let d=b.flat?` [media ~${Math.round(b.flat/1e3)}]`:"",e=a?.role||(a?.type==="function_call"?"assistant":"msg");return`<${e}> ${c}${d}`.trimEnd()}let p=a=>{let b=Number(a);return Number.isFinite(b)&&b>=.5&&b<=.98?b:.9},q=null;async function r(){let a=Date.now();if(q&&a-q.at<3e4)return q;let b={},c=[],f=[];try{b=await (0,e.SZ)()||{}}catch{}try{c=await (0,d.uv)()||[]}catch{}try{f=await (0,d.Uv)()||[]}catch{}let g=Object.fromEntries((f||[]).map(a=>[a?.name,a?.models]));return q={at:a,caps:b,customs:function(a){let b=new Map;for(let c of a||[]){if(!c?.id||!c?.providerAlias)continue;let a=String(c.id),d=String(c.providerAlias);b.set(`${d}::${a}`,c)}return b}(c),combos:f||[],comboByName:g}}let s=a=>{let b="string"==typeof a?Number(a):a;return Number.isFinite(b)&&b>0?Math.floor(b):null};async function t(a){let b=String(a||""),c=b.indexOf("/"),{caps:d,customs:e,combos:h,comboByName:i}=await r();if(c<=0){let a=h.find(a=>a?.name===b);if(!a||!Array.isArray(a.models)||0===a.models.length)return null;let c=d[b]?.[b]||d.combo?.[b];if(c&&(s(c.contextWindow)||s(c.maxOutput)))return{contextWindow:s(c.contextWindow),maxOutput:s(c.maxOutput)};let j=(0,g.Q5)(a.models,i,a=>{let b="string"==typeof a?a.indexOf("/"):-1;if(-1===b)return null;let c=a.slice(0,b),g=a.slice(b+1),h=f.js[c]||c,i=g.split(":")[0],j=d[c]?.[g]||d[h]?.[g]||d[c]?.[i]||d[h]?.[i];if(j&&(s(j.contextWindow)||s(j.maxOutput))){let a={};return s(j.contextWindow)&&(a.contextWindow=s(j.contextWindow)),s(j.maxOutput)&&(a.maxOutput=s(j.maxOutput)),a}let k=e.get(`${c}::${g}`)||e.get(`${h}::${g}`)||e.get(`${c}::${i}`)||e.get(`${h}::${i}`);if(k&&(s(k.contextWindow)||s(k.maxOutput))){let a={};return s(k.contextWindow)&&(a.contextWindow=s(k.contextWindow)),s(k.maxOutput)&&(a.maxOutput=s(k.maxOutput)),a}return null});return j?{contextWindow:s(j.contextWindow),maxOutput:s(j.maxOutput)}:null}let j=b.slice(0,c),k=b.slice(c+1),l=f.js[j]||j,m=k.split(":")[0],n=d[j]?.[k]||d[l]?.[k]||d[j]?.[m]||d[l]?.[m];if(n&&(s(n.contextWindow)||s(n.maxOutput)))return{contextWindow:s(n.contextWindow),maxOutput:s(n.maxOutput)};let o=e.get(`${j}::${k}`)||e.get(`${l}::${k}`)||e.get(`${j}::${m}`)||e.get(`${l}::${m}`),p=(0,g.nl)(l,m!==k?m:k)||{};return{contextWindow:s(o?.contextWindow)??(s(p.contextWindow)||null),maxOutput:s(o?.maxOutput)??(s(p.maxOutput)||null)}}async function u({request:a,body:b,modelStr:c,endpoint:d,settings:e}){var f;let g;if(a?.headers?.get?.(j)==="1"||e?.autoCompactEnabled===!1||!b||!Array.isArray(b.messages)||b.messages.length<3)return!1;let k=(g=(0,h.t)(d,b))===h.h.CLAUDE||g===h.h.OPENAI||g===h.h.OPENAI_RESPONSES?g:Array.isArray(b?.messages)?b?.system!==void 0?h.h.CLAUDE:h.h.OPENAI:Array.isArray(b?.input)?h.h.OPENAI_RESPONSES:null;if(k!==h.h.CLAUDE&&k!==h.h.OPENAI)return!1;let q=function(a,b){let c=0,d=a=>{for(let b of(c+=a.flat||0,a.parts))c+=l(b)};if(b===h.h.CLAUDE&&a?.system!==void 0){let b={parts:[],flat:0};n(a.system,b),d(b)}for(let b of Array.isArray(a?.messages)?a.messages:Array.isArray(a?.input)?a.input:[])d(function(a){let b={parts:[],flat:8};if(!a||"object"!=typeof a)return b;if(n(a.content,b),"string"==typeof a.name&&b.parts.push(a.name),Array.isArray(a.tool_calls))for(let c of a.tool_calls){let a=c?.function?.arguments;b.parts.push(String(c?.function?.name||""),"string"==typeof a?a:m(a))}return"string"==typeof a.tool_call_id&&b.parts.push(a.tool_call_id),"object"==typeof a.action&&a.action&&b.parts.push(m(a.action)),b}(b));return a?.tools&&d({parts:[m(a.tools)],flat:0}),a?.tool_definitions&&d({parts:[m(a.tool_definitions)],flat:0}),a?.response_format&&d({parts:[m(a.response_format)],flat:0}),c}(b,k);if(q<4e3)return!1;let r=await t(c);if(!r?.contextWindow)return!1;let v=p(e?.autoCompactRatio),w=s(e?.autoCompactKeepMessages)||8,x=function({body:a,fmt:b,contextWindow:c,ratio:d,keepRecent:e,est:f}){let g=Array.isArray(a?.messages)?a.messages:null;if(!g||g.length<3||!Number.isFinite(c)||c<=0)return null;let i=Math.floor(c*p(d));if(f<i)return null;let j=function(a,b,c){if(!Array.isArray(a)||a.length<3)return -1;let d=Math.max(1,a.length-c);for(let c=d;c<a.length;c++){let d=a[c];if(d&&"user"===d.role&&!(b===h.h.CLAUDE&&function(a,b){return Array.isArray(a)&&a.some(a=>a&&"object"==typeof a&&a.type===b)}(d.content,"tool_result")))return c}return -1}(g,b,e);return j<=0||j>=g.length?null:{cut:j,threshold:i,est:f,prefix:g.slice(0,j),tail:g.slice(j)}}({body:b,fmt:k,contextWindow:r.contextWindow,ratio:v,keepRecent:w,est:q});if(!x)return!1;let y=Math.max(256,Math.min(1500,Math.floor(.1*r.contextWindow))),z=Math.max(2e3,x.threshold-y-1500),A=function(a,b){let c=(a||[]).map(o),d=[],e=0,f=0;for(let a=c.length-1;a>=0;a--){let g=l(c[a]);if(e+g>b&&d.length>0){f=a+1;break}d.unshift(c[a]),e+=g}return f>0&&d.unshift(`[…earlier ${f} messages omitted for length…]`),d.join("\n")}(x.prefix,z),B=null;try{B=new URL(a.url).origin}catch{}if(!B)return!1;let C=a.headers?.get?.("authorization"),D=new AbortController,E=setTimeout(()=>D.abort(),12e4),F="";try{let a,b,d,e=await fetch(`${B}/v1/chat/completions`,{method:"POST",signal:D.signal,headers:{"content-type":"application/json",[j]:"1",...C?{authorization:C}:{}},body:JSON.stringify({model:c,messages:[{role:"system",content:"你是对话压缩助手。请把下面的历史对话压缩成一段可供后续模型无缝接续的摘要。必须保留:用户的核心目标与约束、关键决定及理由、涉及的文件路径/函数名/代码标识符、重要的工具调用结果、未完成的任务与下一步。只输出摘要正文,不要寒暄或标题。"},{role:"user",content:A}],stream:!1,max_tokens:y,temperature:.3,enable_thinking:!1})});if(!e.ok)return i.warn("COMPACT",`summary call ${e.status} for ${c} — sending original request`),!1;f=await e.json(),a=f?.choices?.[0],b=a?.message?.content??a?.text,d="","string"==typeof b?d=b:Array.isArray(b)&&(d=b.map(a=>"string"==typeof a?a:a?.text||"").join("")),d.trim()||"string"!=typeof a?.message?.reasoning_content||(d=a.message.reasoning_content),F=d}catch(a){return i.warn("COMPACT",`summary failed for ${c}: ${a?.message||a} — sending original request`),!1}finally{clearTimeout(E)}return F&&F.trim()?(b.messages=[function(a,b,c){let d=`[Conversation summary of earlier context]
1
+ "use strict";exports.id=9489,exports.ids=[9489],exports.modules={3894:(a,b,c)=>{c.d(b,{F_:()=>g,Nc:()=>h,Qh:()=>t,Su:()=>q,ag:()=>o,kI:()=>p,rl:()=>u,sy:()=>s});var d=c(79646),e=c(33873),f=c.n(e);let g=["code","ml"],h={code:["tree-sitter","tree-sitter-language-pack"],ml:["torch","huggingface-hub"]},i="win32"===process.platform,j=i?"where":"which",k=i?[`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python313\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python312\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python311\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python310\\Scripts`,`${process.env.APPDATA||""}\\Python\\Python313\\Scripts`]:["/usr/local/bin","/opt/homebrew/bin","/Library/Frameworks/Python.framework/Versions/3.13/bin","/Library/Frameworks/Python.framework/Versions/3.12/bin","/Library/Frameworks/Python.framework/Versions/3.11/bin","/Library/Frameworks/Python.framework/Versions/3.10/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],l=[...k,process.env.PATH||""].filter(Boolean).join(f().delimiter),m=["python3.13","python3.12","python3.11","python3.10","python3","python"],n=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]),o=process.env.HEADROOM_URL||"http://localhost:8787";function p(){try{let a=(0,d.execSync)(`${j} headroom`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l}}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function q(){let a=null;for(let b of function(){let a=[],b=p();if(b){let c=f().dirname(b);for(let b of i?["python.exe","python3.exe"]:["python3","python3.13","python"])a.push(f().join(c,b))}for(let b of k)if(b)for(let c of m)a.push(f().join(b,i?`${c}.exe`:c));return a.push(...m),a}())try{let c=(0,d.execSync)(`${b} --version`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l}}).toString().trim().match(/(\d+)\.(\d+)/);if(!c)continue;let[e,f]=[parseInt(c[1],10),parseInt(c[2],10)];if(!(e>3||3===e&&f>=10))continue;a||(a=b);try{return(0,d.execFileSync)(b,["-m","pip","show","headroom-ai"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}),b}catch{}}catch{}return a}async function r(a){if(!a)return!1;let b=String(a).replace(/\/$/,"");try{return(await fetch(`${b}/health`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function s(a){try{let b=new URL(a);return n.has(b.hostname)}catch{return!1}}async function t(a){let b=p(),c=q(),d=!!b,e=await r(a),f=s(a),g=d?u(c):{installed:!1,version:null,extras:{code:!1,ml:!1}};return{installed:d,path:b,running:e,python:c,localUrl:f,canStart:d&&f,version:g.version,extras:g.extras}}function u(a){let b=a||q();if(!b)return{installed:!1,version:null,extras:{code:!1,ml:!1}};try{let a=(0,d.execFileSync)(b,["-m","pip","list","--format=json","--disable-pip-version-check"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}).toString(),c=JSON.parse(a),e=new Set(c.map(a=>String(a.name||"").toLowerCase()));if(!e.has("headroom-ai"))return{installed:!1,version:null,extras:{code:!1,ml:!1}};let f=c.find(a=>a.name?.toLowerCase()==="headroom-ai")?.version||null,i={};for(let a of g)i[a]=h[a].some(a=>e.has(a));return{installed:!0,version:f,extras:i}}catch{return{installed:!1,version:null,extras:{code:!1,ml:!1}}}}},17603:(a,b,c)=>{c.d(b,{R8:()=>j,ar:()=>l,vB:()=>h});var d=c(66306);let e=["vision","pdf","audioInput","videoInput"],f=new Set(e);function g(a,b){var c;let d=Array.isArray(c=b?.capacityAdapter?.[a])?{enabled:!0,roundRobin:!1,models:c.map(a=>a?.model||a).filter(Boolean)}:c&&"object"==typeof c?{enabled:!1!==c.enabled,roundRobin:!!c.roundRobin,models:Array.isArray(c.models)?c.models.filter(Boolean):[]}:{enabled:!1,roundRobin:!1,models:[]};return d.enabled&&0===d.models.length?{...d,models:["oc/mimo-v2.6-flash-free"]}:d}function h(a,b){for(let c of[...a||[]].filter(a=>f.has(a))){let{enabled:a,models:d}=g(c,b);if(a&&0!==d.length)return function(a,b){let{enabled:c,roundRobin:d}=g(a,b);return c&&d?"round-robin":"fallback"}(c,b)}return"fallback"}function i(a,b){let c=a.indexOf("/"),e=c>0?a.slice(0,c):"",f=c>0?a.slice(c+1):a,g=(0,d.nl)(e,f);return b.every(a=>!0===g[a])}function j(a,b,c){let d=[...b||[]].filter(a=>f.has(a));if(0===d.length||!Array.isArray(a)||0===a.length||a.some(a=>i(a,d)))return a;let h=(function(a){let b=new Set,c=[];for(let d of e){let{enabled:e,models:f}=g(d,a);if(e)for(let a of f)b.has(a)||(b.add(a),c.push(a))}return c})(c).filter(b=>!a.includes(b)&&i(b,d));return 0===h.length?a:[...h,...a]}function k(a){return"string"==typeof a?a.length:Array.isArray(a)?a.reduce((a,b)=>a+("string"==typeof b?.text?b.text.length:50),0):0}function l(a,b){let c=new Set(b);return 0===c.size?a:(b,e,...f)=>{if(c.has(e)){let a=e.indexOf("/"),c=a>0?e.slice(0,a):"",f=a>0?e.slice(a+1):e,{contextWindow:g}=(0,d.nl)(c,f);b=function(a,b){let c=Array.isArray(a.messages)?"messages":Array.isArray(a.input)?"input":Array.isArray(a.contents)?"contents":null;if(!c)return a;let d=a[c];if(!d||0===d.length)return a;let e=a=>"system"===a||"developer"===a,f=d.filter(a=>e(a?.role)),g=d.filter(a=>!e(a?.role));if(0===g.length)return a;let h=a=>"assistant"===a||"model"===a,i=g.length-1;for(;i>=0&&!h(g[i]?.role);)i--;let j=g.slice(i+1),l=g.slice(0,i+1);if(0===l.length)return a;let m=a=>a.content??a.parts,n=.8*(b||2e5)*4,o=l.slice(0,6),p=f.concat(o,j).reduce((a,b)=>a+k(m(b)),0);for(;p>n&&o.length>0;)p-=k(m(o.pop()));return o.length===l.length?a:{...a,[c]:[...f,...o,...j]}}(b,g)}return a(b,e,...f)}}},38775:(a,b,c)=>{c.d(b,{getComboModels:()=>j,mA:()=>i});var d=c(89718),e=c(40669),f=c(61351);let g={xmtp:"xiaomi-tokenplan","xiaomi-tokenplan":"xiaomi-tokenplan"},h=new Set(Object.keys(g));for(let a of f.default)for(let b of(h.add(a.id),a.alias&&h.add(a.alias),a.aliases||[]))h.add(b);async function i(a,{inferFallback:b=!0}={}){let c,f=(c=(0,e.Xh)(a),c?.providerAlias&&g[c.providerAlias]?{...c,provider:g[c.providerAlias]}:c);if(!f.isAlias){if(!h.has(f.providerAlias)){let a=(await (0,d.Fh)({type:"openai-compatible"})).find(a=>a.prefix===f.providerAlias);if(a)return{provider:a.id,model:f.model};let b=(await (0,d.Fh)({type:"anthropic-compatible"})).find(a=>a.prefix===f.providerAlias);if(b)return{provider:b.id,model:f.model};let c=(await (0,d.Fh)({type:"custom-embedding"})).find(a=>a.prefix===f.providerAlias);if(c)return{provider:c.id,model:f.model}}return{provider:f.provider,model:f.model}}if(await (0,d.Dj)(f.model))return{provider:null,model:f.model};let j=await (0,e.XO)(a,d.OM);return j||((0,e.hb)(f.model)?{provider:"codex",model:f.model}:b?(0,e.js)(a,d.OM):{provider:null,model:f.model})}async function j(a){if(a.includes("/"))return null;let b=await (0,d.Dj)(a);return b&&b.models&&b.models.length>0?b.models:null}},41255:(a,b,c)=>{let d;c.d(b,{t:()=>r});var e=c(75837),f=c(38775),g=c(83017),h=c(66306),i=c(47370);function j(a,b=2e3){let c=String(a??"").trim();return c.length>b?`${c.slice(0,b)}…`:c}function k(a){return a?"string"==typeof a?a:String(a.name||a.function?.name||""):""}function l(a){if(null==a)return null;if("string"==typeof a)return a;if("object"!=typeof a)return null;if("string"==typeof a.choice)return a.choice;if(Array.isArray(a.choices)&&a.choices.length>0){let b=a.choices[0];return"string"==typeof b?b:b?.text??b?.value??null}if("string"==typeof a.value)return a.value;if("string"==typeof a.text)return a.text;if("string"==typeof a.answer)return a.answer;if(null!=a.selected){let b=a.selected;return"string"==typeof b?b:b?.text??b?.value??null}return null}var m=c(7803);async function n(a){try{let b=await (0,f.mA)(a);if(!b?.provider)return null;let c=(0,h.nl)(b.provider,b.model);if(!c)return null;return{name:b.model,provider:b.provider,model:b.model,vision:!!c.vision,tools:!!c.tools,pdf:!!c.pdf,search:!!c.search,contextWindow:c.contextWindow||0}}catch{return null}}let o={at:0,byKey:new Map};async function p(a){if(Date.now()-o.at<6e4)return o.byKey;try{let{getUsageDashboard:a}=await Promise.resolve().then(c.bind(c,47370)),b=await a({minRequests:10}),d=new Map;for(let a of b.models||[])d.set(`${a.provider}|${a.model}`,{health:a.score,successRate:a.successRate});o={at:Date.now(),byKey:d}}catch{}return o.byKey}let q=Number.isFinite(d=parseInt(process.env.COMBO_ROUTER_DECISION_TIMEOUT_MS,10))&&d>0?d:8e3;function r(a){let b;return Promise.race([s(a),new Promise(a=>{b=setTimeout(()=>a(null),q)})]).finally(()=>clearTimeout(b))}async function s({routerModel:a,body:b,candidates:c,logTag:d="COMBO",apiKey:h=null,endpoint:o="/v1/chat/completions"}){try{let q,r;if(!a||!c?.length)return null;let s=await (0,f.mA)(a);if(!s?.provider)return m.warn(d,`router: unknown routerModel '${a}', using fallback order`),null;let t=await p(c),u=new Map;for(let a of c){let b=await n(a)||{},c=b.provider?t.get(`${b.provider}|${b.model}`):null;u.set(a,c?{...b,...c}:b)}let v={...function(a,b=[],c=null){let d=j(function(a){let b=Array.isArray(a?.messages)?a.messages:[];for(let a=b.length-1;a>=0;a--){let c=b[a];if(c?.role!=="user")continue;let d=c.content;if("string"==typeof d)return d;if(Array.isArray(d))return d.filter(a=>a&&"text"===a.type&&"string"==typeof a.text).map(a=>a.text).join("\n");break}return""}(a)),e=(Array.isArray(a?.tools)?a.tools:[]).map(k).filter(Boolean).slice(0,12),f=e.length>0||a?.tool_choice!=null,g=a?.stream===!0,h=b.map(a=>{let b=c?c(a):null,d=[];b?.vision&&d.push("vision"),b?.tools&&d.push("tools"),b?.pdf&&d.push("pdf"),b?.search&&d.push("search");let e=b?.contextWindow?` ~${Math.round(b.contextWindow/1e3)}k ctx`:"",f=b?.health!=null&&b.health<70?` [recently flaky: ${b.health}/100 over recent traffic${null!=b.successRate?`, ${b.successRate}% success`:""}]`:"",g=j(b?.name||a,80);return`- ${a} (${g}${e?`,${e}`:""}${d.length?`, ${d.join("/")}`:""})${f}`}),i=[d?`User request: ${d}`:"User request: (no text content in this turn)",`Client expects: ${g?"streaming":"non-streaming"} reply${f?"; tool/function calling in play":""}`,e.length?`Tools offered: ${e.join(", ")}`:"",`Candidate models (pick exactly one id):
2
+ ${h.join("\n")}`,"How to choose: prefer a member whose capabilities fit the request (tool calling, vision, pdf, context size). A member marked [recently flaky] should be avoided when an equally capable unmarked member exists. Unmarked members either have good recent health or no recent traffic data — absence of a mark is NOT a quality penalty."].filter(Boolean),l={};for(let a of b){let b=String(a);l[b.length>64?b:j(b,64)]=null}return{state:i.join("\n"),questions:{pick_model:{type:"choice",instructions:"Pick the single best candidate model id to answer this request.",criteria:l}}}}(b,c,a=>u.get(a)||null),model:`${s.provider}/${s.model}`},w=await (0,e.c1)(s.provider,new Set,s.model);if(!w||w.allRateLimited)return m.warn(d,`router: no usable credentials for ${a}, using fallback order`),null;let x=await (0,g.l)({body:v,modelInfo:{provider:s.provider,model:s.model},credentials:w,log:m,onRequestSuccess:async()=>{await (0,e.Pt)(w.connectionId,w,s.model)}});if(!x?.success)return m.warn(d,`router: decision failed (${x?.status}: ${x?.error||"unknown"}), using fallback order`),null;let y=await x.response.json().catch(()=>null);x.usage&&(0,i.sZ)({provider:s.provider,model:s.model,connectionId:w.connectionId,apiKey:h,endpoint:o,tokens:{...x.usage,total_tokens:x.usage.prompt_tokens+x.usage.completion_tokens},status:"success"}).catch(()=>{});let z=(q=y?.answers??y?.result?.answers??y?.result??y,r=l(q?.pick_model??(q&&"object"==typeof q&&!Array.isArray(q)?Object.values(q)[0]:null)),"string"!=typeof r?null:r.trim()||null),A=function(a,b=[]){if("string"!=typeof a||!a)return null;if(b.includes(a))return a;let c=b.filter(b=>b.endsWith(`/${a}`));return 1===c.length?c[0]:null}(z,c);if(!A)return m.warn(d,`router: decision picked '${z??"(unparsable)"}' outside the candidate set, using fallback order`),null;let B=function(a){try{let b=a?.answers??a?.result?.answers??a?.result??a,c=b?.pick_model??(b&&"object"==typeof b&&!Array.isArray(b)?Object.values(b)[0]:null);if(!c||"object"!=typeof c)return null;let d=l(c),e="number"==typeof c.confidence&&Number.isFinite(c.confidence)?c.confidence:null,f=null,g=null,h=c.probabilities;if(h&&"object"==typeof h&&!Array.isArray(h))for(let[a,b]of Object.entries(h))a!==d&&"number"==typeof b&&Number.isFinite(b)&&(null===g||b>g)&&(f=a,g=b);if(null===e&&null===f)return null;return{confidence:e,runnerUp:f,runnerUpP:g}}catch{return null}}(y),C="";if(B){let a=[];null!=B.confidence&&a.push(`conf ${B.confidence.toFixed(2)}`),B.runnerUp&&a.push(`next ${B.runnerUp}${null!=B.runnerUpP?` ${B.runnerUpP.toFixed(2)}`:""}`),a.length&&(C=` (${a.join(", ")})`)}return m.info(d,`router: ${a} → ${A} of ${c.length} candidates${C}`),A}catch(a){return m.warn(d,`router: decision errored (${a?.message||a}), using fallback order`),null}}},46634:(a,b,c)=>{c.d(b,{Mo:()=>h,RG:()=>l,V:()=>i,Y8:()=>k,xl:()=>m});var d=c(1932),e=c(87155);let f=null,g=null;function h(){return f?{loaded:!0,version:f.version,loadedAt:f.loadedAt}:{loaded:!1}}async function i(){return f||g||(g=j().finally(()=>{g=null}))}async function j(){let a=(0,e.S1)();if(!a.installed){let a=Error("PXPIPE is not installed");throw a.code="NOT_INSTALLED",a}let b=`${(0,d.pathToFileURL)((0,e.CG)()).href}?v=${encodeURIComponent(a.version||"0")}`,c=await import(b);if("function"!=typeof c.transformAnthropicMessages)throw Error("installed pxpipe package does not export transformAnthropicMessages");return f={module:c,version:a.version,loadedAt:Date.now()}}function k(){let a=!!f;return f=null,a}async function l({autoLoad:a=!0}={}){try{if(!f&&!a)return null;let{module:b}=await i();return b.transformAnthropicMessages}catch{return null}}async function m(){let a=Date.now(),{module:b}=await i(),c=new TextEncoder().encode(JSON.stringify({model:"claude-fable-5",max_tokens:16,messages:[{role:"user",content:"ping"}]})),d=await b.transformAnthropicMessages({body:c,model:"claude-fable-5"});if(!d||"boolean"!=typeof d.applied||!(d.body instanceof Uint8Array))throw Error("transform returned an unexpected shape");return{ok:!0,reason:d.reason,durationMs:Date.now()-a}}},46945:(a,b,c)=>{c.d(b,{V:()=>e});let d=/\[1m\]$/i;function e(a){if("string"!=typeof a)return{model:a,contextMarker:null};let b=a.trim(),c=b.match(d);return c?{model:b.slice(0,-c[0].length),contextMarker:c[0].slice(1,-1).toLowerCase()}:{model:a,contextMarker:null}}},54174:(a,b,c)=>{c.d(b,{Yy:()=>u});var d=c(89718),e=c(66489),f=c(40615),g=c(66306),h=c(14170),i=c(7803);let j="x-10r-internal-compaction",k=/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uac00-\ud7af]/g;function l(a){if(!a)return 0;let b=String(a),c=(b.match(k)||[]).length;return Math.ceil(1.2*c+(b.length-c)/4)}let m=a=>{try{return JSON.stringify(a)}catch{return String(a)}};function n(a,b){if(null==a)return;if("string"==typeof a)return void b.parts.push(a);if(Array.isArray(a)){for(let c of a)n(c,b);return}if("object"!=typeof a)return void b.parts.push(String(a));let c=a.type;"image"===c||"image_url"===c||"input_image"===c||"document"===c||"file"===c?b.flat+=1e3:"tool_use"===c?b.parts.push(String(a.name||""),m(a.input)):"tool_result"===c?n(a.content,b):"string"==typeof a.text?b.parts.push(a.text):b.parts.push(m(a))}function o(a){let b={parts:[],flat:0};n(a?.content,b);let c=b.parts.filter(Boolean).join(" ").replace(/\s+/g," ").trim();if(Array.isArray(a?.tool_calls)&&(c+=" "+a.tool_calls.map(a=>`call:${a?.function?.name}${a?.function?.arguments?`(${String(a.function.arguments).slice(0,200)})`:""}`).join(" ")),Array.isArray(a?.content))for(let b of a.content)b?.type==="tool_use"&&(c+=` call:${b.name}(${m(b.input).slice(0,200)})`),b?.type==="tool_result"&&(c+=" [tool-result]");let d=b.flat?` [media ~${Math.round(b.flat/1e3)}]`:"",e=a?.role||(a?.type==="function_call"?"assistant":"msg");return`<${e}> ${c}${d}`.trimEnd()}let p=a=>{let b=Number(a);return Number.isFinite(b)&&b>=.5&&b<=.98?b:.9},q=null;async function r(){let a=Date.now();if(q&&a-q.at<3e4)return q;let b={},c=[],f=[];try{b=await (0,e.SZ)()||{}}catch{}try{c=await (0,d.uv)()||[]}catch{}try{f=await (0,d.Uv)()||[]}catch{}let g=Object.fromEntries((f||[]).map(a=>[a?.name,a?.models]));return q={at:a,caps:b,customs:function(a){let b=new Map;for(let c of a||[]){if(!c?.id||!c?.providerAlias)continue;let a=String(c.id),d=String(c.providerAlias);b.set(`${d}::${a}`,c)}return b}(c),combos:f||[],comboByName:g}}let s=a=>{let b="string"==typeof a?Number(a):a;return Number.isFinite(b)&&b>0?Math.floor(b):null};async function t(a){let b=String(a||""),c=b.indexOf("/"),{caps:d,customs:e,combos:h,comboByName:i}=await r();if(c<=0){let a=h.find(a=>a?.name===b);if(!a||!Array.isArray(a.models)||0===a.models.length)return null;let c=d[b]?.[b]||d.combo?.[b];if(c&&(s(c.contextWindow)||s(c.maxOutput)))return{contextWindow:s(c.contextWindow),maxOutput:s(c.maxOutput)};let j=(0,g.Q5)(a.models,i,a=>{let b="string"==typeof a?a.indexOf("/"):-1;if(-1===b)return null;let c=a.slice(0,b),g=a.slice(b+1),h=f.js[c]||c,i=g.split(":")[0],j=d[c]?.[g]||d[h]?.[g]||d[c]?.[i]||d[h]?.[i];if(j&&(s(j.contextWindow)||s(j.maxOutput))){let a={};return s(j.contextWindow)&&(a.contextWindow=s(j.contextWindow)),s(j.maxOutput)&&(a.maxOutput=s(j.maxOutput)),a}let k=e.get(`${c}::${g}`)||e.get(`${h}::${g}`)||e.get(`${c}::${i}`)||e.get(`${h}::${i}`);if(k&&(s(k.contextWindow)||s(k.maxOutput))){let a={};return s(k.contextWindow)&&(a.contextWindow=s(k.contextWindow)),s(k.maxOutput)&&(a.maxOutput=s(k.maxOutput)),a}return null});return j?{contextWindow:s(j.contextWindow),maxOutput:s(j.maxOutput)}:null}let j=b.slice(0,c),k=b.slice(c+1),l=f.js[j]||j,m=k.split(":")[0],n=d[j]?.[k]||d[l]?.[k]||d[j]?.[m]||d[l]?.[m];if(n&&(s(n.contextWindow)||s(n.maxOutput)))return{contextWindow:s(n.contextWindow),maxOutput:s(n.maxOutput)};let o=e.get(`${j}::${k}`)||e.get(`${l}::${k}`)||e.get(`${j}::${m}`)||e.get(`${l}::${m}`),p=(0,g.nl)(l,m!==k?m:k)||{};return{contextWindow:s(o?.contextWindow)??(s(p.contextWindow)||null),maxOutput:s(o?.maxOutput)??(s(p.maxOutput)||null)}}async function u({request:a,body:b,modelStr:c,endpoint:d,settings:e}){var f;let g;if(a?.headers?.get?.(j)==="1"||e?.autoCompactEnabled===!1||!b||!Array.isArray(b.messages)||b.messages.length<3)return!1;let k=(g=(0,h.t)(d,b))===h.h.CLAUDE||g===h.h.OPENAI||g===h.h.OPENAI_RESPONSES?g:Array.isArray(b?.messages)?b?.system!==void 0?h.h.CLAUDE:h.h.OPENAI:Array.isArray(b?.input)?h.h.OPENAI_RESPONSES:null;if(k!==h.h.CLAUDE&&k!==h.h.OPENAI)return!1;let q=function(a,b){let c=0,d=a=>{for(let b of(c+=a.flat||0,a.parts))c+=l(b)};if(b===h.h.CLAUDE&&a?.system!==void 0){let b={parts:[],flat:0};n(a.system,b),d(b)}for(let b of Array.isArray(a?.messages)?a.messages:Array.isArray(a?.input)?a.input:[])d(function(a){let b={parts:[],flat:8};if(!a||"object"!=typeof a)return b;if(n(a.content,b),"string"==typeof a.name&&b.parts.push(a.name),Array.isArray(a.tool_calls))for(let c of a.tool_calls){let a=c?.function?.arguments;b.parts.push(String(c?.function?.name||""),"string"==typeof a?a:m(a))}return"string"==typeof a.tool_call_id&&b.parts.push(a.tool_call_id),"object"==typeof a.action&&a.action&&b.parts.push(m(a.action)),b}(b));return a?.tools&&d({parts:[m(a.tools)],flat:0}),a?.tool_definitions&&d({parts:[m(a.tool_definitions)],flat:0}),a?.response_format&&d({parts:[m(a.response_format)],flat:0}),c}(b,k);if(q<4e3)return!1;let r=await t(c);if(!r?.contextWindow)return!1;let v=p(e?.autoCompactRatio),w=s(e?.autoCompactKeepMessages)||8,x=function({body:a,fmt:b,contextWindow:c,ratio:d,keepRecent:e,est:f}){let g=Array.isArray(a?.messages)?a.messages:null;if(!g||g.length<3||!Number.isFinite(c)||c<=0)return null;let i=Math.floor(c*p(d));if(f<i)return null;let j=function(a,b,c){if(!Array.isArray(a)||a.length<3)return -1;let d=Math.max(1,a.length-c);for(let c=d;c<a.length;c++){let d=a[c];if(d&&"user"===d.role&&!(b===h.h.CLAUDE&&function(a,b){return Array.isArray(a)&&a.some(a=>a&&"object"==typeof a&&a.type===b)}(d.content,"tool_result")))return c}return -1}(g,b,e);return j<=0||j>=g.length?null:{cut:j,threshold:i,est:f,prefix:g.slice(0,j),tail:g.slice(j)}}({body:b,fmt:k,contextWindow:r.contextWindow,ratio:v,keepRecent:w,est:q});if(!x)return!1;let y=Math.max(256,Math.min(1500,Math.floor(.1*r.contextWindow))),z=Math.max(2e3,x.threshold-y-1500),A=function(a,b){let c=(a||[]).map(o),d=[],e=0,f=0;for(let a=c.length-1;a>=0;a--){let g=l(c[a]);if(e+g>b&&d.length>0){f=a+1;break}d.unshift(c[a]),e+=g}return f>0&&d.unshift(`[…earlier ${f} messages omitted for length…]`),d.join("\n")}(x.prefix,z),B=null;try{B=new URL(a.url).origin}catch{}if(!B)return!1;let C=a.headers?.get?.("authorization"),D=new AbortController,E=setTimeout(()=>D.abort(),12e4),F="";try{let a,b,d,e=await fetch(`${B}/v1/chat/completions`,{method:"POST",signal:D.signal,headers:{"content-type":"application/json",[j]:"1",...C?{authorization:C}:{}},body:JSON.stringify({model:c,messages:[{role:"system",content:"你是对话压缩助手。请把下面的历史对话压缩成一段可供后续模型无缝接续的摘要。必须保留:用户的核心目标与约束、关键决定及理由、涉及的文件路径/函数名/代码标识符、重要的工具调用结果、未完成的任务与下一步。只输出摘要正文,不要寒暄或标题。"},{role:"user",content:A}],stream:!1,max_tokens:y,temperature:.3,enable_thinking:!1})});if(!e.ok)return i.warn("COMPACT",`summary call ${e.status} for ${c} — sending original request`),!1;f=await e.json(),a=f?.choices?.[0],b=a?.message?.content??a?.text,d="","string"==typeof b?d=b:Array.isArray(b)&&(d=b.map(a=>"string"==typeof a?a:a?.text||"").join("")),d.trim()||"string"!=typeof a?.message?.reasoning_content||(d=a.message.reasoning_content),F=d}catch(a){return i.warn("COMPACT",`summary failed for ${c}: ${a?.message||a} — sending original request`),!1}finally{clearTimeout(E)}return F&&F.trim()?(b.messages=[function(a,b,c){let d=`[Conversation summary of earlier context]
3
3
  ${c}
4
4
  [End of summary — recent messages follow]`,e=a?.content;if(b===h.h.CLAUDE){let b=[];return b.push({type:"text",text:d}),"string"==typeof e&&e?b.push({type:"text",text:e}):Array.isArray(e)&&b.push(...e),{...a,content:b}}return"string"==typeof e?{...a,content:e?`${d}
5
5
 
6
- ${e}`:d}:Array.isArray(e)?{...a,content:[{type:"text",text:d},...e]}:{...a,content:d}}(x.tail[0],k,F.trim()),...x.tail.slice(1)],i.info("COMPACT",`${c}: est ${q}tok ≥ ${Math.round(100*v)}% of ${r.contextWindow} → summarized ${x.prefix.length} msgs, kept ${x.tail.length}`),!0):(i.warn("COMPACT",`empty summary for ${c} — sending original request`),!1)}},66489:(a,b,c)=>{c.d(b,{D3:()=>d.D3,SZ:()=>d.SZ,dW:()=>d.dW});var d=c(27274)},74388:(a,b,c)=>{c.d(b,{Az:()=>l,SP:()=>o,T0:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(87155);let i=g().join(h.XF,"events.jsonl"),j=g().join(h.XF,"events.jsonl.1");function k(a){try{e().existsSync(h.XF)||e().mkdirSync(h.XF,{recursive:!0});try{e().statSync(i).size>5242880&&e().renameSync(i,j)}catch{}e().appendFile(i,JSON.stringify({ts:Date.now(),...a})+"\n",()=>{})}catch{}}function l({sinceMs:a=null,limit:b=null}={}){let c=[];for(let b of[j,i])try{if(!e().existsSync(b))continue;for(let d of e().readFileSync(b,"utf8").split("\n"))if(d)try{let b=JSON.parse(d);if(a&&b.ts<a)continue;c.push(b)}catch{}}catch{}return c.sort((a,b)=>a.ts-b.ts),b?c.slice(-b):c}function m(){return{requests:0,compressed:0,bypassed:0,errors:0,tokensBeforeEst:0,tokensAfterEst:0,tokensSavedEst:0,savedPct:0,imagesGenerated:0,compressionTimeMs:0,avgCompressionMs:0}}function n(a,b){a.requests++,b.applied?(a.compressed++,a.tokensBeforeEst+=b.tokensBeforeEst||0,a.tokensAfterEst+=b.tokensAfterEst||0,a.tokensSavedEst+=b.tokensSavedEst||0,a.imagesGenerated+=b.imageCount||0,a.compressionTimeMs+=b.durationMs||0):"transform_error"===b.reason||"timeout"===b.reason?a.errors++:a.bypassed++}function o({timelineDays:a=30,recentLimit:b=100}={}){let c=l(),d=Date.now(),e=new Date(new Date(d).setHours(0,0,0,0)).getTime(),f={all:m(),today:m(),yesterday:m(),last7d:m(),last30d:m()},g=new Map;for(let b=a-1;b>=0;b--){let a=new Date(e-864e5*b);g.set(a.toISOString().slice(0,10),{date:a.toISOString().slice(0,10),tokensSavedEst:0,compressed:0,requests:0})}for(let a of c){n(f.all,a),a.ts>=e?n(f.today,a):a.ts>=e-864e5&&n(f.yesterday,a),a.ts>=d-6048e5&&n(f.last7d,a),a.ts>=d-2592e6&&n(f.last30d,a);let b=new Date(a.ts).toISOString().slice(0,10),c=g.get(b);c&&(c.requests++,a.applied&&(c.compressed++,c.tokensSavedEst+=a.tokensSavedEst||0))}for(let a of Object.values(f))a.savedPct=a.tokensBeforeEst>0?+(a.tokensSavedEst/a.tokensBeforeEst*100).toFixed(2):0,a.avgCompressionMs=a.compressed>0?Math.round(a.compressionTimeMs/a.compressed):0;return{windows:f,timeline:[...g.values()],recent:c.slice(-b).reverse()}}},79489:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{P:()=>C});var e=c(48895),f=c(78591),g=c(89718),h=c(12557),i=c(38775),j=c(49059),k=c(92500),l=c(3894),m=c(46634),n=c(74388),o=c(43659),p=c(48136),q=c(92812),r=c(41255),s=c(54174),t=c(17603),u=c(27349),v=c(41004),w=c(14170),x=c(7803),y=c(67828),z=c(38160),A=c(46945),B=a([e,k]);async function C(a,b=null){let c;try{c=await a.json()}catch{return x.warn("CHAT","Invalid JSON body"),(0,o.yj)(v.gx.BAD_REQUEST,"Invalid JSON body")}b||(b={endpoint:new URL(a.url).pathname,body:c,headers:Object.fromEntries(a.headers.entries())});let{model:d,contextMarker:e}=(0,A.V)(c.model);e&&(c.model=d);let h=a.headers.get("Authorization"),j=(0,f.Tr)(a);if(h&&j){let a=x.maskKey(j);x.debug("AUTH",`API Key: ${a}`)}else x.debug("AUTH","No API key provided (local mode)");let k=await (0,g.getSettings)();if(k.requireApiKey){if(!j)return x.warn("AUTH","Missing API key (requireApiKey=true)"),(0,o.yj)(v.gx.UNAUTHORIZED,"Missing API key");if(!await (0,f.kI)(j))return x.warn("AUTH","Invalid API key (requireApiKey=true)"),(0,o.yj)(v.gx.UNAUTHORIZED,"Invalid API key")}let l=await (0,f.uO)(j,{request:a,model:d});if(l)return l;let m=await (0,f.bs)(j,d);if(m)return m;if(!d)return x.warn("CHAT","Missing model"),(0,o.yj)(v.gx.BAD_REQUEST,"Missing model");let n=a?.headers?.get("user-agent")||"",p=(0,u.c)(c,d,n,!!k.ccFilterNaming);if(p)return p.response||p;try{await (0,s.Yy)({request:a,body:c,modelStr:d,endpoint:b?.endpoint,settings:k})}catch(a){x.warn("COMPACT",`skipped: ${a?.message||a}`)}let w=(0,q.t8)(c),y=await (0,i.getComboModels)(d);if(y){let e=k.comboStrategies||{},f=e[d]?.fallbackStrategy||k.comboStrategy||"fallback",g=(0,t.R8)(y,w,k),h=g.filter(a=>!y.includes(a));if("fusion"===f)return x.info("CHAT",`Combo "${d}" with ${y.length} models (strategy: fusion)`),(0,q.vt)({body:c,models:y,handleSingleModel:(c,d,e)=>{let f=b;if(e&&b){let{tools:a,tool_choice:c,...d}=b.body||{};f={...b,body:d}}return D(c,d,f,a,j)},log:x,comboName:d,judgeModel:e[d]?.judgeModel,tuning:e[d]?.fusionTuning});let i=k.comboStickyRoundRobinLimit,l=e[d]?.retryOnEmpty??k.comboRetryOnEmpty??!1,m=e[d]?.retryOnEmptyLimit??k.comboRetryOnEmptyLimit;if("router"===f){let f=e[d]?.routerModel,k=await (0,r.t)({routerModel:f,body:c,candidates:g,apiKey:j,endpoint:a?.url?new URL(a.url).pathname:"/v1/chat/completions"});if(k){x.info("CHAT",`Combo "${d}" router → ${k}`);let e=[k,...g.filter(a=>a!==k)];return(0,q.Pr)({body:c,models:e,handleSingleModel:(0,t.ar)((c,d)=>D(c,d,b,a,j),h),log:x,comboName:d,comboStrategy:"fallback",comboStickyLimit:i,retryOnEmpty:l,retryOnEmptyLimit:m})}x.info("CHAT",`Combo "${d}" router degraded → fallback order`)}return x.info("CHAT",`Combo "${d}" with ${g.length} models (strategy: ${f}, sticky: ${i})`),(0,q.Pr)({body:c,models:g,handleSingleModel:(0,t.ar)((c,d)=>D(c,d,b,a,j),h),log:x,comboName:d,comboStrategy:f,comboStickyLimit:i,retryOnEmpty:l,retryOnEmptyLimit:m})}let z=(0,t.R8)([d],w,k);if(z.length>1){let e=z.filter(a=>a!==d);return x.info("CHAT",`Capacity adapter for [${[...w].join(",")}] on "${d}" → trying ${z.join(", ")}`),(0,q.Pr)({body:c,models:z,handleSingleModel:(0,t.ar)((c,d)=>D(c,d,b,a,j),e),log:x,comboName:d,comboStrategy:(0,t.vB)(w,k)})}return D(c,d,b,a,j,{inferFallback:!1,requestedModel:e?`${d.slice(d.indexOf("/")+1)}[${e}]`:null})}async function D(a,b,c=null,d=null,e=null,{inferFallback:r=!0,requestedModel:s=null}={}){let u=await (0,i.mA)(b,{inferFallback:r});if(!u.provider){let f=await (0,i.getComboModels)(b);if(f){let h=await (0,g.getSettings)(),i=h.comboStrategies||{},j=i[b]?.fallbackStrategy||h.comboStrategy||"fallback",k=(0,q.t8)(a),l=(0,t.R8)(f,k,h),m=l.filter(a=>!f.includes(a));if("fusion"===j)return x.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: fusion)`),(0,q.vt)({body:a,models:f,handleSingleModel:(a,b,f)=>{let g=c;if(f&&c){let{tools:a,tool_choice:b,...d}=c.body||{};g={...c,body:d}}return D(a,b,g,d,e)},log:x,comboName:b,judgeModel:i[b]?.judgeModel,tuning:i[b]?.fusionTuning});let n=h.comboStickyRoundRobinLimit,o=i[b]?.retryOnEmpty??h.comboRetryOnEmpty??!1,p=i[b]?.retryOnEmptyLimit??h.comboRetryOnEmptyLimit;return x.info("CHAT",`Combo "${b}" with ${l.length} models (strategy: ${j}, sticky: ${n})`),(0,q.Pr)({body:a,models:l,handleSingleModel:(0,t.ar)((a,b)=>D(a,b,c,d,e),m),log:x,comboName:b,comboStrategy:j,comboStickyLimit:n,retryOnEmpty:o,retryOnEmptyLimit:p})}return x.warn("CHAT","Unknown model",{model:b}),(0,o.yj)(v.gx.BAD_REQUEST,`Unknown model: "${b}". It is not in /v1/models — send a provider-prefixed model id from GET /v1/models.`)}let{provider:A,model:B}=u,C=d?.headers?.get("user-agent")||"",E=new Set,F=null,G=null,H=null;if("codebuddy-cn"===A&&(0,j.Fe)(a)){let b=(0,j.Jz)(a);x.warn("CHAT",`[${A}/${B}] payload exceeds extreme-size backstop (${b}); rejected locally`);let c=(0,h.vt)(`[${A}/${B}] 请求体积已达极端量级(${b}),已在本地拦截,避免触发上游渠道级风控。`);return(0,o.yj)(v.gx.BAD_REQUEST,c)}let I=await (0,g.Bf)(A);if((0,h.d5)(I)>0){let a=I.until,b=(0,h.Qo)(a);return x.warn("AUTH",`${A} | channel blocked (${b}) — skipping all accounts`),(0,o.wO)(v.gx.SERVICE_UNAVAILABLE,(0,h.vt)(`[${A}/${B}] 上游渠道风控临时冷却中(${b}自动解冻)`),a,b)}for(;;){let b=await (0,f.c1)(A,E,B,{requestedModel:s||B});if(!b||b.allRateLimited){if(b?.allRateLimited){let a=F||b.lastError||"Unavailable",c=G||Number(b.lastErrorCode)||v.gx.SERVICE_UNAVAILABLE;x.warn("CHAT",`[${A}/${B}] ${a} (${b.retryAfterHuman})`);let d=`[${A}/${B}] ${a}`,e=402===c||(0,h.tc)(a)?(0,h.dN)(d,A):(0,h.Hu)(d,A);return(0,o.wO)(c,e,b.retryAfter,b.retryAfterHuman,H)}if(0===E.size)return x.warn("AUTH",`No active credentials for provider: ${A}`),(0,o.yj)(v.gx.NOT_FOUND,`No active credentials for provider: ${A}`);x.warn("CHAT","No more accounts available",{provider:A});let a=F||"All accounts unavailable",c=402===G||(0,h.tc)(a)?(0,h.dN)(a,A):(0,h.Hu)(a,A);return(0,o.yj)(G||v.gx.SERVICE_UNAVAILABLE,c,H)}let i=await (0,y.checkAndRefreshToken)(A,b);if(("antigravity"===A||"gemini-cli"===A)&&!i.projectId){let a=await (0,z.eG)(b.connectionId,i.accessToken,A);a&&(i.projectId=a,(0,y.vN)(b.connectionId,{projectId:a}).catch(()=>{}))}let j=await (0,g.getSettings)(),q=(j.providerThinking||{})[A]||null,r=await (0,k.wk)({body:{...a,model:`${A}/${B}`},modelInfo:{provider:A,model:B},credentials:i,log:x,clientRawRequest:c,connectionId:b.connectionId,userAgent:C,apiKey:e,ccFilterNaming:!!j.ccFilterNaming,rtkEnabled:!!j.rtkEnabled,headroomEnabled:!!j.headroomEnabled,headroomUrl:j.headroomUrl||l.ag,headroomCompressUserMessages:!!j.headroomCompressUserMessages,cavemanEnabled:!!j.cavemanEnabled,cavemanLevel:j.cavemanLevel||"full",ponytailEnabled:!!j.ponytailEnabled,ponytailLevel:j.ponytailLevel||"full",pxpipeEnabled:!!j.pxpipeEnabled,pxpipeMinChars:j.pxpipeMinChars,pxpipeTimeoutMs:j.pxpipeTimeoutMs,pxpipeTransform:j.pxpipeEnabled?await (0,m.RG)():null,onPxpipeEvent:n.T0,providerThinking:q,sourceFormatOverride:d?.url?(0,w.t)(new URL(d.url).pathname,a):null,onCredentialsRefreshed:async a=>{await (0,y.Xg)(b.connectionId,a,{providerSpecificData:b.providerSpecificData,provider:A,log:x})},onCredentialsRefreshFailed:async a=>{await (0,y.Ug)(b.connectionId,{provider:A,reason:a,log:x})},onRequestSuccess:async()=>{await (0,f.Pt)(b.connectionId,b,B);let a=await (0,g.Bf)(A)!==null;await (0,g.Um)(A),a&&await (0,f.C$)(A)}});if(r.success)return r.response;let{shouldFallback:t,channelScope:u}=await (0,f.vk)(b.connectionId,r.status,r.error,A,B,r.resetsAtMs);if(t&&u){let a=await (0,g.Bf)(A),b=(0,h.pT)(a);await (0,g.hj)(A,b);let c=(0,h.Qo)(b.until);return x.warn("AUTH",`${A} | channel blocked for ${Math.round(b.durationMs/1e3)}s (strike ${b.strikes}${b.escalated?", escalated":""}) — aborting account fallback`),x.warn("CHAT",`[${A}/${B}] ${r.error} (channel blocked, ${c})`),(0,o.wO)(r.status||v.gx.SERVICE_UNAVAILABLE,(0,h.vt)(`[${A}/${B}] ${r.error}`),b.until,c)}if(t){x.warn("FALLBACK",`⇄ ACC:${b.connectionName} UNAVAILABLE (${r.status}) → NEXT ACCOUNT`),E.add(b.connectionId),F=r.error,G=r.status,H=(0,p.d)(r.response?.headers);continue}return r.response}}[e,k]=B.then?(await B)():B,d()}catch(a){d(a)}})},83017:(a,b,c)=>{c.d(b,{l:()=>i});var d=c(77598),e=c.n(d),f=c(43659),g=c(41004),h=c(26070);async function i({body:a,modelInfo:b,credentials:c,log:d,onRequestSuccess:j}){let k,l,m,n,{provider:o,model:p}=b,q=h.B$[o]?.systemoneConfig,r=c?.providerSpecificData?.baseUrl||q?.baseUrl;if(!r)return(0,f.A1)(g.gx.BAD_REQUEST,`Provider '${o}' does not support System One.`);if(void 0===a.state||null===a.state)return(0,f.A1)(g.gx.BAD_REQUEST,"Missing required field: state");if(!a.questions||"object"!=typeof a.questions||Array.isArray(a.questions))return(0,f.A1)(g.gx.BAD_REQUEST,"Missing required field: questions");let s=c?.apiKey||c?.accessToken,t=(m=Date.now().toString(16).padStart(12,"0").slice(-12),n=[...e().randomBytes(14)].map(a=>"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[a%62]).join(""),`ses_${m}${n}`),u={"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...q.headers||{},"x-opencode-session":t,"x-opencode-session-id":t},v={...a,model:p};d?.debug?.("SYSTEMONE",`${o.toUpperCase()} | ${p}`);try{k=await fetch(r,{method:"POST",headers:u,body:JSON.stringify(v),..."function"==typeof AbortSignal?.timeout?{signal:AbortSignal.timeout(g.pH)}:{}})}catch(b){let a=(0,f.lR)(b,o,p,g.gx.BAD_GATEWAY);return d?.debug?.("SYSTEMONE",`Fetch error: ${a}`),(0,f.A1)(g.gx.BAD_GATEWAY,a)}if(!k.ok){let{statusCode:a,message:b}=await (0,f.zL)(k),c=(0,f.lR)(Error(b),o,p,a);return d?.debug?.("SYSTEMONE",`Provider error: ${c}`),(0,f.A1)(a,c)}try{l=await k.json()}catch{return(0,f.A1)(g.gx.BAD_GATEWAY,`Invalid JSON response from ${o}`)}j&&await j();let w=l?.usage;return{success:!0,usage:w?{prompt_tokens:w.input_tokens||0,completion_tokens:w.output_tokens||0}:null,response:new Response(JSON.stringify(l),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}},87155:(a,b,c)=>{c.d(b,{CG:()=>q,ED:()=>u,S1:()=>s,XF:()=>j,_g:()=>t,no:()=>r,sW:()=>w});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(79646),i=c(49120);let j=g().join(i.nJ,"pxpipe"),k="pxpipe-proxy",l=g().join(j,"install.log"),m="win32"===process.platform,n=[...m?[`${process.env.ProgramFiles||""}\\nodejs`,`${process.env.APPDATA||""}\\npm`]:["/usr/local/bin","/opt/homebrew/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],process.env.PATH||""].filter(Boolean).join(g().delimiter),o=null;function p(){return g().join(j,"node_modules",k)}function q(){return g().join(p(),"dist","core","library.js")}function r(){try{let a=(0,h.execSync)(`${m?"where":"which"} npm`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:n}}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function s(){try{let a=g().join(p(),"package.json");if(!e().existsSync(a)||!e().existsSync(q()))return{installed:!1,version:null,path:null};let b=JSON.parse(e().readFileSync(a,"utf8"));return{installed:!0,version:b.version||null,path:p()}}catch{return{installed:!1,version:null,path:null}}}function t(){return null!==o}function u(){return o||(o=v().finally(()=>{o=null}))}async function v(){let a=r();if(!a){let a=Error("npm not found on PATH — Node.js/npm is required to install PXPIPE");throw a.code="NPM_NOT_FOUND",a}e().existsSync(j)||e().mkdirSync(j,{recursive:!0});let b=g().join(j,"package.json");e().existsSync(b)||e().writeFileSync(b,JSON.stringify({name:"10router-pxpipe-host",private:!0},null,2));let c=e().openSync(l,"a");e().writeSync(c,`
6
+ ${e}`:d}:Array.isArray(e)?{...a,content:[{type:"text",text:d},...e]}:{...a,content:d}}(x.tail[0],k,F.trim()),...x.tail.slice(1)],i.info("COMPACT",`${c}: est ${q}tok ≥ ${Math.round(100*v)}% of ${r.contextWindow} → summarized ${x.prefix.length} msgs, kept ${x.tail.length}`),!0):(i.warn("COMPACT",`empty summary for ${c} — sending original request`),!1)}},66489:(a,b,c)=>{c.d(b,{D3:()=>d.D3,SZ:()=>d.SZ,dW:()=>d.dW});var d=c(27274)},74388:(a,b,c)=>{c.d(b,{Az:()=>l,SP:()=>o,T0:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(87155);let i=g().join(h.XF,"events.jsonl"),j=g().join(h.XF,"events.jsonl.1");function k(a){try{e().existsSync(h.XF)||e().mkdirSync(h.XF,{recursive:!0});try{e().statSync(i).size>5242880&&e().renameSync(i,j)}catch{}e().appendFile(i,JSON.stringify({ts:Date.now(),...a})+"\n",()=>{})}catch{}}function l({sinceMs:a=null,limit:b=null}={}){let c=[];for(let b of[j,i])try{if(!e().existsSync(b))continue;for(let d of e().readFileSync(b,"utf8").split("\n"))if(d)try{let b=JSON.parse(d);if(a&&b.ts<a)continue;c.push(b)}catch{}}catch{}return c.sort((a,b)=>a.ts-b.ts),b?c.slice(-b):c}function m(){return{requests:0,compressed:0,bypassed:0,errors:0,tokensBeforeEst:0,tokensAfterEst:0,tokensSavedEst:0,savedPct:0,imagesGenerated:0,compressionTimeMs:0,avgCompressionMs:0}}function n(a,b){a.requests++,b.applied?(a.compressed++,a.tokensBeforeEst+=b.tokensBeforeEst||0,a.tokensAfterEst+=b.tokensAfterEst||0,a.tokensSavedEst+=b.tokensSavedEst||0,a.imagesGenerated+=b.imageCount||0,a.compressionTimeMs+=b.durationMs||0):"transform_error"===b.reason||"timeout"===b.reason?a.errors++:a.bypassed++}function o({timelineDays:a=30,recentLimit:b=100}={}){let c=l(),d=Date.now(),e=new Date(new Date(d).setHours(0,0,0,0)).getTime(),f={all:m(),today:m(),yesterday:m(),last7d:m(),last30d:m()},g=new Map;for(let b=a-1;b>=0;b--){let a=new Date(e-864e5*b);g.set(a.toISOString().slice(0,10),{date:a.toISOString().slice(0,10),tokensSavedEst:0,compressed:0,requests:0})}for(let a of c){n(f.all,a),a.ts>=e?n(f.today,a):a.ts>=e-864e5&&n(f.yesterday,a),a.ts>=d-6048e5&&n(f.last7d,a),a.ts>=d-2592e6&&n(f.last30d,a);let b=new Date(a.ts).toISOString().slice(0,10),c=g.get(b);c&&(c.requests++,a.applied&&(c.compressed++,c.tokensSavedEst+=a.tokensSavedEst||0))}for(let a of Object.values(f))a.savedPct=a.tokensBeforeEst>0?+(a.tokensSavedEst/a.tokensBeforeEst*100).toFixed(2):0,a.avgCompressionMs=a.compressed>0?Math.round(a.compressionTimeMs/a.compressed):0;return{windows:f,timeline:[...g.values()],recent:c.slice(-b).reverse()}}},79489:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{P:()=>C});var e=c(48895),f=c(75837),g=c(89718),h=c(12557),i=c(38775),j=c(49059),k=c(92500),l=c(3894),m=c(46634),n=c(74388),o=c(43659),p=c(48136),q=c(92812),r=c(41255),s=c(54174),t=c(17603),u=c(27349),v=c(41004),w=c(14170),x=c(7803),y=c(67828),z=c(38160),A=c(46945),B=a([e,k]);async function C(a,b=null){let c;try{c=await a.json()}catch{return x.warn("CHAT","Invalid JSON body"),(0,o.yj)(v.gx.BAD_REQUEST,"Invalid JSON body")}b||(b={endpoint:new URL(a.url).pathname,body:c,headers:Object.fromEntries(a.headers.entries())});let{model:d,contextMarker:e}=(0,A.V)(c.model);e&&(c.model=d);let h=a.headers.get("Authorization"),j=(0,f.Tr)(a);if(h&&j){let a=x.maskKey(j);x.debug("AUTH",`API Key: ${a}`)}else x.debug("AUTH","No API key provided (local mode)");let k=await (0,g.getSettings)();if(k.requireApiKey){if(!j)return x.warn("AUTH","Missing API key (requireApiKey=true)"),(0,o.yj)(v.gx.UNAUTHORIZED,"Missing API key");if(!await (0,f.kI)(j))return x.warn("AUTH","Invalid API key (requireApiKey=true)"),(0,o.yj)(v.gx.UNAUTHORIZED,"Invalid API key")}let l=await (0,f.uO)(j,{request:a,model:d});if(l)return l;let m=await (0,f.bs)(j,d);if(m)return m;if(!d)return x.warn("CHAT","Missing model"),(0,o.yj)(v.gx.BAD_REQUEST,"Missing model");let n=a?.headers?.get("user-agent")||"",p=(0,u.c)(c,d,n,!!k.ccFilterNaming);if(p)return p.response||p;try{await (0,s.Yy)({request:a,body:c,modelStr:d,endpoint:b?.endpoint,settings:k})}catch(a){x.warn("COMPACT",`skipped: ${a?.message||a}`)}let w=(0,q.t8)(c),y=await (0,i.getComboModels)(d);if(y){let e=k.comboStrategies||{},f=e[d]?.fallbackStrategy||k.comboStrategy||"fallback",g=(0,t.R8)(y,w,k),h=g.filter(a=>!y.includes(a));if("fusion"===f)return x.info("CHAT",`Combo "${d}" with ${y.length} models (strategy: fusion)`),(0,q.vt)({body:c,models:y,handleSingleModel:(c,d,e)=>{let f=b;if(e&&b){let{tools:a,tool_choice:c,...d}=b.body||{};f={...b,body:d}}return D(c,d,f,a,j)},log:x,comboName:d,judgeModel:e[d]?.judgeModel,tuning:e[d]?.fusionTuning});let i=k.comboStickyRoundRobinLimit,l=e[d]?.retryOnEmpty??k.comboRetryOnEmpty??!1,m=e[d]?.retryOnEmptyLimit??k.comboRetryOnEmptyLimit;if("router"===f){let f=e[d]?.routerModel,k=await (0,r.t)({routerModel:f,body:c,candidates:g,apiKey:j,endpoint:a?.url?new URL(a.url).pathname:"/v1/chat/completions"});if(k){x.info("CHAT",`Combo "${d}" router → ${k}`);let e=[k,...g.filter(a=>a!==k)];return(0,q.Pr)({body:c,models:e,handleSingleModel:(0,t.ar)((c,d)=>D(c,d,b,a,j),h),log:x,comboName:d,comboStrategy:"fallback",comboStickyLimit:i,retryOnEmpty:l,retryOnEmptyLimit:m})}x.info("CHAT",`Combo "${d}" router degraded → fallback order`)}return x.info("CHAT",`Combo "${d}" with ${g.length} models (strategy: ${f}, sticky: ${i})`),(0,q.Pr)({body:c,models:g,handleSingleModel:(0,t.ar)((c,d)=>D(c,d,b,a,j),h),log:x,comboName:d,comboStrategy:f,comboStickyLimit:i,retryOnEmpty:l,retryOnEmptyLimit:m})}let z=(0,t.R8)([d],w,k);if(z.length>1){let e=z.filter(a=>a!==d);return x.info("CHAT",`Capacity adapter for [${[...w].join(",")}] on "${d}" → trying ${z.join(", ")}`),(0,q.Pr)({body:c,models:z,handleSingleModel:(0,t.ar)((c,d)=>D(c,d,b,a,j),e),log:x,comboName:d,comboStrategy:(0,t.vB)(w,k)})}return D(c,d,b,a,j,{inferFallback:!1,requestedModel:e?`${d.slice(d.indexOf("/")+1)}[${e}]`:null})}async function D(a,b,c=null,d=null,e=null,{inferFallback:r=!0,requestedModel:s=null}={}){let u=await (0,i.mA)(b,{inferFallback:r});if(!u.provider){let f=await (0,i.getComboModels)(b);if(f){let h=await (0,g.getSettings)(),i=h.comboStrategies||{},j=i[b]?.fallbackStrategy||h.comboStrategy||"fallback",k=(0,q.t8)(a),l=(0,t.R8)(f,k,h),m=l.filter(a=>!f.includes(a));if("fusion"===j)return x.info("CHAT",`Combo "${b}" with ${f.length} models (strategy: fusion)`),(0,q.vt)({body:a,models:f,handleSingleModel:(a,b,f)=>{let g=c;if(f&&c){let{tools:a,tool_choice:b,...d}=c.body||{};g={...c,body:d}}return D(a,b,g,d,e)},log:x,comboName:b,judgeModel:i[b]?.judgeModel,tuning:i[b]?.fusionTuning});let n=h.comboStickyRoundRobinLimit,o=i[b]?.retryOnEmpty??h.comboRetryOnEmpty??!1,p=i[b]?.retryOnEmptyLimit??h.comboRetryOnEmptyLimit;return x.info("CHAT",`Combo "${b}" with ${l.length} models (strategy: ${j}, sticky: ${n})`),(0,q.Pr)({body:a,models:l,handleSingleModel:(0,t.ar)((a,b)=>D(a,b,c,d,e),m),log:x,comboName:b,comboStrategy:j,comboStickyLimit:n,retryOnEmpty:o,retryOnEmptyLimit:p})}return x.warn("CHAT","Unknown model",{model:b}),(0,o.yj)(v.gx.BAD_REQUEST,`Unknown model: "${b}". It is not in /v1/models — send a provider-prefixed model id from GET /v1/models.`)}let{provider:A,model:B}=u,C=d?.headers?.get("user-agent")||"",E=new Set,F=null,G=null,H=null;if("codebuddy-cn"===A&&(0,j.Fe)(a)){let b=(0,j.Jz)(a);x.warn("CHAT",`[${A}/${B}] payload exceeds extreme-size backstop (${b}); rejected locally`);let c=(0,h.vt)(`[${A}/${B}] 请求体积已达极端量级(${b}),已在本地拦截,避免触发上游渠道级风控。`);return(0,o.yj)(v.gx.BAD_REQUEST,c)}let I=await (0,g.Bf)(A);if((0,h.d5)(I)>0){let a=I.until,b=(0,h.Qo)(a);return x.warn("AUTH",`${A} | channel blocked (${b}) — skipping all accounts`),(0,o.wO)(v.gx.SERVICE_UNAVAILABLE,(0,h.vt)(`[${A}/${B}] 上游渠道风控临时冷却中(${b}自动解冻)`),a,b)}for(;;){let b=await (0,f.c1)(A,E,B,{requestedModel:s||B});if(!b||b.allRateLimited){if(b?.allRateLimited){let a=F||b.lastError||"Unavailable",c=G||Number(b.lastErrorCode)||v.gx.SERVICE_UNAVAILABLE;x.warn("CHAT",`[${A}/${B}] ${a} (${b.retryAfterHuman})`);let d=`[${A}/${B}] ${a}`,e=402===c||(0,h.tc)(a)?(0,h.dN)(d,A):(0,h.Hu)(d,A);return(0,o.wO)(c,e,b.retryAfter,b.retryAfterHuman,H)}if(0===E.size)return x.warn("AUTH",`No active credentials for provider: ${A}`),(0,o.yj)(v.gx.NOT_FOUND,`No active credentials for provider: ${A}`);x.warn("CHAT","No more accounts available",{provider:A});let a=F||"All accounts unavailable",c=402===G||(0,h.tc)(a)?(0,h.dN)(a,A):(0,h.Hu)(a,A);return(0,o.yj)(G||v.gx.SERVICE_UNAVAILABLE,c,H)}let i=await (0,y.checkAndRefreshToken)(A,b);if(("antigravity"===A||"gemini-cli"===A)&&!i.projectId){let a=await (0,z.eG)(b.connectionId,i.accessToken,A);a&&(i.projectId=a,(0,y.vN)(b.connectionId,{projectId:a}).catch(()=>{}))}let j=await (0,g.getSettings)(),q=(j.providerThinking||{})[A]||null,r=await (0,k.wk)({body:{...a,model:`${A}/${B}`},modelInfo:{provider:A,model:B},credentials:i,log:x,clientRawRequest:c,connectionId:b.connectionId,userAgent:C,apiKey:e,ccFilterNaming:!!j.ccFilterNaming,rtkEnabled:!!j.rtkEnabled,headroomEnabled:!!j.headroomEnabled,headroomUrl:j.headroomUrl||l.ag,headroomCompressUserMessages:!!j.headroomCompressUserMessages,cavemanEnabled:!!j.cavemanEnabled,cavemanLevel:j.cavemanLevel||"full",ponytailEnabled:!!j.ponytailEnabled,ponytailLevel:j.ponytailLevel||"full",pxpipeEnabled:!!j.pxpipeEnabled,pxpipeMinChars:j.pxpipeMinChars,pxpipeTimeoutMs:j.pxpipeTimeoutMs,pxpipeTransform:j.pxpipeEnabled?await (0,m.RG)():null,onPxpipeEvent:n.T0,providerThinking:q,sourceFormatOverride:d?.url?(0,w.t)(new URL(d.url).pathname,a):null,onCredentialsRefreshed:async a=>{await (0,y.Xg)(b.connectionId,a,{providerSpecificData:b.providerSpecificData,provider:A,log:x})},onCredentialsRefreshFailed:async a=>{await (0,y.Ug)(b.connectionId,{provider:A,reason:a,log:x})},onRequestSuccess:async()=>{await (0,f.Pt)(b.connectionId,b,B);let a=await (0,g.Bf)(A)!==null;await (0,g.Um)(A),a&&await (0,f.C$)(A)}});if(r.success)return r.response;let{shouldFallback:t,channelScope:u}=await (0,f.vk)(b.connectionId,r.status,r.error,A,B,r.resetsAtMs);if(t&&u){let a=await (0,g.Bf)(A),b=(0,h.pT)(a);await (0,g.hj)(A,b);let c=(0,h.Qo)(b.until);return x.warn("AUTH",`${A} | channel blocked for ${Math.round(b.durationMs/1e3)}s (strike ${b.strikes}${b.escalated?", escalated":""}) — aborting account fallback`),x.warn("CHAT",`[${A}/${B}] ${r.error} (channel blocked, ${c})`),(0,o.wO)(r.status||v.gx.SERVICE_UNAVAILABLE,(0,h.vt)(`[${A}/${B}] ${r.error}`),b.until,c)}if(t){x.warn("FALLBACK",`⇄ ACC:${b.connectionName} UNAVAILABLE (${r.status}) → NEXT ACCOUNT`),E.add(b.connectionId),F=r.error,G=r.status,H=(0,p.d)(r.response?.headers);continue}return r.response}}[e,k]=B.then?(await B)():B,d()}catch(a){d(a)}})},83017:(a,b,c)=>{c.d(b,{l:()=>i});var d=c(77598),e=c.n(d),f=c(43659),g=c(41004),h=c(26070);async function i({body:a,modelInfo:b,credentials:c,log:d,onRequestSuccess:j}){let k,l,m,n,{provider:o,model:p}=b,q=h.B$[o]?.systemoneConfig,r=c?.providerSpecificData?.baseUrl||q?.baseUrl;if(!r)return(0,f.A1)(g.gx.BAD_REQUEST,`Provider '${o}' does not support System One.`);if(void 0===a.state||null===a.state)return(0,f.A1)(g.gx.BAD_REQUEST,"Missing required field: state");if(!a.questions||"object"!=typeof a.questions||Array.isArray(a.questions))return(0,f.A1)(g.gx.BAD_REQUEST,"Missing required field: questions");let s=c?.apiKey||c?.accessToken,t=(m=Date.now().toString(16).padStart(12,"0").slice(-12),n=[...e().randomBytes(14)].map(a=>"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[a%62]).join(""),`ses_${m}${n}`),u={"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...q.headers||{},"x-opencode-session":t,"x-opencode-session-id":t},v={...a,model:p};d?.debug?.("SYSTEMONE",`${o.toUpperCase()} | ${p}`);try{k=await fetch(r,{method:"POST",headers:u,body:JSON.stringify(v),..."function"==typeof AbortSignal?.timeout?{signal:AbortSignal.timeout(g.pH)}:{}})}catch(b){let a=(0,f.lR)(b,o,p,g.gx.BAD_GATEWAY);return d?.debug?.("SYSTEMONE",`Fetch error: ${a}`),(0,f.A1)(g.gx.BAD_GATEWAY,a)}if(!k.ok){let{statusCode:a,message:b}=await (0,f.zL)(k),c=(0,f.lR)(Error(b),o,p,a);return d?.debug?.("SYSTEMONE",`Provider error: ${c}`),(0,f.A1)(a,c)}try{l=await k.json()}catch{return(0,f.A1)(g.gx.BAD_GATEWAY,`Invalid JSON response from ${o}`)}j&&await j();let w=l?.usage;return{success:!0,usage:w?{prompt_tokens:w.input_tokens||0,completion_tokens:w.output_tokens||0}:null,response:new Response(JSON.stringify(l),{headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}})}}},87155:(a,b,c)=>{c.d(b,{CG:()=>q,ED:()=>u,S1:()=>s,XF:()=>j,_g:()=>t,no:()=>r,sW:()=>w});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(79646),i=c(49120);let j=g().join(i.nJ,"pxpipe"),k="pxpipe-proxy",l=g().join(j,"install.log"),m="win32"===process.platform,n=[...m?[`${process.env.ProgramFiles||""}\\nodejs`,`${process.env.APPDATA||""}\\npm`]:["/usr/local/bin","/opt/homebrew/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],process.env.PATH||""].filter(Boolean).join(g().delimiter),o=null;function p(){return g().join(j,"node_modules",k)}function q(){return g().join(p(),"dist","core","library.js")}function r(){try{let a=(0,h.execSync)(`${m?"where":"which"} npm`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:n}}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function s(){try{let a=g().join(p(),"package.json");if(!e().existsSync(a)||!e().existsSync(q()))return{installed:!1,version:null,path:null};let b=JSON.parse(e().readFileSync(a,"utf8"));return{installed:!0,version:b.version||null,path:p()}}catch{return{installed:!1,version:null,path:null}}}function t(){return null!==o}function u(){return o||(o=v().finally(()=>{o=null}))}async function v(){let a=r();if(!a){let a=Error("npm not found on PATH — Node.js/npm is required to install PXPIPE");throw a.code="NPM_NOT_FOUND",a}e().existsSync(j)||e().mkdirSync(j,{recursive:!0});let b=g().join(j,"package.json");e().existsSync(b)||e().writeFileSync(b,JSON.stringify({name:"10router-pxpipe-host",private:!0},null,2));let c=e().openSync(l,"a");e().writeSync(c,`
7
7
  [${new Date().toISOString()}] npm install ${k}@latest
8
8
  `),await new Promise((b,d)=>{let e=(0,h.spawn)(a,["install",`${k}@latest`,"--no-audit","--no-fund","--omit=dev"],{cwd:j,stdio:["ignore",c,c],windowsHide:!0,env:{...process.env,PATH:n}}),f=setTimeout(()=>{e.kill("SIGKILL"),d(Error("npm install timed out after 5 minutes — see install.log"))},3e5);e.once("error",a=>{clearTimeout(f),d(a)}),e.once("exit",a=>{clearTimeout(f),0===a?b():d(Error(`npm install exited with code ${a} — see install.log`))})}).finally(()=>e().closeSync(c));let d=s();if(!d.installed)throw Error("install finished but package is missing — see install.log");return d}function w(a=200){try{if(!e().existsSync(l))return"";return e().readFileSync(l,"utf8").split(/\r?\n/).filter(Boolean).slice(-a).join("\n")}catch{return""}}}};