switchboard-router 0.9.46 → 0.9.49

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 (357) hide show
  1. package/app/.next/static/chunks/{1321-468635886f5017ab.js → 1321-431751fe9225bf53.js} +1 -1
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  4. package/app/.next-cli-build/build-manifest.json +2 -2
  5. package/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.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.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.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.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  61. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  62. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  63. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  64. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  68. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  69. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  70. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  71. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  72. package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
  84. package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  86. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  88. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/cli-tools/claude-full-catalog/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +2 -2
  96. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  102. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  106. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +2 -2
  108. package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  112. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  114. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  116. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  118. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  120. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/picker-labels/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js +1 -1
  148. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js +1 -1
  150. package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/models/routable/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/pricing/defaults/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/routing/feedback/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  289. package/app/.next-cli-build/server/app/callback.html +1 -1
  290. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  291. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  292. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  293. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  294. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  298. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  299. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  301. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/index.html +1 -1
  303. package/app/.next-cli-build/server/app/index.rsc +3 -3
  304. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  305. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  306. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  309. package/app/.next-cli-build/server/app/landing.html +1 -1
  310. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  311. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  312. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  313. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  314. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  316. package/app/.next-cli-build/server/app/login.html +1 -1
  317. package/app/.next-cli-build/server/app/login.rsc +4 -4
  318. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  319. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  321. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  324. package/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  325. package/app/.next-cli-build/server/chunks/1350.js +1 -1
  326. package/app/.next-cli-build/server/chunks/2847.js +1 -1
  327. package/app/.next-cli-build/server/chunks/369.js +3 -3
  328. package/app/.next-cli-build/server/chunks/{7880.js → 3694.js} +2 -2
  329. package/app/.next-cli-build/server/chunks/4301.js +1 -0
  330. package/app/.next-cli-build/server/chunks/5717.js +1 -1
  331. package/app/.next-cli-build/server/chunks/7201.js +1 -1
  332. package/app/.next-cli-build/server/chunks/7828.js +1 -1
  333. package/app/.next-cli-build/server/chunks/869.js +1 -1
  334. package/app/.next-cli-build/server/chunks/8998.js +1 -1
  335. package/app/.next-cli-build/server/chunks/9091.js +1 -1
  336. package/app/.next-cli-build/server/chunks/9261.js +1 -1
  337. package/app/.next-cli-build/server/chunks/9264.js +3 -3
  338. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  339. package/app/.next-cli-build/server/middleware.js +1 -1
  340. package/app/.next-cli-build/server/pages/404.html +1 -1
  341. package/app/.next-cli-build/server/pages/500.html +1 -1
  342. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  343. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  344. package/app/.next-cli-build/static/chunks/{1321-468635886f5017ab.js → 1321-431751fe9225bf53.js} +1 -1
  345. package/app/open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls +0 -0
  346. package/app/open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls +0 -0
  347. package/app/open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls +0 -0
  348. package/app/open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls +0 -0
  349. package/app/open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe +0 -0
  350. package/app/open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe +0 -0
  351. package/app/package.json +1 -1
  352. package/package.json +1 -1
  353. package/app/.next-cli-build/server/chunks/1837.js +0 -1
  354. /package/app/.next/static/{WW6AmUFPUk6i1gC7bGp99 → 6k9a5hXyI2Plbuq2Hfh-a}/_buildManifest.js +0 -0
  355. /package/app/.next/static/{WW6AmUFPUk6i1gC7bGp99 → 6k9a5hXyI2Plbuq2Hfh-a}/_ssgManifest.js +0 -0
  356. /package/app/.next-cli-build/static/{WW6AmUFPUk6i1gC7bGp99 → 6k9a5hXyI2Plbuq2Hfh-a}/_buildManifest.js +0 -0
  357. /package/app/.next-cli-build/static/{WW6AmUFPUk6i1gC7bGp99 → 6k9a5hXyI2Plbuq2Hfh-a}/_ssgManifest.js +0 -0
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switchboard-app",
3
- "version": "0.9.46",
3
+ "version": "0.9.49",
4
4
  "description": "Switchboard — intelligent model routing dashboard",
5
5
  "private": true,
6
6
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switchboard-router",
3
- "version": "0.9.46",
3
+ "version": "0.9.49",
4
4
  "description": "Switchboard CLI — local AI routing gateway (install: npm i -g switchboard-router; run: switchboard)",
