9router-proxy 0.6.15 → 0.6.17
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 +9 -9
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- 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.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.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.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.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/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.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/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/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/_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 +2 -2
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- 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/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/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 +5 -5
- 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 +2 -2
- 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 +2 -2
- 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 +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/codewhale-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/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 +2 -2
- 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 +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 +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 +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/crush-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- 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/devin-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +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/forge-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +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 +2 -2
- 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 +2 -2
- 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/omp-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- 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 +2 -2
- 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/cli-tools/pi-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-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/presets/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/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/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.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.nft.json +1 -1
- 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/catalog-sync/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.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/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/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.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/grok-cli/bulk-import/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/api-key/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/import-cli-proxy/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/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/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.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.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/providers/web-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/web-login/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/netlify-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/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/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 +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 +3 -3
- 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]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/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/logs/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.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 +1 -1
- 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/[...model]/route.js.nft.json +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.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.nft.json +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/systemone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +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.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 +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 +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 +2 -2
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +2 -2
- 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/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- 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 +2 -2
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
- 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 +2 -2
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- 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 +9 -9
- package/app/.next-cli-build/server/chunks/1350.js +1 -1
- package/app/.next-cli-build/server/chunks/1757.js +1 -1
- package/app/.next-cli-build/server/chunks/3943.js +1 -1
- package/app/.next-cli-build/server/chunks/4123.js +1 -1
- package/app/.next-cli-build/server/chunks/4577.js +1 -0
- package/app/.next-cli-build/server/chunks/5026.js +1 -1
- package/app/.next-cli-build/server/chunks/5330.js +4 -4
- package/app/.next-cli-build/server/chunks/5615.js +2 -2
- package/app/.next-cli-build/server/chunks/6638.js +1 -1
- package/app/.next-cli-build/server/chunks/7877.js +7 -0
- package/app/.next-cli-build/server/chunks/794.js +1 -1
- package/app/.next-cli-build/server/chunks/8238.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js.nft.json +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/server/preview-props.json +3 -3
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{1321-ceb8908cfe8c5ba5.js → 1321-49da642292269cb3.js} +1 -1
- package/app/open-sse/lib/deepseek-pow-hash.js +450 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/8767.js +0 -7
- /package/app/.next-cli-build/static/{fpfZT4jXLP_-MS9aGSb1r → ZNl8Hs1z--QA5Uwm8j-64}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{fpfZT4jXLP_-MS9aGSb1r → ZNl8Hs1z--QA5Uwm8j-64}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=3943,exports.ids=[3943],exports.modules={7630:(a,b,c)=>{c.d(b,{Ew:()=>o,WH:()=>q,jg:()=>i,rZ:()=>p,xj:()=>j});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cn.devecostudio.huawei.com",h="1008";function i(){return e().randomUUID().replace(/-/g,"")}function j(a,b){let c=new URLSearchParams({port:String(a),appid:h,code:b});return`${g}/console/DevEcoIDE/apply?${c}`}async function k(a,{headers:b={},params:c={},proxyOptions:d=null}={}){let e=new URL(a);for(let[a,b]of Object.entries(c))e.searchParams.set(a,b);let g=await (0,f.proxyAwareFetch)(e.toString(),{method:"GET",headers:b},d),h=await g.text().catch(()=>"");if(!g.ok){let a=Error(`DevEco auth error ${g.status}: ${h.slice(0,200)}`);throw a.authFailed=g.status>=400&&g.status<500,a}return h}async function l(a,b={}){let c=await k(a,b);try{return JSON.parse(c)}catch{let a=Error(`DevEco auth: non-JSON response (${c.slice(0,80)})`);throw a.authFailed=!0,a}}async function m(a,{proxyOptions:b=null}={}){let c=(await k(`${g}/authrouter/auth/api/temptoken/check`,{params:{tempToken:a.split("&")[0],site:"CN",version:"1.0.0",appid:h},proxyOptions:b})).trim(),d=c;if(!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(d))try{let a=JSON.parse(c);d=String(a.jwtToken||a.data?.jwtToken||a.token||"").trim()}catch{}if(3!==d.split(".").length){let a=Error("DevEco: temptoken check returned no jwtToken in JWT form");throw a.authFailed=!0,a}return d}async function n(a,{refresh:b=!1,proxyOptions:c=null}={}){let d=await l(`${g}/authrouter/auth/api/jwToken/check`,{headers:{jwtToken:a,refresh:b?"true":"false"},proxyOptions:c});if(!d?.status)return null;let e=d.userInfo||d.data?.userInfo;return e?.accessToken?{userId:e.userId||"",userName:e.name||"",accessToken:e.accessToken,refreshToken:e.refreshToken||"",jwtToken:a,countryCode:(e.nationalCode||"CN").trim().toUpperCase(),isRealName:"true"===String(e.realName)}:null}async function o(a,{proxyOptions:b=null}={}){let c=await m(a,{proxyOptions:b}),d=await n(c,{proxyOptions:b});if(!d)throw Error("DevEco: jwtToken check returned no access token");return d.expiresAt=Date.now()+18e5,d}function p(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.accessToken,refreshToken:a.jwtToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",jwtToken:a.jwtToken||"",userId:a.userId||b.userId||"",userName:a.userName||b.userName||"",countryCode:a.countryCode||"",isRealName:a.isRealName??b.isRealName??!1,tokenExpiresAt:new Date(a.expiresAt).toISOString()}}}async function q(a,{proxyOptions:b=null,log:c=null}={}){let d=(a?.providerSpecificData||{}).jwtToken||a?.refreshToken||"";if(!d)return c?.warn?.("TOKEN_REFRESH","DevEco: no jwtToken stored — reconnect required"),{error:"invalid_grant",message:"DevEco: jwtToken missing, please re-login"};try{let a=await n(d,{refresh:!0,proxyOptions:b});if(!a)return c?.warn?.("TOKEN_REFRESH","DevEco refresh returned no access token"),{error:"invalid_grant",message:"DevEco: token revoked, please re-login"};return a.expiresAt=Date.now()+18e5,c?.info?.("TOKEN_REFRESH",`DevEco token renewed until ${new Date(a.expiresAt).toISOString()}`),p(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`DevEco refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},8521:(a,b,c)=>{c.d(b,{oD:()=>G,Og:()=>I,jT:()=>H,Sc:()=>J,Wm:()=>r,jR:()=>w,I9:()=>q,Ql:()=>t,rE:()=>C,$B:()=>O,pb:()=>L,qZ:()=>P});var d=c(12643),e=c(75924),f=c(39609);let g=new Map;async function h(a,b,c,d){if(!b)return c();let e=`${a}:${b}`,f=g.get(e);if(f){if(f.promise)return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),f.promise;if(f.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),f.result;g.delete(e)}let h=(async()=>{try{let a=await c(),b={result:a,expiresAt:Date.now()+1e4};g.set(e,b);let d=setTimeout(()=>{g.get(e)===b&&g.delete(e)},1e4);return d.unref?.(),a}catch(a){throw g.delete(e),a}})();return g.set(e,{promise:h}),h}var i=c(18080);let j=null;async function k(a,b){return a?h("xai",a,async()=>{try{j||(j=new(await Promise.all([c.e(5615),c.e(4730)]).then(c.bind(c,84730))).XaiService);let b=await j.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH",`xai refresh failed: ${c?.message||c}`);let a=String(c?.message||"");if(a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant"};return null}},b):null}let l={claude:{bodyFormat:"json",includeClientSecret:!1,url:()=>e.NA.anthropic.token,dedupKey:"claude"},iflow:{url:()=>e.NA.iflow.token,dedupKey:"iflow",extraHeaders:(a,b)=>({Authorization:`Basic ${btoa(`${b.clientId}:${b.clientSecret}`)}`})},github:{url:()=>e.NA.github.token,dedupKey:"github",includeClientSecret:a=>!!a?.clientSecret},kimi:{dedupKey:"kimi",extraHeaders:a=>(0,e.buildKimiHeaders)(a?.providerSpecificData?.deviceId)}};async function m(a,b,c,e){let f=d.xq[a],g=l[a]||{},i=function(a,b,c){if(c?.url)try{return c.url()}catch{}return b?.refreshUrl||d.sr[a]?.tokenUrl||null}(a,f,g);return f&&i?b?h(g.dedupKey||a,b,async()=>{try{let d,h,j,{format:k,body:l}=(d=g?.bodyFormat==="json"?"json":"form",h=g?.includeClientSecret===void 0||("function"==typeof g.includeClientSecret?g.includeClientSecret(f):g.includeClientSecret),j={grant_type:"refresh_token",refresh_token:b,client_id:f.clientId},(h&&f.clientSecret&&(j.client_secret=f.clientSecret),"json"===d)?{format:"json",body:JSON.stringify(j)}:{format:"form",body:new URLSearchParams(j)}),m={"Content-Type":"json"===k?"application/json":"application/x-www-form-urlencoded",Accept:"application/json",...g.extraHeaders&&g.extraHeaders(c,f)||{}},n=await fetch(i,{method:"POST",headers:m,body:l});if(!n.ok){let b=await n.text();return e?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:n.status,error:b}),null}let o=await n.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!o.access_token,hasNewRefreshToken:!!o.refresh_token,expiresIn:o.expires_in}),{accessToken:o.access_token,refreshToken:o.refresh_token||b,expiresIn:o.expires_in,...g.parse&&g.parse(o)||{}}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function n(a,b,c){return m("kimi",a,b,c)}async function o(a,b){return a?h("cline",a,async()=>{try{let c=await fetch(d.xq.cline?.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Cline token",{status:c.status,error:a}),null}let e=await c.json(),f=e?.data||e;if(!f?.accessToken)return null;let g=f.expiresAt?Math.max(1,Math.floor((new Date(f.expiresAt).getTime()-Date.now())/1e3)):f.expiresIn||f.expires_in||3600;return{accessToken:f.accessToken,refreshToken:f.refreshToken||a,expiresIn:g}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing Cline token: ${a.message}`),null}},b):null}async function p(a,b){return m("claude",a,{},b)}async function q(a,b,c,d){return a?h(`google:${b}`,a,async()=>{try{let f=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function r(a,b){return a?h("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text(),d=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error?.code||c?.error||c?.error_code||"",e=c?.error_description||c?.message||a||"",f=`${d} ${e}`.toLowerCase();return{status:b,code:d,description:e,permanent:["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_grant"].some(a=>f.includes(a))}}(a,c.status);if(d.permanent)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used or invalid. Re-auth required.",{status:c.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a,code:d.code,permanent:d.permanent}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function s(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(7774),c.e(7801),c.e(8920),c.e(24),c.e(7187),c.e(8623),c.e(7843),c.e(2578),c.e(3225),c.e(7913),c.e(4957),c.e(8767),c.e(614),c.e(8499),c.e(2327),c.e(5330),c.e(6171),c.e(8895),c.e(4279),c.e(3535)]).then(c.bind(c,74177));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function t(a,b,c,e=null){return a?h("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,j=b?.clientSecret,k=b?.region;if("external_idp"===g){let d;try{d=(0,i.uo)(a,b)}catch(a){return c?.warn?.("TOKEN_REFRESH",`Invalid Kiro external_idp refresh config: ${a.message}`),null}let g=await (0,f.proxyAwareFetch)(d.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:d.body},e);if(!g.ok){let a=await g.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro external_idp token",{status:g.status,error:a}),null}let h=await g.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro external_idp token",{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||a,expiresIn:h.expires_in,providerSpecificData:d.providerSpecificData}}if(h&&j){let d="idc"===g&&k?`https://oidc.${k}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",i=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:j,refreshToken:a,grantType:"refresh_token"})},e);if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:i.status,error:a}),null}let l=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!l.accessToken,expiresIn:l.expiresIn}),{accessToken:l.accessToken,refreshToken:l.refreshToken||a,expiresIn:l.expiresIn,...await s(b,l.accessToken,l.profileArn)}}let l=await (0,f.proxyAwareFetch)(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},e);if(!l.ok){let a=await l.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:l.status,error:a}),null}let m=await l.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!m.accessToken,expiresIn:m.expiresIn}),{accessToken:m.accessToken,refreshToken:m.refreshToken||a,expiresIn:m.expiresIn,...await s(b,m.accessToken,m.profileArn)}},c):null}async function u(a,b){return m("iflow",a,{},b)}async function v(a,b){return m("github",a,{},b)}async function w(a,b){return a?h("copilot",a,async()=>{try{let c=await fetch(d.sr.github?.copilotTokenUrl,{headers:{Authorization:`token ${a}`,"User-Agent":e.x0.USER_AGENT,"Editor-Version":`vscode/${e.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${e.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":e.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!f.token,expiresAt:f.expires_at}),{token:f.token,expiresAt:f.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}},b):null}async function x(a,b){return a?h("codebuddy-cn",a,async()=>{let c=d.sr["codebuddy-cn"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function y(a,b){return a?h("codebuddy-intl",a,async()=>{let c=d.sr["codebuddy-intl"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy intl token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy intl token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy intl token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function z(a,b,c,e="trae"){if(!a)return null;let f=d.sr[e]||{},g=f.exchangeTokenUrl||f.tokenUrl;return g?h(e,a,async()=>{try{let b,d=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"Trae/1.0.0 antigravity-cockpit-tools"},body:JSON.stringify({ClientID:f.clientId||"ono9krqynydwx5",RefreshToken:a,ClientSecret:f.clientSecret||"-",UserID:""})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Trae token",{status:d.status,error:a}),null}let e=await d.json(),h=e?.Result||e?.Data||e?.result||e,i=h?.AccessToken||h?.Token||h?.accessToken;if(!i)return c?.error?.("TOKEN_REFRESH","Trae refresh returned no AccessToken",{payload:e}),null;let j=h?.RefreshToken||h?.refreshToken||a,k=h?.ExpiresAt||h?.TokenExpireAt||h?.expiresAt;if("number"==typeof k){let a=k>1e12?Math.floor(k/1e3):k;b=Math.max(1,a-Math.floor(Date.now()/1e3))}else if("string"==typeof k){let a=new Date(k).getTime()-Date.now();b=a>0?Math.floor(a/1e3):void 0}return c?.info?.("TOKEN_REFRESH","Successfully refreshed Trae token",{hasNewAccessToken:!!i,hasNewRefreshToken:j!==a,expiresIn:b}),{accessToken:i,refreshToken:j,expiresIn:b}}catch(a){return c?.error?.("TOKEN_REFRESH",`Error refreshing Trae token: ${a.message}`),null}},c):(c?.warn?.("TOKEN_REFRESH","No Trae exchangeTokenUrl configured"),null)}async function A(a,b){return b?.info?.("TOKEN_REFRESH","windsurf: apiKey is long-lived (no refresh_token flow) — skipping"),null}let B={"minimax-code":"https://account.minimax.cn/oauth2/token","minimax-code-global":"https://account.minimax.io/oauth2/token"};async function C(a,b,c){let d=B[a];return d&&b?h(a,b,async()=>{try{let e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:"mcode-public",scope:"agent.default",audience:"agent-backend"}).toString(),signal:AbortSignal.timeout(3e4)}),f=await e.json().catch(()=>null);if(!e.ok||f&&"string"==typeof f.error&&f.error){let b=f?.error||`HTTP ${e.status}`;if(400===e.status&&f?.error==="invalid_grant")return c?.warn?.("TOKEN_REFRESH",`MiniMax refresh token spent/rejected (${a}) — sign-in gone`),{error:"invalid_grant"};return c?.error?.("TOKEN_REFRESH",`MiniMax token refresh failed (${a})`,{status:e.status,error:b}),null}if(!f?.access_token)return c?.error?.("TOKEN_REFRESH",`MiniMax refresh returned no access_token (${a})`),null;return{accessToken:f.access_token,refreshToken:f.refresh_token||b,expiresIn:f.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Error refreshing MiniMax token (${a}): ${b.message}`),null}},c):null}async function D(a,b){return a?h("nous",a,async()=>{try{let c=await fetch("https://portal.nousresearch.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-nous-refresh-token":a},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:"hermes-cli"}),signal:AbortSignal.timeout(3e4)});if(!c.ok){let a=await c.text().catch(()=>"");return b?.error?.("TOKEN_REFRESH","Failed to refresh Nous token",{status:c.status,error:a}),null}let d=await c.json();if(!d?.access_token)return b?.error?.("TOKEN_REFRESH","Nous token refresh returned no access_token"),null;let e=null,f=null,g=null;try{let a=await fetch("https://portal.nousresearch.com/api/oauth/agent-key",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${d.access_token}`},body:JSON.stringify({min_ttl_seconds:7200}),signal:AbortSignal.timeout(15e3)});if(a.ok){let c=await a.json();e=c.api_key||null,f=c.key_id||null,g=c.expires_at||null,b?.info?.("TOKEN_REFRESH","Nous agent key minted successfully")}else{let c=await a.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Failed to mint Nous agent key, falling back to access_token",{error:c})}}catch(a){b?.warn?.("TOKEN_REFRESH",`Nous agent key mint error: ${a?.message||a}`)}return{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in,apiKey:e||d.access_token,agentKey:e,providerSpecificData:{...f?{agentKeyId:f}:{},...g?{agentKeyExpiresAt:g}:{}}}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing Nous token: ${a.message}`),null}},b):null}var E=c(71547),F=c(7630);let G=3e5;function H(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function I(a){return e.Wu[a]?e.Wu[a]:"kimi-coding"===a&&e.Wu.kimi?e.Wu.kimi:G}function J(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let K=new Map;async function L(a,b){let d=a.client_email,f=K.get(d);if(f&&f.expiresAt-Date.now()>3e5)return{accessToken:f.token,expiresAt:f.expiresAt};try{let{SignJWT:f,importPKCS8:g}=await Promise.all([c.e(8292),c.e(1455)]).then(c.bind(c,71455));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let h=await g(a.private_key.replace(/\\n/g,"\n"),"RS256"),i=Math.floor(Date.now()/1e3),j=await new f({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience(e.NA.google.token).setIssuedAt(i).setExpirationTime(i+3600).sign(h),k=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:j})});if(!k.ok){let a=await k.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:l,expires_in:m}=await k.json(),n=Date.now()+(m??3600)*1e3;return K.set(d,{token:l,expiresAt:n}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:l,expiresAt:n}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}function M(a,b){let c=J(a.apiKey);return c?L(c,b):null}let N={"gemini-cli":(a,b)=>q(a.refreshToken,d.xq["gemini-cli"].clientId,d.xq["gemini-cli"].clientSecret,b),antigravity:(a,b)=>q(a.refreshToken,d.xq.antigravity.clientId,d.xq.antigravity.clientSecret,b),claude:(a,b)=>p(a.refreshToken,b),codex:(a,b)=>r(a.refreshToken,b),iflow:(a,b)=>u(a.refreshToken,b),github:(a,b)=>v(a.refreshToken,b),kiro:(a,b)=>t(a.refreshToken,a.providerSpecificData,b),xai:(a,b)=>k(a.refreshToken,b),"grok-cli":(a,b)=>k(a.refreshToken,b),gcli:(a,b)=>k(a.refreshToken,b),"codebuddy-cn":(a,b)=>x(a.refreshToken,b),"codebuddy-intl":(a,b)=>y(a.refreshToken,b),codearts:(a,b)=>(0,E.J9)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),deveco:(a,b)=>(0,F.WH)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),trae:(a,b)=>z(a.refreshToken,a,b,"trae"),"trae-enterprise":(a,b)=>z(a.refreshToken,a,b,"trae-enterprise"),cline:(a,b)=>o(a.refreshToken,b),clinepass:(a,b)=>o(a.refreshToken,b),zed:()=>null,windsurf:(a,b)=>A(a,b),kimi:(a,b)=>n(a.refreshToken,a,b),"kimi-coding":(a,b)=>n(a.refreshToken,a,b),"minimax-code":(a,b)=>C("minimax-code",a.refreshToken,b),"minimax-code-global":(a,b)=>C("minimax-code-global",a.refreshToken,b),nous:(a,b)=>D(a.refreshToken,b),vertex:M,"vertex-partner":M};async function O(a,b,c){if(!b.refreshToken)return null;let d=N[a];return d?d(b,c):m(a,b.refreshToken,b,c)}async function P(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}},12643:(a,b,c)=>{c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(26070);function e(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let f=d.xq["xiaomi-tokenplan"]?.regions||{},g=d.xq["xiaomi-tokenplan"]?.defaultRegion;function h(a){return f[a?.providerSpecificData?.region]||f[g]}},18080:(a,b,c)=>{c.d(b,{Xj:()=>i,uo:()=>j});let d=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function e(a){return"string"==typeof a?a.trim():""}function f(a){let b,c=e(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");let f=b.hostname.toLowerCase();if(!d.has(f))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}function g(a){return Array.isArray(a)?a.map(e).filter(Boolean).join(" "):e(a)}function h(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4;return JSON.parse(Buffer.from(`${c}${"=".repeat(d)}`,"base64").toString("utf8"))}catch{return null}}function i(a){let b=a;if("string"==typeof b)try{b=JSON.parse(b)}catch{throw Error("CLIProxyAPI auth JSON is invalid")}if(!b||"object"!=typeof b)throw Error("CLIProxyAPI auth JSON is required");let c=e(b.auth_method||b.authMethod);if(c&&"external_idp"!==c)throw Error("Only external_idp Kiro auth is supported by this importer");let d=e(b.access_token||b.accessToken),i=e(b.refresh_token||b.refreshToken),j=e(b.client_id||b.clientId),k=f(b.token_endpoint||b.tokenEndpoint),l=e(b.profile_arn||b.profileArn),m=e(b.region)||"us-east-1",n=g(b.scopes||b.scope);if(!d)throw Error("access_token is required");if(!i)throw Error("refresh_token is required");if(!j)throw Error("client_id is required");if(!n)throw Error("scopes is required");if(!l)throw Error("profile_arn is required");let o=h(d),p=b.email||o?.email||o?.preferred_username||o?.upn||o?.sub||null;return{accessToken:d,refreshToken:i,expiresAt:function(a){let b=a.expired||a.expires_at||a.expiresAt;if(b){let a=new Date(b).getTime();if(Number.isFinite(a))return new Date(a).toISOString()}let c=Number(a.expires_in||a.expiresIn||0);if(Number.isFinite(c)&&c>0)return new Date(Date.now()+1e3*c).toISOString();let d=h(a.access_token||a.accessToken);return d?.exp?new Date(1e3*d.exp).toISOString():new Date(Date.now()+36e5).toISOString()}(b),email:p,providerSpecificData:{profileArn:l,region:m,authMethod:"external_idp",provider:"CLIProxyAPI",clientId:j,tokenEndpoint:k,scope:n}}}function j(a,b={}){let c=e(b.clientId||b.client_id),d=f(b.tokenEndpoint||b.token_endpoint),h=g(b.scope||b.scopes);if(!a)throw Error("refresh token is required");if(!c)throw Error("clientId is required for external_idp refresh");if(!h)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:d,body:new URLSearchParams({grant_type:"refresh_token",client_id:c,refresh_token:a,scope:h}),providerSpecificData:{...b,authMethod:"external_idp",clientId:c,tokenEndpoint:d,scope:h}}}},39006:a=>{a.exports={rE:"0.6.15"}},71547:(a,b,c)=>{c.d(b,{DK:()=>h,Ew:()=>s,HW:()=>t,J9:()=>w,Qi:()=>j,a_:()=>v,ox:()=>l,xj:()=>n,yn:()=>o,zx:()=>m});var d=c(77598),e=c.n(d),f=c(39609);let g="https://sts.cn-north-4.myhuaweicloud.com",h="https://snap-access.cn-north-4.myhuaweicloud.com",i="CodeArts_Tui",j="codearts/26.9.3";function k(a){return Buffer.from(JSON.stringify(a),"utf8").toString("base64url")}function l(){return e().randomBytes(32).toString("hex")}function m(){let{privateKey:a,publicKey:b}=e().generateKeyPairSync("ec",{namedCurve:"prime256v1"});return{privateKeyJwk:a.export({format:"jwk"}),publicKeyJwk:b.export({format:"jwk"})}}function n({redirectUri:a,codeChallenge:b,ticketId:c,locale:d="zh-cn",portalBase:e="https://codearts.huaweicloud.com/portal"}){let{port:f}=new URL(a),g=new URLSearchParams({locale:d,client_id:i,port:f,code_challenge:b,code_challenge_method:"SHA-256",ticket_id:c});return`${e.replace(/\/+$/,"")}/authorize?${g.toString()}`}function o(a,b="127.0.0.1"){return`http://${b}:${a}/oauth/callback`}async function p(a,b,{extraHeaders:c=null,proxyOptions:d=null,stsBase:h=g}={}){let i=`${h.replace(/\/+$/,"")}/v1/oauth2/tokens`,l=await (0,f.proxyAwareFetch)(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":j,DPoP:function(a,b,c,d=Math.floor(Date.now()/1e3)){if(!a?.privateKeyJwk||!a?.publicKeyJwk)throw Error("CodeArts DPoP key pair is missing; restart the login flow");let f={alg:"ES256",typ:"dpop+jwt",jwk:{crv:"P-256",ext:!0,key_ops:["verify"],kty:"EC",x:a.publicKeyJwk.x,y:a.publicKeyJwk.y}},g={htm:String(b).toUpperCase(),htu:c,iat:d,jti:e().randomBytes(16).toString("hex")},h=`${k(f)}.${k(g)}`,i=e().createPrivateKey({key:a.privateKeyJwk,format:"jwk"}),j=e().sign("sha256",Buffer.from(h),{key:i,dsaEncoding:"ieee-p1363"});return`${h}.${j.toString("base64url")}`}(b,"POST",i),...c||{}},body:new URLSearchParams(a).toString()},d),m=await l.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{n=null}if(!l.ok){var o,q;let a;throw o=l.status,q=n,(a=Error(q?.error_description||q?.error?.message||q?.error||`CodeArts token request failed: HTTP ${o} ${(m||"").slice(0,200)}`)).status=o,(400===o||401===o||403===o)&&(a.authFailed=!0),a}return n}function q({accessKeyId:a,secretAccessKey:b,securityToken:c,expiration:d,refreshToken:e,keyPair:f}){if(!a||!b)return null;let g=Date.parse(d||"");return{accessKeyId:a,secretAccessKey:b,securityToken:c||"",expiresAt:Number.isFinite(g)?g:Date.now()+36e5,refreshToken:e||null,dpopKeyPair:f}}function r(a,b){let c=a?.credentials||a?.Credential||{};return q({accessKeyId:c.access_key_id||c.accessKeyId,secretAccessKey:c.secret_access_key||c.secretAccessKey,securityToken:c.security_token||c.securityToken,expiration:c.expiration,refreshToken:a?.refresh_token||a?.refreshToken,keyPair:b})}async function s({code:a,codeVerifier:b,redirectUri:c,keyPair:d,proxyOptions:e=null,stsBase:f=g}){let h=await p({client_id:i,code:a,code_verifier:b,grant_type:"authorization_code",redirect_uri:c},d,{proxyOptions:e,stsBase:f}),j=r(h,d);if(!j)throw Error("CodeArts token exchange returned no credentials "+JSON.stringify(h?.error||h?.error_description||Object.keys(h||{})));return j}async function t({ticketId:a,secret:b,keyPair:c=null,attempts:d=10,intervalMs:e=1e3,sleep:g=a=>new Promise(b=>setTimeout(b,a)),proxyOptions:i=null,apiBase:k=h}={}){if(!a||!b)throw Error("CodeArts login secret needs its ticket_id");let l=`${k.replace(/\/+$/,"")}/snap-manager/v1/login/ticket?${new URLSearchParams({ticket_id:a,secret:b})}`,m=0;for(let a=1;a<=d;a++){await g(e);let b=await (0,f.proxyAwareFetch)(l,{method:"GET",headers:{Accept:"application/json","User-Agent":j}},i).catch(b=>(m=0,console.log(`[CodeArts] ticket poll ${a}/${d} failed: ${b?.message||b}`),null));if(!b)continue;if(m=b.status,!b.ok){console.log(`[CodeArts] ticket poll ${a}/${d}: HTTP ${b.status}`);continue}let h=await b.text().catch(()=>""),k=null;try{k=h?JSON.parse(h):null}catch{k=null}let n=function(a,b){let c=a?.credential||a?.credentials||{};return q({accessKeyId:c.access||c.access_key_id,secretAccessKey:c.secret||c.secret_access_key,securityToken:c.securitytoken||c.security_token,expiration:c.expires_at||c.expiration,refreshToken:a?.refresh_token,keyPair:b})}(k,c);if(n)return n;console.log(`[CodeArts] ticket poll ${a}/${d}: no credentials in payload`)}throw Error(`CodeArts login ticket never returned credentials (last HTTP ${m||"network error"})`)}async function u({refreshToken:a,accountId:b="",keyPair:c,proxyOptions:d=null,stsBase:e=g}){let f=r(await p({client_id:i,refresh_token:a,grant_type:"refresh_token"},c,{extraHeaders:{"x-agent-user-account":String(b||"")},proxyOptions:d,stsBase:e}),c);if(!f)throw Error("CodeArts refresh returned no credentials");return f.refreshToken||(f.refreshToken=a),f}function v(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.securityToken,refreshToken:a.refreshToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,securityToken:a.securityToken,accountId:a.accountId??b.accountId??"",dpopKeyPair:a.dpopKeyPair||b.dpopKeyPair||null,tokenExpiresAt:new Date(a.expiresAt).toISOString(),...b.userId?{userId:b.userId}:{},...b.domainId?{domainId:b.domainId}:{},...b.userName?{userName:b.userName}:{}}}}async function w(a,{proxyOptions:b=null,log:c=null}={}){let d,e={accessKeyId:(d=a?.providerSpecificData||{}).accessKeyId||"",secretAccessKey:d.secretAccessKey||"",securityToken:d.securityToken||a?.accessToken||"",refreshToken:a?.refreshToken||d.refreshToken||"",accountId:d.accountId||"",dpopKeyPair:d.dpopKeyPair||null};if(!e.refreshToken)return c?.warn?.("TOKEN_REFRESH","CodeArts: connection has no refresh token"),{error:"invalid_grant",message:"CodeArts refresh token missing — reconnect the account"};if(!e.dpopKeyPair?.privateKeyJwk)return c?.warn?.("TOKEN_REFRESH","CodeArts: DPoP key pair was not persisted with the connection"),{error:"invalid_grant",message:"CodeArts DPoP key pair missing — reconnect the account"};try{let a=await u({refreshToken:e.refreshToken,accountId:e.accountId,keyPair:e.dpopKeyPair,proxyOptions:b});if(a.accountId=e.accountId,!a.securityToken)return c?.warn?.("TOKEN_REFRESH","CodeArts refresh returned credentials without a security token"),null;return c?.info?.("TOKEN_REFRESH",`CodeArts AK/SK renewed until ${new Date(a.expiresAt).toISOString()}`),v(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`CodeArts refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},75924:(a,b,c)=>{let d;c.d(b,{Ch:()=>k,Cn:()=>p,Co:()=>z,Ic:()=>w,J5:()=>t,K:()=>u,NA:()=>C,Ok:()=>h,QH:()=>q,Wu:()=>B,buildKimiHeaders:()=>D,dw:()=>s,go:()=>j,iO:()=>A,j5:()=>x,nZ:()=>v,sX:()=>l,uR:()=>r,x0:()=>n,zv:()=>y});var e=c(21820),f=c(12643),g=c(74129);let h={hostname:"inference-api.nousresearch.com",chatCompletionsPath:"/v1/chat/completions",tags:["product=9router","client=9router","user=9router"]},i=f.xq["gemini-cli"]?.cliVersion,j=f.xq["gemini-cli"]?.apiClient,k=f.xq.codex?.cliVersion;function l(a="unknown"){let b;return`GeminiCLI/${i}/${a||"unknown"} (${(0,e.platform)()}; ${"ia32"===(b=(0,e.arch)())?"x86":b}; terminal)`}let m=f.xq.github?.copilot||{},n={VSCODE_VERSION:m.vscodeVersion,COPILOT_CHAT_VERSION:m.chatVersion,USER_AGENT:m.userAgent,API_VERSION:m.apiVersion};function o(){let a=(0,e.platform)(),b=(0,e.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let p={ideType:9,platform:o(),pluginType:2},q="_ide",r="_ide",s=new Set(["Task","TaskOutput","TaskStop","TaskCreate","TaskGet","TaskUpdate","TaskList","Bash","Glob","Grep","Read","Edit","Write","NotebookEdit","WebFetch","WebSearch","AskUserQuestion","Skill","EnterPlanMode","ExitPlanMode"]),t=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),u={"User-Agent":g.Of},v={"gemini-cli":{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},antigravity:{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"}},w={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:o(),pluginType:2})},x={"Content-Type":"application/json","User-Agent":g.Of},y={ideType:9,platform:o(),pluginType:2},z="You are Claude Code, Anthropic's official CLI for Claude.",A=[{from:"You are a Claude agent, built on Anthropic's Claude Agent SDK.",to:""},{from:/You are Hermes(?: Agent)?(?:,\s*(?:an intelligent AI assistant|an AI assistant|an AI agent))?(?:,?\s*(?:built|created)\s+by\s+Nous Research)?\./gi,to:"You are an AI assistant."},{from:/^x-anthropic-billing-header:[^\n]*(?:\r?\n)*/gim,to:""},{from:/opencode/gi,to:a=>"OpenCode"===a?"Antigravity":"OPENCODE"===a?"ANTIGRAVITY":"antigravity"}],B=Object.fromEntries(Object.entries(f.sr).filter(([,a])=>a.refreshLeadMs).map(([a,b])=>[a,b.refreshLeadMs])),C={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:f.sr.codex?.tokenUrl,auth:f.sr.codex?.authorizeUrl},anthropic:{token:f.sr.claude?.tokenUrl,auth:"https://api.anthropic.com/v1/oauth/authorize"},iflow:{token:f.sr.iflow?.tokenUrl,auth:f.sr.iflow?.authorizeUrl},github:{token:f.sr.github?.tokenUrl,auth:f.sr.github?.authorizeUrl,deviceCode:f.sr.github?.deviceCodeUrl}};function D(a){let b=(0,e.platform)(),f=(0,e.arch)(),g=`${b} ${f}`;"darwin"===b?g=`macOS ${f}`:"win32"===b?g=`Windows ${f}`:"linux"===b&&(g=`Linux ${f}`);let h="unknown";try{h=(0,e.hostname)()||"unknown"}catch{h="unknown"}let i="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"9router","X-Msh-Version":function(){if(d)return d;try{d=c(39006).rE||"0.0.0"}catch{d=process.env.npm_package_version||"0.0.0"}return d}(),"X-Msh-Device-Name":h,"X-Msh-Device-Model":g,"X-Msh-Device-Id":i}}},93943:(a,b,c)=>{c.d(b,{Dz:()=>k,MF:()=>m,Vq:()=>n,fp:()=>l});var d=c(16698),e=c(8521),f=c(26070);let g=f.sr.codex?.maxRefreshAgeMs,h=new Map,i=new d.AsyncLocalStorage;function j(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function k(a){return j(a?.expiresAt??a?.tokenExpiresAt)}function l(a,b,c=Date.now()){if(!b)return!1;let d=k(b);if(null!==d&&d-c<(0,e.Og)(a))return!0;let h=f.sr[a]?.maxRefreshAgeMs;return!!(h&&b.refreshToken&&function(a,b=Date.now(),c=g){let d=j(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!d||b-d>=c}(b,c,h))}async function m(a,b,c){let d,e=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),f=i.getStore();if(f?.has(e))return c();let g=h.get(e);if(g)return g;let j=Promise.resolve().then(()=>i.run(new Set([...f||[],e]),c)).finally(()=>{h.delete(e)});return h.set(e,j),j}async function n(a,b,c){return b?m(a,b,async()=>{let d=await (0,e.$B)(a,b,c);return function(a,b,c,d=Date.now()){var g,h;if(!c)return null;if((0,e.jT)(c))return c;let i={},j=new Date(d).toISOString();c.accessToken&&(i.accessToken=c.accessToken),c.apiKey&&(i.apiKey=c.apiKey),c.token&&(i.token=c.token);let k=c.refreshToken??b?.refreshToken;k&&(i.refreshToken=k);let l=c.idToken??b?.idToken;return l&&(i.idToken=l),c.expiresIn?(i.expiresIn=c.expiresIn,i.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,d)):c.expiresAt&&(i.expiresAt=c.expiresAt),c.projectId&&(i.projectId=c.projectId),c.providerSpecificData&&(g=b?.providerSpecificData,i.providerSpecificData=(h=c.providerSpecificData)&&"object"==typeof h?{...g||{},...h}:g),c.copilotToken&&(i.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(i.copilotTokenExpiresAt=c.copilotTokenExpiresAt),(f.sr[a]?.trackRefreshAt||i.accessToken||i.apiKey||i.token||i.refreshToken||i.copilotToken)&&(i.lastRefreshAt=c.lastRefreshAt||j),i}(a,b,d)}):null}}};
|
|
1
|
+
"use strict";exports.id=3943,exports.ids=[3943],exports.modules={7630:(a,b,c)=>{c.d(b,{Ew:()=>o,WH:()=>q,jg:()=>i,rZ:()=>p,xj:()=>j});var d=c(77598),e=c.n(d),f=c(39609);let g="https://cn.devecostudio.huawei.com",h="1008";function i(){return e().randomUUID().replace(/-/g,"")}function j(a,b){let c=new URLSearchParams({port:String(a),appid:h,code:b});return`${g}/console/DevEcoIDE/apply?${c}`}async function k(a,{headers:b={},params:c={},proxyOptions:d=null}={}){let e=new URL(a);for(let[a,b]of Object.entries(c))e.searchParams.set(a,b);let g=await (0,f.proxyAwareFetch)(e.toString(),{method:"GET",headers:b},d),h=await g.text().catch(()=>"");if(!g.ok){let a=Error(`DevEco auth error ${g.status}: ${h.slice(0,200)}`);throw a.authFailed=g.status>=400&&g.status<500,a}return h}async function l(a,b={}){let c=await k(a,b);try{return JSON.parse(c)}catch{let a=Error(`DevEco auth: non-JSON response (${c.slice(0,80)})`);throw a.authFailed=!0,a}}async function m(a,{proxyOptions:b=null}={}){let c=(await k(`${g}/authrouter/auth/api/temptoken/check`,{params:{tempToken:a.split("&")[0],site:"CN",version:"1.0.0",appid:h},proxyOptions:b})).trim(),d=c;if(!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/.test(d))try{let a=JSON.parse(c);d=String(a.jwtToken||a.data?.jwtToken||a.token||"").trim()}catch{}if(3!==d.split(".").length){let a=Error("DevEco: temptoken check returned no jwtToken in JWT form");throw a.authFailed=!0,a}return d}async function n(a,{refresh:b=!1,proxyOptions:c=null}={}){let d=await l(`${g}/authrouter/auth/api/jwToken/check`,{headers:{jwtToken:a,refresh:b?"true":"false"},proxyOptions:c});if(!d?.status)return null;let e=d.userInfo||d.data?.userInfo;return e?.accessToken?{userId:e.userId||"",userName:e.name||"",accessToken:e.accessToken,refreshToken:e.refreshToken||"",jwtToken:a,countryCode:(e.nationalCode||"CN").trim().toUpperCase(),isRealName:"true"===String(e.realName)}:null}async function o(a,{proxyOptions:b=null}={}){let c=await m(a,{proxyOptions:b}),d=await n(c,{proxyOptions:b});if(!d)throw Error("DevEco: jwtToken check returned no access token");return d.expiresAt=Date.now()+18e5,d}function p(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.accessToken,refreshToken:a.jwtToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",jwtToken:a.jwtToken||"",userId:a.userId||b.userId||"",userName:a.userName||b.userName||"",countryCode:a.countryCode||"",isRealName:a.isRealName??b.isRealName??!1,tokenExpiresAt:new Date(a.expiresAt).toISOString()}}}async function q(a,{proxyOptions:b=null,log:c=null}={}){let d=(a?.providerSpecificData||{}).jwtToken||a?.refreshToken||"";if(!d)return c?.warn?.("TOKEN_REFRESH","DevEco: no jwtToken stored — reconnect required"),{error:"invalid_grant",message:"DevEco: jwtToken missing, please re-login"};try{let a=await n(d,{refresh:!0,proxyOptions:b});if(!a)return c?.warn?.("TOKEN_REFRESH","DevEco refresh returned no access token"),{error:"invalid_grant",message:"DevEco: token revoked, please re-login"};return a.expiresAt=Date.now()+18e5,c?.info?.("TOKEN_REFRESH",`DevEco token renewed until ${new Date(a.expiresAt).toISOString()}`),p(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`DevEco refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},8521:(a,b,c)=>{c.d(b,{oD:()=>G,Og:()=>I,jT:()=>H,Sc:()=>J,Wm:()=>r,jR:()=>w,I9:()=>q,Ql:()=>t,rE:()=>C,$B:()=>O,pb:()=>L,qZ:()=>P});var d=c(12643),e=c(75924),f=c(39609);let g=new Map;async function h(a,b,c,d){if(!b)return c();let e=`${a}:${b}`,f=g.get(e);if(f){if(f.promise)return d?.info?.("TOKEN_REFRESH",`Reusing in-flight refresh for ${a}`),f.promise;if(f.expiresAt>Date.now())return d?.info?.("TOKEN_REFRESH",`Reusing recent refresh result for ${a}`),f.result;g.delete(e)}let h=(async()=>{try{let a=await c(),b={result:a,expiresAt:Date.now()+1e4};g.set(e,b);let d=setTimeout(()=>{g.get(e)===b&&g.delete(e)},1e4);return d.unref?.(),a}catch(a){throw g.delete(e),a}})();return g.set(e,{promise:h}),h}var i=c(18080);let j=null;async function k(a,b){return a?h("xai",a,async()=>{try{j||(j=new(await Promise.all([c.e(5615),c.e(4730)]).then(c.bind(c,84730))).XaiService);let b=await j.refreshAccessToken(a);return{accessToken:b.access_token,refreshToken:b.refresh_token||a,expiresIn:b.expires_in,idToken:b.id_token}}catch(c){b?.warn?.("TOKEN_REFRESH",`xai refresh failed: ${c?.message||c}`);let a=String(c?.message||"");if(a.includes("invalid_grant")||a.includes("invalid_request"))return{error:"invalid_grant"};return null}},b):null}let l={claude:{bodyFormat:"json",includeClientSecret:!1,url:()=>e.NA.anthropic.token,dedupKey:"claude"},iflow:{url:()=>e.NA.iflow.token,dedupKey:"iflow",extraHeaders:(a,b)=>({Authorization:`Basic ${btoa(`${b.clientId}:${b.clientSecret}`)}`})},github:{url:()=>e.NA.github.token,dedupKey:"github",includeClientSecret:a=>!!a?.clientSecret},kimi:{dedupKey:"kimi",extraHeaders:a=>(0,e.buildKimiHeaders)(a?.providerSpecificData?.deviceId)}};async function m(a,b,c,e){let f=d.xq[a],g=l[a]||{},i=function(a,b,c){if(c?.url)try{return c.url()}catch{}return b?.refreshUrl||d.sr[a]?.tokenUrl||null}(a,f,g);return f&&i?b?h(g.dedupKey||a,b,async()=>{try{let d,h,j,{format:k,body:l}=(d=g?.bodyFormat==="json"?"json":"form",h=g?.includeClientSecret===void 0||("function"==typeof g.includeClientSecret?g.includeClientSecret(f):g.includeClientSecret),j={grant_type:"refresh_token",refresh_token:b,client_id:f.clientId},(h&&f.clientSecret&&(j.client_secret=f.clientSecret),"json"===d)?{format:"json",body:JSON.stringify(j)}:{format:"form",body:new URLSearchParams(j)}),m={"Content-Type":"json"===k?"application/json":"application/x-www-form-urlencoded",Accept:"application/json",...g.extraHeaders&&g.extraHeaders(c,f)||{}},n=await fetch(i,{method:"POST",headers:m,body:l});if(!n.ok){let b=await n.text();return e?.error?.("TOKEN_REFRESH",`Failed to refresh token for ${a}`,{status:n.status,error:b}),null}let o=await n.json();return e?.info?.("TOKEN_REFRESH",`Successfully refreshed token for ${a}`,{hasNewAccessToken:!!o.access_token,hasNewRefreshToken:!!o.refresh_token,expiresIn:o.expires_in}),{accessToken:o.access_token,refreshToken:o.refresh_token||b,expiresIn:o.expires_in,...g.parse&&g.parse(o)||{}}}catch(b){return e?.error?.("TOKEN_REFRESH",`Error refreshing token for ${a}`,{error:b.message}),null}},e):(e?.warn?.("TOKEN_REFRESH",`No refresh token available for provider: ${a}`),null):(e?.warn?.("TOKEN_REFRESH",`No refresh URL configured for provider: ${a}`),null)}async function n(a,b,c){return m("kimi",a,b,c)}async function o(a,b){return a?h("cline",a,async()=>{try{let c=await fetch(d.xq.cline?.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"})});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Cline token",{status:c.status,error:a}),null}let e=await c.json(),f=e?.data||e;if(!f?.accessToken)return null;let g=f.expiresAt?Math.max(1,Math.floor((new Date(f.expiresAt).getTime()-Date.now())/1e3)):f.expiresIn||f.expires_in||3600;return{accessToken:f.accessToken,refreshToken:f.refreshToken||a,expiresIn:g}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing Cline token: ${a.message}`),null}},b):null}async function p(a,b){return m("claude",a,{},b)}async function q(a,b,c,d){return a?h(`google:${b}`,a,async()=>{try{let f=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:b,client_secret:c})});if(!f.ok){let a=await f.text();return d?.error?.("TOKEN_REFRESH","Failed to refresh Google token",{status:f.status,error:a}),null}let g=await f.json();return d?.info?.("TOKEN_REFRESH","Successfully refreshed Google token",{hasNewAccessToken:!!g.access_token,expiresIn:g.expires_in}),{accessToken:g.access_token,refreshToken:g.refresh_token||a,expiresIn:g.expires_in}}catch(a){return d?.error?.("TOKEN_REFRESH",`Network error refreshing Google token: ${a.message}`),null}},d):null}async function r(a,b){return a?h("codex",a,async()=>{try{let c=await fetch(e.NA.openai.token,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:d.xq.codex.clientId,grant_type:"refresh_token",refresh_token:a})});if(!c.ok){let a=await c.text(),d=function(a="",b=0){let c=null;try{c=a?JSON.parse(a):null}catch{c=null}let d=c?.error?.code||c?.error||c?.error_code||"",e=c?.error_description||c?.message||a||"",f=`${d} ${e}`.toLowerCase();return{status:b,code:d,description:e,permanent:["refresh_token_expired","refresh_token_reused","refresh_token_invalidated","invalid_grant"].some(a=>f.includes(a))}}(a,c.status);if(d.permanent)return b?.error?.("TOKEN_REFRESH","Codex refresh token already used or invalid. Re-auth required.",{status:c.status,code:d.code}),{error:"unrecoverable_refresh_error",code:d.code};return b?.error?.("TOKEN_REFRESH","Failed to refresh Codex token",{status:c.status,error:a,code:d.code,permanent:d.permanent}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Codex token",{hasNewAccessToken:!!f.access_token,hasNewRefreshToken:!!f.refresh_token,hasIdToken:!!f.id_token,expiresIn:f.expires_in}),{accessToken:f.access_token,refreshToken:f.refresh_token||a,idToken:f.id_token,expiresIn:f.expires_in}}catch(a){return b?.error?.("TOKEN_REFRESH",`Network error refreshing Codex token: ${a.message}`),null}},b):null}async function s(a,b,d){if(a?.profileArn)return{};let e=d?.trim?.()||null;if(!e){let{fetchKiroProfileArn:a}=await Promise.all([c.e(7774),c.e(7801),c.e(8920),c.e(24),c.e(7187),c.e(8623),c.e(7843),c.e(2578),c.e(3225),c.e(7913),c.e(4577),c.e(4957),c.e(614),c.e(7877),c.e(8499),c.e(2327),c.e(5330),c.e(6171),c.e(8895),c.e(4279),c.e(3535)]).then(c.bind(c,74177));e=await a(b)}return e?{providerSpecificData:{profileArn:e}}:{}}async function t(a,b,c,e=null){return a?h("kiro",a,async()=>{let g=b?.authMethod,h=b?.clientId,j=b?.clientSecret,k=b?.region;if("external_idp"===g){let d;try{d=(0,i.uo)(a,b)}catch(a){return c?.warn?.("TOKEN_REFRESH",`Invalid Kiro external_idp refresh config: ${a.message}`),null}let g=await (0,f.proxyAwareFetch)(d.tokenEndpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:d.body},e);if(!g.ok){let a=await g.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro external_idp token",{status:g.status,error:a}),null}let h=await g.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro external_idp token",{hasNewAccessToken:!!h.access_token,hasNewRefreshToken:!!h.refresh_token,expiresIn:h.expires_in}),{accessToken:h.access_token,refreshToken:h.refresh_token||a,expiresIn:h.expires_in,providerSpecificData:d.providerSpecificData}}if(h&&j){let d="idc"===g&&k?`https://oidc.${k}.amazonaws.com/token`:"https://oidc.us-east-1.amazonaws.com/token",i=await (0,f.proxyAwareFetch)(d,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:h,clientSecret:j,refreshToken:a,grantType:"refresh_token"})},e);if(!i.ok){let a=await i.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro AWS token",{status:i.status,error:a}),null}let l=await i.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro AWS token",{hasNewAccessToken:!!l.accessToken,expiresIn:l.expiresIn}),{accessToken:l.accessToken,refreshToken:l.refreshToken||a,expiresIn:l.expiresIn,...await s(b,l.accessToken,l.profileArn)}}let l=await (0,f.proxyAwareFetch)(d.xq.kiro.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"kiro-cli/1.0.0"},body:JSON.stringify({refreshToken:a})},e);if(!l.ok){let a=await l.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Kiro social token",{status:l.status,error:a}),null}let m=await l.json();return c?.info?.("TOKEN_REFRESH","Successfully refreshed Kiro social token",{hasNewAccessToken:!!m.accessToken,expiresIn:m.expiresIn}),{accessToken:m.accessToken,refreshToken:m.refreshToken||a,expiresIn:m.expiresIn,...await s(b,m.accessToken,m.profileArn)}},c):null}async function u(a,b){return m("iflow",a,{},b)}async function v(a,b){return m("github",a,{},b)}async function w(a,b){return a?h("copilot",a,async()=>{try{let c=await fetch(d.sr.github?.copilotTokenUrl,{headers:{Authorization:`token ${a}`,"User-Agent":e.x0.USER_AGENT,"Editor-Version":`vscode/${e.x0.VSCODE_VERSION}`,"Editor-Plugin-Version":`copilot-chat/${e.x0.COPILOT_CHAT_VERSION}`,Accept:"application/json","x-github-api-version":e.x0.API_VERSION}});if(!c.ok){let a=await c.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh Copilot token",{status:c.status,error:a}),null}let f=await c.json();return b?.info?.("TOKEN_REFRESH","Successfully refreshed Copilot token",{hasToken:!!f.token,expiresAt:f.expires_at}),{token:f.token,expiresAt:f.expires_at}}catch(a){return b?.error?.("TOKEN_REFRESH","Error refreshing Copilot token",{error:a.message}),null}},b):null}async function x(a,b){return a?h("codebuddy-cn",a,async()=>{let c=d.sr["codebuddy-cn"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function y(a,b){return a?h("codebuddy-intl",a,async()=>{let c=d.sr["codebuddy-intl"]||{},e=await fetch(c.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-Refresh-Token":a,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!e.ok){let a=await e.text();return b?.error?.("TOKEN_REFRESH","Failed to refresh CodeBuddy intl token",{status:e.status,error:a}),null}let f=await e.json();return 0===f.code&&f.data?.accessToken?(b?.info?.("TOKEN_REFRESH","Successfully refreshed CodeBuddy intl token",{hasNewAccessToken:!!f.data.accessToken,hasNewRefreshToken:!!f.data.refreshToken,expiresIn:f.data.expiresIn}),{accessToken:f.data.accessToken,refreshToken:f.data.refreshToken||a,expiresIn:f.data.expiresIn}):(b?.error?.("TOKEN_REFRESH","CodeBuddy intl token refresh returned no token",{code:f.code,msg:f.msg}),null)},b):null}async function z(a,b,c,e="trae"){if(!a)return null;let f=d.sr[e]||{},g=f.exchangeTokenUrl||f.tokenUrl;return g?h(e,a,async()=>{try{let b,d=await fetch(g,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":"Trae/1.0.0 antigravity-cockpit-tools"},body:JSON.stringify({ClientID:f.clientId||"ono9krqynydwx5",RefreshToken:a,ClientSecret:f.clientSecret||"-",UserID:""})});if(!d.ok){let a=await d.text();return c?.error?.("TOKEN_REFRESH","Failed to refresh Trae token",{status:d.status,error:a}),null}let e=await d.json(),h=e?.Result||e?.Data||e?.result||e,i=h?.AccessToken||h?.Token||h?.accessToken;if(!i)return c?.error?.("TOKEN_REFRESH","Trae refresh returned no AccessToken",{payload:e}),null;let j=h?.RefreshToken||h?.refreshToken||a,k=h?.ExpiresAt||h?.TokenExpireAt||h?.expiresAt;if("number"==typeof k){let a=k>1e12?Math.floor(k/1e3):k;b=Math.max(1,a-Math.floor(Date.now()/1e3))}else if("string"==typeof k){let a=new Date(k).getTime()-Date.now();b=a>0?Math.floor(a/1e3):void 0}return c?.info?.("TOKEN_REFRESH","Successfully refreshed Trae token",{hasNewAccessToken:!!i,hasNewRefreshToken:j!==a,expiresIn:b}),{accessToken:i,refreshToken:j,expiresIn:b}}catch(a){return c?.error?.("TOKEN_REFRESH",`Error refreshing Trae token: ${a.message}`),null}},c):(c?.warn?.("TOKEN_REFRESH","No Trae exchangeTokenUrl configured"),null)}async function A(a,b){return b?.info?.("TOKEN_REFRESH","windsurf: apiKey is long-lived (no refresh_token flow) — skipping"),null}let B={"minimax-code":"https://account.minimax.cn/oauth2/token","minimax-code-global":"https://account.minimax.io/oauth2/token"};async function C(a,b,c){let d=B[a];return d&&b?h(a,b,async()=>{try{let e=await fetch(d,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:b,client_id:"mcode-public",scope:"agent.default",audience:"agent-backend"}).toString(),signal:AbortSignal.timeout(3e4)}),f=await e.json().catch(()=>null);if(!e.ok||f&&"string"==typeof f.error&&f.error){let b=f?.error||`HTTP ${e.status}`;if(400===e.status&&f?.error==="invalid_grant")return c?.warn?.("TOKEN_REFRESH",`MiniMax refresh token spent/rejected (${a}) — sign-in gone`),{error:"invalid_grant"};return c?.error?.("TOKEN_REFRESH",`MiniMax token refresh failed (${a})`,{status:e.status,error:b}),null}if(!f?.access_token)return c?.error?.("TOKEN_REFRESH",`MiniMax refresh returned no access_token (${a})`),null;return{accessToken:f.access_token,refreshToken:f.refresh_token||b,expiresIn:f.expires_in}}catch(b){return c?.error?.("TOKEN_REFRESH",`Error refreshing MiniMax token (${a}): ${b.message}`),null}},c):null}async function D(a,b){return a?h("nous",a,async()=>{try{let c=await fetch("https://portal.nousresearch.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-nous-refresh-token":a},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:"hermes-cli"}),signal:AbortSignal.timeout(3e4)});if(!c.ok){let a=await c.text().catch(()=>"");return b?.error?.("TOKEN_REFRESH","Failed to refresh Nous token",{status:c.status,error:a}),null}let d=await c.json();if(!d?.access_token)return b?.error?.("TOKEN_REFRESH","Nous token refresh returned no access_token"),null;let e=null,f=null,g=null;try{let a=await fetch("https://portal.nousresearch.com/api/oauth/agent-key",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${d.access_token}`},body:JSON.stringify({min_ttl_seconds:7200}),signal:AbortSignal.timeout(15e3)});if(a.ok){let c=await a.json();e=c.api_key||null,f=c.key_id||null,g=c.expires_at||null,b?.info?.("TOKEN_REFRESH","Nous agent key minted successfully")}else{let c=await a.text().catch(()=>"");b?.warn?.("TOKEN_REFRESH","Failed to mint Nous agent key, falling back to access_token",{error:c})}}catch(a){b?.warn?.("TOKEN_REFRESH",`Nous agent key mint error: ${a?.message||a}`)}return{accessToken:d.access_token,refreshToken:d.refresh_token||a,expiresIn:d.expires_in,apiKey:e||d.access_token,agentKey:e,providerSpecificData:{...f?{agentKeyId:f}:{},...g?{agentKeyExpiresAt:g}:{}}}}catch(a){return b?.error?.("TOKEN_REFRESH",`Error refreshing Nous token: ${a.message}`),null}},b):null}var E=c(71547),F=c(7630);let G=3e5;function H(a){return a&&"object"==typeof a&&("unrecoverable_refresh_error"===a.error||"refresh_token_reused"===a.error||"invalid_request"===a.error||"invalid_grant"===a.error)}function I(a){return e.Wu[a]?e.Wu[a]:"kimi-coding"===a&&e.Wu.kimi?e.Wu.kimi:G}function J(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("service_account"===b.type&&b.client_email&&b.private_key&&b.project_id)return b;return null}catch{return null}}let K=new Map;async function L(a,b){let d=a.client_email,f=K.get(d);if(f&&f.expiresAt-Date.now()>3e5)return{accessToken:f.token,expiresAt:f.expiresAt};try{let{SignJWT:f,importPKCS8:g}=await Promise.all([c.e(8292),c.e(1455)]).then(c.bind(c,71455));b?.debug?.("TOKEN_REFRESH",`Vertex minting token for ${a.client_email}`);let h=await g(a.private_key.replace(/\\n/g,"\n"),"RS256"),i=Math.floor(Date.now()/1e3),j=await new f({scope:"https://www.googleapis.com/auth/cloud-platform"}).setProtectedHeader({alg:"RS256"}).setIssuer(a.client_email).setAudience(e.NA.google.token).setIssuedAt(i).setExpirationTime(i+3600).sign(h),k=await fetch(e.NA.google.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:j})});if(!k.ok){let a=await k.text();return b?.error?.("TOKEN_REFRESH",`Vertex token mint failed: ${a}`),null}let{access_token:l,expires_in:m}=await k.json(),n=Date.now()+(m??3600)*1e3;return K.set(d,{token:l,expiresAt:n}),b?.info?.("TOKEN_REFRESH",`Vertex token minted for ${a.client_email}`),{accessToken:l,expiresAt:n}}catch(a){return b?.error?.("TOKEN_REFRESH",`Vertex token error: ${a.message}`),null}}function M(a,b){let c=J(a.apiKey);return c?L(c,b):null}let N={"gemini-cli":(a,b)=>q(a.refreshToken,d.xq["gemini-cli"].clientId,d.xq["gemini-cli"].clientSecret,b),antigravity:(a,b)=>q(a.refreshToken,d.xq.antigravity.clientId,d.xq.antigravity.clientSecret,b),claude:(a,b)=>p(a.refreshToken,b),codex:(a,b)=>r(a.refreshToken,b),iflow:(a,b)=>u(a.refreshToken,b),github:(a,b)=>v(a.refreshToken,b),kiro:(a,b)=>t(a.refreshToken,a.providerSpecificData,b),xai:(a,b)=>k(a.refreshToken,b),"grok-cli":(a,b)=>k(a.refreshToken,b),gcli:(a,b)=>k(a.refreshToken,b),"codebuddy-cn":(a,b)=>x(a.refreshToken,b),"codebuddy-intl":(a,b)=>y(a.refreshToken,b),codearts:(a,b)=>(0,E.J9)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),deveco:(a,b)=>(0,F.WH)(a,{log:b,proxyOptions:{connectionProxyEnabled:a?.providerSpecificData?.connectionProxyEnabled===!0,connectionProxyUrl:a?.providerSpecificData?.connectionProxyUrl||"",connectionNoProxy:a?.providerSpecificData?.connectionNoProxy||"",vercelRelayUrl:a?.providerSpecificData?.vercelRelayUrl||""}}),trae:(a,b)=>z(a.refreshToken,a,b,"trae"),"trae-enterprise":(a,b)=>z(a.refreshToken,a,b,"trae-enterprise"),cline:(a,b)=>o(a.refreshToken,b),clinepass:(a,b)=>o(a.refreshToken,b),zed:()=>null,windsurf:(a,b)=>A(a,b),kimi:(a,b)=>n(a.refreshToken,a,b),"kimi-coding":(a,b)=>n(a.refreshToken,a,b),"minimax-code":(a,b)=>C("minimax-code",a.refreshToken,b),"minimax-code-global":(a,b)=>C("minimax-code-global",a.refreshToken,b),nous:(a,b)=>D(a.refreshToken,b),vertex:M,"vertex-partner":M};async function O(a,b,c){if(!b.refreshToken)return null;let d=N[a];return d?d(b,c):m(a,b.refreshToken,b,c)}async function P(a,b=3,c=null){for(let d=0;d<b;d++){if(d>0){let a=1e3*d;c?.debug?.("TOKEN_REFRESH",`Retry ${d}/${b} after ${a}ms`),await new Promise(b=>setTimeout(b,a))}try{let b=await a();if(b)return b}catch(a){c?.warn?.("TOKEN_REFRESH",`Attempt ${d+1}/${b} failed: ${a.message}`)}}return c?.error?.("TOKEN_REFRESH",`All ${b} retry attempts failed`),null}},12643:(a,b,c)=>{c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(26070);function e(a){return(a?.providerSpecificData?.baseUrl?.trim()||"http://localhost:11434").replace(/\/$/,"")}let f=d.xq["xiaomi-tokenplan"]?.regions||{},g=d.xq["xiaomi-tokenplan"]?.defaultRegion;function h(a){return f[a?.providerSpecificData?.region]||f[g]}},18080:(a,b,c)=>{c.d(b,{Xj:()=>i,uo:()=>j});let d=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function e(a){return"string"==typeof a?a.trim():""}function f(a){let b,c=e(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");let f=b.hostname.toLowerCase();if(!d.has(f))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}function g(a){return Array.isArray(a)?a.map(e).filter(Boolean).join(" "):e(a)}function h(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4;return JSON.parse(Buffer.from(`${c}${"=".repeat(d)}`,"base64").toString("utf8"))}catch{return null}}function i(a){let b=a;if("string"==typeof b)try{b=JSON.parse(b)}catch{throw Error("CLIProxyAPI auth JSON is invalid")}if(!b||"object"!=typeof b)throw Error("CLIProxyAPI auth JSON is required");let c=e(b.auth_method||b.authMethod);if(c&&"external_idp"!==c)throw Error("Only external_idp Kiro auth is supported by this importer");let d=e(b.access_token||b.accessToken),i=e(b.refresh_token||b.refreshToken),j=e(b.client_id||b.clientId),k=f(b.token_endpoint||b.tokenEndpoint),l=e(b.profile_arn||b.profileArn),m=e(b.region)||"us-east-1",n=g(b.scopes||b.scope);if(!d)throw Error("access_token is required");if(!i)throw Error("refresh_token is required");if(!j)throw Error("client_id is required");if(!n)throw Error("scopes is required");if(!l)throw Error("profile_arn is required");let o=h(d),p=b.email||o?.email||o?.preferred_username||o?.upn||o?.sub||null;return{accessToken:d,refreshToken:i,expiresAt:function(a){let b=a.expired||a.expires_at||a.expiresAt;if(b){let a=new Date(b).getTime();if(Number.isFinite(a))return new Date(a).toISOString()}let c=Number(a.expires_in||a.expiresIn||0);if(Number.isFinite(c)&&c>0)return new Date(Date.now()+1e3*c).toISOString();let d=h(a.access_token||a.accessToken);return d?.exp?new Date(1e3*d.exp).toISOString():new Date(Date.now()+36e5).toISOString()}(b),email:p,providerSpecificData:{profileArn:l,region:m,authMethod:"external_idp",provider:"CLIProxyAPI",clientId:j,tokenEndpoint:k,scope:n}}}function j(a,b={}){let c=e(b.clientId||b.client_id),d=f(b.tokenEndpoint||b.token_endpoint),h=g(b.scope||b.scopes);if(!a)throw Error("refresh token is required");if(!c)throw Error("clientId is required for external_idp refresh");if(!h)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:d,body:new URLSearchParams({grant_type:"refresh_token",client_id:c,refresh_token:a,scope:h}),providerSpecificData:{...b,authMethod:"external_idp",clientId:c,tokenEndpoint:d,scope:h}}}},39006:a=>{a.exports={rE:"0.6.17"}},71547:(a,b,c)=>{c.d(b,{DK:()=>h,Ew:()=>s,HW:()=>t,J9:()=>w,Qi:()=>j,a_:()=>v,ox:()=>l,xj:()=>n,yn:()=>o,zx:()=>m});var d=c(77598),e=c.n(d),f=c(39609);let g="https://sts.cn-north-4.myhuaweicloud.com",h="https://snap-access.cn-north-4.myhuaweicloud.com",i="CodeArts_Tui",j="codearts/26.9.3";function k(a){return Buffer.from(JSON.stringify(a),"utf8").toString("base64url")}function l(){return e().randomBytes(32).toString("hex")}function m(){let{privateKey:a,publicKey:b}=e().generateKeyPairSync("ec",{namedCurve:"prime256v1"});return{privateKeyJwk:a.export({format:"jwk"}),publicKeyJwk:b.export({format:"jwk"})}}function n({redirectUri:a,codeChallenge:b,ticketId:c,locale:d="zh-cn",portalBase:e="https://codearts.huaweicloud.com/portal"}){let{port:f}=new URL(a),g=new URLSearchParams({locale:d,client_id:i,port:f,code_challenge:b,code_challenge_method:"SHA-256",ticket_id:c});return`${e.replace(/\/+$/,"")}/authorize?${g.toString()}`}function o(a,b="127.0.0.1"){return`http://${b}:${a}/oauth/callback`}async function p(a,b,{extraHeaders:c=null,proxyOptions:d=null,stsBase:h=g}={}){let i=`${h.replace(/\/+$/,"")}/v1/oauth2/tokens`,l=await (0,f.proxyAwareFetch)(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":j,DPoP:function(a,b,c,d=Math.floor(Date.now()/1e3)){if(!a?.privateKeyJwk||!a?.publicKeyJwk)throw Error("CodeArts DPoP key pair is missing; restart the login flow");let f={alg:"ES256",typ:"dpop+jwt",jwk:{crv:"P-256",ext:!0,key_ops:["verify"],kty:"EC",x:a.publicKeyJwk.x,y:a.publicKeyJwk.y}},g={htm:String(b).toUpperCase(),htu:c,iat:d,jti:e().randomBytes(16).toString("hex")},h=`${k(f)}.${k(g)}`,i=e().createPrivateKey({key:a.privateKeyJwk,format:"jwk"}),j=e().sign("sha256",Buffer.from(h),{key:i,dsaEncoding:"ieee-p1363"});return`${h}.${j.toString("base64url")}`}(b,"POST",i),...c||{}},body:new URLSearchParams(a).toString()},d),m=await l.text().catch(()=>""),n=null;try{n=m?JSON.parse(m):null}catch{n=null}if(!l.ok){var o,q;let a;throw o=l.status,q=n,(a=Error(q?.error_description||q?.error?.message||q?.error||`CodeArts token request failed: HTTP ${o} ${(m||"").slice(0,200)}`)).status=o,(400===o||401===o||403===o)&&(a.authFailed=!0),a}return n}function q({accessKeyId:a,secretAccessKey:b,securityToken:c,expiration:d,refreshToken:e,keyPair:f}){if(!a||!b)return null;let g=Date.parse(d||"");return{accessKeyId:a,secretAccessKey:b,securityToken:c||"",expiresAt:Number.isFinite(g)?g:Date.now()+36e5,refreshToken:e||null,dpopKeyPair:f}}function r(a,b){let c=a?.credentials||a?.Credential||{};return q({accessKeyId:c.access_key_id||c.accessKeyId,secretAccessKey:c.secret_access_key||c.secretAccessKey,securityToken:c.security_token||c.securityToken,expiration:c.expiration,refreshToken:a?.refresh_token||a?.refreshToken,keyPair:b})}async function s({code:a,codeVerifier:b,redirectUri:c,keyPair:d,proxyOptions:e=null,stsBase:f=g}){let h=await p({client_id:i,code:a,code_verifier:b,grant_type:"authorization_code",redirect_uri:c},d,{proxyOptions:e,stsBase:f}),j=r(h,d);if(!j)throw Error("CodeArts token exchange returned no credentials "+JSON.stringify(h?.error||h?.error_description||Object.keys(h||{})));return j}async function t({ticketId:a,secret:b,keyPair:c=null,attempts:d=10,intervalMs:e=1e3,sleep:g=a=>new Promise(b=>setTimeout(b,a)),proxyOptions:i=null,apiBase:k=h}={}){if(!a||!b)throw Error("CodeArts login secret needs its ticket_id");let l=`${k.replace(/\/+$/,"")}/snap-manager/v1/login/ticket?${new URLSearchParams({ticket_id:a,secret:b})}`,m=0;for(let a=1;a<=d;a++){await g(e);let b=await (0,f.proxyAwareFetch)(l,{method:"GET",headers:{Accept:"application/json","User-Agent":j}},i).catch(b=>(m=0,console.log(`[CodeArts] ticket poll ${a}/${d} failed: ${b?.message||b}`),null));if(!b)continue;if(m=b.status,!b.ok){console.log(`[CodeArts] ticket poll ${a}/${d}: HTTP ${b.status}`);continue}let h=await b.text().catch(()=>""),k=null;try{k=h?JSON.parse(h):null}catch{k=null}let n=function(a,b){let c=a?.credential||a?.credentials||{};return q({accessKeyId:c.access||c.access_key_id,secretAccessKey:c.secret||c.secret_access_key,securityToken:c.securitytoken||c.security_token,expiration:c.expires_at||c.expiration,refreshToken:a?.refresh_token,keyPair:b})}(k,c);if(n)return n;console.log(`[CodeArts] ticket poll ${a}/${d}: no credentials in payload`)}throw Error(`CodeArts login ticket never returned credentials (last HTTP ${m||"network error"})`)}async function u({refreshToken:a,accountId:b="",keyPair:c,proxyOptions:d=null,stsBase:e=g}){let f=r(await p({client_id:i,refresh_token:a,grant_type:"refresh_token"},c,{extraHeaders:{"x-agent-user-account":String(b||"")},proxyOptions:d,stsBase:e}),c);if(!f)throw Error("CodeArts refresh returned no credentials");return f.refreshToken||(f.refreshToken=a),f}function v(a,b={}){let c=Math.max(60,Math.floor((a.expiresAt-Date.now())/1e3));return{accessToken:a.securityToken,refreshToken:a.refreshToken||null,expiresIn:c,providerSpecificData:{authMethod:"oauth",accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,securityToken:a.securityToken,accountId:a.accountId??b.accountId??"",dpopKeyPair:a.dpopKeyPair||b.dpopKeyPair||null,tokenExpiresAt:new Date(a.expiresAt).toISOString(),...b.userId?{userId:b.userId}:{},...b.domainId?{domainId:b.domainId}:{},...b.userName?{userName:b.userName}:{}}}}async function w(a,{proxyOptions:b=null,log:c=null}={}){let d,e={accessKeyId:(d=a?.providerSpecificData||{}).accessKeyId||"",secretAccessKey:d.secretAccessKey||"",securityToken:d.securityToken||a?.accessToken||"",refreshToken:a?.refreshToken||d.refreshToken||"",accountId:d.accountId||"",dpopKeyPair:d.dpopKeyPair||null};if(!e.refreshToken)return c?.warn?.("TOKEN_REFRESH","CodeArts: connection has no refresh token"),{error:"invalid_grant",message:"CodeArts refresh token missing — reconnect the account"};if(!e.dpopKeyPair?.privateKeyJwk)return c?.warn?.("TOKEN_REFRESH","CodeArts: DPoP key pair was not persisted with the connection"),{error:"invalid_grant",message:"CodeArts DPoP key pair missing — reconnect the account"};try{let a=await u({refreshToken:e.refreshToken,accountId:e.accountId,keyPair:e.dpopKeyPair,proxyOptions:b});if(a.accountId=e.accountId,!a.securityToken)return c?.warn?.("TOKEN_REFRESH","CodeArts refresh returned credentials without a security token"),null;return c?.info?.("TOKEN_REFRESH",`CodeArts AK/SK renewed until ${new Date(a.expiresAt).toISOString()}`),v(a)}catch(a){if(c?.error?.("TOKEN_REFRESH",`CodeArts refresh failed: ${a.message}`),a.authFailed)return{error:"invalid_grant",message:a.message};return null}}},75924:(a,b,c)=>{let d;c.d(b,{Ch:()=>k,Cn:()=>p,Co:()=>z,Ic:()=>w,J5:()=>t,K:()=>u,NA:()=>C,Ok:()=>h,QH:()=>q,Wu:()=>B,buildKimiHeaders:()=>D,dw:()=>s,go:()=>j,iO:()=>A,j5:()=>x,nZ:()=>v,sX:()=>l,uR:()=>r,x0:()=>n,zv:()=>y});var e=c(21820),f=c(12643),g=c(74129);let h={hostname:"inference-api.nousresearch.com",chatCompletionsPath:"/v1/chat/completions",tags:["product=9router","client=9router","user=9router"]},i=f.xq["gemini-cli"]?.cliVersion,j=f.xq["gemini-cli"]?.apiClient,k=f.xq.codex?.cliVersion;function l(a="unknown"){let b;return`GeminiCLI/${i}/${a||"unknown"} (${(0,e.platform)()}; ${"ia32"===(b=(0,e.arch)())?"x86":b}; terminal)`}let m=f.xq.github?.copilot||{},n={VSCODE_VERSION:m.vscodeVersion,COPILOT_CHAT_VERSION:m.chatVersion,USER_AGENT:m.userAgent,API_VERSION:m.apiVersion};function o(){let a=(0,e.platform)(),b=(0,e.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let p={ideType:9,platform:o(),pluginType:2},q="_ide",r="_ide",s=new Set(["Task","TaskOutput","TaskStop","TaskCreate","TaskGet","TaskUpdate","TaskList","Bash","Glob","Grep","Read","Edit","Write","NotebookEdit","WebFetch","WebSearch","AskUserQuestion","Skill","EnterPlanMode","ExitPlanMode"]),t=new Set(["browser_subagent","command_status","find_by_name","generate_image","grep_search","list_dir","list_resources","multi_replace_file_content","notify_user","read_resource","read_terminal","read_url_content","replace_file_content","run_command","search_web","send_command_input","task_boundary","view_content_chunk","view_file","write_to_file"]),u={"User-Agent":g.Of},v={"gemini-cli":{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"},antigravity:{loadCodeAssist:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUser:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser"}},w={"Content-Type":"application/json","User-Agent":"google-api-nodejs-client/9.15.1","X-Goog-Api-Client":"google-cloud-sdk vscode_cloudshelleditor/0.1","Client-Metadata":JSON.stringify({ideType:9,platform:o(),pluginType:2})},x={"Content-Type":"application/json","User-Agent":g.Of},y={ideType:9,platform:o(),pluginType:2},z="You are Claude Code, Anthropic's official CLI for Claude.",A=[{from:"You are a Claude agent, built on Anthropic's Claude Agent SDK.",to:""},{from:/You are Hermes(?: Agent)?(?:,\s*(?:an intelligent AI assistant|an AI assistant|an AI agent))?(?:,?\s*(?:built|created)\s+by\s+Nous Research)?\./gi,to:"You are an AI assistant."},{from:/^x-anthropic-billing-header:[^\n]*(?:\r?\n)*/gim,to:""},{from:/opencode/gi,to:a=>"OpenCode"===a?"Antigravity":"OPENCODE"===a?"ANTIGRAVITY":"antigravity"}],B=Object.fromEntries(Object.entries(f.sr).filter(([,a])=>a.refreshLeadMs).map(([a,b])=>[a,b.refreshLeadMs])),C={google:{token:"https://oauth2.googleapis.com/token",auth:"https://accounts.google.com/o/oauth2/auth"},openai:{token:f.sr.codex?.tokenUrl,auth:f.sr.codex?.authorizeUrl},anthropic:{token:f.sr.claude?.tokenUrl,auth:"https://api.anthropic.com/v1/oauth/authorize"},iflow:{token:f.sr.iflow?.tokenUrl,auth:f.sr.iflow?.authorizeUrl},github:{token:f.sr.github?.tokenUrl,auth:f.sr.github?.authorizeUrl,deviceCode:f.sr.github?.deviceCodeUrl}};function D(a){let b=(0,e.platform)(),f=(0,e.arch)(),g=`${b} ${f}`;"darwin"===b?g=`macOS ${f}`:"win32"===b?g=`Windows ${f}`:"linux"===b&&(g=`Linux ${f}`);let h="unknown";try{h=(0,e.hostname)()||"unknown"}catch{h="unknown"}let i="string"==typeof a&&a.trim()?a.trim():`kimi-${Date.now()}`;return{"X-Msh-Platform":"9router","X-Msh-Version":function(){if(d)return d;try{d=c(39006).rE||"0.0.0"}catch{d=process.env.npm_package_version||"0.0.0"}return d}(),"X-Msh-Device-Name":h,"X-Msh-Device-Model":g,"X-Msh-Device-Id":i}}},93943:(a,b,c)=>{c.d(b,{Dz:()=>k,MF:()=>m,Vq:()=>n,fp:()=>l});var d=c(16698),e=c(8521),f=c(26070);let g=f.sr.codex?.maxRefreshAgeMs,h=new Map,i=new d.AsyncLocalStorage;function j(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function k(a){return j(a?.expiresAt??a?.tokenExpiresAt)}function l(a,b,c=Date.now()){if(!b)return!1;let d=k(b);if(null!==d&&d-c<(0,e.Og)(a))return!0;let h=f.sr[a]?.maxRefreshAgeMs;return!!(h&&b.refreshToken&&function(a,b=Date.now(),c=g){let d=j(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!d||b-d>=c}(b,c,h))}async function m(a,b,c){let d,e=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),f=i.getStore();if(f?.has(e))return c();let g=h.get(e);if(g)return g;let j=Promise.resolve().then(()=>i.run(new Set([...f||[],e]),c)).finally(()=>{h.delete(e)});return h.set(e,j),j}async function n(a,b,c){return b?m(a,b,async()=>{let d=await (0,e.$B)(a,b,c);return function(a,b,c,d=Date.now()){var g,h;if(!c)return null;if((0,e.jT)(c))return c;let i={},j=new Date(d).toISOString();c.accessToken&&(i.accessToken=c.accessToken),c.apiKey&&(i.apiKey=c.apiKey),c.token&&(i.token=c.token);let k=c.refreshToken??b?.refreshToken;k&&(i.refreshToken=k);let l=c.idToken??b?.idToken;return l&&(i.idToken=l),c.expiresIn?(i.expiresIn=c.expiresIn,i.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,d)):c.expiresAt&&(i.expiresAt=c.expiresAt),c.projectId&&(i.projectId=c.projectId),c.providerSpecificData&&(g=b?.providerSpecificData,i.providerSpecificData=(h=c.providerSpecificData)&&"object"==typeof h?{...g||{},...h}:g),c.copilotToken&&(i.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(i.copilotTokenExpiresAt=c.copilotTokenExpiresAt),(f.sr[a]?.trackRefreshAt||i.accessToken||i.apiKey||i.token||i.refreshToken||i.copilotToken)&&(i.lastRefreshAt=c.lastRefreshAt||j),i}(a,b,d)}):null}}};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
data: ${d}
|
|
5
5
|
|
|
6
6
|
`)}catch{}}}),f.stderr.on("data",b=>console.log(`[mcp:${a}]`,b.toString().trim())),f.on("exit",c=>{console.log(`[mcp:${a}] exited`,c),b.delete(a)}),c}a.exports={getOrSpawn:j,registerSession:function(a,b){let c=j(a),d=e.randomUUID();return c.sessions.set(d,b),d},unregisterSession:function(a,b){let c=h().get(a);if(c&&(c.sessions.delete(b),0===c.sessions.size)){try{c.proc.kill()}catch{}h().delete(a)}},sendToChild:function(a,b){let c=h().get(a);if(!c?.proc?.stdin?.writable)throw Error(`Bridge not running: ${a}`);c.proc.stdin.write(`${JSON.stringify(b)}
|
|
7
|
-
`)},isRunning:function(a){let b=h().get(a);return!!(b?.proc&&!b.proc.killed&&null===b.proc.exitCode)},findPlugin:i,killAllBridges:function(){let a=h();for(let[b,c]of a){try{c.proc.kill()}catch{}a.delete(b)}}}},28286:a=>{a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},76476:(a,b,c)=>{c.d(b,{N:()=>l,v:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(49120);let i=g().join(h.n,"mitm","aliases.json");function j(a){let b=g().dirname(i);e().mkdirSync(b,{recursive:!0});let c=`${i}.tmp`;e().writeFileSync(c,JSON.stringify(a,null,2),"utf8"),e().renameSync(c,i)}async function k(){try{let{getMitmAlias:a}=await Promise.resolve().then(c.bind(c,9460)),b=await a();j(b||{})}catch(a){console.log("[mitmAliasCache] sync failed:",a.message)}}function l(a,b){try{let c={};if(e().existsSync(i))try{c=JSON.parse(e().readFileSync(i,"utf8"))}catch{}c[a]=b||{},j(c)}catch(a){console.log("[mitmAliasCache] write failed:",a.message)}}},94123:(a,b,c)=>{c.d(b,{Ay:()=>v,Zh:()=>u});var d=c(21820),e=c.n(d),f=c(1932),g=c(33873),h=c(29021),i=c(89718),j=c(66457),k=c(96182),l=c(76476),m=c(17113);if(!process.env.MITM_SERVER_PATH)try{let a=(0,f.fileURLToPath)("file:///home/runner/work/9router/9router/src/shared/services/initializeApp.js"),b=(0,g.dirname)((0,g.dirname)(a)),c=(0,g.join)(b,"mitm","server.js");(0,h.existsSync)(c)&&(process.env.MITM_SERVER_PATH=c)}catch{}try{(0,k.initDbHooks)(i.mt,i.Xx)}catch{}process.setMaxListeners(20);let n=global.__appSingleton??={signalHandlersRegistered:!1,watchdogInterval:null,networkMonitorInterval:null,lastNetworkFingerprint:null,lastWatchdogTick:Date.now(),lastOnline:null,mitmStartInProgress:!1,tunnelAutoResumed:!1,tailscaleAutoResumed:!1};async function o(){var a;await (0,i.bI)();let b=await (0,i.mt)();b.tunnelEnabled&&!n.tunnelAutoResumed&&(n.tunnelAutoResumed=!0,console.log("[InitApp] Tunnel was enabled, auto-resuming..."),r("startup").catch(a=>console.log("[InitApp] Tunnel resume failed:",a.message))),b.tailscaleEnabled&&!n.tailscaleAutoResumed&&(n.tailscaleAutoResumed=!0,console.log("[InitApp] Tailscale was enabled, auto-resuming..."),s("startup").catch(a=>console.log("[InitApp] Tailscale resume failed:",a.message))),b.tunnelEnabled&&(0,j.Al)().catch(()=>{}),b.mitmEnabled&&((0,l.v)().catch(()=>{}),p(b)),u(b),a=b,[a?.claudeAutoPing,a?.codexAutoPing].some(a=>Object.values(a?.connections||{}).some(Boolean)||Object.values(a?.schedules||{}).some(a=>a?.enabled===!0))&&Promise.all([c.e(7774),c.e(7801),c.e(9318),c.e(6070),c.e(1329),c.e(9609),c.e(8920),c.e(24),c.e(3943),c.e(7187),c.e(8623),c.e(7843),c.e(2578),c.e(3225),c.e(7913),c.e(
|
|
7
|
+
`)},isRunning:function(a){let b=h().get(a);return!!(b?.proc&&!b.proc.killed&&null===b.proc.exitCode)},findPlugin:i,killAllBridges:function(){let a=h();for(let[b,c]of a){try{c.proc.kill()}catch{}a.delete(b)}}}},28286:a=>{a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},76476:(a,b,c)=>{c.d(b,{N:()=>l,v:()=>k});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(49120);let i=g().join(h.n,"mitm","aliases.json");function j(a){let b=g().dirname(i);e().mkdirSync(b,{recursive:!0});let c=`${i}.tmp`;e().writeFileSync(c,JSON.stringify(a,null,2),"utf8"),e().renameSync(c,i)}async function k(){try{let{getMitmAlias:a}=await Promise.resolve().then(c.bind(c,9460)),b=await a();j(b||{})}catch(a){console.log("[mitmAliasCache] sync failed:",a.message)}}function l(a,b){try{let c={};if(e().existsSync(i))try{c=JSON.parse(e().readFileSync(i,"utf8"))}catch{}c[a]=b||{},j(c)}catch(a){console.log("[mitmAliasCache] write failed:",a.message)}}},94123:(a,b,c)=>{c.d(b,{Ay:()=>v,Zh:()=>u});var d=c(21820),e=c.n(d),f=c(1932),g=c(33873),h=c(29021),i=c(89718),j=c(66457),k=c(96182),l=c(76476),m=c(17113);if(!process.env.MITM_SERVER_PATH)try{let a=(0,f.fileURLToPath)("file:///home/runner/work/9router/9router/src/shared/services/initializeApp.js"),b=(0,g.dirname)((0,g.dirname)(a)),c=(0,g.join)(b,"mitm","server.js");(0,h.existsSync)(c)&&(process.env.MITM_SERVER_PATH=c)}catch{}try{(0,k.initDbHooks)(i.mt,i.Xx)}catch{}process.setMaxListeners(20);let n=global.__appSingleton??={signalHandlersRegistered:!1,watchdogInterval:null,networkMonitorInterval:null,lastNetworkFingerprint:null,lastWatchdogTick:Date.now(),lastOnline:null,mitmStartInProgress:!1,tunnelAutoResumed:!1,tailscaleAutoResumed:!1};async function o(){var a;await (0,i.bI)();let b=await (0,i.mt)();b.tunnelEnabled&&!n.tunnelAutoResumed&&(n.tunnelAutoResumed=!0,console.log("[InitApp] Tunnel was enabled, auto-resuming..."),r("startup").catch(a=>console.log("[InitApp] Tunnel resume failed:",a.message))),b.tailscaleEnabled&&!n.tailscaleAutoResumed&&(n.tailscaleAutoResumed=!0,console.log("[InitApp] Tailscale was enabled, auto-resuming..."),s("startup").catch(a=>console.log("[InitApp] Tailscale resume failed:",a.message))),b.tunnelEnabled&&(0,j.Al)().catch(()=>{}),b.mitmEnabled&&((0,l.v)().catch(()=>{}),p(b)),u(b),a=b,[a?.claudeAutoPing,a?.codexAutoPing].some(a=>Object.values(a?.connections||{}).some(Boolean)||Object.values(a?.schedules||{}).some(a=>a?.enabled===!0))&&Promise.all([c.e(7774),c.e(7801),c.e(9318),c.e(6070),c.e(1329),c.e(9609),c.e(8920),c.e(24),c.e(3943),c.e(7187),c.e(8623),c.e(7843),c.e(2578),c.e(3225),c.e(7913),c.e(4577),c.e(4957),c.e(614),c.e(7877),c.e(8499),c.e(2327),c.e(5330),c.e(8416),c.e(6171),c.e(8895),c.e(8271),c.e(1133)]).then(c.bind(c,1133)).then(({startQuotaAutoPing:a})=>a()).catch(a=>console.log("[AutoPing] scheduler start failed:",a.message)),Promise.all([c.e(9318),c.e(6070),c.e(9609),c.e(3943),c.e(3256)]).then(c.bind(c,3256)).then(({startBackgroundTokenRefresh:a})=>a()).catch(a=>console.log("[BackgroundTokenRefresh] scheduler start failed:",a.message))}async function p(a){if(!n.mitmStartInProgress){n.mitmStartInProgress=!0;try{if(!a.mitmEnabled||(await (0,k.getMitmStatus)()).running)return;let b=await (0,k.loadEncryptedPassword)();if(!b&&"win32"!==process.platform)return void console.log("[InitApp] MITM was enabled but no saved password found, skipping auto-start");let c=(await (0,i.PX)()).find(a=>!1!==a.isActive);console.log("[InitApp] MITM was enabled, auto-starting..."),await (0,k.startMitm)(c?.key||"sk_9router",b),console.log("[InitApp] MITM auto-started");try{await (0,k.restoreToolDNS)(b),console.log("[InitApp] DNS restored from saved state")}catch(a){console.log("[InitApp] DNS restore failed:",a.message)}}catch(a){console.log("[InitApp] MITM auto-start failed:",a.message)}finally{n.mitmStartInProgress=!1}}}let q=/^(startup|netchange|sleep|sleep\+netchange|online|unexpected-exit)$/;async function r(a){let b=(0,j.Qn)();if(!(await (0,i.mt)()).tunnelEnabled||b.cancelToken.cancelled||b.spawnInProgress)return;let c=q.test(a);if(!(0,j.nN)()){if(!c&&Date.now()-b.lastRestartAt<j.Lh)return void console.log(`[Tunnel] degraded but cooldown active, skip (${a})`);if(await (0,j.u7)()){console.log(`[Tunnel] safeRestart (${a}) — tunnel unreachable${c?" [force]":""}`);try{await (0,j.cb)(),b.lastRestartAt=Date.now(),console.log("[Tunnel] restart success")}catch(a){/cloudflared killed|tunnel cancelled/.test(a.message)||console.log("[Tunnel] restart failed:",a.message)}}}}async function s(a){let b=(0,j.oN)();if(!(await (0,i.mt)()).tailscaleEnabled||b.cancelToken.cancelled||b.spawnInProgress||("startup"===a?await (0,j.hp)():(0,j.Kp)()))return;if((0,j.si)()&&b.activeLocalPort){try{await (0,j.LC)(b.activeLocalPort),b.lastRestartAt=Date.now(),console.log("[Tailscale] funnel re-established (daemon alive)")}catch(a){console.log("[Tailscale] funnel recovery failed:",a.message)}return}let c=q.test(a);if(!c&&Date.now()-b.lastRestartAt<j.Lh)return void console.log(`[Tailscale] degraded but cooldown active, skip (${a})`);if(await (0,j.u7)()){console.log(`[Tailscale] safeRestart (${a}) — daemon not running${c?" [force]":""}`);try{await (0,j.mh)(),b.lastRestartAt=Date.now(),console.log("[Tailscale] restart success")}catch(a){console.log("[Tailscale] restart failed:",a.message)}}}function t(){let a=e().networkInterfaces(),b=[];for(let[c,d]of Object.entries(a))if(d&&!j.Lx.test(c))for(let a of d)a.internal||"IPv4"!==a.family||b.push(`${c}:${a.address}`);return b.sort().join("|")}function u(a){if(a?.tunnelEnabled||a?.tailscaleEnabled){!n.watchdogInterval&&(n.watchdogInterval=setInterval(()=>{r("watchdog").catch(()=>{}),s("watchdog").catch(()=>{})},j.DA),n.watchdogInterval.unref&&n.watchdogInterval.unref()),!n.networkMonitorInterval&&(n.lastNetworkFingerprint=t(),n.lastWatchdogTick=Date.now(),n.lastOnline=null,n.networkMonitorInterval=setInterval(async()=>{try{let a=Date.now(),b=a-n.lastWatchdogTick;n.lastWatchdogTick=a;let c=t(),d=c!==n.lastNetworkFingerprint,e=b>6*j.rI;d&&(n.lastNetworkFingerprint=c);let f=await (0,j.u7)(),g=!1===n.lastOnline;if(n.lastOnline=f,!f||!d&&!e&&!g)return;await new Promise(a=>setTimeout(a,j.cw));let h=g?"online":e&&d?"sleep+netchange":e?"sleep":"netchange";r(h).catch(()=>{}),s(h).catch(()=>{})}catch(a){console.log("[NetworkMonitor] error:",a.message)}},j.rI),n.networkMonitorInterval.unref&&n.networkMonitorInterval.unref());return}n.watchdogInterval&&(clearInterval(n.watchdogInterval),n.watchdogInterval=null),n.networkMonitorInterval&&(clearInterval(n.networkMonitorInterval),n.networkMonitorInterval=null,n.lastNetworkFingerprint=null,n.lastOnline=null)}let v=async function a(){try{if(!n.signalHandlersRegistered){let a=()=>{try{(0,k.removeAllDNSEntriesSync)()}catch{}try{(0,m.killAllBridges)()}catch{}(0,j.ss)(),process.exit()};process.on("SIGINT",a),process.on("SIGTERM",a),process.on("exit",()=>{try{(0,k.removeAllDNSEntriesSync)()}catch{}}),n.signalHandlersRegistered=!0}(0,j.X$)(()=>{r("unexpected-exit").catch(()=>{})}),setTimeout(()=>{o().catch(a=>console.error("[InitApp] deferred startup failed:",a.message))},3e3)}catch(a){console.error("[InitApp] Error:",a)}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=4577,exports.ids=[4577],exports.modules={10079:(a,b,c)=>{function d(a){let b=(a||"").trim();return b?b.replace(/^bearer\s+/i,"").replace(/^cookie:/i,"").trim():""}function e(a,b){let c=d(a);if(!c)return"";let e=function(a){let b,c=(a||"").trim();if(!c||!c.startsWith("["))return null;try{b=JSON.parse(c)}catch{return null}if(!Array.isArray(b))return null;if(0===b.length)return"";let d=[];for(let a=0;a<b.length;a++){let c=b[a];if(!c||"object"!=typeof c||Array.isArray(c))throw Error(`Invalid cookie JSON at index ${a}: expected an object`);if("string"!=typeof c.name||!c.name)throw Error(`Invalid cookie JSON at index ${a}: missing required field 'name'`);if("string"!=typeof c.value)throw Error(`Invalid cookie JSON at index ${a}: missing required field 'value'`);d.push(`${c.name}=${c.value}`)}return d.join("; ")}(c);return null!==e?e:c.includes("=")?c:`${b}=${c}`}c.d(b,{$J:()=>h,EU:()=>g,lT:()=>i,p1:()=>e});let f=new Set(["path","domain","expires","max-age","secure","httponly","samesite"]);function g(a,b){let c=[];for(let d of String(a||"").split(";")){let a=d.trim();if(!a)continue;let e=a.indexOf("=");if(e<=0)continue;let g=a.slice(0,e).trim(),h=a.slice(e+1).trim();if(!g||!h||f.has(g.toLowerCase()))continue;let i=String(b||"").replace(/^\./,"");g.startsWith("__Host-")?c.push({name:g,value:h,domain:i,path:"/",secure:!0}):c.push({name:g,value:h,domain:b,path:"/",secure:!0})}return c}function h(a,b){let c=d(a);if(!c)return"";if(c.includes(";")){let a=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=c.match(RegExp("(?:^|;\\s*)"+a+"=([^;\\s]+)"));return d?d[1]:""}let e=`${b}=`;return c.startsWith(e)?c.slice(e.length):c}function i(a){let b=h(a,"sso");if(!b)return"";let c=[`sso=${b}`];for(let b of["sso-rw","cf_clearance","__cf_bm"])if(RegExp("(?:^|;\\s*)"+b+"=").test(a)){let d=h(a,b);d&&c.push(`${b}=${d}`)}return c.join("; ")}},20742:(a,b,c)=>{c.d(b,{A:()=>q});var d=c(31421),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(73136),j=c(26182);let k={"playwright-core":"^1.62.1","wreq-js":"^3.2.0"};function l(){return h().join((0,j.S)(),"runtime")}function m(a){let b=String(a?.code||"");return"MODULE_NOT_FOUND"===b||"ERR_MODULE_NOT_FOUND"===b}let n=new Map;function o(a,b){let c;if(!a||!b||b.includes("/")||b.includes("\\"))return null;let d=h().join(a,"node_modules",b);try{c=JSON.parse(f().readFileSync(h().join(d,"package.json"),"utf8"))}catch{return null}let e=function a(b){if(!b)return null;if("string"==typeof b)return b;if(Array.isArray(b)){for(let c of b){let b=a(c);if(b)return b}return null}if("object"!=typeof b)return null;if(void 0!==b["."]){let c=a(b["."]);if(c)return c}for(let c of["import","node","require","default"]){let d=a(b[c]);if(d)return d}return null}(c.exports)||c.module||c.main||"index.js",g=h().resolve(d,e);try{f().statSync(g).isDirectory()&&(g=h().join(g,"index.js"))}catch{return null}return(0,i.pathToFileURL)(g).href}async function p(a){let b,c,e;try{return await import(a)}catch(a){if(!m(a))throw a}let g=o(l(),a);if(g)try{return await import(g)}catch(a){if(!m(a))throw a}let h=k[a];if(!h)throw Error(`${a} is missing and has no pinned runtime version — add it to LAZY_DEP_VERSIONS in open-sse/services/lazyRuntime.js (never install "latest" at runtime).`);let i=l(),j=await (b=l(),f().mkdirSync(b,{recursive:!0}),c="win32"===process.platform?"npm.cmd":"npm",e=["install","--no-audit","--no-fund","--prefer-online",`${a}@${h}`],new Promise(a=>{let f=(0,d.spawn)(c,e,{cwd:b,stdio:["ignore","pipe","pipe"],shell:"win32"===process.platform}),g="";f.stderr?.on("data",a=>{g+=String(a)}),f.on("error",b=>a({ok:!1,stderr:String(b.message||b)})),f.on("close",b=>a({ok:0===b,stderr:g}))}));if(!j.ok){let b=(j.stderr.match(/npm ERR! ?(.+)/)||[])[1]||j.stderr.split("\n").filter(Boolean).pop()||"unknown npm error";throw Error(`${a} is missing and the on-demand install failed (${String(b).slice(0,160)}) — install it manually: cd "${i}" && npm install ${a}@${h}`)}let n=o(i,a);if(!n)throw Error(`${a}@${h} installed into "${i}" but no entry file could be resolved — check that the package ships a package.json with main/exports`);return import(n)}function q(a){return n.has(a)||n.set(a,p(a).finally(()=>n.delete(a))),n.get(a)}},22115:(a,b,c)=>{c.d(b,{CO:()=>e,X7:()=>j,ZB:()=>i,jm:()=>h});var d=c(20742);let e="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36",f=null;async function g(){return f||(f=(async()=>{let a=await (0,d.A)("wreq-js");if("function"!=typeof a.createSession)throw Error("wreq-js runtime is missing createSession");return a.createSession({browser:"chrome_146",os:"macos"})})().catch(a=>{throw f=null,a})),f}class h extends Error{constructor(a){super(a),this.name="GrokTlsUnavailableError"}}function i(a){return"string"==typeof a&&/just a moment|attention required|cf-mitigated/i.test(a)}async function j(a,{method:b="GET",headers:c={},body:d,timeoutMs:e=12e4,signal:f}={}){let i;try{i=await g()}catch(a){throw new h(`wreq-js unavailable (${a instanceof Error?a.message:"unknown"}) — install the optional wreq-js dependency to use Grok Web`)}let k={method:b.toUpperCase(),headers:c,redirect:"follow",timeout:e};void 0!==d&&(k.body=d),f&&(k.signal=f);let l=await i.fetch(a,k),m=await l.arrayBuffer(),n={};try{l.headers&&"function"==typeof l.headers.forEach&&l.headers.forEach((a,b)=>{n[b]=a})}catch{}return new Response(m,{status:l.status,headers:n})}},26182:(a,b,c)=>{c.d(b,{S:()=>k});var d=c(73024),e=c.n(d),f=c(48161),g=c.n(f),h=c(76760),i=c.n(h);let j=null;function k(){if(j)return j;for(let a of[process.env.DATA_DIR,i().join(g().homedir(),".9router"),i().join(g().tmpdir(),"9router")].filter(Boolean))try{return e().mkdirSync(a,{recursive:!0}),e().accessSync(a,e().constants.W_OK),j=a,a}catch{}return j=process.cwd()}},82543:(a,b,c)=>{function d(a,b="__Secure-1PSID"){let c=a.trim();if(!c)return"";let e=function(a){if(!a.startsWith("{"))return[];try{let b=JSON.parse(a),c=b.cookies&&"object"==typeof b.cookies&&!Array.isArray(b.cookies)?b.cookies:b;return Object.entries(c).filter(([,a])=>"string"==typeof a&&a.trim().length>0).map(([a,b])=>`${a}=${String(b).trim()}`)}catch{return[]}}(c);return e.length>0?e.join("; "):c.includes("=")?c:`${b}=${c}`}function e(a){let b=d(a.trim().replace(/^cookie:\s*/i,"")),c=b.split(";").map(a=>a.trim()).find(a=>a.toLowerCase().startsWith("__secure-1psid="));return c&&0!==c.slice(c.indexOf("=")+1).trim().length?b:null}c.d(b,{L:()=>d,m:()=>e})},98915:(a,b,c)=>{function d(a){let b;if("string"!=typeof a||!a.trim())return null;try{b=JSON.parse(a)}catch{return a}return b&&"object"==typeof b?"string"==typeof b.value&&b.value.trim()?b.value:null:a}c.d(b,{Xm:()=>d,YI:()=>f,u0:()=>g});let e={"grok-web":{loginUrl:"https://grok.com/",cookieDomain:".grok.com",tokenSources:[{type:"cookie",name:"sso"}]},"chatgpt-web":{loginUrl:"https://chatgpt.com/",cookieDomain:".chatgpt.com",tokenSources:[{type:"cookie",name:"__Secure-next-auth.session-token"}]},"gemini-web":{loginUrl:"https://gemini.google.com/",cookieDomain:".google.com",tokenSources:[{type:"cookie",name:"__Secure-1PSID"},{type:"cookie",name:"__Secure-1PSIDTS",optional:!0}]},"muse-web":{loginUrl:"https://muse.ai/",cookieDomain:".muse.ai",tokenSources:[{type:"cookie",name:"hatch_sess"},{type:"cookie",name:"hatch_gw",optional:!0},{type:"cookie",name:"hatch_vml",optional:!0},{type:"cookie",name:"hatch_native_auth_device",optional:!0}]},"deepseek-web":{loginUrl:"https://chat.deepseek.com/sign_in",cookieDomain:".deepseek.com",tokenSources:[{type:"localStorage",name:"userToken"}],credentialFrom:"localStorageValue",validateToken:a=>{let b=d(a);return"string"==typeof b&&b.trim().length>=20}},"uc-web":{loginUrl:"https://uncensored.com/",cookieDomain:".uncensored.com",tokenSources:[{type:"cookie",name:"__client"},{type:"cookie",name:"__client_uat",validateCookie:a=>Number(a)>0}]}};function f(a){return e[a]||null}function g(){return Object.keys(e)}}};
|