9router 0.4.63 → 0.4.71
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.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/required-server-files.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -4
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +5 -5
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
- package/app/.next-cli-build/server/chunks/1249.js +1 -1
- package/app/.next-cli-build/server/chunks/1574.js +2 -2
- package/app/.next-cli-build/server/chunks/1679.js +1 -0
- package/app/.next-cli-build/server/chunks/1909.js +1 -1
- package/app/.next-cli-build/server/chunks/21.js +1 -1
- package/app/.next-cli-build/server/chunks/287.js +10 -0
- package/app/.next-cli-build/server/chunks/4116.js +1 -0
- package/app/.next-cli-build/server/chunks/4185.js +1 -1
- package/app/.next-cli-build/server/chunks/4343.js +1 -1
- package/app/.next-cli-build/server/chunks/4447.js +1 -1
- package/app/.next-cli-build/server/chunks/450.js +2 -2
- package/app/.next-cli-build/server/chunks/5079.js +1 -1
- package/app/.next-cli-build/server/chunks/514.js +1 -1
- package/app/.next-cli-build/server/chunks/5221.js +1 -1
- package/app/.next-cli-build/server/chunks/5412.js +1 -1
- package/app/.next-cli-build/server/chunks/5445.js +1 -1
- package/app/.next-cli-build/server/chunks/586.js +1 -1
- package/app/.next-cli-build/server/chunks/5926.js +1 -0
- package/app/.next-cli-build/server/chunks/6263.js +9 -7
- package/app/.next-cli-build/server/chunks/6379.js +7 -5
- package/app/.next-cli-build/server/chunks/6560.js +1 -1
- package/app/.next-cli-build/server/chunks/666.js +4 -4
- package/app/.next-cli-build/server/chunks/7171.js +1 -1
- package/app/.next-cli-build/server/chunks/7810.js +1 -1
- package/app/.next-cli-build/server/chunks/7958.js +1 -1
- package/app/.next-cli-build/server/chunks/800.js +1 -1
- package/app/.next-cli-build/server/chunks/8202.js +21 -7
- package/app/.next-cli-build/server/chunks/8395.js +1 -1
- package/app/.next-cli-build/server/chunks/8515.js +1 -1
- package/app/.next-cli-build/server/chunks/8718.js +1 -0
- package/app/.next-cli-build/server/chunks/9455.js +1 -0
- package/app/.next-cli-build/server/chunks/9737.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{3771-9c0300235faf81ff.js → 3771-bd799f9ca1565b53.js} +6 -6
- package/app/.next-cli-build/static/chunks/4156-baddf637d83062c4.js +7 -0
- package/app/.next-cli-build/static/chunks/505-9cc4bfeeecd52a1d.js +1 -0
- package/app/.next-cli-build/static/chunks/8035-1cb6bd472ac855e6.js +3 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-cc517a5fd7a180a7.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-1fb39d8d504a37bd.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-73cccbfb5f229176.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-146bb7feac19df7d.js +3 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-25fb00750362bc8d.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-c6ba0f397e71e7a9.js +1 -0
- package/app/.next-cli-build/static/css/47f98e2051b87d48.css +1 -0
- package/app/cli/.build-home/.9router/db/backups/upgrade-0.4.63-to-0.4.65-0.4.65-20260529-160138/data.sqlite +0 -0
- package/app/cli/.build-home/.9router/db/backups/upgrade-0.4.65-to-0.4.66-0.4.66-20260529-174857/data.sqlite +0 -0
- package/app/cli/.build-home/.9router/db/backups/upgrade-0.4.66-to-0.4.71-0.4.71-20260606-161630/data.sqlite +0 -0
- package/app/cli/.build-home/.9router/db/data.sqlite +0 -0
- package/app/package.json +1 -1
- package/app/public/i18n/literals/ar.json +2 -1
- package/app/public/i18n/literals/bn.json +2 -1
- package/app/public/i18n/literals/cs.json +2 -1
- package/app/public/i18n/literals/da.json +2 -1
- package/app/public/i18n/literals/de.json +2 -1
- package/app/public/i18n/literals/el.json +2 -1
- package/app/public/i18n/literals/es.json +2 -1
- package/app/public/i18n/literals/fi.json +2 -1
- package/app/public/i18n/literals/fr.json +2 -1
- package/app/public/i18n/literals/he.json +2 -1
- package/app/public/i18n/literals/hi.json +2 -1
- package/app/public/i18n/literals/hu.json +2 -1
- package/app/public/i18n/literals/id.json +2 -1
- package/app/public/i18n/literals/it.json +2 -1
- package/app/public/i18n/literals/ja.json +2 -1
- package/app/public/i18n/literals/ko.json +2 -1
- package/app/public/i18n/literals/nl.json +2 -1
- package/app/public/i18n/literals/no.json +2 -1
- package/app/public/i18n/literals/pl.json +2 -1
- package/app/public/i18n/literals/pt-BR.json +2 -1
- package/app/public/i18n/literals/pt-PT.json +2 -1
- package/app/public/i18n/literals/ro.json +2 -1
- package/app/public/i18n/literals/ru.json +2 -1
- package/app/public/i18n/literals/sv.json +2 -1
- package/app/public/i18n/literals/th.json +2 -1
- package/app/public/i18n/literals/tl.json +2 -1
- package/app/public/i18n/literals/tr.json +2 -1
- package/app/public/i18n/literals/uk.json +2 -1
- package/app/public/i18n/literals/ur.json +2 -1
- package/app/public/i18n/literals/vi.json +2 -1
- package/app/public/i18n/literals/zh-CN.json +5 -1
- package/app/public/i18n/literals/zh-TW.json +2 -1
- package/app/public/providers/qoder.png +0 -0
- package/app/server.js +1 -1
- package/app/src/lib/oauth/services/qoder.js +216 -0
- package/app/src/mitm/server.js +34 -33
- package/package.json +1 -1
- package/src/cli/menus/providers.js +1 -0
- package/app/.next-cli-build/server/chunks/1578.js +0 -1
- package/app/.next-cli-build/server/chunks/1869.js +0 -1
- package/app/.next-cli-build/server/chunks/504.js +0 -1
- package/app/.next-cli-build/server/chunks/6283.js +0 -1
- package/app/.next-cli-build/server/chunks/7973.js +0 -1
- package/app/.next-cli-build/static/chunks/4156-c9429fb1c6c597c1.js +0 -7
- package/app/.next-cli-build/static/chunks/505-e9e4c888178f0420.js +0 -1
- package/app/.next-cli-build/static/chunks/8035-29d2887f5dbccda4.js +0 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-cd0fd0414de9421f.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-cf6325b0b4557845.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-3582cb03c9ef5dd8.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-495215cffe60eada.js +0 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-a35fe0f44eb4f35d.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-b824357884ed2892.js +0 -1
- package/app/.next-cli-build/static/css/4b7bd5878335a29b.css +0 -1
- /package/app/.next-cli-build/static/{vZzGp60X33yZYtn51xF65 → ysWLxHbP9XPnw5hXviU8p}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{vZzGp60X33yZYtn51xF65 → ysWLxHbP9XPnw5hXviU8p}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
exports.id=1574,exports.ids=[1574],exports.modules={14567:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},27386:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(26835),e=c(53830),f=c(41183),g=c.n(f),h=c(50450),i=c(93617);let j=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],k=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"}];function l({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(""),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!0),[C,D]=(0,e.useState)(!0),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!0),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)("full"),[M,N]=(0,e.useState)(!0),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(""),[U,V]=(0,e.useState)(""),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)(null),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(""),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)(""),[ao,ap]=(0,e.useState)(null),[aq,ar]=(0,e.useState)(""),[as,at]=(0,e.useState)(""),[au,av]=(0,e.useState)(null),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)([]),[aA,aB]=(0,e.useState)(""),[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)(!1),[aG,aH]=(0,e.useState)(!1),aI=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aJ,aK]=(0,e.useState)(!1),[aL,aM]=(0,e.useState)(!1),[aN,aO]=(0,e.useState)(new Set),{copied:aP,copy:aQ}=(0,i.C)(),aR=!A||!C,aS=A?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let aT=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&F(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},aU=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&z(a)}catch(a){console.log("Error updating requireApiKey:",a)}},aV=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:a})})).ok&&H(a)}catch(a){console.log("Error updating rtkEnabled:",a)}},aW=async a=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.log("Error updating setting:",a)}},aX=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},aY=async(...a)=>{X(!0),Z("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return P(!0),X(!1),Z(""),!0;if((Date.now()-c)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return _({type:"error",message:"Tunnel process stopped unexpectedly."}),X(!1),Z(""),!1}}catch{}}return _({type:"error",message:"Tunnel created but not reachable. Please try again."}),X(!1),Z(""),!1},aZ=async()=>{ab(!1),X(!0),_(null),Z("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?Z(`Downloading cloudflared... ${c.download.progress}%`):a&&Z("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void _({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void _({type:"error",message:"No tunnel URL returned"});T(d),V(c.publicUrl||""),await aY(c.publicUrl,d)}catch(a){_({type:"error",message:a.message})}finally{a=!1,X(!1),Z("")}},a$=async()=>{X(!0),_(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(P(!1),T(""),ad(!1),_({type:"success",message:"Tunnel disabled"})):_({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){_({type:"error",message:a.message})}finally{X(!1)}},a_=async()=>{av(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return av(b.installed),b}}catch{}return av(!1),{installed:!1}},a0=async()=>{ax(!0),ap(null),az([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aA})});aB("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)az(a=>[...a.slice(-50),d.message]);else if("done"===c){av(!0),ax(!1),aF(!1),a4();return}else"error"===c&&ap({type:"error",message:d.error||"Install failed"})}}}catch(a){ap({type:"error",message:a.message})}finally{ax(!1)}},a1=async a=>{an("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<3e5;){await new Promise(a=>setTimeout(a,2e3));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},a2=(a,b)=>{ar(a),at(b)},a3=()=>{ar(""),at("")},a4=async()=>{aF(!1),aD(!0),al(!0),ap(null),an("Connecting..."),a3();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aj(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);af(!0),ap(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){a2(b.authUrl,"Open Login Page"),an('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){a3(),an("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aj(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);af(!0),ap(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await a5(b.enableUrl):ap({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}a3(),ap({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await a5(b.enableUrl);ap({type:"error",message:b.error||"Failed to connect"})}catch(a){ap({type:"error",message:a.message})}finally{al(!1),aD(!1),an(""),a3()}},a5=async a=>{a2(a,"Open Funnel Settings"),an('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){a3(),aj(b.tunnelUrl||"");let a=await a1(b.tunnelUrl);af(!0),ap(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){a3(),ap({type:"error",message:b.error});return}}catch{}}a3(),ap({type:"error",message:"Timed out waiting for Funnel to be enabled."})},a6=async()=>{al(!0),ap(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(af(!1),aj(""),aH(!1),ap({type:"success",message:"Tailscale disabled"})):ap({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){ap({type:"error",message:a.message})}finally{al(!1)}},a7=async()=>{ap(null),az([]);let a=await a_();a?.installed&&a?.hasCachedPassword?a4():aF(!0)},a8=async()=>{if(s.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s})}),b=await a.json();a.ok&&(v(b.key),await aX(),t(""),r(!1))}catch(a){console.log("Error creating key:",a)}},a9=async a=>{x({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{x(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),aO(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},ba=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},[bb,bc]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(m,{label:"Local",url:bb,copyId:"local_url",copied:aP,onCopy:aQ}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${O?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),O&&!W&&Q?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${U||S}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aQ(`${U||S}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aP?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>ad(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!O||W||Q?W?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),Y||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{X(!1),Z("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):$?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),$.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ab(!0),children:"Enable"})]}):M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>N(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{aR?_({type:"error",message:`Security required: ${aS}`}):y?ab(!0):_({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aJ?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>ad(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ae?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ae&&!ak&&ag?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${ai}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aQ(`${ai}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aP?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aH(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ae||ak||ag?ak||aC?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),am||"Connecting..."]}),aq&&(0,d.jsx)(h.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aq,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:as||"Open"}),(0,d.jsx)("button",{onClick:()=>{al(!1),aD(!1),an(""),a3()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ao?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ao.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:a7,children:"Enable"})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aR?ap({type:"error",message:`Security required: ${aS}`}):a7()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aL?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aH(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aR&&!O&&!ae&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(p,{message:aS,action:{label:"Open settings",href:"/dashboard/profile"}})}),(O||ae)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!y&&(0,d.jsx)(p,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!A||!C)&&(0,d.jsx)(p,{message:A?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:A?"Change password":"Enable",href:"/dashboard/profile"}})]}),(O||ae)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(h.lM,{checked:E,onChange:()=>aT(!E)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(o,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(h.Zp,{id:"rtk",children:[(0,d.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,d.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,d.jsx)(h.lM,{checked:G,onChange:()=>aV(!G)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,d.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[I&&(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:k.map(a=>(0,d.jsx)("button",{onClick:()=>{var b;L(b=a.id),aW({cavemanLevel:b})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${K===a.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:a.desc,children:a.label},a.id))}),(0,d.jsx)(h.lM,{checked:I,onChange:()=>{var a;J(a=!I),aW({cavemanEnabled:a})}})]})]})]}),(0,d.jsxs)(h.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>r(!0),children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(h.lM,{checked:y,onChange:()=>aU(!y)})]}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>r(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,d.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono",children:aN.has(a.id)?a.key:(b=a.key)?b.length>8?b.slice(0,8)+"...":b:""}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.id,void aO(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:aN.has(a.id)?"Hide key":"Show key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aN.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{onClick:()=>aQ(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aP===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(h.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?x({title:"Pause API Key",message:`Pause API key "${a.name}"?
|
|
1
|
+
exports.id=1574,exports.ids=[1574],exports.modules={14567:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/Working/router4/app/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},27386:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(26835),e=c(53830),f=c(41183),g=c.n(f),h=c(50450),i=c(93617);c(19538);let j=["zh-CN","zh-TW"],k=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],l=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}];function m({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!0),[D,E]=(0,e.useState)(!0),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!0),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)("full"),[N,O]=(0,e.useState)("en"),[P,Q]=(0,e.useState)(!0),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(""),[X,Y]=(0,e.useState)(""),[Z,$]=(0,e.useState)(!1),[_,aa]=(0,e.useState)(""),[ab,ac]=(0,e.useState)(null),[ad,ae]=(0,e.useState)(!1),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(!1),[al,am]=(0,e.useState)(""),[an,ao]=(0,e.useState)(!1),[ap,aq]=(0,e.useState)(""),[ar,as]=(0,e.useState)(null),[at,au]=(0,e.useState)(""),[av,aw]=(0,e.useState)(""),[ax,ay]=(0,e.useState)(null),[az,aA]=(0,e.useState)(!1),[aB,aC]=(0,e.useState)([]),[aD,aE]=(0,e.useState)(""),[aF,aG]=(0,e.useState)(!1),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)(!1),aL=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aM,aN]=(0,e.useState)(!1),[aO,aP]=(0,e.useState)(!1),[aQ,aR]=(0,e.useState)(new Set),[aS,aT]=(0,e.useState)(!1),aU=j.includes(N)?l:l.filter(a=>!a.wenyan),{copied:aV,copy:aW}=(0,i.C)(),aX=!B||!D,aY=B?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let aZ=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&G(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},a$=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&A(a)}catch(a){console.log("Error updating requireApiKey:",a)}},a_=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:a})})).ok&&I(a)}catch(a){console.log("Error updating rtkEnabled:",a)}},a0=async a=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(a){console.log("Error updating setting:",a)}},a1=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},a2=async(...a)=>{$(!0),aa("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return S(!0),$(!1),aa(""),!0;if((Date.now()-c)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return ac({type:"error",message:"Tunnel process stopped unexpectedly."}),$(!1),aa(""),!1}}catch{}}return ac({type:"error",message:"Tunnel created but not reachable. Please try again."}),$(!1),aa(""),!1},a3=async()=>{ae(!1),$(!0),ac(null),aa("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?aa(`Downloading cloudflared... ${c.download.progress}%`):a&&aa("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void ac({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void ac({type:"error",message:"No tunnel URL returned"});W(d),Y(c.publicUrl||""),await a2(c.publicUrl,d)}catch(a){ac({type:"error",message:a.message})}finally{a=!1,$(!1),aa("")}},a4=async()=>{$(!0),ac(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(S(!1),W(""),ag(!1),ac({type:"success",message:"Tunnel disabled"})):ac({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){ac({type:"error",message:a.message})}finally{$(!1)}},a5=async()=>{ay(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return ay(b.installed),b}}catch{}return ay(!1),{installed:!1}},a6=async()=>{aA(!0),as(null),aC([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aD})});aE("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aC(a=>[...a.slice(-50),d.message]);else if("done"===c){ay(!0),aA(!1),aI(!1),ba();return}else"error"===c&&as({type:"error",message:d.error||"Install failed"})}}}catch(a){as({type:"error",message:a.message})}finally{aA(!1)}},a7=async a=>{aq("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<3e5;){await new Promise(a=>setTimeout(a,2e3));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},a8=(a,b)=>{au(a),aw(b)},a9=()=>{au(""),aw("")},ba=async()=>{aI(!1),aG(!0),ao(!0),as(null),aq("Connecting..."),a9();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){am(b.tunnelUrl||"");let a=await a7(b.tunnelUrl);ai(!0),as(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){a8(b.authUrl,"Open Login Page"),aq('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){a9(),aq("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){am(b.tunnelUrl||"");let a=await a7(b.tunnelUrl);ai(!0),as(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await bb(b.enableUrl):as({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}a9(),as({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await bb(b.enableUrl);as({type:"error",message:b.error||"Failed to connect"})}catch(a){as({type:"error",message:a.message})}finally{ao(!1),aG(!1),aq(""),a9()}},bb=async a=>{a8(a,"Open Funnel Settings"),aq('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){a9(),am(b.tunnelUrl||"");let a=await a7(b.tunnelUrl);ai(!0),as(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){a9(),as({type:"error",message:b.error});return}}catch{}}a9(),as({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bc=async()=>{ao(!0),as(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(ai(!1),am(""),aK(!1),as({type:"success",message:"Tailscale disabled"})):as({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){as({type:"error",message:a.message})}finally{ao(!1)}},bd=async()=>{as(null),aC([]);let a=await a5();a?.installed&&a?.hasCachedPassword?ba():aI(!0)},be=async()=>{if(t.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})}),b=await a.json();a.ok&&(w(b.key),await a1(),u(""),s(!1))}catch(a){console.log("Error creating key:",a)}},bf=async a=>{y({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{y(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),aR(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},bg=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},[bh,bi]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(n,{label:"Local",url:bh,copyId:"local_url",copied:aV,onCopy:aW}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${R?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),R&&!Z&&T?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${X||V}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aW(`${X||V}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aV?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>ag(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!R||Z||T?Z?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),_||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{$(!1),aa("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ab?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ab.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ae(!0),children:"Enable"})]}):P?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>Q(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{aX?ac({type:"error",message:`Security required: ${aY}`}):z?ae(!0):ac({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aM?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>ag(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ah?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ah&&!an&&aj?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${al}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>aW(`${al}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aV?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aK(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ah||an||aj?an||aF?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ap||"Connecting..."]}),at&&(0,d.jsx)(h.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(at,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:av||"Open"}),(0,d.jsx)("button",{onClick:()=>{ao(!1),aG(!1),aq(""),a9()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ar?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ar.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:bd,children:"Enable"})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aX?as({type:"error",message:`Security required: ${aY}`}):bd()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aO?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aK(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aX&&!R&&!ah&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(q,{message:aY,action:{label:"Open settings",href:"/dashboard/profile"}})}),(R||ah)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!z&&(0,d.jsx)(q,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!B||!D)&&(0,d.jsx)(q,{message:B?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:B?"Change password":"Enable",href:"/dashboard/profile"}})]}),(R||ah)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(h.lM,{checked:F,onChange:()=>aZ(!F)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(p,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(h.Zp,{id:"rtk",children:[(0,d.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,d.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,d.jsx)(h.lM,{checked:H,onChange:()=>a_(!H)})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,d.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[J&&(0,d.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,d.jsx)("div",{className:"flex items-center gap-1.5",children:aU.map(a=>(0,d.jsx)("button",{onClick:()=>{var b;M(b=a.id),a0({cavemanLevel:b})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${L===a.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:a.desc,children:a.label},a.id))}),(0,d.jsx)("p",{className:"text-xs text-primary",children:l.find(a=>a.id===L)?.desc})]}),(0,d.jsx)(h.lM,{checked:J,onChange:()=>{var a;K(a=!J),a0({cavemanEnabled:a})}})]})]})]}),(0,d.jsxs)(h.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>s(!0),children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(h.lM,{checked:z,onChange:()=>a$(!z)})]}),aS&&!z&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(q,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>s(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,d.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono",children:aQ.has(a.id)?a.key:(b=a.key)?b.length>8?b.slice(0,8)+"...":b:""}),(0,d.jsx)("button",{onClick:()=>{var b;return b=a.id,void aR(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:aQ.has(a.id)?"Hide key":"Show key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aQ.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{onClick:()=>aW(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aV===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)(h.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?y({title:"Pause API Key",message:`Pause API key "${a.name}"?
|
|
2
2
|
|
|
3
|
-
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{
|
|
3
|
+
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{y(null),bg(a.id,b)}}):bg(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{onClick:()=>bf(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsx)(h.aF,{isOpen:r,title:"Create API Key",onClose:()=>{s(!1),u("")},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Key Name",value:t,onChange:a=>u(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:be,fullWidth:!0,disabled:!t.trim(),children:"Create"}),(0,d.jsx)(h.$n,{onClick:()=>{s(!1),u("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!v,title:"API Key Created",onClose:()=>w(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:v||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===aV?"check":"content_copy",onClick:()=>aW(v,"created_key"),children:"created_key"===aV?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>w(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:ad,title:"Enable Tunnel",onClose:()=>ae(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:k.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a3,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(h.$n,{onClick:()=>ae(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:af,title:"Disable Tunnel",onClose:()=>!Z&&ag(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a4,fullWidth:!0,disabled:Z,variant:"danger",children:Z?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>ag(!1),variant:"ghost",fullWidth:!0,disabled:Z,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:aH,title:"Tailscale Funnel",onClose:()=>{az||(aI(!1),aE(""),as(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ax&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ax&&!az&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a6,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(h.$n,{onClick:()=>aI(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),az&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aB.length>0&&(0,d.jsx)("div",{ref:aL,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aB.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===ax&&!az&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>ba(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>aI(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ar&&(0,d.jsx)(o,{status:ar})]})}),(0,d.jsx)(h.aF,{isOpen:aJ,title:"Disable Tailscale",onClose:()=>!an&&aK(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bc,fullWidth:!0,disabled:an,variant:"danger",children:an?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>aK(!1),variant:"ghost",fullWidth:!0,disabled:an,children:"Cancel"})]})]})}),(0,d.jsx)(h.uo,{isOpen:!!x,onClose:()=>y(null),onConfirm:x?.onConfirm,title:x?.title||"Confirm",message:x?.message,variant:"danger"})]})}function n({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:i}){return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(h.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),i]})}function o({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function p({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function q({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}m.propTypes={machineId:g().string.isRequired}},54501:(a,b,c)=>{Promise.resolve().then(c.bind(c,14567))},75662:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(99119);async function e(){return await (0,d.Xj)()}},90949:(a,b,c)=>{Promise.resolve().then(c.bind(c,27386))},99119:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(20243),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(81372);let l=h().join(k.DATA_DIR,"machine-id"),m=h().join(k.DATA_DIR,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.DATA_DIR,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=1679,exports.ids=[1679,9442],exports.modules={24709:(a,b,c)=>{c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(29737);Object.entries(c(50021).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},39006:a=>{a.exports={rE:"0.4.71"}},47978:(a,b,c)=>{c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>u,Nu:()=>n,OV:()=>f,Tx:()=>o,WN:()=>p,Ww:()=>v,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>t,hF:()=>j,lB:()=>s,t:()=>q});var d=c(21820);function e(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let f={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},i={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},j={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},k={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},l={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},o={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},p={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},q={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},t={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},u={baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3},v=3e5},56066:(a,b,c)=>{c.d(b,{C:()=>f});var d=c(16288);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"9Router"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},56659:(a,b,c)=>{c.d(b,{Vq:()=>i,fp:()=>g});var d=c(41578);let e=new Map;function f(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 g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},71679:(a,b,c)=>{c.d(b,{F:()=>t});var d=c(37770),e=c(93250),f=c(56066),g=c(50021),h=c(89489),i=c(29737),j=c(62276),k=c(56659),l=c(47978),m=c(98774);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"9Router",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.w$)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){let c=n[a.provider];if(!c)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(c.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let d=a.accessToken,e=!1,f=null,g=(0,k.fp)(a.provider,a);if(c.refreshable&&g&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};d=b.accessToken,e=!0,f=b}if(c.checkExpiry)return e?{valid:!0,error:null,refreshed:e,newTokens:f}:g?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:e,newTokens:f}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:e}:403===b.status?{valid:!1,error:"Access denied",refreshed:e}:{valid:!1,error:`API returned ${b.status}`,refreshed:e}},c=await b(d);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let g=await p(a);return g?.accessToken?(e=!0,f=g,d=g.accessToken,await b(d)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let g=c.buildUrl?c.buildUrl(d):c.url,h=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d}`,...c.extraHeaders},i={method:c.method,headers:h};c.body&&(i.body=c.body);let j=await r(g,i,b);if(j.ok||c.acceptStatuses&&c.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:e,newTokens:f};if(401===j.status&&c.refreshable&&!e&&a.refreshToken){let d=await p(a);if(d){let a=c.buildUrl?c.buildUrl(d.accessToken):g,e=c.noAuth?{...c.extraHeaders}:{[c.authHeader]:`${c.authPrefix}${d.accessToken}`,...c.extraHeaders},f={method:c.method,headers:e};c.body&&(f.body=c.body);let h=await r(a,f,b);if(h.ok||c.acceptStatuses&&c.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:d}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:e};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:e};return{valid:!1,error:`API returned ${j.status}`,refreshed:e}}catch(a){return{valid:!1,error:a.message,refreshed:e}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,37973));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,37973));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=await r(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j={testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},89442:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.fv,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(37770)},89489:(a,b,c)=>{c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(50021),f=c(24709);d.rE;let g={npmPackageName:"9router",installCmd:"npm i -g 9router",installCmdLatest:"npm i -g 9router@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},h={maxLines:200,pollIntervalMs:1e3},i={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},93250:(a,b,c)=>{c.d(b,{B:()=>f});var d=c(89442);function e(a){return null==a?"":String(a).trim()}async function f(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},98774:(a,b,c)=>{c.d(b,{w$:()=>e});let d=c(39006).rE||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"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 f&&(g.Authorization=f),g}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=1909,exports.ids=[1909],exports.modules={11909:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{PY:()=>u,Re:()=>s,Su:()=>t,exchangeTokens:()=>r,extractCodexAccountInfo:()=>o,kP:()=>q,sO:()=>p});var e=c(46379),f=c(55511),g=c.n(f),h=c(9988),i=c(47978),j=c(75771),k=a([e]);e=(k.then?(await k)():k)[0];let v=null;function l(a,b){let c,d=String(a||"").trim();if(!d)throw Error(`xai discovery ${b} is empty`);try{c=new URL(d)}catch(a){throw Error(`xai discovery ${b} is invalid: ${a.message}`)}if("https:"!==c.protocol)throw Error(`xai discovery ${b} must use https: ${d}`);let e=c.hostname.toLowerCase().trim();if("x.ai"!==e&&!e.endsWith(".x.ai"))throw Error(`xai discovery ${b} host ${e} is not on x.ai`);return d}async function m(){if(v)return v;try{let a=await fetch(j.oT.discoveryUrl,{headers:{Accept:"application/json"}});if(a.ok){let b=await a.json();return v={authorizeUrl:l(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:l(b.token_endpoint,"token_endpoint")}}}catch{}return v={authorizeUrl:j.oT.authorizeUrl,tokenUrl:j.oT.tokenUrl}}function n(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4,e=c+"=".repeat(d);return JSON.parse(Buffer.from(e,"base64").toString("utf8"))}catch{return null}}function o(a){let b=n(a);if(!b)return{};let c=b["https://api.openai.com/auth"]||{};return{email:b.email,chatgptAccountId:c.chatgpt_account_id||b.account_id,chatgptPlanType:c.chatgpt_plan_type||b.plan_type}}let w={claude:{config:i.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},codex:{config:i.DI,flowType:"authorization_code_pkce",fixedPort:1455,callbackPath:"/auth/callback",buildAuthUrl:(a,b,c,d)=>{let e={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c},f=Object.entries(e).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=o(a.id_token),c={accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in};return b.email&&(c.email=b.email),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}},xai:{config:j.oT,flowType:"authorization_code_pkce",fixedPort:j.oT.loopbackPort,callbackPath:j.oT.callbackPath,pkceVerifierBytes:j.Ue,prepareConfig:async a=>{let b=await m();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 fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`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=function(a){if(!a||"string"!=typeof a)return;let b=a.split(".");if(3===b.length)try{let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),c=(4-a.length%4)%4,d=Buffer.from(a+"=".repeat(c),"base64").toString("utf8"),e=JSON.parse(d);return e.email||e.preferred_username||e.sub||void 0}catch{return}}(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}},"gemini-cli":{config:i.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${i.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,i.cD)(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},antigravity:{config:i.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":i.YT.loadCodeAssistUserAgent,"X-Goog-Api-Client":i.YT.loadCodeAssistApiClient,"Client-Metadata":i.YT.loadCodeAssistClientMetadata,"x-request-source":"local"},c=(0,i.cD)(),d=await fetch(`${i.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"}}),e=d.ok?await d.json():{},f="",g="legacy-tier";try{let a=await fetch(i.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c})});if(a.ok){let b=await a.json();if(f=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){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 fetch(i.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:g,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:e,projectId:f}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},iflow:{config:i.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${i.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qoder:{config:i.hF,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,state:c});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${i.hF.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from Qoder");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qwen:{config:i.Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod})});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c})});return{ok:d.ok,data:await d.json()}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})},github:{config:i.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(i.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":i.Nu.apiVersion,"User-Agent":i.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(i.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":i.Nu.apiVersion,"User-Agent":i.Nu.userAgent}}),e=d.ok?await d.json():{};return{copilotToken:c,userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},kiro:{config:i.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1",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 fetch(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})});if(!i.ok){let a=await i.text();throw Error(`Client registration failed: ${a}`)}let j=await i.json(),k=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:j.clientId,clientSecret:j.clientSecret,startUrl:e})});if(!k.ok){let a=await k.text();throw Error(`Device authorization failed: ${a}`)}let l=await k.json();return{device_code:l.deviceCode,user_code:l.userCode,verification_uri:l.verificationUri,verification_uri_complete:l.verificationUriComplete,expires_in:l.expiresIn,interval:l.interval||5,_clientId:j.clientId,_clientSecret:j.clientSecret,_region:d,_authMethod:f,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,f=d?._region||"us-east-1",g=`https://oidc.${f}.amazonaws.com/token`,h=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await h.json()}catch(b){let a=await h.text();e={error:"invalid_response",error_description:a}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=function(a){let b=n(a);if(b)return b.email||b.preferred_username||b.sub||void 0}(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||i.Tx.startUrl}}}},cursor:{config:i.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},"kimi-coding":{config:i.t,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri||"https://www.kimi.com/code/authorize_device",verification_uri_complete:c.verification_uri_complete||`https://www.kimi.com/code/authorize_device?user_code=${c.user_code}`,expires_in:c.expires_in,interval:c.interval||5}},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in})},kilocode:{config:i.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},cline:{config:i.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},gitlab:{config:i.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=e.clientId||"",h=new URLSearchParams({client_id:g,redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${h.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},codebuddy:{config:i.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:JSON.stringify({state:b})});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer"}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:86400,providerSpecificData:{}})}};function p(a){let b=w[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}async function q(a,b,c){let d=p(a),e=d.prepareConfig?await d.prepareConfig(d.config,c||{}):d.config,{codeVerifier:f,codeChallenge:g,state:i}=(0,h.lz)(d.pkceVerifierBytes);return{authUrl:"device_code"===d.flowType?null:"authorization_code_pkce"===d.flowType?d.buildAuthUrl(e,b,i,g,c||{}):d.buildAuthUrl(e,b,i,void 0,c||{}),state:i,codeVerifier:f,codeChallenge:g,redirectUri:b,flowType:d.flowType,fixedPort:d.fixedPort,callbackPath:d.callbackPath||"/callback"}}async function r(a,b,c,d,e,f){let g=p(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 s(a,b,c){let d=p(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 t(a,b,c,d){let e=p(a);if("device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if(f.ok)if(f.data.access_token){let a=null;return e.postExchange&&(a=await e.postExchange(f.data)),{success:!0,tokens:e.mapTokens(f.data,a)}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}let x=!1;async function u(){if(!x){x=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await Promise.resolve().then(c.bind(c,37770));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=o(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){x=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}d()}catch(a){d(a)}})}};
|
|
1
|
+
"use strict";exports.id=1909,exports.ids=[1909],exports.modules={11909:(a,b,c)=>{c.a(a,async(a,d)=>{try{c.d(b,{PY:()=>v,Re:()=>t,Su:()=>u,exchangeTokens:()=>s,extractCodexAccountInfo:()=>p,kP:()=>r,sO:()=>q});var e=c(46379),f=c(55511),g=c.n(f),h=c(9988),i=c(47978),j=c(75771),k=a([e]);e=(k.then?(await k)():k)[0];let w=null;function l(a,b){let c,d=String(a||"").trim();if(!d)throw Error(`xai discovery ${b} is empty`);try{c=new URL(d)}catch(a){throw Error(`xai discovery ${b} is invalid: ${a.message}`)}if("https:"!==c.protocol)throw Error(`xai discovery ${b} must use https: ${d}`);let e=c.hostname.toLowerCase().trim();if("x.ai"!==e&&!e.endsWith(".x.ai"))throw Error(`xai discovery ${b} host ${e} is not on x.ai`);return d}async function m(){if(w)return w;try{let a=await fetch(j.oT.discoveryUrl,{headers:{Accept:"application/json"}});if(a.ok){let b=await a.json();return w={authorizeUrl:l(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:l(b.token_endpoint,"token_endpoint")}}}catch{}return w={authorizeUrl:j.oT.authorizeUrl,tokenUrl:j.oT.tokenUrl}}function n(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4,e=c+"=".repeat(d);return JSON.parse(Buffer.from(e,"base64").toString("utf8"))}catch{return null}}function o(a){let b=n(a);if(b)return b.email||b.preferred_username||b.sub||void 0}function p(a){let b=n(a);if(!b)return{};let c=b["https://api.openai.com/auth"]||{};return{email:b.email,chatgptAccountId:c.chatgpt_account_id||b.account_id,chatgptPlanType:c.chatgpt_plan_type||b.plan_type}}let x={claude:{config:i.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},codex:{config:i.DI,flowType:"authorization_code_pkce",fixedPort:1455,callbackPath:"/auth/callback",buildAuthUrl:(a,b,c,d)=>{let e={response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c},f=Object.entries(e).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=p(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||o(a.access_token);return d&&(c.email=d),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}},xai:{config:j.oT,flowType:"authorization_code_pkce",fixedPort:j.oT.loopbackPort,callbackPath:j.oT.callbackPath,pkceVerifierBytes:j.Ue,prepareConfig:async a=>{let b=await m();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 fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`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=function(a){if(!a||"string"!=typeof a)return;let b=a.split(".");if(3===b.length)try{let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),c=(4-a.length%4)%4,d=Buffer.from(a+"=".repeat(c),"base64").toString("utf8"),e=JSON.parse(d);return e.email||e.preferred_username||e.sub||void 0}catch{return}}(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}},"gemini-cli":{config:i.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${i.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,i.cD)(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},antigravity:{config:i.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":i.YT.loadCodeAssistUserAgent,"X-Goog-Api-Client":i.YT.loadCodeAssistApiClient,"Client-Metadata":i.YT.loadCodeAssistClientMetadata,"x-request-source":"local"},c=(0,i.cD)(),d=await fetch(`${i.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"}}),e=d.ok?await d.json():{},f="",g="legacy-tier";try{let a=await fetch(i.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c})});if(a.ok){let b=await a.json();if(f=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){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 fetch(i.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:g,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:e,projectId:f}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},iflow:{config:i.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${i.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})},qoder:{config:i.hF,flowType:"device_code",requestDeviceCode:async a=>{let{QoderService:b}=await c.e(9455).then(c.bind(c,29455)),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(9455).then(c.bind(c,29455)),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:i.Hp,flowType:"device_code",requestDeviceCode:async(a,b)=>{let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scope,code_challenge:b,code_challenge_method:a.codeChallengeMethod})});if(!c.ok){let a=await c.text();throw Error(`Device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b,code_verifier:c})});return{ok:d.ok,data:await d.json()}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{resourceUrl:a.resource_url}})},github:{config:i.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(i.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":i.Nu.apiVersion,"User-Agent":i.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(i.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":i.Nu.apiVersion,"User-Agent":i.Nu.userAgent}}),e=d.ok?await d.json():{};return{copilotToken:c,userInfo:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},kiro:{config:i.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1",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 fetch(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})});if(!i.ok){let a=await i.text();throw Error(`Client registration failed: ${a}`)}let j=await i.json(),k=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:j.clientId,clientSecret:j.clientSecret,startUrl:e})});if(!k.ok){let a=await k.text();throw Error(`Device authorization failed: ${a}`)}let l=await k.json();return{device_code:l.deviceCode,user_code:l.userCode,verification_uri:l.verificationUri,verification_uri_complete:l.verificationUriComplete,expires_in:l.expiresIn,interval:l.interval||5,_clientId:j.clientId,_clientSecret:j.clientSecret,_region:d,_authMethod:f,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,f=d?._region||"us-east-1",g=`https://oidc.${f}.amazonaws.com/token`,h=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await h.json()}catch(b){let a=await h.text();e={error:"invalid_response",error_description:a}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=o(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||i.Tx.startUrl}}}},cursor:{config:i.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},"kimi-coding":{config:i.t,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}let c=await b.json();return{device_code:c.device_code,user_code:c.user_code,verification_uri:c.verification_uri||"https://www.kimi.com/code/authorize_device",verification_uri_complete:c.verification_uri_complete||`https://www.kimi.com/code/authorize_device?user_code=${c.user_code}`,expires_in:c.expires_in,interval:c.interval||5}},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{c=await d.json()}catch(b){let a=await d.text();c={error:"invalid_response",error_description:a}}return{ok:d.ok,data:c}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in})},kilocode:{config:i.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},cline:{config:i.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},gitlab:{config:i.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=e.clientId||"",h=new URLSearchParams({client_id:g,redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${h.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},codebuddy:{config:i.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:JSON.stringify({state:b})});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer"}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:86400,providerSpecificData:{}})}};function q(a){let b=x[a];if(!b)throw Error(`Unknown provider: ${a}`);return b}async function r(a,b,c){let d=q(a),e=d.prepareConfig?await d.prepareConfig(d.config,c||{}):d.config,{codeVerifier:f,codeChallenge:g,state:i}=(0,h.lz)(d.pkceVerifierBytes);return{authUrl:"device_code"===d.flowType?null:"authorization_code_pkce"===d.flowType?d.buildAuthUrl(e,b,i,g,c||{}):d.buildAuthUrl(e,b,i,void 0,c||{}),state:i,codeVerifier:f,codeChallenge:g,redirectUri:b,flowType:d.flowType,fixedPort:d.fixedPort,callbackPath:d.callbackPath||"/callback"}}async function s(a,b,c,d,e,f){let g=q(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 t(a,b,c){let d=q(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 u(a,b,c,d){let e=q(a);if("device_code"!==e.flowType)throw Error(`Provider ${a} does not support device code flow`);let f=await e.pollToken(e.config,b,c,d);if(f.ok)if(f.data.access_token){let a=null;return e.postExchange&&(a=await e.postExchange(f.data)),{success:!0,tokens:e.mapTokens(f.data,a)}}else if("authorization_pending"===f.data.error||"slow_down"===f.data.error)return{success:!1,error:f.data.error,errorDescription:f.data.error_description||f.data.message,pending:"authorization_pending"===f.data.error};else return{success:!1,error:f.data.error||"no_access_token",errorDescription:f.data.error_description||f.data.message||"No access token received"};return{success:!1,error:f.data.error,errorDescription:f.data.error_description}}let y=!1;async function v(){if(!y){y=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await Promise.resolve().then(c.bind(c,37770));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=p(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){y=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}d()}catch(a){d(a)}})}};
|