5
5
  "bin": {
6
6
  "switchboard": "./cli.js",
@@ -1 +0,0 @@
1
- "use strict";exports.id=1837,exports.ids=[1837],exports.modules={43429:(a,b,c)=>{c.d(b,{Y:()=>e});let d=["user-agent","anthropic-beta","anthropic-version","anthropic-dangerous-direct-browser-access","x-app","x-stainless-helper-method","x-stainless-retry-count","x-stainless-runtime-version","x-stainless-package-version","x-stainless-runtime","x-stainless-lang","x-stainless-arch","x-stainless-os","x-stainless-timeout","x-claude-code-session-id","package-version","runtime-version","os","arch"];function e(a){if(!a||"object"!=typeof a)return null;let b={};for(let c of d)void 0!==a[c]&&null!==a[c]&&(b[c]=a[c]);return Object.keys(b).length>0?b:null}},68988:(a,b,c)=>{c.d(b,{A9:()=>i,R8:()=>j,Sx:()=>h,mn:()=>k});var d=c(46052),e=c(13247),f=c(53129);async function g(a){let b=await a.text();try{return JSON.parse(b)}catch{return{error:"invalid_response",error_description:b}}}async function h(a){let b=new URLSearchParams({client_id:a.clientId,scope:a.scope});a.referrer&&b.set("referrer",a.referrer);let c=await (0,d.Fm)(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:b,...e.Ai}),f=await g(c);if(!c.ok)throw Error(`Grok CLI device code request failed: ${f.error_description||f.error||c.status}`);return f}async function i(a,b){let c=await (0,d.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId}),...e.Ai}),f=await g(c),h="authorization_pending"===f.error||"slow_down"===f.error;return{ok:c.ok||h,data:f}}async function j(a){try{let b=await (0,d.Fm)(`${e.Nr}/user`,{headers:(0,e.Ab)(a.access_token),...e.Ai});return{user:b.ok?await b.json():null}}catch{return{user:null}}}function k(a,b=null){let c=b?.user||{},d=(0,f.pG)(a.id_token)||(0,f.J_)(a.access_token)||c.email,e=c.userId||c.principalId||null,g=[c.firstName,c.lastName].filter(Boolean).join(" ").trim();return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,scope:a.scope,...d?{email:d}:{},...g?{displayName:g}:{},providerSpecificData:{authMethod:"device_code",idToken:a.id_token||null,email:d||null,userId:e,hasGrokCodeAccess:c.hasGrokCodeAccess??null,subscriptionTier:c.subscriptionTier??null}}}},74177:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{backfillCodexEmails:()=>y,exchangeTokens:()=>v,extractCodexAccountInfo:()=>l.YR,fetchKiroProfileArn:()=>l.gR,generateAuthData:()=>u,getProvider:()=>s,getProviderNames:()=>t,pollForToken:()=>x,requestDeviceCode:()=>w});var e=c(30369),f=c(55511),g=c.n(f),h=c(28730),i=c(13808),j=c(92990),k=c(73159),l=c(53129),m=c(75008),n=c(22898),o=c(46052),p=c(68988),q=a([e]);e=(q.then?(await q)():q)[0];let z=null;async function r(){if(z)return z;try{let a=await (0,o.Fm)(k.o.discoveryUrl,{headers:{Accept:"application/json"},identity:"grok-cli",provider:"xai",format:"openai"});if(a.ok){let b=await a.json();return z={authorizeUrl:(0,l.js)(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:(0,l.js)(b.token_endpoint,"token_endpoint")}}}catch{}return z={authorizeUrl:k.o.authorizeUrl,tokenUrl:k.o.tokenUrl}}let A={claude:{config:j.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d}),...(0,l.ro)("claude")});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},codex:{config:j.DI,flowType:"authorization_code_pkce",fixedPort:j.DI.fixedPort,callbackPath:j.DI.callbackPath,buildAuthUrl:(a,b,c,d)=>{let e={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c},f=Object.entries(e).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d}),...(0,l.ro)("codex")});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=(0,l.YR)(a.id_token),c={accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in,lastRefreshAt:new Date().toISOString()},d=b.email||(0,l.J_)(a.access_token);return d&&(c.email=d),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}},xai:{config:k.o,flowType:"authorization_code_pkce",fixedPort:k.o.loopbackPort,callbackPath:k.o.callbackPath,pkceVerifierBytes:k.U,prepareConfig:async a=>{let b=await r();return{...a,authorizeUrl:b.authorizeUrl,tokenUrl:b.tokenUrl}},buildAuthUrl:(a,b,c,d)=>{let e=g().randomBytes(16).toString("hex"),f={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c,nonce:e,plan:"generic",referrer:"cli-proxy-api"},h=Object.entries(f).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${h}`},exchangeToken:async(a,b,c,d)=>{let e=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d}),identity:"grok-cli",provider:"xai",format:"openai"});if(!e.ok){let a=await e.text();throw Error(`xAI token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b={accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope},c=(0,l.pG)(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}},"grok-cli":{config:j.qp,flowType:"device_code",requestDeviceCode:p.Sx,pollToken:(a,b)=>(0,p.A9)(a,b),postExchange:p.R8,mapTokens:p.mn},"gemini-cli":{config:j.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c}),...(0,l.ro)("gemini-cli")});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await (0,o.Fm)(`${j.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`},...(0,l.ro)("gemini-cli")}),c=b.ok?await b.json():{},d="";try{let b=await (0,o.Fm)("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,j.cD)(),mode:1}),...(0,l.ro)("gemini-cli")});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},antigravity:{config:j.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c}),identity:"antigravity",provider:"antigravity",format:"antigravity"});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","X-Goog-Api-Client":j.YT.loadCodeAssistApiClient,"Client-Metadata":j.YT.loadCodeAssistClientMetadata},c=(0,j.cD)(),d=await (0,o.Fm)(`${j.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`},identity:"antigravity",provider:"antigravity",format:"antigravity"}),e=d.ok?await d.json():{},f="",g="legacy-tier";try{let a=await (0,o.Fm)(j.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c}),identity:"antigravity",provider:"antigravity",format:"antigravity"});if(a.ok){let b=await a.json();if(f=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){g=a.id.trim();break}}}}catch(a){console.log("Failed to load code assist:",a)}return f&&(async()=>{for(let a=0;a<10;a++){try{let a=await (0,o.Fm)(j.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:g,metadata:c}),identity:"antigravity",provider:"antigravity",format:"antigravity"});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:e,projectId:f}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},iflow:{config:j.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret}),...(0,l.ro)("iflow")});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await (0,o.Fm)(`${j.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"},...(0,l.ro)("iflow")});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qoder:{config:j.hF,flowType:"device_code",requestDeviceCode:async a=>{let{QoderService:b}=await c.e(1531).then(c.bind(c,91531)),d=new b().initiateDeviceFlow();return{device_code:d.nonce,user_code:d.nonce.slice(0,8).toUpperCase(),verification_uri:a.loginUrl,verification_uri_complete:d.verificationUriComplete,expires_in:300,interval:2,codeVerifier:d.codeVerifier,_qoderNonce:d.nonce,_qoderMachineId:d.machineId}},pollToken:async(a,b,d,e)=>{let f,{QoderService:g}=await c.e(1531).then(c.bind(c,91531)),h=new g,i=b||e?._qoderNonce,j=d||e?._qoderVerifier;if(!i||!j)return{ok:!1,data:{error:"invalid_request",error_description:"Missing nonce/verifier"}};try{f=await h.pollDeviceToken({nonce:i,codeVerifier:j})}catch(a){return{ok:!1,data:{error:"poll_failed",error_description:a.message}}}if("pending"===f.status)return{ok:!1,data:{error:"authorization_pending"}};let k=await h.fetchUserInfo(f.accessToken),l=Math.floor((f.expireTime-Date.now())/1e3),m=Math.max(86400,l);return{ok:!0,data:{access_token:f.accessToken,refresh_token:f.refreshToken,expires_in:m,_qoderUserId:f.userId,_qoderMachineId:e?._qoderMachineId||"",_qoderName:k.name,_qoderEmail:k.email,_qoderOrganizationId:k.organizationId}}},mapTokens:a=>{let b=(a._qoderEmail||"").trim(),c=(a._qoderName||"").trim()||null,d=a._qoderUserId||"",e=b||(d?`qoder-user-${d}`:null);return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,email:e,displayName:c,providerSpecificData:{authMethod:"device",userId:d,machineId:a._qoderMachineId||"",organizationId:a._qoderOrganizationId||""}}}},qwen:{config:j.Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await (0,o.Fm)(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod}),...(0,l.ro)("qwen")});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c}),...(0,l.ro)("qwen")}),e=await d.text(),f=null;try{f=e?JSON.parse(e):null}catch{f=null}return f?{ok:d.ok,data:f}:!d.ok&&(d.status>=500||429===d.status)?{ok:!1,data:{error:"authorization_pending"}}:{ok:!1,data:{error:`token_endpoint_http_${d.status}`}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})},github:{config:j.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await (0,o.Fm)(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes}),...(0,l.ro)("github")});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),...(0,l.ro)("github")});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await (0,o.Fm)(j.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json"},identity:"copilot",provider:"github",format:"openai"}),c=b.ok?await b.json():{},d=await (0,o.Fm)(j.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":j.Nu.apiVersion},identity:"copilot",provider:"github",format:"openai"}),e=d.ok?await d.json():{};return{copilotToken:c,userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},kiro:{config:j.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1";(0,j.S6)(d);let e=("string"==typeof c.startUrl?c.startUrl.trim():"")||a.startUrl,f="idc"===c.authMethod?"idc":"builder-id",g=`https://oidc.${d}.amazonaws.com/client/register`,h=`https://oidc.${d}.amazonaws.com/device_authorization`,i=await (0,o.Fm)(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl}),...(0,l.ro)("kiro")});if(!i.ok){let a=await i.text();throw Error(`Client registration failed: ${a}`)}let k=await i.json(),m=await (0,o.Fm)(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:k.clientId,clientSecret:k.clientSecret,startUrl:e}),...(0,l.ro)("kiro")});if(!m.ok){let a=await m.text();throw Error(`Device authorization failed: ${a}`)}let n=await m.json();return{device_code:n.deviceCode,user_code:n.userCode,verification_uri:n.verificationUri,verification_uri_complete:n.verificationUriComplete,expires_in:n.expiresIn,interval:n.interval||5,_clientId:k.clientId,_clientSecret:k.clientSecret,_region:d,_authMethod:f,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,f=d?._region||"us-east-1";(0,j.S6)(f);let g=(0,m.R)(d?._profileArn);if(d?._profileArn&&!g)throw Error("A valid Kiro profile ARN is required for IAM Identity Center");let h=`https://oidc.${f}.amazonaws.com/token`,i=await (0,o.Fm)(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"}),...(0,l.ro)("kiro")});try{e=await i.json()}catch(b){let a=await i.text();e={error:"invalid_response",error_description:a}}if(e.accessToken){let a=(0,m.R)(e.profileArn),b=a?.profileArn||g?.profileArn||await (0,l.gR)(e.accessToken,f);if(d?._authMethod==="idc"&&!b)throw Error("Kiro did not return an enterprise profile. Check that the subscription is active, or enter a profile ARN from `kiro-cli whoami`.");return{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:b,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}}return{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=(0,l.J_)(a.access_token);return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,email:b,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret,region:a._region||"us-east-1",authMethod:a._authMethod||"builder-id",startUrl:a._startUrl||j.Tx.startUrl}}}},cursor:{config:j.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},"kimi-coding":{config:j.t,flowType:"device_code",requestDeviceCode:async a=>{let b=g().randomUUID(),c=await (0,o.Fm)(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...(0,h.VK)(b)},body:new URLSearchParams({client_id:a.clientId}),...(0,l.ro)("kimi-coding")});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}let d=await c.json();return{device_code:d.device_code,user_code:d.user_code,verification_uri:d.verification_uri||"https://www.kimi.com/code/authorize_device",verification_uri_complete:d.verification_uri_complete||`https://www.kimi.com/code/authorize_device?user_code=${d.user_code}`,expires_in:d.expires_in,interval:d.interval||5,_kimiDeviceId:b}},pollToken:async(a,b,c,d)=>{let e,f=d?._kimiDeviceId,g=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...(0,h.VK)(f)},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b}),...(0,l.ro)("kimi-coding")});try{e=await g.json()}catch(b){let a=await g.text();e={error:"invalid_response",error_description:a}}return e.access_token&&f&&(e._kimiDeviceId=f),{ok:g.ok,data:e}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,...a._kimiDeviceId?{providerSpecificData:{deviceId:a._kimiDeviceId}}:{}})},kilocode:{config:j.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await (0,o.Fm)(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"},...(0,l.ro)("kilocode")});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await (0,o.Fm)(`${a.pollUrlBase}/${b}`,{...(0,l.ro)("kilocode")});if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await (0,o.Fm)(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`},...(0,l.ro)("kilocode")});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},cline:{config:j.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await (0,o.Fm)(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c}),...(0,l.ro)("cline")});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},clinepass:{config:j.w1,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c}),...(0,l.ro)("clinepass")});if(!d.ok){let a=await d.text();throw Error(`ClinePass token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},gitlab:{config:j.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=e.clientId||"",h=new URLSearchParams({client_id:g,redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${h.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await (0,o.Fm)(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString(),...(0,l.ro)("gitlab")});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let m=await k.json(),n=await (0,o.Fm)(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${m.access_token}`},...(0,l.ro)("gitlab")}),p=n.ok?await n.json():{};return{...m,_user:p,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},"codebuddy-cn":{config:j.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await (0,o.Fm)(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}",...(0,l.ro)("codebuddy-cn")});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await (0,o.Fm)(`${a.tokenUrl}?state=${encodeURIComponent(b)}`,{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"},...(0,l.ro)("codebuddy-cn")});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer",expires_in:d.data.expiresIn}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||86400,providerSpecificData:{}})},kimchi:{config:j.Td,flowType:"browser_token",buildAuthUrl:(a,b,c)=>{let d=(a.webAppUrl||"https://app.kimchi.dev").replace(/\/+$/,""),e=new URLSearchParams({callback:b,state:c});return`${d}/cli-auth?${e.toString()}`},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!c)throw Error("Missing Kimchi token");let d=a.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",e=await (0,o.Fm)(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`},...(0,l.ro)("kimchi")});if(!e.ok)throw Error(`Kimchi token validation failed: ${e.status}`);let f={};if(a.userInfoUrl)try{let b=await (0,o.Fm)(a.userInfoUrl,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`},...(0,l.ro)("kimchi")});b.ok&&(f=await b.json())}catch{f={}}return{access_token:c,token_type:"Bearer",_kimchiUser:f}},mapTokens:a=>{let b=a._kimchiUser||{},c=b.id?String(b.id):"",d=b.username||"",e=b.email||(c?`kimchi-user-${c}`:null);return{accessToken:a.access_token,refreshToken:null,email:e,displayName:b.name||d||null,providerSpecificData:{authMethod:"browser_token",userId:c,username:d}}}},muse:{config:j.sA,flowType:"device_code",requestDeviceCode:async a=>{let b=await (0,o.Fm)(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":"muse-code/1.0.2"},body:new URLSearchParams({client_id:a.clientId}),...(0,l.ro)("muse")});if(!b.ok){let a=await b.text();throw Error(`Meta device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri,verification_uri_complete:c.verification_uri_complete,expires_in:c.expires_in,interval:c.interval||5}},pollToken:async(a,b)=>{let c,d=await (0,o.Fm)(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":"muse-code/1.0.2"},body:new URLSearchParams({grant_type:a.grantType||"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b}),...(0,l.ro)("muse")}),e=await d.text();try{c=JSON.parse(e)}catch{return{ok:!1,data:{error:`invalid_json: ${e.slice(0,200)}`}}}return d.ok&&c.access_token||"authorization_pending"===c.error||"slow_down"===c.error?{ok:!0,data:c}:{ok:!1,data:{error:c.error||`HTTP ${d.status}`,error_description:c.error_description||c.message||e}}},postExchange:async a=>{let b=a.access_token;if(!b)return null;try{let a=process.env.META_MINT_URL||"https://api.meta.ai/muse-code/key",c=await (0,o.Fm)(a,{method:"POST",headers:{Authorization:`Bearer ${b}`,"User-Agent":"muse-code/1.0.2","Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({dca_token:b}),identity:"muse-code",provider:"muse"});if(c.ok)return await c.json()}catch(a){console.warn("Failed to mint Meta API key from DCA token:",a?.message)}return null},mapTokens:(a,b)=>({accessToken:b?.api_key||a.access_token,apiKey:b?.api_key||a.access_token,refreshToken:a.access_token,expiresIn:a.expires_in,email:b?.user_email||void 0,displayName:b?.user_full_name||void 0,providerSpecificData:{dcaToken:a.access_token,apiKey:b?.api_key||"",baseUrl:b?.base_url||"https://api.meta.ai/v1",subsTierName:b?.subs_tier_name||"",subsTierId:b?.subs_tier_id||"",isSubsActive:!!b?.is_subs_active}})}};function s(a){let b=A[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}function t(){return Object.keys(A)}async function u(a,b,c){let d,e=s(a),f=e.prepareConfig?await e.prepareConfig(e.config,c||{}):e.config,{codeVerifier:g,codeChallenge:h,state:j}=(0,i.lz)(e.pkceVerifierBytes);return d="device_code"===e.flowType?null:"authorization_code_pkce"===e.flowType?e.buildAuthUrl(f,b,j,h,c||{}):e.buildAuthUrl(f,b,j,void 0,c||{}),(0,n.e_)({state:j,provider:a,codeVerifier:g,redirectUri:b||null}),{authUrl:d,state:j,codeVerifier:g,codeChallenge:h,redirectUri:b,flowType:e.flowType,fixedPort:e.fixedPort,callbackPath:e.callbackPath||"/callback"}}async function v(a,b,c,d,e,f){let g=s(a),h=g.prepareConfig?await g.prepareConfig(g.config,f||{}):g.config,i=await g.exchangeToken(h,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(i)),g.mapTokens(i,j)}async function w(a,b,c){let d=s(a);if("device_code"!==d.flowType)throw Error(`Provider ${a} does not support device code flow`);return await d.requestDeviceCode(d.config,b,c||{})}async function x(a,b,c,d){let e=s(a);if("device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if(f.ok)if(f.data.access_token){let b=null;e.postExchange&&(b=await e.postExchange(f.data));let c=e.mapTokens(f.data,b);if("kiro"===a&&!c.providerSpecificData?.profileArn){let a=await (0,l.gR)(c.accessToken,c.providerSpecificData?.region);a&&(c.providerSpecificData.profileArn=a)}return{success:!0,tokens:c}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}let B=!1;async function y(){if(!B){B=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await Promise.resolve().then(c.bind(c,15717));for(let c of(await a()).filter(a=>{if("codex"!==a.provider||"oauth"!==a.authType||!a.idToken)return!1;let b=!!a.email,c=!!a.providerSpecificData?.chatgptAccountId;return!b||!c})){let a=(0,l.YR)(c.idToken);if(!a.email&&!a.chatgptAccountId)continue;let d={};!c.email&&a.email&&(d.email=a.email),(a.chatgptAccountId||a.chatgptPlanType)&&(d.providerSpecificData={...c.providerSpecificData||{},chatgptAccountId:a.chatgptAccountId,chatgptPlanType:a.chatgptPlanType}),Object.keys(d).length&&await b(c.id,d)}}catch(a){B=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}d()}catch(a){d(a)}})},89865:(a,b,c)=>{c.d(b,{A1:()=>h,lR:()=>j,wO:()=>i,yj:()=>f,zL:()=>g});var d=c(87252);async function e(a,b){let c=a?.body?.getReader?.();if(!c)try{return(await a.text()).slice(0,b)}catch{return""}let d=new TextDecoder,e="",f=0;try{for(;f<b;){let{done:a,value:g}=await c.read();if(a)break;let h=g instanceof Uint8Array?g:new Uint8Array(g),i=b-f;if(e+=d.decode(h.subarray(0,i),{stream:h.byteLength<=i}),f+=Math.min(h.byteLength,i),h.byteLength>i){try{await c.cancel("upstream error body limit")}catch{}break}}return e+d.decode()}catch{return e}finally{try{c.releaseLock?.()}catch{}}}function f(a,b){let c;return new Response(JSON.stringify((c=d.LY[a]||(a>=500?{type:"server_error",code:"internal_server_error"}:{type:"invalid_request_error",code:""}),{error:{message:b||d.O[a]||"An error occurred",type:c.type,code:c.code}})),{status:a,headers:{"Content-Type":"application/json"}})}async function g(a,b=null){let c=await e(a,65536);if(b&&"function"==typeof b.parseError)try{let e=b.parseError(a,c);if(e&&"object"==typeof e){let b=e.message||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:e.status||a.status,message:b,resetsAtMs:e.resetsAtMs}}}catch{}let f="";try{let a=JSON.parse(c);f="string"==typeof a?.error?.message?a.error.message:"string"==typeof a?.message?a.message:"string"==typeof a?.error_description?a.error_description:"string"==typeof a?.error?a.error:""}catch{f=c}let h=("string"==typeof f?f:"")||d.O[a.status]||`Upstream error: ${a.status}`;return{statusCode:a.status,message:h}}function h(a,b,c){return{success:!1,status:a,error:b,resetsAtMs:c,response:f(a,b)}}function i(a,b,c,d){let e=Math.max(Math.ceil((new Date(c).getTime()-Date.now())/1e3),1);return new Response(JSON.stringify({error:{message:`${b} (${d})`}}),{status:a,headers:{"Content-Type":"application/json","Retry-After":String(e)}})}function j(a,b,c,d){let e=d||a.code||"FETCH_FAILED",f=a.message||"Unknown error",g=a.cause?.code,h=a.cause?.message,i=g||h?` (cause: ${[g,h].filter(Boolean).join(": ")})`:"";return`[${e}]: ${f}${i}`}}};