switchboard-router 0.9.56 → 0.9.57
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/static/chunks/1321-e030b87815d694f7.js → .next/static/chunks/1321-6054454e39d71f19.js} +1 -1
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +17 -17
- 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/agent-library/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.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/combos/routing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/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/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/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/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/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/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 +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +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/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/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-full-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +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/cowork-mcp-registry/route.js +2 -2
- 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 +2 -2
- 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/deepseek-tui-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- 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/gemini-cli-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- 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/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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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/picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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/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/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +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/routable/route.js.nft.json +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.nft.json +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.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/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/pricing/defaults/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]/model-probes/batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/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]/route.js.nft.json +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.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.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.nft.json +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/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/routing/feedback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/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/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/skills/[id]/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/token-saver/vault-stats/route.js.nft.json +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.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.nft.json +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/usage/[connectionId]/codex-reset-credits/route.js.nft.json +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/[id]/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.nft.json +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.nft.json +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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.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.nft.json +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/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.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- 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 +3 -3
- 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 +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- 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 +4 -4
- 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 +17 -17
- package/app/.next-cli-build/server/chunks/1792.js +2 -2
- package/app/.next-cli-build/server/chunks/2847.js +1 -1
- package/app/.next-cli-build/server/chunks/4454.js +1 -1
- package/app/.next-cli-build/server/chunks/519.js +1 -1
- package/app/.next-cli-build/server/chunks/7003.js +1 -0
- package/app/.next-cli-build/server/chunks/7774.js +3 -3
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +9 -9
- package/app/.next-cli-build/server/chunks/static/media/versions.fd0ef9e7.json +24 -0
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/{.next/static/chunks/1321-e030b87815d694f7.js → .next-cli-build/static/chunks/1321-6054454e39d71f19.js} +1 -1
- package/app/open-sse/identity/snapshots/versions.json +10 -10
- package/app/open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe +0 -0
- package/app/open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/4353.js +0 -1
- package/app/.next-cli-build/server/chunks/static/media/versions.d3affa61.json +0 -24
- /package/app/.next/static/{p00HZLRpEZ2dD21V7ZHfh → jX_YoXTmP5GCN19LWe_Ur}/_buildManifest.js +0 -0
- /package/app/.next/static/{p00HZLRpEZ2dD21V7ZHfh → jX_YoXTmP5GCN19LWe_Ur}/_ssgManifest.js +0 -0
- /package/app/.next-cli-build/static/{p00HZLRpEZ2dD21V7ZHfh → jX_YoXTmP5GCN19LWe_Ur}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{p00HZLRpEZ2dD21V7ZHfh → jX_YoXTmP5GCN19LWe_Ur}/_ssgManifest.js +0 -0
|
@@ -17,7 +17,7 @@ exports.id=8998,exports.ids=[8998],exports.modules={794:(a,b,c)=>{"use strict";l
|
|
|
17
17
|
'-WindowStyle','Hidden','-EncodedCommand','${b}'
|
|
18
18
|
) -Verb RunAs -Wait -PassThru -WindowStyle Hidden;
|
|
19
19
|
if ($proc.ExitCode -ne 0) { throw "Elevated command exited with code $($proc.ExitCode)" }
|
|
20
|
-
`;return new Promise((a,b)=>{d(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command ${h(c)}`,{windowsHide:!0},(c,d,e)=>{if(c){let a=e||c.message;a.includes("canceled by the user")||a.includes("operation was canceled")?b(Error("User canceled UAC prompt")):b(Error(a))}else a(d)})})},quotePs:h}},11897:(a,b,c)=>{"use strict";c.d(b,{R4:()=>g,BY:()=>k,a_:()=>i.a_,RV:()=>e,rP:()=>j,x4:()=>f,bC:()=>i.bC,Du:()=>h,z7:()=>d});let d={USER:"user",ASSISTANT:"assistant",TOOL:"tool",SYSTEM:"system",DEVELOPER:"developer"},e={USER:"user",MODEL:"model"},f={TEXT:"text",IMAGE_URL:"image_url",IMAGE:"image",INPUT_AUDIO:"input_audio",AUDIO_URL:"audio_url",FILE:"file",FUNCTION:"function"},g={TEXT:"text",IMAGE:"image",DOCUMENT:"document",TOOL_USE:"tool_use",TOOL_RESULT:"tool_result",THINKING:"thinking",REDACTED_THINKING:"redacted_thinking"},h={MESSAGE:"message",FUNCTION_CALL:"function_call",FUNCTION_CALL_OUTPUT:"function_call_output",REASONING:"reasoning",OUTPUT_TEXT:"output_text",INPUT_TEXT:"input_text",INPUT_IMAGE:"input_image",INPUT_FILE:"input_file",SUMMARY_TEXT:"summary_text"};f.TEXT,f.IMAGE_URL,f.IMAGE,f.INPUT_AUDIO,f.AUDIO_URL,f.FILE,f.TEXT,f.IMAGE_URL,f.IMAGE,g.TOOL_RESULT;var i=c(62457);let j="unknown",k="image/png"},12600:(a,b,c)=>{"use strict";let d,e,f,g,h,i,j,k,{extractBody:l,mixinBody:m,cloneBody:n,bodyUnusable:o}=c(35381),{Headers:p,fill:q,HeadersList:r,setHeadersGuard:s,getHeadersGuard:t,setHeadersList:u,getHeadersList:v}=c(28665),w=c(84285),x=c(57975),{isValidHTTPToken:y,sameOrigin:z,environmentSettingsObject:A}=c(42425),{forbiddenMethodsSet:B,corsSafeListedMethodsSet:C,referrerPolicy:D,requestRedirect:E,requestMode:F,requestCredentials:G,requestCache:H,requestDuplex:I}=c(19608),{kEnumerableProperty:J,normalizedMethodRecordsBase:K,normalizedMethodRecords:L}=w,{webidl:M}=c(32984),{URLSerializer:N}=c(16537),{kConstruct:O}=c(49176),P=c(34589),{getMaxListeners:Q,setMaxListeners:R,defaultMaxListeners:S}=c(78474),T=Symbol("abortController"),U=new FinalizationRegistry(({signal:a,abort:b})=>{a.removeEventListener("abort",b)}),V=new WeakMap;try{d=Q(new AbortController().signal)>0}catch{d=!1}function W(a){return function b(){let c=a.deref();if(void 0!==c){U.unregister(b),this.removeEventListener("abort",b),c.abort(this.reason);let a=V.get(c.signal);if(void 0!==a){if(0!==a.size){for(let b of a){let a=b.deref();void 0!==a&&a.abort(this.reason)}a.clear()}V.delete(c.signal)}}}}let X=!1;class Y{#c;#d;#e;#a;#f=null;constructor(a,b){let c;if(M.util.markAsUncloneable(this),a===O)return;M.argumentLengthCheck(arguments,1,"Request constructor"),a=M.converters.RequestInfo(a),b=M.converters.RequestInit(b);let e=null,f=null;const g=A.settingsObject.baseUrl;let h=null;if("string"==typeof a){let c;this.#d=b.dispatcher;try{c=new URL(a,g)}catch(b){throw TypeError("Failed to parse URL from "+a,{cause:b})}if(c.username||c.password)throw TypeError("Request cannot be constructed from a URL that includes credentials: "+a);e=Z({urlList:[c]}),f="cors"}else P(M.is.Request(a)),e=a.#a,h=a.#c,this.#d=b.dispatcher||a.#d;const i=A.settingsObject.origin;let j="client";if(e.window?.constructor?.name==="EnvironmentSettingsObject"&&z(e.window,i)&&(j=e.window),null!=b.window)throw TypeError(`'window' option '${j}' must be null`);"window"in b&&(j="no-window"),e=Z({method:e.method,headersList:e.headersList,unsafeRequest:e.unsafeRequest,client:A.settingsObject,window:j,priority:e.priority,origin:e.origin,referrer:e.referrer,referrerPolicy:e.referrerPolicy,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,integrity:e.integrity,keepalive:e.keepalive,reloadNavigation:e.reloadNavigation,historyNavigation:e.historyNavigation,urlList:[...e.urlList]});const k=0!==Object.keys(b).length;if(k&&("navigate"===e.mode&&(e.mode="same-origin"),e.reloadNavigation=!1,e.historyNavigation=!1,e.origin="client",e.referrer="client",e.referrerPolicy="",e.url=e.urlList[e.urlList.length-1],e.urlList=[e.url]),void 0!==b.referrer){const a=b.referrer;if(""===a)e.referrer="no-referrer";else{let b;try{b=new URL(a,g)}catch(b){throw TypeError(`Referrer "${a}" is not a valid URL.`,{cause:b})}"about:"===b.protocol&&"client"===b.hostname||i&&!z(b,A.settingsObject.baseUrl)?e.referrer="client":e.referrer=b}}if(void 0!==b.referrerPolicy&&(e.referrerPolicy=b.referrerPolicy),"navigate"===(c=void 0!==b.mode?b.mode:f))throw M.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(null!=c&&(e.mode=c),void 0!==b.credentials&&(e.credentials=b.credentials),void 0!==b.cache&&(e.cache=b.cache),"only-if-cached"===e.cache&&"same-origin"!==e.mode)throw TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(void 0!==b.redirect&&(e.redirect=b.redirect),null!=b.integrity&&(e.integrity=String(b.integrity)),void 0!==b.keepalive&&(e.keepalive=!!b.keepalive),void 0!==b.method){let a=b.method;const c=L[a];if(void 0!==c)e.method=c;else{if(!y(a))throw TypeError(`'${a}' is not a valid HTTP method.`);const b=a.toUpperCase();if(B.has(b))throw TypeError(`'${a}' HTTP method is unsupported.`);a=K[b]??a,e.method=a}X||"patch"!==e.method||(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),X=!0)}void 0!==b.signal&&(h=b.signal),this.#a=e;const m=new AbortController;if(this.#c=m.signal,null!=h)if(h.aborted)m.abort(h.reason);else{this[T]=m;const a=W(new WeakRef(m));d&&Q(h)===S&&R(1500,h);const b=w.addAbortListener(h,a);U.register(m,{signal:h,abort:a},a),this.#f=()=>{U.unregister(a),b(),this.#f=null}}if(this.#e=new p(O),u(this.#e,e.headersList),s(this.#e,"request"),"no-cors"===c){if(!C.has(e.method))throw TypeError(`'${e.method} is unsupported in no-cors mode.`);s(this.#e,"request-no-cors")}if(k){const a=v(this.#e),c=void 0!==b.headers?b.headers:new r(a);if(a.clear(),c instanceof r){for(const{name:b,value:d}of c.rawValues())a.append(b,d,!1);a.cookies=c.cookies}else q(this.#e,c)}const n=M.is.Request(a)?a.#a.body:null;if((null!=b.body||null!=n)&&("GET"===e.method||"HEAD"===e.method))throw TypeError("Request with GET/HEAD method cannot have body.");let t=null;if(null!=b.body){const[a,c]=l(b.body,e.keepalive);t=a,c&&!v(this.#e).contains("content-type",!0)&&this.#e.append("content-type",c,!0)}const x=t??n;if(null!=x&&null==x.source){if(null!=t&&null==b.duplex)throw TypeError("RequestInit: duplex option is required when sending a body.");if("same-origin"!==e.mode&&"cors"!==e.mode)throw TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');e.useCORSPreflightFlag=!0}let D=x;if(null==t&&null!=n){if(o(a.#a))throw TypeError("Cannot construct a Request with a Request object that has already been used.");const b=new TransformStream;n.stream.pipeThrough(b),D={source:n.source,length:n.length,stream:b.readable}}this.#a.body=D}get method(){return M.brandCheck(this,M.is.Request),this.#a.method}get url(){return M.brandCheck(this,M.is.Request),N(this.#a.url)}get headers(){return M.brandCheck(this,M.is.Request),this.#e}get destination(){return M.brandCheck(this,M.is.Request),this.#a.destination}get referrer(){return(M.brandCheck(this,M.is.Request),"no-referrer"===this.#a.referrer)?"":"client"===this.#a.referrer?"about:client":this.#a.referrer.toString()}get referrerPolicy(){return M.brandCheck(this,M.is.Request),this.#a.referrerPolicy}get mode(){return M.brandCheck(this,M.is.Request),this.#a.mode}get credentials(){return M.brandCheck(this,M.is.Request),this.#a.credentials}get cache(){return M.brandCheck(this,M.is.Request),this.#a.cache}get redirect(){return M.brandCheck(this,M.is.Request),this.#a.redirect}get integrity(){return M.brandCheck(this,M.is.Request),this.#a.integrity}get keepalive(){return M.brandCheck(this,M.is.Request),this.#a.keepalive}get isReloadNavigation(){return M.brandCheck(this,M.is.Request),this.#a.reloadNavigation}get isHistoryNavigation(){return M.brandCheck(this,M.is.Request),this.#a.historyNavigation}get signal(){return M.brandCheck(this,M.is.Request),this.#c}get body(){return M.brandCheck(this,M.is.Request),this.#a.body?this.#a.body.stream:null}get bodyUsed(){return M.brandCheck(this,M.is.Request),!!this.#a.body&&w.isDisturbed(this.#a.body.stream)}get duplex(){return M.brandCheck(this,M.is.Request),"half"}clone(){if(M.brandCheck(this,M.is.Request),o(this.#a))throw TypeError("unusable");let a=$(this.#a),b=new AbortController;if(this.signal.aborted)b.abort(this.signal.reason);else{let a=V.get(this.signal);void 0===a&&(a=new Set,V.set(this.signal,a));let c=new WeakRef(b);a.add(c),w.addAbortListener(b.signal,W(c))}return _(a,this.#d,b.signal,t(this.#e))}[x.inspect.custom](a,b){null===b.depth&&(b.depth=2),b.colors??=!0;let c={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${x.formatWithOptions(b,c)}`}static{e=(a,b)=>{a.#c=b},f=a=>a.#d,g=(a,b)=>{a.#d=b},h=(a,b)=>{a.#e=b},i=a=>a.#a,j=(a,b)=>{a.#a=b},k=a=>{a.#f?.()},M.is.Request=a=>null!=a&&"object"==typeof a&&#a in a}}function Z(a){return{method:a.method??"GET",localURLsOnly:a.localURLsOnly??!1,unsafeRequest:a.unsafeRequest??!1,body:a.body??null,client:a.client??null,reservedClient:a.reservedClient??null,replacesClientId:a.replacesClientId??"",window:a.window??"client",keepalive:a.keepalive??!1,serviceWorkers:a.serviceWorkers??"all",initiator:a.initiator??"",destination:a.destination??"",priority:a.priority??"auto",origin:a.origin??"client",policyContainer:a.policyContainer??"client",referrer:a.referrer??"client",referrerPolicy:a.referrerPolicy??"",mode:a.mode??"no-cors",useCORSPreflightFlag:a.useCORSPreflightFlag??!1,credentials:a.credentials??"same-origin",useCredentials:a.useCredentials??!1,cache:a.cache??"default",redirect:a.redirect??"follow",integrity:a.integrity??"",cryptoGraphicsNonceMetadata:a.cryptoGraphicsNonceMetadata??"",parserMetadata:a.parserMetadata??"",reloadNavigation:a.reloadNavigation??!1,historyNavigation:a.historyNavigation??!1,userActivation:a.userActivation??!1,taintedOrigin:a.taintedOrigin??!1,redirectCount:a.redirectCount??0,responseTainting:a.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:a.preventNoCacheCacheControlHeaderModification??!1,done:a.done??!1,timingAllowFailed:a.timingAllowFailed??!1,useURLCredentials:a.useURLCredentials??void 0,traversableForUserPrompts:a.traversableForUserPrompts??"client",urlList:a.urlList,url:a.urlList[0],headersList:a.headersList?new r(a.headersList):new r}}function $(a){let b=Z({...a,body:null});return null!=a.body&&(b.body=n(a.body)),b}function _(a,b,c,d){let f=new Y(O);j(f,a),g(f,b),e(f,c);let i=new p(O);return h(f,i),u(i,a.headersList),s(i,d),f}m(Y,i,M.is.Request),Object.defineProperties(Y.prototype,{method:J,url:J,headers:J,redirect:J,clone:J,signal:J,duplex:J,destination:J,body:J,bodyUsed:J,isHistoryNavigation:J,isReloadNavigation:J,keepalive:J,integrity:J,cache:J,credentials:J,attribute:J,referrerPolicy:J,referrer:J,mode:J,[Symbol.toStringTag]:{value:"Request",configurable:!0}}),M.converters.RequestInfo=function(a){return"string"==typeof a?M.converters.USVString(a):M.is.Request(a)?a:M.converters.USVString(a)},M.converters.RequestInit=M.dictionaryConverter([{key:"method",converter:M.converters.ByteString},{key:"headers",converter:M.converters.HeadersInit},{key:"body",converter:M.nullableConverter(M.converters.BodyInit)},{key:"referrer",converter:M.converters.USVString},{key:"referrerPolicy",converter:M.converters.DOMString,allowedValues:D},{key:"mode",converter:M.converters.DOMString,allowedValues:F},{key:"credentials",converter:M.converters.DOMString,allowedValues:G},{key:"cache",converter:M.converters.DOMString,allowedValues:H},{key:"redirect",converter:M.converters.DOMString,allowedValues:E},{key:"integrity",converter:M.converters.DOMString},{key:"keepalive",converter:M.converters.boolean},{key:"signal",converter:M.nullableConverter(a=>M.converters.AbortSignal(a,"RequestInit","signal"))},{key:"window",converter:M.converters.any},{key:"duplex",converter:M.converters.DOMString,allowedValues:I},{key:"dispatcher",converter:M.converters.any},{key:"priority",converter:M.converters.DOMString,allowedValues:["high","low","auto"]}]),a.exports={Request:Y,makeRequest:Z,fromInnerRequest:_,cloneRequest:$,getRequestDispatcher:f,getRequestState:i,removeRequestAbortListener:k}},13161:(a,b,c)=>{"use strict";c.d(b,{vq:()=>f.vq,kt:()=>j});var d=c(38421),e=c(69537),f=c(15251),g=c(97915);let h="-review",i=new Set(["kr","kiro"]);function j(a,b){let c="string"==typeof b?b.match(/\([^()]+\)\s*$/):null,d=c?c[0]:"",e=d?b.slice(0,c.index).trim():b,j=function(a,b,c){if(!a)return;let d=a.find(a=>a.id===b);if(d)return d;if(!i.has(c))return;let e=(0,g.Kq)(b);if(e!==b)return a.find(a=>a.id===e)}(f.vq[a],e,a);return j?.upstreamModelId?j.upstreamModelId+d:j?.id?j.id+d:"cx"===a&&"string"==typeof e&&e.endsWith(h)?e.slice(0,-h.length)+d:e+d}let k=Object.fromEntries(e.A.filter(a=>a.alias&&a.alias!==a.id).map(a=>[a.id,a.alias]));Object.fromEntries(Object.keys(d.xq).map(a=>[a,k[a]||a]))},13839:(a,b,c)=>{"use strict";a.exports=c.p+"static/media/versions.d3affa61.json"},14071:(a,b,c)=>{"use strict";c.d(b,{F:()=>f});var d=c(46248),e=c(38421);class f extends d.L{constructor(){super("xiaomi-tokenplan")}buildUrl(a,b,c=0,d=null){let f=(0,e.Yg)(d);return d?.runtimeTransport?.format==="claude"?`${f.replace(/\/v1\/?$/,"")}/anthropic/v1/messages`:`${f}/chat/completions`}}},14896:(a,b,c)=>{"use strict";var d=c(68531);c(26408),d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO},15251:(a,b,c)=>{"use strict";c.d(b,{xq:()=>p,vq:()=>q,sr:()=>r});var d=c(69537),e=c(82689);let f={baseUrl:"",format:"openai",headers:{},auth:{header:"Authorization",scheme:"bearer",source:["accessToken","apiKey"]},forceStream:!1,urlSuffix:"",quirks:{},passthroughModels:!1,retry:e.cI,timeoutMs:e.pH,executor:"default"};var g=c(97915);let h={alloy:{id:"alloy",name:"Alloy"},ash:{id:"ash",name:"Ash"},ballad:{id:"ballad",name:"Ballad"},cedar:{id:"cedar",name:"Cedar"},coral:{id:"coral",name:"Coral"},echo:{id:"echo",name:"Echo"},fable:{id:"fable",name:"Fable"},marin:{id:"marin",name:"Marin"},nova:{id:"nova",name:"Nova"},onyx:{id:"onyx",name:"Onyx"},sage:{id:"sage",name:"Sage"},shimmer:{id:"shimmer",name:"Shimmer"},verse:{id:"verse",name:"Verse"}},i=(...a)=>a.map(a=>({...h[a],type:"tts"})),j=i("alloy","ash","coral","echo","fable","nova","onyx","sage","shimmer"),k=i("alloy","ash","ballad","cedar","coral","echo","fable","marin","nova","onyx","sage","shimmer","verse"),l=["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Vindemiatrix","Sadachbia","Sadaltager","Sulafat"].map(a=>({id:a,name:a,type:"tts"})),m={openai:{models:[{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"tts-1",name:"TTS-1",type:"tts"}],voices:{"gpt-4o-mini-tts":k,"tts-1":j,"tts-1-hd":j},allVoices:k},openrouter:{models:[{id:"openai/gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"openai/tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"openai/tts-1",name:"TTS-1",type:"tts"}],voices:{"openai/gpt-4o-mini-tts":k,"openai/tts-1":j,"openai/tts-1-hd":j},allVoices:k},elevenlabs:{models:[{id:"eleven_flash_v2_5",name:"Flash v2.5 (Fastest)",type:"tts"},{id:"eleven_turbo_v2_5",name:"Turbo v2.5 (Fast)",type:"tts"},{id:"eleven_multilingual_v2",name:"Multilingual v2 (Quality)",type:"tts"},{id:"eleven_monolingual_v1",name:"Monolingual v1 (English)",type:"tts"}]},"edge-tts":{defaults:[{id:"en-US-AriaNeural",name:"Aria (en-US)",type:"tts"},{id:"en-US-GuyNeural",name:"Guy (en-US)",type:"tts"},{id:"en-GB-SoniaNeural",name:"Sonia (en-GB)",type:"tts"},{id:"vi-VN-HoaiMyNeural",name:"Hoai My (vi-VN)",type:"tts"},{id:"vi-VN-NamMinhNeural",name:"Nam Minh (vi-VN)",type:"tts"},{id:"zh-CN-XiaoxiaoNeural",name:"Xiaoxiao (zh-CN)",type:"tts"},{id:"zh-CN-YunxiNeural",name:"Yunxi (zh-CN)",type:"tts"},{id:"fr-FR-DeniseNeural",name:"Denise (fr-FR)",type:"tts"},{id:"de-DE-KatjaNeural",name:"Katja (de-DE)",type:"tts"},{id:"ja-JP-NanamiNeural",name:"Nanami (ja-JP)",type:"tts"},{id:"ko-KR-SunHiNeural",name:"SunHi (ko-KR)",type:"tts"}]},"local-device":{defaults:[{id:"default",name:"System Default Voice",type:"tts"}]},"google-tts":{defaults:[{id:"af",name:"Afrikaans",type:"tts"},{id:"ar",name:"Arabic",type:"tts"},{id:"bg",name:"Bulgarian",type:"tts"},{id:"bn",name:"Bengali",type:"tts"},{id:"bs",name:"Bosnian",type:"tts"},{id:"ca",name:"Catalan",type:"tts"},{id:"cs",name:"Czech",type:"tts"},{id:"cy",name:"Welsh",type:"tts"},{id:"da",name:"Danish",type:"tts"},{id:"de",name:"German",type:"tts"},{id:"el",name:"Greek",type:"tts"},{id:"en",name:"English",type:"tts"},{id:"eo",name:"Esperanto",type:"tts"},{id:"es",name:"Spanish",type:"tts"},{id:"et",name:"Estonian",type:"tts"},{id:"fi",name:"Finnish",type:"tts"},{id:"fr",name:"French",type:"tts"},{id:"gu",name:"Gujarati",type:"tts"},{id:"hi",name:"Hindi",type:"tts"},{id:"hr",name:"Croatian",type:"tts"},{id:"hu",name:"Hungarian",type:"tts"},{id:"hy",name:"Armenian",type:"tts"},{id:"id",name:"Indonesian",type:"tts"},{id:"is",name:"Icelandic",type:"tts"},{id:"it",name:"Italian",type:"tts"},{id:"ja",name:"Japanese",type:"tts"},{id:"jw",name:"Javanese",type:"tts"},{id:"km",name:"Khmer",type:"tts"},{id:"kn",name:"Kannada",type:"tts"},{id:"ko",name:"Korean",type:"tts"},{id:"la",name:"Latin",type:"tts"},{id:"lv",name:"Latvian",type:"tts"},{id:"mk",name:"Macedonian",type:"tts"},{id:"ml",name:"Malayalam",type:"tts"},{id:"mr",name:"Marathi",type:"tts"},{id:"my",name:"Myanmar (Burmese)",type:"tts"},{id:"ne",name:"Nepali",type:"tts"},{id:"nl",name:"Dutch",type:"tts"},{id:"no",name:"Norwegian",type:"tts"},{id:"pl",name:"Polish",type:"tts"},{id:"pt",name:"Portuguese",type:"tts"},{id:"ro",name:"Romanian",type:"tts"},{id:"ru",name:"Russian",type:"tts"},{id:"si",name:"Sinhala",type:"tts"},{id:"sk",name:"Slovak",type:"tts"},{id:"sq",name:"Albanian",type:"tts"},{id:"sr",name:"Serbian",type:"tts"},{id:"su",name:"Sundanese",type:"tts"},{id:"sv",name:"Swedish",type:"tts"},{id:"sw",name:"Swahili",type:"tts"},{id:"ta",name:"Tamil",type:"tts"},{id:"te",name:"Telugu",type:"tts"},{id:"th",name:"Thai",type:"tts"},{id:"tl",name:"Filipino",type:"tts"},{id:"tr",name:"Turkish",type:"tts"},{id:"uk",name:"Ukrainian",type:"tts"},{id:"ur",name:"Urdu",type:"tts"},{id:"vi",name:"Vietnamese",type:"tts"},{id:"zh-CN",name:"Chinese (Simplified)",type:"tts"},{id:"zh-TW",name:"Chinese (Traditional)",type:"tts"}]},gemini:{models:[{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS",type:"tts"},{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS",type:"tts"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS",type:"tts"}],voices:{"gemini-3.1-flash-tts-preview":l,"gemini-2.5-flash-preview-tts":l,"gemini-2.5-pro-preview-tts":l},allVoices:l}},n=["clientId","clientSecret","tokenUrl"],o=new Set(["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"]),p={},q={},r={},s={};for(let a of d.A){a.transport&&(p[a.id]=function(a,b){let c={...a};if(c.format||(c.format=f.format),c.identity||(c.identity="claude"===c.format?"claude-cli":"openai-node"),b)for(let a of n)void 0===c[a]&&void 0!==b[a]&&(c[a]=b[a]);return c}(a.transport,a.oauth),a.transports&&(p[a.id].transports=a.transports)),void 0!==a.models&&(q[a.alias||a.id]=a.models.map(g.pk)),a.oauth&&(r[a.id]=a.oauth);let b={};for(let c of o)void 0!==a[c]&&(b[c]=a[c]);a.media&&Object.assign(b,a.media),Object.keys(b).length&&(s[a.id]=b)}Object.assign(q,function(){let a={};for(let[b,c]of Object.entries(m))c.models&&(a[`${b}-tts-models`]=c.models),c.allVoices&&(a[`${b}-tts-voices`]=c.allVoices),c.defaults&&(a[b]=c.defaults);return a["openai-tts-voices"]=m.openai.allVoices,a["openrouter-tts-voices"]=m.openrouter.allVoices,a}())},15529:(a,b,c)=>{var d=c(45654);c(41702),a.exports=d.mgf=d.mgf||{},d.mgf.mgf1=d.mgf1},15738:(a,b,c)=>{"use strict";c.d(b,{fK:()=>i,ry:()=>j,uQ:()=>k});var d=c(69537),e=c(15904);let f=new Set(d.A.map(a=>a?.id).filter(a=>"string"==typeof a&&a)),g=new WeakMap;function h(a,b){let c=g.get(a);if(c||(c=new Map,g.set(a,c)),c.has(b))return c.get(b);let d=!!a.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[b]);return c.set(b,d),d}function i(a){let b=new Set(f);if(h(a,"providerConnections"))for(let c of a.all("SELECT DISTINCT provider FROM providerConnections")||[])"string"==typeof c.provider&&c.provider&&b.add(c.provider);if(h(a,"providerNodes"))for(let c of a.all("SELECT id FROM providerNodes")||[])"string"==typeof c.id&&c.id&&b.add(c.id);return b}function j(a,b){return"string"==typeof b&&!!b&&(!!(f.has(b)||h(a,"providerConnections")&&a.get("SELECT 1 AS configured FROM providerConnections WHERE provider = ? LIMIT 1",[b]))||!!(h(a,"providerNodes")&&a.get("SELECT 1 AS configured FROM providerNodes WHERE id = ? LIMIT 1",[b])))}function k(a,b){!b||"unknown"===b||j(a,b)||h(a,"prometheusUsageTotals")&&(0,e.Bq)(a,()=>{let c=a.get(`SELECT provider, requests, promptTokens, completionTokens, cachedTokens, cost
|
|
20
|
+
`;return new Promise((a,b)=>{d(`powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command ${h(c)}`,{windowsHide:!0},(c,d,e)=>{if(c){let a=e||c.message;a.includes("canceled by the user")||a.includes("operation was canceled")?b(Error("User canceled UAC prompt")):b(Error(a))}else a(d)})})},quotePs:h}},11897:(a,b,c)=>{"use strict";c.d(b,{R4:()=>g,BY:()=>k,a_:()=>i.a_,RV:()=>e,rP:()=>j,x4:()=>f,bC:()=>i.bC,Du:()=>h,z7:()=>d});let d={USER:"user",ASSISTANT:"assistant",TOOL:"tool",SYSTEM:"system",DEVELOPER:"developer"},e={USER:"user",MODEL:"model"},f={TEXT:"text",IMAGE_URL:"image_url",IMAGE:"image",INPUT_AUDIO:"input_audio",AUDIO_URL:"audio_url",FILE:"file",FUNCTION:"function"},g={TEXT:"text",IMAGE:"image",DOCUMENT:"document",TOOL_USE:"tool_use",TOOL_RESULT:"tool_result",THINKING:"thinking",REDACTED_THINKING:"redacted_thinking"},h={MESSAGE:"message",FUNCTION_CALL:"function_call",FUNCTION_CALL_OUTPUT:"function_call_output",REASONING:"reasoning",OUTPUT_TEXT:"output_text",INPUT_TEXT:"input_text",INPUT_IMAGE:"input_image",INPUT_FILE:"input_file",SUMMARY_TEXT:"summary_text"};f.TEXT,f.IMAGE_URL,f.IMAGE,f.INPUT_AUDIO,f.AUDIO_URL,f.FILE,f.TEXT,f.IMAGE_URL,f.IMAGE,g.TOOL_RESULT;var i=c(62457);let j="unknown",k="image/png"},12600:(a,b,c)=>{"use strict";let d,e,f,g,h,i,j,k,{extractBody:l,mixinBody:m,cloneBody:n,bodyUnusable:o}=c(35381),{Headers:p,fill:q,HeadersList:r,setHeadersGuard:s,getHeadersGuard:t,setHeadersList:u,getHeadersList:v}=c(28665),w=c(84285),x=c(57975),{isValidHTTPToken:y,sameOrigin:z,environmentSettingsObject:A}=c(42425),{forbiddenMethodsSet:B,corsSafeListedMethodsSet:C,referrerPolicy:D,requestRedirect:E,requestMode:F,requestCredentials:G,requestCache:H,requestDuplex:I}=c(19608),{kEnumerableProperty:J,normalizedMethodRecordsBase:K,normalizedMethodRecords:L}=w,{webidl:M}=c(32984),{URLSerializer:N}=c(16537),{kConstruct:O}=c(49176),P=c(34589),{getMaxListeners:Q,setMaxListeners:R,defaultMaxListeners:S}=c(78474),T=Symbol("abortController"),U=new FinalizationRegistry(({signal:a,abort:b})=>{a.removeEventListener("abort",b)}),V=new WeakMap;try{d=Q(new AbortController().signal)>0}catch{d=!1}function W(a){return function b(){let c=a.deref();if(void 0!==c){U.unregister(b),this.removeEventListener("abort",b),c.abort(this.reason);let a=V.get(c.signal);if(void 0!==a){if(0!==a.size){for(let b of a){let a=b.deref();void 0!==a&&a.abort(this.reason)}a.clear()}V.delete(c.signal)}}}}let X=!1;class Y{#c;#d;#e;#a;#f=null;constructor(a,b){let c;if(M.util.markAsUncloneable(this),a===O)return;M.argumentLengthCheck(arguments,1,"Request constructor"),a=M.converters.RequestInfo(a),b=M.converters.RequestInit(b);let e=null,f=null;const g=A.settingsObject.baseUrl;let h=null;if("string"==typeof a){let c;this.#d=b.dispatcher;try{c=new URL(a,g)}catch(b){throw TypeError("Failed to parse URL from "+a,{cause:b})}if(c.username||c.password)throw TypeError("Request cannot be constructed from a URL that includes credentials: "+a);e=Z({urlList:[c]}),f="cors"}else P(M.is.Request(a)),e=a.#a,h=a.#c,this.#d=b.dispatcher||a.#d;const i=A.settingsObject.origin;let j="client";if(e.window?.constructor?.name==="EnvironmentSettingsObject"&&z(e.window,i)&&(j=e.window),null!=b.window)throw TypeError(`'window' option '${j}' must be null`);"window"in b&&(j="no-window"),e=Z({method:e.method,headersList:e.headersList,unsafeRequest:e.unsafeRequest,client:A.settingsObject,window:j,priority:e.priority,origin:e.origin,referrer:e.referrer,referrerPolicy:e.referrerPolicy,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,integrity:e.integrity,keepalive:e.keepalive,reloadNavigation:e.reloadNavigation,historyNavigation:e.historyNavigation,urlList:[...e.urlList]});const k=0!==Object.keys(b).length;if(k&&("navigate"===e.mode&&(e.mode="same-origin"),e.reloadNavigation=!1,e.historyNavigation=!1,e.origin="client",e.referrer="client",e.referrerPolicy="",e.url=e.urlList[e.urlList.length-1],e.urlList=[e.url]),void 0!==b.referrer){const a=b.referrer;if(""===a)e.referrer="no-referrer";else{let b;try{b=new URL(a,g)}catch(b){throw TypeError(`Referrer "${a}" is not a valid URL.`,{cause:b})}"about:"===b.protocol&&"client"===b.hostname||i&&!z(b,A.settingsObject.baseUrl)?e.referrer="client":e.referrer=b}}if(void 0!==b.referrerPolicy&&(e.referrerPolicy=b.referrerPolicy),"navigate"===(c=void 0!==b.mode?b.mode:f))throw M.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(null!=c&&(e.mode=c),void 0!==b.credentials&&(e.credentials=b.credentials),void 0!==b.cache&&(e.cache=b.cache),"only-if-cached"===e.cache&&"same-origin"!==e.mode)throw TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(void 0!==b.redirect&&(e.redirect=b.redirect),null!=b.integrity&&(e.integrity=String(b.integrity)),void 0!==b.keepalive&&(e.keepalive=!!b.keepalive),void 0!==b.method){let a=b.method;const c=L[a];if(void 0!==c)e.method=c;else{if(!y(a))throw TypeError(`'${a}' is not a valid HTTP method.`);const b=a.toUpperCase();if(B.has(b))throw TypeError(`'${a}' HTTP method is unsupported.`);a=K[b]??a,e.method=a}X||"patch"!==e.method||(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),X=!0)}void 0!==b.signal&&(h=b.signal),this.#a=e;const m=new AbortController;if(this.#c=m.signal,null!=h)if(h.aborted)m.abort(h.reason);else{this[T]=m;const a=W(new WeakRef(m));d&&Q(h)===S&&R(1500,h);const b=w.addAbortListener(h,a);U.register(m,{signal:h,abort:a},a),this.#f=()=>{U.unregister(a),b(),this.#f=null}}if(this.#e=new p(O),u(this.#e,e.headersList),s(this.#e,"request"),"no-cors"===c){if(!C.has(e.method))throw TypeError(`'${e.method} is unsupported in no-cors mode.`);s(this.#e,"request-no-cors")}if(k){const a=v(this.#e),c=void 0!==b.headers?b.headers:new r(a);if(a.clear(),c instanceof r){for(const{name:b,value:d}of c.rawValues())a.append(b,d,!1);a.cookies=c.cookies}else q(this.#e,c)}const n=M.is.Request(a)?a.#a.body:null;if((null!=b.body||null!=n)&&("GET"===e.method||"HEAD"===e.method))throw TypeError("Request with GET/HEAD method cannot have body.");let t=null;if(null!=b.body){const[a,c]=l(b.body,e.keepalive);t=a,c&&!v(this.#e).contains("content-type",!0)&&this.#e.append("content-type",c,!0)}const x=t??n;if(null!=x&&null==x.source){if(null!=t&&null==b.duplex)throw TypeError("RequestInit: duplex option is required when sending a body.");if("same-origin"!==e.mode&&"cors"!==e.mode)throw TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');e.useCORSPreflightFlag=!0}let D=x;if(null==t&&null!=n){if(o(a.#a))throw TypeError("Cannot construct a Request with a Request object that has already been used.");const b=new TransformStream;n.stream.pipeThrough(b),D={source:n.source,length:n.length,stream:b.readable}}this.#a.body=D}get method(){return M.brandCheck(this,M.is.Request),this.#a.method}get url(){return M.brandCheck(this,M.is.Request),N(this.#a.url)}get headers(){return M.brandCheck(this,M.is.Request),this.#e}get destination(){return M.brandCheck(this,M.is.Request),this.#a.destination}get referrer(){return(M.brandCheck(this,M.is.Request),"no-referrer"===this.#a.referrer)?"":"client"===this.#a.referrer?"about:client":this.#a.referrer.toString()}get referrerPolicy(){return M.brandCheck(this,M.is.Request),this.#a.referrerPolicy}get mode(){return M.brandCheck(this,M.is.Request),this.#a.mode}get credentials(){return M.brandCheck(this,M.is.Request),this.#a.credentials}get cache(){return M.brandCheck(this,M.is.Request),this.#a.cache}get redirect(){return M.brandCheck(this,M.is.Request),this.#a.redirect}get integrity(){return M.brandCheck(this,M.is.Request),this.#a.integrity}get keepalive(){return M.brandCheck(this,M.is.Request),this.#a.keepalive}get isReloadNavigation(){return M.brandCheck(this,M.is.Request),this.#a.reloadNavigation}get isHistoryNavigation(){return M.brandCheck(this,M.is.Request),this.#a.historyNavigation}get signal(){return M.brandCheck(this,M.is.Request),this.#c}get body(){return M.brandCheck(this,M.is.Request),this.#a.body?this.#a.body.stream:null}get bodyUsed(){return M.brandCheck(this,M.is.Request),!!this.#a.body&&w.isDisturbed(this.#a.body.stream)}get duplex(){return M.brandCheck(this,M.is.Request),"half"}clone(){if(M.brandCheck(this,M.is.Request),o(this.#a))throw TypeError("unusable");let a=$(this.#a),b=new AbortController;if(this.signal.aborted)b.abort(this.signal.reason);else{let a=V.get(this.signal);void 0===a&&(a=new Set,V.set(this.signal,a));let c=new WeakRef(b);a.add(c),w.addAbortListener(b.signal,W(c))}return _(a,this.#d,b.signal,t(this.#e))}[x.inspect.custom](a,b){null===b.depth&&(b.depth=2),b.colors??=!0;let c={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${x.formatWithOptions(b,c)}`}static{e=(a,b)=>{a.#c=b},f=a=>a.#d,g=(a,b)=>{a.#d=b},h=(a,b)=>{a.#e=b},i=a=>a.#a,j=(a,b)=>{a.#a=b},k=a=>{a.#f?.()},M.is.Request=a=>null!=a&&"object"==typeof a&&#a in a}}function Z(a){return{method:a.method??"GET",localURLsOnly:a.localURLsOnly??!1,unsafeRequest:a.unsafeRequest??!1,body:a.body??null,client:a.client??null,reservedClient:a.reservedClient??null,replacesClientId:a.replacesClientId??"",window:a.window??"client",keepalive:a.keepalive??!1,serviceWorkers:a.serviceWorkers??"all",initiator:a.initiator??"",destination:a.destination??"",priority:a.priority??"auto",origin:a.origin??"client",policyContainer:a.policyContainer??"client",referrer:a.referrer??"client",referrerPolicy:a.referrerPolicy??"",mode:a.mode??"no-cors",useCORSPreflightFlag:a.useCORSPreflightFlag??!1,credentials:a.credentials??"same-origin",useCredentials:a.useCredentials??!1,cache:a.cache??"default",redirect:a.redirect??"follow",integrity:a.integrity??"",cryptoGraphicsNonceMetadata:a.cryptoGraphicsNonceMetadata??"",parserMetadata:a.parserMetadata??"",reloadNavigation:a.reloadNavigation??!1,historyNavigation:a.historyNavigation??!1,userActivation:a.userActivation??!1,taintedOrigin:a.taintedOrigin??!1,redirectCount:a.redirectCount??0,responseTainting:a.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:a.preventNoCacheCacheControlHeaderModification??!1,done:a.done??!1,timingAllowFailed:a.timingAllowFailed??!1,useURLCredentials:a.useURLCredentials??void 0,traversableForUserPrompts:a.traversableForUserPrompts??"client",urlList:a.urlList,url:a.urlList[0],headersList:a.headersList?new r(a.headersList):new r}}function $(a){let b=Z({...a,body:null});return null!=a.body&&(b.body=n(a.body)),b}function _(a,b,c,d){let f=new Y(O);j(f,a),g(f,b),e(f,c);let i=new p(O);return h(f,i),u(i,a.headersList),s(i,d),f}m(Y,i,M.is.Request),Object.defineProperties(Y.prototype,{method:J,url:J,headers:J,redirect:J,clone:J,signal:J,duplex:J,destination:J,body:J,bodyUsed:J,isHistoryNavigation:J,isReloadNavigation:J,keepalive:J,integrity:J,cache:J,credentials:J,attribute:J,referrerPolicy:J,referrer:J,mode:J,[Symbol.toStringTag]:{value:"Request",configurable:!0}}),M.converters.RequestInfo=function(a){return"string"==typeof a?M.converters.USVString(a):M.is.Request(a)?a:M.converters.USVString(a)},M.converters.RequestInit=M.dictionaryConverter([{key:"method",converter:M.converters.ByteString},{key:"headers",converter:M.converters.HeadersInit},{key:"body",converter:M.nullableConverter(M.converters.BodyInit)},{key:"referrer",converter:M.converters.USVString},{key:"referrerPolicy",converter:M.converters.DOMString,allowedValues:D},{key:"mode",converter:M.converters.DOMString,allowedValues:F},{key:"credentials",converter:M.converters.DOMString,allowedValues:G},{key:"cache",converter:M.converters.DOMString,allowedValues:H},{key:"redirect",converter:M.converters.DOMString,allowedValues:E},{key:"integrity",converter:M.converters.DOMString},{key:"keepalive",converter:M.converters.boolean},{key:"signal",converter:M.nullableConverter(a=>M.converters.AbortSignal(a,"RequestInit","signal"))},{key:"window",converter:M.converters.any},{key:"duplex",converter:M.converters.DOMString,allowedValues:I},{key:"dispatcher",converter:M.converters.any},{key:"priority",converter:M.converters.DOMString,allowedValues:["high","low","auto"]}]),a.exports={Request:Y,makeRequest:Z,fromInnerRequest:_,cloneRequest:$,getRequestDispatcher:f,getRequestState:i,removeRequestAbortListener:k}},13161:(a,b,c)=>{"use strict";c.d(b,{vq:()=>f.vq,kt:()=>j});var d=c(38421),e=c(69537),f=c(15251),g=c(97915);let h="-review",i=new Set(["kr","kiro"]);function j(a,b){let c="string"==typeof b?b.match(/\([^()]+\)\s*$/):null,d=c?c[0]:"",e=d?b.slice(0,c.index).trim():b,j=function(a,b,c){if(!a)return;let d=a.find(a=>a.id===b);if(d)return d;if(!i.has(c))return;let e=(0,g.Kq)(b);if(e!==b)return a.find(a=>a.id===e)}(f.vq[a],e,a);return j?.upstreamModelId?j.upstreamModelId+d:j?.id?j.id+d:"cx"===a&&"string"==typeof e&&e.endsWith(h)?e.slice(0,-h.length)+d:e+d}let k=Object.fromEntries(e.A.filter(a=>a.alias&&a.alias!==a.id).map(a=>[a.id,a.alias]));Object.fromEntries(Object.keys(d.xq).map(a=>[a,k[a]||a]))},13839:(a,b,c)=>{"use strict";a.exports=c.p+"static/media/versions.fd0ef9e7.json"},14071:(a,b,c)=>{"use strict";c.d(b,{F:()=>f});var d=c(46248),e=c(38421);class f extends d.L{constructor(){super("xiaomi-tokenplan")}buildUrl(a,b,c=0,d=null){let f=(0,e.Yg)(d);return d?.runtimeTransport?.format==="claude"?`${f.replace(/\/v1\/?$/,"")}/anthropic/v1/messages`:`${f}/chat/completions`}}},14896:(a,b,c)=>{"use strict";var d=c(68531);c(26408),d.h.GEMINI,d.h.GEMINI_CLI,d.h.VERTEX,d.h.ANTIGRAVITY,d.h.OLLAMA,d.h.KIRO},15251:(a,b,c)=>{"use strict";c.d(b,{xq:()=>p,vq:()=>q,sr:()=>r});var d=c(69537),e=c(82689);let f={baseUrl:"",format:"openai",headers:{},auth:{header:"Authorization",scheme:"bearer",source:["accessToken","apiKey"]},forceStream:!1,urlSuffix:"",quirks:{},passthroughModels:!1,retry:e.cI,timeoutMs:e.pH,executor:"default"};var g=c(97915);let h={alloy:{id:"alloy",name:"Alloy"},ash:{id:"ash",name:"Ash"},ballad:{id:"ballad",name:"Ballad"},cedar:{id:"cedar",name:"Cedar"},coral:{id:"coral",name:"Coral"},echo:{id:"echo",name:"Echo"},fable:{id:"fable",name:"Fable"},marin:{id:"marin",name:"Marin"},nova:{id:"nova",name:"Nova"},onyx:{id:"onyx",name:"Onyx"},sage:{id:"sage",name:"Sage"},shimmer:{id:"shimmer",name:"Shimmer"},verse:{id:"verse",name:"Verse"}},i=(...a)=>a.map(a=>({...h[a],type:"tts"})),j=i("alloy","ash","coral","echo","fable","nova","onyx","sage","shimmer"),k=i("alloy","ash","ballad","cedar","coral","echo","fable","marin","nova","onyx","sage","shimmer","verse"),l=["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Vindemiatrix","Sadachbia","Sadaltager","Sulafat"].map(a=>({id:a,name:a,type:"tts"})),m={openai:{models:[{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"tts-1",name:"TTS-1",type:"tts"}],voices:{"gpt-4o-mini-tts":k,"tts-1":j,"tts-1-hd":j},allVoices:k},openrouter:{models:[{id:"openai/gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"openai/tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"openai/tts-1",name:"TTS-1",type:"tts"}],voices:{"openai/gpt-4o-mini-tts":k,"openai/tts-1":j,"openai/tts-1-hd":j},allVoices:k},elevenlabs:{models:[{id:"eleven_flash_v2_5",name:"Flash v2.5 (Fastest)",type:"tts"},{id:"eleven_turbo_v2_5",name:"Turbo v2.5 (Fast)",type:"tts"},{id:"eleven_multilingual_v2",name:"Multilingual v2 (Quality)",type:"tts"},{id:"eleven_monolingual_v1",name:"Monolingual v1 (English)",type:"tts"}]},"edge-tts":{defaults:[{id:"en-US-AriaNeural",name:"Aria (en-US)",type:"tts"},{id:"en-US-GuyNeural",name:"Guy (en-US)",type:"tts"},{id:"en-GB-SoniaNeural",name:"Sonia (en-GB)",type:"tts"},{id:"vi-VN-HoaiMyNeural",name:"Hoai My (vi-VN)",type:"tts"},{id:"vi-VN-NamMinhNeural",name:"Nam Minh (vi-VN)",type:"tts"},{id:"zh-CN-XiaoxiaoNeural",name:"Xiaoxiao (zh-CN)",type:"tts"},{id:"zh-CN-YunxiNeural",name:"Yunxi (zh-CN)",type:"tts"},{id:"fr-FR-DeniseNeural",name:"Denise (fr-FR)",type:"tts"},{id:"de-DE-KatjaNeural",name:"Katja (de-DE)",type:"tts"},{id:"ja-JP-NanamiNeural",name:"Nanami (ja-JP)",type:"tts"},{id:"ko-KR-SunHiNeural",name:"SunHi (ko-KR)",type:"tts"}]},"local-device":{defaults:[{id:"default",name:"System Default Voice",type:"tts"}]},"google-tts":{defaults:[{id:"af",name:"Afrikaans",type:"tts"},{id:"ar",name:"Arabic",type:"tts"},{id:"bg",name:"Bulgarian",type:"tts"},{id:"bn",name:"Bengali",type:"tts"},{id:"bs",name:"Bosnian",type:"tts"},{id:"ca",name:"Catalan",type:"tts"},{id:"cs",name:"Czech",type:"tts"},{id:"cy",name:"Welsh",type:"tts"},{id:"da",name:"Danish",type:"tts"},{id:"de",name:"German",type:"tts"},{id:"el",name:"Greek",type:"tts"},{id:"en",name:"English",type:"tts"},{id:"eo",name:"Esperanto",type:"tts"},{id:"es",name:"Spanish",type:"tts"},{id:"et",name:"Estonian",type:"tts"},{id:"fi",name:"Finnish",type:"tts"},{id:"fr",name:"French",type:"tts"},{id:"gu",name:"Gujarati",type:"tts"},{id:"hi",name:"Hindi",type:"tts"},{id:"hr",name:"Croatian",type:"tts"},{id:"hu",name:"Hungarian",type:"tts"},{id:"hy",name:"Armenian",type:"tts"},{id:"id",name:"Indonesian",type:"tts"},{id:"is",name:"Icelandic",type:"tts"},{id:"it",name:"Italian",type:"tts"},{id:"ja",name:"Japanese",type:"tts"},{id:"jw",name:"Javanese",type:"tts"},{id:"km",name:"Khmer",type:"tts"},{id:"kn",name:"Kannada",type:"tts"},{id:"ko",name:"Korean",type:"tts"},{id:"la",name:"Latin",type:"tts"},{id:"lv",name:"Latvian",type:"tts"},{id:"mk",name:"Macedonian",type:"tts"},{id:"ml",name:"Malayalam",type:"tts"},{id:"mr",name:"Marathi",type:"tts"},{id:"my",name:"Myanmar (Burmese)",type:"tts"},{id:"ne",name:"Nepali",type:"tts"},{id:"nl",name:"Dutch",type:"tts"},{id:"no",name:"Norwegian",type:"tts"},{id:"pl",name:"Polish",type:"tts"},{id:"pt",name:"Portuguese",type:"tts"},{id:"ro",name:"Romanian",type:"tts"},{id:"ru",name:"Russian",type:"tts"},{id:"si",name:"Sinhala",type:"tts"},{id:"sk",name:"Slovak",type:"tts"},{id:"sq",name:"Albanian",type:"tts"},{id:"sr",name:"Serbian",type:"tts"},{id:"su",name:"Sundanese",type:"tts"},{id:"sv",name:"Swedish",type:"tts"},{id:"sw",name:"Swahili",type:"tts"},{id:"ta",name:"Tamil",type:"tts"},{id:"te",name:"Telugu",type:"tts"},{id:"th",name:"Thai",type:"tts"},{id:"tl",name:"Filipino",type:"tts"},{id:"tr",name:"Turkish",type:"tts"},{id:"uk",name:"Ukrainian",type:"tts"},{id:"ur",name:"Urdu",type:"tts"},{id:"vi",name:"Vietnamese",type:"tts"},{id:"zh-CN",name:"Chinese (Simplified)",type:"tts"},{id:"zh-TW",name:"Chinese (Traditional)",type:"tts"}]},gemini:{models:[{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS",type:"tts"},{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS",type:"tts"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS",type:"tts"}],voices:{"gemini-3.1-flash-tts-preview":l,"gemini-2.5-flash-preview-tts":l,"gemini-2.5-pro-preview-tts":l},allVoices:l}},n=["clientId","clientSecret","tokenUrl"],o=new Set(["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","modelsFetcher","mediaPriority","hiddenKinds"]),p={},q={},r={},s={};for(let a of d.A){a.transport&&(p[a.id]=function(a,b){let c={...a};if(c.format||(c.format=f.format),c.identity||(c.identity="claude"===c.format?"claude-cli":"openai-node"),b)for(let a of n)void 0===c[a]&&void 0!==b[a]&&(c[a]=b[a]);return c}(a.transport,a.oauth),a.transports&&(p[a.id].transports=a.transports)),void 0!==a.models&&(q[a.alias||a.id]=a.models.map(g.pk)),a.oauth&&(r[a.id]=a.oauth);let b={};for(let c of o)void 0!==a[c]&&(b[c]=a[c]);a.media&&Object.assign(b,a.media),Object.keys(b).length&&(s[a.id]=b)}Object.assign(q,function(){let a={};for(let[b,c]of Object.entries(m))c.models&&(a[`${b}-tts-models`]=c.models),c.allVoices&&(a[`${b}-tts-voices`]=c.allVoices),c.defaults&&(a[b]=c.defaults);return a["openai-tts-voices"]=m.openai.allVoices,a["openrouter-tts-voices"]=m.openrouter.allVoices,a}())},15529:(a,b,c)=>{var d=c(45654);c(41702),a.exports=d.mgf=d.mgf||{},d.mgf.mgf1=d.mgf1},15738:(a,b,c)=>{"use strict";c.d(b,{fK:()=>i,ry:()=>j,uQ:()=>k});var d=c(69537),e=c(15904);let f=new Set(d.A.map(a=>a?.id).filter(a=>"string"==typeof a&&a)),g=new WeakMap;function h(a,b){let c=g.get(a);if(c||(c=new Map,g.set(a,c)),c.has(b))return c.get(b);let d=!!a.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[b]);return c.set(b,d),d}function i(a){let b=new Set(f);if(h(a,"providerConnections"))for(let c of a.all("SELECT DISTINCT provider FROM providerConnections")||[])"string"==typeof c.provider&&c.provider&&b.add(c.provider);if(h(a,"providerNodes"))for(let c of a.all("SELECT id FROM providerNodes")||[])"string"==typeof c.id&&c.id&&b.add(c.id);return b}function j(a,b){return"string"==typeof b&&!!b&&(!!(f.has(b)||h(a,"providerConnections")&&a.get("SELECT 1 AS configured FROM providerConnections WHERE provider = ? LIMIT 1",[b]))||!!(h(a,"providerNodes")&&a.get("SELECT 1 AS configured FROM providerNodes WHERE id = ? LIMIT 1",[b])))}function k(a,b){!b||"unknown"===b||j(a,b)||h(a,"prometheusUsageTotals")&&(0,e.Bq)(a,()=>{let c=a.get(`SELECT provider, requests, promptTokens, completionTokens, cachedTokens, cost
|
|
21
21
|
FROM prometheusUsageTotals WHERE provider = ?`,[b]);if(!c)return;(0,e.Kd)(c);let d=a.get(`SELECT provider, requests, promptTokens, completionTokens, cachedTokens, cost
|
|
22
22
|
FROM prometheusUsageTotals WHERE provider = 'unknown'`);d&&(0,e.Kd)(d),(0,e.Kd)({provider:"unknown",requests:(d?.requests||0)+c.requests,promptTokens:(d?.promptTokens||0)+c.promptTokens,completionTokens:(d?.completionTokens||0)+c.completionTokens,cachedTokens:(d?.cachedTokens||0)+c.cachedTokens,cost:(d?.cost||0)+c.cost}),a.run(`INSERT INTO prometheusUsageTotals(provider, requests, promptTokens, completionTokens, cachedTokens, cost)
|
|
23
23
|
VALUES('unknown', ?, ?, ?, ?, ?)
|
|
@@ -26,7 +26,7 @@ exports.id=8998,exports.ids=[8998],exports.modules={794:(a,b,c)=>{"use strict";l
|
|
|
26
26
|
promptTokens = promptTokens + excluded.promptTokens,
|
|
27
27
|
completionTokens = completionTokens + excluded.completionTokens,
|
|
28
28
|
cachedTokens = cachedTokens + excluded.cachedTokens,
|
|
29
|
-
cost = cost + excluded.cost`,[c.requests,c.promptTokens,c.completionTokens,c.cachedTokens,c.cost]),a.run("DELETE FROM prometheusUsageTotals WHERE provider = ?",[b])})}},15873:(a,b,c)=>{var d=c(45654);c(63070),c(76632),c(36105),c(56416),c(20308),c(29984),c(10401),c(4554),c(33889),c(65737);var e=d.asn1,f=d.pki,g=a.exports=d.pkcs12=d.pkcs12||{},h={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},i={name:"PFX",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},h,{name:"PFX.macData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:e.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},j={name:"SafeBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},k={name:"Attribute",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,capture:"values"}]},l={name:"CertBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:e.Class.UNIVERSAL,type:e.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function m(a,b,c,d){for(var e=[],f=0;f<a.length;f++)for(var g=0;g<a[f].safeBags.length;g++){var h=a[f].safeBags[g];if(void 0===d||h.type===d){if(null===b){e.push(h);continue}void 0!==h.attributes[b]&&h.attributes[b].indexOf(c)>=0&&e.push(h)}}return e}function n(a){if(a.composed||a.constructed){for(var b=d.util.createBuffer(),c=0;c<a.value.length;++c)b.putBytes(a.value[c].value);a.composed=a.constructed=!1,a.value=b.getBytes()}return a}g.pkcs12FromAsn1=function(a,b,c){"string"==typeof b?(c=b,b=!0):void 0===b&&(b=!0);var o={};if(!e.validate(a,i,o,[])){var p=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw p.errors=p,p}var q={version:o.version.charCodeAt(0),safeContents:[],getBags:function(a){var b,c={};return"localKeyId"in a?b=a.localKeyId:"localKeyIdHex"in a&&(b=d.util.hexToBytes(a.localKeyIdHex)),void 0===b&&!("friendlyName"in a)&&"bagType"in a&&(c[a.bagType]=m(q.safeContents,null,null,a.bagType)),void 0!==b&&(c.localKeyId=m(q.safeContents,"localKeyId",b,a.bagType)),"friendlyName"in a&&(c.friendlyName=m(q.safeContents,"friendlyName",a.friendlyName,a.bagType)),c},getBagsByFriendlyName:function(a,b){return m(q.safeContents,"friendlyName",a,b)},getBagsByLocalKeyId:function(a,b){return m(q.safeContents,"localKeyId",a,b)}};if(3!==o.version.charCodeAt(0)){var p=Error("PKCS#12 PFX of version other than 3 not supported.");throw p.version=o.version.charCodeAt(0),p}if(e.derToOid(o.contentType)!==f.oids.data){var p=Error("Only PKCS#12 PFX in password integrity mode supported.");throw p.oid=e.derToOid(o.contentType),p}var r=o.content.value[0];if(r.tagClass!==e.Class.UNIVERSAL||r.type!==e.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(r=n(r),o.mac){var s=null,t=0,u=e.derToOid(o.macAlgorithm);switch(u){case f.oids.sha1:s=d.md.sha1.create(),t=20;break;case f.oids.sha256:s=d.md.sha256.create(),t=32;break;case f.oids.sha384:s=d.md.sha384.create(),t=48;break;case f.oids.sha512:s=d.md.sha512.create(),t=64;break;case f.oids.md5:s=d.md.md5.create(),t=16}if(null===s)throw Error("PKCS#12 uses unsupported MAC algorithm: "+u);var v=new d.util.ByteBuffer(o.macSalt),w="macIterations"in o?parseInt(d.util.bytesToHex(o.macIterations),16):1,x=g.generateKey(c,v,3,w,t,s),y=d.hmac.create();if(y.start(s,x),y.update(r.value),y.getMac().getBytes()!==o.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(a.value)&&a.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not validated.");return function(a,b,c,g){if((b=e.fromDer(b,c)).tagClass!==e.Class.UNIVERSAL||b.type!==e.Type.SEQUENCE||!0!==b.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<b.value.length;i++){var m=b.value[i],o={},p=[];if(!e.validate(m,h,o,p)){var q=Error("Cannot read ContentInfo.");throw q.errors=p,q}var r={encrypted:!1},s=null,t=o.content.value[0];switch(e.derToOid(o.contentType)){case f.oids.data:if(t.tagClass!==e.Class.UNIVERSAL||t.type!==e.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");s=n(t).value;break;case f.oids.encryptedData:s=function(a,b){var c={},g=[];if(!e.validate(a,d.pkcs7.asn1.encryptedDataValidator,c,g)){var h=Error("Cannot read EncryptedContentInfo.");throw h.errors=g,h}var i=e.derToOid(c.contentType);if(i!==f.oids.data){var h=Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw h.oid=i,h}i=e.derToOid(c.encAlgorithm);var j=f.pbe.getCipher(i,c.encParameter,b),k=n(c.encryptedContentAsn1),l=d.util.createBuffer(k.value);if(j.update(l),!j.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");return j.output.getBytes()}(t,g),r.encrypted=!0;break;default:var q=Error("Unsupported PKCS#12 contentType.");throw q.contentType=e.derToOid(o.contentType),q}r.safeBags=function(a,b,c){if(!b&&0===a.length)return[];if((a=e.fromDer(a,b)).tagClass!==e.Class.UNIVERSAL||a.type!==e.Type.SEQUENCE||!0!==a.constructed)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var d=[],g=0;g<a.value.length;g++){var h,i,m=a.value[g],n={},o=[];if(!e.validate(m,j,n,o)){var p=Error("Cannot read SafeBag.");throw p.errors=o,p}var q={type:e.derToOid(n.bagId),attributes:function(a){var b={};if(void 0!==a)for(var c=0;c<a.length;++c){var d={},g=[];if(!e.validate(a[c],k,d,g)){var h=Error("Cannot read PKCS#12 BagAttribute.");throw h.errors=g,h}var i=e.derToOid(d.oid);if(void 0!==f.oids[i]){b[f.oids[i]]=[];for(var j=0;j<d.values.length;++j)b[f.oids[i]].push(d.values[j].value)}}return b}(n.bagAttributes)};d.push(q);var r=n.bagValue.value[0];switch(q.type){case f.oids.pkcs8ShroudedKeyBag:if(null===(r=f.decryptPrivateKeyInfo(r,c)))throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case f.oids.keyBag:try{q.key=f.privateKeyFromAsn1(r)}catch(a){q.key=null,q.asn1=r}continue;case f.oids.certBag:h=l,i=function(){if(e.derToOid(n.certId)!==f.oids.x509Certificate){var a=Error("Unsupported certificate type, only X.509 supported.");throw a.oid=e.derToOid(n.certId),a}var c=e.fromDer(n.cert,b);try{q.cert=f.certificateFromAsn1(c,!0)}catch(a){q.cert=null,q.asn1=c}};break;default:var p=Error("Unsupported PKCS#12 SafeBag type.");throw p.oid=q.type,p}if(void 0!==h&&!e.validate(r,h,n,o)){var p=Error("Cannot read PKCS#12 "+h.name);throw p.errors=o,p}i()}return d}(s,c,g),a.safeContents.push(r)}}(q,r.value,b,c),q},g.toPkcs12Asn1=function(a,b,c,h){(h=h||{}).saltSize=h.saltSize||8,h.count=h.count||2048,h.algorithm=h.algorithm||h.encAlgorithm||"aes128","useMac"in h||(h.useMac=!0),"localKeyId"in h||(h.localKeyId=null),"generateLocalKeyId"in h||(h.generateLocalKeyId=!0);var i,j,k=h.localKeyId;if(null!==k)k=d.util.hexToBytes(k);else if(h.generateLocalKeyId)if(b){var l=d.util.isArray(b)?b[0]:b;"string"==typeof l&&(l=f.certificateFromPem(l));var m=d.md.sha1.create();m.update(e.toDer(f.certificateToAsn1(l)).getBytes()),k=m.digest().getBytes()}else k=d.random.getBytes(20);var n=[];null!==k&&n.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.localKeyId).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,k)])])),"friendlyName"in h&&n.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.friendlyName).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.BMPSTRING,!1,h.friendlyName)])])),n.length>0&&(i=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,n));var o=[],p=[];null!==b&&(p=d.util.isArray(b)?b:[b]);for(var q=[],r=0;r<p.length;++r){"string"==typeof(b=p[r])&&(b=f.certificateFromPem(b));var s=0===r?i:void 0,t=f.certificateToAsn1(b),u=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.certBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.x509Certificate).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(t).getBytes())])])]),s]);q.push(u)}if(q.length>0){var v=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,q),w=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(v).getBytes())])]);o.push(w)}var x=null;if(null!==a){var y=f.wrapRsaPrivateKey(f.privateKeyToAsn1(a));x=null===c?e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.keyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[y]),i]):e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.pkcs8ShroudedKeyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[f.encryptPrivateKeyInfo(y,c,h)]),i]);var z=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[x]),A=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(z).getBytes())])]);o.push(A)}var B=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,o);if(h.useMac){var m=d.md.sha1.create(),C=new d.util.ByteBuffer(d.random.getBytes(h.saltSize)),D=h.count,a=g.generateKey(c,C,3,D,20),E=d.hmac.create();E.start(m,a),E.update(e.toDer(B).getBytes());var F=E.getMac();j=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.sha1).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,F.getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,C.getBytes()),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(D).getBytes())])}return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(3).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(B).getBytes())])]),j])},g.generateKey=d.pbe.generatePkcs12Key},15904:(a,b,c)=>{"use strict";c.d(b,{BO:()=>m,Bq:()=>k,Kd:()=>l,SQ:()=>n});var d=c(77397);let e=["requests","promptTokens","completionTokens","cachedTokens"],f=["requests","errors","fallbacks"],g=new WeakMap;function h(a,b){let c=g.get(a);if(c||(c=new Map,g.set(a,c)),c.has(b))return c.get(b);let d=!!a.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[b]);return c.set(b,d),d}let i=new WeakMap;function j(a){i.delete(a),h(a,"prometheusMetricState")&&a.run("UPDATE prometheusMetricState SET available = 0 WHERE id = 1")}function k(a,b){if(!function(a){let b=Date.now(),c=i.get(a);if(c&&c.expiresAt>b)return c.value;let e=function(a){if(!h(a,"prometheusMetricState"))return!1;let b=a.get("SELECT available FROM prometheusMetricState WHERE id = 1");try{let a=(0,d.T)(b?.available,"metricState.available",{integer:!0});if(![0,1].includes(a))throw Error("invalid Prometheus metric state");return 1===a}catch{return j(a),!1}}(a);return i.set(a,{value:e,expiresAt:b+5e3}),e}(a))return!1;try{return a.transaction(b),!0}catch{return j(a),!1}}function l(a,b=a?.provider||"usage"){if(!a||"string"!=typeof a.provider||!a.provider)throw Error(`invalid Prometheus usage metric: ${b}.provider`);for(let c of e)(0,d.T)(a[c],`${b}.${c}`,{integer:!0});return(0,d.T)(a.cost,`${b}.cost`),a}function m(a,b=a?.source||"routing"){if(!a||"string"!=typeof a.source||!a.source)throw Error(`invalid Prometheus routing metric: ${b}.source`);for(let c of f)(0,d.T)(a[c],`${b}.${c}`,{integer:!0});return a}function n(a,b=a?.requestKey||"routingRequest"){if(!a||"string"!=typeof a.source||!a.source)throw Error(`invalid Prometheus routing request: ${b}.source`);(0,d.T)(a.terminalId,`${b}.terminalId`,{integer:!0});let c=(0,d.T)(a.isError,`${b}.isError`,{integer:!0}),e=(0,d.T)(a.fallbackUsed,`${b}.fallbackUsed`,{integer:!0});if(![0,1].includes(c)||![0,1].includes(e))throw Error(`invalid Prometheus routing request: ${b}`);return a}},16276:(a,b,c)=>{"use strict";c.d(b,{v:()=>e});var d=c(46248);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;return"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto"),e}}},16537:(a,b,c)=>{"use strict";let d=c(34589),{asciiLowercase:e,forgivingBase64:f,collectASequenceOfCodePoints:g,collectASequenceOfCodePointsFast:h,isomorphicDecode:i,removeASCIIWhitespace:j,removeChars:k}=c(70745),l=new TextEncoder,m=/^[-!#$%&'*+.^_`|~A-Za-z0-9]+$/u,n=/[\u000A\u000D\u0009\u0020]/u,o=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function p(a,b=!1){if(!b)return a.href;let c=a.href,d=a.hash.length,e=0===d?c:c.substring(0,c.length-d);return!d&&c.endsWith("#")?e.slice(0,-1):e}function q(a){return function(a){let b=a.length,c=new Uint8Array(b),d=0,e=0;for(;e<b;){let b=a[e];37!==b?c[d++]=b:37!==b||r(a[e+1])&&r(a[e+2])?(c[d++]=s(a[e+1])<<4|s(a[e+2]),e+=2):c[d++]=37,++e}return b===d?c:c.subarray(0,d)}(l.encode(a))}function r(a){return a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102}function s(a){return a>=48&&a<=57?a-48:(223&a)-55}function t(a){a=w(a,!0,!0);let b={position:0},c=h("/",a,b);if(0===c.length||!m.test(c)||b.position>=a.length)return"failure";b.position++;let d=h(";",a,b);if(0===(d=w(d,!1,!0)).length||!m.test(d))return"failure";let f=e(c),i=e(d),j={type:f,subtype:i,parameters:new Map,essence:`${f}/${i}`};for(;b.position<a.length;){b.position++,g(a=>n.test(a),a,b);let c=g(a=>";"!==a&&"="!==a,a,b);if(c=e(c),b.position<a.length){if(";"===a[b.position])continue;b.position++}if(b.position>=a.length)break;let d=null;if('"'===a[b.position])d=u(a,b,!0),h(";",a,b);else if(0===(d=w(d=h(";",a,b),!1,!0)).length)continue;0!==c.length&&m.test(c)&&(0===d.length||o.test(d))&&!j.parameters.has(c)&&j.parameters.set(c,d)}return j}function u(a,b,c=!1){let e=b.position,f="";for(d('"'===a[b.position]),b.position++;f+=g(a=>'"'!==a&&"\\"!==a,a,b),!(b.position>=a.length);){let c=a[b.position];if(b.position++,"\\"===c){if(b.position>=a.length){f+="\\";break}f+=a[b.position],b.position++}else{d('"'===c);break}}return c?f:a.slice(e,b.position)}function v(a){return 13===a||10===a||9===a||32===a}function w(a,b=!0,c=!0){return k(a,b,c,v)}a.exports={dataURLProcessor:function(a){d("data:"===a.protocol);let b=p(a,!0);b=b.slice(5);let c={position:0},e=h(",",b,c),g=e.length;if(e=j(e,!0,!0),c.position>=b.length)return"failure";c.position++;let k=q(b.slice(g+1));if(/;\u0020*[Bb][Aa][Ss][Ee]64$/u.test(e)){if("failure"===(k=f(i(k))))return"failure";e=(e=(e=e.slice(0,-6)).replace(/(\u0020+)$/u,"")).slice(0,-1)}e.startsWith(";")&&(e="text/plain"+e);let l=t(e);return"failure"===l&&(l=t("text/plain;charset=US-ASCII")),{mimeType:l,body:k}},URLSerializer:p,stringPercentDecode:q,parseMIMEType:t,collectAnHTTPQuotedString:u,serializeAMimeType:function(a){d("failure"!==a);let{parameters:b,essence:c}=a,e=c;for(let[a,c]of b.entries())e+=";",e+=a,e+="=",m.test(c)||(c='"'+(c=c.replace(/[\\"]/ug,"\\$&"))+'"'),e+=c;return e},removeHTTPWhitespace:w,minimizeSupportedMimeType:function(a){switch(a.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return a.subtype.endsWith("+json")?"application/json":a.subtype.endsWith("+xml")?"application/xml":""},HTTP_TOKEN_CODEPOINTS:m}},16542:(a,b,c)=>{"use strict";c.d(b,{r:()=>h});var d=c(55511),e=c(22256),f=c(38421),g=c(96997);class h extends e.Hv{constructor(){super("iflow",f.xq.iflow)}async refreshCredentials(a,b){if(!a?.refreshToken)return null;let c=await (0,g.AH)(a.refreshToken,b);return c?.accessToken?{accessToken:c.accessToken,refreshToken:c.refreshToken||a.refreshToken,expiresAt:c.expiresAt,expiresIn:c.expiresIn}:null}generateUUID(){return d.randomUUID()}createIFlowSignature(a,b,c,e){if(!e)return"";let f=`${a}:${b}:${c}`,g=d.createHmac("sha256",e);return g.update(f),g.digest("hex")}buildHeaders(a,b=!0){let c=`session-${this.generateUUID()}`,d=Date.now(),e=this.config.headers["User-Agent"]||"iFlow-Cli",f=a.apiKey||a.accessToken||"",g=this.createIFlowSignature(e,c,d,f),h={"Content-Type":"application/json",...this.config.headers,"session-id":c,"x-iflow-timestamp":d.toString(),"x-iflow-signature":g},i=a.apiKey||a.accessToken;return i&&(h.Authorization=`Bearer ${i}`),b&&(h.Accept="text/event-stream"),h}buildUrl(a,b,c=0,d=null){return this.config.baseUrl}transformRequest(a,b,c,d){return c&&b.messages&&!b.stream_options&&(b.stream_options={include_usage:!0}),b}}},16712:(a,b,c)=>{"use strict";let d=c(34589),{AsyncResource:e}=c(16698),{Readable:f}=c(1712),{InvalidArgumentError:g,RequestAbortedError:h}=c(61448),i=c(84285);function j(){}class k extends e{constructor(a,b){if(!a||"object"!=typeof a)throw new g("invalid opts");const{signal:c,method:d,opaque:e,body:f,onInfo:k,responseHeaders:l,highWaterMark:m}=a;try{if("function"!=typeof b)throw new g("invalid callback");if(null!=m&&(!Number.isFinite(m)||m<0))throw new g("invalid highWaterMark");if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new g("signal must be an EventEmitter or EventTarget");if("CONNECT"===d)throw new g("invalid method");if(k&&"function"!=typeof k)throw new g("invalid onInfo callback");super("UNDICI_REQUEST")}catch(a){throw i.isStream(f)&&i.destroy(f.on("error",j),a),a}this.method=d,this.responseHeaders=l||null,this.opaque=e||null,this.callback=b,this.res=null,this.abort=null,this.body=f,this.trailers={},this.context=null,this.controller=null,this.onInfo=k||null,this.highWaterMark=m,this.reason=null,this.removeAbortListener=null,c?.aborted?this.reason=c.reason??new h:c&&(this.removeAbortListener=i.addAbortListener(c,()=>{if(this.reason=c.reason??new h,this.res){let a=this.res;this.res=null,i.destroy(a.on("error",j),this.reason)}else this.abort&&this.abort(this.reason)}))}onRequestStart(a,b){this.reason?a.abort(this.reason):(d(this.callback),this.controller=a,this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){let{callback:e,opaque:g,context:h,responseHeaders:k,highWaterMark:l}=this,m=a?.rawHeaders,n="raw"===k?i.parseRawHeaders(m):c;if(b<200){this.onInfo&&this.onInfo({statusCode:b,headers:n});return}let o=c?.["content-type"],p=c?.["content-length"],q=new f({resume:()=>a.resume(),abort:b=>a.abort(b),contentType:o,contentLength:"HEAD"!==this.method&&p?Number(p):null,highWaterMark:l});if(this.removeAbortListener&&(q.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=q,null!==e)try{this.runInAsyncScope(e,null,null,{statusCode:b,statusText:d,headers:n,trailers:this.trailers,opaque:g,body:q,context:h})}catch(a){this.res=null,i.destroy(q.on("error",j),a),queueMicrotask(()=>{throw a})}}onResponseData(a,b){this.res&&!1===this.res.push(b)&&a.pause()}onResponseEnd(a,b){if(b&&"object"==typeof b)for(let a of Object.keys(b))"__proto__"===a?Object.defineProperty(this.trailers,a,{value:b[a],enumerable:!0,configurable:!0,writable:!0}):this.trailers[a]=b[a];this.res?.push(null)}onResponseError(a,b){let{res:c,callback:d,body:e,opaque:f}=this;d&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(d,null,b,{opaque:f})})),c&&(this.res=null,queueMicrotask(()=>{i.destroy(c.on("error",j),b)})),e&&(this.body=null,i.isStream(e)&&(e.on("error",j),i.destroy(e,b))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}}a.exports=function a(b,c){if(void 0===c)return new Promise((c,d)=>{a.call(this,b,(a,b)=>a?d(a):c(b))});try{let a=new k(b,c);this.dispatch(b,a)}catch(d){if("function"!=typeof c)throw d;let a=b?.opaque;queueMicrotask(()=>c(d,{opaque:a}))}},a.exports.RequestHandler=k},17438:(a,b,c)=>{"use strict";c.d(b,{GU:()=>j,HP:()=>o,Hr:()=>l,Kx:()=>i,dC:()=>n,d_:()=>p,f8:()=>m,mt:()=>h,oC:()=>g,p3:()=>k,qd:()=>f});let d=async()=>{},e={getSettings:async()=>({}),loadProviderQuotaState:null,saveProviderQuotaState:null,trackPendingRequest:()=>{},appendRequestLog:d,saveRequestDetail:d,saveRequestUsage:d,getRoutingEvents:async()=>[],getClusterWorkerStats:async()=>({}),getPromotedLearningVersion:async()=>null,createLearningVersion:d,countRoutingEvents:async()=>0,listCombosWithRoutingEvents:async()=>[],getLastScheduledLearnAt:async()=>null,getClusterLatencyP50:async()=>null,getComboModels:async()=>null,putVaultEntry:async()=>!1,searchVault:async()=>[],getVaultEntry:async()=>null,cleanupExpiredVault:async()=>0,buildExternalIdpRefreshParams:null,createXaiService:null,fetchKiroProfileArn:null};function f(a={}){return e={...e,...a}}function g(){return e}async function h(...a){return e.getSettings?e.getSettings(...a):{}}async function i(...a){return e.getRoutingEvents(...a)}async function j(...a){return e.getClusterWorkerStats(...a)}async function k(...a){return e.getPromotedLearningVersion(...a)}async function l(...a){return e.createLearningVersion(...a)}async function m(...a){return e.countRoutingEvents(...a)}async function n(...a){return e.listCombosWithRoutingEvents(...a)}async function o(...a){return e.getLastScheduledLearnAt(...a)}async function p(...a){return e.getComboModels(...a)}},18101:(a,b,c)=>{"use strict";c.d(b,{tV:()=>e,v8:()=>g});var d=c(68531);function e(a,b=null){if(!a)return null;let c=a.trim();if(b===d.h.OLLAMA||c.startsWith("{")&&!c.startsWith("data:")){if(c.startsWith("{"))try{return JSON.parse(c)}catch(a){return null}if(b===d.h.OLLAMA)return null}if(c.startsWith("data:")){let a=c.split("\n").map(a=>{let b=a.trim();return b.startsWith("data:")?b.slice(5).replace(/^ /,""):b}).join("\n").trim();if("[DONE]"===a)return{done:!0};try{return JSON.parse(a)}catch(b){a.length>0&&a.length<1e3&&console.log(`[WARN] Failed to parse SSE line (${a.length} chars): ${a.substring(0,100)}...`)}}return null}function f(a){if(!a||"object"!=typeof a||Array.isArray(a))return a;let b=a;if("usage"in b){if(null===b.usage){let{usage:a,...c}=b;b=c}else if("object"==typeof b.usage&&null===b.usage.perf_metrics){let{perf_metrics:a,...c}=b.usage;b={...b,usage:c}}}if(b.response&&"object"==typeof b.response&&!Array.isArray(b.response)){let a=f(b.response);a!==b.response&&(b={...b,response:a})}return b}function g(a,b){if(null==a)return"data: null\n\n";if(a&&a.done)return"data: [DONE]\n\n";if(a&&a.event&&a.data){let b=f(a.data);return`event: ${a.event}
|
|
29
|
+
cost = cost + excluded.cost`,[c.requests,c.promptTokens,c.completionTokens,c.cachedTokens,c.cost]),a.run("DELETE FROM prometheusUsageTotals WHERE provider = ?",[b])})}},15873:(a,b,c)=>{var d=c(45654);c(63070),c(76632),c(36105),c(56416),c(20308),c(29984),c(10401),c(4554),c(33889),c(65737);var e=d.asn1,f=d.pki,g=a.exports=d.pkcs12=d.pkcs12||{},h={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},i={name:"PFX",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},h,{name:"PFX.macData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:e.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},j={name:"SafeBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},k={name:"Attribute",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,capture:"values"}]},l={name:"CertBag",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:e.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:e.Class.UNIVERSAL,type:e.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function m(a,b,c,d){for(var e=[],f=0;f<a.length;f++)for(var g=0;g<a[f].safeBags.length;g++){var h=a[f].safeBags[g];if(void 0===d||h.type===d){if(null===b){e.push(h);continue}void 0!==h.attributes[b]&&h.attributes[b].indexOf(c)>=0&&e.push(h)}}return e}function n(a){if(a.composed||a.constructed){for(var b=d.util.createBuffer(),c=0;c<a.value.length;++c)b.putBytes(a.value[c].value);a.composed=a.constructed=!1,a.value=b.getBytes()}return a}g.pkcs12FromAsn1=function(a,b,c){"string"==typeof b?(c=b,b=!0):void 0===b&&(b=!0);var o={};if(!e.validate(a,i,o,[])){var p=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw p.errors=p,p}var q={version:o.version.charCodeAt(0),safeContents:[],getBags:function(a){var b,c={};return"localKeyId"in a?b=a.localKeyId:"localKeyIdHex"in a&&(b=d.util.hexToBytes(a.localKeyIdHex)),void 0===b&&!("friendlyName"in a)&&"bagType"in a&&(c[a.bagType]=m(q.safeContents,null,null,a.bagType)),void 0!==b&&(c.localKeyId=m(q.safeContents,"localKeyId",b,a.bagType)),"friendlyName"in a&&(c.friendlyName=m(q.safeContents,"friendlyName",a.friendlyName,a.bagType)),c},getBagsByFriendlyName:function(a,b){return m(q.safeContents,"friendlyName",a,b)},getBagsByLocalKeyId:function(a,b){return m(q.safeContents,"localKeyId",a,b)}};if(3!==o.version.charCodeAt(0)){var p=Error("PKCS#12 PFX of version other than 3 not supported.");throw p.version=o.version.charCodeAt(0),p}if(e.derToOid(o.contentType)!==f.oids.data){var p=Error("Only PKCS#12 PFX in password integrity mode supported.");throw p.oid=e.derToOid(o.contentType),p}var r=o.content.value[0];if(r.tagClass!==e.Class.UNIVERSAL||r.type!==e.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(r=n(r),o.mac){var s=null,t=0,u=e.derToOid(o.macAlgorithm);switch(u){case f.oids.sha1:s=d.md.sha1.create(),t=20;break;case f.oids.sha256:s=d.md.sha256.create(),t=32;break;case f.oids.sha384:s=d.md.sha384.create(),t=48;break;case f.oids.sha512:s=d.md.sha512.create(),t=64;break;case f.oids.md5:s=d.md.md5.create(),t=16}if(null===s)throw Error("PKCS#12 uses unsupported MAC algorithm: "+u);var v=new d.util.ByteBuffer(o.macSalt),w="macIterations"in o?parseInt(d.util.bytesToHex(o.macIterations),16):1,x=g.generateKey(c,v,3,w,t,s),y=d.hmac.create();if(y.start(s,x),y.update(r.value),y.getMac().getBytes()!==o.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(a.value)&&a.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not validated.");return function(a,b,c,g){if((b=e.fromDer(b,c)).tagClass!==e.Class.UNIVERSAL||b.type!==e.Type.SEQUENCE||!0!==b.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var i=0;i<b.value.length;i++){var m=b.value[i],o={},p=[];if(!e.validate(m,h,o,p)){var q=Error("Cannot read ContentInfo.");throw q.errors=p,q}var r={encrypted:!1},s=null,t=o.content.value[0];switch(e.derToOid(o.contentType)){case f.oids.data:if(t.tagClass!==e.Class.UNIVERSAL||t.type!==e.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");s=n(t).value;break;case f.oids.encryptedData:s=function(a,b){var c={},g=[];if(!e.validate(a,d.pkcs7.asn1.encryptedDataValidator,c,g)){var h=Error("Cannot read EncryptedContentInfo.");throw h.errors=g,h}var i=e.derToOid(c.contentType);if(i!==f.oids.data){var h=Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw h.oid=i,h}i=e.derToOid(c.encAlgorithm);var j=f.pbe.getCipher(i,c.encParameter,b),k=n(c.encryptedContentAsn1),l=d.util.createBuffer(k.value);if(j.update(l),!j.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");return j.output.getBytes()}(t,g),r.encrypted=!0;break;default:var q=Error("Unsupported PKCS#12 contentType.");throw q.contentType=e.derToOid(o.contentType),q}r.safeBags=function(a,b,c){if(!b&&0===a.length)return[];if((a=e.fromDer(a,b)).tagClass!==e.Class.UNIVERSAL||a.type!==e.Type.SEQUENCE||!0!==a.constructed)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var d=[],g=0;g<a.value.length;g++){var h,i,m=a.value[g],n={},o=[];if(!e.validate(m,j,n,o)){var p=Error("Cannot read SafeBag.");throw p.errors=o,p}var q={type:e.derToOid(n.bagId),attributes:function(a){var b={};if(void 0!==a)for(var c=0;c<a.length;++c){var d={},g=[];if(!e.validate(a[c],k,d,g)){var h=Error("Cannot read PKCS#12 BagAttribute.");throw h.errors=g,h}var i=e.derToOid(d.oid);if(void 0!==f.oids[i]){b[f.oids[i]]=[];for(var j=0;j<d.values.length;++j)b[f.oids[i]].push(d.values[j].value)}}return b}(n.bagAttributes)};d.push(q);var r=n.bagValue.value[0];switch(q.type){case f.oids.pkcs8ShroudedKeyBag:if(null===(r=f.decryptPrivateKeyInfo(r,c)))throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case f.oids.keyBag:try{q.key=f.privateKeyFromAsn1(r)}catch(a){q.key=null,q.asn1=r}continue;case f.oids.certBag:h=l,i=function(){if(e.derToOid(n.certId)!==f.oids.x509Certificate){var a=Error("Unsupported certificate type, only X.509 supported.");throw a.oid=e.derToOid(n.certId),a}var c=e.fromDer(n.cert,b);try{q.cert=f.certificateFromAsn1(c,!0)}catch(a){q.cert=null,q.asn1=c}};break;default:var p=Error("Unsupported PKCS#12 SafeBag type.");throw p.oid=q.type,p}if(void 0!==h&&!e.validate(r,h,n,o)){var p=Error("Cannot read PKCS#12 "+h.name);throw p.errors=o,p}i()}return d}(s,c,g),a.safeContents.push(r)}}(q,r.value,b,c),q},g.toPkcs12Asn1=function(a,b,c,h){(h=h||{}).saltSize=h.saltSize||8,h.count=h.count||2048,h.algorithm=h.algorithm||h.encAlgorithm||"aes128","useMac"in h||(h.useMac=!0),"localKeyId"in h||(h.localKeyId=null),"generateLocalKeyId"in h||(h.generateLocalKeyId=!0);var i,j,k=h.localKeyId;if(null!==k)k=d.util.hexToBytes(k);else if(h.generateLocalKeyId)if(b){var l=d.util.isArray(b)?b[0]:b;"string"==typeof l&&(l=f.certificateFromPem(l));var m=d.md.sha1.create();m.update(e.toDer(f.certificateToAsn1(l)).getBytes()),k=m.digest().getBytes()}else k=d.random.getBytes(20);var n=[];null!==k&&n.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.localKeyId).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,k)])])),"friendlyName"in h&&n.push(e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.friendlyName).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.BMPSTRING,!1,h.friendlyName)])])),n.length>0&&(i=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,n));var o=[],p=[];null!==b&&(p=d.util.isArray(b)?b:[b]);for(var q=[],r=0;r<p.length;++r){"string"==typeof(b=p[r])&&(b=f.certificateFromPem(b));var s=0===r?i:void 0,t=f.certificateToAsn1(b),u=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.certBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.x509Certificate).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(t).getBytes())])])]),s]);q.push(u)}if(q.length>0){var v=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,q),w=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(v).getBytes())])]);o.push(w)}var x=null;if(null!==a){var y=f.wrapRsaPrivateKey(f.privateKeyToAsn1(a));x=null===c?e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.keyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[y]),i]):e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.pkcs8ShroudedKeyBag).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[f.encryptPrivateKeyInfo(y,c,h)]),i]);var z=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[x]),A=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(z).getBytes())])]);o.push(A)}var B=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,o);if(h.useMac){var m=d.md.sha1.create(),C=new d.util.ByteBuffer(d.random.getBytes(h.saltSize)),D=h.count,a=g.generateKey(c,C,3,D,20),E=d.hmac.create();E.start(m,a),E.update(e.toDer(B).getBytes());var F=E.getMac();j=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.sha1).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,F.getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,C.getBytes()),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(D).getBytes())])}return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(3).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(f.oids.data).getBytes()),e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,e.toDer(B).getBytes())])]),j])},g.generateKey=d.pbe.generatePkcs12Key},15904:(a,b,c)=>{"use strict";c.d(b,{BO:()=>m,Bq:()=>k,Kd:()=>l,SQ:()=>n});var d=c(77397);let e=["requests","promptTokens","completionTokens","cachedTokens"],f=["requests","errors","fallbacks"],g=new WeakMap;function h(a,b){let c=g.get(a);if(c||(c=new Map,g.set(a,c)),c.has(b))return c.get(b);let d=!!a.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",[b]);return c.set(b,d),d}let i=new WeakMap;function j(a){i.delete(a),h(a,"prometheusMetricState")&&a.run("UPDATE prometheusMetricState SET available = 0 WHERE id = 1")}function k(a,b){if(!function(a){let b=Date.now(),c=i.get(a);if(c&&c.expiresAt>b)return c.value;let e=function(a){if(!h(a,"prometheusMetricState"))return!1;let b=a.get("SELECT available FROM prometheusMetricState WHERE id = 1");try{let a=(0,d.T)(b?.available,"metricState.available",{integer:!0});if(![0,1].includes(a))throw Error("invalid Prometheus metric state");return 1===a}catch{return j(a),!1}}(a);return i.set(a,{value:e,expiresAt:b+5e3}),e}(a))return!1;try{return a.transaction(b),!0}catch{return j(a),!1}}function l(a,b=a?.provider||"usage"){if(!a||"string"!=typeof a.provider||!a.provider)throw Error(`invalid Prometheus usage metric: ${b}.provider`);for(let c of e)(0,d.T)(a[c],`${b}.${c}`,{integer:!0});return(0,d.T)(a.cost,`${b}.cost`),a}function m(a,b=a?.source||"routing"){if(!a||"string"!=typeof a.source||!a.source)throw Error(`invalid Prometheus routing metric: ${b}.source`);for(let c of f)(0,d.T)(a[c],`${b}.${c}`,{integer:!0});return a}function n(a,b=a?.requestKey||"routingRequest"){if(!a||"string"!=typeof a.source||!a.source)throw Error(`invalid Prometheus routing request: ${b}.source`);(0,d.T)(a.terminalId,`${b}.terminalId`,{integer:!0});let c=(0,d.T)(a.isError,`${b}.isError`,{integer:!0}),e=(0,d.T)(a.fallbackUsed,`${b}.fallbackUsed`,{integer:!0});if(![0,1].includes(c)||![0,1].includes(e))throw Error(`invalid Prometheus routing request: ${b}`);return a}},16276:(a,b,c)=>{"use strict";c.d(b,{v:()=>e});var d=c(46248);class e extends d.L{constructor(){super("codebuddy-cn")}transformRequest(a,b,c,d){let e=super.transformRequest(a,b,c,d);e.stream=!0;let f=e.reasoning_effort;return"none"===f||"off"===f?delete e.reasoning_effort:f&&(e.reasoning_summary="auto"),e}}},16537:(a,b,c)=>{"use strict";let d=c(34589),{asciiLowercase:e,forgivingBase64:f,collectASequenceOfCodePoints:g,collectASequenceOfCodePointsFast:h,isomorphicDecode:i,removeASCIIWhitespace:j,removeChars:k}=c(70745),l=new TextEncoder,m=/^[-!#$%&'*+.^_`|~A-Za-z0-9]+$/u,n=/[\u000A\u000D\u0009\u0020]/u,o=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function p(a,b=!1){if(!b)return a.href;let c=a.href,d=a.hash.length,e=0===d?c:c.substring(0,c.length-d);return!d&&c.endsWith("#")?e.slice(0,-1):e}function q(a){return function(a){let b=a.length,c=new Uint8Array(b),d=0,e=0;for(;e<b;){let b=a[e];37!==b?c[d++]=b:37!==b||r(a[e+1])&&r(a[e+2])?(c[d++]=s(a[e+1])<<4|s(a[e+2]),e+=2):c[d++]=37,++e}return b===d?c:c.subarray(0,d)}(l.encode(a))}function r(a){return a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102}function s(a){return a>=48&&a<=57?a-48:(223&a)-55}function t(a){a=w(a,!0,!0);let b={position:0},c=h("/",a,b);if(0===c.length||!m.test(c)||b.position>=a.length)return"failure";b.position++;let d=h(";",a,b);if(0===(d=w(d,!1,!0)).length||!m.test(d))return"failure";let f=e(c),i=e(d),j={type:f,subtype:i,parameters:new Map,essence:`${f}/${i}`};for(;b.position<a.length;){b.position++,g(a=>n.test(a),a,b);let c=g(a=>";"!==a&&"="!==a,a,b);if(c=e(c),b.position<a.length){if(";"===a[b.position])continue;b.position++}if(b.position>=a.length)break;let d=null;if('"'===a[b.position])d=u(a,b,!0),h(";",a,b);else if(0===(d=w(d=h(";",a,b),!1,!0)).length)continue;0!==c.length&&m.test(c)&&(0===d.length||o.test(d))&&!j.parameters.has(c)&&j.parameters.set(c,d)}return j}function u(a,b,c=!1){let e=b.position,f="";for(d('"'===a[b.position]),b.position++;f+=g(a=>'"'!==a&&"\\"!==a,a,b),!(b.position>=a.length);){let c=a[b.position];if(b.position++,"\\"===c){if(b.position>=a.length){f+="\\";break}f+=a[b.position],b.position++}else{d('"'===c);break}}return c?f:a.slice(e,b.position)}function v(a){return 13===a||10===a||9===a||32===a}function w(a,b=!0,c=!0){return k(a,b,c,v)}a.exports={dataURLProcessor:function(a){d("data:"===a.protocol);let b=p(a,!0);b=b.slice(5);let c={position:0},e=h(",",b,c),g=e.length;if(e=j(e,!0,!0),c.position>=b.length)return"failure";c.position++;let k=q(b.slice(g+1));if(/;\u0020*[Bb][Aa][Ss][Ee]64$/u.test(e)){if("failure"===(k=f(i(k))))return"failure";e=(e=(e=e.slice(0,-6)).replace(/(\u0020+)$/u,"")).slice(0,-1)}e.startsWith(";")&&(e="text/plain"+e);let l=t(e);return"failure"===l&&(l=t("text/plain;charset=US-ASCII")),{mimeType:l,body:k}},URLSerializer:p,stringPercentDecode:q,parseMIMEType:t,collectAnHTTPQuotedString:u,serializeAMimeType:function(a){d("failure"!==a);let{parameters:b,essence:c}=a,e=c;for(let[a,c]of b.entries())e+=";",e+=a,e+="=",m.test(c)||(c='"'+(c=c.replace(/[\\"]/ug,"\\$&"))+'"'),e+=c;return e},removeHTTPWhitespace:w,minimizeSupportedMimeType:function(a){switch(a.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return a.subtype.endsWith("+json")?"application/json":a.subtype.endsWith("+xml")?"application/xml":""},HTTP_TOKEN_CODEPOINTS:m}},16542:(a,b,c)=>{"use strict";c.d(b,{r:()=>h});var d=c(55511),e=c(22256),f=c(38421),g=c(96997);class h extends e.Hv{constructor(){super("iflow",f.xq.iflow)}async refreshCredentials(a,b){if(!a?.refreshToken)return null;let c=await (0,g.AH)(a.refreshToken,b);return c?.accessToken?{accessToken:c.accessToken,refreshToken:c.refreshToken||a.refreshToken,expiresAt:c.expiresAt,expiresIn:c.expiresIn}:null}generateUUID(){return d.randomUUID()}createIFlowSignature(a,b,c,e){if(!e)return"";let f=`${a}:${b}:${c}`,g=d.createHmac("sha256",e);return g.update(f),g.digest("hex")}buildHeaders(a,b=!0){let c=`session-${this.generateUUID()}`,d=Date.now(),e=this.config.headers["User-Agent"]||"iFlow-Cli",f=a.apiKey||a.accessToken||"",g=this.createIFlowSignature(e,c,d,f),h={"Content-Type":"application/json",...this.config.headers,"session-id":c,"x-iflow-timestamp":d.toString(),"x-iflow-signature":g},i=a.apiKey||a.accessToken;return i&&(h.Authorization=`Bearer ${i}`),b&&(h.Accept="text/event-stream"),h}buildUrl(a,b,c=0,d=null){return this.config.baseUrl}transformRequest(a,b,c,d){return c&&b.messages&&!b.stream_options&&(b.stream_options={include_usage:!0}),b}}},16712:(a,b,c)=>{"use strict";let d=c(34589),{AsyncResource:e}=c(16698),{Readable:f}=c(1712),{InvalidArgumentError:g,RequestAbortedError:h}=c(61448),i=c(84285);function j(){}class k extends e{constructor(a,b){if(!a||"object"!=typeof a)throw new g("invalid opts");const{signal:c,method:d,opaque:e,body:f,onInfo:k,responseHeaders:l,highWaterMark:m}=a;try{if("function"!=typeof b)throw new g("invalid callback");if(null!=m&&(!Number.isFinite(m)||m<0))throw new g("invalid highWaterMark");if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new g("signal must be an EventEmitter or EventTarget");if("CONNECT"===d)throw new g("invalid method");if(k&&"function"!=typeof k)throw new g("invalid onInfo callback");super("UNDICI_REQUEST")}catch(a){throw i.isStream(f)&&i.destroy(f.on("error",j),a),a}this.method=d,this.responseHeaders=l||null,this.opaque=e||null,this.callback=b,this.res=null,this.abort=null,this.body=f,this.trailers={},this.context=null,this.controller=null,this.onInfo=k||null,this.highWaterMark=m,this.reason=null,this.removeAbortListener=null,c?.aborted?this.reason=c.reason??new h:c&&(this.removeAbortListener=i.addAbortListener(c,()=>{if(this.reason=c.reason??new h,this.res){let a=this.res;this.res=null,i.destroy(a.on("error",j),this.reason)}else this.abort&&this.abort(this.reason)}))}onRequestStart(a,b){this.reason?a.abort(this.reason):(d(this.callback),this.controller=a,this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){let{callback:e,opaque:g,context:h,responseHeaders:k,highWaterMark:l}=this,m=a?.rawHeaders,n="raw"===k?i.parseRawHeaders(m):c;if(b<200){this.onInfo&&this.onInfo({statusCode:b,headers:n});return}let o=c?.["content-type"],p=c?.["content-length"],q=new f({resume:()=>a.resume(),abort:b=>a.abort(b),contentType:o,contentLength:"HEAD"!==this.method&&p?Number(p):null,highWaterMark:l});if(this.removeAbortListener&&(q.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=q,null!==e)try{this.runInAsyncScope(e,null,null,{statusCode:b,statusText:d,headers:n,trailers:this.trailers,opaque:g,body:q,context:h})}catch(a){this.res=null,i.destroy(q.on("error",j),a),queueMicrotask(()=>{throw a})}}onResponseData(a,b){this.res&&!1===this.res.push(b)&&a.pause()}onResponseEnd(a,b){if(b&&"object"==typeof b)for(let a of Object.keys(b))"__proto__"===a?Object.defineProperty(this.trailers,a,{value:b[a],enumerable:!0,configurable:!0,writable:!0}):this.trailers[a]=b[a];this.res?.push(null)}onResponseError(a,b){let{res:c,callback:d,body:e,opaque:f}=this;d&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(d,null,b,{opaque:f})})),c&&(this.res=null,queueMicrotask(()=>{i.destroy(c.on("error",j),b)})),e&&(this.body=null,i.isStream(e)&&(e.on("error",j),i.destroy(e,b))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}}a.exports=function a(b,c){if(void 0===c)return new Promise((c,d)=>{a.call(this,b,(a,b)=>a?d(a):c(b))});try{let a=new k(b,c);this.dispatch(b,a)}catch(d){if("function"!=typeof c)throw d;let a=b?.opaque;queueMicrotask(()=>c(d,{opaque:a}))}},a.exports.RequestHandler=k},17438:(a,b,c)=>{"use strict";c.d(b,{GU:()=>j,HP:()=>o,Hr:()=>l,Kx:()=>i,dC:()=>n,d_:()=>p,f8:()=>m,mt:()=>h,oC:()=>g,p3:()=>k,qd:()=>f});let d=async()=>{},e={getSettings:async()=>({}),loadProviderQuotaState:null,saveProviderQuotaState:null,trackPendingRequest:()=>{},appendRequestLog:d,saveRequestDetail:d,saveRequestUsage:d,getRoutingEvents:async()=>[],getClusterWorkerStats:async()=>({}),getPromotedLearningVersion:async()=>null,createLearningVersion:d,countRoutingEvents:async()=>0,listCombosWithRoutingEvents:async()=>[],getLastScheduledLearnAt:async()=>null,getClusterLatencyP50:async()=>null,getComboModels:async()=>null,putVaultEntry:async()=>!1,searchVault:async()=>[],getVaultEntry:async()=>null,cleanupExpiredVault:async()=>0,buildExternalIdpRefreshParams:null,createXaiService:null,fetchKiroProfileArn:null};function f(a={}){return e={...e,...a}}function g(){return e}async function h(...a){return e.getSettings?e.getSettings(...a):{}}async function i(...a){return e.getRoutingEvents(...a)}async function j(...a){return e.getClusterWorkerStats(...a)}async function k(...a){return e.getPromotedLearningVersion(...a)}async function l(...a){return e.createLearningVersion(...a)}async function m(...a){return e.countRoutingEvents(...a)}async function n(...a){return e.listCombosWithRoutingEvents(...a)}async function o(...a){return e.getLastScheduledLearnAt(...a)}async function p(...a){return e.getComboModels(...a)}},17525:(a,b,c)=>{"use strict";c.d(b,{sS:()=>d}),c(49471),c(15251),c(71253);function d(a){if(!a||"object"!=typeof a)return null;let b=a.output_config?.effort;if("string"==typeof b&&b){let a=b.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let c=a.thinking;if(c&&"object"==typeof c){if("disabled"===c.type)return{mode:"none"};if("adaptive"===c.type||"enabled"===c.type){let a=Number(c.budget_tokens);return Number.isFinite(a)&&a>0?{mode:"budget",budget:a}:{mode:"auto"}}}let d=a.reasoning_effort??("object"==typeof a.reasoning?a.reasoning?.effort:null);if("string"==typeof d&&d){let a=d.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let e=a.thinkingConfig||a.generationConfig?.thinkingConfig||a.request?.generationConfig?.thinkingConfig;if(e&&"object"==typeof e){if("string"==typeof e.thinkingLevel)return{mode:"level",level:e.thinkingLevel.toLowerCase()};let a=Number(e.thinkingBudget);if(Number.isFinite(a))return 0===a?{mode:"none"}:a<0?{mode:"auto"}:{mode:"budget",budget:a}}if(!1===a.enable_thinking)return{mode:"none"};if(!0===a.enable_thinking){let b=Number(a.thinking_budget);return Number.isFinite(b)&&b>0?{mode:"budget",budget:b}:{mode:"auto"}}return null}c(26317)},18101:(a,b,c)=>{"use strict";c.d(b,{tV:()=>e,v8:()=>g});var d=c(68531);function e(a,b=null){if(!a)return null;let c=a.trim();if(b===d.h.OLLAMA||c.startsWith("{")&&!c.startsWith("data:")){if(c.startsWith("{"))try{return JSON.parse(c)}catch(a){return null}if(b===d.h.OLLAMA)return null}if(c.startsWith("data:")){let a=c.split("\n").map(a=>{let b=a.trim();return b.startsWith("data:")?b.slice(5).replace(/^ /,""):b}).join("\n").trim();if("[DONE]"===a)return{done:!0};try{return JSON.parse(a)}catch(b){a.length>0&&a.length<1e3&&console.log(`[WARN] Failed to parse SSE line (${a.length} chars): ${a.substring(0,100)}...`)}}return null}function f(a){if(!a||"object"!=typeof a||Array.isArray(a))return a;let b=a;if("usage"in b){if(null===b.usage){let{usage:a,...c}=b;b=c}else if("object"==typeof b.usage&&null===b.usage.perf_metrics){let{perf_metrics:a,...c}=b.usage;b={...b,usage:c}}}if(b.response&&"object"==typeof b.response&&!Array.isArray(b.response)){let a=f(b.response);a!==b.response&&(b={...b,response:a})}return b}function g(a,b){if(null==a)return"data: null\n\n";if(a&&a.done)return"data: [DONE]\n\n";if(a&&a.event&&a.data){let b=f(a.data);return`event: ${a.event}
|
|
30
30
|
data: ${JSON.stringify(b)}
|
|
31
31
|
|
|
32
32
|
`}return(a=f(a),b===d.h.CLAUDE&&a&&a.type)?`event: ${a.type}
|
|
@@ -178,7 +178,7 @@ ${e(g)}\r
|
|
|
178
178
|
\r
|
|
179
179
|
`);f.push(a,g,k),"number"==typeof g.size?i+=a.byteLength+g.size+k.byteLength:l=!0}let m=u.encode(`--${b}--\r
|
|
180
180
|
`);f.push(m),i+=m.byteLength,l&&(i=null),h=a,g=async function*(){for(let a of f)a.stream?yield*a.stream():yield a},n=`multipart/form-data; boundary=${b}`}else if(k.is.Blob(a))h=a,i=a.size,a.type&&(n=a.type);else if("function"==typeof a[Symbol.asyncIterator]){if(b)throw TypeError("keepalive");if(d.isDisturbed(a)||a.locked)throw TypeError("Response body object should not be disturbed or locked");c=k.is.ReadableStream(a)?a:ReadableStream.from(a).pipeThrough(new TransformStream({transform(a,b){let c=o(a)?a:Buffer.from(a);c.byteLength&&b.enqueue(c)}}))}return("string"==typeof h||o(h))&&(g=()=>(i="string"==typeof h?Buffer.byteLength(h):h.length,h)),null!=g&&(async()=>{let a=g(),b=a?.[Symbol.asyncIterator]?.();if(b)for await(let a of b){if(m(c))break;a.length&&f.enqueue(new Uint8Array(a))}else a?.length&&!m(c)&&f.enqueue("string"==typeof a?u.encode(a):new Uint8Array(a));queueMicrotask(()=>e(f))})(),[{stream:c,source:h,length:i},n]}function x(a,b,c,d){try{k.brandCheck(a,c)}catch(a){return Promise.reject(a)}if(y(a=d(a)))return Promise.reject(TypeError("Body is unusable: Body has already been read"));let e=Promise.withResolvers(),g=e.reject,h=a=>{try{e.resolve(b(a))}catch(a){g(a)}};return null==a.body?h(Buffer.allocUnsafe(0)):f(a.body,h,g),e.promise}function y(a){let b=a.body;return null!=b&&(b.stream.locked||d.isDisturbed(b.stream))}function z(a){let b=g(a.headersList);return"failure"===b?null:b}a.exports={extractBody:w,safelyExtractBody:function(a,b=!1){return k.is.ReadableStream(a)&&(l(!d.isDisturbed(a),"The body has already been consumed."),l(!a.locked,"The stream is locked.")),w(a,b)},cloneBody:function(a){let{0:b,1:c}=t?.(a.stream,!0)??a.stream.tee();return a.stream=b,{stream:c,length:a.length,source:a.source}},mixinBody:function(a,b,c){Object.assign(a.prototype,{blob(){return x(this,a=>{let c=z(b(this));return null===c?c="":c&&(c=p(c)),new Blob([a],{type:c})},c,b)},arrayBuffer(){return x(this,a=>new Uint8Array(a).buffer,c,b)},text(){return x(this,s,c,b)},json(){return x(this,r,c,b)},formData(){return x(this,a=>{let c=z(b(this));if(null!==c)switch(c.essence){case"multipart/form-data":{let b=q(a,c),d=new h;return i(d,b),d}case"application/x-www-form-urlencoded":{let b=new URLSearchParams(a.toString()),c=new h;for(let[a,d]of b)c.append(a,d);return c}}throw TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},c,b)},bytes(){return x(this,a=>new Uint8Array(a),c,b)},textStream(){let a=b(this);if(y(a))throw TypeError("Body is unusable: Body has already been read");if(null==a.body){let a,b=new ReadableStream({start:b=>{a=b},pull:()=>Promise.resolve(),cancel:()=>Promise.resolve()},{size:()=>1});return a.close(),b}let c=a.body.stream,d=new TextDecoderStream("UTF-8");return c.pipeThrough(d)}})},streamRegistry:new FinalizationRegistry(a=>{let b=a.deref();!b||b.locked||n(b)||m(b)||b.cancel("Response object has been garbage collected").catch(v)}),bodyUnusable:y}},35689:(a,b,c)=>{"use strict";let{PoolBase:d,kClients:e,kNeedDrain:f,kAddClient:g,kDrainQueue:h,kOnClientBusy:i,kOnClientDrain:j,kGetDispatcher:k,kHasDispatcher:l,kRemoveClient:m}=c(39065),n=c(40106),{InvalidArgumentError:o}=c(61448),p=c(84285),{kConnecting:q,kHTTPContext:r,kUrl:s}=c(49176),t=c(55285),u=Symbol("options"),v=Symbol("connections"),w=Symbol("factory"),x=Symbol("protocol"),y=Symbol("protocol probe");function z(a,b){return new n(a,b)}function A(a,b){return b instanceof n&&"h1"!==a[x]&&(!0===a[u].useH2c||"https:"===a[s].protocol&&!1!==a[u].allowH2)}function B(a){let b=a[w](a[s],a[u]);return A(a,b)&&(a[y]=b),a[g](b),b}class C extends d{constructor(a,{connections:b,factory:c=z,connect:d,connectTimeout:f,tls:g,maxCachedSessions:i,socketPath:j,autoSelectFamily:k,autoSelectFamilyAttemptTimeout:l,allowH2:m,useH2c:q,clientTtl:A,...B}={}){if(null!=b&&(!Number.isFinite(b)||b<0))throw new o("invalid connections");if("function"!=typeof c)throw new o("factory must be a function.");if(null!=d&&"function"!=typeof d&&"object"!=typeof d)throw new o("connect must be a function or an object");"function"!=typeof d&&(d=t({...g,maxCachedSessions:i,allowH2:m,useH2c:q,socketPath:j,timeout:f,..."boolean"==typeof k?{autoSelectFamily:k,autoSelectFamilyAttemptTimeout:l}:void 0,...d})),super(B),this[v]=b||null,this[s]=p.parseOrigin(a),this[u]={...p.deepClone(B),connect:d,allowH2:m,useH2c:q,clientTtl:A,socketPath:j},this[w]=c,this[x]=null,this[y]=null,this.on("connect",(a,b)=>{if(null!=A&&A>0)for(let a of b)Object.assign(a,{ttl:Date.now()});let c=b[b.length-1];c instanceof n&&(this[x]=c[r]?.version),c===this[y]&&"h2"!==this[x]&&(this[y]=null,this[h](a,b.slice(1)))}),this.on("disconnect",(a,b)=>{b.includes(this[y])&&(this[y]=null,this[h](a,b.slice(1)))}),this.on("connectionError",(a,b)=>{let c=!1;for(let a of b){a===this[y]&&(this[y]=null,c=!0);let b=this[e].indexOf(a);-1!==b&&this[e].splice(b,1)}c&&this[h](a,b.slice(1))})}[i](a){null===this[y]&&a[q]&&A(this,a)&&(this[y]=a)}[j](a){a===this[y]&&(this[y]=null)}[k](){let a=this[u].clientTtl;for(let b=0;b<this[e].length;b++){let c=this[e][b];if(null!=a&&a>0&&c.ttl&&Date.now()-c.ttl>a)this[m](c),b--;else if(!c[f])return c}if(null===this[y]&&(!this[v]||this[e].length<this[v]))return B(this)}[l](){let a=this[u].clientTtl;for(let b=0;b<this[e].length;b++){let c=this[e][b];if(null!=a&&a>0&&c.ttl&&Date.now()-c.ttl>a)this[m](c),b--;else if(!c[f])return!0}return null===this[y]&&(!this[v]||this[e].length<this[v])&&(B(this),!0)}}a.exports=C},36105:(a,b,c)=>{var d=c(45654);d.pki=d.pki||{};var e=a.exports=d.pki.oids=d.oids=d.oids||{};function f(a,b){e[a]=b,e[b]=a}f("1.2.840.113549.1.1.1","rsaEncryption"),f("1.2.840.113549.1.1.4","md5WithRSAEncryption"),f("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),f("1.2.840.113549.1.1.7","RSAES-OAEP"),f("1.2.840.113549.1.1.8","mgf1"),f("1.2.840.113549.1.1.9","pSpecified"),f("1.2.840.113549.1.1.10","RSASSA-PSS"),f("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),f("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),f("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),f("1.3.101.112","EdDSA25519"),f("1.2.840.10040.4.3","dsa-with-sha1"),f("1.3.14.3.2.7","desCBC"),f("1.3.14.3.2.26","sha1"),f("1.3.14.3.2.29","sha1WithRSASignature"),f("2.16.840.1.101.3.4.2.1","sha256"),f("2.16.840.1.101.3.4.2.2","sha384"),f("2.16.840.1.101.3.4.2.3","sha512"),f("2.16.840.1.101.3.4.2.4","sha224"),f("2.16.840.1.101.3.4.2.5","sha512-224"),f("2.16.840.1.101.3.4.2.6","sha512-256"),f("1.2.840.113549.2.2","md2"),f("1.2.840.113549.2.5","md5"),f("1.2.840.113549.1.7.1","data"),f("1.2.840.113549.1.7.2","signedData"),f("1.2.840.113549.1.7.3","envelopedData"),f("1.2.840.113549.1.7.4","signedAndEnvelopedData"),f("1.2.840.113549.1.7.5","digestedData"),f("1.2.840.113549.1.7.6","encryptedData"),f("1.2.840.113549.1.9.1","emailAddress"),f("1.2.840.113549.1.9.2","unstructuredName"),f("1.2.840.113549.1.9.3","contentType"),f("1.2.840.113549.1.9.4","messageDigest"),f("1.2.840.113549.1.9.5","signingTime"),f("1.2.840.113549.1.9.6","counterSignature"),f("1.2.840.113549.1.9.7","challengePassword"),f("1.2.840.113549.1.9.8","unstructuredAddress"),f("1.2.840.113549.1.9.14","extensionRequest"),f("1.2.840.113549.1.9.20","friendlyName"),f("1.2.840.113549.1.9.21","localKeyId"),f("1.2.840.113549.1.9.22.1","x509Certificate"),f("1.2.840.113549.1.12.10.1.1","keyBag"),f("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),f("1.2.840.113549.1.12.10.1.3","certBag"),f("1.2.840.113549.1.12.10.1.4","crlBag"),f("1.2.840.113549.1.12.10.1.5","secretBag"),f("1.2.840.113549.1.12.10.1.6","safeContentsBag"),f("1.2.840.113549.1.5.13","pkcs5PBES2"),f("1.2.840.113549.1.5.12","pkcs5PBKDF2"),f("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),f("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),f("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),f("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),f("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),f("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),f("1.2.840.113549.2.7","hmacWithSHA1"),f("1.2.840.113549.2.8","hmacWithSHA224"),f("1.2.840.113549.2.9","hmacWithSHA256"),f("1.2.840.113549.2.10","hmacWithSHA384"),f("1.2.840.113549.2.11","hmacWithSHA512"),f("1.2.840.113549.3.7","des-EDE3-CBC"),f("2.16.840.1.101.3.4.1.2","aes128-CBC"),f("2.16.840.1.101.3.4.1.22","aes192-CBC"),f("2.16.840.1.101.3.4.1.42","aes256-CBC"),f("2.5.4.3","commonName"),f("2.5.4.4","surname"),f("2.5.4.5","serialNumber"),f("2.5.4.6","countryName"),f("2.5.4.7","localityName"),f("2.5.4.8","stateOrProvinceName"),f("2.5.4.9","streetAddress"),f("2.5.4.10","organizationName"),f("2.5.4.11","organizationalUnitName"),f("2.5.4.12","title"),f("2.5.4.13","description"),f("2.5.4.15","businessCategory"),f("2.5.4.17","postalCode"),f("2.5.4.42","givenName"),f("2.5.4.65","pseudonym"),f("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),f("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),f("2.16.840.1.113730.1.1","nsCertType"),f("2.16.840.1.113730.1.13","nsComment"),e["2.5.29.1"]="authorityKeyIdentifier",e["2.5.29.2"]="keyAttributes",e["2.5.29.3"]="certificatePolicies",e["2.5.29.4"]="keyUsageRestriction",e["2.5.29.5"]="policyMapping",e["2.5.29.6"]="subtreesConstraint",e["2.5.29.7"]="subjectAltName",e["2.5.29.8"]="issuerAltName",e["2.5.29.9"]="subjectDirectoryAttributes",e["2.5.29.10"]="basicConstraints",e["2.5.29.11"]="nameConstraints",e["2.5.29.12"]="policyConstraints",e["2.5.29.13"]="basicConstraints",f("2.5.29.14","subjectKeyIdentifier"),f("2.5.29.15","keyUsage"),e["2.5.29.16"]="privateKeyUsagePeriod",f("2.5.29.17","subjectAltName"),f("2.5.29.18","issuerAltName"),f("2.5.29.19","basicConstraints"),e["2.5.29.20"]="cRLNumber",e["2.5.29.21"]="cRLReason",e["2.5.29.22"]="expirationDate",e["2.5.29.23"]="instructionCode",e["2.5.29.24"]="invalidityDate",e["2.5.29.25"]="cRLDistributionPoints",e["2.5.29.26"]="issuingDistributionPoint",e["2.5.29.27"]="deltaCRLIndicator",e["2.5.29.28"]="issuingDistributionPoint",e["2.5.29.29"]="certificateIssuer",e["2.5.29.30"]="nameConstraints",f("2.5.29.31","cRLDistributionPoints"),f("2.5.29.32","certificatePolicies"),e["2.5.29.33"]="policyMappings",e["2.5.29.34"]="policyConstraints",f("2.5.29.35","authorityKeyIdentifier"),e["2.5.29.36"]="policyConstraints",f("2.5.29.37","extKeyUsage"),e["2.5.29.46"]="freshestCRL",e["2.5.29.54"]="inhibitAnyPolicy",f("1.3.6.1.4.1.11129.2.4.2","timestampList"),f("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),f("1.3.6.1.5.5.7.3.1","serverAuth"),f("1.3.6.1.5.5.7.3.2","clientAuth"),f("1.3.6.1.5.5.7.3.3","codeSigning"),f("1.3.6.1.5.5.7.3.4","emailProtection"),f("1.3.6.1.5.5.7.3.8","timeStamping")},36649:(a,b,c)=>{"use strict";let{wellknownHeaderNames:d,headerNameLowerCasedRecord:e}=c(28820);class f{value=null;left=null;middle=null;right=null;code;constructor(a,b,c){if(void 0===c||c>=a.length)throw TypeError("Unreachable");if((this.code=a.charCodeAt(c))>127)throw TypeError("key must be ascii string");a.length!==++c?this.middle=new f(a,b,c):this.value=b}add(a,b){let c=a.length;if(0===c)throw TypeError("Unreachable");let d=0,e=this;for(;;){let g=a.charCodeAt(d);if(g>127)throw TypeError("key must be ascii string");if(e.code===g)if(c===++d){e.value=b;break}else if(null!==e.middle)e=e.middle;else{e.middle=new f(a,b,d);break}else if(e.code<g)if(null!==e.left)e=e.left;else{e.left=new f(a,b,d);break}else if(null!==e.right)e=e.right;else{e.right=new f(a,b,d);break}}}search(a){let b=a.length,c=0,d=this;for(;null!==d&&c<b;){let e=a[c];for(e<=90&&e>=65&&(e|=32);null!==d;){if(e===d.code){if(b===++c)return d;d=d.middle;break}d=d.code<e?d.left:d.right}}return null}}class g{node=null;insert(a,b){null===this.node?this.node=new f(a,b,0):this.node.add(a,b)}lookup(a){return this.node?.search(a)?.value??null}}let h=new g;for(let a=0;a<d.length;++a){let b=e[d[a]];h.insert(b,b)}a.exports={TernarySearchTree:g,tree:h}},36902:(a,b,c)=>{var d=c(45654);c(33889),c(32e3),c(29984),function(){if(d.prime){a.exports=d.prime;return}var b=a.exports=d.prime=d.prime||{},c=d.jsbn.BigInteger,e=[6,4,2,4,2,4,6,2],f=new c(null);f.fromInt(30);var g=function(a,b){return a|b};function h(a,b,c,f){var g,h=i(a,b),j=(g=h.bitLength())<=100?27:g<=150?18:g<=200?15:g<=250?12:g<=300?9:g<=350?8:g<=400?7:g<=500?6:g<=600?5:g<=800?4:g<=1250?3:2;"millerRabinTests"in c&&(j=c.millerRabinTests);var k=10;"maxBlockTime"in c&&(k=c.maxBlockTime),function a(b,c,f,g,h,j,k){var l=+new Date;do{if(b.bitLength()>c&&(b=i(c,f)),b.isProbablePrime(h))return k(null,b);b.dAddOffset(e[g++%8],0)}while(j<0||new Date-l<j);d.util.setImmediate(function(){a(b,c,f,g,h,j,k)})}(h,a,b,0,j,k,f)}function i(a,b){var d=new c(a,b),e=a-1;return d.testBit(e)||d.bitwiseTo(c.ONE.shiftLeft(e),g,d),d.dAddOffset(31-d.mod(f).byteValue(),0),d}b.generateProbablePrime=function(a,b,e){"function"==typeof b&&(e=b,b={});var f,g,j,k,l=(b=b||{}).algorithm||"PRIMEINC";"string"==typeof l&&(l={name:l}),l.options=l.options||{};var m=b.prng||d.random;if("PRIMEINC"===l.name){return f=a,g={nextBytes:function(a){for(var b=m.getBytesSync(a.length),c=0;c<a.length;++c)a[c]=b.charCodeAt(c)}},j=l.options,k=e,"workers"in j?function(a,b,e,f){if("u"<typeof Worker)return h(a,b,e,f);var g=i(a,b),j=e.workers,k=e.workLoad||100,l=30*k/8,m=e.workerScript||"forge/prime.worker.js";if(-1===j)return d.util.estimateCores(function(a,b){a&&(b=2),j=b-1,n()});function n(){j=Math.max(1,j);for(var d=[],e=0;e<j;++e)d[e]=new Worker(m);for(var h=j,e=0;e<j;++e)d[e].addEventListener("message",o);var n=!1;function o(e){if(!n){--h;var j=e.data;if(j.found){for(var m=0;m<d.length;++m)d[m].terminate();return n=!0,f(null,new c(j.prime,16))}g.bitLength()>a&&(g=i(a,b));var o=g.toString(16);e.target.postMessage({hex:o,workLoad:k}),g.dAddOffset(l,0)}}}n()}(f,g,j,k):h(f,g,j,k)}throw Error("Invalid prime generation algorithm: "+l.name)}}()},37417:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,MaxOriginsReachedError:e}=c(61448),{kBusy:f,kClients:g,kConnected:h,kRunning:i,kPending:j,kClose:k,kDestroy:l,kDispatch:m,kUrl:n}=c(49176),o=c(5318),p=c(35689),q=c(40106),r=c(84285),s=Symbol("onConnect"),t=Symbol("onDisconnect"),u=Symbol("onConnectionError"),v=Symbol("onDrain"),w=Symbol("factory"),x=Symbol("options"),y=Symbol("origins");function z(a,b){return b&&1===b.connections?new q(a,b):new p(a,b)}class A extends o{constructor({factory:a=z,maxOrigins:b=1/0,connect:c,...e}={}){if("function"!=typeof a)throw new d("factory must be a function.");if(null!=c&&"function"!=typeof c&&"object"!=typeof c)throw new d("connect must be a function or an object");if("number"!=typeof b||Number.isNaN(b)||b<=0)throw new d("maxOrigins must be a number greater than 0");super(e),c&&"function"!=typeof c&&(c={...c}),this[x]={...r.deepClone(e),maxOrigins:b,connect:c},this[w]=a,this[g]=new Map,this[y]=new Set,this[v]=(a,b)=>{this.emit("drain",a,[this,...b])},this[s]=(a,b)=>{this.emit("connect",a,[this,...b])},this[t]=(a,b,c)=>{this.emit("disconnect",a,[this,...b],c)},this[u]=(a,b,c)=>{this.emit("connectionError",a,[this,...b],c)}}get[i](){let a=0;for(let b of this[g].values())a+=b[i];return a}[m](a,b){let c;if(a.origin&&("string"==typeof a.origin||a.origin instanceof URL))c=String(a.origin);else throw new d("opts.origin must be a non-empty string or URL.");let i=a.allowH2??this[x].allowH2,k=!1===i?`${c}#http1-only`:c;if(this[y].size>=this[x].maxOrigins&&!this[y].has(c))throw new e;let l=this[g].get(k);if(!l){l=this[w](a.origin,!1===i?{...this[x],allowH2:!1}:this[x]);let b=()=>{if(this[g].get(k)!==l||l[h]>0||l[f]||l[j]>0)return;this[g].delete(k),l.destroyed||l.close();let a=!1;for(let b of this[g].keys())if(b===c||b===`${c}#http1-only`){a=!0;break}a||this[y].delete(c)};l.on("drain",this[v]).on("connect",this[s]).on("disconnect",(a,c,d)=>{b(),this[t](a,c,d)}).on("connectionError",(a,c,d)=>{b(),this[u](a,c,d)}),this[g].set(k,l),this[y].add(c)}return l.dispatch(a,b)}[k](){let a=[];for(let b of this[g].values())a.push(b.close());return this[g].clear(),Promise.all(a)}[l](a){let b=[];for(let c of this[g].values())b.push(c.destroy(a));return this[g].clear(),Promise.all(b)}get stats(){let a={};for(let b of this[g].values())b.stats&&(a[b[n].origin]=b.stats);return a}}a.exports=A},37436:(a,b,c)=>{"use strict";let d=c(29021),e=c(33873),f=c(21820),g="switchboard";function h(){return"win32"===process.platform?e.join(process.env.APPDATA||e.join(f.homedir(),"AppData","Roaming"),g):e.join(f.homedir(),`.${g}`)}let i=function(){let a=process.env.DATA_DIR;if(!a)return h();try{return d.mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${g}`),h();throw b}}(),j=e.join(i,"mitm");a.exports={DATA_DIR:i,MITM_DIR:j}},37606:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>A});var d=c(22256),e=c(38421),f=c(19016),g=c(24725),h=c(50969);let i=e.xq["perplexity-web"].baseUrl,j="2.18",k={"pplx-auto":["concise","pplx_pro"],"pplx-sonar":["copilot","experimental"],"pplx-gpt":["copilot","gpt54"],"pplx-gemini":["copilot","gemini31pro_high"],"pplx-sonnet":["copilot","claude46sonnet"],"pplx-opus":["copilot","claude46opus"],"pplx-nemotron":["copilot","nv_nemotron_3_super"]},l={"pplx-gpt":"gpt54_thinking","pplx-sonnet":"claude46sonnetthinking","pplx-opus":"claude46opusthinking"},m=/\[\d+\]/g,n=/<grok:[^>]*>.*?<\/grok:[^>]*>/gs,o=/<grok:[^>]*\/>/g,p=/<[?]xml[^?]*[?]>/g,q=/<\/?response\b[^>]*>/gi,r=/ {2,}/g,s=/\n{3,}/g,t=new Map;function u(a){let b=a.map(a=>`${a.role}:${a.content}`).join("\n"),c=0x811c9dc5;for(let a=0;a<b.length;a++)c^=b.charCodeAt(a),c=0x1000193*c>>>0;return c.toString(16).padStart(8,"0")}function v(a,b,c,d){if(!d)return;let e=u([...a,{role:"user",content:b},{role:"assistant",content:c}]);if(t.set(e,{backendUuid:d,ts:Date.now()}),t.size>200){let a=null,b=1/0;for(let[c,d]of t)d.ts<b&&(b=d.ts,a=c);a&&t.delete(a)}}function w(a,b=!0){let c=a;return c=(c=(c=(c=(c=c.replace(p,"")).replace(m,"")).replace(n,"")).replace(o,"")).replace(q,""),b&&(c=(c=(c=c.replace(r," ")).replace(s,"\n\n")).trim()),c}async function*x(a,b){let c=a.getReader(),d=new TextDecoder,e="",f=[];function g(){if(0===f.length)return null;let a=f.join("\n");f=[];let b=a.trim();if(!b||"[DONE]"===b)return"done";try{return JSON.parse(b)}catch{return null}}try{for(;;){if(b?.aborted)return;let{value:a,done:h}=await c.read();if(h)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a);e=e.slice(a+1);let c=b.endsWith("\r")?b.slice(0,-1):b;if(""===c){let a=g();if("done"===a)return;a&&(yield a);continue}if(c.startsWith("data:")&&f.push(c.slice(5).trimStart()),"event: end_of_stream"===c)return}}(e+=d.decode()).trim().startsWith("data:")&&f.push(e.trim().slice(5).trimStart());let a=g();a&&"done"!==a&&(yield a)}finally{c.releaseLock()}}async function*y(a,b){let c="",d=null,e=0,f=new Set;for await(let g of x(a,b)){if(g.error_code||g.error_message)return void(yield{error:g.error_message||`Perplexity error: ${g.error_code}`,done:!0});g.backend_uuid&&(d=g.backend_uuid);let a=g.blocks??[];for(let b of a){let a=b.intended_usage??"";if("pro_search_steps"===a&&b.plan_block?.steps){for(let a of b.plan_block.steps)if("SEARCH_WEB"===a.step_type)for(let b of a.search_web_content?.queries??[]){let a=b.query??"";a&&!f.has(a)&&(f.add(a),yield{thinking:`Searching: ${a}`,backendUuid:d??void 0})}else if("READ_RESULTS"===a.step_type)for(let b of(a.read_results_content?.urls??[]).slice(0,3))b&&!f.has(b)&&(f.add(b),yield{thinking:`Reading: ${b}`,backendUuid:d??void 0})}if("plan"===a&&b.plan_block?.goals)for(let a of b.plan_block.goals){let b=a.description??"";b&&!f.has(b)&&(f.add(b),yield{thinking:b,backendUuid:d??void 0})}if(!a.includes("markdown"))continue;let g=b.markdown_block;if(!g)continue;let h=g.chunks??[];if(0!==h.length)if("DONE"===g.progress)c=h.join("");else{let a=c+h.join("");if(a.length>e){let b=a.slice(e);c=a,e=a.length,yield{delta:b,answer:c,backendUuid:d??void 0}}}}if(0===a.length&&g.text){let a=g.text.trim();if(a.length>e){let b=a.slice(e);c=a,e=a.length,yield{delta:b,answer:c,backendUuid:d??void 0}}}if(g.final||"COMPLETED"===g.status)break}yield{delta:"",answer:c,backendUuid:d??void 0,done:!0}}async function z(a,b,c,d,e,f,g){let h="",i=null,j=[];for await(let b of y(a,g)){if(b.backendUuid&&(i=b.backendUuid),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"PPLX_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){j.push(b.thinking);continue}if(b.done){h=b.answer||h;break}b.answer&&(h=b.answer)}v(e,f,h=w(h),i);let k=j.length>0?j.join("\n"):void 0,l={role:"assistant",content:h};k&&(l.reasoning_content=k);let m=Math.ceil(f.length/4),n=Math.ceil(h.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:null,choices:[{index:0,message:l,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:m,completion_tokens:n,total_tokens:m+n}}),{status:200,headers:{"Content-Type":"application/json"}})}class A extends d.Hv{constructor(){super("perplexity-web",e.xq["perplexity-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:m,proxyOptions:n=null}){var o,p,q,r,s;let x,A,B,C,D,E=b?.messages;if(!E||!Array.isArray(E)||0===E.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};(b?.thinking===!0||b?.reasoning_effort!=null&&"none"!==b.reasoning_effort)&&l[a]?(x="copilot",A=l[a],m?.info?.("PPLX-WEB",`Thinking mode → ${a} using ${A}`)):k[a]?[x,A]=k[a]:(x="copilot",A=a,m?.info?.("PPLX-WEB",`Unmapped model ${a}, using as raw preference`));let F=function(a){let b="",c=[];for(let d of a){let a=String(d.role||"user");"developer"===a&&(a="system");let e="";"string"==typeof d.content?e=d.content:Array.isArray(d.content)&&(e=d.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),e.trim()&&("system"===a?b+=e+"\n":("user"===a||"assistant"===a)&&c.push({role:a,content:e}))}let d="";return c.length>0&&"user"===c[c.length-1].role&&(d=c.pop().content),{systemMsg:b,history:c,currentMsg:d}}(E),G=function(a){if(0===a.length)return null;let b=u(a),c=t.get(b);return c?Date.now()-c.ts>36e5?(t.delete(b),null):c.backendUuid:null}(F.history);G&&m?.info?.("PPLX-WEB",`Session continue: ${G.slice(0,12)}...`);let H=function(a,b,c){if(b)return a.currentMsg;let d={},e=[];a.systemMsg.trim()&&e.push(a.systemMsg.trim());let f=function(a){if(!Array.isArray(a)||0===a.length)return"";let b=a.map(a=>{let b=a?.function||a||{},c=b.name||"unnamed",d=(b.description||"").split("\n")[0].slice(0,200);return`- ${c}: ${d}`});return`Available tools (reference only, cannot invoke):
|
|
181
|
-
${b.join("\n")}`}(c);f&&e.push(f),e.push("You have built-in web search. Answer questions directly using search results."),d.instructions=e,a.history.length>0&&(d.history=a.history),a.currentMsg?d.query=a.currentMsg:0===a.history.length&&(d.query="");let g=JSON.stringify(d);return g.length>96e3?g.slice(-96e3):g}(F,G,b?.tools);if(!H.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};let I=(o=x,p=A,D="u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",{query_str:H,params:{query_str:H,search_focus:"internet",mode:o,model_preference:p,sources:["web"],attachments:[],frontend_uuid:crypto.randomUUID(),frontend_context_uuid:crypto.randomUUID(),version:j,language:"en-US",timezone:D,search_recency_filter:null,is_incognito:!0,use_schematized_api:!0,last_backend_uuid:G}}),J={"Content-Type":"application/json",Accept:"text/event-stream",Origin:"https://www.perplexity.ai",Referer:"https://www.perplexity.ai/","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","X-App-ApiClient":"default","X-App-ApiVersion":j};d.accessToken?J.Authorization=`Bearer ${d.accessToken}`:d.apiKey&&(J.Cookie=`__Secure-next-auth.session-token=${d.apiKey}`),m?.info?.("PPLX-WEB",`Query to ${a} (pref=${A}, mode=${x}), len=${H.length}`);let K={method:"POST",headers:J,body:JSON.stringify(I),identity:this.config.identity,provider:this.provider,format:this.config.format};e&&(K.signal=e);try{B=await (0,h.Fm)(i,K,n)}catch(a){return m?.error?.("PPLX-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Perplexity connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:J,transformedBody:I}}if(!B.ok){let a=B.status,b=`Perplexity returned HTTP ${a}`;return 401===a||403===a?b="Perplexity auth failed — session cookie may be expired. Re-paste your __Secure-next-auth.session-token.":429===a&&(b="Perplexity rate limited. Wait a moment and retry."),m?.warn?.("PPLX-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:i,headers:J,transformedBody:I}}if(!B.body)return{response:new Response(JSON.stringify({error:{message:"Perplexity returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:J,transformedBody:I};let L=`chatcmpl-pplx-${crypto.randomUUID().slice(0,12)}`,M=Math.floor(Date.now()/1e3);if(c){let b;C=new Response((q=B.body,r=F.history,s=F.currentMsg,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="",h=null;for await(let f of y(q,e)){if(f.backendUuid&&(h=f.backendUuid),f.error){c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{reasoning_content:f.thinking+"\n"},finish_reason:null,logprobs:null}]})));continue}if(f.done){d=f.answer||d;break}let e=f.delta||"";e&&(e=w(e,!1))&&c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:e},finish_reason:null,logprobs:null}]}))),f.answer&&(d=f.answer)}c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U)),v(r,s,w(d),h)}catch(d){c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else C=await z(B.body,a,L,M,F.history,F.currentMsg,e);return{response:C,url:i,headers:J,transformedBody:I}}}},37691:(a,b,c)=>{var d=c(45654);c(1277),c(33889);var e=a.exports=d.sha512=d.sha512||{};d.md.sha512=d.md.algorithms.sha512=e;var f=d.sha384=d.sha512.sha384=d.sha512.sha384||{};f.create=function(){return e.create("SHA-384")},d.md.sha384=d.md.algorithms.sha384=f,d.sha512.sha256=d.sha512.sha256||{create:function(){return e.create("SHA-512/256")}},d.md["sha512/256"]=d.md.algorithms["sha512/256"]=d.sha512.sha256,d.sha512.sha224=d.sha512.sha224||{create:function(){return e.create("SHA-512/224")}},d.md["sha512/224"]=d.md.algorithms["sha512/224"]=d.sha512.sha224,e.create=function(a){if(h||(g=String.fromCharCode(128)+d.util.fillString("\0",128),i=[[0x428a2f98,0xd728ae22],[0x71374491,0x23ef65cd],[0xb5c0fbcf,0xec4d3b2f],[0xe9b5dba5,0x8189dbbc],[0x3956c25b,0xf348b538],[0x59f111f1,0xb605d019],[0x923f82a4,0xaf194f9b],[0xab1c5ed5,0xda6d8118],[0xd807aa98,0xa3030242],[0x12835b01,0x45706fbe],[0x243185be,0x4ee4b28c],[0x550c7dc3,0xd5ffb4e2],[0x72be5d74,0xf27b896f],[0x80deb1fe,0x3b1696b1],[0x9bdc06a7,0x25c71235],[0xc19bf174,0xcf692694],[0xe49b69c1,0x9ef14ad2],[0xefbe4786,0x384f25e3],[0xfc19dc6,0x8b8cd5b5],[0x240ca1cc,0x77ac9c65],[0x2de92c6f,0x592b0275],[0x4a7484aa,0x6ea6e483],[0x5cb0a9dc,0xbd41fbd4],[0x76f988da,0x831153b5],[0x983e5152,0xee66dfab],[0xa831c66d,0x2db43210],[0xb00327c8,0x98fb213f],[0xbf597fc7,0xbeef0ee4],[0xc6e00bf3,0x3da88fc2],[0xd5a79147,0x930aa725],[0x6ca6351,0xe003826f],[0x14292967,0xa0e6e70],[0x27b70a85,0x46d22ffc],[0x2e1b2138,0x5c26c926],[0x4d2c6dfc,0x5ac42aed],[0x53380d13,0x9d95b3df],[0x650a7354,0x8baf63de],[0x766a0abb,0x3c77b2a8],[0x81c2c92e,0x47edaee6],[0x92722c85,0x1482353b],[0xa2bfe8a1,0x4cf10364],[0xa81a664b,0xbc423001],[0xc24b8b70,0xd0f89791],[0xc76c51a3,0x654be30],[0xd192e819,0xd6ef5218],[0xd6990624,0x5565a910],[0xf40e3585,0x5771202a],[0x106aa070,0x32bbd1b8],[0x19a4c116,0xb8d2d0c8],[0x1e376c08,0x5141ab53],[0x2748774c,0xdf8eeb99],[0x34b0bcb5,0xe19b48a8],[0x391c0cb3,0xc5c95a63],[0x4ed8aa4a,0xe3418acb],[0x5b9cca4f,0x7763e373],[0x682e6ff3,0xd6b2b8a3],[0x748f82ee,0x5defb2fc],[0x78a5636f,0x43172f60],[0x84c87814,0xa1f0ab72],[0x8cc70208,0x1a6439ec],[0x90befffa,0x23631e28],[0xa4506ceb,0xde82bde9],[0xbef9a3f7,0xb2c67915],[0xc67178f2,0xe372532b],[0xca273ece,0xea26619c],[0xd186b8c7,0x21c0c207],[0xeada7dd6,0xcde0eb1e],[0xf57d4f7f,0xee6ed178],[0x6f067aa,0x72176fba],[0xa637dc5,0xa2c898a6],[0x113f9804,0xbef90dae],[0x1b710b35,0x131c471b],[0x28db77f5,0x23047d84],[0x32caab7b,0x40c72493],[0x3c9ebe0a,0x15c9bebc],[0x431d67c4,0x9c100d4c],[0x4cc5d4be,0xcb3e42b6],[0x597f299c,0xfc657e2a],[0x5fcb6fab,0x3ad6faec],[0x6c44198c,0x4a475817]],(j={})["SHA-512"]=[[0x6a09e667,0xf3bcc908],[0xbb67ae85,0x84caa73b],[0x3c6ef372,0xfe94f82b],[0xa54ff53a,0x5f1d36f1],[0x510e527f,0xade682d1],[0x9b05688c,0x2b3e6c1f],[0x1f83d9ab,0xfb41bd6b],[0x5be0cd19,0x137e2179]],j["SHA-384"]=[[0xcbbb9d5d,0xc1059ed8],[0x629a292a,0x367cd507],[0x9159015a,0x3070dd17],[0x152fecd8,0xf70e5939],[0x67332667,0xffc00b31],[0x8eb44a87,0x68581511],[0xdb0c2e0d,0x64f98fa7],[0x47b5481d,0xbefa4fa4]],j["SHA-512/256"]=[[0x22312194,0xfc2bf72c],[0x9f555fa3,0xc84c64c2],[0x2393b86b,0x6f53b151],[0x96387719,0x5940eabd],[0x96283ee2,0xa88effe3],[0xbe5e1e25,0x53863992],[0x2b0199fc,0x2c85b8aa],[0xeb72ddc,0x81c52ca2]],j["SHA-512/224"]=[[0x8c3d37c8,0x19544da2],[0x73e19966,0x89dcd4d6],[0x1dfab7ae,0x32ff9c82],[0x679dd514,0x582f9fcf],[0xf6d2b69,0x7bd44da8],[0x77e36f73,0x4c48942],[0x3f9d85a8,0x6a1d36c8],[0x1112e6ad,0x91d692a1]],h=!0),void 0===a&&(a="SHA-512"),!(a in j))throw Error("Invalid SHA-512 algorithm: "+a);for(var b=j[a],c=null,e=d.util.createBuffer(),f=Array(80),l=0;l<80;++l)f[l]=[,,];var m=64;switch(a){case"SHA-384":m=48;break;case"SHA-512/256":m=32;break;case"SHA-512/224":m=28}var n={algorithm:a.replace("-","").toLowerCase(),blockLength:128,digestLength:m,messageLength:0,fullMessageLength:null,messageLengthSize:16};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength128=[];for(var a=n.messageLengthSize/4,f=0;f<a;++f)n.fullMessageLength.push(0);e=d.util.createBuffer(),c=Array(b.length);for(var f=0;f<b.length;++f)c[f]=b[f].slice(0);return n},n.start(),n.update=function(a,b){"utf8"===b&&(a=d.util.encodeUtf8(a));var g=a.length;n.messageLength+=g,g=[g/0x100000000>>>0,g>>>0];for(var h=n.fullMessageLength.length-1;h>=0;--h)n.fullMessageLength[h]+=g[1],g[1]=g[0]+(n.fullMessageLength[h]/0x100000000>>>0),n.fullMessageLength[h]=n.fullMessageLength[h]>>>0,g[0]=g[1]/0x100000000>>>0;return e.putBytes(a),k(c,f,e),(e.read>2048||0===e.length())&&e.compact(),n},n.digest=function(){var b,h,i=d.util.createBuffer();i.putBytes(e.bytes());var j=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;i.putBytes(g.substr(0,n.blockLength-j));for(var l=8*n.fullMessageLength[0],m=0;m<n.fullMessageLength.length-1;++m)l+=(b=8*n.fullMessageLength[m+1])/0x100000000>>>0,i.putInt32(l>>>0),l=b>>>0;i.putInt32(l);for(var o=Array(c.length),m=0;m<c.length;++m)o[m]=c[m].slice(0);k(o,f,i);var p=d.util.createBuffer();h="SHA-512"===a?o.length:"SHA-384"===a?o.length-2:o.length-4;for(var m=0;m<h;++m)p.putInt32(o[m][0]),(m!==h-1||"SHA-512/224"!==a)&&p.putInt32(o[m][1]);return p},n};var g=null,h=!1,i=null,j=null;function k(a,b,c){for(var d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=c.length();N>=128;){for(G=0;G<16;++G)b[G][0]=c.getInt32()>>>0,b[G][1]=c.getInt32()>>>0;for(;G<80;++G)d=(((H=(J=b[G-2])[0])>>>19|(I=J[1])<<13)^(I>>>29|H<<3)^H>>>6)>>>0,e=((H<<13|I>>>19)^(I<<3|H>>>29)^(H<<26|I>>>6))>>>0,f=(((H=(L=b[G-15])[0])>>>1|(I=L[1])<<31)^(H>>>8|I<<24)^H>>>7)>>>0,g=((H<<31|I>>>1)^(H<<24|I>>>8)^(H<<25|I>>>7))>>>0,K=b[G-7],M=b[G-16],I=e+K[1]+g+M[1],b[G][0]=d+K[0]+f+M[0]+(I/0x100000000>>>0)>>>0,b[G][1]=I>>>0;for(q=a[0][0],r=a[0][1],s=a[1][0],t=a[1][1],u=a[2][0],v=a[2][1],w=a[3][0],x=a[3][1],y=a[4][0],z=a[4][1],A=a[5][0],B=a[5][1],C=a[6][0],D=a[6][1],E=a[7][0],F=a[7][1],G=0;G<80;++G)k=((y>>>14|z<<18)^(y>>>18|z<<14)^(z>>>9|y<<23))>>>0,l=((y<<18|z>>>14)^(y<<14|z>>>18)^(z<<23|y>>>9))>>>0,m=(C^y&(A^C))>>>0,n=(D^z&(B^D))>>>0,h=((q>>>28|r<<4)^(r>>>2|q<<30)^(r>>>7|q<<25))>>>0,j=((q<<4|r>>>28)^(r<<30|q>>>2)^(r<<25|q>>>7))>>>0,o=(q&s|u&(q^s))>>>0,p=(r&t|v&(r^t))>>>0,I=F+l+n+i[G][1]+b[G][1],d=E+k+m+i[G][0]+b[G][0]+(I/0x100000000>>>0)>>>0,e=I>>>0,f=h+o+((I=j+p)/0x100000000>>>0)>>>0,g=I>>>0,E=C,F=D,C=A,D=B,A=y,B=z,y=w+d+((I=x+e)/0x100000000>>>0)>>>0,z=I>>>0,w=u,x=v,u=s,v=t,s=q,t=r,q=d+f+((I=e+g)/0x100000000>>>0)>>>0,r=I>>>0;I=a[0][1]+r,a[0][0]=a[0][0]+q+(I/0x100000000>>>0)>>>0,a[0][1]=I>>>0,I=a[1][1]+t,a[1][0]=a[1][0]+s+(I/0x100000000>>>0)>>>0,a[1][1]=I>>>0,I=a[2][1]+v,a[2][0]=a[2][0]+u+(I/0x100000000>>>0)>>>0,a[2][1]=I>>>0,I=a[3][1]+x,a[3][0]=a[3][0]+w+(I/0x100000000>>>0)>>>0,a[3][1]=I>>>0,I=a[4][1]+z,a[4][0]=a[4][0]+y+(I/0x100000000>>>0)>>>0,a[4][1]=I>>>0,I=a[5][1]+B,a[5][0]=a[5][0]+A+(I/0x100000000>>>0)>>>0,a[5][1]=I>>>0,I=a[6][1]+D,a[6][0]=a[6][0]+C+(I/0x100000000>>>0)>>>0,a[6][1]=I>>>0,I=a[7][1]+F,a[7][0]=a[7][0]+E+(I/0x100000000>>>0)>>>0,a[7][1]=I>>>0,N-=128}}},37703:(a,b,c)=>{"use strict";c.d(b,{getMitmAlias:()=>h,o5:()=>g}),c(24081);var d=c(58609);let e=(0,d.U)("modelAliases");(0,d.U)("customModels");let f=(0,d.U)("mitmAlias");async function g(a,b){await e.set(a,b)}async function h(a){return a?await f.get(a)||{}:await f.getAll()}},37858:(a,b,c)=>{"use strict";let{createInflate:d,createGunzip:e,createBrotliDecompress:f,createZstdDecompress:g}=c(38522),{pipeline:h,Transform:i}=c(57075),{InvalidArgumentError:j,ResponseExceededMaxSizeError:k}=c(61448),l=c(60823);class m{#Z;#$;#G;#H=!1;constructor(a,b,c){this.#Z=a,this.#$=b,this.#G=c,this.target=null}pause(){this.#H||(this.#H=!0,this.#Z())}resume(){this.#H&&(this.#H=!1,this.#$())}abort(a){this.target?.abort(a),this.#G(a)}get paused(){return this.#H}get aborted(){return this.target?.aborted??!1}get reason(){return this.target?.reason??null}get rawHeaders(){return this.target?.rawHeaders??null}set rawHeaders(a){this.target&&(this.target.rawHeaders=a)}get rawTrailers(){return this.target?.rawTrailers??null}set rawTrailers(a){this.target&&(this.target.rawTrailers=a)}}let n={__proto__:null,gzip:e,"x-gzip":e,br:f,deflate:d,compress:d,"x-compress":d,zstd:g},o=[204,304],p=!1;class q extends l{#_=[];#aa;#ab;#ac;#ad;#ae=0;#af=!1;#ag=!1;#ah=!1;#ai=!1;#aj=!1;#ak=!1;#al=!1;#am;#B;constructor(a,{skipStatusCodes:b=o,skipErrorResponses:c=!0,maxSize:d=0}={}){if(!Number.isSafeInteger(d)||d<0)throw new j("maxSize must be a non-negative integer");super(a),this.#ab=b,this.#ac=c,this.#ad=d,this.#B=new m(()=>this.#an(),()=>this.#ao(),a=>{this.#ag&&!this.#af&&this.onResponseError(this.#B,a)})}#an(){this.#ap()}#ao(){let a=this.#aj;this.#aq(),a||(this.#ar(),this.#as())}#ap(){this.#ai||this.#af||(this.#ai=!0,this.#B.target?.pause())}#ar(){this.#ai&&!this.#B.paused&&!this.#ah&&(this.#ai=!1,this.#ag||this.#B.target?.resume())}#aq(){if(!this.#af&&!this.#B.paused&&this.#am){if(this.#aj){this.#ak=!0;return}this.#aj=!0;try{do{let a;for(this.#ak=!1;!this.#af&&!this.#B.paused&&null!==(a=this.#am.read());){if(this.#ad>0){let b=this.#ae+a.length;if(b>this.#ad)return void this.#at(new k(`Decompressed response size (${b}) exceeded maxSize (${this.#ad})`));this.#ae=b}let b=super.onResponseData(this.#B,a);!1!==b||this.#B.paused||this.#B.pause()}}while(this.#ak&&!this.#af&&!this.#B.paused)}finally{this.#aj=!1}this.#ar(),this.#as()}}#as(){this.#af||!this.#al||this.#B.paused||this.#aj||(this.#af=!0,this.#au(),super.onResponseEnd(this.#B,this.#aa))}#av(){this.#af||(this.#al=!0,this.#aq(),this.#as())}#aw(a,b){return!!(!a||b<200||this.#ab.includes(b))||!!this.#ac&&!!(b>=400)}#ax(a){let b=a.split(",");if(b.length>5)throw Error(`too many content-encodings in response: ${b.length}, maximum allowed is 5`);let c=[];for(let a=b.length-1;a>=0;a--){let d=b[a].trim();if(d){if(!n[d])return c.length=0,c;c.push(n[d]())}}if(c.length<2)return c;let d=[];for(let a=0;a<c.length;a++)d.push(c[a]),a<c.length-1&&this.#ad>0&&d.push(function(a){let b=0;return new i({transform(c,d,e){let f=b+c.length;f>a?e(new k(`Decompressed response size (${f}) exceeded maxSize (${a})`)):(b=f,e(null,c))}})}(this.#ad));return d}#at(a){this.#af||(this.#ag?this.onResponseError(this.#B,a):this.#B.abort(a))}#ay(a){this.#am=a,a.on("readable",()=>this.#aq()),a.on("error",a=>this.#at(a))}#az(){let a=this.#_[0];this.#ay(a),a.on("end",()=>this.#av())}#aA(){let a=this.#_[this.#_.length-1];this.#ay(a),h(this.#_,a=>{if(!this.#af){if(a)return void this.#at(a);this.#av()}})}#aB(){this.#_[0].on("drain",()=>{!this.#af&&(this.#ah=!1,this.#B.paused||(this.#aq(),this.#ar()))})}#au(){this.#_.length=0,this.#am=void 0}onRequestStart(a,b){return this.#B.target=a,super.onRequestStart(this.#B,b)}onRequestUpgrade(a,b,c,d){return super.onRequestUpgrade(this.#B,b,c,d)}onResponseStart(a,b,c,d){let e=c["content-encoding"],f=Array.isArray(e)?e.join(","):e;if(this.#aw(f,b))return super.onResponseStart(this.#B,b,c,d);let g=this.#ax(f.toLowerCase());if(0===g.length)return this.#au(),super.onResponseStart(this.#B,b,c,d);this.#_=g;let{"content-encoding":h,"content-length":i,...j}=c;if(this.#B.rawHeaders){let a=this.#B.rawHeaders;if(Array.isArray(a)){let b=[];for(let c=0;c<a.length;c+=2){let d=a[c],e=(Buffer.isBuffer(d)?d.toString("latin1"):`${d}`).toLowerCase();"content-encoding"!==e&&"content-length"!==e&&b.push(a[c],a[c+1])}a.splice(0,a.length,...b)}else if("object"==typeof a)for(let b of Object.keys(a)){let c=b.toLowerCase();("content-encoding"===c||"content-length"===c)&&delete a[b]}}return this.#aB(),1===this.#_.length?this.#az():this.#aA(),super.onResponseStart(this.#B,b,j,d)}onResponseData(a,b){if(this.#_.length>0){this.#_[0].write(b)||(this.#ah=!0,this.#ap());return}return super.onResponseData(this.#B,b)}onResponseEnd(a,b){if(this.#_.length>0){this.#ag=!0,this.#aa=b,this.#_[0].end();return}return super.onResponseEnd(this.#B,b)}onResponseError(a,b){if(!this.#af){for(let a of(this.#af=!0,this.#_))a.destroy();this.#au(),super.onResponseError(this.#B,b)}}}a.exports=function(a={}){return p||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),p=!0),b=>(c,d)=>"HEAD"===c.method?b(c,d):b(c,new q(d,a))}},38421:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(15251);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]}},38528:(a,b,c)=>{"use strict";c.d(b,{IQ:()=>h,U:()=>f,eZ:()=>g,gD:()=>i,u9:()=>j});var d=c(15251),e=c(50969);let f=a=>d.xq[a]?.usage||{};function g(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}function h(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}function i(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function j(a,b,c=1e4,d=null){let f=new AbortController,g=setTimeout(()=>f.abort(),c);try{return await (0,e.Fm)(a,{...b,signal:f.signal},d)}finally{clearTimeout(g)}}},38627:(a,b,c)=>{var d=c(45654);c(1277),c(33889);var e=a.exports=d.md5=d.md5||{};d.md.md5=d.md.algorithms.md5=e,e.create=function(){j||function(){f=String.fromCharCode(128)+d.util.fillString("\0",64),g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],h=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],i=Array(64);for(var a=0;a<64;++a)i[a]=Math.floor(0x100000000*Math.abs(Math.sin(a+1)));j=!0}();var a=null,b=d.util.createBuffer(),c=Array(16),e={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return e.start=function(){e.messageLength=0,e.fullMessageLength=e.messageLength64=[];for(var c=e.messageLengthSize/4,f=0;f<c;++f)e.fullMessageLength.push(0);return b=d.util.createBuffer(),a={h0:0x67452301,h1:0xefcdab89,h2:0x98badcfe,h3:0x10325476},e},e.start(),e.update=function(f,g){"utf8"===g&&(f=d.util.encodeUtf8(f));var h=f.length;e.messageLength+=h,h=[h/0x100000000>>>0,h>>>0];for(var i=e.fullMessageLength.length-1;i>=0;--i)e.fullMessageLength[i]+=h[1],h[1]=h[0]+(e.fullMessageLength[i]/0x100000000>>>0),e.fullMessageLength[i]=e.fullMessageLength[i]>>>0,h[0]=h[1]/0x100000000>>>0;return b.putBytes(f),k(a,c,b),(b.read>2048||0===b.length())&&b.compact(),e},e.digest=function(){var g=d.util.createBuffer();g.putBytes(b.bytes());var h=e.fullMessageLength[e.fullMessageLength.length-1]+e.messageLengthSize&e.blockLength-1;g.putBytes(f.substr(0,e.blockLength-h));for(var i,j=0,l=e.fullMessageLength.length-1;l>=0;--l)j=(i=8*e.fullMessageLength[l]+j)/0x100000000>>>0,g.putInt32Le(i>>>0);var m={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3};k(m,c,g);var n=d.util.createBuffer();return n.putInt32Le(m.h0),n.putInt32Le(m.h1),n.putInt32Le(m.h2),n.putInt32Le(m.h3),n},e};var f=null,g=null,h=null,i=null,j=!1;function k(a,b,c){for(var d,e,f,j,k,l,m,n,o=c.length();o>=64;){for(e=a.h0,f=a.h1,j=a.h2,k=a.h3,n=0;n<16;++n)b[n]=c.getInt32Le(),d=e+(k^f&(j^k))+i[n]+b[n],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;for(;n<32;++n)d=e+(j^k&(f^j))+i[n]+b[g[n]],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;for(;n<48;++n)d=e+(f^j^k)+i[n]+b[g[n]],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;for(;n<64;++n)d=e+(j^(f|~k))+i[n]+b[g[n]],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;a.h0=a.h0+e|0,a.h1=a.h1+f|0,a.h2=a.h2+j|0,a.h3=a.h3+k|0,o-=64}}},38650:(a,b,c)=>{"use strict";let{Writable:d}=c(57075),{EventEmitter:e}=c(78474),{assertCacheKey:f,assertCacheValue:g}=c(79468);class h extends e{#h=1024;#ad=0x6400000;#g=5242880;#aC=0;#aD=0;#aE=new Map;#aF=!1;constructor(a){if(super(),a){if("object"!=typeof a)throw TypeError("MemoryCacheStore options must be an object");if(void 0!==a.maxCount){if("number"!=typeof a.maxCount||!Number.isInteger(a.maxCount)||a.maxCount<0)throw TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#h=a.maxCount}if(void 0!==a.maxSize){if("number"!=typeof a.maxSize||!Number.isInteger(a.maxSize)||a.maxSize<0)throw TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#ad=a.maxSize}if(void 0!==a.maxEntrySize){if("number"!=typeof a.maxEntrySize||!Number.isInteger(a.maxEntrySize)||a.maxEntrySize<0)throw TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#g=a.maxEntrySize}}}get size(){return this.#aC}isFull(){return this.#aC>=this.#ad||this.#aD>=this.#h}get(a){f(a);let b=`${a.origin}:${a.path}`,c=Date.now(),d=this.#aE.get(b),e=d?i(a,d,c):null;return null==e?void 0:{statusMessage:e.statusMessage,statusCode:e.statusCode,headers:e.headers,body:e.body,vary:e.vary?e.vary:void 0,etag:e.etag,cacheControlDirectives:e.cacheControlDirectives,cachedAt:e.cachedAt,staleAt:e.staleAt,deleteAt:e.deleteAt}}createWriteStream(a,b){f(a),g(b);let c=`${a.origin}:${a.path}`,e=this,h={...a,...b,body:[],size:0};return new d({write(a,b,c){"string"==typeof a&&(a=Buffer.from(a,b)),h.size+=a.byteLength,h.size>e.#g?this.destroy():h.body.push(a),c(null)},final(b){let d=e.#aE.get(c);d||(d=[],e.#aE.set(c,d));let f=i(a,d,Date.now());if(f){let a=d.indexOf(f);d.splice(a,1,h),e.#aC-=f.size}else d.push(h),e.#aD+=1;if(e.#aC+=h.size,e.#aC>e.#ad||e.#aD>e.#h){for(let[a,b]of(e.#aF||(e.emit("maxSizeExceeded",{size:e.#aC,maxSize:e.#ad,count:e.#aD,maxCount:e.#h}),e.#aF=!0),e.#aE)){for(let a of b.splice(0,Math.ceil(b.length/2)))e.#aC-=a.size,e.#aD-=1;0===b.length&&e.#aE.delete(a)}e.#aC<e.#ad&&e.#aD<e.#h&&(e.#aF=!1)}b(null)}})}delete(a){if("object"!=typeof a)throw TypeError(`expected key to be object, got ${typeof a}`);let b=`${a.origin}:${a.path}`;for(let a of this.#aE.get(b)??[])this.#aC-=a.size,this.#aD-=1;this.#aE.delete(b)}}function i(a,b,c){for(let d=0;d<b.length;d++){let e=b[d];if(e.deleteAt>c&&e.method===a.method&&function(a,b){if(null==b.vary)return!0;for(let c in b.vary)if(Object.hasOwn(b.vary,c)&&!function(a,b){if(null==a&&null==b)return!0;if(null==a&&null!=b||null!=a&&null==b)return!1;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return a===b}(a.headers?.[c],b.vary[c]))return!1;return!0}(a,e))return e}}a.exports=h},39065:(a,b,c)=>{"use strict";let{PoolStats:d}=c(19071),e=c(5318),f=c(50329),{kConnected:g,kSize:h,kRunning:i,kPending:j,kQueued:k,kBusy:l,kFree:m,kUrl:n,kClose:o,kDestroy:p,kDispatch:q}=c(49176),r=Symbol("clients"),s=Symbol("needDrain"),t=Symbol("queue"),u=Symbol("closed resolve"),v=Symbol("onDrain"),w=Symbol("onConnect"),x=Symbol("onDisconnect"),y=Symbol("onConnectionError"),z=Symbol("on client busy"),A=Symbol("on client drain"),B=Symbol("drain queue"),C=Symbol("get dispatcher"),D=Symbol("has dispatcher"),E=Symbol("add client"),F=Symbol("remove client");class G extends e{[t]=new f;[k]=0;[r]=[];[s]=!1;[v](a,b,c){if(a.closed||a.destroyed)return;let d=this[t],e=!1;for(this[A](a);!e;){let b=d.shift();if(!b)break;this[k]--,e=!a.dispatch(b.opts,b.handler)}if(a[s]=e,e&&this[z](a),!e&&this[s]&&(this[s]=!1,this.emit("drain",b,[this,...c])),this[u]&&d.isEmpty()){let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a).then(this[u])}}[z](){}[A](){}[B](a,b){let c=this[t],d=!0;for(;!c.isEmpty();){let a=this[C]();if(!a){d=!1;break}let b=c.shift();if(this[k]--,!a.dispatch(b.opts,b.handler)&&(a[s]=!0,this[z](a),!(d=this[D]())))break}if(d&&this[s]&&(this[s]=!1,this.emit("drain",a,[this,...b])),this[u]&&c.isEmpty()){let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a).then(this[u])}}[w]=(a,b)=>{this.emit("connect",a,[this,...b])};[x]=(a,b,c)=>{this.emit("disconnect",a,[this,...b],c)};[y]=(a,b,c)=>{this.emit("connectionError",a,[this,...b],c)};get[l](){return this[s]}get[g](){let a=0;for(let{[g]:b}of this[r])a+=b;return a}get[m](){let a=0;for(let{[g]:b,[s]:c}of this[r])a+=b&&!c;return a}get[j](){let a=this[k];for(let{[j]:b}of this[r])a+=b;return a}get[i](){let a=0;for(let{[i]:b}of this[r])a+=b;return a}get[h](){let a=this[k];for(let{[h]:b}of this[r])a+=b;return a}get stats(){return new d(this)}[o](){if(!this[t].isEmpty())return new Promise(a=>{this[u]=a});{let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a)}}[p](a){for(;;){let b=this[t].shift();if(!b)break;b.handler.onResponseError(null,a)}let b=Array(this[r].length);for(let c=0;c<this[r].length;c++)b[c]=this[r][c].destroy(a);return Promise.all(b)}[q](a,b){let c=this[C]();return c?c.dispatch(a,b)||(c[s]=!0,this[z](c),this[s]=!this[D]()):(this[s]=!0,this[t].push({opts:a,handler:b}),this[k]++),!this[s]}[D](){for(let a=0;a<this[r].length;a++){let b=this[r][a];if(!b[s]&&!0!==b.closed&&!0!==b.destroyed)return!0}return!1}[E](a){return a.on("drain",this[v].bind(this,a)).on("connect",this[w]).on("disconnect",this[x]).on("connectionError",this[y]),this[r].push(a),this[s]&&queueMicrotask(()=>{this[s]&&!a[s]&&this[v](a,a[n],[a,this])}),this}[F](a){let b=this[r].indexOf(a);-1!==b&&this[r].splice(b,1),a.close(()=>{}),this[s]=!this[r].some(a=>!a[s]&&!0!==a.closed&&!0!==a.destroyed)}}a.exports={PoolBase:G,kClients:r,kNeedDrain:s,kAddClient:E,kRemoveClient:F,kDrainQueue:B,kOnClientBusy:z,kOnClientDrain:A,kGetDispatcher:C,kHasDispatcher:D}},39490:(a,b,c)=>{"use strict";RegExp("<think>([\\s\\S]*?)</think>\\s*")},39541:(a,b,c)=>{"use strict";function d(a){if(!a||"object"!=typeof a)return null;let b=a.output_config?.effort;if("string"==typeof b&&b){let a=b.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let c=a.thinking;if(c&&"object"==typeof c){if("disabled"===c.type)return{mode:"none"};if("adaptive"===c.type||"enabled"===c.type){let a=Number(c.budget_tokens);return Number.isFinite(a)&&a>0?{mode:"budget",budget:a}:{mode:"auto"}}}let d=a.reasoning_effort??("object"==typeof a.reasoning?a.reasoning?.effort:null);if("string"==typeof d&&d){let a=d.toLowerCase();return"none"===a||"off"===a?{mode:"none"}:"auto"===a?{mode:"auto"}:{mode:"level",level:a}}let e=a.thinkingConfig||a.generationConfig?.thinkingConfig||a.request?.generationConfig?.thinkingConfig;if(e&&"object"==typeof e){if("string"==typeof e.thinkingLevel)return{mode:"level",level:e.thinkingLevel.toLowerCase()};let a=Number(e.thinkingBudget);if(Number.isFinite(a))return 0===a?{mode:"none"}:a<0?{mode:"auto"}:{mode:"budget",budget:a}}if(!1===a.enable_thinking)return{mode:"none"};if(!0===a.enable_thinking){let b=Number(a.thinking_budget);return Number.isFinite(b)&&b>0?{mode:"budget",budget:b}:{mode:"auto"}}return null}c.d(b,{sS:()=>d}),c(49471),c(15251),c(26317)},39804:(a,b,c)=>{var d=c(45654);c(45518),c(27080);var e=a.exports=d.tls;function f(a,b,c){var f=b.entity===d.tls.ConnectionEnd.client;a.read.cipherState={init:!1,cipher:d.cipher.createDecipher("AES-CBC",f?c.keys.server_write_key:c.keys.client_write_key),iv:f?c.keys.server_write_IV:c.keys.client_write_IV},a.write.cipherState={init:!1,cipher:d.cipher.createCipher("AES-CBC",f?c.keys.client_write_key:c.keys.server_write_key),iv:f?c.keys.client_write_IV:c.keys.server_write_IV},a.read.cipherFunction=j,a.write.cipherFunction=g,a.read.macLength=a.write.macLength=c.mac_length,a.read.macFunction=a.write.macFunction=e.hmac_sha1}function g(a,b){var c,f=!1,g=b.macFunction(b.macKey,b.sequenceNumber,a);a.fragment.putBytes(g),b.updateSequenceNumber(),c=a.version.minor===e.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:d.random.getBytesSync(16),b.cipherState.init=!0;var i=b.cipherState.cipher;return i.start({iv:c}),a.version.minor>=e.Versions.TLS_1_1.minor&&i.output.putBytes(c),i.update(a.fragment),i.finish(h)&&(a.fragment=i.output,a.length=a.fragment.length(),f=!0),f}function h(a,b,c){if(!c){var d=a-b.length()%a;b.fillWithByte(d-1,d)}return!0}function i(a,b,c){var d=!0;if(c){for(var e=b.length(),f=b.last(),g=e-1-f;g<e-1;++g)d=d&&b.at(g)==f;d&&b.truncate(f+1)}return d}function j(a,b){var c,f,g,h,j,k=!1;j=a.version.minor===e.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:a.fragment.getBytes(16),b.cipherState.init=!0;var l=b.cipherState.cipher;l.start({iv:j}),l.update(a.fragment),k=l.finish(i);var m=b.macLength,n=d.random.getBytesSync(m),o=l.output.length();o>=m?(a.fragment=l.output.getBytes(o-m),n=l.output.getBytes(m)):a.fragment=l.output.getBytes(),a.fragment=d.util.createBuffer(a.fragment),a.length=a.fragment.length();var p=b.macFunction(b.macKey,b.sequenceNumber,a);return b.updateSequenceNumber(),k=(c=b.macKey,f=n,g=p,(h=d.hmac.create()).start("SHA1",c),h.update(f),f=h.digest().getBytes(),h.start(null,null),h.update(g),f===(g=h.digest().getBytes())&&k)}e.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=e.BulkCipherAlgorithm.aes,a.cipher_type=e.CipherType.block,a.enc_key_length=16,a.block_length=16,a.fixed_iv_length=16,a.record_iv_length=16,a.mac_algorithm=e.MACAlgorithm.hmac_sha1,a.mac_length=20,a.mac_key_length=20},initConnectionState:f},e.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=e.BulkCipherAlgorithm.aes,a.cipher_type=e.CipherType.block,a.enc_key_length=32,a.block_length=16,a.fixed_iv_length=16,a.record_iv_length=16,a.mac_algorithm=e.MACAlgorithm.hmac_sha1,a.mac_length=20,a.mac_key_length=20},initConnectionState:f}},40106:(a,b,c)=>{"use strict";let d=c(34589),e=c(77030),f=c(37067),g=c(84285),{ClientStats:h}=c(19071),{channels:i}=c(62571),j=c(76316),k=c(5318),{InvalidArgumentError:l,InformationalError:m,ClientDestroyedError:n}=c(61448),o=c(55285),{kUrl:p,kServerName:q,kClient:r,kBusy:s,kConnect:t,kResuming:u,kRunning:v,kPending:w,kSize:x,kQueue:y,kConnected:z,kConnecting:A,kNeedDrain:B,kKeepAliveDefaultTimeout:C,kHostHeader:D,kPendingIdx:E,kRunningIdx:F,kError:G,kPipelining:H,kKeepAliveTimeoutValue:I,kMaxHeadersSize:J,kKeepAliveMaxTimeout:K,kKeepAliveTimeoutThreshold:L,kHeadersTimeout:M,kBodyTimeout:N,kStrictContentLength:O,kConnector:P,kMaxRequests:Q,kCounter:R,kClose:S,kDestroy:T,kDispatch:U,kLocalAddress:V,kMaxResponseSize:W,kOnError:X,kHTTPContext:Y,kMaxConcurrentStreams:Z,kHostAuthority:$,kResume:_,kHTTP2Options:aa}=c(49176),ab=c(97678),ac=c(80985),ad=Symbol("kClosedResolve"),ae=f&&f.maxHeaderSize&&Number.isInteger(f.maxHeaderSize)&&f.maxHeaderSize>0?()=>f.maxHeaderSize:()=>{throw new l("http module not available or http.maxHeaderSize invalid")},af=()=>{},ag=!1;function ah(a){!0!==ag&&(process.emitWarning(`Use h2Options.${a} instead. ${a} for H2 will be deprecated in future major.`,{code:"UNDICI-H2-OPTIONS"}),ag=!0)}function ai(a){return a[Y]?.version==="h2"?a[Z]:a[H]??a[Y]?.defaultPipelining??1}class aj extends k{constructor(a,{maxHeaderSize:b,headersTimeout:c,socketTimeout:d,requestTimeout:f,connectTimeout:h,bodyTimeout:i,idleTimeout:j,keepAlive:k,keepAliveTimeout:m,maxKeepAliveTimeout:n,keepAliveMaxTimeout:r,keepAliveTimeoutThreshold:s,socketPath:t,pipelining:v,tls:w,strictContentLength:x,maxCachedSessions:z,connect:A,maxRequestsPerClient:G,localAddress:R,maxResponseSize:S,autoSelectFamily:T,autoSelectFamilyAttemptTimeout:U,maxConcurrentStreams:Z,allowH2:ab,useH2c:ac,initialWindowSize:af,connectionWindowSize:ag,pingInterval:ai,webSocket:aj,h2Options:al,eventSource:am}={}){if(void 0!==k)throw new l("unsupported keepAlive, use pipelining=0 instead");if(void 0!==d)throw new l("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==f)throw new l("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==j)throw new l("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==n)throw new l("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=b){if(!Number.isInteger(b)||b<1)throw new l("invalid maxHeaderSize")}else b=ae();if(null!=t&&"string"!=typeof t)throw new l("invalid socketPath");if(null!=h&&(!Number.isFinite(h)||h<0))throw new l("invalid connectTimeout");if(null!=m&&(!Number.isFinite(m)||m<=0))throw new l("invalid keepAliveTimeout");if(null!=r&&(!Number.isFinite(r)||r<=0))throw new l("invalid keepAliveMaxTimeout");if(null!=s&&!Number.isFinite(s))throw new l("invalid keepAliveTimeoutThreshold");if(null!=c&&(!Number.isInteger(c)||c<0))throw new l("headersTimeout must be a positive integer or zero");if(null!=i&&(!Number.isInteger(i)||i<0))throw new l("bodyTimeout must be a positive integer or zero");if(null!=A&&"function"!=typeof A&&"object"!=typeof A)throw new l("connect must be a function or an object");if(null!=G&&(!Number.isInteger(G)||G<0))throw new l("maxRequestsPerClient must be a positive number");if(null!=R&&("string"!=typeof R||0===e.isIP(R)))throw new l("localAddress must be valid string IP address");if(null!=S&&(!Number.isInteger(S)||S<-1))throw new l("maxResponseSize must be a positive number");if(null!=U&&(!Number.isInteger(U)||U<-1))throw new l("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=ab&&"boolean"!=typeof ab)throw new l("allowH2 must be a valid boolean value");if(!1!==ab)if(null!=al){if(null!=al.useH2c&&"boolean"!=typeof al.useH2c)throw new l("h2Options.useH2c must be a valid boolean value");if(al.settings?.initialWindowSize!=null&&(!Number.isInteger(al.settings.initialWindowSize)||al.settings.initialWindowSize<1))throw new l("h2Options.settings.initialWindowSize must be a positive integer, greater than 0");if(null!=al.maxConcurrentStreams&&(!Number.isInteger(al.maxConcurrentStreams)||al.maxConcurrentStreams<1))throw new l("h2Options.maxConcurrentStreams must be a positive integer, greater than 0");if(null!=al.connectionWindowSize&&(!Number.isInteger(al.connectionWindowSize)||al.connectionWindowSize<1))throw new l("h2Options.connectionWindowSize must be a positive integer, greater than 0");if(null!=al.pingInterval&&("number"!=typeof al.pingInterval||!Number.isInteger(al.pingInterval)||al.pingInterval<0))throw new l("h2Options.pingInterval must be a positive integer, greater or equal to 0")}else{if(null!=ac&&"boolean"!=typeof ac)throw ah("useH2c"),new l("useH2c must be a valid boolean value");if(null!=Z&&("number"!=typeof Z||Z<1))throw ah("maxConcurrentStreams"),new l("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=af&&(!Number.isInteger(af)||af<1))throw ah("initialWindowSize"),new l("initialWindowSize must be a positive integer, greater than 0");if(null!=ag&&(!Number.isInteger(ag)||ag<1))throw ah("connectionWindowSize"),new l("connectionWindowSize must be a positive integer, greater than 0");if(null!=ai&&("number"!=typeof ai||!Number.isInteger(ai)||ai<0))throw ah("pingInterval"),new l("pingInterval must be a positive integer, greater or equal to 0")}if(super({webSocket:aj,eventSource:am}),"function"!=typeof A)A=o({...w,maxCachedSessions:z,allowH2:ab,socketPath:t,useH2c:al?.useH2c??ac,timeout:h,..."boolean"==typeof T?{autoSelectFamily:T,autoSelectFamilyAttemptTimeout:U}:void 0,...A});else{const a=A;A=(b,c)=>a({...b,...null!=t?{socketPath:t}:null,...null!=ab?{allowH2:ab}:null},c)}this[p]=g.parseOrigin(a),this[$]=`${this[p].hostname}${this[p].port?`:${this[p].port}`:""}`,this[P]=A,this[H]=null!=v?v:1,this[J]=b,this[C]=null==m?4e3:m,this[K]=null==r?6e5:r,this[L]=null==s?2e3:s,this[I]=this[C],this[q]=null,this[V]=null!=R?R:null,this[u]=0,this[B]=0,this[D]=`host: ${this[$]}\r
|
|
181
|
+
${b.join("\n")}`}(c);f&&e.push(f),e.push("You have built-in web search. Answer questions directly using search results."),d.instructions=e,a.history.length>0&&(d.history=a.history),a.currentMsg?d.query=a.currentMsg:0===a.history.length&&(d.query="");let g=JSON.stringify(d);return g.length>96e3?g.slice(-96e3):g}(F,G,b?.tools);if(!H.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};let I=(o=x,p=A,D="u">typeof Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"UTC",{query_str:H,params:{query_str:H,search_focus:"internet",mode:o,model_preference:p,sources:["web"],attachments:[],frontend_uuid:crypto.randomUUID(),frontend_context_uuid:crypto.randomUUID(),version:j,language:"en-US",timezone:D,search_recency_filter:null,is_incognito:!0,use_schematized_api:!0,last_backend_uuid:G}}),J={"Content-Type":"application/json",Accept:"text/event-stream",Origin:"https://www.perplexity.ai",Referer:"https://www.perplexity.ai/","User-Agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36","X-App-ApiClient":"default","X-App-ApiVersion":j};d.accessToken?J.Authorization=`Bearer ${d.accessToken}`:d.apiKey&&(J.Cookie=`__Secure-next-auth.session-token=${d.apiKey}`),m?.info?.("PPLX-WEB",`Query to ${a} (pref=${A}, mode=${x}), len=${H.length}`);let K={method:"POST",headers:J,body:JSON.stringify(I),identity:this.config.identity,provider:this.provider,format:this.config.format};e&&(K.signal=e);try{B=await (0,h.Fm)(i,K,n)}catch(a){return m?.error?.("PPLX-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Perplexity connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:J,transformedBody:I}}if(!B.ok){let a=B.status,b=`Perplexity returned HTTP ${a}`;return 401===a||403===a?b="Perplexity auth failed — session cookie may be expired. Re-paste your __Secure-next-auth.session-token.":429===a&&(b="Perplexity rate limited. Wait a moment and retry."),m?.warn?.("PPLX-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:i,headers:J,transformedBody:I}}if(!B.body)return{response:new Response(JSON.stringify({error:{message:"Perplexity returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:J,transformedBody:I};let L=`chatcmpl-pplx-${crypto.randomUUID().slice(0,12)}`,M=Math.floor(Date.now()/1e3);if(c){let b;C=new Response((q=B.body,r=F.history,s=F.currentMsg,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="",h=null;for await(let f of y(q,e)){if(f.backendUuid&&(h=f.backendUuid),f.error){c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{reasoning_content:f.thinking+"\n"},finish_reason:null,logprobs:null}]})));continue}if(f.done){d=f.answer||d;break}let e=f.delta||"";e&&(e=w(e,!1))&&c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:e},finish_reason:null,logprobs:null}]}))),f.answer&&(d=f.answer)}c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U)),v(r,s,w(d),h)}catch(d){c.enqueue(b.encode((0,g.N)({id:L,object:"chat.completion.chunk",created:M,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else C=await z(B.body,a,L,M,F.history,F.currentMsg,e);return{response:C,url:i,headers:J,transformedBody:I}}}},37691:(a,b,c)=>{var d=c(45654);c(1277),c(33889);var e=a.exports=d.sha512=d.sha512||{};d.md.sha512=d.md.algorithms.sha512=e;var f=d.sha384=d.sha512.sha384=d.sha512.sha384||{};f.create=function(){return e.create("SHA-384")},d.md.sha384=d.md.algorithms.sha384=f,d.sha512.sha256=d.sha512.sha256||{create:function(){return e.create("SHA-512/256")}},d.md["sha512/256"]=d.md.algorithms["sha512/256"]=d.sha512.sha256,d.sha512.sha224=d.sha512.sha224||{create:function(){return e.create("SHA-512/224")}},d.md["sha512/224"]=d.md.algorithms["sha512/224"]=d.sha512.sha224,e.create=function(a){if(h||(g=String.fromCharCode(128)+d.util.fillString("\0",128),i=[[0x428a2f98,0xd728ae22],[0x71374491,0x23ef65cd],[0xb5c0fbcf,0xec4d3b2f],[0xe9b5dba5,0x8189dbbc],[0x3956c25b,0xf348b538],[0x59f111f1,0xb605d019],[0x923f82a4,0xaf194f9b],[0xab1c5ed5,0xda6d8118],[0xd807aa98,0xa3030242],[0x12835b01,0x45706fbe],[0x243185be,0x4ee4b28c],[0x550c7dc3,0xd5ffb4e2],[0x72be5d74,0xf27b896f],[0x80deb1fe,0x3b1696b1],[0x9bdc06a7,0x25c71235],[0xc19bf174,0xcf692694],[0xe49b69c1,0x9ef14ad2],[0xefbe4786,0x384f25e3],[0xfc19dc6,0x8b8cd5b5],[0x240ca1cc,0x77ac9c65],[0x2de92c6f,0x592b0275],[0x4a7484aa,0x6ea6e483],[0x5cb0a9dc,0xbd41fbd4],[0x76f988da,0x831153b5],[0x983e5152,0xee66dfab],[0xa831c66d,0x2db43210],[0xb00327c8,0x98fb213f],[0xbf597fc7,0xbeef0ee4],[0xc6e00bf3,0x3da88fc2],[0xd5a79147,0x930aa725],[0x6ca6351,0xe003826f],[0x14292967,0xa0e6e70],[0x27b70a85,0x46d22ffc],[0x2e1b2138,0x5c26c926],[0x4d2c6dfc,0x5ac42aed],[0x53380d13,0x9d95b3df],[0x650a7354,0x8baf63de],[0x766a0abb,0x3c77b2a8],[0x81c2c92e,0x47edaee6],[0x92722c85,0x1482353b],[0xa2bfe8a1,0x4cf10364],[0xa81a664b,0xbc423001],[0xc24b8b70,0xd0f89791],[0xc76c51a3,0x654be30],[0xd192e819,0xd6ef5218],[0xd6990624,0x5565a910],[0xf40e3585,0x5771202a],[0x106aa070,0x32bbd1b8],[0x19a4c116,0xb8d2d0c8],[0x1e376c08,0x5141ab53],[0x2748774c,0xdf8eeb99],[0x34b0bcb5,0xe19b48a8],[0x391c0cb3,0xc5c95a63],[0x4ed8aa4a,0xe3418acb],[0x5b9cca4f,0x7763e373],[0x682e6ff3,0xd6b2b8a3],[0x748f82ee,0x5defb2fc],[0x78a5636f,0x43172f60],[0x84c87814,0xa1f0ab72],[0x8cc70208,0x1a6439ec],[0x90befffa,0x23631e28],[0xa4506ceb,0xde82bde9],[0xbef9a3f7,0xb2c67915],[0xc67178f2,0xe372532b],[0xca273ece,0xea26619c],[0xd186b8c7,0x21c0c207],[0xeada7dd6,0xcde0eb1e],[0xf57d4f7f,0xee6ed178],[0x6f067aa,0x72176fba],[0xa637dc5,0xa2c898a6],[0x113f9804,0xbef90dae],[0x1b710b35,0x131c471b],[0x28db77f5,0x23047d84],[0x32caab7b,0x40c72493],[0x3c9ebe0a,0x15c9bebc],[0x431d67c4,0x9c100d4c],[0x4cc5d4be,0xcb3e42b6],[0x597f299c,0xfc657e2a],[0x5fcb6fab,0x3ad6faec],[0x6c44198c,0x4a475817]],(j={})["SHA-512"]=[[0x6a09e667,0xf3bcc908],[0xbb67ae85,0x84caa73b],[0x3c6ef372,0xfe94f82b],[0xa54ff53a,0x5f1d36f1],[0x510e527f,0xade682d1],[0x9b05688c,0x2b3e6c1f],[0x1f83d9ab,0xfb41bd6b],[0x5be0cd19,0x137e2179]],j["SHA-384"]=[[0xcbbb9d5d,0xc1059ed8],[0x629a292a,0x367cd507],[0x9159015a,0x3070dd17],[0x152fecd8,0xf70e5939],[0x67332667,0xffc00b31],[0x8eb44a87,0x68581511],[0xdb0c2e0d,0x64f98fa7],[0x47b5481d,0xbefa4fa4]],j["SHA-512/256"]=[[0x22312194,0xfc2bf72c],[0x9f555fa3,0xc84c64c2],[0x2393b86b,0x6f53b151],[0x96387719,0x5940eabd],[0x96283ee2,0xa88effe3],[0xbe5e1e25,0x53863992],[0x2b0199fc,0x2c85b8aa],[0xeb72ddc,0x81c52ca2]],j["SHA-512/224"]=[[0x8c3d37c8,0x19544da2],[0x73e19966,0x89dcd4d6],[0x1dfab7ae,0x32ff9c82],[0x679dd514,0x582f9fcf],[0xf6d2b69,0x7bd44da8],[0x77e36f73,0x4c48942],[0x3f9d85a8,0x6a1d36c8],[0x1112e6ad,0x91d692a1]],h=!0),void 0===a&&(a="SHA-512"),!(a in j))throw Error("Invalid SHA-512 algorithm: "+a);for(var b=j[a],c=null,e=d.util.createBuffer(),f=Array(80),l=0;l<80;++l)f[l]=[,,];var m=64;switch(a){case"SHA-384":m=48;break;case"SHA-512/256":m=32;break;case"SHA-512/224":m=28}var n={algorithm:a.replace("-","").toLowerCase(),blockLength:128,digestLength:m,messageLength:0,fullMessageLength:null,messageLengthSize:16};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength128=[];for(var a=n.messageLengthSize/4,f=0;f<a;++f)n.fullMessageLength.push(0);e=d.util.createBuffer(),c=Array(b.length);for(var f=0;f<b.length;++f)c[f]=b[f].slice(0);return n},n.start(),n.update=function(a,b){"utf8"===b&&(a=d.util.encodeUtf8(a));var g=a.length;n.messageLength+=g,g=[g/0x100000000>>>0,g>>>0];for(var h=n.fullMessageLength.length-1;h>=0;--h)n.fullMessageLength[h]+=g[1],g[1]=g[0]+(n.fullMessageLength[h]/0x100000000>>>0),n.fullMessageLength[h]=n.fullMessageLength[h]>>>0,g[0]=g[1]/0x100000000>>>0;return e.putBytes(a),k(c,f,e),(e.read>2048||0===e.length())&&e.compact(),n},n.digest=function(){var b,h,i=d.util.createBuffer();i.putBytes(e.bytes());var j=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;i.putBytes(g.substr(0,n.blockLength-j));for(var l=8*n.fullMessageLength[0],m=0;m<n.fullMessageLength.length-1;++m)l+=(b=8*n.fullMessageLength[m+1])/0x100000000>>>0,i.putInt32(l>>>0),l=b>>>0;i.putInt32(l);for(var o=Array(c.length),m=0;m<c.length;++m)o[m]=c[m].slice(0);k(o,f,i);var p=d.util.createBuffer();h="SHA-512"===a?o.length:"SHA-384"===a?o.length-2:o.length-4;for(var m=0;m<h;++m)p.putInt32(o[m][0]),(m!==h-1||"SHA-512/224"!==a)&&p.putInt32(o[m][1]);return p},n};var g=null,h=!1,i=null,j=null;function k(a,b,c){for(var d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=c.length();N>=128;){for(G=0;G<16;++G)b[G][0]=c.getInt32()>>>0,b[G][1]=c.getInt32()>>>0;for(;G<80;++G)d=(((H=(J=b[G-2])[0])>>>19|(I=J[1])<<13)^(I>>>29|H<<3)^H>>>6)>>>0,e=((H<<13|I>>>19)^(I<<3|H>>>29)^(H<<26|I>>>6))>>>0,f=(((H=(L=b[G-15])[0])>>>1|(I=L[1])<<31)^(H>>>8|I<<24)^H>>>7)>>>0,g=((H<<31|I>>>1)^(H<<24|I>>>8)^(H<<25|I>>>7))>>>0,K=b[G-7],M=b[G-16],I=e+K[1]+g+M[1],b[G][0]=d+K[0]+f+M[0]+(I/0x100000000>>>0)>>>0,b[G][1]=I>>>0;for(q=a[0][0],r=a[0][1],s=a[1][0],t=a[1][1],u=a[2][0],v=a[2][1],w=a[3][0],x=a[3][1],y=a[4][0],z=a[4][1],A=a[5][0],B=a[5][1],C=a[6][0],D=a[6][1],E=a[7][0],F=a[7][1],G=0;G<80;++G)k=((y>>>14|z<<18)^(y>>>18|z<<14)^(z>>>9|y<<23))>>>0,l=((y<<18|z>>>14)^(y<<14|z>>>18)^(z<<23|y>>>9))>>>0,m=(C^y&(A^C))>>>0,n=(D^z&(B^D))>>>0,h=((q>>>28|r<<4)^(r>>>2|q<<30)^(r>>>7|q<<25))>>>0,j=((q<<4|r>>>28)^(r<<30|q>>>2)^(r<<25|q>>>7))>>>0,o=(q&s|u&(q^s))>>>0,p=(r&t|v&(r^t))>>>0,I=F+l+n+i[G][1]+b[G][1],d=E+k+m+i[G][0]+b[G][0]+(I/0x100000000>>>0)>>>0,e=I>>>0,f=h+o+((I=j+p)/0x100000000>>>0)>>>0,g=I>>>0,E=C,F=D,C=A,D=B,A=y,B=z,y=w+d+((I=x+e)/0x100000000>>>0)>>>0,z=I>>>0,w=u,x=v,u=s,v=t,s=q,t=r,q=d+f+((I=e+g)/0x100000000>>>0)>>>0,r=I>>>0;I=a[0][1]+r,a[0][0]=a[0][0]+q+(I/0x100000000>>>0)>>>0,a[0][1]=I>>>0,I=a[1][1]+t,a[1][0]=a[1][0]+s+(I/0x100000000>>>0)>>>0,a[1][1]=I>>>0,I=a[2][1]+v,a[2][0]=a[2][0]+u+(I/0x100000000>>>0)>>>0,a[2][1]=I>>>0,I=a[3][1]+x,a[3][0]=a[3][0]+w+(I/0x100000000>>>0)>>>0,a[3][1]=I>>>0,I=a[4][1]+z,a[4][0]=a[4][0]+y+(I/0x100000000>>>0)>>>0,a[4][1]=I>>>0,I=a[5][1]+B,a[5][0]=a[5][0]+A+(I/0x100000000>>>0)>>>0,a[5][1]=I>>>0,I=a[6][1]+D,a[6][0]=a[6][0]+C+(I/0x100000000>>>0)>>>0,a[6][1]=I>>>0,I=a[7][1]+F,a[7][0]=a[7][0]+E+(I/0x100000000>>>0)>>>0,a[7][1]=I>>>0,N-=128}}},37703:(a,b,c)=>{"use strict";c.d(b,{getMitmAlias:()=>h,o5:()=>g}),c(24081);var d=c(58609);let e=(0,d.U)("modelAliases");(0,d.U)("customModels");let f=(0,d.U)("mitmAlias");async function g(a,b){await e.set(a,b)}async function h(a){return a?await f.get(a)||{}:await f.getAll()}},37858:(a,b,c)=>{"use strict";let{createInflate:d,createGunzip:e,createBrotliDecompress:f,createZstdDecompress:g}=c(38522),{pipeline:h,Transform:i}=c(57075),{InvalidArgumentError:j,ResponseExceededMaxSizeError:k}=c(61448),l=c(60823);class m{#Z;#$;#G;#H=!1;constructor(a,b,c){this.#Z=a,this.#$=b,this.#G=c,this.target=null}pause(){this.#H||(this.#H=!0,this.#Z())}resume(){this.#H&&(this.#H=!1,this.#$())}abort(a){this.target?.abort(a),this.#G(a)}get paused(){return this.#H}get aborted(){return this.target?.aborted??!1}get reason(){return this.target?.reason??null}get rawHeaders(){return this.target?.rawHeaders??null}set rawHeaders(a){this.target&&(this.target.rawHeaders=a)}get rawTrailers(){return this.target?.rawTrailers??null}set rawTrailers(a){this.target&&(this.target.rawTrailers=a)}}let n={__proto__:null,gzip:e,"x-gzip":e,br:f,deflate:d,compress:d,"x-compress":d,zstd:g},o=[204,304],p=!1;class q extends l{#_=[];#aa;#ab;#ac;#ad;#ae=0;#af=!1;#ag=!1;#ah=!1;#ai=!1;#aj=!1;#ak=!1;#al=!1;#am;#B;constructor(a,{skipStatusCodes:b=o,skipErrorResponses:c=!0,maxSize:d=0}={}){if(!Number.isSafeInteger(d)||d<0)throw new j("maxSize must be a non-negative integer");super(a),this.#ab=b,this.#ac=c,this.#ad=d,this.#B=new m(()=>this.#an(),()=>this.#ao(),a=>{this.#ag&&!this.#af&&this.onResponseError(this.#B,a)})}#an(){this.#ap()}#ao(){let a=this.#aj;this.#aq(),a||(this.#ar(),this.#as())}#ap(){this.#ai||this.#af||(this.#ai=!0,this.#B.target?.pause())}#ar(){this.#ai&&!this.#B.paused&&!this.#ah&&(this.#ai=!1,this.#ag||this.#B.target?.resume())}#aq(){if(!this.#af&&!this.#B.paused&&this.#am){if(this.#aj){this.#ak=!0;return}this.#aj=!0;try{do{let a;for(this.#ak=!1;!this.#af&&!this.#B.paused&&null!==(a=this.#am.read());){if(this.#ad>0){let b=this.#ae+a.length;if(b>this.#ad)return void this.#at(new k(`Decompressed response size (${b}) exceeded maxSize (${this.#ad})`));this.#ae=b}let b=super.onResponseData(this.#B,a);!1!==b||this.#B.paused||this.#B.pause()}}while(this.#ak&&!this.#af&&!this.#B.paused)}finally{this.#aj=!1}this.#ar(),this.#as()}}#as(){this.#af||!this.#al||this.#B.paused||this.#aj||(this.#af=!0,this.#au(),super.onResponseEnd(this.#B,this.#aa))}#av(){this.#af||(this.#al=!0,this.#aq(),this.#as())}#aw(a,b){return!!(!a||b<200||this.#ab.includes(b))||!!this.#ac&&!!(b>=400)}#ax(a){let b=a.split(",");if(b.length>5)throw Error(`too many content-encodings in response: ${b.length}, maximum allowed is 5`);let c=[];for(let a=b.length-1;a>=0;a--){let d=b[a].trim();if(d){if(!n[d])return c.length=0,c;c.push(n[d]())}}if(c.length<2)return c;let d=[];for(let a=0;a<c.length;a++)d.push(c[a]),a<c.length-1&&this.#ad>0&&d.push(function(a){let b=0;return new i({transform(c,d,e){let f=b+c.length;f>a?e(new k(`Decompressed response size (${f}) exceeded maxSize (${a})`)):(b=f,e(null,c))}})}(this.#ad));return d}#at(a){this.#af||(this.#ag?this.onResponseError(this.#B,a):this.#B.abort(a))}#ay(a){this.#am=a,a.on("readable",()=>this.#aq()),a.on("error",a=>this.#at(a))}#az(){let a=this.#_[0];this.#ay(a),a.on("end",()=>this.#av())}#aA(){let a=this.#_[this.#_.length-1];this.#ay(a),h(this.#_,a=>{if(!this.#af){if(a)return void this.#at(a);this.#av()}})}#aB(){this.#_[0].on("drain",()=>{!this.#af&&(this.#ah=!1,this.#B.paused||(this.#aq(),this.#ar()))})}#au(){this.#_.length=0,this.#am=void 0}onRequestStart(a,b){return this.#B.target=a,super.onRequestStart(this.#B,b)}onRequestUpgrade(a,b,c,d){return super.onRequestUpgrade(this.#B,b,c,d)}onResponseStart(a,b,c,d){let e=c["content-encoding"],f=Array.isArray(e)?e.join(","):e;if(this.#aw(f,b))return super.onResponseStart(this.#B,b,c,d);let g=this.#ax(f.toLowerCase());if(0===g.length)return this.#au(),super.onResponseStart(this.#B,b,c,d);this.#_=g;let{"content-encoding":h,"content-length":i,...j}=c;if(this.#B.rawHeaders){let a=this.#B.rawHeaders;if(Array.isArray(a)){let b=[];for(let c=0;c<a.length;c+=2){let d=a[c],e=(Buffer.isBuffer(d)?d.toString("latin1"):`${d}`).toLowerCase();"content-encoding"!==e&&"content-length"!==e&&b.push(a[c],a[c+1])}a.splice(0,a.length,...b)}else if("object"==typeof a)for(let b of Object.keys(a)){let c=b.toLowerCase();("content-encoding"===c||"content-length"===c)&&delete a[b]}}return this.#aB(),1===this.#_.length?this.#az():this.#aA(),super.onResponseStart(this.#B,b,j,d)}onResponseData(a,b){if(this.#_.length>0){this.#_[0].write(b)||(this.#ah=!0,this.#ap());return}return super.onResponseData(this.#B,b)}onResponseEnd(a,b){if(this.#_.length>0){this.#ag=!0,this.#aa=b,this.#_[0].end();return}return super.onResponseEnd(this.#B,b)}onResponseError(a,b){if(!this.#af){for(let a of(this.#af=!0,this.#_))a.destroy();this.#au(),super.onResponseError(this.#B,b)}}}a.exports=function(a={}){return p||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),p=!0),b=>(c,d)=>"HEAD"===c.method?b(c,d):b(c,new q(d,a))}},38421:(a,b,c)=>{"use strict";c.d(b,{Ak:()=>e,Yg:()=>h,sr:()=>d.sr,xq:()=>d.xq});var d=c(15251);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]}},38528:(a,b,c)=>{"use strict";c.d(b,{IQ:()=>h,U:()=>f,eZ:()=>g,gD:()=>i,u9:()=>j});var d=c(15251),e=c(50969);let f=a=>d.xq[a]?.usage||{};function g(a){if(!a)return null;try{if(a instanceof Date)return a.toISOString();if("number"==typeof a)return new Date(a<1e12?1e3*a:a).toISOString();if("string"==typeof a){if(/^\d+$/.test(a)){let b=Number(a);return new Date(b<1e12?1e3*b:b).toISOString()}return new Date(a).toISOString()}return null}catch(b){return console.warn(`Failed to parse reset time: ${a}`,b),null}}function h(a,b=0){if("number"==typeof a&&Number.isFinite(a))return a;if("string"==typeof a&&a.trim()){let b=Number(a);if(Number.isFinite(b))return b}return b}function i(a){return"string"==typeof a?a.trim()||null:a&&"object"==typeof a&&"string"==typeof a.id&&a.id.trim()||null}async function j(a,b,c=1e4,d=null){let f=new AbortController,g=setTimeout(()=>f.abort(),c);try{return await (0,e.Fm)(a,{...b,signal:f.signal},d)}finally{clearTimeout(g)}}},38627:(a,b,c)=>{var d=c(45654);c(1277),c(33889);var e=a.exports=d.md5=d.md5||{};d.md.md5=d.md.algorithms.md5=e,e.create=function(){j||function(){f=String.fromCharCode(128)+d.util.fillString("\0",64),g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],h=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],i=Array(64);for(var a=0;a<64;++a)i[a]=Math.floor(0x100000000*Math.abs(Math.sin(a+1)));j=!0}();var a=null,b=d.util.createBuffer(),c=Array(16),e={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return e.start=function(){e.messageLength=0,e.fullMessageLength=e.messageLength64=[];for(var c=e.messageLengthSize/4,f=0;f<c;++f)e.fullMessageLength.push(0);return b=d.util.createBuffer(),a={h0:0x67452301,h1:0xefcdab89,h2:0x98badcfe,h3:0x10325476},e},e.start(),e.update=function(f,g){"utf8"===g&&(f=d.util.encodeUtf8(f));var h=f.length;e.messageLength+=h,h=[h/0x100000000>>>0,h>>>0];for(var i=e.fullMessageLength.length-1;i>=0;--i)e.fullMessageLength[i]+=h[1],h[1]=h[0]+(e.fullMessageLength[i]/0x100000000>>>0),e.fullMessageLength[i]=e.fullMessageLength[i]>>>0,h[0]=h[1]/0x100000000>>>0;return b.putBytes(f),k(a,c,b),(b.read>2048||0===b.length())&&b.compact(),e},e.digest=function(){var g=d.util.createBuffer();g.putBytes(b.bytes());var h=e.fullMessageLength[e.fullMessageLength.length-1]+e.messageLengthSize&e.blockLength-1;g.putBytes(f.substr(0,e.blockLength-h));for(var i,j=0,l=e.fullMessageLength.length-1;l>=0;--l)j=(i=8*e.fullMessageLength[l]+j)/0x100000000>>>0,g.putInt32Le(i>>>0);var m={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3};k(m,c,g);var n=d.util.createBuffer();return n.putInt32Le(m.h0),n.putInt32Le(m.h1),n.putInt32Le(m.h2),n.putInt32Le(m.h3),n},e};var f=null,g=null,h=null,i=null,j=!1;function k(a,b,c){for(var d,e,f,j,k,l,m,n,o=c.length();o>=64;){for(e=a.h0,f=a.h1,j=a.h2,k=a.h3,n=0;n<16;++n)b[n]=c.getInt32Le(),d=e+(k^f&(j^k))+i[n]+b[n],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;for(;n<32;++n)d=e+(j^k&(f^j))+i[n]+b[g[n]],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;for(;n<48;++n)d=e+(f^j^k)+i[n]+b[g[n]],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;for(;n<64;++n)d=e+(j^(f|~k))+i[n]+b[g[n]],m=h[n],e=k,k=j,j=f,f+=d<<m|d>>>32-m;a.h0=a.h0+e|0,a.h1=a.h1+f|0,a.h2=a.h2+j|0,a.h3=a.h3+k|0,o-=64}}},38650:(a,b,c)=>{"use strict";let{Writable:d}=c(57075),{EventEmitter:e}=c(78474),{assertCacheKey:f,assertCacheValue:g}=c(79468);class h extends e{#h=1024;#ad=0x6400000;#g=5242880;#aC=0;#aD=0;#aE=new Map;#aF=!1;constructor(a){if(super(),a){if("object"!=typeof a)throw TypeError("MemoryCacheStore options must be an object");if(void 0!==a.maxCount){if("number"!=typeof a.maxCount||!Number.isInteger(a.maxCount)||a.maxCount<0)throw TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#h=a.maxCount}if(void 0!==a.maxSize){if("number"!=typeof a.maxSize||!Number.isInteger(a.maxSize)||a.maxSize<0)throw TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#ad=a.maxSize}if(void 0!==a.maxEntrySize){if("number"!=typeof a.maxEntrySize||!Number.isInteger(a.maxEntrySize)||a.maxEntrySize<0)throw TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#g=a.maxEntrySize}}}get size(){return this.#aC}isFull(){return this.#aC>=this.#ad||this.#aD>=this.#h}get(a){f(a);let b=`${a.origin}:${a.path}`,c=Date.now(),d=this.#aE.get(b),e=d?i(a,d,c):null;return null==e?void 0:{statusMessage:e.statusMessage,statusCode:e.statusCode,headers:e.headers,body:e.body,vary:e.vary?e.vary:void 0,etag:e.etag,cacheControlDirectives:e.cacheControlDirectives,cachedAt:e.cachedAt,staleAt:e.staleAt,deleteAt:e.deleteAt}}createWriteStream(a,b){f(a),g(b);let c=`${a.origin}:${a.path}`,e=this,h={...a,...b,body:[],size:0};return new d({write(a,b,c){"string"==typeof a&&(a=Buffer.from(a,b)),h.size+=a.byteLength,h.size>e.#g?this.destroy():h.body.push(a),c(null)},final(b){let d=e.#aE.get(c);d||(d=[],e.#aE.set(c,d));let f=i(a,d,Date.now());if(f){let a=d.indexOf(f);d.splice(a,1,h),e.#aC-=f.size}else d.push(h),e.#aD+=1;if(e.#aC+=h.size,e.#aC>e.#ad||e.#aD>e.#h){for(let[a,b]of(e.#aF||(e.emit("maxSizeExceeded",{size:e.#aC,maxSize:e.#ad,count:e.#aD,maxCount:e.#h}),e.#aF=!0),e.#aE)){for(let a of b.splice(0,Math.ceil(b.length/2)))e.#aC-=a.size,e.#aD-=1;0===b.length&&e.#aE.delete(a)}e.#aC<e.#ad&&e.#aD<e.#h&&(e.#aF=!1)}b(null)}})}delete(a){if("object"!=typeof a)throw TypeError(`expected key to be object, got ${typeof a}`);let b=`${a.origin}:${a.path}`;for(let a of this.#aE.get(b)??[])this.#aC-=a.size,this.#aD-=1;this.#aE.delete(b)}}function i(a,b,c){for(let d=0;d<b.length;d++){let e=b[d];if(e.deleteAt>c&&e.method===a.method&&function(a,b){if(null==b.vary)return!0;for(let c in b.vary)if(Object.hasOwn(b.vary,c)&&!function(a,b){if(null==a&&null==b)return!0;if(null==a&&null!=b||null!=a&&null==b)return!1;if(Array.isArray(a)&&Array.isArray(b)){if(a.length!==b.length)return!1;for(let c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return a===b}(a.headers?.[c],b.vary[c]))return!1;return!0}(a,e))return e}}a.exports=h},39065:(a,b,c)=>{"use strict";let{PoolStats:d}=c(19071),e=c(5318),f=c(50329),{kConnected:g,kSize:h,kRunning:i,kPending:j,kQueued:k,kBusy:l,kFree:m,kUrl:n,kClose:o,kDestroy:p,kDispatch:q}=c(49176),r=Symbol("clients"),s=Symbol("needDrain"),t=Symbol("queue"),u=Symbol("closed resolve"),v=Symbol("onDrain"),w=Symbol("onConnect"),x=Symbol("onDisconnect"),y=Symbol("onConnectionError"),z=Symbol("on client busy"),A=Symbol("on client drain"),B=Symbol("drain queue"),C=Symbol("get dispatcher"),D=Symbol("has dispatcher"),E=Symbol("add client"),F=Symbol("remove client");class G extends e{[t]=new f;[k]=0;[r]=[];[s]=!1;[v](a,b,c){if(a.closed||a.destroyed)return;let d=this[t],e=!1;for(this[A](a);!e;){let b=d.shift();if(!b)break;this[k]--,e=!a.dispatch(b.opts,b.handler)}if(a[s]=e,e&&this[z](a),!e&&this[s]&&(this[s]=!1,this.emit("drain",b,[this,...c])),this[u]&&d.isEmpty()){let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a).then(this[u])}}[z](){}[A](){}[B](a,b){let c=this[t],d=!0;for(;!c.isEmpty();){let a=this[C]();if(!a){d=!1;break}let b=c.shift();if(this[k]--,!a.dispatch(b.opts,b.handler)&&(a[s]=!0,this[z](a),!(d=this[D]())))break}if(d&&this[s]&&(this[s]=!1,this.emit("drain",a,[this,...b])),this[u]&&c.isEmpty()){let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a).then(this[u])}}[w]=(a,b)=>{this.emit("connect",a,[this,...b])};[x]=(a,b,c)=>{this.emit("disconnect",a,[this,...b],c)};[y]=(a,b,c)=>{this.emit("connectionError",a,[this,...b],c)};get[l](){return this[s]}get[g](){let a=0;for(let{[g]:b}of this[r])a+=b;return a}get[m](){let a=0;for(let{[g]:b,[s]:c}of this[r])a+=b&&!c;return a}get[j](){let a=this[k];for(let{[j]:b}of this[r])a+=b;return a}get[i](){let a=0;for(let{[i]:b}of this[r])a+=b;return a}get[h](){let a=this[k];for(let{[h]:b}of this[r])a+=b;return a}get stats(){return new d(this)}[o](){if(!this[t].isEmpty())return new Promise(a=>{this[u]=a});{let a=[];for(let b=0;b<this[r].length;b++){let c=this[r][b];c.destroyed||a.push(c.close())}return Promise.all(a)}}[p](a){for(;;){let b=this[t].shift();if(!b)break;b.handler.onResponseError(null,a)}let b=Array(this[r].length);for(let c=0;c<this[r].length;c++)b[c]=this[r][c].destroy(a);return Promise.all(b)}[q](a,b){let c=this[C]();return c?c.dispatch(a,b)||(c[s]=!0,this[z](c),this[s]=!this[D]()):(this[s]=!0,this[t].push({opts:a,handler:b}),this[k]++),!this[s]}[D](){for(let a=0;a<this[r].length;a++){let b=this[r][a];if(!b[s]&&!0!==b.closed&&!0!==b.destroyed)return!0}return!1}[E](a){return a.on("drain",this[v].bind(this,a)).on("connect",this[w]).on("disconnect",this[x]).on("connectionError",this[y]),this[r].push(a),this[s]&&queueMicrotask(()=>{this[s]&&!a[s]&&this[v](a,a[n],[a,this])}),this}[F](a){let b=this[r].indexOf(a);-1!==b&&this[r].splice(b,1),a.close(()=>{}),this[s]=!this[r].some(a=>!a[s]&&!0!==a.closed&&!0!==a.destroyed)}}a.exports={PoolBase:G,kClients:r,kNeedDrain:s,kAddClient:E,kRemoveClient:F,kDrainQueue:B,kOnClientBusy:z,kOnClientDrain:A,kGetDispatcher:C,kHasDispatcher:D}},39490:(a,b,c)=>{"use strict";RegExp("<think>([\\s\\S]*?)</think>\\s*")},39804:(a,b,c)=>{var d=c(45654);c(45518),c(27080);var e=a.exports=d.tls;function f(a,b,c){var f=b.entity===d.tls.ConnectionEnd.client;a.read.cipherState={init:!1,cipher:d.cipher.createDecipher("AES-CBC",f?c.keys.server_write_key:c.keys.client_write_key),iv:f?c.keys.server_write_IV:c.keys.client_write_IV},a.write.cipherState={init:!1,cipher:d.cipher.createCipher("AES-CBC",f?c.keys.client_write_key:c.keys.server_write_key),iv:f?c.keys.client_write_IV:c.keys.server_write_IV},a.read.cipherFunction=j,a.write.cipherFunction=g,a.read.macLength=a.write.macLength=c.mac_length,a.read.macFunction=a.write.macFunction=e.hmac_sha1}function g(a,b){var c,f=!1,g=b.macFunction(b.macKey,b.sequenceNumber,a);a.fragment.putBytes(g),b.updateSequenceNumber(),c=a.version.minor===e.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:d.random.getBytesSync(16),b.cipherState.init=!0;var i=b.cipherState.cipher;return i.start({iv:c}),a.version.minor>=e.Versions.TLS_1_1.minor&&i.output.putBytes(c),i.update(a.fragment),i.finish(h)&&(a.fragment=i.output,a.length=a.fragment.length(),f=!0),f}function h(a,b,c){if(!c){var d=a-b.length()%a;b.fillWithByte(d-1,d)}return!0}function i(a,b,c){var d=!0;if(c){for(var e=b.length(),f=b.last(),g=e-1-f;g<e-1;++g)d=d&&b.at(g)==f;d&&b.truncate(f+1)}return d}function j(a,b){var c,f,g,h,j,k=!1;j=a.version.minor===e.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:a.fragment.getBytes(16),b.cipherState.init=!0;var l=b.cipherState.cipher;l.start({iv:j}),l.update(a.fragment),k=l.finish(i);var m=b.macLength,n=d.random.getBytesSync(m),o=l.output.length();o>=m?(a.fragment=l.output.getBytes(o-m),n=l.output.getBytes(m)):a.fragment=l.output.getBytes(),a.fragment=d.util.createBuffer(a.fragment),a.length=a.fragment.length();var p=b.macFunction(b.macKey,b.sequenceNumber,a);return b.updateSequenceNumber(),k=(c=b.macKey,f=n,g=p,(h=d.hmac.create()).start("SHA1",c),h.update(f),f=h.digest().getBytes(),h.start(null,null),h.update(g),f===(g=h.digest().getBytes())&&k)}e.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=e.BulkCipherAlgorithm.aes,a.cipher_type=e.CipherType.block,a.enc_key_length=16,a.block_length=16,a.fixed_iv_length=16,a.record_iv_length=16,a.mac_algorithm=e.MACAlgorithm.hmac_sha1,a.mac_length=20,a.mac_key_length=20},initConnectionState:f},e.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=e.BulkCipherAlgorithm.aes,a.cipher_type=e.CipherType.block,a.enc_key_length=32,a.block_length=16,a.fixed_iv_length=16,a.record_iv_length=16,a.mac_algorithm=e.MACAlgorithm.hmac_sha1,a.mac_length=20,a.mac_key_length=20},initConnectionState:f}},40106:(a,b,c)=>{"use strict";let d=c(34589),e=c(77030),f=c(37067),g=c(84285),{ClientStats:h}=c(19071),{channels:i}=c(62571),j=c(76316),k=c(5318),{InvalidArgumentError:l,InformationalError:m,ClientDestroyedError:n}=c(61448),o=c(55285),{kUrl:p,kServerName:q,kClient:r,kBusy:s,kConnect:t,kResuming:u,kRunning:v,kPending:w,kSize:x,kQueue:y,kConnected:z,kConnecting:A,kNeedDrain:B,kKeepAliveDefaultTimeout:C,kHostHeader:D,kPendingIdx:E,kRunningIdx:F,kError:G,kPipelining:H,kKeepAliveTimeoutValue:I,kMaxHeadersSize:J,kKeepAliveMaxTimeout:K,kKeepAliveTimeoutThreshold:L,kHeadersTimeout:M,kBodyTimeout:N,kStrictContentLength:O,kConnector:P,kMaxRequests:Q,kCounter:R,kClose:S,kDestroy:T,kDispatch:U,kLocalAddress:V,kMaxResponseSize:W,kOnError:X,kHTTPContext:Y,kMaxConcurrentStreams:Z,kHostAuthority:$,kResume:_,kHTTP2Options:aa}=c(49176),ab=c(97678),ac=c(80985),ad=Symbol("kClosedResolve"),ae=f&&f.maxHeaderSize&&Number.isInteger(f.maxHeaderSize)&&f.maxHeaderSize>0?()=>f.maxHeaderSize:()=>{throw new l("http module not available or http.maxHeaderSize invalid")},af=()=>{},ag=!1;function ah(a){!0!==ag&&(process.emitWarning(`Use h2Options.${a} instead. ${a} for H2 will be deprecated in future major.`,{code:"UNDICI-H2-OPTIONS"}),ag=!0)}function ai(a){return a[Y]?.version==="h2"?a[Z]:a[H]??a[Y]?.defaultPipelining??1}class aj extends k{constructor(a,{maxHeaderSize:b,headersTimeout:c,socketTimeout:d,requestTimeout:f,connectTimeout:h,bodyTimeout:i,idleTimeout:j,keepAlive:k,keepAliveTimeout:m,maxKeepAliveTimeout:n,keepAliveMaxTimeout:r,keepAliveTimeoutThreshold:s,socketPath:t,pipelining:v,tls:w,strictContentLength:x,maxCachedSessions:z,connect:A,maxRequestsPerClient:G,localAddress:R,maxResponseSize:S,autoSelectFamily:T,autoSelectFamilyAttemptTimeout:U,maxConcurrentStreams:Z,allowH2:ab,useH2c:ac,initialWindowSize:af,connectionWindowSize:ag,pingInterval:ai,webSocket:aj,h2Options:al,eventSource:am}={}){if(void 0!==k)throw new l("unsupported keepAlive, use pipelining=0 instead");if(void 0!==d)throw new l("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==f)throw new l("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==j)throw new l("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==n)throw new l("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=b){if(!Number.isInteger(b)||b<1)throw new l("invalid maxHeaderSize")}else b=ae();if(null!=t&&"string"!=typeof t)throw new l("invalid socketPath");if(null!=h&&(!Number.isFinite(h)||h<0))throw new l("invalid connectTimeout");if(null!=m&&(!Number.isFinite(m)||m<=0))throw new l("invalid keepAliveTimeout");if(null!=r&&(!Number.isFinite(r)||r<=0))throw new l("invalid keepAliveMaxTimeout");if(null!=s&&!Number.isFinite(s))throw new l("invalid keepAliveTimeoutThreshold");if(null!=c&&(!Number.isInteger(c)||c<0))throw new l("headersTimeout must be a positive integer or zero");if(null!=i&&(!Number.isInteger(i)||i<0))throw new l("bodyTimeout must be a positive integer or zero");if(null!=A&&"function"!=typeof A&&"object"!=typeof A)throw new l("connect must be a function or an object");if(null!=G&&(!Number.isInteger(G)||G<0))throw new l("maxRequestsPerClient must be a positive number");if(null!=R&&("string"!=typeof R||0===e.isIP(R)))throw new l("localAddress must be valid string IP address");if(null!=S&&(!Number.isInteger(S)||S<-1))throw new l("maxResponseSize must be a positive number");if(null!=U&&(!Number.isInteger(U)||U<-1))throw new l("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=ab&&"boolean"!=typeof ab)throw new l("allowH2 must be a valid boolean value");if(!1!==ab)if(null!=al){if(null!=al.useH2c&&"boolean"!=typeof al.useH2c)throw new l("h2Options.useH2c must be a valid boolean value");if(al.settings?.initialWindowSize!=null&&(!Number.isInteger(al.settings.initialWindowSize)||al.settings.initialWindowSize<1))throw new l("h2Options.settings.initialWindowSize must be a positive integer, greater than 0");if(null!=al.maxConcurrentStreams&&(!Number.isInteger(al.maxConcurrentStreams)||al.maxConcurrentStreams<1))throw new l("h2Options.maxConcurrentStreams must be a positive integer, greater than 0");if(null!=al.connectionWindowSize&&(!Number.isInteger(al.connectionWindowSize)||al.connectionWindowSize<1))throw new l("h2Options.connectionWindowSize must be a positive integer, greater than 0");if(null!=al.pingInterval&&("number"!=typeof al.pingInterval||!Number.isInteger(al.pingInterval)||al.pingInterval<0))throw new l("h2Options.pingInterval must be a positive integer, greater or equal to 0")}else{if(null!=ac&&"boolean"!=typeof ac)throw ah("useH2c"),new l("useH2c must be a valid boolean value");if(null!=Z&&("number"!=typeof Z||Z<1))throw ah("maxConcurrentStreams"),new l("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=af&&(!Number.isInteger(af)||af<1))throw ah("initialWindowSize"),new l("initialWindowSize must be a positive integer, greater than 0");if(null!=ag&&(!Number.isInteger(ag)||ag<1))throw ah("connectionWindowSize"),new l("connectionWindowSize must be a positive integer, greater than 0");if(null!=ai&&("number"!=typeof ai||!Number.isInteger(ai)||ai<0))throw ah("pingInterval"),new l("pingInterval must be a positive integer, greater or equal to 0")}if(super({webSocket:aj,eventSource:am}),"function"!=typeof A)A=o({...w,maxCachedSessions:z,allowH2:ab,socketPath:t,useH2c:al?.useH2c??ac,timeout:h,..."boolean"==typeof T?{autoSelectFamily:T,autoSelectFamilyAttemptTimeout:U}:void 0,...A});else{const a=A;A=(b,c)=>a({...b,...null!=t?{socketPath:t}:null,...null!=ab?{allowH2:ab}:null},c)}this[p]=g.parseOrigin(a),this[$]=`${this[p].hostname}${this[p].port?`:${this[p].port}`:""}`,this[P]=A,this[H]=null!=v?v:1,this[J]=b,this[C]=null==m?4e3:m,this[K]=null==r?6e5:r,this[L]=null==s?2e3:s,this[I]=this[C],this[q]=null,this[V]=null!=R?R:null,this[u]=0,this[B]=0,this[D]=`host: ${this[$]}\r
|
|
182
182
|
`,this[N]=null!=i?i:3e5,this[M]=null!=c?c:3e5,this[O]=null==x||x,this[Q]=G,this[ad]=null,this[W]=S>-1?S:-1,this[Y]=null,this[aa]={pingInterval:al?.pingInterval??ai??6e4,connectionWindowSize:al?.connectionWindowSize??ag??524288,maxConcurrentStreams:al?.maxConcurrentStreams??Z??100,sessionOptions:{initialWindowSize:al?.initialWindowSize??af??262144}},this[y]=[],this[F]=0,this[E]=0,this[_]=a=>ao(this,a),this[X]=a=>ak(this,a)}get pipelining(){return this[H]}set pipelining(a){this[H]=a,this[_](!0)}get stats(){return new h(this)}get[w](){return this[y].length-this[E]}get[v](){return this[E]-this[F]}get[x](){return this[y].length-this[F]}get[z](){return!!this[Y]&&!this[A]&&!this[Y].destroyed}get[s](){let a=this[Y]?.version==="h2";return!!(this[Y]?.busy(null)||this[x]>=(ai(this)||1)||this[w]>0&&!a)}[t](a){al(this),this.once("connect",a)}[U](a,b){let c=new j(this[p].origin,a,b);return this[y].push(c),this[u]||(null==g.bodyLength(c.body)&&g.isIterable(c.body)?(this[u]=1,queueMicrotask(()=>ao(this))):this[_](!0)),this[u]&&2!==this[B]&&this[s]&&(this[B]=2),this[B]<2}[S](){return new Promise(a=>{this[x]?this[ad]=a:a(null)})}[T](a){return new Promise(b=>{let c=this[y].splice(this[E]);for(let b=0;b<c.length;b++){let d=c[b];null!=d&&g.errorRequest(this,d,a)}let d=()=>{this[ad]&&(this[ad](),this[ad]=null),b(null)};this[Y]?(this[Y].destroy(a,d),this[Y]=null):queueMicrotask(d),this[_]()})}}function ak(a,b){if(0===a[v]&&"UND_ERR_INFO"!==b.code&&"UND_ERR_SOCKET"!==b.code){d(a[E]===a[F]);let c=a[y].splice(a[F]);for(let d=0;d<c.length;d++){let e=c[d];null!=e&&g.errorRequest(a,e,b)}d(0===a[x])}}function al(a){d(!a[A]),d(!a[Y]);let{host:b,hostname:c,protocol:f,port:h}=a[p];if("["===c[0]){let a=c.indexOf("]");d(-1!==a);let b=c.substring(1,a);d(e.isIPv6(b)),c=b}a[A]=!0,i.beforeConnect.hasSubscribers&&i.beforeConnect.publish({connectParams:{host:b,hostname:c,protocol:f,port:h,version:a[Y]?.version,servername:a[q],localAddress:a[V]},connector:a[P]});try{a[P]({host:b,hostname:c,protocol:f,port:h,servername:a[q],localAddress:a[V]},(e,j)=>{if(e){am(a,e,{host:b,hostname:c,protocol:f,port:h}),a[_]();return}if(a.destroyed){g.destroy(j.on("error",af),new n),a[_]();return}d(j);try{a[Y]="h2"===j.alpnProtocol?ac(a,j):ab(a,j)}catch(d){j.destroy().on("error",af),am(a,d,{host:b,hostname:c,protocol:f,port:h}),a[_]();return}a[A]=!1,j[R]=0,j[Q]=a[Q],j[r]=a,j[G]=null,i.connected.hasSubscribers&&i.connected.publish({connectParams:{host:b,hostname:c,protocol:f,port:h,version:a[Y]?.version,servername:a[q],localAddress:a[V]},connector:a[P],socket:j}),a.emit("connect",a[p],[a]),a[_]()})}catch(d){am(a,d,{host:b,hostname:c,protocol:f,port:h}),a[_]()}}function am(a,b,{host:c,hostname:d,protocol:e,port:f}){if(!a.destroyed){if(a[A]=!1,i.connectError.hasSubscribers&&i.connectError.publish({connectParams:{host:c,hostname:d,protocol:e,port:f,version:a[Y]?.version,servername:a[q],localAddress:a[V]},connector:a[P],error:b}),"ERR_TLS_CERT_ALTNAME_INVALID"===b.code){let c=a[y].splice(a[F],a[v]);a[E]=a[F];for(let d=0;d<c.length;d++)g.errorRequest(a,c[d],b);for(;a[w]>0&&a[y][a[E]].servername===a[q];){let c=a[y].splice(a[E],1)[0];g.errorRequest(a,c,b)}}else ak(a,b);a.emit("connectionError",a[p],[a],b)}}function an(a){a[B]=0,a.emit("drain",a[p],[a])}function ao(a,b){2!==a[u]&&(a[u]=2,function(a,b){for(;;){if(a.destroyed)return void d(0===a[w]);if(a[ad]&&!a[x]){a[ad](),a[ad]=null;return}if(a[Y]&&a[Y].resume(),a[s])a[B]=2;else if(2===a[B]){b?(a[B]=1,queueMicrotask(()=>an(a))):an(a);continue}if(0===a[w]||a[v]>=(ai(a)||1))return;let c=a[y][a[E]];if(null===c)return;if(c.aborted){a[y].splice(a[E],1);continue}if("https:"===a[p].protocol&&a[q]!==c.servername){if(a[v]>0)return;a[q]=c.servername,a[Y]?.destroy(new m("servername changed"),()=>{a[Y]=null,ao(a)})}if(a[A])return;if(!a[Y]){a[q]=c.servername,al(a);return}if(a[Y].destroyed||a[Y].busy(c))return;!c.aborted&&a[Y].write(c)?a[E]++:a[y].splice(a[E],1)}}(a,b),a[u]=0,a[F]>256&&(a[y].splice(0,a[F]),a[E]-=a[F],a[F]=0))}a.exports=aj},40404:(a,b,c)=>{"use strict";c.d(b,{T:()=>y});var d=c(22256);let e=`You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.
|
|
183
183
|
|
|
184
184
|
## General
|
|
@@ -298,7 +298,7 @@ You are producing plain text that will later be styled by the CLI. Follow these
|
|
|
298
298
|
* Examples: src/app.ts, src/app.ts:42, b/server/index.js#L10, C:\\repo\\project\\main.rs:12:5`;var f=c(38421),g=c(98976),h=c(10342),i=c(26408),j=c(13161),k=c(86363),l=c(49623),m=c(97137),n=c(68531),o=c(82689),p=c(73081);let q=new TextEncoder;var r=c(44140),s=c(50969);let t=new Map,u=/^(rs|fc|resp|msg)_/,v=new Set(["image_generation","web_search","web_search_preview","file_search","computer","computer_use_preview","code_interpreter","mcp","local_shell","tool_search"]),w=new Set(["custom"]),x=new Set(["model","input","instructions","tools","tool_choice","stream","store","reasoning","service_tier","include","prompt_cache_key","client_metadata","text"]);class y extends d.Hv{constructor(){super("codex",f.xq.codex),this._currentSessionId=null}buildHeaders(a,b=!0){let c=super.buildHeaders(a,b);c.session_id=this._currentSessionId||a?.connectionId||"default",c.originator||(c.originator="codex_cli_rs");let d=a?.providerSpecificData?.workspaceId;return"string"==typeof d&&d&&!c["chatgpt-account-id"]&&(c["chatgpt-account-id"]=d),c}buildUrl(a,b,c=0,d=null){let e=super.buildUrl(a,b,c,d);return this._isCompact?`${e}/compact`:e}async refreshCredentials(a,b){return a?.refreshToken?(0,g.Vq)("codex",a,b):null}needsRefresh(a){return(0,g.fp)("codex",a)}async prefetchImages(a){if(Array.isArray(a?.input))for(let b of a.input){if(!Array.isArray(b.content))continue;let a=b.content.map(async a=>{if("image_url"!==a.type)return a;let b="string"==typeof a.image_url?a.image_url:a.image_url?.url,c=a.image_url?.detail||"auto";if(!b)return a;if(b.startsWith("data:"))return{type:"input_image",image_url:b,detail:c};let d=await (0,i.ni)(b,{timeoutMs:15e3});return{type:"input_image",image_url:d?.url||b,detail:c}});b.content=await Promise.all(a)}}async execute(a){let b=Array.isArray(a.body?.input)?a.body.input.reduce((a,b)=>a+(Array.isArray(b.content)?b.content.filter(a=>"image_url"===a.type).length:0),0):0,c=Array.isArray(a.body?.input)?a.body.input.length:0;if((0,k.s)("CODEX",`execute start | inputItems=${c} | images=${b} | session=${this._currentSessionId?"resolved":"pending"}`),b>0){let b=Date.now();await this.prefetchImages(a.body),(0,k.s)("CODEX",`prefetchImages done | ${Date.now()-b}ms`)}else await this.prefetchImages(a.body);let d="off"!==process.env.CODEX_WS_TRANSPORT?await this._executeOverWebSocket(a):null;return d||(0,m.v)({execute:()=>super.execute(a),retryConfig:this.config.retry,signal:a.signal,log:a.log,provider:"codex"})}async _executeOverWebSocket(a){let b;if("off"===process.env.CODEX_WS_TRANSPORT||process.env.VITEST||a.body?._compact||!1===a.stream||a.proxyOptions?.vercelRelayUrl||a.signal?.aborted)return null;try{b=structuredClone(a.body)}catch{return null}let c=null;try{var d;let e,f,g=this.transformRequest(a.model,b,a.stream,a.credentials),h=this.buildUrl(a.model,a.stream,0,a.credentials);if((0,s.WV)(h))return null;let i=(0,s.ip)(h,a.proxyOptions);if(d=i||"direct",(f=t.get(d))||(f={failures:0,openUntil:0},t.set(d,f)),c=f,Date.now()<c.openUntil)return null;let j={...this.buildHeaders(a.credentials,a.stream,h,a.model)},{headers:l}=(0,r.fX)(j,{identity:this.resolveIdentity(a.credentials),provider:"codex",format:a.credentials?.runtimeTransport?.format||this.config.format,credentialId:a.credentials?.connectionId||a.credentials?.apiKey||a.credentials?.accessToken,stream:!0});if(delete l["Content-Type"],delete l.Accept,i)try{e=await (0,s.wo)(i)}catch(b){if(a.proxyOptions?.strictProxy===!0)return null;a.log?.warn?.("CODEX-WS",`proxy dispatcher unavailable, connecting direct: ${b.message}`)}let m=function({wsUrl:a,headers:b,request:c,WebSocket:d=globalThis.WebSocket,signal:e,dispatcher:f,connectTimeoutMs:g=o.pH}={}){let h,i,j;if("function"!=typeof d)throw Error("no WebSocket implementation available");try{h=new d(a,f?{headers:b,dispatcher:f}:{headers:b})}catch(a){throw Error(`codex ws connect failed: ${a.message}`)}let l=null,m=[],r=!1,s=!1,t=!1,u=!1,v=new Promise((a,b)=>{i=a,j=b}),w=(a,b=!0)=>{if(!t){t=!0,clearTimeout(y),e?.removeEventListener?.("abort",x);try{h.close()}catch{}if(s||(s=!0,a?j(a):i()),b&&l)try{a?l.error(a):l.close()}catch{}}},x=()=>w(new DOMException("The operation was aborted.","AbortError"));e?.addEventListener?.("abort",x,{once:!0});let y=setTimeout(()=>{w(Object.assign(Error("codex ws first frame timeout"),{code:"codex_ws_timeout",status:504}))},g);y.unref?.(),e?.aborted&&x();let z=()=>{if(l&&!t)for(;m.length>0&&l.desiredSize>0;)try{l.enqueue(m.shift())}catch{break}},A=()=>{r&&0===m.length&&w()};return h.onopen=()=>{if(!t)try{h.send(JSON.stringify({type:"response.create",...c})),u=!0,(0,k.s)("CODEX-WS",`opened ${a} | request sent`)}catch(a){w(Error(`codex ws send failed: ${a.message}`))}},h.onerror=()=>w(Error(u?"codex ws transport failed":"codex ws handshake failed")),{response:new Response(new ReadableStream({start(a){l=a,h.onmessage=a=>{if(t)return;let b="string"==typeof a.data?a.data:"",c=null;try{c=JSON.parse(b)}catch{}let d=c?.type||null;if(d){if(!s){if("error"===d)return void w(Object.assign(Error(c?.error?.message||"codex ws error frame"),{status:Number(c?.status)||502,code:"codex_ws_error_frame"}));s=!0,clearTimeout(y),i()}m.push(q.encode(`event: ${d}
|
|
299
299
|
data: ${b}
|
|
300
300
|
|
|
301
|
-
`)),(0,p.nu)(d,{response:{}})&&((0,k.s)("CODEX-WS",`terminal ${d} | closing`),r=!0),z(),A()}},h.onclose=()=>{if(!t){if(r){try{for(;m.length>0;)l.enqueue(m.shift())}catch{}w();return}w(Error("codex ws closed before terminal event"))}}},pull(){z(),A()},cancel(){w(null,!1)}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Switchboard-Transport":"responses-websocket"}}),url:a,headers:b,ready:v,format:n.h.OPENAI_RESPONSES}}({wsUrl:String(h).replace(/^http:\/\//i,"ws://").replace(/^https:\/\//i,"wss://"),headers:l,request:g,signal:a.signal,...e?{dispatcher:e}:{}});return await m.ready,c.failures=0,(0,k.s)("CODEX-WS",`transport=responses_websocket | ${h}`),{response:m.response,url:h,headers:l,transformedBody:g}}catch(d){if(d?.name==="AbortError")throw d;let b=c&&d?.code!=="codex_ws_error_frame";return b&&(c.failures+=1),b&&c.failures>=3?(c.openUntil=Date.now()+3e5,c.failures=0,a.log?.warn?.("CODEX-WS",`websocket transport failing repeatedly, pausing attempts for 5 minutes: ${d.message}`)):a.log?.warn?.("CODEX-WS",`websocket transport failed, falling back to HTTP: ${d.message}`),(0,k.s)("CODEX-WS",`handshake failed: ${d.message}`),null}}parseError(a,b){if(429===a.status&&b)try{let a=JSON.parse(b),c=a?.error;if(c?.type==="usage_limit_reached"){let a=Date.now(),d=null;if("number"==typeof c.resets_at&&c.resets_at>0){let b=1e3*c.resets_at;b>a&&(d=b)}if(!d&&"number"==typeof c.resets_in_seconds&&c.resets_in_seconds>0&&(d=a+1e3*c.resets_in_seconds),d)return{status:429,message:c.message||b,resetsAtMs:d}}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){this._isCompact=!!b._compact,delete b._compact,this._currentSessionId=(0,l.oV)({headers:d?.rawHeaders,body:b,connectionId:d?.connectionId,workspaceId:d?.providerSpecificData?.workspaceId,scope:"codex"});let f=(0,h.m)(b.input);if(f&&(b.input=f),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(b.input=[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]),Array.isArray(b.input))for(let a of b.input)!(!a||"object"!=typeof a||Array.isArray(a))&&("system"!==a.role||a.type&&"message"!==a.type||(a.role="developer"));Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&u.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&u.test(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c="string"==typeof a.type?a.type:"";if("namespace"===c){if(Array.isArray(a.tools))for(let c of a.tools){let a="string"==typeof c?.name?c.name.trim().slice(0,128):"";a&&b.add(a)}return!0}if("function"!==c)return!!w.has(c)||!!c&&!a.function&&"string"!=typeof a.name&&v.has(c);let d=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,e=("string"==typeof a.name?a.name:"string"==typeof d?.name?d.name:"").trim();if(!e)return!1;let f="string"==typeof a.description?a.description:"string"==typeof d?.description?d.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:d?.parameters&&"object"==typeof d.parameters&&!Array.isArray(d.parameters)?d.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=e.slice(0,128),f&&(a.description=f),a.parameters=g,b.add(e),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"";c&&b.has(c)||delete a.tool_choice}}(b),b.stream=!0,b.instructions&&""!==b.instructions.trim()||(b.instructions=e),b.store=!1,!b.prompt_cache_key&&this._currentSessionId&&(b.prompt_cache_key=this._currentSessionId),b.model=(0,j.kt)("cx",b.model||a);let g=null;for(let a of["none","low","medium","high","xhigh"])if(b.model.endsWith(`-${a}`)){g=a,b.model=b.model.replace(`-${a}`,"");break}if(b.reasoning)b.reasoning.summary||(b.reasoning.summary="auto");else{let a=b.reasoning_effort||g||"low";b.reasoning={effort:a,summary:"auto"}}for(let a of(delete b.reasoning_effort,b.reasoning&&b.reasoning.effort&&"none"!==b.reasoning.effort&&(b.include=["reasoning.encrypted_content"]),delete b.temperature,delete b.top_p,delete b.frequency_penalty,delete b.presence_penalty,delete b.logprobs,delete b.top_logprobs,delete b.n,delete b.seed,delete b.max_tokens,delete b.max_completion_tokens,delete b.max_output_tokens,delete b.user,delete b.prompt_cache_retention,delete b.metadata,delete b.stream_options,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))x.has(a)||delete b[a];return b}}},40603:(a,b,c)=>{"use strict";let{EventEmitter:d}=c(78474),{Buffer:e}=c(4573),{InvalidArgumentError:f,Socks5ProxyError:g}=c(61448),{debuglog:h}=c(57975),{parseAddress:i}=c(33297),j=h("undici:socks5"),k=e.alloc(0),l={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},m={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},n={IPV4:1,DOMAIN:3,IPV6:4},o={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},p={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"};class q extends d{constructor(a,b={}){if(super(),!a)throw new f("socket is required");this.socket=a,this.options=b,this.state=p.INITIAL,this.buffer=k,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],b.username&&b.password&&this.authMethods.push(l.USERNAME_PASSWORD),this.authMethods.push(l.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(a){j("received data",a.length,"bytes in state",this.state),this.buffer=e.concat([this.buffer,a]);try{switch(this.state){case p.HANDSHAKING:this.handleHandshakeResponse();break;case p.AUTHENTICATING:this.handleAuthResponse();break;case p.CONNECTING:this.handleConnectResponse()}}catch(a){this.onError(a)}}onError(a){j("socket error",a),this.state=p.ERROR,this.emit("error",a),this.destroy()}onClose(){j("socket closed"),this.state=p.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=p.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==p.INITIAL)throw new f("Handshake already started");j("starting handshake with",this.authMethods.length,"auth methods"),this.state=p.HANDSHAKING;let a=e.alloc(2+this.authMethods.length);a[0]=5,a[1]=this.authMethods.length,this.authMethods.forEach((b,c)=>{a[2+c]=b}),this.socket.write(a)}handleHandshakeResponse(){if(this.buffer.length<2)return;let a=this.buffer[0],b=this.buffer[1];if(5!==a)throw new g(`Invalid SOCKS version: ${a}`,"UND_ERR_SOCKS5_VERSION");if(b===l.NO_ACCEPTABLE)throw new g("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),j("server selected auth method",b),b===l.NO_AUTH)this.markAuthenticated();else if(b===l.USERNAME_PASSWORD)this.state=p.AUTHENTICATING,this.sendAuthRequest();else throw new g(`Unsupported authentication method: ${b}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:a,password:b}=this.options;if(!a||!b)throw new f("Username and password required for authentication");j("sending username/password auth");let c=e.from(a),d=e.from(b);if(c.length>255||d.length>255)throw new f("Username or password too long");let g=e.alloc(3+c.length+d.length);g[0]=1,g[1]=c.length,c.copy(g,2),g[2+c.length]=d.length,d.copy(g,3+c.length),this.socket.write(g)}handleAuthResponse(){if(this.buffer.length<2)return;let a=this.buffer[0],b=this.buffer[1];if(1!==a)throw new g(`Invalid auth sub-negotiation version: ${a}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(0!==b)throw new g("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),j("authentication successful"),this.markAuthenticated()}connect(a,b){if(this.state===p.CONNECTING||this.state===p.CONNECTED)throw new f("Connection already in progress");if(this.state!==p.AUTHENTICATED)throw new f("Client must be authenticated before CONNECT");j("connecting to",a,b),this.state=p.CONNECTING;let c=this.buildConnectRequest(m.CONNECT,a,b);this.socket.write(c)}buildConnectRequest(a,b,c){let{type:d,buffer:f}=i(b),g=e.alloc(4+f.length+2);return g[0]=5,g[1]=a,g[2]=0,g[3]=d,f.copy(g,4),g.writeUInt16BE(c,4+f.length),g}handleConnectResponse(){let a;if(this.buffer.length<4)return;let b=this.buffer[0],c=this.buffer[1],d=this.buffer[3];if(5!==b)throw new g(`Invalid SOCKS version in reply: ${b}`,"UND_ERR_SOCKS5_REPLY_VERSION");let e=4;if(d===n.IPV4)e+=6;else if(d===n.DOMAIN){if(this.buffer.length<5)return;e+=1+this.buffer[4]+2}else if(d===n.IPV6)e+=18;else throw new g(`Invalid address type in reply: ${d}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length<e)return;if(c!==o.SUCCEEDED){let a=this.getReplyErrorMessage(c);throw new g(`SOCKS5 connection failed: ${a}`,`UND_ERR_SOCKS5_REPLY_${c}`)}let f=4;if(d===n.IPV4)a=Array.from(this.buffer.subarray(f,f+4)).join("."),f+=4;else if(d===n.DOMAIN){let b=this.buffer[f];f+=1,a=this.buffer.subarray(f,f+b).toString(),f+=b}else if(d===n.IPV6){let b=[];for(let a=0;a<8;a++){let c=this.buffer.readUInt16BE(f+2*a);b.push(c.toString(16))}a=b.join(":"),f+=16}let h=this.buffer.readUInt16BE(f);this.buffer=k,this.state=p.CONNECTED,this.socket.removeListener("data",this.onSocketData),j("connected, bound address:",a,"port:",h),this.emit("connected",{address:a,port:h})}getReplyErrorMessage(a){switch(a){case o.GENERAL_FAILURE:return"General SOCKS server failure";case o.CONNECTION_NOT_ALLOWED:return"Connection not allowed by ruleset";case o.NETWORK_UNREACHABLE:return"Network unreachable";case o.HOST_UNREACHABLE:return"Host unreachable";case o.CONNECTION_REFUSED:return"Connection refused";case o.TTL_EXPIRED:return"TTL expired";case o.COMMAND_NOT_SUPPORTED:return"Command not supported";case o.ADDRESS_TYPE_NOT_SUPPORTED:return"Address type not supported";default:return`Unknown error code: ${a}`}}}a.exports={Socks5Client:q,AUTH_METHODS:l,COMMANDS:m,ADDRESS_TYPES:n,REPLY_CODES:o,STATES:p}},41702:(a,b,c)=>{var d=c(45654);c(33889),d.mgf=d.mgf||{},(a.exports=d.mgf.mgf1=d.mgf1=d.mgf1||{}).create=function(a){return{generate:function(b,c){for(var e=new d.util.ByteBuffer,f=Math.ceil(c/a.digestLength),g=0;g<f;g++){var h=new d.util.ByteBuffer;h.putInt32(g),a.start(),a.update(b+h.getBytes()),e.putBuffer(a.digest())}return e.truncate(e.length()-c),e.getBytes()}}}},41883:(a,b,c)=>{"use strict";c.d(b,{w:()=>k});var d=c(22256),e=c(38421),f=c(96997),g=c(50969);let h=new Map;function i(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("authorized_user"===b.type&&b.client_id&&b.client_secret&&b.refresh_token)return b;return null}catch{return null}}async function j(a,b,c,d){if(h.has(a))return h.get(a);let e=await (0,g.Fm)(`https://aiplatform.googleapis.com/v1/publishers/google/models/__probe__:generateContent?key=${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}",identity:c.identity,provider:b,format:c.format},d),f=await e.json().catch(()=>null),i=(f?.[0]?.error?.message||f?.error?.message||"").match(/projects\/([^/]+)\//),j=i?.[1]||null;return j&&h.set(a,j),j}class k extends d.Hv{constructor(a="vertex"){super(a,e.xq[a]||{})}buildUrl(a,b,c=0,d=null){let e=(0,f.Sc)(d?.apiKey),g=i(d?.apiKey),h=!!e||!!g||!!d?.accessToken,j=h?null:d?.apiKey,k=e?.project_id||g?.quota_project_id||d?.providerSpecificData?.projectId;if("vertex-partner"===this.provider){if(!k)throw Error("Vertex partner models require a project_id. Add it in providerSpecificData or use Service Account JSON.");let a=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/global/endpoints/openapi/chat/completions`;return j?`${a}?key=${j}`:a}let l=b?"streamGenerateContent":"generateContent";if(h){if(!k)throw Error("Vertex OAuth/ADC requires a project_id. Add quota_project_id to your ADC JSON or set providerSpecificData.projectId.");let c=d?.providerSpecificData?.location||"us-central1",e=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/${c}/publishers/google/models/${a}:${l}`;return b&&(e+="?alt=sse"),e}let m=`https://aiplatform.googleapis.com/v1/publishers/google/models/${a}:${l}`;return b&&(m+="?alt=sse"),j&&(m+=b?`&key=${j}`:`?key=${j}`),m}buildHeaders(a,b=!0){let c={"Content-Type":"application/json"};return a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),b&&(c.Accept="text/event-stream"),c}async refreshCredentials(a,b,c=null){let d=(0,f.Sc)(a?.apiKey);if(d){let a=await (0,f.pb)(d,b);return a?{accessToken:a.accessToken,expiresAt:a.expiresAt}:null}let e=i(a?.apiKey);if(e){let a=await (0,f.I9)(e.refresh_token,e.client_id,e.client_secret,b,this.provider,c);return a?.accessToken?{accessToken:a.accessToken,expiresAt:a.expiresAt}:null}return null}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:h,proxyOptions:k=null}){let l=(0,f.Sc)(d?.apiKey),m=i(d?.apiKey);if(l){let a=await (0,f.pb)(l,h);if(!a?.accessToken)throw Error("Vertex: failed to mint access token from Service Account JSON");d.accessToken=a.accessToken}if(m){let a=await (0,f.I9)(m.refresh_token,m.client_id,m.client_secret,h,this.provider,k);if(!a?.accessToken)throw Error("Vertex: failed to refresh access token from ADC JSON (authorized_user)");d.accessToken=a.accessToken}if("vertex-partner"===this.provider&&!l&&!m&&!d?.providerSpecificData?.projectId){let a=await j(d.apiKey,this.provider,this.config,k);if(!a)throw Error("Vertex: could not resolve project_id from API key. Please add it manually in provider settings.");h?.debug?.("VERTEX",`Resolved project_id: ${a}`),d.providerSpecificData={...d.providerSpecificData,projectId:a}}let n=this.buildUrl(a,c,0,d),o=this.buildHeaders(d,c),p=this.transformRequest(a,b,c,d);return{response:await (0,g.Fm)(n,{method:"POST",headers:o,body:JSON.stringify(p),signal:e,identity:this.resolveIdentity(d),provider:this.provider,format:this.config?.format},k),url:n,headers:o,transformedBody:p}}}},42425:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),e=c(38522),{redirectStatusSet:f,referrerPolicyTokens:g,badPortsSet:h}=c(19608),{getGlobalOrigin:i}=c(79412),{collectAnHTTPQuotedString:j,parseMIMEType:k}=c(16537),{performance:l}=c(643),{isValidHTTPToken:m,normalizedMethodRecordsBase:n}=c(84285),o=c(34589),{isUint8Array:p}=c(73429),{webidl:q}=c(32984),{isomorphicEncode:r,collectASequenceOfCodePoints:s,removeChars:t}=c(70745);function u(a){let b=a.urlList,c=b.length;return 0===c?null:b[c-1].toString()}function v(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>126||c<32)return!1}return!0}function w(a){return a.urlList[a.urlList.length-1]}function x(a){return!1===(" "===a[0]||" "===a[0]||" "===a[a.length-1]||" "===a[a.length-1]||a.includes("\n")||a.includes("\r")||a.includes("\0"))}function y(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function z(a,b=!1){return(o(q.is.URL(a)),I(a=new URL(a)))?"no-referrer":(a.username="",a.password="",a.hash="",!0===b&&(a.pathname="",a.search=""),a)}let A=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),B=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function C(a){return a.includes(":")?("["===a[0]&&"]"===a[a.length-1]&&(a=a.slice(1,-1)),B(a)):A(a)}function D(a){var b;return!!q.is.URL(a)&&("about:blank"===a.href||"about:srcdoc"===a.href||"data:"===a.protocol||"blob:"===a.protocol||null!=(b=a.origin)&&"null"!==b&&(!!("https:"===(b=new URL(b)).protocol||"wss:"===b.protocol||C(b.hostname)||"localhost"===b.hostname||"localhost."===b.hostname||b.hostname.endsWith(".localhost")||b.hostname.endsWith(".localhost."))||"file:"===b.protocol))}function E(a,b){return a.origin===b.origin&&"null"===a.origin||a.protocol===b.protocol&&a.hostname===b.hostname&&a.port===b.port}let F=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function G(a,b,c=0,d=1){class e{#I;#aG;#aH;constructor(a,b){this.#I=a,this.#aG=b,this.#aH=0}next(){let e;if("object"!=typeof this||this===null||!(#I in this))throw TypeError(`'next' called on an object that does not implement interface ${a} Iterator.`);let f=this.#aH,g=b(this.#I);if(f>=g.length)return{value:void 0,done:!0};let{[c]:h,[d]:i}=g[f];switch(this.#aH=f+1,this.#aG){case"key":e=h;break;case"value":e=i;break;case"key+value":e=[h,i]}return{value:e,done:!1}}}return delete e.prototype.constructor,Object.setPrototypeOf(e.prototype,F),Object.defineProperties(e.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${a} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(a,b){return new e(a,b)}}async function H(a,b,c){try{let d=[],e=0;for(;;){let{done:f,value:g}=await a.read();if(f)return void b(Buffer.concat(d,e));if(!p(g))return void c(TypeError("Received non-Uint8Array chunk"));d.push(g),e+=g.length}}catch(a){c(a)}}function I(a){o("protocol"in a);let b=a.protocol;return"about:"===b||"blob:"===b||"data:"===b}function J(a){return"string"==typeof a&&":"===a[5]&&"h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3]&&"s"===a[4]||"https:"===a.protocol}function K(a){o("protocol"in a);let b=a.protocol;return"http:"===b||"https:"===b}class L extends d{#aI;constructor(a){super(),this.#aI=a}_transform(a,b,c){if(!this._inflateStream){if(0===a.length)return void c();this._inflateStream=(15&a[0])==8?e.createInflate(this.#aI):e.createInflateRaw(this.#aI),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",a=>this.destroy(a))}this._inflateStream.write(a,b,c)}_final(a){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),a()}}function M(a,b){let c=b.get(a,!0);if(null===c)return null;let d={position:0},e=[],f="";for(;d.position<c.length;){if(f+=s(a=>'"'!==a&&","!==a,c,d),d.position<c.length)if(34===c.charCodeAt(d.position)){if(f+=j(c,d),d.position<c.length)continue}else o(44===c.charCodeAt(d.position)),d.position++;f=t(f,!0,!0,a=>9===a||32===a),e.push(f),f=""}return e}class N{get baseUrl(){return i()}get origin(){return this.baseUrl?.origin}policyContainer=y()}class O{settingsObject=new N}a.exports={isAborted:function(a){return"aborted"===a.controller.state},isCancelled:function(a){return"aborted"===a.controller.state||"terminated"===a.controller.state},isValidEncodedURL:v,tryUpgradeRequestToAPotentiallyTrustworthyURL:function(a){},clampAndCoarsenConnectionTimingInfo:function(a,b,c){return!a?.startTime||a.startTime<b?{domainLookupStartTime:b,domainLookupEndTime:b,connectionStartTime:b,connectionEndTime:b,secureConnectionStartTime:b,ALPNNegotiatedProtocol:a?.ALPNNegotiatedProtocol}:{domainLookupStartTime:a.domainLookupStartTime,domainLookupEndTime:a.domainLookupEndTime,connectionStartTime:a.connectionStartTime,connectionEndTime:a.connectionEndTime,secureConnectionStartTime:a.secureConnectionStartTime,ALPNNegotiatedProtocol:a.ALPNNegotiatedProtocol}},coarsenedSharedCurrentTime:function(a){return l.now()},determineRequestsReferrer:function(a){let b=a.referrerPolicy;o(b);let c=null;if("client"===a.referrer){let a=i();if(!a||"null"===a.origin)return"no-referrer";c=new URL(a)}else q.is.URL(a.referrer)&&(c=a.referrer);let d=z(c),e=z(c,!0);switch(d.toString().length>4096&&(d=e),b){case"no-referrer":return"no-referrer";case"origin":if(null!=e)return e;return z(c,!0);case"unsafe-url":return d;case"strict-origin":{let b=w(a);if(D(d)&&!D(b))return"no-referrer";return e}case"strict-origin-when-cross-origin":{let b=w(a);if(E(d,b))return d;if(D(d)&&!D(b))return"no-referrer";return e}case"same-origin":if(E(a,d))return d;return"no-referrer";case"origin-when-cross-origin":if(E(a,d))return d;return e;case"no-referrer-when-downgrade":{let b=w(a);if(D(d)&&!D(b))return"no-referrer";return d}}},makePolicyContainer:y,clonePolicyContainer:function(a){return{referrerPolicy:a.referrerPolicy}},appendFetchMetadata:function(a){if(!D(w(a)))return;let b=null;b=a.mode,a.headersList.set("sec-fetch-mode",b,!0)},appendRequestOriginHeader:function(a){let b=a.origin;if("client"!==b&&void 0!==b){if("cors"===a.responseTainting||"websocket"===a.mode)a.headersList.append("origin",b,!0);else if("GET"!==a.method&&"HEAD"!==a.method){switch(a.referrerPolicy){case"no-referrer":b=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":a.origin&&J(a.origin)&&!J(w(a))&&(b=null);break;case"same-origin":E(a,w(a))||(b=null)}a.headersList.append("origin",b,!0)}}},TAOCheck:function(){return"success"},corsCheck:function(){return"success"},crossOriginResourcePolicyCheck:function(){return"allowed"},createOpaqueTimingInfo:function(a){return{startTime:a.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:a.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}},setRequestReferrerPolicyOnRedirect:function(a,b){let c=function(a){let b=(a.headersList.get("referrer-policy",!0)??"").split(","),c="";if(b.length)for(let a=b.length;0!==a;a--){let d=b[a-1].trim();if(g.has(d)){c=d;break}}return c}(b);""!==c&&(a.referrerPolicy=c)},isValidHTTPToken:m,requestBadPort:function(a){let b=w(a);return K(b)&&h.has(b.port)?"blocked":"allowed"},requestCurrentURL:w,responseURL:u,responseLocationURL:function(a,b){var c;if(!f.has(a.status))return null;let d=a.headersList.get("location",!0);return null!==d&&x(d)&&(v(d)||(c=d,d=Buffer.from(c,"binary").toString("utf8")),d=new URL(d,u(a))),d&&!d.hash&&(d.hash=b),d},isURLPotentiallyTrustworthy:D,isValidReasonPhrase:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(!(9===c||c>=32&&c<=126||c>=128&&c<=255))return!1}return!0},sameOrigin:E,normalizeMethod:function(a){return n[a.toLowerCase()]??a},iteratorMixin:function(a,b,c,d=0,e=1,f){let g=G(a,c,d,e),h={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return q.brandCheck(this,f),g(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return q.brandCheck(this,f),g(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return q.brandCheck(this,f),g(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(b,c=globalThis){if(q.brandCheck(this,f),q.argumentLengthCheck(arguments,1,`${a}.forEach`),"function"!=typeof b)throw TypeError(`Failed to execute 'forEach' on '${a}': parameter 1 is not of type 'Function'.`);for(let{0:a,1:d}of g(this,"key+value"))b.call(c,d,a,this)}}};return Object.defineProperties(b.prototype,{...h,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:h.entries.value}})},createIterator:G,isValidHeaderName:m,isValidHeaderValue:x,isErrorLike:function(a){return a instanceof Error||a?.constructor?.name==="Error"||a?.constructor?.name==="DOMException"},fullyReadBody:function(a,b,c){try{let d=a.stream.getReader();H(d,b,c)}catch(a){c(a)}},readableStreamClose:function(a){try{a.close(),a.byobRequest?.respond(0)}catch(a){if(!a.message.includes("Controller is already closed")&&!a.message.includes("ReadableStream is already closed"))throw a}},urlIsLocal:I,urlHasHttpsScheme:J,urlIsHttpHttpsScheme:K,readAllBytes:H,simpleRangeHeaderValue:function(a,b){if(!a.startsWith("bytes"))return"failure";let c={position:5};if(b&&s(a=>" "===a||" "===a,a,c),61!==a.charCodeAt(c.position))return"failure";c.position++,b&&s(a=>" "===a||" "===a,a,c);let d=s(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),e=d.length?Number(d):null;if(b&&s(a=>" "===a||" "===a,a,c),45!==a.charCodeAt(c.position))return"failure";c.position++,b&&s(a=>" "===a||" "===a,a,c);let f=s(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),g=f.length?Number(f):null;return c.position<a.length||null===g&&null===e||null!==e&&null!==g&&e>g?"failure":{rangeStartValue:e,rangeEndValue:g}},buildContentRange:function(a,b,c){let d="bytes ";return d+=r(`${a}`),d+="-",d+=r(`${b}`),d+="/",d+=r(`${c}`)},createInflate:function(a){return new L(a)},extractMimeType:function(a){let b=null,c=null,d=null,e=M("content-type",a);if(null===e)return"failure";for(let a of e){let e=k(a);"failure"!==e&&"*/*"!==e.essence&&((d=e).essence!==c?(b=null,d.parameters.has("charset")&&(b=d.parameters.get("charset")),c=d.essence):d.parameters.has("charset")||null===b||d.parameters.set("charset",b))}return null==d?"failure":d},getDecodeSplit:M,environmentSettingsObject:new O,isOriginIPPotentiallyTrustworthy:C,hasAuthenticationEntry:function(a){return!1},includesCredentials:function(a){return!!(a.username||a.password)},isTraversableNavigable:function(a){return null!=a&&"client"!==a&&"no-traversable"!==a}}},42430:(a,b,c)=>{"use strict";let{addAbortListener:d}=c(78474),{environmentSettingsObject:e,readableStreamClose:f}=c(42425),{states:g,opcodes:h,sentCloseFrameState:i}=c(62026),{webidl:j}=c(32984),{getURLRecord:k,isValidSubprotocol:l,isEstablished:m,utf8Decode:n}=c(94050),{establishWebSocketConnection:o,failWebsocketConnection:p,closeWebSocketConnection:q}=c(4654),{channels:r}=c(62571),{WebsocketFrameSend:s}=c(45221),{ByteParser:t}=c(64821),{WebSocketError:u,createUnvalidatedWebSocketError:v}=c(87404),{kEnumerableProperty:w}=c(84285),{utf8DecodeBytes:x}=c(67449),y=!1;class z{#aJ;#aK;#aL;#aM;#aN;#aO;#aP=!1;#aQ={onConnectionEstablished:(a,b)=>this.#aR(a,b),onMessage:(a,b)=>this.#aS(a,b),onParserError:a=>p(this.#aQ,null,a.message),onParserDrain:()=>this.#aQ.socket.resume(),onSocketData:a=>{this.#aT.write(a)||this.#aQ.socket.pause()},onSocketError:a=>{this.#aQ.readyState=g.CLOSING,r.socketError.hasSubscribers&&r.socketError.publish(a),this.#aQ.socket.destroy()},onSocketClose:()=>queueMicrotask(()=>this.#aU()),onPing:()=>{},onPong:()=>{},readyState:g.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aT;constructor(a,b){y||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),y=!0),j.argumentLengthCheck(arguments,1,"WebSocket"),a=j.converters.USVString(a),null!==b&&(b=j.converters.WebSocketStreamOptions(b));const c=k(a,e.settingsObject.baseUrl),f=b.protocols;if(f.length!==new Set(f.map(a=>a.toLowerCase())).size||f.length>0&&!f.every(a=>l(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#aJ=c.toString(),this.#aK=Promise.withResolvers(),this.#aL=Promise.withResolvers(),null!=b.signal){const a=b.signal;if(a.aborted){this.#aK.reject(a.reason),this.#aL.reject(a.reason);return}d(a,()=>{m(this.#aQ.readyState)||(p(this.#aQ),this.#aQ.readyState=g.CLOSING,this.#aK.reject(a.reason),this.#aL.reject(a.reason),this.#aP=!0)})}const h=e.settingsObject;this.#aQ.controller=o(c,f,h,this.#aQ,b)}get url(){return this.#aJ.toString()}get opened(){return this.#aK.promise}get closed(){return this.#aL.promise}close(a){null!==a&&(a=j.converters.WebSocketCloseInfo(a));let b=a.closeCode??null,c=a.reason;q(this.#aQ,b,c,!0)}#aV(a){a=j.converters.WebSocketStreamWrite(a);let b=Promise.withResolvers(),c=null,d=null;if(j.is.BufferSource(a))c=new Uint8Array(ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):a.slice()),d=h.BINARY;else{let e;try{e=j.converters.DOMString(a)}catch(a){return b.reject(a),b.promise}c=new TextEncoder().encode(e),d=h.TEXT}if(this.#aQ.closeState.has(i.SENT)||this.#aQ.closeState.has(i.RECEIVED))b.resolve(void 0);else{let a=new s(c);this.#aQ.socket.write(a.createFrame(d),()=>{b.resolve(void 0)})}return b.promise}#aR(a,b){this.#aQ.socket=a.socket;let c=this.#aQ.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#aQ.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new t(this.#aQ,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#aQ.onParserDrain()),e.on("error",a=>this.#aQ.onParserError(a)),this.#aT=e,this.#aQ.readyState=g.OPEN;let f=a.headersList.get("sec-websocket-extensions")??"",h=a.headersList.get("sec-websocket-protocol")??"",i=new ReadableStream({start:a=>{this.#aN=a},pull:()=>this.#aW(),cancel:a=>this.#aX(a)}),j=new WritableStream({start:a=>{this.#aO=a},write:a=>this.#aV(a),close:()=>q(this.#aQ,null,null),abort:a=>this.#aY(a)});this.#aM=i,this.#aK.resolve({extensions:f,protocol:h,readable:i,writable:j})}#aS(a,b){let c;if(this.#aQ.readyState===g.OPEN){if(a===h.TEXT)try{c=n(b)}catch{p(this.#aQ,1007,"Received invalid UTF-8 in text frame.");return}else a===h.BINARY&&(c=new Uint8Array(b.buffer,b.byteOffset,b.byteLength));this.#aN.enqueue(c),this.#aN.desiredSize<=0&&this.#aQ.socket.pause()}}#aU(){let a=this.#aQ.closeState.has(i.SENT)&&this.#aQ.closeState.has(i.RECEIVED);if(this.#aQ.readyState=g.CLOSED,this.#aP)return;this.#aQ.wasEverConnected||this.#aK.reject(new u("Socket never opened"));let b=this.#aT?.closingInfo,c=b?.code??1005;this.#aQ.closeState.has(i.RECEIVED)||(c=1006);let d=b?.reason==null?"":x(Buffer.from(b.reason));if(a)f(this.#aN),this.#aO.error(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#aL.resolve({closeCode:c,reason:d});else{let a=v("unclean close",c,d);this.#aN?.error(a),this.#aO?.error(a),this.#aL.reject(a)}}#aY(a){let b=null,c="";j.is.WebSocketError(a)&&(b=a.closeCode,c=a.reason),q(this.#aQ,b,c)}#aW(){this.#aQ.socket.resume()}#aX(a){this.#aY(a)}}Object.defineProperties(z.prototype,{url:w,opened:w,closed:w,close:w,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}}),j.converters.WebSocketStreamOptions=j.dictionaryConverter([{key:"protocols",converter:j.sequenceConverter(j.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:j.nullableConverter(j.converters.AbortSignal),defaultValue:()=>null}]),j.converters.WebSocketCloseInfo=j.dictionaryConverter([{key:"closeCode",converter:a=>j.converters["unsigned short"](a,j.attributes.EnforceRange)},{key:"reason",converter:j.converters.USVString,defaultValue:()=>""}]),j.converters.WebSocketStreamWrite=function(a){return"string"==typeof a?j.converters.USVString(a):j.converters.BufferSource(a)},a.exports={WebSocketStream:z}},43086:(a,b,c)=>{"use strict";let d=c(5318),{kClose:e,kDestroy:f,kClosed:g,kDestroyed:h,kDispatch:i,kNoProxyAgent:j,kHttpProxyAgent:k,kHttpsProxyAgent:l}=c(49176),m=c(48841),n=c(37417),o={"http:":80,"https:":443};class p extends d{#aZ=null;#a$=null;#y=null;constructor(a={}){super(a),this.#y=a;const{httpProxy:b,httpsProxy:c,noProxy:d,...e}=a;this[j]=new n(e);const f=b??process.env.http_proxy??process.env.HTTP_PROXY;f?this[k]=new m({...e,uri:f}):this[k]=this[j];const g=c??process.env.https_proxy??process.env.HTTPS_PROXY;g?this[l]=new m({...e,uri:g}):this[l]=this[k],this.#a_()}[i](a,b){let c=new URL(a.origin);return this.#a0(c).dispatch(a,b)}[e](){return Promise.all([this[j].close(),!this[k][g]&&this[k].close(),!this[l][g]&&this[l].close()])}[f](a){return Promise.all([this[j].destroy(a),!this[k][h]&&this[k].destroy(a),!this[l][h]&&this[l].destroy(a)])}#a0(a){let{protocol:b,host:c,port:d}=a;return((c=c.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase()).length>1&&46===c.charCodeAt(c.length-1)&&(c=c.slice(0,-1)),d=Number.parseInt(d,10)||o[b]||0,this.#a1(c,d))?"https:"===b?this[l]:this[k]:this[j]}#a1(a,b){if(this.#a2&&this.#a_(),0===this.#a$.length)return!0;for(let c=0;c<this.#a$.length;c++){let d=this.#a$[c];if("*"===d.hostname){if(d.port&&d.port!==b)continue;return!1}if((!d.port||d.port===b)&&(!d.wildcard&&a===d.hostname||a.slice(-(d.hostname.length+1))===`.${d.hostname}`))return!1}return!0}#a_(){let a=this.#y.noProxy??this.#a3,b=a.split(/[,\s]/),c=[];for(let a=0;a<b.length;a++){let d,e,f=b[a];if(!f)continue;let g=f.match(/^\[(.+)\]:(\d+)$/);if(g)d=g[1],e=Number.parseInt(g[2],10);else{let a=f.replace(/^\[(.+)\]$/,"$1"),b=1===(a.match(/:/g)||[]).length&&a.match(/^(.+):(\d+)$/);d=b?b[1]:a,e=b?Number.parseInt(b[2],10):0}let h=42===f.charCodeAt(0);c.push({hostname:d.replace(/^\*?\./,"").replace(/^(.+)\.$/,"$1").toLowerCase(),port:e,wildcard:h})}this.#aZ=a,this.#a$=c}get #a2(){return void 0===this.#y.noProxy&&this.#aZ!==this.#a3}get #a3(){return process.env.no_proxy??process.env.NO_PROXY??""}}a.exports=p},43835:(a,b,c)=>{"use strict";c.d(b,{$D:()=>m,P9:()=>j,We:()=>h,aZ:()=>n,rG:()=>i});var d=c(39541),e=c(26317);let f="-agentic",g="-thinking";function h(a){return"google"===a||"github"===a?"arn:aws:codewhisperer:us-east-1:699475941385:profile/EHGA3GRVQMUK":"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX"}let i=`
|
|
301
|
+
`)),(0,p.nu)(d,{response:{}})&&((0,k.s)("CODEX-WS",`terminal ${d} | closing`),r=!0),z(),A()}},h.onclose=()=>{if(!t){if(r){try{for(;m.length>0;)l.enqueue(m.shift())}catch{}w();return}w(Error("codex ws closed before terminal event"))}}},pull(){z(),A()},cancel(){w(null,!1)}}),{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache","X-Switchboard-Transport":"responses-websocket"}}),url:a,headers:b,ready:v,format:n.h.OPENAI_RESPONSES}}({wsUrl:String(h).replace(/^http:\/\//i,"ws://").replace(/^https:\/\//i,"wss://"),headers:l,request:g,signal:a.signal,...e?{dispatcher:e}:{}});return await m.ready,c.failures=0,(0,k.s)("CODEX-WS",`transport=responses_websocket | ${h}`),{response:m.response,url:h,headers:l,transformedBody:g}}catch(d){if(d?.name==="AbortError")throw d;let b=c&&d?.code!=="codex_ws_error_frame";return b&&(c.failures+=1),b&&c.failures>=3?(c.openUntil=Date.now()+3e5,c.failures=0,a.log?.warn?.("CODEX-WS",`websocket transport failing repeatedly, pausing attempts for 5 minutes: ${d.message}`)):a.log?.warn?.("CODEX-WS",`websocket transport failed, falling back to HTTP: ${d.message}`),(0,k.s)("CODEX-WS",`handshake failed: ${d.message}`),null}}parseError(a,b){if(429===a.status&&b)try{let a=JSON.parse(b),c=a?.error;if(c?.type==="usage_limit_reached"){let a=Date.now(),d=null;if("number"==typeof c.resets_at&&c.resets_at>0){let b=1e3*c.resets_at;b>a&&(d=b)}if(!d&&"number"==typeof c.resets_in_seconds&&c.resets_in_seconds>0&&(d=a+1e3*c.resets_in_seconds),d)return{status:429,message:c.message||b,resetsAtMs:d}}}catch{}return super.parseError(a,b)}transformRequest(a,b,c,d){this._isCompact=!!b._compact,delete b._compact,this._currentSessionId=(0,l.oV)({headers:d?.rawHeaders,body:b,connectionId:d?.connectionId,workspaceId:d?.providerSpecificData?.workspaceId,scope:"codex"});let f=(0,h.m)(b.input);if(f&&(b.input=f),(!b.input||Array.isArray(b.input)&&0===b.input.length)&&(b.input=[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]),Array.isArray(b.input))for(let a of b.input)!(!a||"object"!=typeof a||Array.isArray(a))&&("system"!==a.role||a.type&&"message"!==a.type||(a.role="developer"));Array.isArray(b.input)&&(b.input=b.input.filter(a=>{if("string"==typeof a&&u.test(a))return!1;if(a&&"object"==typeof a&&!Array.isArray(a)){if("item_reference"===a.type)return!1;"string"==typeof a.id&&u.test(a.id)&&delete a.id}return!0})),function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c="string"==typeof a.type?a.type:"";if("namespace"===c){if(Array.isArray(a.tools))for(let c of a.tools){let a="string"==typeof c?.name?c.name.trim().slice(0,128):"";a&&b.add(a)}return!0}if("function"!==c)return!!w.has(c)||!!c&&!a.function&&"string"!=typeof a.name&&v.has(c);let d=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,e=("string"==typeof a.name?a.name:"string"==typeof d?.name?d.name:"").trim();if(!e)return!1;let f="string"==typeof a.description?a.description:"string"==typeof d?.description?d.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:d?.parameters&&"object"==typeof d.parameters&&!Array.isArray(d.parameters)?d.parameters:{type:"object",properties:{}};for(let b of Object.keys(a))delete a[b];return a.type="function",a.name=e.slice(0,128),f&&(a.description=f),a.parameters=g,b.add(e),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"";c&&b.has(c)||delete a.tool_choice}}(b),b.stream=!0,b.instructions&&""!==b.instructions.trim()||(b.instructions=e),b.store=!1,!b.prompt_cache_key&&this._currentSessionId&&(b.prompt_cache_key=this._currentSessionId),b.model=(0,j.kt)("cx",b.model||a);let g=null;for(let a of["none","low","medium","high","xhigh"])if(b.model.endsWith(`-${a}`)){g=a,b.model=b.model.replace(`-${a}`,"");break}if(b.reasoning)b.reasoning.summary||(b.reasoning.summary="auto");else{let a=b.reasoning_effort||g||"low";b.reasoning={effort:a,summary:"auto"}}for(let a of(delete b.reasoning_effort,b.reasoning&&b.reasoning.effort&&"none"!==b.reasoning.effort&&(b.include=["reasoning.encrypted_content"]),delete b.temperature,delete b.top_p,delete b.frequency_penalty,delete b.presence_penalty,delete b.logprobs,delete b.top_logprobs,delete b.n,delete b.seed,delete b.max_tokens,delete b.max_completion_tokens,delete b.max_output_tokens,delete b.user,delete b.prompt_cache_retention,delete b.metadata,delete b.stream_options,delete b.safety_identifier,delete b.previous_response_id,Object.keys(b)))x.has(a)||delete b[a];return b}}},40603:(a,b,c)=>{"use strict";let{EventEmitter:d}=c(78474),{Buffer:e}=c(4573),{InvalidArgumentError:f,Socks5ProxyError:g}=c(61448),{debuglog:h}=c(57975),{parseAddress:i}=c(33297),j=h("undici:socks5"),k=e.alloc(0),l={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},m={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},n={IPV4:1,DOMAIN:3,IPV6:4},o={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},p={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",AUTHENTICATED:"authenticated",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"};class q extends d{constructor(a,b={}){if(super(),!a)throw new f("socket is required");this.socket=a,this.options=b,this.state=p.INITIAL,this.buffer=k,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],b.username&&b.password&&this.authMethods.push(l.USERNAME_PASSWORD),this.authMethods.push(l.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(a){j("received data",a.length,"bytes in state",this.state),this.buffer=e.concat([this.buffer,a]);try{switch(this.state){case p.HANDSHAKING:this.handleHandshakeResponse();break;case p.AUTHENTICATING:this.handleAuthResponse();break;case p.CONNECTING:this.handleConnectResponse()}}catch(a){this.onError(a)}}onError(a){j("socket error",a),this.state=p.ERROR,this.emit("error",a),this.destroy()}onClose(){j("socket closed"),this.state=p.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}markAuthenticated(){this.state=p.AUTHENTICATED,this.emit("authenticated")}handshake(){if(this.state!==p.INITIAL)throw new f("Handshake already started");j("starting handshake with",this.authMethods.length,"auth methods"),this.state=p.HANDSHAKING;let a=e.alloc(2+this.authMethods.length);a[0]=5,a[1]=this.authMethods.length,this.authMethods.forEach((b,c)=>{a[2+c]=b}),this.socket.write(a)}handleHandshakeResponse(){if(this.buffer.length<2)return;let a=this.buffer[0],b=this.buffer[1];if(5!==a)throw new g(`Invalid SOCKS version: ${a}`,"UND_ERR_SOCKS5_VERSION");if(b===l.NO_ACCEPTABLE)throw new g("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),j("server selected auth method",b),b===l.NO_AUTH)this.markAuthenticated();else if(b===l.USERNAME_PASSWORD)this.state=p.AUTHENTICATING,this.sendAuthRequest();else throw new g(`Unsupported authentication method: ${b}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:a,password:b}=this.options;if(!a||!b)throw new f("Username and password required for authentication");j("sending username/password auth");let c=e.from(a),d=e.from(b);if(c.length>255||d.length>255)throw new f("Username or password too long");let g=e.alloc(3+c.length+d.length);g[0]=1,g[1]=c.length,c.copy(g,2),g[2+c.length]=d.length,d.copy(g,3+c.length),this.socket.write(g)}handleAuthResponse(){if(this.buffer.length<2)return;let a=this.buffer[0],b=this.buffer[1];if(1!==a)throw new g(`Invalid auth sub-negotiation version: ${a}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(0!==b)throw new g("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),j("authentication successful"),this.markAuthenticated()}connect(a,b){if(this.state===p.CONNECTING||this.state===p.CONNECTED)throw new f("Connection already in progress");if(this.state!==p.AUTHENTICATED)throw new f("Client must be authenticated before CONNECT");j("connecting to",a,b),this.state=p.CONNECTING;let c=this.buildConnectRequest(m.CONNECT,a,b);this.socket.write(c)}buildConnectRequest(a,b,c){let{type:d,buffer:f}=i(b),g=e.alloc(4+f.length+2);return g[0]=5,g[1]=a,g[2]=0,g[3]=d,f.copy(g,4),g.writeUInt16BE(c,4+f.length),g}handleConnectResponse(){let a;if(this.buffer.length<4)return;let b=this.buffer[0],c=this.buffer[1],d=this.buffer[3];if(5!==b)throw new g(`Invalid SOCKS version in reply: ${b}`,"UND_ERR_SOCKS5_REPLY_VERSION");let e=4;if(d===n.IPV4)e+=6;else if(d===n.DOMAIN){if(this.buffer.length<5)return;e+=1+this.buffer[4]+2}else if(d===n.IPV6)e+=18;else throw new g(`Invalid address type in reply: ${d}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length<e)return;if(c!==o.SUCCEEDED){let a=this.getReplyErrorMessage(c);throw new g(`SOCKS5 connection failed: ${a}`,`UND_ERR_SOCKS5_REPLY_${c}`)}let f=4;if(d===n.IPV4)a=Array.from(this.buffer.subarray(f,f+4)).join("."),f+=4;else if(d===n.DOMAIN){let b=this.buffer[f];f+=1,a=this.buffer.subarray(f,f+b).toString(),f+=b}else if(d===n.IPV6){let b=[];for(let a=0;a<8;a++){let c=this.buffer.readUInt16BE(f+2*a);b.push(c.toString(16))}a=b.join(":"),f+=16}let h=this.buffer.readUInt16BE(f);this.buffer=k,this.state=p.CONNECTED,this.socket.removeListener("data",this.onSocketData),j("connected, bound address:",a,"port:",h),this.emit("connected",{address:a,port:h})}getReplyErrorMessage(a){switch(a){case o.GENERAL_FAILURE:return"General SOCKS server failure";case o.CONNECTION_NOT_ALLOWED:return"Connection not allowed by ruleset";case o.NETWORK_UNREACHABLE:return"Network unreachable";case o.HOST_UNREACHABLE:return"Host unreachable";case o.CONNECTION_REFUSED:return"Connection refused";case o.TTL_EXPIRED:return"TTL expired";case o.COMMAND_NOT_SUPPORTED:return"Command not supported";case o.ADDRESS_TYPE_NOT_SUPPORTED:return"Address type not supported";default:return`Unknown error code: ${a}`}}}a.exports={Socks5Client:q,AUTH_METHODS:l,COMMANDS:m,ADDRESS_TYPES:n,REPLY_CODES:o,STATES:p}},41702:(a,b,c)=>{var d=c(45654);c(33889),d.mgf=d.mgf||{},(a.exports=d.mgf.mgf1=d.mgf1=d.mgf1||{}).create=function(a){return{generate:function(b,c){for(var e=new d.util.ByteBuffer,f=Math.ceil(c/a.digestLength),g=0;g<f;g++){var h=new d.util.ByteBuffer;h.putInt32(g),a.start(),a.update(b+h.getBytes()),e.putBuffer(a.digest())}return e.truncate(e.length()-c),e.getBytes()}}}},41883:(a,b,c)=>{"use strict";c.d(b,{w:()=>k});var d=c(22256),e=c(38421),f=c(96997),g=c(50969);let h=new Map;function i(a){if("string"!=typeof a)return null;try{let b=JSON.parse(a);if("authorized_user"===b.type&&b.client_id&&b.client_secret&&b.refresh_token)return b;return null}catch{return null}}async function j(a,b,c,d){if(h.has(a))return h.get(a);let e=await (0,g.Fm)(`https://aiplatform.googleapis.com/v1/publishers/google/models/__probe__:generateContent?key=${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}",identity:c.identity,provider:b,format:c.format},d),f=await e.json().catch(()=>null),i=(f?.[0]?.error?.message||f?.error?.message||"").match(/projects\/([^/]+)\//),j=i?.[1]||null;return j&&h.set(a,j),j}class k extends d.Hv{constructor(a="vertex"){super(a,e.xq[a]||{})}buildUrl(a,b,c=0,d=null){let e=(0,f.Sc)(d?.apiKey),g=i(d?.apiKey),h=!!e||!!g||!!d?.accessToken,j=h?null:d?.apiKey,k=e?.project_id||g?.quota_project_id||d?.providerSpecificData?.projectId;if("vertex-partner"===this.provider){if(!k)throw Error("Vertex partner models require a project_id. Add it in providerSpecificData or use Service Account JSON.");let a=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/global/endpoints/openapi/chat/completions`;return j?`${a}?key=${j}`:a}let l=b?"streamGenerateContent":"generateContent";if(h){if(!k)throw Error("Vertex OAuth/ADC requires a project_id. Add quota_project_id to your ADC JSON or set providerSpecificData.projectId.");let c=d?.providerSpecificData?.location||"us-central1",e=`https://aiplatform.googleapis.com/v1/projects/${k}/locations/${c}/publishers/google/models/${a}:${l}`;return b&&(e+="?alt=sse"),e}let m=`https://aiplatform.googleapis.com/v1/publishers/google/models/${a}:${l}`;return b&&(m+="?alt=sse"),j&&(m+=b?`&key=${j}`:`?key=${j}`),m}buildHeaders(a,b=!0){let c={"Content-Type":"application/json"};return a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),b&&(c.Accept="text/event-stream"),c}async refreshCredentials(a,b,c=null){let d=(0,f.Sc)(a?.apiKey);if(d){let a=await (0,f.pb)(d,b);return a?{accessToken:a.accessToken,expiresAt:a.expiresAt}:null}let e=i(a?.apiKey);if(e){let a=await (0,f.I9)(e.refresh_token,e.client_id,e.client_secret,b,this.provider,c);return a?.accessToken?{accessToken:a.accessToken,expiresAt:a.expiresAt}:null}return null}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:h,proxyOptions:k=null}){let l=(0,f.Sc)(d?.apiKey),m=i(d?.apiKey);if(l){let a=await (0,f.pb)(l,h);if(!a?.accessToken)throw Error("Vertex: failed to mint access token from Service Account JSON");d.accessToken=a.accessToken}if(m){let a=await (0,f.I9)(m.refresh_token,m.client_id,m.client_secret,h,this.provider,k);if(!a?.accessToken)throw Error("Vertex: failed to refresh access token from ADC JSON (authorized_user)");d.accessToken=a.accessToken}if("vertex-partner"===this.provider&&!l&&!m&&!d?.providerSpecificData?.projectId){let a=await j(d.apiKey,this.provider,this.config,k);if(!a)throw Error("Vertex: could not resolve project_id from API key. Please add it manually in provider settings.");h?.debug?.("VERTEX",`Resolved project_id: ${a}`),d.providerSpecificData={...d.providerSpecificData,projectId:a}}let n=this.buildUrl(a,c,0,d),o=this.buildHeaders(d,c),p=this.transformRequest(a,b,c,d);return{response:await (0,g.Fm)(n,{method:"POST",headers:o,body:JSON.stringify(p),signal:e,identity:this.resolveIdentity(d),provider:this.provider,format:this.config?.format},k),url:n,headers:o,transformedBody:p}}}},42425:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),e=c(38522),{redirectStatusSet:f,referrerPolicyTokens:g,badPortsSet:h}=c(19608),{getGlobalOrigin:i}=c(79412),{collectAnHTTPQuotedString:j,parseMIMEType:k}=c(16537),{performance:l}=c(643),{isValidHTTPToken:m,normalizedMethodRecordsBase:n}=c(84285),o=c(34589),{isUint8Array:p}=c(73429),{webidl:q}=c(32984),{isomorphicEncode:r,collectASequenceOfCodePoints:s,removeChars:t}=c(70745);function u(a){let b=a.urlList,c=b.length;return 0===c?null:b[c-1].toString()}function v(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>126||c<32)return!1}return!0}function w(a){return a.urlList[a.urlList.length-1]}function x(a){return!1===(" "===a[0]||" "===a[0]||" "===a[a.length-1]||" "===a[a.length-1]||a.includes("\n")||a.includes("\r")||a.includes("\0"))}function y(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function z(a,b=!1){return(o(q.is.URL(a)),I(a=new URL(a)))?"no-referrer":(a.username="",a.password="",a.hash="",!0===b&&(a.pathname="",a.search=""),a)}let A=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),B=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function C(a){return a.includes(":")?("["===a[0]&&"]"===a[a.length-1]&&(a=a.slice(1,-1)),B(a)):A(a)}function D(a){var b;return!!q.is.URL(a)&&("about:blank"===a.href||"about:srcdoc"===a.href||"data:"===a.protocol||"blob:"===a.protocol||null!=(b=a.origin)&&"null"!==b&&(!!("https:"===(b=new URL(b)).protocol||"wss:"===b.protocol||C(b.hostname)||"localhost"===b.hostname||"localhost."===b.hostname||b.hostname.endsWith(".localhost")||b.hostname.endsWith(".localhost."))||"file:"===b.protocol))}function E(a,b){return a.origin===b.origin&&"null"===a.origin||a.protocol===b.protocol&&a.hostname===b.hostname&&a.port===b.port}let F=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function G(a,b,c=0,d=1){class e{#I;#aG;#aH;constructor(a,b){this.#I=a,this.#aG=b,this.#aH=0}next(){let e;if("object"!=typeof this||this===null||!(#I in this))throw TypeError(`'next' called on an object that does not implement interface ${a} Iterator.`);let f=this.#aH,g=b(this.#I);if(f>=g.length)return{value:void 0,done:!0};let{[c]:h,[d]:i}=g[f];switch(this.#aH=f+1,this.#aG){case"key":e=h;break;case"value":e=i;break;case"key+value":e=[h,i]}return{value:e,done:!1}}}return delete e.prototype.constructor,Object.setPrototypeOf(e.prototype,F),Object.defineProperties(e.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${a} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(a,b){return new e(a,b)}}async function H(a,b,c){try{let d=[],e=0;for(;;){let{done:f,value:g}=await a.read();if(f)return void b(Buffer.concat(d,e));if(!p(g))return void c(TypeError("Received non-Uint8Array chunk"));d.push(g),e+=g.length}}catch(a){c(a)}}function I(a){o("protocol"in a);let b=a.protocol;return"about:"===b||"blob:"===b||"data:"===b}function J(a){return"string"==typeof a&&":"===a[5]&&"h"===a[0]&&"t"===a[1]&&"t"===a[2]&&"p"===a[3]&&"s"===a[4]||"https:"===a.protocol}function K(a){o("protocol"in a);let b=a.protocol;return"http:"===b||"https:"===b}class L extends d{#aI;constructor(a){super(),this.#aI=a}_transform(a,b,c){if(!this._inflateStream){if(0===a.length)return void c();this._inflateStream=(15&a[0])==8?e.createInflate(this.#aI):e.createInflateRaw(this.#aI),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",a=>this.destroy(a))}this._inflateStream.write(a,b,c)}_final(a){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),a()}}function M(a,b){let c=b.get(a,!0);if(null===c)return null;let d={position:0},e=[],f="";for(;d.position<c.length;){if(f+=s(a=>'"'!==a&&","!==a,c,d),d.position<c.length)if(34===c.charCodeAt(d.position)){if(f+=j(c,d),d.position<c.length)continue}else o(44===c.charCodeAt(d.position)),d.position++;f=t(f,!0,!0,a=>9===a||32===a),e.push(f),f=""}return e}class N{get baseUrl(){return i()}get origin(){return this.baseUrl?.origin}policyContainer=y()}class O{settingsObject=new N}a.exports={isAborted:function(a){return"aborted"===a.controller.state},isCancelled:function(a){return"aborted"===a.controller.state||"terminated"===a.controller.state},isValidEncodedURL:v,tryUpgradeRequestToAPotentiallyTrustworthyURL:function(a){},clampAndCoarsenConnectionTimingInfo:function(a,b,c){return!a?.startTime||a.startTime<b?{domainLookupStartTime:b,domainLookupEndTime:b,connectionStartTime:b,connectionEndTime:b,secureConnectionStartTime:b,ALPNNegotiatedProtocol:a?.ALPNNegotiatedProtocol}:{domainLookupStartTime:a.domainLookupStartTime,domainLookupEndTime:a.domainLookupEndTime,connectionStartTime:a.connectionStartTime,connectionEndTime:a.connectionEndTime,secureConnectionStartTime:a.secureConnectionStartTime,ALPNNegotiatedProtocol:a.ALPNNegotiatedProtocol}},coarsenedSharedCurrentTime:function(a){return l.now()},determineRequestsReferrer:function(a){let b=a.referrerPolicy;o(b);let c=null;if("client"===a.referrer){let a=i();if(!a||"null"===a.origin)return"no-referrer";c=new URL(a)}else q.is.URL(a.referrer)&&(c=a.referrer);let d=z(c),e=z(c,!0);switch(d.toString().length>4096&&(d=e),b){case"no-referrer":return"no-referrer";case"origin":if(null!=e)return e;return z(c,!0);case"unsafe-url":return d;case"strict-origin":{let b=w(a);if(D(d)&&!D(b))return"no-referrer";return e}case"strict-origin-when-cross-origin":{let b=w(a);if(E(d,b))return d;if(D(d)&&!D(b))return"no-referrer";return e}case"same-origin":if(E(a,d))return d;return"no-referrer";case"origin-when-cross-origin":if(E(a,d))return d;return e;case"no-referrer-when-downgrade":{let b=w(a);if(D(d)&&!D(b))return"no-referrer";return d}}},makePolicyContainer:y,clonePolicyContainer:function(a){return{referrerPolicy:a.referrerPolicy}},appendFetchMetadata:function(a){if(!D(w(a)))return;let b=null;b=a.mode,a.headersList.set("sec-fetch-mode",b,!0)},appendRequestOriginHeader:function(a){let b=a.origin;if("client"!==b&&void 0!==b){if("cors"===a.responseTainting||"websocket"===a.mode)a.headersList.append("origin",b,!0);else if("GET"!==a.method&&"HEAD"!==a.method){switch(a.referrerPolicy){case"no-referrer":b=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":a.origin&&J(a.origin)&&!J(w(a))&&(b=null);break;case"same-origin":E(a,w(a))||(b=null)}a.headersList.append("origin",b,!0)}}},TAOCheck:function(){return"success"},corsCheck:function(){return"success"},crossOriginResourcePolicyCheck:function(){return"allowed"},createOpaqueTimingInfo:function(a){return{startTime:a.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:a.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}},setRequestReferrerPolicyOnRedirect:function(a,b){let c=function(a){let b=(a.headersList.get("referrer-policy",!0)??"").split(","),c="";if(b.length)for(let a=b.length;0!==a;a--){let d=b[a-1].trim();if(g.has(d)){c=d;break}}return c}(b);""!==c&&(a.referrerPolicy=c)},isValidHTTPToken:m,requestBadPort:function(a){let b=w(a);return K(b)&&h.has(b.port)?"blocked":"allowed"},requestCurrentURL:w,responseURL:u,responseLocationURL:function(a,b){var c;if(!f.has(a.status))return null;let d=a.headersList.get("location",!0);return null!==d&&x(d)&&(v(d)||(c=d,d=Buffer.from(c,"binary").toString("utf8")),d=new URL(d,u(a))),d&&!d.hash&&(d.hash=b),d},isURLPotentiallyTrustworthy:D,isValidReasonPhrase:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(!(9===c||c>=32&&c<=126||c>=128&&c<=255))return!1}return!0},sameOrigin:E,normalizeMethod:function(a){return n[a.toLowerCase()]??a},iteratorMixin:function(a,b,c,d=0,e=1,f){let g=G(a,c,d,e),h={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return q.brandCheck(this,f),g(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return q.brandCheck(this,f),g(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return q.brandCheck(this,f),g(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(b,c=globalThis){if(q.brandCheck(this,f),q.argumentLengthCheck(arguments,1,`${a}.forEach`),"function"!=typeof b)throw TypeError(`Failed to execute 'forEach' on '${a}': parameter 1 is not of type 'Function'.`);for(let{0:a,1:d}of g(this,"key+value"))b.call(c,d,a,this)}}};return Object.defineProperties(b.prototype,{...h,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:h.entries.value}})},createIterator:G,isValidHeaderName:m,isValidHeaderValue:x,isErrorLike:function(a){return a instanceof Error||a?.constructor?.name==="Error"||a?.constructor?.name==="DOMException"},fullyReadBody:function(a,b,c){try{let d=a.stream.getReader();H(d,b,c)}catch(a){c(a)}},readableStreamClose:function(a){try{a.close(),a.byobRequest?.respond(0)}catch(a){if(!a.message.includes("Controller is already closed")&&!a.message.includes("ReadableStream is already closed"))throw a}},urlIsLocal:I,urlHasHttpsScheme:J,urlIsHttpHttpsScheme:K,readAllBytes:H,simpleRangeHeaderValue:function(a,b){if(!a.startsWith("bytes"))return"failure";let c={position:5};if(b&&s(a=>" "===a||" "===a,a,c),61!==a.charCodeAt(c.position))return"failure";c.position++,b&&s(a=>" "===a||" "===a,a,c);let d=s(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),e=d.length?Number(d):null;if(b&&s(a=>" "===a||" "===a,a,c),45!==a.charCodeAt(c.position))return"failure";c.position++,b&&s(a=>" "===a||" "===a,a,c);let f=s(a=>{let b=a.charCodeAt(0);return b>=48&&b<=57},a,c),g=f.length?Number(f):null;return c.position<a.length||null===g&&null===e||null!==e&&null!==g&&e>g?"failure":{rangeStartValue:e,rangeEndValue:g}},buildContentRange:function(a,b,c){let d="bytes ";return d+=r(`${a}`),d+="-",d+=r(`${b}`),d+="/",d+=r(`${c}`)},createInflate:function(a){return new L(a)},extractMimeType:function(a){let b=null,c=null,d=null,e=M("content-type",a);if(null===e)return"failure";for(let a of e){let e=k(a);"failure"!==e&&"*/*"!==e.essence&&((d=e).essence!==c?(b=null,d.parameters.has("charset")&&(b=d.parameters.get("charset")),c=d.essence):d.parameters.has("charset")||null===b||d.parameters.set("charset",b))}return null==d?"failure":d},getDecodeSplit:M,environmentSettingsObject:new O,isOriginIPPotentiallyTrustworthy:C,hasAuthenticationEntry:function(a){return!1},includesCredentials:function(a){return!!(a.username||a.password)},isTraversableNavigable:function(a){return null!=a&&"client"!==a&&"no-traversable"!==a}}},42430:(a,b,c)=>{"use strict";let{addAbortListener:d}=c(78474),{environmentSettingsObject:e,readableStreamClose:f}=c(42425),{states:g,opcodes:h,sentCloseFrameState:i}=c(62026),{webidl:j}=c(32984),{getURLRecord:k,isValidSubprotocol:l,isEstablished:m,utf8Decode:n}=c(94050),{establishWebSocketConnection:o,failWebsocketConnection:p,closeWebSocketConnection:q}=c(4654),{channels:r}=c(62571),{WebsocketFrameSend:s}=c(45221),{ByteParser:t}=c(64821),{WebSocketError:u,createUnvalidatedWebSocketError:v}=c(87404),{kEnumerableProperty:w}=c(84285),{utf8DecodeBytes:x}=c(67449),y=!1;class z{#aJ;#aK;#aL;#aM;#aN;#aO;#aP=!1;#aQ={onConnectionEstablished:(a,b)=>this.#aR(a,b),onMessage:(a,b)=>this.#aS(a,b),onParserError:a=>p(this.#aQ,null,a.message),onParserDrain:()=>this.#aQ.socket.resume(),onSocketData:a=>{this.#aT.write(a)||this.#aQ.socket.pause()},onSocketError:a=>{this.#aQ.readyState=g.CLOSING,r.socketError.hasSubscribers&&r.socketError.publish(a),this.#aQ.socket.destroy()},onSocketClose:()=>queueMicrotask(()=>this.#aU()),onPing:()=>{},onPong:()=>{},readyState:g.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aT;constructor(a,b){y||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),y=!0),j.argumentLengthCheck(arguments,1,"WebSocket"),a=j.converters.USVString(a),null!==b&&(b=j.converters.WebSocketStreamOptions(b));const c=k(a,e.settingsObject.baseUrl),f=b.protocols;if(f.length!==new Set(f.map(a=>a.toLowerCase())).size||f.length>0&&!f.every(a=>l(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#aJ=c.toString(),this.#aK=Promise.withResolvers(),this.#aL=Promise.withResolvers(),null!=b.signal){const a=b.signal;if(a.aborted){this.#aK.reject(a.reason),this.#aL.reject(a.reason);return}d(a,()=>{m(this.#aQ.readyState)||(p(this.#aQ),this.#aQ.readyState=g.CLOSING,this.#aK.reject(a.reason),this.#aL.reject(a.reason),this.#aP=!0)})}const h=e.settingsObject;this.#aQ.controller=o(c,f,h,this.#aQ,b)}get url(){return this.#aJ.toString()}get opened(){return this.#aK.promise}get closed(){return this.#aL.promise}close(a){null!==a&&(a=j.converters.WebSocketCloseInfo(a));let b=a.closeCode??null,c=a.reason;q(this.#aQ,b,c,!0)}#aV(a){a=j.converters.WebSocketStreamWrite(a);let b=Promise.withResolvers(),c=null,d=null;if(j.is.BufferSource(a))c=new Uint8Array(ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):a.slice()),d=h.BINARY;else{let e;try{e=j.converters.DOMString(a)}catch(a){return b.reject(a),b.promise}c=new TextEncoder().encode(e),d=h.TEXT}if(this.#aQ.closeState.has(i.SENT)||this.#aQ.closeState.has(i.RECEIVED))b.resolve(void 0);else{let a=new s(c);this.#aQ.socket.write(a.createFrame(d),()=>{b.resolve(void 0)})}return b.promise}#aR(a,b){this.#aQ.socket=a.socket;let c=this.#aQ.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#aQ.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new t(this.#aQ,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#aQ.onParserDrain()),e.on("error",a=>this.#aQ.onParserError(a)),this.#aT=e,this.#aQ.readyState=g.OPEN;let f=a.headersList.get("sec-websocket-extensions")??"",h=a.headersList.get("sec-websocket-protocol")??"",i=new ReadableStream({start:a=>{this.#aN=a},pull:()=>this.#aW(),cancel:a=>this.#aX(a)}),j=new WritableStream({start:a=>{this.#aO=a},write:a=>this.#aV(a),close:()=>q(this.#aQ,null,null),abort:a=>this.#aY(a)});this.#aM=i,this.#aK.resolve({extensions:f,protocol:h,readable:i,writable:j})}#aS(a,b){let c;if(this.#aQ.readyState===g.OPEN){if(a===h.TEXT)try{c=n(b)}catch{p(this.#aQ,1007,"Received invalid UTF-8 in text frame.");return}else a===h.BINARY&&(c=new Uint8Array(b.buffer,b.byteOffset,b.byteLength));this.#aN.enqueue(c),this.#aN.desiredSize<=0&&this.#aQ.socket.pause()}}#aU(){let a=this.#aQ.closeState.has(i.SENT)&&this.#aQ.closeState.has(i.RECEIVED);if(this.#aQ.readyState=g.CLOSED,this.#aP)return;this.#aQ.wasEverConnected||this.#aK.reject(new u("Socket never opened"));let b=this.#aT?.closingInfo,c=b?.code??1005;this.#aQ.closeState.has(i.RECEIVED)||(c=1006);let d=b?.reason==null?"":x(Buffer.from(b.reason));if(a)f(this.#aN),this.#aO.error(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#aL.resolve({closeCode:c,reason:d});else{let a=v("unclean close",c,d);this.#aN?.error(a),this.#aO?.error(a),this.#aL.reject(a)}}#aY(a){let b=null,c="";j.is.WebSocketError(a)&&(b=a.closeCode,c=a.reason),q(this.#aQ,b,c)}#aW(){this.#aQ.socket.resume()}#aX(a){this.#aY(a)}}Object.defineProperties(z.prototype,{url:w,opened:w,closed:w,close:w,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}}),j.converters.WebSocketStreamOptions=j.dictionaryConverter([{key:"protocols",converter:j.sequenceConverter(j.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:j.nullableConverter(j.converters.AbortSignal),defaultValue:()=>null}]),j.converters.WebSocketCloseInfo=j.dictionaryConverter([{key:"closeCode",converter:a=>j.converters["unsigned short"](a,j.attributes.EnforceRange)},{key:"reason",converter:j.converters.USVString,defaultValue:()=>""}]),j.converters.WebSocketStreamWrite=function(a){return"string"==typeof a?j.converters.USVString(a):j.converters.BufferSource(a)},a.exports={WebSocketStream:z}},43086:(a,b,c)=>{"use strict";let d=c(5318),{kClose:e,kDestroy:f,kClosed:g,kDestroyed:h,kDispatch:i,kNoProxyAgent:j,kHttpProxyAgent:k,kHttpsProxyAgent:l}=c(49176),m=c(48841),n=c(37417),o={"http:":80,"https:":443};class p extends d{#aZ=null;#a$=null;#y=null;constructor(a={}){super(a),this.#y=a;const{httpProxy:b,httpsProxy:c,noProxy:d,...e}=a;this[j]=new n(e);const f=b??process.env.http_proxy??process.env.HTTP_PROXY;f?this[k]=new m({...e,uri:f}):this[k]=this[j];const g=c??process.env.https_proxy??process.env.HTTPS_PROXY;g?this[l]=new m({...e,uri:g}):this[l]=this[k],this.#a_()}[i](a,b){let c=new URL(a.origin);return this.#a0(c).dispatch(a,b)}[e](){return Promise.all([this[j].close(),!this[k][g]&&this[k].close(),!this[l][g]&&this[l].close()])}[f](a){return Promise.all([this[j].destroy(a),!this[k][h]&&this[k].destroy(a),!this[l][h]&&this[l].destroy(a)])}#a0(a){let{protocol:b,host:c,port:d}=a;return((c=c.replace(/:\d*$/,"").replace(/^\[(.+)\]$/,"$1").toLowerCase()).length>1&&46===c.charCodeAt(c.length-1)&&(c=c.slice(0,-1)),d=Number.parseInt(d,10)||o[b]||0,this.#a1(c,d))?"https:"===b?this[l]:this[k]:this[j]}#a1(a,b){if(this.#a2&&this.#a_(),0===this.#a$.length)return!0;for(let c=0;c<this.#a$.length;c++){let d=this.#a$[c];if("*"===d.hostname){if(d.port&&d.port!==b)continue;return!1}if((!d.port||d.port===b)&&(!d.wildcard&&a===d.hostname||a.slice(-(d.hostname.length+1))===`.${d.hostname}`))return!1}return!0}#a_(){let a=this.#y.noProxy??this.#a3,b=a.split(/[,\s]/),c=[];for(let a=0;a<b.length;a++){let d,e,f=b[a];if(!f)continue;let g=f.match(/^\[(.+)\]:(\d+)$/);if(g)d=g[1],e=Number.parseInt(g[2],10);else{let a=f.replace(/^\[(.+)\]$/,"$1"),b=1===(a.match(/:/g)||[]).length&&a.match(/^(.+):(\d+)$/);d=b?b[1]:a,e=b?Number.parseInt(b[2],10):0}let h=42===f.charCodeAt(0);c.push({hostname:d.replace(/^\*?\./,"").replace(/^(.+)\.$/,"$1").toLowerCase(),port:e,wildcard:h})}this.#aZ=a,this.#a$=c}get #a2(){return void 0===this.#y.noProxy&&this.#aZ!==this.#a3}get #a3(){return process.env.no_proxy??process.env.NO_PROXY??""}}a.exports=p},43835:(a,b,c)=>{"use strict";c.d(b,{$D:()=>m,P9:()=>j,We:()=>h,aZ:()=>n,rG:()=>i});var d=c(17525),e=c(26317);let f="-agentic",g="-thinking";function h(a){return"google"===a||"github"===a?"arn:aws:codewhisperer:us-east-1:699475941385:profile/EHGA3GRVQMUK":"arn:aws:codewhisperer:us-east-1:638616132270:profile/AAAACCCCXXXX"}let i=`
|
|
302
302
|
# CRITICAL: CHUNKED WRITE PROTOCOL (MANDATORY)
|
|
303
303
|
|
|
304
304
|
You MUST follow these rules for ALL file operations. Violation causes server timeouts and task failure.
|
|
@@ -348,7 +348,7 @@ WRONG: Generating massive code blocks without chunking -> TIMEOUT
|
|
|
348
348
|
|
|
349
349
|
REMEMBER: When in doubt, write LESS per operation. Multiple small operations > one large operation.
|
|
350
350
|
`.trim();function j(a,b,c){let f=(0,d.sS)(a);if(f)return"none"===f.mode?null:"budget"===f.mode?f.budget:"level"===f.mode?(0,e.nE)(f.level)??16e3:16e3;if(b){let a=function(a,b){if(!a)return;if("function"==typeof a.get)return a.get(b);let c=b.toLowerCase();for(let b of Object.keys(a))if(b.toLowerCase()===c)return a[b]}(b,"anthropic-beta");if("string"==typeof a&&a.toLowerCase().includes("interleaved-thinking"))return 16e3}if(function(a){for(let b of Array.isArray(a?.messages)?a.messages:[]){if(!b||"system"!==b.role&&"user"!==b.role)continue;let a=b.content;if("string"==typeof a){if(o(a))return!0}else if(Array.isArray(a))for(let b of a){let a=b?.text;if("string"==typeof a&&o(a))return!0}}return!!("string"==typeof a?.system&&o(a.system))}(a))return 16e3;if("string"==typeof c&&c){let a=c.toLowerCase();if(a.includes("thinking")||a.includes("-reason"))return 16e3}return null}function k(a){return"string"==typeof a&&a.endsWith(f)}function l(a){return"string"==typeof a&&a.endsWith(g)}function m(a){var b,c;let d=a,e=!1,h=!1;return k(d)&&(e=!0,d=k(b=d)?b.slice(0,-f.length):b),l(d)&&(h=!0,d=l(c=d)?c.slice(0,-g.length):c),{upstream:d,agentic:e,thinking:h}}function n(a=16e3){let b=Math.max(1,Math.min(32e3,Number(a)||16e3));return`<thinking_mode>enabled</thinking_mode>
|
|
351
|
-
<max_thinking_length>${b}</max_thinking_length>`}function o(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}},44140:(a,b,c)=>{"use strict";c.d(b,{AU:()=>p,Aw:()=>q,fX:()=>s});let d=/switchboard/i,e=/Switchboard\//i,f="https://github.com/Vijay-Duke/switchboard-router",g=new Set(["authorization","x-api-key","api-key","cookie"]);function h(a){return g.has(String(a).toLowerCase())}function i(a){let b={};for(let[c,g]of a?a instanceof Headers?[...a.entries()]:Object.entries(a):[])null!=g&&!function(a,b){let c=String(a),g=null==b?"":String(b),i=c.toLowerCase();return!!(i.startsWith("x-switchboard-")||"x-client-type"===i&&/^switchboard$/i.test(g.trim())||"x-msh-platform"===i&&/^switchboard$/i.test(g.trim())||"user-agent"===i&&e.test(g)||d.test(c)&&!h(c)||d.test(g)&&!h(c)||g.includes(f))}(c,g)&&(b[c]=String(g));return b}Object.freeze({SWITCHBOARD_RE:d,SWITCHBOARD_UA_RE:e,SWITCHBOARD_GITHUB:f});var j=c(59882),k=c(70625),l=c(3507);let m="oauth-2025-04-20",n="claude-code-20250219",o="extended-cache-ttl-2025-04-11";function p(a){let b=[],c=new Set;for(let d of String(a||"").split(",")){let a=d.trim();a&&!c.has(a)&&(b.push(a),c.add(a))}if(!c.has(m)){let a=+(b[0]===n);b.splice(a,0,m)}return c.has(o)||b.push(o),b.join(",")}function q(a){return String(a||"").split(",").map(a=>a.trim()).filter(a=>a&&a!==n).join(",")}function r(a){return Object.keys(a).find(a=>"user-agent"===a.toLowerCase())}function s(a,b={}){let c=i(a),d=(0,j.ti)(b.identity,{format:b.format,provider:b.provider}),e=b.snapshot||(0,k.zi)(d),f="claude-cli"===d?(0,k.Iq)(b.credentialId):null,g=(0,j.$3)(c,d,{snapshot:f?{...e,os:f.os,arch:f.arch}:e,overlay:b.overlay,stream:b.stream,retryCount:b.retryCount,preserveUserAgent:!b.identity}),h=(0,j.E$)(d),m=i(g);if("claude-cli"===d&&b.requestPath?.startsWith("/v1/messages/count_tokens")){for(let a of Object.keys(m))"x-stainless-timeout"===a.toLowerCase()&&delete m[a];m=(0,j.Dm)(m,j.$R)}if(!r(m)){let a=e?.userAgent||function(a,b){let c=b?.version,d=(0,l.ol)()||"linux",e="ia32"===(0,l.LY)()?"x86":(0,l.LY)()||"x64";switch(a){case"claude-cli":return`claude-cli/${c||"2.1.
|
|
351
|
+
<max_thinking_length>${b}</max_thinking_length>`}function o(a){return!!a&&!!a.includes("<thinking_mode>")&&(a.includes("<thinking_mode>enabled</thinking_mode>")||a.includes("<thinking_mode>interleaved</thinking_mode>"))}},44140:(a,b,c)=>{"use strict";c.d(b,{AU:()=>p,Aw:()=>q,fX:()=>s});let d=/switchboard/i,e=/Switchboard\//i,f="https://github.com/Vijay-Duke/switchboard-router",g=new Set(["authorization","x-api-key","api-key","cookie"]);function h(a){return g.has(String(a).toLowerCase())}function i(a){let b={};for(let[c,g]of a?a instanceof Headers?[...a.entries()]:Object.entries(a):[])null!=g&&!function(a,b){let c=String(a),g=null==b?"":String(b),i=c.toLowerCase();return!!(i.startsWith("x-switchboard-")||"x-client-type"===i&&/^switchboard$/i.test(g.trim())||"x-msh-platform"===i&&/^switchboard$/i.test(g.trim())||"user-agent"===i&&e.test(g)||d.test(c)&&!h(c)||d.test(g)&&!h(c)||g.includes(f))}(c,g)&&(b[c]=String(g));return b}Object.freeze({SWITCHBOARD_RE:d,SWITCHBOARD_UA_RE:e,SWITCHBOARD_GITHUB:f});var j=c(59882),k=c(70625),l=c(3507);let m="oauth-2025-04-20",n="claude-code-20250219",o="extended-cache-ttl-2025-04-11";function p(a){let b=[],c=new Set;for(let d of String(a||"").split(",")){let a=d.trim();a&&!c.has(a)&&(b.push(a),c.add(a))}if(!c.has(m)){let a=+(b[0]===n);b.splice(a,0,m)}return c.has(o)||b.push(o),b.join(",")}function q(a){return String(a||"").split(",").map(a=>a.trim()).filter(a=>a&&a!==n).join(",")}function r(a){return Object.keys(a).find(a=>"user-agent"===a.toLowerCase())}function s(a,b={}){let c=i(a),d=(0,j.ti)(b.identity,{format:b.format,provider:b.provider}),e=b.snapshot||(0,k.zi)(d),f="claude-cli"===d?(0,k.Iq)(b.credentialId):null,g=(0,j.$3)(c,d,{snapshot:f?{...e,os:f.os,arch:f.arch}:e,overlay:b.overlay,stream:b.stream,retryCount:b.retryCount,preserveUserAgent:!b.identity}),h=(0,j.E$)(d),m=i(g);if("claude-cli"===d&&b.requestPath?.startsWith("/v1/messages/count_tokens")){for(let a of Object.keys(m))"x-stainless-timeout"===a.toLowerCase()&&delete m[a];m=(0,j.Dm)(m,j.$R)}if(!r(m)){let a=e?.userAgent||function(a,b){let c=b?.version,d=(0,l.ol)()||"linux",e="ia32"===(0,l.LY)()?"x86":(0,l.LY)()||"x64";switch(a){case"claude-cli":return`claude-cli/${c||"2.1.302"} (external, cli)`;case"codex-cli":return`codex_cli_rs/${c||"0.163.0"}`;case"gemini-cli":return`GeminiCLI/${c||"0.64.0"}/unknown (${d}; ${e}; terminal)`;case"cline":return`Cline/${c||"3.0.0"}`;case"antigravity":return`antigravity/${c||"2.9.1"} ${d}/${e}`;case"copilot":return`GitHubCopilotChat/${c||"0.38.0"}`;case"qwen":return`QwenCode/${c||"0.12.3"} (${d}; ${e})`;case"grok-cli":return`grok-cli/${c||"1.0.0"}`;case"grok-build":return`grok-shell/${c||"0.2.99"} (${d}; ${e})`;case"chrome":return"Mozilla/5.0";default:return`OpenAI/NodeJS/${"u">typeof process&&process.version?process.version.replace(/^v/,""):"unknown"}`}}(d,e);m["User-Agent"]=a}return"claude-cli"===d&&function(a,b){let c=(0,k.Kn)(b),d=r(a),e=String(d?a[d]:"").match(/claude-(?:cli|code)\/(\d+\.\d+\.\d+)/i)?.[1]||null;if(!c.version||c.billingVersion!==c.version||c.tlsVersion!==c.version||c.userAgentVersion!==c.version||e!==c.version)throw Error(`Claude identity mismatch: ua=${e||c.userAgentVersion} version=${c.version} billing=${c.billingVersion} tls=${c.tlsVersion}`)}(m,e),{headers:i(m),profileId:d,tls:h?.tls||"node",alpn:h?.alpn||["h2","http/1.1"],tlsSpecRev:e?.tlsSpecRev}}},45221:(a,b,c)=>{"use strict";let{runtimeFeatures:d}=c(56758),{maxUnsigned16Bit:e,opcodes:f}=c(62026),g=null,h=8192,i=d.has("crypto")?c(77598).randomFillSync:null;function j(){return 8192===h&&(h=0,i(g??=Buffer.allocUnsafeSlow(8192),0,8192)),[g[h++],g[h++],g[h++],g[h++]]}class k{constructor(a){this.frameData=a}createFrame(a){let b=this.frameData,c=j(),d=b?.byteLength??0,f=d,g=6;d>e?(g+=8,f=127):d>125&&(g+=2,f=126);let h=Buffer.allocUnsafe(d+g);h[0]=h[1]=0,h[0]|=128,h[0]=(240&h[0])+a,h[g-4]=c[0],h[g-3]=c[1],h[g-2]=c[2],h[g-1]=c[3],h[1]=f,126===f?h.writeUInt16BE(d,2):127===f&&(h[2]=h[3]=0,h.writeUIntBE(d,4,6)),h[1]|=128;for(let a=0;a<d;++a)h[g+a]=b[a]^c[3&a];return h}static createFastTextFrame(a){let b=j(),c=a.length;for(let d=0;d<c;++d)a[d]^=b[3&d];let d=c,g=6;c>e?(g+=8,d=127):c>125&&(g+=2,d=126);let h=Buffer.allocUnsafeSlow(g);return h[0]=128|f.TEXT,h[1]=128|d,h[g-4]=b[0],h[g-3]=b[1],h[g-2]=b[2],h[g-1]=b[3],126===d?h.writeUInt16BE(c,2):127===d&&(h[2]=h[3]=0,h.writeUIntBE(c,4,6)),[h,a]}}a.exports={WebsocketFrameSend:k,generateMask:j}},45431:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(83382);let e={id:"grok-cli",priority:275,alias:"gcli",aliases:["grok-build","gb"],uiAlias:"gcli",display:{name:"Grok CLI (Grok Build)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"GC",website:"https://x.ai",notice:{text:"Sign in with your xAI account via device code. Uses Grok Build subscription credits.",signupUrl:"https://grok.com/supergrok"}},category:"oauth",authModes:["oauth"],hasOAuth:!0,thinkingConfig:{options:["low","medium","high","xhigh"],defaultMode:"high"},transport:{identity:d.s2,baseUrl:`${d.Nr}/responses`,format:"openai-responses",forceStream:!0,modelsUrl:`${d.Nr}/models`,userUrl:`${d.Nr}/user`,tokenAuth:"xai-grok-cli",clientIdentifier:d.rK,clientVersion:d.uG,usage:{url:`${d.Nr}/billing?format=credits`,userUrl:`${d.Nr}/user?include=subscription`},retry:{429:{attempts:2,delayMs:2e3},502:{attempts:2,delayMs:1500},503:{attempts:2,delayMs:1500}}},models:[{id:d.to,name:"Grok Build",contextLength:5e5,maxOutputTokens:64e3},{id:"grok-4.5",name:"Grok 4.5",contextLength:5e5,maxOutputTokens:64e3},{id:"grok-4.5-high",name:"Grok 4.5 (High)",upstreamModelId:"grok-4.5"},{id:"grok-4.5-medium",name:"Grok 4.5 (Medium)",upstreamModelId:"grok-4.5"},{id:"grok-4.5-low",name:"Grok 4.5 (Low)",upstreamModelId:"grok-4.5"}],serviceKinds:["llm"],oauth:{clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},features:{usage:!0}}},45504:(a,b,c)=>{"use strict";c.d(b,{t:()=>l});var d=c(99887),e=c(68531),f=c(10962),g=c(26408),h=c(11897),i=c(90242),j=c(30816);function k(a){return"string"!=typeof a?"":a.replace(/^x-anthropic-billing-header:[^\n]*(?:\r?\n)?/i,"")}function l(a,b,c,d=null,e=!1){let n={model:a,messages:[],stream:c};if(b.max_tokens&&(n.max_tokens=(0,f.M)(b)),void 0!==b.temperature&&(n.temperature=b.temperature),void 0!==b.stop_sequences?n.stop=b.stop_sequences:void 0!==b.stop&&(n.stop=b.stop),void 0!==b.top_p&&(n.top_p=b.top_p),void 0!==b.top_k&&(n.top_k=b.top_k),b.system){let a=Array.isArray(b.system)?b.system.map(a=>k(a.text||"")).filter(Boolean).join("\n"):k(b.system);a&&n.messages.push({role:h.z7.SYSTEM,content:a})}if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=function(a,b=!1){if(a.role===h.z7.SYSTEM){var c;let b,d=(b=(Array.isArray(c=a.content)?c.filter(a=>a?.type===h.R4.TEXT).map(a=>a.text||""):["string"==typeof c?c:""]).filter(Boolean).join("\n")).trim()?`<instructions>
|
|
352
352
|
${b}
|
|
353
353
|
</instructions>`:"";return d?{role:h.z7.USER,content:d}:null}let d=a.role===h.z7.USER||a.role===h.z7.TOOL?h.z7.USER:h.z7.ASSISTANT;if("string"==typeof a.content)return{role:d,content:a.content};if(Array.isArray(a.content)){let c=[],e=[],f=[],j="",k=null;for(let d of a.content)switch(d.type){case h.R4.TEXT:c.push({type:h.x4.TEXT,text:d.text});break;case h.R4.THINKING:d.thinking&&(j=j?`${j}
|
|
354
354
|
${d.thinking}`:d.thinking),d.signature&&!k&&(k=d.signature);break;case h.R4.REDACTED_THINKING:d.signature&&!k&&(k=d.signature);break;case h.R4.DOCUMENT:c.push(m(d));break;case h.R4.IMAGE:d.source?.type==="base64"?c.push({type:h.x4.IMAGE_URL,image_url:{url:(0,g.$q)(d.source.media_type,d.source.data)}}):d.source?.type==="url"&&d.source.url&&c.push({type:h.x4.IMAGE_URL,image_url:{url:d.source.url}});break;case h.R4.TOOL_USE:e.push({id:d.id,type:h.x4.FUNCTION,function:{name:d.name,arguments:"string"==typeof d.input?d.input:JSON.stringify(d.input||{})}});break;case h.R4.TOOL_RESULT:let a="";if("string"==typeof d.content)a=d.content;else if(Array.isArray(d.content)){let c=[],e=[];for(let a of d.content)a&&"object"==typeof a&&(a.type===h.R4.TEXT&&"string"==typeof a.text?c.push(a.text):a.type===h.R4.IMAGE?a.source?.type==="base64"&&a.source?.data?e.push({type:h.x4.IMAGE_URL,image_url:{url:(0,g.$q)(a.source.media_type,a.source.data)}}):a.source?.type==="url"&&a.source.url&&e.push({type:h.x4.IMAGE_URL,image_url:{url:a.source.url}}):a.type===h.R4.DOCUMENT&&e.push(m(a,b)));if(e.length>0){let b=[];c.length>0&&b.push({type:h.x4.TEXT,text:c.join("\n")}),b.push(...e),a=b}else a=c.length>0?c.join("\n"):JSON.stringify(d.content)}else d.content&&(a=JSON.stringify(d.content));let i={role:h.z7.TOOL,tool_call_id:d.tool_use_id,content:a};void 0!==d.is_error&&(i.is_error=!!d.is_error),f.push(i)}if(f.length>0)return c.length>0?[{role:h.z7.USER,content:(0,i.z)(c)},...f]:f;if(e.length>0){let a={role:h.z7.ASSISTANT};return c.length>0&&(a.content=(0,i.z)(c)),j&&(a.reasoning_content=j),k&&(a.reasoning_signature=k),a.tool_calls=e,a}if(c.length>0||j){let a={role:d};return c.length>0&&(a.content=(0,i.z)(c)),j&&(a.reasoning_content=j),k&&(a.reasoning_signature=k),a}if(0===a.content.length)return{role:d,content:""}}return null}(b.messages[a],e);c&&(Array.isArray(c)?n.messages.push(...c):n.messages.push(c))}return function(a){for(let b=0;b<a.length;b++){let c=a[b];if(c.role===h.z7.ASSISTANT&&c.tool_calls&&c.tool_calls.length>0){let d=c.tool_calls.map(a=>a.id),e=new Set,f=b+1;for(let c=b+1;c<a.length;c++){let b=a[c];if(b.role===h.z7.TOOL&&b.tool_call_id)e.add(b.tool_call_id),f=c+1;else break}let g=d.filter(a=>!e.has(a));if(g.length>0){let c=g.map(a=>({role:h.z7.TOOL,tool_call_id:a,content:""}));a.splice(f,0,...c),b=f+c.length-1}}}}(n.messages),b.tools&&Array.isArray(b.tools)&&(n.tools=b.tools.map(a=>({type:h.x4.FUNCTION,function:{name:a.name,description:"string"==typeof a.description?a.description:String(a.description||""),parameters:(0,j.M)(a.input_schema||{type:"object",properties:{}})}}))),b.tool_choice&&(n.tool_choice=function(a){if(!a)return"auto";if("string"==typeof a)return"none"===a||"auto"===a||"required"===a?a:"auto";switch(a.type){case"auto":default:return"auto";case"none":return"none";case"any":return"required";case"tool":return{type:h.x4.FUNCTION,function:{name:a.name}}}}(b.tool_choice)),void 0!==b.reasoning_effort?n.reasoning_effort=b.reasoning_effort:b.reasoning?.effort!==void 0&&(n.reasoning_effort=b.reasoning.effort),void 0!==b.reasoning&&(n.reasoning=b.reasoning),n}function m(a,b=!1){let c=a.source||{};return"base64"===c.type&&c.data?{type:h.x4.FILE,file:{file_data:(0,g.$q)(c.media_type||"application/pdf",c.data),...a.name?{filename:a.name}:{}}}:"url"===c.type&&c.url?b?{type:h.x4.FILE,file:{file_url:c.url}}:{type:h.x4.TEXT,text:`[Document: ${c.url}]`}:"text"===c.type&&"string"==typeof c.data?{type:h.x4.TEXT,text:c.data}:{type:h.x4.TEXT,text:`[Document: ${a.name||"omitted"}]`}}(0,d.kz)(e.h.CLAUDE,e.h.OPENAI,l,null)},45518:(a,b,c)=>{var d,e,f,g,h,i=c(45654);function j(a,b){i.cipher.registerAlgorithm(a,function(){return new i.aes.Algorithm(a,b)})}c(66568),c(19396),c(33889),a.exports=i.aes=i.aes||{},i.aes.startEncrypting=function(a,b,c,d){var e=o({key:a,output:c,decrypt:!1,mode:d});return e.start(b),e},i.aes.createEncryptionCipher=function(a,b){return o({key:a,output:null,decrypt:!1,mode:b})},i.aes.startDecrypting=function(a,b,c,d){var e=o({key:a,output:c,decrypt:!0,mode:d});return e.start(b),e},i.aes.createDecryptionCipher=function(a,b){return o({key:a,output:null,decrypt:!0,mode:b})},i.aes.Algorithm=function(a,b){k||l();var c=this;c.name=a,c.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return n(c._w,a,b,!1)},decrypt:function(a,b){return n(c._w,a,b,!0)}}}),c._init=!1},i.aes.Algorithm.prototype.initialize=function(a){if(!this._init){var b,c=a.key;if("string"==typeof c&&(16===c.length||24===c.length||32===c.length))c=i.util.createBuffer(c);else if(i.util.isArray(c)&&(16===c.length||24===c.length||32===c.length)){b=c,c=i.util.createBuffer();for(var d=0;d<b.length;++d)c.putByte(b[d])}if(!i.util.isArray(c)){b=c,c=[];var e=b.length();if(16===e||24===e||32===e){e>>>=2;for(var d=0;d<e;++d)c.push(b.getInt32())}}if(!i.util.isArray(c)||4!==c.length&&6!==c.length&&8!==c.length)throw Error("Invalid key parameter.");var f=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=m(c,a.decrypt&&!f),this._init=!0}},i.aes._expandKey=function(a,b){return k||l(),m(a,b)},i.aes._updateBlock=n,j("AES-ECB",i.cipher.modes.ecb),j("AES-CBC",i.cipher.modes.cbc),j("AES-CFB",i.cipher.modes.cfb),j("AES-OFB",i.cipher.modes.ofb),j("AES-CTR",i.cipher.modes.ctr),j("AES-GCM",i.cipher.modes.gcm);var k=!1;function l(){k=!0,f=[0,1,2,4,8,16,32,64,128,27,54];for(var a=Array(256),b=0;b<128;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;d=Array(256),e=Array(256),g=[,,,,],h=[,,,,];for(var b=0;b<4;++b)g[b]=Array(256),h[b]=Array(256);for(var c,i,j,l,m,n,o,p=0,q=0,b=0;b<256;++b){l=(l=q^q<<1^q<<2^q<<3^q<<4)>>8^255&l^99,d[p]=l,e[l]=p,m=a[l],c=a[p],i=a[c],j=a[i],n=m<<24^l<<16^l<<8^(l^m),o=(c^i^j)<<24^(p^j)<<16^(p^i^j)<<8^(p^c^j);for(var r=0;r<4;++r)g[r][p]=n,h[r][l]=o,n=n<<24|n>>>8,o=o<<24|o>>>8;0===p?p=q=1:(p=c^a[a[a[c^j]]],q^=a[a[q]])}}function m(a,b){for(var c,e=a.slice(0),g=1,i=e.length,j=4*(i+6+1),k=i;k<j;++k)c=e[k-1],k%i==0?(c=d[c>>>16&255]<<24^d[c>>>8&255]<<16^d[255&c]<<8^d[c>>>24]^f[g]<<24,g++):i>6&&k%i==4&&(c=d[c>>>24]<<24^d[c>>>16&255]<<16^d[c>>>8&255]<<8^d[255&c]),e[k]=e[k-i]^c;if(b){var l,m=h[0],n=h[1],o=h[2],p=h[3],q=e.slice(0);j=e.length;for(var k=0,r=j-4;k<j;k+=4,r-=4)if(0===k||k===j-4)q[k]=e[r],q[k+1]=e[r+3],q[k+2]=e[r+2],q[k+3]=e[r+1];else for(var s=0;s<4;++s)l=e[r+s],q[k+(3&-s)]=m[d[l>>>24]]^n[d[l>>>16&255]]^o[d[l>>>8&255]]^p[d[255&l]];e=q}return e}function n(a,b,c,f){var i,j,k,l,m,n,o,p,q,r,s,t,u=a.length/4-1;f?(i=h[0],j=h[1],k=h[2],l=h[3],m=e):(i=g[0],j=g[1],k=g[2],l=g[3],m=d),n=b[0]^a[0],o=b[f?3:1]^a[1],p=b[2]^a[2],q=b[f?1:3]^a[3];for(var v=3,w=1;w<u;++w)r=i[n>>>24]^j[o>>>16&255]^k[p>>>8&255]^l[255&q]^a[++v],s=i[o>>>24]^j[p>>>16&255]^k[q>>>8&255]^l[255&n]^a[++v],t=i[p>>>24]^j[q>>>16&255]^k[n>>>8&255]^l[255&o]^a[++v],q=i[q>>>24]^j[n>>>16&255]^k[o>>>8&255]^l[255&p]^a[++v],n=r,o=s,p=t;c[0]=m[n>>>24]<<24^m[o>>>16&255]<<16^m[p>>>8&255]<<8^m[255&q]^a[++v],c[f?3:1]=m[o>>>24]<<24^m[p>>>16&255]<<16^m[q>>>8&255]<<8^m[255&n]^a[++v],c[2]=m[p>>>24]<<24^m[q>>>16&255]<<16^m[n>>>8&255]<<8^m[255&o]^a[++v],c[f?1:3]=m[q>>>24]<<24^m[n>>>16&255]<<16^m[o>>>8&255]<<8^m[255&p]^a[++v]}function o(a){var b,c="AES-"+((a=a||{}).mode||"CBC").toUpperCase(),d=(b=a.decrypt?i.cipher.createDecipher(c,a.key):i.cipher.createCipher(c,a.key)).start;return b.start=function(a,c){var e=null;c instanceof i.util.ByteBuffer&&(e=c,c={}),(c=c||{}).output=e,c.iv=a,d.call(b,c)},b}},45654:a=>{a.exports={options:{usePureJavaScript:!1}}},45874:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>k,exportSettings:()=>l,getSettings:()=>j});var d=c(24081),e=c(50743);let f={stickyRoundRobinLimit:3,providerStrategies:{},providerSchedules:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},enableObservability:!0,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:20128",dnsToolEnabled:{},rtkEnabled:!0,headroomEnabled:!1,headroomUrl:process.env.HEADROOM_URL||"http://localhost:8787",headroomCompressUserMessages:!1,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",pxpipeEnabled:!1,pxpipeAutoInstall:!0,pxpipeMinChars:25e3,pxpipeTimeoutMs:15e3,requireApiKey:!0,ssrfAllowHosts:[],capacityAdapter:{vision:{enabled:!0,roundRobin:!1,models:[]},pdf:{enabled:!1,roundRobin:!1,models:[]},audioInput:{enabled:!0,roundRobin:!1,models:[]},videoInput:{enabled:!1,roundRobin:!1,models:[]}}};async function g(){let a=(await (0,d.c)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}let h={value:null,at:0};function i(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c);let c=function(){let a=process.env.REQUIRE_API_KEY;if(null==a||""===a)return null;let b=String(a).trim().toLowerCase();return"1"===b||"true"===b||"yes"===b||"0"!==b&&"false"!==b&&"no"!==b&&null}();return null!==c&&(b.requireApiKey=c),b}async function j(){return h.value&&Date.now()-h.at<2e3?{...h.value}:{...(h={value:i(await g()),at:Date.now()}).value}}async function k(a){let b,c=await (0,d.c)();return c.transaction(()=>{let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),h.at=0,i(b)}async function l(){return h.at=0,await g()}},46036:(a,b,c)=>{"use strict";c(68531)},46248:(a,b,c)=>{"use strict";c.d(b,{L:()=>t});var d=c(22256),e=c(38421),f=c(74570),g=c(22884),h=c(10793),i=c(44140),j=c(50969),k=c(77321),l=c(29137),m=c(49623);let n={combined:!0,header:"Authorization",scheme:"bearer"},o={combined:!0,header:"x-api-key",scheme:"raw"},p=Object.fromEntries(Object.entries(e.xq).filter(([,a])=>a.auth).map(([a,b])=>[a,b.auth]));function q(a,b,c){a[b.header]="bearer"===b.scheme?`Bearer ${c}`:c}let r={kimiHeaders:(a,b)=>Object.assign(a,(0,h.VK)(b?.providerSpecificData?.deviceId)),clineHeaders:(a,b)=>Object.assign(a,function(a,b={}){let c,d=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",{headers:e}=(0,i.fX)({...d?{Authorization:d}:{},...b},{identity:"cline"});return e}(b.apiKey||b.accessToken)),kilocodeOrg:(a,b)=>{b.providerSpecificData?.orgId&&(a["X-Kilocode-OrganizationID"]=b.providerSpecificData.orgId)}},s=Object.fromEntries(Object.entries(e.sr).filter(([,a])=>a.refresh).map(([a,b])=>{let c=b.tokenUrl,d=b.refresh.encoding,e=b.refresh.scope?{scope:b.refresh.scope}:{};return[a,{encoding:d,url:()=>c,params:c=>"gemini"===a?{client_id:c.config.clientId,client_secret:c.config.clientSecret,...e}:{client_id:b.clientId,...e}}]}));class t extends d.Hv{constructor(a){super(a,e.xq[a]||e.xq.openai)}transformRequest(a,b,c,e){super.transformRequest(a,b,c,e);let f=this.applyJsonSchemaFallback(b);if(f&&"object"==typeof f){this.config.quirks?.dropClientMetadata&&delete f.client_metadata,(0,l.c)(this.provider,a,f);let b=(0,g.jJ)(this.provider,e);c&&("openai"===b||"ollama"===b)&&Array.isArray(f.messages)&&!f.stream_options&&(f.stream_options={include_usage:!0}),(0,d._2)(this.config)?delete f.stream:c&&!0!==f.stream&&(f.stream=!0)}return(0,k.Z)({provider:this.provider,model:a,body:f})}applyJsonSchemaFallback(a){if(!this.provider?.startsWith?.("openai-compatible-"))return a;let b=a?.response_format;if(b?.type!=="json_schema"||!b.json_schema?.schema)return a;let c=JSON.stringify(b.json_schema.schema,null,2),d=`You must respond with valid JSON that strictly follows this JSON schema:
|
|
@@ -359,13 +359,13 @@ Respond ONLY with the JSON object, no other text.`,e=Array.isArray(a.messages)?a
|
|
|
359
359
|
|
|
360
360
|
${d}`:Array.isArray(f.content)&&f.content.push({type:"text",text:`
|
|
361
361
|
|
|
362
|
-
${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null){let e=d?.runtimeTransport;if(e?.baseUrl)return e.urlSuffix?`${e.baseUrl}${e.urlSuffix}`:e.baseUrl;if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.Es).replace(/\/$/,""),b="responses"===(0,g.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.ky).replace(/\/$/,"");return`${a}/messages`}if("gemini"===this.config.format)return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;if(this.config.urlSuffix)return`${this.config.baseUrl}${this.config.urlSuffix}`;let h=this.config.baseUrl;if(h?.includes("{accountId}")){let a=d?.providerSpecificData?.accountId;if(!a)throw Error(`${this.provider} requires accountId in providerSpecificData`);return h.replace("{accountId}",a)}return h}resolveAuthDescriptor(){return this.provider?.startsWith?.("anthropic-compatible-")?{apiKey:{header:"x-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"},anthropicVersion:!0}:this.config?.format==="claude"?{...o,anthropicVersion:!0}:n}buildHeaders(a,b=!0,c,d){let e=a?.runtimeTransport,g={"Content-Type":"application/json",...e?e.headers:this.config.headers},h=e?.auth||p[this.provider]||this.resolveAuthDescriptor();for(let b of h.hooks||[])r[b]?.(g,a);if(!function(a,b,c){if(b.combined){q(a,b,c.apiKey||c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8);return}c.apiKey?q(a,b.apiKey,c.apiKey):c.accessToken&&q(a,b.oauth,c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8)}(g,h,a),"claude"===this.provider&&d&&(g["Anthropic-Beta"]=(0,f.d)(d)),this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let b of(a.apiKey&&!g.Authorization&&(g.Authorization=`Bearer ${a.apiKey}`),delete g["anthropic-dangerous-direct-browser-access"],delete g["Anthropic-Dangerous-Direct-Browser-Access"],delete g["x-app"],delete g["X-App"],["anthropic-beta","Anthropic-Beta"]))if(g[b]){let a=g[b].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");a?g[b]=a:delete g[b]}}}if(c&&!g["x-opencode-session"])try{"opencode.ai"===new URL(c).hostname&&(g["x-opencode-session"]=(0,m.oV)({headers:a?.rawHeaders,connectionId:a?.connectionId,scope:"opencode"}))}catch{}return b&&(g.Accept="text/event-stream"),g}refreshFromGrant(a,b){let c=s[this.provider],d={grant_type:"refresh_token",refresh_token:a.refreshToken,...c.params(this)};return"json"===c.encoding?this.refreshWithJSON(c.url(),d,b,this.provider):this.refreshWithForm(c.url(),d,b,this.provider)}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshFromGrant(a,c),codex:()=>this.refreshFromGrant(a,c),qwen:()=>this.refreshWithForm(h.NA.qwen.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.qwen.clientId},c,"qwen"),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshFromGrant(a,c),kiro:()=>this.refreshKiro(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),"kimi-coding":()=>this.refreshKimiCoding(a,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null,d=this.provider){let f=await (0,j.Fm)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b),identity:e.xq[d]?.identity,provider:d,format:e.xq[d]?.format},c);if(!f.ok)return null;let g=await f.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||b.refresh_token,expiresIn:g.expires_in}}async refreshWithForm(a,b,c=null,d=this.provider){let f=await (0,j.Fm)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b),identity:e.xq[d]?.identity,provider:d,format:e.xq[d]?.format},c);if(!f.ok)return null;let g=await f.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||b.refresh_token,expiresIn:g.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${e.xq.iflow.clientId}:${e.xq.iflow.clientSecret}`),d=await (0,j.Fm)(h.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:e.xq.iflow.clientId,client_secret:e.xq.iflow.clientSecret}),identity:e.xq.iflow?.identity,provider:"iflow",format:e.xq.iflow?.format},b);if(!d.ok)return null;let f=await d.json();return{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async refreshKiro(a,b=null){let c=await (0,j.Fm)(e.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}),identity:e.xq.kiro?.identity,provider:"kiro",format:e.xq.kiro?.format},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCline(a,b=null){let c=await (0,j.Fm)(e.xq.cline.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"}),identity:e.xq.cline?.identity,provider:"cline",format:e.xq.cline?.format},b);if(!c.ok)return null;let d=await c.json(),f=d?.data||d,g=f?.expiresAt,h=g?Math.max(1,Math.floor((new Date(g).getTime()-Date.now())/1e3)):void 0,i=f?.accessToken;return i&&!i.startsWith("workos:")&&(i=`workos:${i}`),{accessToken:i,refreshToken:f?.refreshToken||a,expiresIn:h}}async refreshKimiCoding(a,b=null){let c=a?.providerSpecificData?.deviceId,d=(0,h.VK)(c),f=await (0,j.Fm)(e.xq["kimi-coding"].refreshUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...d},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq["kimi-coding"].clientId}),identity:e.xq["kimi-coding"]?.identity,provider:"kimi-coding",format:e.xq["kimi-coding"]?.format},b);if(!f.ok)return null;let g=await f.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||a.refreshToken,expiresIn:g.expires_in,...c?{providerSpecificData:{...a.providerSpecificData,deviceId:c}}:{}}}async refreshKilocode(a,b=null){return null}}},47335:(a,b,c)=>{"use strict";let d=c(60823),{ResponseError:e}=c(61448);class f extends d{#M;#a4;#a5;#e;#a6;constructor(a,{handler:b}){super(b)}#a7(a){return 0===(this.#a4??"").indexOf(a)}onRequestStart(a,b){return this.#M=0,this.#a4=null,this.#a5=null,this.#e=null,this.#a6="",super.onRequestStart(a,b)}onResponseStart(a,b,c,d){if(this.#M=b,this.#e=c,this.#a4=c["content-type"],this.#M<400)return super.onResponseStart(a,b,c,d);(this.#a7("application/json")||this.#a7("text/plain"))&&(this.#a5=new TextDecoder("utf-8"))}onResponseData(a,b){if(this.#M<400)return super.onResponseData(a,b);this.#a6+=this.#a5?.decode(b,{stream:!0})??""}onResponseEnd(a,b){if(this.#M>=400){let b;if(this.#a6+=this.#a5?.decode(void 0,{stream:!1})??"",this.#a7("application/json"))try{this.#a6=JSON.parse(this.#a6)}catch{}let c=Error.stackTraceLimit;Error.stackTraceLimit=0;try{b=new e("Response Error",this.#M,{body:this.#a6,headers:this.#e})}finally{Error.stackTraceLimit=c}super.onResponseError(a,b)}else super.onResponseEnd(a,b)}onResponseError(a,b){super.onResponseError(a,b)}}a.exports=()=>a=>function(b,c){return a(b,new f(b,{handler:c}))}},47659:(a,b,c)=>{"use strict";c(63971),c(50969);var d=c(38528);c(10793),(0,d.U)("antigravity"),c(82961),c(20012),c(43835),(0,d.U)("minimax").urls,(0,d.U)("minimax-cn").urls,c(15251),c(83382),(0,d.U)("glm").url,(0,d.U)("glm-cn").url,(0,d.U)("vercel-ai-gateway").url},47703:(a,b,c)=>{"use strict";let{pipeline:d}=c(57075),{fetching:e}=c(76403),{webidl:f}=c(32984),{EventSourceStream:g}=c(97356),{parseMIMEType:h}=c(16537),{createFastMessageEvent:i}=c(51753),{isNetworkError:j}=c(78196),{isValidHeaderValue:k,kEnumerableProperty:l}=c(84285),{environmentSettingsObject:m}=c(42425),{createPotentialCORSRequest:n}=c(26376),{getGlobalDispatcher:o}=c(59970),{isomorphicDecode:p}=c(70745),q=new TextEncoder,r=!1;class s extends EventTarget{#a8={open:null,error:null,message:null};#aJ;#a9=!1;#ba=0;#bb=null;#B=null;#d;#a;constructor(a,b={}){let c;super(),f.util.markAsUncloneable(this);const d="EventSource constructor";f.argumentLengthCheck(arguments,1,d),r||(r=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),a=f.converters.USVString(a),b=f.converters.EventSourceInitDict(b,d,"eventSourceInitDict"),this.#d=b.node.dispatcher||b.dispatcher,this.#a={lastEventId:"",reconnectionTime:b.node.reconnectionTime};try{c=new URL(a,m.settingsObject.baseUrl),this.#a.origin=c.origin}catch(a){throw new DOMException(a,"SyntaxError")}this.#aJ=c.href;let e="anonymous";!0===b.withCredentials&&(e="use-credentials",this.#a9=!0);const g=n(c,"",e);g.client=m.settingsObject,g.headersList.set("Accept","text/event-stream"),g.cache="no-store",g.initiator="other",this.#bb=g,this.#bc()}get readyState(){return f.brandCheck(this,f.is.EventSource),this.#ba}get url(){return f.brandCheck(this,f.is.EventSource),this.#aJ}get withCredentials(){return f.brandCheck(this,f.is.EventSource),this.#a9}#bc(){if(2===this.#ba)return;this.#ba=0;let a={request:this.#bb,dispatcher:this.#d};a.processResponseEndOfBody=a=>{if(!j(a))return this.#bd()},a.processResponse=a=>{if(j(a))if(!a.aborted)return void this.#bd();else{this.close(),this.dispatchEvent(new Event("error"));return}let b=a.headersList.get("content-type",!0),c=null!==b?h(b):"failure",e="failure"!==c&&"text/event-stream"===c.essence;if(200!==a.status||!1===e){this.close(),this.dispatchEvent(new Event("error"));return}this.#ba=1,this.dispatchEvent(new Event("open")),this.#a.origin=a.urlList[a.urlList.length-1].origin;let f=new g({eventSourceSettings:this.#a,maxEventSize:this.#d.eventSourceOptions?.maxEventSize,push:a=>{this.dispatchEvent(i(a.type,a.options))}});d(a.body.stream,f,a=>{a?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#B=e(a)}#bd(){2!==this.#ba&&(this.#ba=0,this.dispatchEvent(new Event("error")),setTimeout(()=>{if(0===this.#ba){if(this.#bb.headersList.delete("last-event-id",!0),this.#a.lastEventId.length){let a=p(q.encode(this.#a.lastEventId));k(a)&&this.#bb.headersList.set("last-event-id",a,!0)}this.#bc()}},this.#a.reconnectionTime)?.unref())}close(){f.brandCheck(this,f.is.EventSource),2!==this.#ba&&(this.#ba=2,this.#B.abort(),this.#bb=null)}get onopen(){return f.brandCheck(this,f.is.EventSource),this.#a8.open}set onopen(a){f.brandCheck(this,f.is.EventSource),this.#a8.open&&this.removeEventListener("open",this.#a8.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#a8.open=a):this.#a8.open=null}get onmessage(){return f.brandCheck(this,f.is.EventSource),this.#a8.message}set onmessage(a){f.brandCheck(this,f.is.EventSource),this.#a8.message&&this.removeEventListener("message",this.#a8.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#a8.message=a):this.#a8.message=null}get onerror(){return f.brandCheck(this,f.is.EventSource),this.#a8.error}set onerror(a){f.brandCheck(this,f.is.EventSource),this.#a8.error&&this.removeEventListener("error",this.#a8.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#a8.error=a):this.#a8.error=null}static{f.is.EventSource=a=>null!=a&&"object"==typeof a&&#a8 in a}}let t={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(s,t),Object.defineProperties(s.prototype,t),Object.defineProperties(s.prototype,{close:l,onerror:l,onmessage:l,onopen:l,readyState:l,url:l,withCredentials:l}),f.converters.EventSourceInitDict=f.dictionaryConverter([{key:"withCredentials",converter:f.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>o()},{key:"node",converter:f.dictionaryConverter([{key:"reconnectionTime",converter:f.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:f.converters.any}]),defaultValue:()=>({})}]),a.exports={EventSource:s,defaultReconnectionTime:3e3}},47800:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),{runtimeFeatures:e}=c(56758),f=e.has("crypto")?c(77598):null,g=f?.hash?a=>f.hash("sha256",a,"base64url"):a=>Buffer.from(a).toString("base64url");function h(a){return Array.isArray(a)&&(1&a.length)==0}let i=["record","playback","update"];a.exports={createHeaderFilters:function(a={}){let{ignoreHeaders:b=[],excludeHeaders:c=[],matchHeaders:d=[],caseSensitive:e=!1}=a;return{ignore:new Set(b.map(a=>e?a:a.toLowerCase())),exclude:new Set(c.map(a=>e?a:a.toLowerCase())),match:new Set(d.map(a=>e?a:a.toLowerCase()))}},hashId:g,isUndiciHeaders:h,normalizeHeaders:function(a){let b={};if(!a)return b;if(h(a)){for(let c=0;c<a.length;c+=2){let d=a[c],e=a[c+1];if(d&&void 0!==e){let a=Buffer.isBuffer(d)?d.toString():d,c=Buffer.isBuffer(e)?e.toString():e;b[a.toLowerCase()]=c}}return b}if(a&&"object"==typeof a)for(let[c,d]of Object.entries(a))c&&"string"==typeof c&&(b[c.toLowerCase()]=Array.isArray(d)?d.join(", "):String(d));return b},isUrlExcludedFactory:function(a=[]){return 0===a.length?()=>!1:function(b){let c;for(let d of a)if("string"==typeof d){if(c||(c=b.toLowerCase()),c.includes(d.toLowerCase()))return!0}else if(d instanceof RegExp&&d.test(b))return!0;return!1}},validateSnapshotMode:function(a){if(!i.includes(a))throw new d(`Invalid snapshot mode: ${a}. Must be one of: ${i.join(", ")}`)}}},48841:(a,b,c)=>{"use strict";let{kProxy:d,kClose:e,kDestroy:f,kDispatch:g}=c(49176),h=c(37417),i=c(35689),j=c(5318),{InvalidArgumentError:k,RequestAbortedError:l,SecureProxyConnectionError:m,ProxyConnectionError:n}=c(61448),o=c(55285),p=c(40106),{channels:q}=c(62571),r=c(64156),{hasSafeIterator:s}=c(84285),t=Symbol("proxy agent"),u=Symbol("proxy client"),v=Symbol("proxy headers"),w=Symbol("request tls settings"),x=Symbol("proxy tls settings"),y=Symbol("connect endpoint function"),z=Symbol("connect endpoint function (http/1.1 only)"),A=Symbol("tunnel proxy"),B="proxy-authorization";function C(a,b){return new i(a,b)}let D=()=>{};function E(a,b){return 1===b.connections?new p(a,b):new i(a,b)}class F extends j{#be;#bf;constructor(a,{headers:b={},connect:c,factory:d,proxyServername:e}){if(!a)throw new k("Proxy URL is mandatory");super(),this[v]=b,this.#bf=e,d?this.#be=d(a,{connect:c}):this.#be=new p(a,{connect:c})}[g](a,b){let c=b.onResponseStart;b.onResponseStart=function(a,d,e,f){if(407===d){"function"==typeof b.onResponseError&&b.onResponseError(a,new k("Proxy Authentication Required (407)"));return}c&&c.call(this,a,d,e,f)};let{origin:d,path:e="/",headers:f={}}=a;if(a.path=d+e,!("host"in f)&&!("Host"in f)){let{host:a}=new URL(d);f.host=a}return a.headers={...this[v],...f},null!=this.#bf&&(a.servername=this.#bf),this.#be[g](a,b)}[e](){return this.#be.close()}[f](a){return this.#be.destroy(a)}}class G extends j{constructor(a){if(!a||"object"==typeof a&&!(a instanceof URL)&&!a.uri)throw new k("Proxy uri is mandatory");const{clientFactory:b=C}=a;if("function"!=typeof b)throw new k("Proxy opts.clientFactory must be a function.");const{proxyTunnel:c,connectTimeout:e}=a;super(a);const f=this.#bg(a),{href:g,origin:i,port:j,protocol:p,username:s,password:B,hostname:G}=f;if(this[d]={uri:g,protocol:p},this[w]=a.requestTls,this[x]=a.proxyTls,this[v]=a.headers||{},this[A]=c,a.auth&&a.token)throw new k("opts.auth cannot be used in combination with opts.token");a.auth?this[v]["proxy-authorization"]=`Basic ${a.auth}`:a.token?this[v]["proxy-authorization"]=a.token:s&&B?this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:${decodeURIComponent(B)}`).toString("base64")}`:s&&(this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:`).toString("base64")}`);const H=o({timeout:e,...a.proxyTls}),I=o({timeout:e,...a.proxyTls,allowH2:!1});this[y]=o({timeout:e,...a.requestTls}),this[z]=o({timeout:e,...a.requestTls,allowH2:!1});const J=a.factory||E,K=(b,c)=>{let{protocol:f}=new URL(b);if("socks5:"===this[d].protocol||"socks:"===this[d].protocol)return new r(this[d].uri,{headers:this[v],connect:H,factory:J,username:a.username||s,password:a.password||B,connectTimeout:e,proxyTls:a.proxyTls,requestTls:a.requestTls});if(!0!==this[A]&&"http:"===f){let a="https:"===this[d].protocol?(a,b)=>I(a,(a,c)=>{a&&"ERR_TLS_CERT_ALTNAME_INVALID"===a.code?b(new m(a)):b(a,c)}):I;return new F(this[d].uri,{headers:this[v],connect:a,factory:J,proxyServername:"https:"===this[d].protocol?this[x]?.servername||G:void 0})}return J(b,c)};"socks5:"===p||"socks:"===p?this[u]=null:this[u]=b(f,{connect:H}),this[t]=new h({...a,factory:K,connect:async(a,b)=>{if(!this[u])return void b(new k("Cannot establish tunnel connection without a proxy client"));let c=a.host;a.port||(c+=`:${"https:"===a.protocol?443:80}`);try{let d,e={origin:i,port:j,path:c,signal:a.signal,headers:{...this[v],host:a.host,...null==a.connections||a.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[x]?.servername||G},{socket:f,statusCode:g}=await this[u].connect(e);if(200!==g){f.on("error",D).destroy(),b(new l(`Proxy response (${g}) !== 200 when HTTP Tunneling`));return}if(q.proxyConnected.hasSubscribers&&q.proxyConnected.publish({socket:f,connectParams:e}),"https:"!==a.protocol)return void b(null,f);d=this[w]?this[w].servername:a.servername,(!1===a.allowH2?this[z]:this[y])({...a,servername:d,httpSocket:f},b)}catch(a){b("ERR_TLS_CERT_ALTNAME_INVALID"===a.code?new m(a):"UND_ERR_SOCKET"===a.code?new n(a):a)}}})}dispatch(a,b){let c=function(a){if(Array.isArray(a)){let b={};for(let c=0;c<a.length;c+=2)H(a[c])&&I(),b[a[c]]=a[c+1];return b}if(a&&"object"==typeof a&&s(a)){let b={};for(let[c,d]of a){if(!Object.hasOwn(b,c)){b[c]=d;continue}let a=b[c],e=[];void 0!==a&&e.push(...Array.isArray(a)?a:[a]),void 0!==d&&e.push(...Array.isArray(d)?d:[d]),b[c]=e.length>1?e:e[0]}return b}return a}(a.headers);if(function(a){for(let b in a)H(b)&&I()}(c),c&&!("host"in c)&&!("Host"in c)){let{host:b}=new URL(a.origin);c.host=b}return this[t].dispatch({...a,headers:c},b)}#bg(a){return"string"==typeof a?new URL(a):a instanceof URL?a:new URL(a.uri)}[e](){let a=[this[t].close()];return this[u]&&a.push(this[u].close()),Promise.all(a)}[f](){let a=[this[t].destroy()];return this[u]&&a.push(this[u].destroy()),Promise.all(a)}}function H(a){return a.length===B.length&&a.toLowerCase()===B}function I(){throw new k("Proxy-Authorization should be sent in ProxyAgent constructor")}a.exports=G},49166:(a,b,c)=>{"use strict";let{Cache:d}=c(50027),{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h{#bh=new Map;constructor(){arguments[0]!==g&&e.illegalConstructor(),e.util.markAsUncloneable(this)}async match(a,b={}){if(e.brandCheck(this,e.is.CacheStorage),e.argumentLengthCheck(arguments,1,"CacheStorage.match"),a=e.converters.RequestInfo(a),null!=(b=e.converters.MultiCacheQueryOptions(b)).cacheName){if(this.#bh.has(b.cacheName)){let c=new d(g,this.#bh.get(b.cacheName));return await c.match(a,b)}}else for(let c of this.#bh.values()){let e=new d(g,c),f=await e.match(a,b);if(void 0!==f)return f}}async has(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.has";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bh.has(a)}async open(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.open";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bh.has(a))return new d(g,this.#bh.get(a));let c=[];return this.#bh.set(a,c),new d(g,c)}async delete(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.delete";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bh.delete(a)}async keys(){return e.brandCheck(this,e.is.CacheStorage),[...this.#bh.keys()]}static{e.is.CacheStorage=a=>null!=a&&"object"==typeof a&&#bh in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:f,has:f,open:f,delete:f,keys:f}),a.exports={CacheStorage:h}},49176:a=>{"use strict";a.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kRequestOrigin:Symbol("request origin"),kOriginless:Symbol("originless"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2Options:Symbol("http2 options"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHostAuthority:Symbol("host authority"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}},49209:(a,b,c)=>{"use strict";c.d(b,{$:()=>p});var d=c(22256),e=c(38421),f=c(19016),g=c(24725),h=c(50969);let i=e.xq["grok-web"].baseUrl,j={"grok-3":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3",isThinking:!1},"grok-3-mini":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_MINI_THINKING",isThinking:!0},"grok-3-thinking":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_THINKING",isThinking:!0},"grok-4":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4",isThinking:!1},"grok-4-mini":{grokModel:"grok-4-mini",modelMode:"MODEL_MODE_GROK_4_MINI_THINKING",isThinking:!0},"grok-4-thinking":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4_THINKING",isThinking:!0},"grok-4-heavy":{grokModel:"grok-4",modelMode:"MODEL_MODE_HEAVY",isThinking:!0},"grok-4.1-mini":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_MINI_THINKING",isThinking:!0},"grok-4.1-fast":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_FAST",isThinking:!1},"grok-4.1-expert":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_EXPERT",isThinking:!0},"grok-4.1-thinking":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_THINKING",isThinking:!0},"grok-4.2":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20-beta":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1}};function k(a,b=!1){let c=b?"abcdefghijklmnopqrstuvwxyz0123456789":"abcdefghijklmnopqrstuvwxyz",d="";for(let b=0;b<a;b++)d+=c[Math.floor(Math.random()*c.length)];return d}function l(a){let b=new Uint8Array(a);return crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join("")}async function*m(a,b){let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a).trim();if(e=e.slice(a+1),b)try{yield JSON.parse(b)}catch{}}}let a=(e+=d.decode()).trim();if(a)try{yield JSON.parse(a)}catch{}}finally{c.releaseLock()}}async function*n(a,b,c){let d="",e="",f=!1;for await(let g of m(a,c)){if(g.error)return void(yield{error:g.error.message||`Grok error: ${g.error.code}`,done:!0});let a=g.result?.response;if(a){if(a.llmInfo?.modelHash&&!d&&(d=a.llmInfo.modelHash),a.responseId&&(e=a.responseId),a.modelResponse){let c=a.modelResponse;f&&b&&(c.message&&(yield{thinking:c.message}),f=!1),c.message&&(yield{fullMessage:c.message,fingerprint:d,responseId:e}),c.metadata?.llm_info?.modelHash&&(d=c.metadata.llm_info.modelHash);continue}null!=a.token&&(yield{delta:a.token,fingerprint:d,responseId:e})}}yield{done:!0,fingerprint:d,responseId:e}}async function o(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of n(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),l=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:l,total_tokens:k+l}}),{status:200,headers:{"Content-Type":"application/json"}})}class p extends d.Hv{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:m,proxyOptions:p=null}){let q,r,s=b?.messages;if(!s||!Array.isArray(s)||0===s.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};let t=j[a];t||m?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:u,modelMode:v,isThinking:w}=t||j["grok-4.1-fast"],x=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(s);if(!x.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};let y={temporary:!0,modelName:u,modelMode:v,message:x,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},z=l(16),A=l(8),B={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${k(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${k(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${z}-${A}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),B.Cookie=`sso=${a}`}m?.info?.("GROK-WEB",`Query to ${a} (grok=${u}, mode=${v}), len=${x.length}`);try{q=await (0,h.Fm)(i,{method:"POST",headers:B,body:JSON.stringify(y),signal:e,identity:this.config.identity,provider:this.provider,format:this.config.format},p)}catch(a){return m?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:B,transformedBody:y}}if(!q.ok){let a=q.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),m?.warn?.("GROK-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:i,headers:B,transformedBody:y}}if(!q.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:B,transformedBody:y};let C=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,D=Math.floor(Date.now()/1e3);if(c){var E;let b;r=new Response((E=q.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of n(E,w,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}catch(d){c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else r=await o(q.body,a,C,D,w,e);return{response:r,url:i,headers:B,transformedBody:y}}}},49345:(a,b,c)=>{var d=c(45654);c(33889);var e=a.exports=d.pem=d.pem||{};function f(a){for(var b=a.name+": ",c=[],d=function(a,b){return" "+b},e=0;e<a.values.length;++e)c.push(a.values[e].replace(/^(\S+\r\n)/,d));b+=c.join(",")+"\r\n";for(var f=0,g=-1,e=0;e<b.length;++e,++f)if(f>65&&-1!==g){var h=b[g];","===h?(++g,b=b.substr(0,g)+"\r\n "+b.substr(g)):b=b.substr(0,g)+"\r\n"+h+b.substr(g+1),f=e-g-1,g=-1,++e}else(" "===b[e]||" "===b[e]||","===b[e])&&(g=e);return b}e.encode=function(a,b){b=b||{};var c,e="-----BEGIN "+a.type+"-----\r\n";if(a.procType&&(e+=f(c={name:"Proc-Type",values:[String(a.procType.version),a.procType.type]})),a.contentDomain&&(e+=f(c={name:"Content-Domain",values:[a.contentDomain]})),a.dekInfo&&(c={name:"DEK-Info",values:[a.dekInfo.algorithm]},a.dekInfo.parameters&&c.values.push(a.dekInfo.parameters),e+=f(c)),a.headers)for(var g=0;g<a.headers.length;++g)e+=f(a.headers[g]);return a.procType&&(e+="\r\n"),e+=d.util.encode64(a.body,b.maxline||64)+"\r\n",e+="-----END "+a.type+"-----\r\n"},e.decode=function(a){for(var b,c=[],e=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,f=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,g=/\r?\n/;b=e.exec(a);){var h=b[1];"NEW CERTIFICATE REQUEST"===h&&(h="CERTIFICATE REQUEST");var i={type:h,procType:null,contentDomain:null,dekInfo:null,headers:[],body:d.util.decode64(b[3])};if(c.push(i),b[2]){for(var j=b[2].split(g),k=0;b&&k<j.length;){for(var l=j[k].replace(/\s+$/,""),m=k+1;m<j.length;++m){var n=j[m];if(!/\s/.test(n[0]))break;l+=n,k=m}if(b=l.match(f)){for(var o={name:b[1],values:[]},p=b[2].split(","),q=0;q<p.length;++q)o.values.push(p[q].replace(/^\s+/,""));if(i.procType)if(i.contentDomain||"Content-Domain"!==o.name)if(i.dekInfo||"DEK-Info"!==o.name)i.headers.push(o);else{if(0===o.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');i.dekInfo={algorithm:p[0],parameters:p[1]||null}}else i.contentDomain=p[0]||"";else{if("Proc-Type"!==o.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==o.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');i.procType={version:p[0],type:p[1]}}}++k}if("ENCRYPTED"===i.procType&&!i.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===c.length)throw Error("Invalid PEM formatted message.");return c}},49471:(a,b,c)=>{"use strict";c.d(b,{nl:()=>j});var d=c(57690),e=c(71253);let f={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,contextWindow:2e5,maxOutput:64e3},g={"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},h={nvidia:{"minimaxai/minimax-m2.7":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072},"minimaxai/minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:131072},"z-ai/glm-5.2":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:128e3},"deepseek-ai/deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},"deepseek-ai/deepseek-v4-flash":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536}},"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}}},i=[{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*fable*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:0,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*omni*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:65536}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwen*max*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.5*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.6*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.7*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*muse-spark*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:65536}},{pattern:"*muse*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:65536}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function j(a,b){if(!b)return{...f};let c=function(a,b){let c=h[a]?.[b];if(c)return c;let d=b.includes("/")?b.split("/").pop():b,f=g[d]||g[b];if(f)return f;for(let{pattern:a,caps:c}of i)if((0,e.gH)(a,d||b))return c;return null}(a,b),j=(0,d.uV)(b);return{...f,...j||{},...c||{}}}},49623:(a,b,c)=>{"use strict";c.d(b,{E9:()=>o,RF:()=>h,oV:()=>n});var d=c(55511),e=c(82689);let f=new Map,g=setInterval(()=>{let a=Date.now();for(let[b,c]of f)a-c.lastUsed>e.v1.sessionTtlMs&&f.delete(b)},e.v1.sessionCleanupIntervalMs);function h(a){if(!a)return i();let b=f.get(a);if(b)return b.lastUsed=Date.now(),b.sessionId;if(f.size>=1e3){let a=f.keys().next().value;f.delete(a)}let c=i();return f.set(a,{sessionId:c,lastUsed:Date.now()}),c}function i(){return d.randomUUID()+Date.now().toString()}g.unref&&g.unref();let j=["x-session-id","session-id","session_id","x-amp-thread-id","x-client-request-id"],k=/_session_([a-f0-9-]+)$/;function l(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}let m=/^[a-z]+\/([0-9a-f-]{36})\//i;function n({headers:a,body:b,connectionId:c,workspaceId:e,scope:f=""}={}){var g,i;let o,p=function(a,b){let c=function(a){if("string"!=typeof a||!a)return null;let b=a.match(k);if(b)return b[1];if("{"===a[0])try{return l(JSON.parse(a)?.session_id)}catch{}return null}(b?.metadata?.user_id);if(c)return`claude:${c}`;let d=function(a){let b=a?.request?.sessionId;if(null!=b&&""!==b)return l(String(b));let c="string"==typeof a?.requestId?a.requestId.match(m):null;return c?l(c[1]):null}(b);if(d)return`antigravity:${d}`;for(let b of j){let c=a&&"object"==typeof a?"function"==typeof a.get?l(a.get(b)):l(a[b]??a[b.toLowerCase()]):null;if(c)return c}return l(b?.prompt_cache_key)||l(b?.session_id)||l(b?.conversation_id)||l(b?.metadata?.user_id)||null}(a,b);if(p)return p;let q=(g=`${f}:${c||""}`,(o=function(a){let b=Array.isArray(a?.input)?a.input:Array.isArray(a?.messages)?a.messages:null;if(!b)return"";let c="";for(let a of b)if(a?.role==="assistant"){if("string"==typeof a.content)c+=a.content;else if(Array.isArray(a.content))for(let b of a.content)c+=b?.text||b?.output||"";if(c.length>=50)break}return c}(b)).length<50?null:`assistant:${i=JSON.stringify([g,o.slice(0,50)]),d.createHash("sha256").update(i).digest("hex")}`);if(q)return q;let r=l(e);return r||h(c)}function o(a){let b=l(a);if(!b)return null;if(/^-?\d+$/.test(b))return b;let c=0x7fffffffffffffffn&d.createHash("sha256").update(b).digest().readBigUInt64BE(0);return`-${c.toString()}`}},49926:(a,b,c)=>{"use strict";c(82703),c(80152),c(82689),c(68531),c(38421),c(75371),c(39490),c(81556),c(17438)},50027:(a,b,c)=>{"use strict";let d=c(34589),{kConstruct:e}=c(49176),{urlEquals:f,getFieldValues:g}=c(90912),{kEnumerableProperty:h,isDisturbed:i}=c(84285),{webidl:j}=c(32984),{cloneResponse:k,fromInnerResponse:l,getResponseState:m}=c(78196),{Request:n,fromInnerRequest:o,getRequestState:p}=c(12600),{fetching:q}=c(76403),{urlIsHttpHttpsScheme:r,readAllBytes:s}=c(42425);class t{#bi;constructor(){arguments[0]!==e&&j.illegalConstructor(),j.util.markAsUncloneable(this),this.#bi=arguments[1]}async match(a,b={}){j.brandCheck(this,j.is.Cache);let c="Cache.match";j.argumentLengthCheck(arguments,1,c),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,c,"options");let d=this.#bj(a,b,1);if(0!==d.length)return d[0]}async matchAll(a,b={}){return j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.matchAll","options"),this.#bj(a,b)}async add(a){j.brandCheck(this,j.is.Cache),j.argumentLengthCheck(arguments,1,"Cache.add");let b=[a=j.converters.RequestInfo(a)],c=this.addAll(b);return await c}async addAll(a){j.brandCheck(this,j.is.Cache);let b="Cache.addAll";j.argumentLengthCheck(arguments,1,b);let c=[],d=[];for(let c of a){if(void 0===c)throw j.errors.conversionFailed({prefix:b,argument:"Argument 1",types:["undefined is not allowed"]});if("string"==typeof(c=j.converters.RequestInfo(c)))continue;let a=p(c);if(!r(a.url)||"GET"!==a.method)throw j.errors.exception({header:b,message:"Expected http/s scheme when method is not GET."})}let e=[];for(let f of a){let a=p(new n(f));if(!r(a.url))throw j.errors.exception({header:b,message:"Expected http/s scheme."});a.initiator="fetch",a.destination="subresource",d.push(a);let h=Promise.withResolvers();e.push(q({request:a,processResponse(a){if("error"===a.type||206===a.status||a.status<200||a.status>299)h.reject(j.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(a.headersList.contains("vary")){for(let b of g(a.headersList.get("vary")))if("*"===b){for(let a of(h.reject(j.errors.exception({header:"Cache.addAll",message:"invalid vary field value"})),e))a.abort();return}}},processResponseConsumeBody(a){a.aborted?h.reject(new DOMException("aborted","AbortError")):h.resolve(a)}})),c.push(h.promise)}let f=Promise.all(c),h=await f,i=[],k=0;for(let a of h){let b={type:"put",request:d[k],response:a};i.push(b),k++}let l=Promise.withResolvers(),m=null;try{this.#bk(i)}catch(a){m=a}return queueMicrotask(()=>{null===m?l.resolve(void 0):l.reject(m)}),l.promise}async put(a,b){j.brandCheck(this,j.is.Cache);let c="Cache.put";j.argumentLengthCheck(arguments,2,c),a=j.converters.RequestInfo(a),b=j.converters.Response(b,c,"response");let d=null;if(!r((d=j.is.Request(a)?p(a):p(new n(a))).url)||"GET"!==d.method)throw j.errors.exception({header:c,message:"Expected an http/s scheme when method is not GET"});let e=m(b);if(206===e.status)throw j.errors.exception({header:c,message:"Got 206 status"});if(e.headersList.contains("vary")){for(let a of g(e.headersList.get("vary")))if("*"===a)throw j.errors.exception({header:c,message:"Got * vary field value"})}if(e.body&&(i(e.body.stream)||e.body.stream.locked))throw j.errors.exception({header:c,message:"Response body is locked or disturbed"});let f=k(e),h=Promise.withResolvers();null!=e.body?s(e.body.stream.getReader(),h.resolve,h.reject):h.resolve(void 0);let l=[],o={type:"put",request:d,response:f};l.push(o);let q=await h.promise;null!=f.body&&(f.body.source=q);let t=Promise.withResolvers(),u=null;try{this.#bk(l)}catch(a){u=a}return queueMicrotask(()=>{null===u?t.resolve():t.reject(u)}),t.promise}async delete(a,b={}){let c;j.brandCheck(this,j.is.Cache);let e="Cache.delete";j.argumentLengthCheck(arguments,1,e),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,e,"options");let f=null;if(j.is.Request(a)){if("GET"!==(f=p(a)).method&&!b.ignoreMethod)return!1}else d("string"==typeof a),f=p(new n(a));let g=[],h={type:"delete",request:f,options:b};g.push(h);let i=Promise.withResolvers(),k=null;try{c=this.#bk(g)}catch(a){k=a}return queueMicrotask(()=>{null===k?i.resolve(!!c?.length):i.reject(k)}),i.promise}async keys(a,b={}){j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.keys","options");let c=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(c=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(c=p(new n(a)));let d=Promise.withResolvers(),e=[];if(void 0===a)for(let a of this.#bi)e.push(a[0]);else for(let a of this.#bl(c,b))e.push(a[0]);return queueMicrotask(()=>{let a=[];for(let b of e){let c=o(b,void 0,new AbortController().signal,"immutable");a.push(c)}d.resolve(Object.freeze(a))}),d.promise}#bk(a){let b=this.#bi,c=[...b],e=[],f=[];try{for(let c of a){let a;if("delete"!==c.type&&"put"!==c.type)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if("delete"===c.type&&null!=c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#bl(c.request,c.options,e).length)throw new DOMException("???","InvalidStateError");if("delete"===c.type){if(a=this.#bl(c.request,c.options),0===a.length)return[];for(let c of a){let a=b.indexOf(c);d(-1!==a),b.splice(a,1)}}else if("put"===c.type){if(null==c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let f=c.request;if(!r(f.url))throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if("GET"!==f.method)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(null!=c.options)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});for(let e of a=this.#bl(c.request)){let a=b.indexOf(e);d(-1!==a),b.splice(a,1)}b.push([c.request,c.response]),e.push([c.request,c.response])}f.push([c.request,c.response])}return f}catch(a){throw this.#bi.length=0,this.#bi=c,a}}#bl(a,b,c){let d=[];for(let e of c??this.#bi){let[c,f]=e;this.#bm(a,c,f,b)&&d.push(e)}return d}#bm(a,b,c=null,d){let e=new URL(a.url),h=new URL(b.url);if(d?.ignoreSearch&&(h.search="",e.search=""),!f(e,h,!0))return!1;if(null==c||d?.ignoreVary||!c.headersList.contains("vary"))return!0;for(let d of g(c.headersList.get("vary")))if("*"===d||b.headersList.get(d)!==a.headersList.get(d))return!1;return!0}#bj(a,b,c=1/0){let d=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(d=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(d=p(new n(a)));let e=[];if(void 0===a)for(let a of this.#bi)e.push(a[1]);else for(let a of this.#bl(d,b))e.push(a[1]);let f=[];for(let a of e){let b=l(k(a),"immutable");if(f.push(b),f.length>=c)break}return Object.freeze(f)}static{j.is.Cache=a=>null!=a&&"object"==typeof a&&#bi in a}}Object.defineProperties(t.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:h,matchAll:h,add:h,addAll:h,put:h,delete:h,keys:h});let u=[{key:"ignoreSearch",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:j.converters.boolean,defaultValue:()=>!1}];j.converters.CacheQueryOptions=j.dictionaryConverter(u),j.converters.MultiCacheQueryOptions=j.dictionaryConverter([...u,{key:"cacheName",converter:j.converters.DOMString}]),j.converters.Response=j.interfaceConverter(j.is.Response,"Response"),j.converters["sequence<RequestInfo>"]=j.sequenceConverter(j.converters.RequestInfo),a.exports={Cache:t}},50132:(a,b,c)=>{"use strict";c(68531)},50329:a=>{"use strict";class b{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(a){this.list[this.top]=a,this.top=this.top+1&2047}shift(){let a=this.list[this.bottom];return void 0===a?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,a)}}a.exports=class{constructor(){this.head=this.tail=new b}isEmpty(){return this.head.isEmpty()}push(a){this.head.isFull()&&(this.head=this.head.next=new b),this.head.push(a)}shift(){let a=this.tail,b=a.shift();return a.isEmpty()&&null!==a.next&&(this.tail=a.next,a.next=null),b}}},50743:(a,b,c)=>{"use strict";function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},50969:(a,b,c)=>{"use strict";let d;c.d(b,{wo:()=>P,Fm:()=>T,ip:()=>O,WV:()=>L});var e=c(27910),f=c(82689),g=c(44140),h=c(59882),i=c(31421),j=c(51455),k=c(76760),l=c(73136),m=c(57075);let n="2.1.289",o=Object.freeze(["http/1.1"]);Object.freeze(["TLS_AES_128_GCM_SHA256","TLS_AES_256_GCM_SHA384","TLS_CHACHA20_POLY1305_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256","TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA","TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","TLS_RSA_WITH_AES_128_GCM_SHA256","TLS_RSA_WITH_AES_256_GCM_SHA384","TLS_RSA_WITH_AES_128_CBC_SHA","TLS_RSA_WITH_AES_256_CBC_SHA"]),Object.freeze(["server_name","extended_master_secret","renegotiation_info","supported_groups:x25519_mlkem768,x25519,secp256r1,secp384r1","ec_point_formats:uncompressed","session_ticket","alpn:http/1.1","status_request","signature_algorithms:ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1","signed_certificate_timestamp","key_share:x25519_mlkem768","psk_key_exchange_modes:psk_dhe_ke","supported_versions:TLS1.3,TLS1.2"]);let p=k.dirname((0,l.fileURLToPath)("file:///home/runner/work/switchboard-router/switchboard-router/open-sse/identity/tls/claude-code.js")),q="win32"===process.platform?"switchboard-claude-tls.exe":"switchboard-claude-tls",r=[process.env.SWITCHBOARD_CLAUDE_TLS_HELPER,k.join(process.cwd(),"open-sse","identity","tls","bin",process.platform,process.arch,q),k.join(p,"bin",process.platform,process.arch,q)].filter(Boolean);function s(a){let b=Number(a);return Number.isFinite(b)&&b>0?Math.floor(b):null}let t=i.spawn,u=function(a){if(null==a||""===a)return 2;let b=Number(a);return Number.isInteger(b)&&b>=0?b:2}(process.env.SWITCHBOARD_CLAUDE_TLS_POOL_CAP),v=new Map,w=null;function x(a){return t(a,[],{stdio:["pipe","pipe","pipe"],windowsHide:!0})}function y(a,b){for(let c of[a,a.stdin,a.stdout,a.stderr])c?.[b?"ref":"unref"]?.()}async function z(){if(d)return d;for(let a of r)try{return await (0,j.access)(a),d=a,a}catch{}throw Error(`Claude Code TLS helper is not installed for ${process.platform}-${process.arch}`)}function A(){return new DOMException("The operation was aborted.","AbortError")}let B=globalThis.fetch,C=new Map,D=new Map,E=async()=>async function(a,b={},c={}){var d,e,f,g;if(c.alpn?.length!==1||"http/1.1"!==c.alpn[0])throw Error("Claude Code TLS transport requires ALPN http/1.1 only");if(b.signal?.aborted)throw A();let h=await z(),i=function(){for(let[a,b]of v)if(b(),null==a.exitCode&&null==a.signalCode)return y(a,!0),a;return null}()??x(h);w||v.size>=u||(w=setImmediate(()=>{w=null,function(a){for(;v.size<u;){let b;try{b=x(a)}catch{return}!function(a){let b=()=>{clearTimeout(c),a.off("exit",b),a.off("error",b),v.delete(a)},c=setTimeout(()=>{b();try{a.kill("SIGTERM")}catch{}},6e4);c.unref?.(),a.once("exit",b),a.once("error",b),y(a,!1),v.set(a,b)}(b)}}(h)}),w.unref?.());let j=function(a){if(null==a)return null;if("string"==typeof a)return Buffer.from(a);if(Buffer.isBuffer(a))return a;if(a instanceof Uint8Array)return Buffer.from(a);throw TypeError("Claude Code TLS helper requires a string or byte request body")}(b.body),k={url:String(a),method:b.method||"GET",headers:(d=b.headers)instanceof Headers?[...d.entries()]:Object.entries(d||{}).map(([a,b])=>[a,String(b)]),headerOrder:c.headerOrder||[],proxyUrl:c.proxyUrl||"",tlsSpecRev:n,alpn:o,bodyLength:j?.byteLength||0,timeoutMs:s(b.timeoutMs)??s(c.timeoutMs)??6e4};return i.stdin.write(`${JSON.stringify(k)}
|
|
362
|
+
${d}`}):e.unshift({role:"system",content:d}),{...a,messages:e,response_format:{type:"json_object"}}}buildUrl(a,b,c=0,d=null){let e=d?.runtimeTransport;if(e?.baseUrl)return e.urlSuffix?`${e.baseUrl}${e.urlSuffix}`:e.baseUrl;if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.Es).replace(/\/$/,""),b="responses"===(0,g.jD)(this.provider,d)?"/responses":"/chat/completions";return`${a}${b}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||f.ky).replace(/\/$/,"");return`${a}/messages`}if("gemini"===this.config.format)return`${this.config.baseUrl}/${a}:${b?"streamGenerateContent?alt=sse":"generateContent"}`;if(this.config.urlSuffix)return`${this.config.baseUrl}${this.config.urlSuffix}`;let h=this.config.baseUrl;if(h?.includes("{accountId}")){let a=d?.providerSpecificData?.accountId;if(!a)throw Error(`${this.provider} requires accountId in providerSpecificData`);return h.replace("{accountId}",a)}return h}resolveAuthDescriptor(){return this.provider?.startsWith?.("anthropic-compatible-")?{apiKey:{header:"x-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"},anthropicVersion:!0}:this.config?.format==="claude"?{...o,anthropicVersion:!0}:n}buildHeaders(a,b=!0,c,d){let e=a?.runtimeTransport,g={"Content-Type":"application/json",...e?e.headers:this.config.headers},h=e?.auth||p[this.provider]||this.resolveAuthDescriptor();for(let b of h.hooks||[])r[b]?.(g,a);if(!function(a,b,c){if(b.combined){q(a,b,c.apiKey||c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8);return}c.apiKey?q(a,b.apiKey,c.apiKey):c.accessToken&&q(a,b.oauth,c.accessToken),b.anthropicVersion&&!a["anthropic-version"]&&(a["anthropic-version"]=f.b8)}(g,h,a),"claude"===this.provider&&d&&(g["Anthropic-Beta"]=(0,f.d)(d)),this.provider?.startsWith?.("anthropic-compatible-")){let b=a?.providerSpecificData?.baseUrl||"";if(!(""===b||b.includes("api.anthropic.com"))){for(let b of(a.apiKey&&!g.Authorization&&(g.Authorization=`Bearer ${a.apiKey}`),delete g["anthropic-dangerous-direct-browser-access"],delete g["Anthropic-Dangerous-Direct-Browser-Access"],delete g["x-app"],delete g["X-App"],["anthropic-beta","Anthropic-Beta"]))if(g[b]){let a=g[b].split(",").map(a=>a.trim()).filter(a=>a&&"claude-code-20250219"!==a).join(",");a?g[b]=a:delete g[b]}}}if(c&&!g["x-opencode-session"])try{"opencode.ai"===new URL(c).hostname&&(g["x-opencode-session"]=(0,m.oV)({headers:a?.rawHeaders,connectionId:a?.connectionId,scope:"opencode"}))}catch{}return b&&(g.Accept="text/event-stream"),g}refreshFromGrant(a,b){let c=s[this.provider],d={grant_type:"refresh_token",refresh_token:a.refreshToken,...c.params(this)};return"json"===c.encoding?this.refreshWithJSON(c.url(),d,b,this.provider):this.refreshWithForm(c.url(),d,b,this.provider)}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;let d={claude:()=>this.refreshFromGrant(a,c),codex:()=>this.refreshFromGrant(a,c),qwen:()=>this.refreshWithForm(h.NA.qwen.token,{grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq.qwen.clientId},c,"qwen"),iflow:()=>this.refreshIflow(a.refreshToken,c),gemini:()=>this.refreshFromGrant(a,c),kiro:()=>this.refreshKiro(a.refreshToken,c),cline:()=>this.refreshCline(a.refreshToken,c),clinepass:()=>this.refreshCline(a.refreshToken,c),"kimi-coding":()=>this.refreshKimiCoding(a,c),kilocode:()=>this.refreshKilocode(a.refreshToken,c)}[this.provider];if(!d)return null;try{let a=await d();return a&&b?.info?.("TOKEN",`${this.provider} refreshed`),a}catch(a){return b?.error?.("TOKEN",`${this.provider} refresh error: ${a.message}`),null}}async refreshWithJSON(a,b,c=null,d=this.provider){let f=await (0,j.Fm)(a,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(b),identity:e.xq[d]?.identity,provider:d,format:e.xq[d]?.format},c);if(!f.ok)return null;let g=await f.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||b.refresh_token,expiresIn:g.expires_in}}async refreshWithForm(a,b,c=null,d=this.provider){let f=await (0,j.Fm)(a,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams(b),identity:e.xq[d]?.identity,provider:d,format:e.xq[d]?.format},c);if(!f.ok)return null;let g=await f.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||b.refresh_token,expiresIn:g.expires_in}}async refreshIflow(a,b=null){let c=btoa(`${e.xq.iflow.clientId}:${e.xq.iflow.clientSecret}`),d=await (0,j.Fm)(h.NA.iflow.token,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${c}`},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a,client_id:e.xq.iflow.clientId,client_secret:e.xq.iflow.clientSecret}),identity:e.xq.iflow?.identity,provider:"iflow",format:e.xq.iflow?.format},b);if(!d.ok)return null;let f=await d.json();return{accessToken:f.access_token,refreshToken:f.refresh_token||a,expiresIn:f.expires_in}}async refreshKiro(a,b=null){let c=await (0,j.Fm)(e.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}),identity:e.xq.kiro?.identity,provider:"kiro",format:e.xq.kiro?.format},b);if(!c.ok)return null;let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken||a,expiresIn:d.expiresIn}}async refreshCline(a,b=null){let c=await (0,j.Fm)(e.xq.cline.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:a,grantType:"refresh_token",clientType:"extension"}),identity:e.xq.cline?.identity,provider:"cline",format:e.xq.cline?.format},b);if(!c.ok)return null;let d=await c.json(),f=d?.data||d,g=f?.expiresAt,h=g?Math.max(1,Math.floor((new Date(g).getTime()-Date.now())/1e3)):void 0,i=f?.accessToken;return i&&!i.startsWith("workos:")&&(i=`workos:${i}`),{accessToken:i,refreshToken:f?.refreshToken||a,expiresIn:h}}async refreshKimiCoding(a,b=null){let c=a?.providerSpecificData?.deviceId,d=(0,h.VK)(c),f=await (0,j.Fm)(e.xq["kimi-coding"].refreshUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...d},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:a.refreshToken,client_id:e.xq["kimi-coding"].clientId}),identity:e.xq["kimi-coding"]?.identity,provider:"kimi-coding",format:e.xq["kimi-coding"]?.format},b);if(!f.ok)return null;let g=await f.json();return{accessToken:g.access_token,refreshToken:g.refresh_token||a.refreshToken,expiresIn:g.expires_in,...c?{providerSpecificData:{...a.providerSpecificData,deviceId:c}}:{}}}async refreshKilocode(a,b=null){return null}}},47335:(a,b,c)=>{"use strict";let d=c(60823),{ResponseError:e}=c(61448);class f extends d{#M;#a4;#a5;#e;#a6;constructor(a,{handler:b}){super(b)}#a7(a){return 0===(this.#a4??"").indexOf(a)}onRequestStart(a,b){return this.#M=0,this.#a4=null,this.#a5=null,this.#e=null,this.#a6="",super.onRequestStart(a,b)}onResponseStart(a,b,c,d){if(this.#M=b,this.#e=c,this.#a4=c["content-type"],this.#M<400)return super.onResponseStart(a,b,c,d);(this.#a7("application/json")||this.#a7("text/plain"))&&(this.#a5=new TextDecoder("utf-8"))}onResponseData(a,b){if(this.#M<400)return super.onResponseData(a,b);this.#a6+=this.#a5?.decode(b,{stream:!0})??""}onResponseEnd(a,b){if(this.#M>=400){let b;if(this.#a6+=this.#a5?.decode(void 0,{stream:!1})??"",this.#a7("application/json"))try{this.#a6=JSON.parse(this.#a6)}catch{}let c=Error.stackTraceLimit;Error.stackTraceLimit=0;try{b=new e("Response Error",this.#M,{body:this.#a6,headers:this.#e})}finally{Error.stackTraceLimit=c}super.onResponseError(a,b)}else super.onResponseEnd(a,b)}onResponseError(a,b){super.onResponseError(a,b)}}a.exports=()=>a=>function(b,c){return a(b,new f(b,{handler:c}))}},47659:(a,b,c)=>{"use strict";c(63971),c(50969);var d=c(38528);c(10793),(0,d.U)("antigravity"),c(82961),c(20012),c(43835),(0,d.U)("minimax").urls,(0,d.U)("minimax-cn").urls,c(15251),c(83382),(0,d.U)("glm").url,(0,d.U)("glm-cn").url,(0,d.U)("vercel-ai-gateway").url},47703:(a,b,c)=>{"use strict";let{pipeline:d}=c(57075),{fetching:e}=c(76403),{webidl:f}=c(32984),{EventSourceStream:g}=c(97356),{parseMIMEType:h}=c(16537),{createFastMessageEvent:i}=c(51753),{isNetworkError:j}=c(78196),{isValidHeaderValue:k,kEnumerableProperty:l}=c(84285),{environmentSettingsObject:m}=c(42425),{createPotentialCORSRequest:n}=c(26376),{getGlobalDispatcher:o}=c(59970),{isomorphicDecode:p}=c(70745),q=new TextEncoder,r=!1;class s extends EventTarget{#a8={open:null,error:null,message:null};#aJ;#a9=!1;#ba=0;#bb=null;#B=null;#d;#a;constructor(a,b={}){let c;super(),f.util.markAsUncloneable(this);const d="EventSource constructor";f.argumentLengthCheck(arguments,1,d),r||(r=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),a=f.converters.USVString(a),b=f.converters.EventSourceInitDict(b,d,"eventSourceInitDict"),this.#d=b.node.dispatcher||b.dispatcher,this.#a={lastEventId:"",reconnectionTime:b.node.reconnectionTime};try{c=new URL(a,m.settingsObject.baseUrl),this.#a.origin=c.origin}catch(a){throw new DOMException(a,"SyntaxError")}this.#aJ=c.href;let e="anonymous";!0===b.withCredentials&&(e="use-credentials",this.#a9=!0);const g=n(c,"",e);g.client=m.settingsObject,g.headersList.set("Accept","text/event-stream"),g.cache="no-store",g.initiator="other",this.#bb=g,this.#bc()}get readyState(){return f.brandCheck(this,f.is.EventSource),this.#ba}get url(){return f.brandCheck(this,f.is.EventSource),this.#aJ}get withCredentials(){return f.brandCheck(this,f.is.EventSource),this.#a9}#bc(){if(2===this.#ba)return;this.#ba=0;let a={request:this.#bb,dispatcher:this.#d};a.processResponseEndOfBody=a=>{if(!j(a))return this.#bd()},a.processResponse=a=>{if(j(a))if(!a.aborted)return void this.#bd();else{this.close(),this.dispatchEvent(new Event("error"));return}let b=a.headersList.get("content-type",!0),c=null!==b?h(b):"failure",e="failure"!==c&&"text/event-stream"===c.essence;if(200!==a.status||!1===e){this.close(),this.dispatchEvent(new Event("error"));return}this.#ba=1,this.dispatchEvent(new Event("open")),this.#a.origin=a.urlList[a.urlList.length-1].origin;let f=new g({eventSourceSettings:this.#a,maxEventSize:this.#d.eventSourceOptions?.maxEventSize,push:a=>{this.dispatchEvent(i(a.type,a.options))}});d(a.body.stream,f,a=>{a?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#B=e(a)}#bd(){2!==this.#ba&&(this.#ba=0,this.dispatchEvent(new Event("error")),setTimeout(()=>{if(0===this.#ba){if(this.#bb.headersList.delete("last-event-id",!0),this.#a.lastEventId.length){let a=p(q.encode(this.#a.lastEventId));k(a)&&this.#bb.headersList.set("last-event-id",a,!0)}this.#bc()}},this.#a.reconnectionTime)?.unref())}close(){f.brandCheck(this,f.is.EventSource),2!==this.#ba&&(this.#ba=2,this.#B.abort(),this.#bb=null)}get onopen(){return f.brandCheck(this,f.is.EventSource),this.#a8.open}set onopen(a){f.brandCheck(this,f.is.EventSource),this.#a8.open&&this.removeEventListener("open",this.#a8.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#a8.open=a):this.#a8.open=null}get onmessage(){return f.brandCheck(this,f.is.EventSource),this.#a8.message}set onmessage(a){f.brandCheck(this,f.is.EventSource),this.#a8.message&&this.removeEventListener("message",this.#a8.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#a8.message=a):this.#a8.message=null}get onerror(){return f.brandCheck(this,f.is.EventSource),this.#a8.error}set onerror(a){f.brandCheck(this,f.is.EventSource),this.#a8.error&&this.removeEventListener("error",this.#a8.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#a8.error=a):this.#a8.error=null}static{f.is.EventSource=a=>null!=a&&"object"==typeof a&&#a8 in a}}let t={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(s,t),Object.defineProperties(s.prototype,t),Object.defineProperties(s.prototype,{close:l,onerror:l,onmessage:l,onopen:l,readyState:l,url:l,withCredentials:l}),f.converters.EventSourceInitDict=f.dictionaryConverter([{key:"withCredentials",converter:f.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>o()},{key:"node",converter:f.dictionaryConverter([{key:"reconnectionTime",converter:f.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:f.converters.any}]),defaultValue:()=>({})}]),a.exports={EventSource:s,defaultReconnectionTime:3e3}},47800:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),{runtimeFeatures:e}=c(56758),f=e.has("crypto")?c(77598):null,g=f?.hash?a=>f.hash("sha256",a,"base64url"):a=>Buffer.from(a).toString("base64url");function h(a){return Array.isArray(a)&&(1&a.length)==0}let i=["record","playback","update"];a.exports={createHeaderFilters:function(a={}){let{ignoreHeaders:b=[],excludeHeaders:c=[],matchHeaders:d=[],caseSensitive:e=!1}=a;return{ignore:new Set(b.map(a=>e?a:a.toLowerCase())),exclude:new Set(c.map(a=>e?a:a.toLowerCase())),match:new Set(d.map(a=>e?a:a.toLowerCase()))}},hashId:g,isUndiciHeaders:h,normalizeHeaders:function(a){let b={};if(!a)return b;if(h(a)){for(let c=0;c<a.length;c+=2){let d=a[c],e=a[c+1];if(d&&void 0!==e){let a=Buffer.isBuffer(d)?d.toString():d,c=Buffer.isBuffer(e)?e.toString():e;b[a.toLowerCase()]=c}}return b}if(a&&"object"==typeof a)for(let[c,d]of Object.entries(a))c&&"string"==typeof c&&(b[c.toLowerCase()]=Array.isArray(d)?d.join(", "):String(d));return b},isUrlExcludedFactory:function(a=[]){return 0===a.length?()=>!1:function(b){let c;for(let d of a)if("string"==typeof d){if(c||(c=b.toLowerCase()),c.includes(d.toLowerCase()))return!0}else if(d instanceof RegExp&&d.test(b))return!0;return!1}},validateSnapshotMode:function(a){if(!i.includes(a))throw new d(`Invalid snapshot mode: ${a}. Must be one of: ${i.join(", ")}`)}}},48841:(a,b,c)=>{"use strict";let{kProxy:d,kClose:e,kDestroy:f,kDispatch:g}=c(49176),h=c(37417),i=c(35689),j=c(5318),{InvalidArgumentError:k,RequestAbortedError:l,SecureProxyConnectionError:m,ProxyConnectionError:n}=c(61448),o=c(55285),p=c(40106),{channels:q}=c(62571),r=c(64156),{hasSafeIterator:s}=c(84285),t=Symbol("proxy agent"),u=Symbol("proxy client"),v=Symbol("proxy headers"),w=Symbol("request tls settings"),x=Symbol("proxy tls settings"),y=Symbol("connect endpoint function"),z=Symbol("connect endpoint function (http/1.1 only)"),A=Symbol("tunnel proxy"),B="proxy-authorization";function C(a,b){return new i(a,b)}let D=()=>{};function E(a,b){return 1===b.connections?new p(a,b):new i(a,b)}class F extends j{#be;#bf;constructor(a,{headers:b={},connect:c,factory:d,proxyServername:e}){if(!a)throw new k("Proxy URL is mandatory");super(),this[v]=b,this.#bf=e,d?this.#be=d(a,{connect:c}):this.#be=new p(a,{connect:c})}[g](a,b){let c=b.onResponseStart;b.onResponseStart=function(a,d,e,f){if(407===d){"function"==typeof b.onResponseError&&b.onResponseError(a,new k("Proxy Authentication Required (407)"));return}c&&c.call(this,a,d,e,f)};let{origin:d,path:e="/",headers:f={}}=a;if(a.path=d+e,!("host"in f)&&!("Host"in f)){let{host:a}=new URL(d);f.host=a}return a.headers={...this[v],...f},null!=this.#bf&&(a.servername=this.#bf),this.#be[g](a,b)}[e](){return this.#be.close()}[f](a){return this.#be.destroy(a)}}class G extends j{constructor(a){if(!a||"object"==typeof a&&!(a instanceof URL)&&!a.uri)throw new k("Proxy uri is mandatory");const{clientFactory:b=C}=a;if("function"!=typeof b)throw new k("Proxy opts.clientFactory must be a function.");const{proxyTunnel:c,connectTimeout:e}=a;super(a);const f=this.#bg(a),{href:g,origin:i,port:j,protocol:p,username:s,password:B,hostname:G}=f;if(this[d]={uri:g,protocol:p},this[w]=a.requestTls,this[x]=a.proxyTls,this[v]=a.headers||{},this[A]=c,a.auth&&a.token)throw new k("opts.auth cannot be used in combination with opts.token");a.auth?this[v]["proxy-authorization"]=`Basic ${a.auth}`:a.token?this[v]["proxy-authorization"]=a.token:s&&B?this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:${decodeURIComponent(B)}`).toString("base64")}`:s&&(this[v]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(s)}:`).toString("base64")}`);const H=o({timeout:e,...a.proxyTls}),I=o({timeout:e,...a.proxyTls,allowH2:!1});this[y]=o({timeout:e,...a.requestTls}),this[z]=o({timeout:e,...a.requestTls,allowH2:!1});const J=a.factory||E,K=(b,c)=>{let{protocol:f}=new URL(b);if("socks5:"===this[d].protocol||"socks:"===this[d].protocol)return new r(this[d].uri,{headers:this[v],connect:H,factory:J,username:a.username||s,password:a.password||B,connectTimeout:e,proxyTls:a.proxyTls,requestTls:a.requestTls});if(!0!==this[A]&&"http:"===f){let a="https:"===this[d].protocol?(a,b)=>I(a,(a,c)=>{a&&"ERR_TLS_CERT_ALTNAME_INVALID"===a.code?b(new m(a)):b(a,c)}):I;return new F(this[d].uri,{headers:this[v],connect:a,factory:J,proxyServername:"https:"===this[d].protocol?this[x]?.servername||G:void 0})}return J(b,c)};"socks5:"===p||"socks:"===p?this[u]=null:this[u]=b(f,{connect:H}),this[t]=new h({...a,factory:K,connect:async(a,b)=>{if(!this[u])return void b(new k("Cannot establish tunnel connection without a proxy client"));let c=a.host;a.port||(c+=`:${"https:"===a.protocol?443:80}`);try{let d,e={origin:i,port:j,path:c,signal:a.signal,headers:{...this[v],host:a.host,...null==a.connections||a.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[x]?.servername||G},{socket:f,statusCode:g}=await this[u].connect(e);if(200!==g){f.on("error",D).destroy(),b(new l(`Proxy response (${g}) !== 200 when HTTP Tunneling`));return}if(q.proxyConnected.hasSubscribers&&q.proxyConnected.publish({socket:f,connectParams:e}),"https:"!==a.protocol)return void b(null,f);d=this[w]?this[w].servername:a.servername,(!1===a.allowH2?this[z]:this[y])({...a,servername:d,httpSocket:f},b)}catch(a){b("ERR_TLS_CERT_ALTNAME_INVALID"===a.code?new m(a):"UND_ERR_SOCKET"===a.code?new n(a):a)}}})}dispatch(a,b){let c=function(a){if(Array.isArray(a)){let b={};for(let c=0;c<a.length;c+=2)H(a[c])&&I(),b[a[c]]=a[c+1];return b}if(a&&"object"==typeof a&&s(a)){let b={};for(let[c,d]of a){if(!Object.hasOwn(b,c)){b[c]=d;continue}let a=b[c],e=[];void 0!==a&&e.push(...Array.isArray(a)?a:[a]),void 0!==d&&e.push(...Array.isArray(d)?d:[d]),b[c]=e.length>1?e:e[0]}return b}return a}(a.headers);if(function(a){for(let b in a)H(b)&&I()}(c),c&&!("host"in c)&&!("Host"in c)){let{host:b}=new URL(a.origin);c.host=b}return this[t].dispatch({...a,headers:c},b)}#bg(a){return"string"==typeof a?new URL(a):a instanceof URL?a:new URL(a.uri)}[e](){let a=[this[t].close()];return this[u]&&a.push(this[u].close()),Promise.all(a)}[f](){let a=[this[t].destroy()];return this[u]&&a.push(this[u].destroy()),Promise.all(a)}}function H(a){return a.length===B.length&&a.toLowerCase()===B}function I(){throw new k("Proxy-Authorization should be sent in ProxyAgent constructor")}a.exports=G},49166:(a,b,c)=>{"use strict";let{Cache:d}=c(50027),{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h{#bh=new Map;constructor(){arguments[0]!==g&&e.illegalConstructor(),e.util.markAsUncloneable(this)}async match(a,b={}){if(e.brandCheck(this,e.is.CacheStorage),e.argumentLengthCheck(arguments,1,"CacheStorage.match"),a=e.converters.RequestInfo(a),null!=(b=e.converters.MultiCacheQueryOptions(b)).cacheName){if(this.#bh.has(b.cacheName)){let c=new d(g,this.#bh.get(b.cacheName));return await c.match(a,b)}}else for(let c of this.#bh.values()){let e=new d(g,c),f=await e.match(a,b);if(void 0!==f)return f}}async has(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.has";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bh.has(a)}async open(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.open";if(e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bh.has(a))return new d(g,this.#bh.get(a));let c=[];return this.#bh.set(a,c),new d(g,c)}async delete(a){e.brandCheck(this,e.is.CacheStorage);let b="CacheStorage.delete";return e.argumentLengthCheck(arguments,1,b),a=e.converters.DOMString(a,b,"cacheName"),this.#bh.delete(a)}async keys(){return e.brandCheck(this,e.is.CacheStorage),[...this.#bh.keys()]}static{e.is.CacheStorage=a=>null!=a&&"object"==typeof a&&#bh in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:f,has:f,open:f,delete:f,keys:f}),a.exports={CacheStorage:h}},49176:a=>{"use strict";a.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kRequestOrigin:Symbol("request origin"),kOriginless:Symbol("originless"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2Options:Symbol("http2 options"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHostAuthority:Symbol("host authority"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}},49209:(a,b,c)=>{"use strict";c.d(b,{$:()=>p});var d=c(22256),e=c(38421),f=c(19016),g=c(24725),h=c(50969);let i=e.xq["grok-web"].baseUrl,j={"grok-3":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3",isThinking:!1},"grok-3-mini":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_MINI_THINKING",isThinking:!0},"grok-3-thinking":{grokModel:"grok-3",modelMode:"MODEL_MODE_GROK_3_THINKING",isThinking:!0},"grok-4":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4",isThinking:!1},"grok-4-mini":{grokModel:"grok-4-mini",modelMode:"MODEL_MODE_GROK_4_MINI_THINKING",isThinking:!0},"grok-4-thinking":{grokModel:"grok-4",modelMode:"MODEL_MODE_GROK_4_THINKING",isThinking:!0},"grok-4-heavy":{grokModel:"grok-4",modelMode:"MODEL_MODE_HEAVY",isThinking:!0},"grok-4.1-mini":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_MINI_THINKING",isThinking:!0},"grok-4.1-fast":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_FAST",isThinking:!1},"grok-4.1-expert":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_EXPERT",isThinking:!0},"grok-4.1-thinking":{grokModel:"grok-4-1-thinking-1129",modelMode:"MODEL_MODE_GROK_4_1_THINKING",isThinking:!0},"grok-4.2":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1},"grok-4.20-beta":{grokModel:"grok-420",modelMode:"MODEL_MODE_GROK_420",isThinking:!1}};function k(a,b=!1){let c=b?"abcdefghijklmnopqrstuvwxyz0123456789":"abcdefghijklmnopqrstuvwxyz",d="";for(let b=0;b<a;b++)d+=c[Math.floor(Math.random()*c.length)];return d}function l(a){let b=new Uint8Array(a);return crypto.getRandomValues(b),Array.from(b,a=>a.toString(16).padStart(2,"0")).join("")}async function*m(a,b){let c=a.getReader(),d=new TextDecoder,e="";try{for(;;){if(b?.aborted)return;let{value:a,done:f}=await c.read();if(f)break;for(e+=d.decode(a,{stream:!0});;){let a=e.indexOf("\n");if(a<0)break;let b=e.slice(0,a).trim();if(e=e.slice(a+1),b)try{yield JSON.parse(b)}catch{}}}let a=(e+=d.decode()).trim();if(a)try{yield JSON.parse(a)}catch{}}finally{c.releaseLock()}}async function*n(a,b,c){let d="",e="",f=!1;for await(let g of m(a,c)){if(g.error)return void(yield{error:g.error.message||`Grok error: ${g.error.code}`,done:!0});let a=g.result?.response;if(a){if(a.llmInfo?.modelHash&&!d&&(d=a.llmInfo.modelHash),a.responseId&&(e=a.responseId),a.modelResponse){let c=a.modelResponse;f&&b&&(c.message&&(yield{thinking:c.message}),f=!1),c.message&&(yield{fullMessage:c.message,fingerprint:d,responseId:e}),c.metadata?.llm_info?.modelHash&&(d=c.metadata.llm_info.modelHash);continue}null!=a.token&&(yield{delta:a.token,fingerprint:d,responseId:e})}}yield{done:!0,fingerprint:d,responseId:e}}async function o(a,b,c,d,e,f){let g="",h="",i=[];for await(let b of n(a,e,f)){if(b.fingerprint&&(h=b.fingerprint),b.error)return new Response(JSON.stringify({error:{message:b.error,type:"upstream_error",code:"GROK_ERROR"}}),{status:502,headers:{"Content-Type":"application/json"}});if(b.thinking){i.push(b.thinking);continue}if(b.done)break;b.fullMessage?g=b.fullMessage:b.delta&&(g+=b.delta)}let j={role:"assistant",content:g};i.length>0&&(j.reasoning_content=i.join("\n"));let k=Math.ceil(g.length/4),l=Math.ceil(g.length/4);return new Response(JSON.stringify({id:c,object:"chat.completion",created:d,model:b,system_fingerprint:h||null,choices:[{index:0,message:j,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:k,completion_tokens:l,total_tokens:k+l}}),{status:200,headers:{"Content-Type":"application/json"}})}class p extends d.Hv{constructor(){super("grok-web",e.xq["grok-web"])}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:m,proxyOptions:p=null}){let q,r,s=b?.messages;if(!s||!Array.isArray(s)||0===s.length)return{response:new Response(JSON.stringify({error:{message:"Missing or empty messages array",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};let t=j[a];t||m?.info?.("GROK-WEB",`Unmapped model ${a}, defaulting to grok-4.1-fast`);let{grokModel:u,modelMode:v,isThinking:w}=t||j["grok-4.1-fast"],x=function(a){let b=[];for(let c of a){let a=String(c.role||"user");"developer"===a&&(a="system");let d="";"string"==typeof c.content?d=c.content:Array.isArray(c.content)&&(d=c.content.filter(a=>"text"===a.type).map(a=>String(a.text||"")).join(" ")),d.trim()&&b.push({role:a,text:d})}let c=-1;for(let a=b.length-1;a>=0;a--)if("user"===b[a].role){c=a;break}let d=[];for(let a=0;a<b.length;a++){let{role:e,text:f}=b[a];d.push(a===c?f:`${e}: ${f}`)}return d.join("\n\n")}(s);if(!x.trim())return{response:new Response(JSON.stringify({error:{message:"Empty query after processing",type:"invalid_request"}}),{status:400,headers:{"Content-Type":"application/json"}}),url:i,headers:{},transformedBody:b};let y={temporary:!0,modelName:u,modelMode:v,message:x,fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,returnImageBytes:!1,returnRawGrokInXaiRequest:!1,enableImageStreaming:!1,imageGenerationCount:0,forceConcise:!1,toolOverrides:{},enableSideBySide:!0,sendFinalMetadata:!0,isReasoning:!1,disableTextFollowUps:!1,disableMemory:!0,forceSideBySide:!1,isAsyncChat:!1,disableSelfHarmShortCircuit:!1,deviceEnvInfo:{darkModeEnabled:!1,devicePixelRatio:2,screenWidth:2056,screenHeight:1329,viewportWidth:2056,viewportHeight:1083}},z=l(16),A=l(8),B={Accept:"*/*","Accept-Encoding":"gzip, deflate, br, zstd","Accept-Language":"en-US,en;q=0.9",Baggage:"sentry-environment=production,sentry-release=d6add6fb0460641fd482d767a335ef72b9b6abb8,sentry-public_key=b311e0f2690c81f25e2c4cf6d4f7ce1c","Cache-Control":"no-cache","Content-Type":"application/json",Origin:"https://grok.com",Pragma:"no-cache",Referer:"https://grok.com/","Sec-Ch-Ua":'"Google Chrome";v="136", "Chromium";v="136", "Not(A:Brand";v="24"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":btoa(.5>Math.random()?`e:TypeError: Cannot read properties of null (reading 'children["${k(5,!0)}"]')`:`e:TypeError: Cannot read properties of undefined (reading '${k(10)}')`),"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${z}-${A}-00`};if(d.apiKey){let a=d.apiKey;a.startsWith("sso=")&&(a=a.slice(4)),B.Cookie=`sso=${a}`}m?.info?.("GROK-WEB",`Query to ${a} (grok=${u}, mode=${v}), len=${x.length}`);try{q=await (0,h.Fm)(i,{method:"POST",headers:B,body:JSON.stringify(y),signal:e,identity:this.config.identity,provider:this.provider,format:this.config.format},p)}catch(a){return m?.error?.("GROK-WEB",`Fetch failed: ${a.message||String(a)}`),{response:new Response(JSON.stringify({error:{message:`Grok connection failed: ${a.message||String(a)}`,type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:B,transformedBody:y}}if(!q.ok){let a=q.status,b=`Grok returned HTTP ${a}`;return 401===a||403===a?b="Grok auth failed — SSO cookie may be expired. Re-paste your sso cookie value from grok.com.":429===a&&(b="Grok rate limited. Wait a moment and retry, or rotate cookies."),m?.warn?.("GROK-WEB",b),{response:new Response(JSON.stringify({error:{message:b,type:"upstream_error",code:`HTTP_${a}`}}),{status:a,headers:{"Content-Type":"application/json"}}),url:i,headers:B,transformedBody:y}}if(!q.body)return{response:new Response(JSON.stringify({error:{message:"Grok returned empty response body",type:"upstream_error"}}),{status:502,headers:{"Content-Type":"application/json"}}),url:i,headers:B,transformedBody:y};let C=`chatcmpl-grok-${crypto.randomUUID().slice(0,12)}`,D=Math.floor(Date.now()/1e3);if(c){var E;let b;r=new Response((E=q.body,b=new TextEncoder,new ReadableStream({async start(c){try{c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:null,choices:[{index:0,delta:{role:"assistant"},finish_reason:null,logprobs:null}]})));let d="";for await(let f of n(E,w,e)){if(f.fingerprint&&(d=f.fingerprint),f.error){c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:`[Error: ${f.error}]`},finish_reason:null,logprobs:null}]})));break}if(f.thinking){c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{reasoning_content:f.thinking},finish_reason:null,logprobs:null}]})));continue}if(f.done)break;f.delta&&c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{content:f.delta},finish_reason:null,logprobs:null}]})))}c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:d||null,choices:[{index:0,delta:{},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}catch(d){c.enqueue(b.encode((0,g.N)({id:C,object:"chat.completion.chunk",created:D,model:a,system_fingerprint:null,choices:[{index:0,delta:{content:`[Stream error: ${d.message||String(d)}]`},finish_reason:"stop",logprobs:null}]}))),c.enqueue(b.encode(f.$U))}finally{c.close()}}})),{status:200,headers:{...f.uB}})}else r=await o(q.body,a,C,D,w,e);return{response:r,url:i,headers:B,transformedBody:y}}}},49345:(a,b,c)=>{var d=c(45654);c(33889);var e=a.exports=d.pem=d.pem||{};function f(a){for(var b=a.name+": ",c=[],d=function(a,b){return" "+b},e=0;e<a.values.length;++e)c.push(a.values[e].replace(/^(\S+\r\n)/,d));b+=c.join(",")+"\r\n";for(var f=0,g=-1,e=0;e<b.length;++e,++f)if(f>65&&-1!==g){var h=b[g];","===h?(++g,b=b.substr(0,g)+"\r\n "+b.substr(g)):b=b.substr(0,g)+"\r\n"+h+b.substr(g+1),f=e-g-1,g=-1,++e}else(" "===b[e]||" "===b[e]||","===b[e])&&(g=e);return b}e.encode=function(a,b){b=b||{};var c,e="-----BEGIN "+a.type+"-----\r\n";if(a.procType&&(e+=f(c={name:"Proc-Type",values:[String(a.procType.version),a.procType.type]})),a.contentDomain&&(e+=f(c={name:"Content-Domain",values:[a.contentDomain]})),a.dekInfo&&(c={name:"DEK-Info",values:[a.dekInfo.algorithm]},a.dekInfo.parameters&&c.values.push(a.dekInfo.parameters),e+=f(c)),a.headers)for(var g=0;g<a.headers.length;++g)e+=f(a.headers[g]);return a.procType&&(e+="\r\n"),e+=d.util.encode64(a.body,b.maxline||64)+"\r\n",e+="-----END "+a.type+"-----\r\n"},e.decode=function(a){for(var b,c=[],e=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,f=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,g=/\r?\n/;b=e.exec(a);){var h=b[1];"NEW CERTIFICATE REQUEST"===h&&(h="CERTIFICATE REQUEST");var i={type:h,procType:null,contentDomain:null,dekInfo:null,headers:[],body:d.util.decode64(b[3])};if(c.push(i),b[2]){for(var j=b[2].split(g),k=0;b&&k<j.length;){for(var l=j[k].replace(/\s+$/,""),m=k+1;m<j.length;++m){var n=j[m];if(!/\s/.test(n[0]))break;l+=n,k=m}if(b=l.match(f)){for(var o={name:b[1],values:[]},p=b[2].split(","),q=0;q<p.length;++q)o.values.push(p[q].replace(/^\s+/,""));if(i.procType)if(i.contentDomain||"Content-Domain"!==o.name)if(i.dekInfo||"DEK-Info"!==o.name)i.headers.push(o);else{if(0===o.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');i.dekInfo={algorithm:p[0],parameters:p[1]||null}}else i.contentDomain=p[0]||"";else{if("Proc-Type"!==o.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==o.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');i.procType={version:p[0],type:p[1]}}}++k}if("ENCRYPTED"===i.procType&&!i.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===c.length)throw Error("Invalid PEM formatted message.");return c}},49471:(a,b,c)=>{"use strict";c.d(b,{nl:()=>j});var d=c(57690),e=c(71253);let f={vision:!1,pdf:!1,audioInput:!1,videoInput:!1,imageOutput:!1,audioOutput:!1,search:!1,tools:!0,reasoning:!1,thinkingFormat:null,thinkingCanDisable:!0,thinkingRange:null,contextWindow:2e5,maxOutput:64e3},g={"claude-opus-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-7":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4.8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-opus-4-8-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4.6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-4-6":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"claude-sonnet-5-thinking-agentic":{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive",contextWindow:1e6,maxOutput:128e3},"gpt-image-1":{imageOutput:!0,tools:!1},"glm-4.6v":{vision:!0,reasoning:!0,thinkingFormat:"zai",contextWindow:128e3},"vision-model":{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6},"coder-model":{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},h={nvidia:{"minimaxai/minimax-m2.7":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072},"minimaxai/minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:131072},"z-ai/glm-5.2":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:128e3},"deepseek-ai/deepseek-v4-pro":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536},"deepseek-ai/deepseek-v4-flash":{reasoning:!0,thinkingFormat:"openai",contextWindow:1e6,maxOutput:65536}},"codebuddy-cn":{"glm-5.2":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:48e3},"glm-5.1":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5.0":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"glm-5.0-turbo":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"glm-5v-turbo":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:38e3},"glm-4.7":{reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:48e3},"minimax-m3":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:512e3,maxOutput:48e3},"minimax-m2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:48e3},"kimi-k2.7":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.6":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:256e3,maxOutput:32e3},"kimi-k2.5":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:164e3,maxOutput:32e3},"hy3-preview":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:192e3,maxOutput:64e3},"deepseek-v4-pro":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v4-flash":{vision:!0,reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:1e6,maxOutput:5e4},"deepseek-v3-2-volc":{reasoning:!0,thinkingFormat:"openai",thinkingCanDisable:!1,contextWindow:96e3,maxOutput:32e3}}},i=[{pattern:"*claude*opus-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*opus-4.8*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.6*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet-4.7*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*haiku*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*claude*opus*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*sonnet*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-adaptive"}},{pattern:"*claude*fable*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude*mythos*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget",contextWindow:1e6,maxOutput:128e3}},{pattern:"*claude-3*",caps:{vision:!0}},{pattern:"*claude*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"claude-budget"}},{pattern:"*gemini*image*",caps:{vision:!0,imageOutput:!0,contextWindow:1048576}},{pattern:"*gemini-3*pro*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65535}},{pattern:"*gemini-3*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-level",thinkingCanDisable:!1,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,search:!0,thinkingFormat:"gemini-budget",thinkingRange:{min:0,max:24576},contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini-2*",caps:{vision:!0,audioInput:!0,videoInput:!0,search:!0,contextWindow:1048576,maxOutput:65536}},{pattern:"*gemini*",caps:{vision:!0,search:!0,contextWindow:1048576}},{pattern:"*gemma*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*nanobanana*",caps:{vision:!0,imageOutput:!0}},{pattern:"*gpt-5*image*",caps:{imageOutput:!0}},{pattern:"*gpt-5*codex*",caps:{reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-5*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:4e5,maxOutput:128e3}},{pattern:"*gpt-4o*",caps:{vision:!0,search:!0,contextWindow:128e3,maxOutput:16384}},{pattern:"*gpt-4.1*",caps:{vision:!0,contextWindow:1e6,maxOutput:32768}},{pattern:"*gpt-4-turbo*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*gpt-4*",caps:{contextWindow:128e3}},{pattern:"*gpt-3.5*",caps:{contextWindow:16385,maxOutput:4096}},{pattern:"*gpt-oss*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1-mini*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:128e3}},{pattern:"*o1*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*o4*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:2e5,maxOutput:1e5}},{pattern:"*grok*image*",caps:{imageOutput:!0}},{pattern:"*grok-code*",caps:{reasoning:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-4*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*grok-3*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:131072}},{pattern:"*grok*",caps:{vision:!0,reasoning:!0,search:!0,thinkingFormat:"openai",contextWindow:256e3}},{pattern:"*qwen*vl*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwen*omni*",caps:{vision:!0,audioInput:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:262144,maxOutput:65536}},{pattern:"*qwen*coder*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6}},{pattern:"*qwen*max*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.5*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.6*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen3.7*",caps:{vision:!0,videoInput:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*plus*",caps:{vision:!0,reasoning:!0,thinkingFormat:"qwen",contextWindow:1e6,maxOutput:65536}},{pattern:"*qwen*235b*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*qwq*",caps:{reasoning:!0,thinkingFormat:"qwen",thinkingCanDisable:!1,contextWindow:131072}},{pattern:"*qwen*",caps:{reasoning:!0,thinkingFormat:"qwen",contextWindow:262144}},{pattern:"*kimi*k2.7*code*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",thinkingCanDisable:!1,contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*k2*",caps:{vision:!0,reasoning:!0,thinkingFormat:"kimi",contextWindow:262144,maxOutput:262144}},{pattern:"*kimi*",caps:{reasoning:!0,thinkingFormat:"kimi",contextWindow:262144}},{pattern:"*glm-5*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4.7*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5,maxOutput:128e3}},{pattern:"*glm-4*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*glm*",caps:{reasoning:!0,thinkingFormat:"zai",contextWindow:2e5}},{pattern:"*deepseek-v4*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:1e6,maxOutput:384e3}},{pattern:"*reasoner*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-r*",caps:{reasoning:!0,thinkingFormat:"deepseek",thinkingCanDisable:!1,contextWindow:128e3}},{pattern:"*deepseek-chat*",caps:{contextWindow:128e3}},{pattern:"*deepseek*",caps:{reasoning:!0,thinkingFormat:"deepseek",contextWindow:128e3}},{pattern:"*minimax*image*",caps:{imageOutput:!0}},{pattern:"*minimax-m3*",caps:{vision:!0,reasoning:!0,thinkingFormat:"minimax",contextWindow:1048576,maxOutput:512e3}},{pattern:"*minimax-m2.7*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:204800,maxOutput:131072}},{pattern:"*minimax*",caps:{reasoning:!0,thinkingFormat:"minimax",thinkingCanDisable:!1,contextWindow:2e5,maxOutput:131072}},{pattern:"*mimo*v2.5*",caps:{vision:!0,audioInput:!0,videoInput:!0,contextWindow:1048576,maxOutput:131072}},{pattern:"*mimo*omni*",caps:{vision:!0,audioInput:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*mimo*",caps:{vision:!0,contextWindow:262144,maxOutput:131072}},{pattern:"*llama-4*",caps:{vision:!0,contextWindow:1e6}},{pattern:"*llama*",caps:{contextWindow:128e3}},{pattern:"*codestral*",caps:{contextWindow:256e3}},{pattern:"*mistral-large*",caps:{vision:!0,contextWindow:256e3}},{pattern:"*mistral*",caps:{contextWindow:128e3}},{pattern:"*command-a-vision*",caps:{vision:!0,contextWindow:128e3}},{pattern:"*command*",caps:{contextWindow:128e3}},{pattern:"*sonar*",caps:{search:!0,contextWindow:128e3}},{pattern:"*pplx*",caps:{search:!0,contextWindow:128e3}},{pattern:"*perplexity*",caps:{search:!0,contextWindow:128e3}},{pattern:"*muse-spark*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:65536}},{pattern:"*muse*",caps:{vision:!0,reasoning:!0,thinkingFormat:"openai",contextWindow:1048576,maxOutput:65536}},{pattern:"*hunyuan*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"hy3*",caps:{reasoning:!0,thinkingFormat:"hunyuan",contextWindow:262144,maxOutput:262144}},{pattern:"*step-*",caps:{reasoning:!0,thinkingFormat:"step",contextWindow:128e3}},{pattern:"*nemotron*",caps:{reasoning:!0,contextWindow:128e3}},{pattern:"*ling-*",caps:{reasoning:!0,contextWindow:128e3}}];function j(a,b){if(!b)return{...f};let c=function(a,b){let c=h[a]?.[b];if(c)return c;let d=b.includes("/")?b.split("/").pop():b,f=g[d]||g[b];if(f)return f;for(let{pattern:a,caps:c}of i)if((0,e.gH)(a,d||b))return c;return null}(a,b),j=(0,d.uV)(b);return{...f,...j||{},...c||{}}}},49623:(a,b,c)=>{"use strict";c.d(b,{E9:()=>o,RF:()=>h,oV:()=>n});var d=c(55511),e=c(82689);let f=new Map,g=setInterval(()=>{let a=Date.now();for(let[b,c]of f)a-c.lastUsed>e.v1.sessionTtlMs&&f.delete(b)},e.v1.sessionCleanupIntervalMs);function h(a){if(!a)return i();let b=f.get(a);if(b)return b.lastUsed=Date.now(),b.sessionId;if(f.size>=1e3){let a=f.keys().next().value;f.delete(a)}let c=i();return f.set(a,{sessionId:c,lastUsed:Date.now()}),c}function i(){return d.randomUUID()+Date.now().toString()}g.unref&&g.unref();let j=["x-session-id","session-id","session_id","x-amp-thread-id","x-client-request-id"],k=/_session_([a-f0-9-]+)$/;function l(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}let m=/^[a-z]+\/([0-9a-f-]{36})\//i;function n({headers:a,body:b,connectionId:c,workspaceId:e,scope:f=""}={}){var g,i;let o,p=function(a,b){let c=function(a){if("string"!=typeof a||!a)return null;let b=a.match(k);if(b)return b[1];if("{"===a[0])try{return l(JSON.parse(a)?.session_id)}catch{}return null}(b?.metadata?.user_id);if(c)return`claude:${c}`;let d=function(a){let b=a?.request?.sessionId;if(null!=b&&""!==b)return l(String(b));let c="string"==typeof a?.requestId?a.requestId.match(m):null;return c?l(c[1]):null}(b);if(d)return`antigravity:${d}`;for(let b of j){let c=a&&"object"==typeof a?"function"==typeof a.get?l(a.get(b)):l(a[b]??a[b.toLowerCase()]):null;if(c)return c}return l(b?.prompt_cache_key)||l(b?.session_id)||l(b?.conversation_id)||l(b?.metadata?.user_id)||null}(a,b);if(p)return p;let q=(g=`${f}:${c||""}`,(o=function(a){let b=Array.isArray(a?.input)?a.input:Array.isArray(a?.messages)?a.messages:null;if(!b)return"";let c="";for(let a of b)if(a?.role==="assistant"){if("string"==typeof a.content)c+=a.content;else if(Array.isArray(a.content))for(let b of a.content)c+=b?.text||b?.output||"";if(c.length>=50)break}return c}(b)).length<50?null:`assistant:${i=JSON.stringify([g,o.slice(0,50)]),d.createHash("sha256").update(i).digest("hex")}`);if(q)return q;let r=l(e);return r||h(c)}function o(a){let b=l(a);if(!b)return null;if(/^-?\d+$/.test(b))return b;let c=0x7fffffffffffffffn&d.createHash("sha256").update(b).digest().readBigUInt64BE(0);return`-${c.toString()}`}},49926:(a,b,c)=>{"use strict";c(82703),c(80152),c(82689),c(68531),c(38421),c(75371),c(39490),c(81556),c(17438)},50027:(a,b,c)=>{"use strict";let d=c(34589),{kConstruct:e}=c(49176),{urlEquals:f,getFieldValues:g}=c(90912),{kEnumerableProperty:h,isDisturbed:i}=c(84285),{webidl:j}=c(32984),{cloneResponse:k,fromInnerResponse:l,getResponseState:m}=c(78196),{Request:n,fromInnerRequest:o,getRequestState:p}=c(12600),{fetching:q}=c(76403),{urlIsHttpHttpsScheme:r,readAllBytes:s}=c(42425);class t{#bi;constructor(){arguments[0]!==e&&j.illegalConstructor(),j.util.markAsUncloneable(this),this.#bi=arguments[1]}async match(a,b={}){j.brandCheck(this,j.is.Cache);let c="Cache.match";j.argumentLengthCheck(arguments,1,c),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,c,"options");let d=this.#bj(a,b,1);if(0!==d.length)return d[0]}async matchAll(a,b={}){return j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.matchAll","options"),this.#bj(a,b)}async add(a){j.brandCheck(this,j.is.Cache),j.argumentLengthCheck(arguments,1,"Cache.add");let b=[a=j.converters.RequestInfo(a)],c=this.addAll(b);return await c}async addAll(a){j.brandCheck(this,j.is.Cache);let b="Cache.addAll";j.argumentLengthCheck(arguments,1,b);let c=[],d=[];for(let c of a){if(void 0===c)throw j.errors.conversionFailed({prefix:b,argument:"Argument 1",types:["undefined is not allowed"]});if("string"==typeof(c=j.converters.RequestInfo(c)))continue;let a=p(c);if(!r(a.url)||"GET"!==a.method)throw j.errors.exception({header:b,message:"Expected http/s scheme when method is not GET."})}let e=[];for(let f of a){let a=p(new n(f));if(!r(a.url))throw j.errors.exception({header:b,message:"Expected http/s scheme."});a.initiator="fetch",a.destination="subresource",d.push(a);let h=Promise.withResolvers();e.push(q({request:a,processResponse(a){if("error"===a.type||206===a.status||a.status<200||a.status>299)h.reject(j.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(a.headersList.contains("vary")){for(let b of g(a.headersList.get("vary")))if("*"===b){for(let a of(h.reject(j.errors.exception({header:"Cache.addAll",message:"invalid vary field value"})),e))a.abort();return}}},processResponseConsumeBody(a){a.aborted?h.reject(new DOMException("aborted","AbortError")):h.resolve(a)}})),c.push(h.promise)}let f=Promise.all(c),h=await f,i=[],k=0;for(let a of h){let b={type:"put",request:d[k],response:a};i.push(b),k++}let l=Promise.withResolvers(),m=null;try{this.#bk(i)}catch(a){m=a}return queueMicrotask(()=>{null===m?l.resolve(void 0):l.reject(m)}),l.promise}async put(a,b){j.brandCheck(this,j.is.Cache);let c="Cache.put";j.argumentLengthCheck(arguments,2,c),a=j.converters.RequestInfo(a),b=j.converters.Response(b,c,"response");let d=null;if(!r((d=j.is.Request(a)?p(a):p(new n(a))).url)||"GET"!==d.method)throw j.errors.exception({header:c,message:"Expected an http/s scheme when method is not GET"});let e=m(b);if(206===e.status)throw j.errors.exception({header:c,message:"Got 206 status"});if(e.headersList.contains("vary")){for(let a of g(e.headersList.get("vary")))if("*"===a)throw j.errors.exception({header:c,message:"Got * vary field value"})}if(e.body&&(i(e.body.stream)||e.body.stream.locked))throw j.errors.exception({header:c,message:"Response body is locked or disturbed"});let f=k(e),h=Promise.withResolvers();null!=e.body?s(e.body.stream.getReader(),h.resolve,h.reject):h.resolve(void 0);let l=[],o={type:"put",request:d,response:f};l.push(o);let q=await h.promise;null!=f.body&&(f.body.source=q);let t=Promise.withResolvers(),u=null;try{this.#bk(l)}catch(a){u=a}return queueMicrotask(()=>{null===u?t.resolve():t.reject(u)}),t.promise}async delete(a,b={}){let c;j.brandCheck(this,j.is.Cache);let e="Cache.delete";j.argumentLengthCheck(arguments,1,e),a=j.converters.RequestInfo(a),b=j.converters.CacheQueryOptions(b,e,"options");let f=null;if(j.is.Request(a)){if("GET"!==(f=p(a)).method&&!b.ignoreMethod)return!1}else d("string"==typeof a),f=p(new n(a));let g=[],h={type:"delete",request:f,options:b};g.push(h);let i=Promise.withResolvers(),k=null;try{c=this.#bk(g)}catch(a){k=a}return queueMicrotask(()=>{null===k?i.resolve(!!c?.length):i.reject(k)}),i.promise}async keys(a,b={}){j.brandCheck(this,j.is.Cache),void 0!==a&&(a=j.converters.RequestInfo(a)),b=j.converters.CacheQueryOptions(b,"Cache.keys","options");let c=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(c=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(c=p(new n(a)));let d=Promise.withResolvers(),e=[];if(void 0===a)for(let a of this.#bi)e.push(a[0]);else for(let a of this.#bl(c,b))e.push(a[0]);return queueMicrotask(()=>{let a=[];for(let b of e){let c=o(b,void 0,new AbortController().signal,"immutable");a.push(c)}d.resolve(Object.freeze(a))}),d.promise}#bk(a){let b=this.#bi,c=[...b],e=[],f=[];try{for(let c of a){let a;if("delete"!==c.type&&"put"!==c.type)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if("delete"===c.type&&null!=c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#bl(c.request,c.options,e).length)throw new DOMException("???","InvalidStateError");if("delete"===c.type){if(a=this.#bl(c.request,c.options),0===a.length)return[];for(let c of a){let a=b.indexOf(c);d(-1!==a),b.splice(a,1)}}else if("put"===c.type){if(null==c.response)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let f=c.request;if(!r(f.url))throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if("GET"!==f.method)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(null!=c.options)throw j.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});for(let e of a=this.#bl(c.request)){let a=b.indexOf(e);d(-1!==a),b.splice(a,1)}b.push([c.request,c.response]),e.push([c.request,c.response])}f.push([c.request,c.response])}return f}catch(a){throw this.#bi.length=0,this.#bi=c,a}}#bl(a,b,c){let d=[];for(let e of c??this.#bi){let[c,f]=e;this.#bm(a,c,f,b)&&d.push(e)}return d}#bm(a,b,c=null,d){let e=new URL(a.url),h=new URL(b.url);if(d?.ignoreSearch&&(h.search="",e.search=""),!f(e,h,!0))return!1;if(null==c||d?.ignoreVary||!c.headersList.contains("vary"))return!0;for(let d of g(c.headersList.get("vary")))if("*"===d||b.headersList.get(d)!==a.headersList.get(d))return!1;return!0}#bj(a,b,c=1/0){let d=null;if(void 0!==a)if(j.is.Request(a)){if("GET"!==(d=p(a)).method&&!b.ignoreMethod)return[]}else"string"==typeof a&&(d=p(new n(a)));let e=[];if(void 0===a)for(let a of this.#bi)e.push(a[1]);else for(let a of this.#bl(d,b))e.push(a[1]);let f=[];for(let a of e){let b=l(k(a),"immutable");if(f.push(b),f.length>=c)break}return Object.freeze(f)}static{j.is.Cache=a=>null!=a&&"object"==typeof a&&#bi in a}}Object.defineProperties(t.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:h,matchAll:h,add:h,addAll:h,put:h,delete:h,keys:h});let u=[{key:"ignoreSearch",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:j.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:j.converters.boolean,defaultValue:()=>!1}];j.converters.CacheQueryOptions=j.dictionaryConverter(u),j.converters.MultiCacheQueryOptions=j.dictionaryConverter([...u,{key:"cacheName",converter:j.converters.DOMString}]),j.converters.Response=j.interfaceConverter(j.is.Response,"Response"),j.converters["sequence<RequestInfo>"]=j.sequenceConverter(j.converters.RequestInfo),a.exports={Cache:t}},50132:(a,b,c)=>{"use strict";c(68531)},50329:a=>{"use strict";class b{bottom=0;top=0;list=Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(a){this.list[this.top]=a,this.top=this.top+1&2047}shift(){let a=this.list[this.bottom];return void 0===a?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,a)}}a.exports=class{constructor(){this.head=this.tail=new b}isEmpty(){return this.head.isEmpty()}push(a){this.head.isFull()&&(this.head=this.head.next=new b),this.head.push(a)}shift(){let a=this.tail,b=a.shift();return a.isEmpty()&&null!==a.next&&(this.tail=a.next,a.next=null),b}}},50743:(a,b,c)=>{"use strict";function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},50969:(a,b,c)=>{"use strict";let d;c.d(b,{wo:()=>P,Fm:()=>T,ip:()=>O,WV:()=>L});var e=c(27910),f=c(82689),g=c(44140),h=c(59882),i=c(31421),j=c(51455),k=c(76760),l=c(73136),m=c(57075);let n="2.1.302",o=Object.freeze(["http/1.1"]);Object.freeze(["TLS_AES_128_GCM_SHA256","TLS_AES_256_GCM_SHA384","TLS_CHACHA20_POLY1305_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256","TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256","TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA","TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA","TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","TLS_RSA_WITH_AES_128_GCM_SHA256","TLS_RSA_WITH_AES_256_GCM_SHA384","TLS_RSA_WITH_AES_128_CBC_SHA","TLS_RSA_WITH_AES_256_CBC_SHA"]),Object.freeze(["server_name","extended_master_secret","renegotiation_info","supported_groups:x25519_mlkem768,x25519,secp256r1,secp384r1","ec_point_formats:uncompressed","session_ticket","alpn:http/1.1","status_request","signature_algorithms:ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,ed25519,ecdsa_secp521r1_sha512,rsa_pkcs1_sha1","signed_certificate_timestamp","key_share:x25519_mlkem768,x25519","psk_key_exchange_modes:psk_dhe_ke","supported_versions:TLS1.3,TLS1.2"]);let p=k.dirname((0,l.fileURLToPath)("file:///home/runner/work/switchboard-router/switchboard-router/open-sse/identity/tls/claude-code.js")),q="win32"===process.platform?"switchboard-claude-tls.exe":"switchboard-claude-tls",r=[process.env.SWITCHBOARD_CLAUDE_TLS_HELPER,k.join(process.cwd(),"open-sse","identity","tls","bin",process.platform,process.arch,q),k.join(p,"bin",process.platform,process.arch,q)].filter(Boolean);function s(a){let b=Number(a);return Number.isFinite(b)&&b>0?Math.floor(b):null}let t=i.spawn,u=function(a){if(null==a||""===a)return 2;let b=Number(a);return Number.isInteger(b)&&b>=0?b:2}(process.env.SWITCHBOARD_CLAUDE_TLS_POOL_CAP),v=new Map,w=null;function x(a){return t(a,[],{stdio:["pipe","pipe","pipe"],windowsHide:!0})}function y(a,b){for(let c of[a,a.stdin,a.stdout,a.stderr])c?.[b?"ref":"unref"]?.()}async function z(){if(d)return d;for(let a of r)try{return await (0,j.access)(a),d=a,a}catch{}throw Error(`Claude Code TLS helper is not installed for ${process.platform}-${process.arch}`)}function A(){return new DOMException("The operation was aborted.","AbortError")}let B=globalThis.fetch,C=new Map,D=new Map,E=async()=>async function(a,b={},c={}){var d,e,f,g;if(c.alpn?.length!==1||"http/1.1"!==c.alpn[0])throw Error("Claude Code TLS transport requires ALPN http/1.1 only");if(b.signal?.aborted)throw A();let h=await z(),i=function(){for(let[a,b]of v)if(b(),null==a.exitCode&&null==a.signalCode)return y(a,!0),a;return null}()??x(h);w||v.size>=u||(w=setImmediate(()=>{w=null,function(a){for(;v.size<u;){let b;try{b=x(a)}catch{return}!function(a){let b=()=>{clearTimeout(c),a.off("exit",b),a.off("error",b),v.delete(a)},c=setTimeout(()=>{b();try{a.kill("SIGTERM")}catch{}},6e4);c.unref?.(),a.once("exit",b),a.once("error",b),y(a,!1),v.set(a,b)}(b)}}(h)}),w.unref?.());let j=function(a){if(null==a)return null;if("string"==typeof a)return Buffer.from(a);if(Buffer.isBuffer(a))return a;if(a instanceof Uint8Array)return Buffer.from(a);throw TypeError("Claude Code TLS helper requires a string or byte request body")}(b.body),k={url:String(a),method:b.method||"GET",headers:(d=b.headers)instanceof Headers?[...d.entries()]:Object.entries(d||{}).map(([a,b])=>[a,String(b)]),headerOrder:c.headerOrder||[],proxyUrl:c.proxyUrl||"",tlsSpecRev:n,alpn:o,bodyLength:j?.byteLength||0,timeoutMs:s(b.timeoutMs)??s(c.timeoutMs)??6e4};return i.stdin.write(`${JSON.stringify(k)}
|
|
363
363
|
`),j&&i.stdin.write(j),i.stdin.end(),e=i.stdout,f=i.stderr,g=b.signal,new Promise((a,b)=>{let c=Buffer.alloc(0),d="",h=!1,j=a=>{d.length>=16384||(d+=a.toString("utf8",0,16384-d.length))},k=(a,b,c)=>{let e=d.trim(),f=`${null==a?"":` with code ${a}`}${b?` (${b})`:""}`;return Error(e||`Claude TLS helper exited${c}${f}`)},l=()=>{e.off("data",r),i.off("error",o),i.off("exit",p)},n=a=>{h||(h=!0,l(),f.off("data",j),g?.removeEventListener("abort",q),b(a))},o=a=>n(a),p=(a,b)=>n(k(a,b," before metadata")),q=()=>{n(A()),i.kill("SIGTERM")},r=b=>{let d,o=(c=Buffer.concat([c,b])).indexOf("\n");if(o<0)return;try{d=JSON.parse(c.subarray(0,o).toString("utf8"))}catch(a){n(Error(`Claude TLS helper returned invalid metadata: ${a.message}`));return}if(d.error)return void n(Error(d.error));h=!0,l(),g?.removeEventListener("abort",q);let p=new m.PassThrough,r=m.Readable.toWeb(p),s=!1,t=!1,u=!1,v=a=>{u||(u=!0,p.off("close",w),e.unpipe(p),e.off("end",z),e.off("error",y),f.off("data",j),i.off("error",y),i.off("exit",B),g?.removeEventListener("abort",C),a?p.destroy(a):p.end())},w=()=>{u||(v(),i.kill("SIGTERM"))},x=a=>{e.destroyed||(e.once("error",()=>{}),e.destroy(a)),v(a)},y=a=>v(a),z=()=>{s=!0,t&&v()},B=(a,b)=>{0!==a||b?x(k(a,b," after metadata")):(t=!0,s&&v())},C=()=>{x(A()),i.kill("SIGTERM")};p.once("close",w),e.once("end",z),e.once("error",y),i.once("error",y),i.once("exit",B),g?.addEventListener("abort",C,{once:!0}),p.write(c.subarray(o+1)),e.pipe(p,{end:!1}),a(new Response(r,{status:d.status,statusText:d.statusText||"",headers:new Headers(d.headers||[])}))};f.on("data",j),e.on("data",r),i.once("error",o),i.once("exit",p),g?.addEventListener("abort",q,{once:!0}),g?.aborted&&q()})},F=async()=>(await Promise.resolve().then(c.t.bind(c,36435,19))).Impit,G=new Map,H=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],I=["8.8.8.8","8.8.4.4"];function J(a){return null==a?"":String(a).trim()}async function K(a){let b=G.get(a);if(b&&Date.now()<b.expiry&&Array.isArray(b.ips)&&b.ips.length>0)return b.idx=(b.idx+1)%b.ips.length,b.ips[b.idx];try{let b=await Promise.resolve().then(c.t.bind(c,14985,19)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,19)),e=new b.Resolver;e.setServers(I);let g=d(e.resolve4.bind(e)),h=d(e.resolve6.bind(e)),i=await g(a).catch(()=>[]);if(Array.isArray(i)&&0!==i.length||(i=await h(a).catch(()=>[])),!Array.isArray(i)||0===i.length)return null;if(G.size>=f.v1.dnsCacheMaxSize){let a=Date.now();for(let[b,c]of G)c.expiry<=a&&G.delete(b);for(;G.size>=f.v1.dnsCacheMaxSize;)G.delete(G.keys().next().value)}return G.set(a,{ips:i,idx:0,expiry:Date.now()+f.v1.dnsCacheTtlMs}),i[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function L(a){try{let b=new URL(a).hostname;return H.some(a=>b.includes(a))}catch{return!1}}function M(a,b){let c,d=J(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function N(a){let b=J(a);if(!b)return null;try{return new URL(b),b}catch{return`http://${b}`}}function O(a,b){return function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=J(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=J(b?.noProxy??b?.connectionNoProxy);return d&&M(a,d)?null:N(c)}(a,b)||N(function(a){let b;if(M(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(a))}async function P(a){let b=N(a);if(!b)return null;if(!C.has(b)){if(C.size>=f.v1.proxyDispatchersMaxSize){let a=C.keys().next().value,b=C.get(a);C.delete(a),Promise.resolve(b?.close?.()).catch(()=>{})}let{ProxyAgent:a}=await Promise.resolve().then(c.t.bind(c,25814,19));C.set(b,new a({uri:b}))}let d=C.get(b);return C.delete(b),C.set(b,d),d}async function Q(a){let b=a||"",c=D.get(b);return c||(c=new(await F())({browser:"chrome",...a?{proxyUrl:a}:{},followRedirects:!1}),D.set(b,c)),(a,b)=>c.fetch(a,b)}function R(a){return a?"u">typeof Headers&&a instanceof Headers?Object.fromEntries(a.entries()):{...a}:{}}async function S(a,b,d){let f=await Promise.resolve().then(c.t.bind(c,55591,19)),g=await Promise.resolve().then(c.t.bind(c,91645,19)),h=f.default??f,i=g.default??g;return new Promise((c,f)=>{let g,j=new i.Socket,k=!1;function l(){j.setTimeout(0),d.signal&&d.signal.removeEventListener("abort",m)}function m(){k||(k=!0,l(),j.destroy(),g?.destroy(),f(new DOMException("The operation was aborted.","AbortError")))}d.signal?.aborted?m():(d.signal&&d.signal.addEventListener("abort",m,{once:!0}),j.setTimeout(1e4,()=>{k||(k=!0,l(),j.destroy(),f(Error(`[ProxyFetch] connect timeout after 10000ms to ${b}`)))}),j.connect(443,b,()=>{j.setTimeout(0);let b={socket:j,servername:a.hostname,path:a.pathname+a.search,method:d.method||"POST",headers:{...R(d.headers),Host:a.hostname}};if((g=h.request(b,a=>{let b=()=>{try{a.destroy(new DOMException("The operation was aborted.","AbortError"))}catch{a.destroy()}},g=()=>d.signal?.removeEventListener("abort",b);if(d.signal?.aborted){k=!0,l(),b(),g(),f(new DOMException("The operation was aborted.","AbortError"));return}d.signal?.addEventListener("abort",b,{once:!0}),a.once("end",g),a.once("close",g),a.once("error",g);let h={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:e.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await h.text())};k=!0,l(),c(h)})).on("error",a=>{k||(k=!0,l(),f(a))}),null!=d.body)try{g.write(function(a){if("string"==typeof a||"u">typeof Buffer&&Buffer.isBuffer(a)||a instanceof Uint8Array)return a;if("u">typeof ArrayBuffer&&a instanceof ArrayBuffer)return Buffer.from(a);if("u">typeof FormData&&a instanceof FormData)throw Error("[ProxyFetch] FormData bodies are not supported on the MITM bypass path");return JSON.stringify(a)}(d.body))}catch(a){k||(k=!0,l(),f(a));return}g.end()}),j.on("error",a=>{k||(k=!0,l(),f(a))}))})}async function T(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=function(a,b={}){let c=b.headers?.Accept||b.headers?.accept||"",d="string"==typeof c&&c.includes("text/event-stream"),e=(0,g.fX)(b.headers||{},{identity:b.identity,provider:b.provider,format:b.format,overlay:b.overlay,credentialId:b.credentialId,stream:b.stream??d,retryCount:b.retryCount,snapshot:b.snapshot,requestPath:new URL(a).pathname}),f={...e.headers};if("claude-cli"===e.profileId){let a=Object.keys(f).find(a=>"authorization"===a.toLowerCase());if((a?String(f[a]):"").startsWith("Bearer ")){let a=Object.keys(f).find(a=>"anthropic-beta"===a.toLowerCase());a&&f[a]&&(f[a]=(0,g.AU)(f[a]))}else{let a=Object.keys(f).find(a=>"x-api-key"===a.toLowerCase());if(a&&f[a]){let a=Object.keys(f).find(a=>"anthropic-beta"===a.toLowerCase());if(a&&f[a]){let b=(0,g.Aw)(f[a]);b?f[a]=b:delete f[a]}for(let a of Object.keys(f))"user-agent"===a.toLowerCase()&&delete f[a]}}}return{...b,headers:f,_identityTls:e.tls,_identityAlpn:e.alpn,_identityTlsSpecRev:e.tlsSpecRev,_identityProfile:e.profileId}}(d,b),f=function(a){let{_identityTls:b,_identityAlpn:c,_identityTlsSpecRev:d,_identityProfile:e,identity:f,provider:g,format:h,overlay:i,credentialId:j,stream:k,retryCount:l,snapshot:m,...n}=a;return n}(e),{_identityTls:i,_identityAlpn:j,_identityProfile:k}=e,l=J(c?.vercelRelayUrl);if(l){let a=new URL(d);return((...a)=>B(...a))(l,{...f,headers:{...R(f.headers),"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`}})}let m=O(d,c);if("node"!==i)try{let b={profileId:k,alpn:j,proxyUrl:m,headerOrder:"claude-cli"===k?new URL(d).pathname.startsWith("/v1/messages/count_tokens")?h.$R:h.Zb:(0,h.E$)(k)?.headerOrder||[]},c=/^claude-code-(\d+\.\d+\.\d+)$/.exec(e._identityTlsSpecRev||"")?.[1]||e._identityTlsSpecRev;if("claude-cli"===k&&c!==n)throw Error(`snapshot TLS spec ${e._identityTlsSpecRev||"missing"} does not match helper ${n}`);let g="chrome"===i?await Q(m):await E();return await g(a,f,b)}catch(b){if(b?.name==="AbortError")throw b;let a=Error(`[ProxyFetch] ${i} TLS (${k}) unavailable: ${b.message}`);throw a.status=503,a}if(L(d)){if(m)try{let b=await P(m);return await ((...a)=>B(...a))(a,{...f,dispatcher:b})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),b=await K(a.hostname);if(b)return await S(a,b,f)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}}if(m)try{let b=await P(m);return await ((...a)=>B(...a))(a,{...f,dispatcher:b})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`)}return((...a)=>B(...a))(a,f)}async function U(a,b={}){return T(a,b,null)}globalThis.fetch!==U&&(globalThis.fetch=U)},51171:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{ou:()=>z});var e=c(22256),f=c(38421),g=c(82689),h=c(71137),i=c(70799),j=c(22268),k=c(19016),l=c(24725),m=c(68531),n=c(50969),o=c(44140),p=c(18586),q=c(74075);let a=null;if(!("u">typeof caches&&"object"==typeof caches||"u">typeof EdgeRuntime))try{a=await Promise.resolve().then(c.t.bind(c,73496,19))}catch{}let w="1"===process.env.CURSOR_STREAM_DEBUG,x=(...a)=>{w&&console.log(...a)};function r(a){let b=String(a||"").split("/").pop();return/^composer(?:-|$)/i.test(b)}function s(a){if(!a)return"";let b="</think>",c=a.lastIndexOf(b);return c<0?"":a.slice(c+b.length).trimStart()}function t(a,b,c,d){if(b+5>a.length)return x(`[CURSOR BUFFER${d}] Reached end, offset=${b}, remaining=${a.length-b}`),{status:"done"};let e=a[b],f=a.readUInt32BE(b+1);if(x(`[CURSOR BUFFER${d}] Frame ${c+1}: flags=0x${e.toString(16).padStart(2,"0")}, length=${f}`),b+5+f>a.length)return x(`[CURSOR BUFFER${d}] Incomplete frame, offset=${b}, length=${f}, buffer.length=${a.length}`),{status:"done"};let g=a.slice(b+5,b+5+f),h=b+5+f;return(g=function(a,b){if(a.length>10&&123===a[0]&&34===a[1])try{if(a.toString("utf-8").startsWith('{"error"'))return x("[DECOMPRESS] Detected JSON error, skipping decompression"),a}catch{}if(1===b||2===b||3===b)try{return q.gunzipSync(a)}catch(c){try{return q.inflateSync(a)}catch(d){try{return q.inflateRawSync(a)}catch(e){x(`[DECOMPRESS ERROR] flags=${b}, payloadSize=${a.length}, gzip=${c.message}, deflate=${d.message}, raw=${e.message}`),x("[DECOMPRESS ERROR] First 50 bytes (hex):",a.slice(0,50).toString("hex"))}}}return a}(g,e))?{status:"ok",payload:g,offset:h}:(x(`[CURSOR BUFFER${d}] Frame ${c+1}: decompression failed, skipping`),{status:"skip",offset:h})}let y=/rate.?limit|rate_limited|resource_exhausted|quota|too many requests|throttl|capacity|overloaded|\b429\b/i;function u(a){return y.test(String(a||""))?{status:g.gx.RATE_LIMITED,type:"rate_limit_error",code:"rate_limited"}:{status:g.gx.BAD_REQUEST,type:"api_error",code:"upstream_error"}}function v(a){let b=a?.error?.details?.[0]?.debug?.details?.title||a?.error?.details?.[0]?.debug?.details?.detail||a?.error?.message||"API Error",c=a?.error?.code==="resource_exhausted";return new Response(JSON.stringify({error:{message:b,type:c?"rate_limit_error":"api_error",code:a?.error?.details?.[0]?.debug?.error||"unknown"}}),{status:c?g.gx.RATE_LIMITED:g.gx.BAD_REQUEST,headers:{"Content-Type":"application/json"}})}class z extends e.Hv{constructor(){super("cursor",f.xq.cursor)}buildUrl(){return`${this.config.baseUrl}${this.config.chatPath}`}buildHeaders(a){let b=a.accessToken,c=a.providerSpecificData?.machineId,d=a.providerSpecificData?.ghostMode!==!1;if(!c)throw Error("Machine ID is required for Cursor API");return(0,i.JA)(b,c,d)}transformRequest(a,b,c,d){let e=b.messages||[],f=b.tools||[],g=b.reasoning_effort||null,i=d?.rawHeaders?.["user-agent"]||"",j=i.includes("claude-cli")||i.includes("claude-code")||i.includes("Claude Code");return(0,h.yI)(e,a,f,g,j)}async makeFetchRequest(a,b,c,d,e=null){let f=await (0,n.Fm)(a,{method:"POST",headers:b,body:c,signal:d,identity:"cursor",provider:this.provider,format:this.config?.format},e);return{status:f.status,headers:Object.fromEntries(f.headers.entries()),body:Buffer.from(await f.arrayBuffer())}}wrapOutboundHeaders(a){return(0,o.fX)(a,{identity:"cursor",provider:this.provider,format:this.config?.format}).headers}makeHttp2Request(b,c,d,e){if(!a)throw Error("http2 module not available");return new Promise((f,g)=>{let h=new URL(b),i=a.connect(`https://${h.host}`),j=[],k={},l=!1,m=a=>(...b)=>{l||(l=!0,clearTimeout(n),i.close(),a(...b))},n=setTimeout(m(()=>{g(Error("HTTP/2 request timed out"))}),6e4);i.on("error",m(g));let o=i.request({":method":"POST",":path":h.pathname,":authority":h.host,":scheme":"https",...this.wrapOutboundHeaders(c)});if(o.on("response",a=>{k=a}),o.on("data",a=>{j.push(a)}),o.on("end",m(()=>{f({status:k[":status"],headers:k,body:Buffer.concat(j)})})),o.on("error",m(g)),e){let a=m(()=>g(Error("Request aborted")));e.addEventListener("abort",a,{once:!0})}o.write(d),o.end()})}async execute({model:b,body:c,stream:d,credentials:e,signal:f,log:h,proxyOptions:i=null}){let j=this.buildUrl(),k=this.buildHeaders(e),l=this.transformRequest(b,c,d,e);try{let e=i?.enabled===!0||i?.connectionProxyEnabled===!0||!!i?.vercelRelayUrl,g=a&&!e?await this.makeHttp2Request(j,k,l,f):await this.makeFetchRequest(j,k,l,f,i);if(200!==g.status){let a=g.body?.toString()||"Unknown error";return{response:new Response(JSON.stringify({error:{message:`[${g.status}]: ${a}`,type:"invalid_request_error",code:""}}),{status:g.status,headers:{"Content-Type":"application/json"}}),url:j,headers:k,transformedBody:c}}return{response:!1!==d?this.transformProtobufToSSE(g.body,b,c):this.transformProtobufToJSON(g.body,b,c),url:j,headers:k,transformedBody:c}}catch(a){return{response:new Response(JSON.stringify({error:{message:a.message,type:"connection_error",code:""}}),{status:g.gx.SERVER_ERROR,headers:{"Content-Type":"application/json"}}),url:j,headers:k,transformedBody:c}}}transformProtobufToJSON(a,b,c){let d=`chatcmpl-cursor-${Date.now()}`,e=Math.floor(Date.now()/1e3),f=0,g="",i="",k=[],l=new Map,n=new Set,o=0;for(x(`[CURSOR BUFFER] Total length: ${a.length} bytes`);f<a.length;){let b=t(a,f,o,"");if("done"===b.status)break;if(f=b.offset,o++,"skip"===b.status)continue;let c=b.payload;if(c.length>0&&123===c[0])try{let a=c.toString("utf-8");if(a.includes('"error"')){let b=g||l.size>0;if(x(`[CURSOR BUFFER] Error frame (hasContent=${b}): ${a.slice(0,500)}`),b)break;return v(JSON.parse(a))}}catch{}let d=(0,h.CP)(new Uint8Array(c));if(x(`[CURSOR DECODED] Frame ${o}:`,d),d.error){let a=g||l.size>0;if(x(`[CURSOR BUFFER] Decoded error (hasContent=${a}): ${d.error}`),a)break;let b=u(d.error);return new Response(JSON.stringify({error:{message:d.error,type:b.type,code:b.code}}),{status:b.status,headers:{"Content-Type":"application/json"}})}if(d.toolCall){let a=d.toolCall;if(l.has(a.id)){let b=l.get(a.id);b.function.arguments+=a.function.arguments,b.isLast=a.isLast}else l.set(a.id,{...a});if(a.isLast){let b=l.get(a.id);n.add(a.id),k.push({id:b.id,type:b.type,function:{name:b.function.name,arguments:b.function.arguments}})}}d.text&&(g+=d.text),d.thinking&&(i+=d.thinking)}let q=r(b)?s(i):"",w=g||q;for(let[a,b]of(x(`[CURSOR BUFFER] Parsed ${o} frames, toolCallsMap size: ${l.size}, finalized toolCalls: ${k.length}`),l.entries()))n.has(a)||(x(`[CURSOR BUFFER] Finalizing incomplete tool call: ${a}, isLast=${b.isLast}`),k.push({id:b.id,type:b.type,function:{name:b.function.name,arguments:b.function.arguments}}));x(`[CURSOR BUFFER] Final toolCalls count: ${k.length}`);let y=w;if(0===k.length&&w){let a=(0,p.au)(w,b);a&&a.toolCalls.length>0&&(x(`[CURSOR BUFFER] Extracted ${a.toolCalls.length} native tool call(s) from text content`),k.push(...a.toolCalls),y=a.content||"")}let z={role:"assistant",content:y||null};k.length>0&&(z.tool_calls=k);let A=(0,j.OF)(c,w.length,m.h.OPENAI),B={id:d,object:"chat.completion",created:e,model:b,choices:[{index:0,message:z,finish_reason:k.length>0?"tool_calls":"stop"}],usage:A};return new Response(JSON.stringify(B),{status:200,headers:{"Content-Type":"application/json"}})}transformProtobufToSSE(a,b,c){let d=`chatcmpl-cursor-${Date.now()}`,e=Math.floor(Date.now()/1e3),f=[],g=0,i="",n="",o=0,q=[],w=new Map,y=new Set,z=new Set,A=0;for(x(`[CURSOR BUFFER SSE] Total length: ${a.length} bytes`);g<a.length;){let c=t(a,g,A," SSE");if("done"===c.status)break;if(g=c.offset,A++,"skip"===c.status)continue;let j=c.payload;if(123===j[0])try{let a=j.toString("utf-8");if(a.includes('"error"')){let b=f.length>0||i||w.size>0;if(x(`[CURSOR BUFFER SSE] Error frame (hasContent=${b}): ${a.slice(0,500)}`),b)break;return v(JSON.parse(a))}}catch{}let k=(0,h.CP)(new Uint8Array(j));if(x(`[CURSOR DECODED SSE] Frame ${A}:`,k),k.error){let a=f.length>0||i||w.size>0;if(x(`[CURSOR BUFFER SSE] Decoded error (hasContent=${a}): ${k.error}`),a)break;let b=u(k.error);return new Response(JSON.stringify({error:{message:k.error,type:b.type,code:b.code}}),{status:b.status,headers:{"Content-Type":"application/json"}})}if(k.toolCall){let a=k.toolCall;if(0===f.length&&f.push((0,l.z)({id:d,created:e,model:b,delta:{role:"assistant",content:""}})),w.has(a.id)){let c=w.get(a.id);c.function.arguments.length,c.function.arguments+=a.function.arguments,c.isLast=a.isLast,a.function.arguments&&(z.add(a.id),f.push((0,l.z)({id:d,created:e,model:b,delta:{tool_calls:[{index:c.index,id:a.id,type:"function",function:{name:a.function.name,arguments:a.function.arguments}}]}})))}else{let c=q.length;y.add(a.id),q.push({...a,index:c}),w.set(a.id,{...a,index:c}),z.add(a.id),f.push((0,l.z)({id:d,created:e,model:b,delta:{tool_calls:[{index:c,id:a.id,type:"function",function:{name:a.function.name,arguments:a.function.arguments}}]}}))}}if(k.text&&(i+=k.text,f.push((0,l.z)({id:d,created:e,model:b,delta:0===f.length&&0===q.length?{role:"assistant",content:k.text}:{content:k.text}}))),r(b)&&k.thinking){n+=k.thinking;let a=s(n);if(a.length>o){let c=a.slice(o);o=a.length,i+=c,f.push((0,l.z)({id:d,created:e,model:b,delta:0===f.length&&0===q.length?{role:"assistant",content:c}:{content:c}}))}}}for(let[a,c]of(x(`[CURSOR BUFFER SSE] Parsed ${A} frames, toolCallsMap size: ${w.size}, toolCalls array: ${q.length}`),w.entries()))if(!y.has(a)){x(`[CURSOR BUFFER SSE] Finalizing incomplete tool call: ${a}, isLast=${c.isLast}`);let g=q.length;q.push({id:c.id,type:c.type,index:g,function:{name:c.function.name,arguments:c.function.arguments}}),z.has(c.id)||f.push((0,l.z)({id:d,created:e,model:b,delta:{tool_calls:[{index:g,id:c.id,type:"function",function:{name:c.function.name,arguments:c.function.arguments}}]}}))}if(0===q.length&&i){let a=(0,p.au)(i,b);if(a&&a.toolCalls.length>0){x(`[CURSOR BUFFER SSE] Extracted ${a.toolCalls.length} native tool call(s) from text content`),f.length=0;let c=a.content||"";c?f.push((0,l.z)({id:d,created:e,model:b,delta:{role:"assistant",content:c}})):f.push((0,l.z)({id:d,created:e,model:b,delta:{role:"assistant",content:""}}));for(let c=0;c<a.toolCalls.length;c++){let g=a.toolCalls[c];q.push({...g,index:c}),f.push((0,l.z)({id:d,created:e,model:b,delta:{tool_calls:[{index:c,id:g.id,type:"function",function:{name:g.function.name,arguments:g.function.arguments}}]}}))}}}0===f.length&&0===q.length&&f.push((0,l.z)({id:d,created:e,model:b,delta:{role:"assistant",content:""}}));let B=(0,j.OF)(c,i.length,m.h.OPENAI);return f.push(`data: ${JSON.stringify({id:d,object:"chat.completion.chunk",created:e,model:b,choices:[{index:0,delta:{},finish_reason:q.length>0?"tool_calls":"stop"}],usage:B})}
|
|
364
364
|
|
|
365
365
|
`),f.push(k.$U),new Response(f.join(""),{status:200,headers:{...k.pb}})}async refreshCredentials(){return null}}d()}catch(a){d(a)}},1)},51753:(a,b,c)=>{"use strict";let d,{webidl:e}=c(32984),{kEnumerableProperty:f}=c(84285),{kConstruct:g}=c(49176);class h extends Event{#bn;constructor(a,b={}){if(a===g){super(arguments[1],arguments[2]),e.util.markAsUncloneable(this);return}const c="MessageEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a=e.converters.DOMString(a,c,"type"),b=e.converters.MessageEventInit(b,c,"eventInitDict")),this.#bn=b,e.util.markAsUncloneable(this)}get data(){return e.brandCheck(this,e.is.MessageEvent),this.#bn.data}get origin(){return e.brandCheck(this,e.is.MessageEvent),this.#bn.origin}get lastEventId(){return e.brandCheck(this,e.is.MessageEvent),this.#bn.lastEventId}get source(){return e.brandCheck(this,e.is.MessageEvent),this.#bn.source}get ports(){return e.brandCheck(this,e.is.MessageEvent),Object.isFrozen(this.#bn.ports)||Object.freeze(this.#bn.ports),this.#bn.ports}initMessageEvent(a,b=!1,c=!1,d=null,f="",g="",i=null,j=[]){return e.brandCheck(this,e.is.MessageEvent),e.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new h(a,{bubbles:b,cancelable:c,data:d,origin:f,lastEventId:g,source:i,ports:j})}static{d=(a,b)=>{let c=new h(g,a,b);return c.#bn=b,c.#bn.data??=null,c.#bn.origin??="",c.#bn.lastEventId??="",c.#bn.source??=null,c.#bn.ports??=[],c},e.is.MessageEvent=a=>null!=a&&"object"==typeof a&&#bn in a}}class i extends Event{#bn;constructor(a,b={}){const c="CloseEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a=e.converters.DOMString(a,c,"type"),b=e.converters.CloseEventInit(b)),this.#bn=b,e.util.markAsUncloneable(this)}get wasClean(){return e.brandCheck(this,e.is.CloseEvent),this.#bn.wasClean}get code(){return e.brandCheck(this,e.is.CloseEvent),this.#bn.code}get reason(){return e.brandCheck(this,e.is.CloseEvent),this.#bn.reason}static{e.is.CloseEvent=a=>null!=a&&"object"==typeof a&&#bn in a}}class j extends Event{#bn;constructor(a,b){const c="ErrorEvent constructor";e.argumentLengthCheck(arguments,1,c),super(a,b),e.util.markAsUncloneable(this),a=e.converters.DOMString(a,c,"type"),b=e.converters.ErrorEventInit(b??{}),this.#bn=b}get message(){return e.brandCheck(this,e.is.ErrorEvent),this.#bn.message}get filename(){return e.brandCheck(this,e.is.ErrorEvent),this.#bn.filename}get lineno(){return e.brandCheck(this,e.is.ErrorEvent),this.#bn.lineno}get colno(){return e.brandCheck(this,e.is.ErrorEvent),this.#bn.colno}get error(){return e.brandCheck(this,e.is.ErrorEvent),this.#bn.error}static{e.is.ErrorEvent=a=>null!=a&&"object"==typeof a&&#bn in a}}Object.defineProperties(h.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:f,origin:f,lastEventId:f,source:f,ports:f,initMessageEvent:f}),Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:f,code:f,wasClean:f}),Object.defineProperties(j.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:f,filename:f,lineno:f,colno:f,error:f}),e.converters.MessagePort=e.interfaceConverter(e.is.MessagePort,"MessagePort"),e.converters["sequence<MessagePort>"]=e.sequenceConverter(e.converters.MessagePort);let k=[{key:"bubbles",converter:e.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:e.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:e.converters.boolean,defaultValue:()=>!1}];e.converters.MessageEventInit=e.dictionaryConverter([...k,{key:"data",converter:e.converters.any,defaultValue:()=>null},{key:"origin",converter:e.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:e.converters.DOMString,defaultValue:()=>""},{key:"source",converter:e.nullableConverter(e.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:e.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),e.converters.CloseEventInit=e.dictionaryConverter([...k,{key:"wasClean",converter:e.converters.boolean,defaultValue:()=>!1},{key:"code",converter:e.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:e.converters.USVString,defaultValue:()=>""}]),e.converters.ErrorEventInit=e.dictionaryConverter([...k,{key:"message",converter:e.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:e.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:e.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:e.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:e.converters.any}]),a.exports={MessageEvent:h,CloseEvent:i,ErrorEvent:j,createFastMessageEvent:d}},52039:(a,b,c)=>{"use strict";let d,{isArrayBuffer:e}=c(73429),{webidl:f}=c(32984),{URLSerializer:g}=c(16537),{environmentSettingsObject:h}=c(42425),{staticPropertyDescriptors:i,states:j,sentCloseFrameState:k,sendHints:l,opcodes:m}=c(62026),{isConnecting:n,isEstablished:o,isClosing:p,isClosed:q,isValidSubprotocol:r,fireEvent:s,utf8Decode:t,toArrayBuffer:u,getURLRecord:v}=c(94050),{establishWebSocketConnection:w,closeWebSocketConnection:x,failWebsocketConnection:y}=c(4654),{ByteParser:z}=c(64821),{kEnumerableProperty:A}=c(84285),{getGlobalDispatcher:B}=c(59970),{ErrorEvent:C,CloseEvent:D,createFastMessageEvent:E}=c(51753),{SendQueue:F}=c(54849),{WebsocketFrameSend:G}=c(45221),{channels:H}=c(62571),I=Symbol.for("nodejs.ref"),J=Symbol.for("nodejs.unref");class K extends EventTarget{#a8={open:null,error:null,close:null,message:null};#bo=0;#bp="";#bq="";#br=!0;#bs;#aQ={onConnectionEstablished:(a,b)=>this.#aR(a,b),onMessage:(a,b)=>this.#aS(a,b),onParserError:a=>y(this.#aQ,null,a.message),onParserDrain:()=>this.#bt(),onSocketData:a=>{this.#aT.write(a)||this.#aQ.socket.pause()},onSocketError:a=>{this.#aQ.readyState=j.CLOSING,H.socketError.hasSubscribers&&H.socketError.publish(a),this.#aQ.socket.destroy()},onSocketClose:()=>this.#aU(),onPing:a=>{H.ping.hasSubscribers&&H.ping.publish({payload:a,websocket:this})},onPong:a=>{H.pong.hasSubscribers&&H.pong.publish({payload:a,websocket:this})},readyState:j.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#aJ;#bu;#aT;constructor(a,b=[]){super(),f.util.markAsUncloneable(this);const c="WebSocket constructor";f.argumentLengthCheck(arguments,1,c);const d=f.converters["DOMString or sequence<DOMString> or WebSocketInit"](b,c,"options");a=f.converters.USVString(a),b=d.protocols;const e=v(a,h.settingsObject.baseUrl);if("string"==typeof b&&(b=[b]),b.length!==new Set(b.map(a=>a.toLowerCase())).size||b.length>0&&!b.every(a=>r(a)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#aJ=new URL(e.href);const g=h.settingsObject;this.#aQ.controller=w(e,b,g,this.#aQ,d),this.#aQ.readyState=K.CONNECTING,this.#bu="blob"}[I](){this.#br=!0,this.#aQ.socket?.ref?.()}[J](){this.#br=!1,this.#aQ.socket?.unref?.()}close(a,b){f.brandCheck(this,f.is.WebSocket),void 0!==a&&(a=f.converters["unsigned short"](a,"WebSocket.close","code",f.attributes.Clamp)),void 0!==b&&(b=f.converters.USVString(b)),a??=null,b??="",x(this.#aQ,a,b,!0)}send(a){f.brandCheck(this,f.is.WebSocket);let b="WebSocket.send";if(f.argumentLengthCheck(arguments,1,b),a=f.converters.WebSocketSendData(a,b,"data"),n(this.#aQ.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!o(this.#aQ.readyState)||p(this.#aQ.readyState)))if("string"==typeof a){let b=Buffer.from(a);this.#bo+=b.byteLength,this.#bs.add(b,()=>{this.#bo-=b.byteLength},l.text)}else e(a)?(this.#bo+=a.byteLength,this.#bs.add(a,()=>{this.#bo-=a.byteLength},l.arrayBuffer)):ArrayBuffer.isView(a)?(this.#bo+=a.byteLength,this.#bs.add(a,()=>{this.#bo-=a.byteLength},l.typedArray)):f.is.Blob(a)&&(this.#bo+=a.size,this.#bs.add(a,()=>{this.#bo-=a.size},l.blob))}get readyState(){return f.brandCheck(this,f.is.WebSocket),this.#aQ.readyState}get bufferedAmount(){return f.brandCheck(this,f.is.WebSocket),this.#bo}get url(){return f.brandCheck(this,f.is.WebSocket),g(this.#aJ)}get extensions(){return f.brandCheck(this,f.is.WebSocket),this.#bq}get protocol(){return f.brandCheck(this,f.is.WebSocket),this.#bp}get onopen(){return f.brandCheck(this,f.is.WebSocket),this.#a8.open}set onopen(a){f.brandCheck(this,f.is.WebSocket),this.#a8.open&&this.removeEventListener("open",this.#a8.open);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("open",b),this.#a8.open=a):this.#a8.open=null}get onerror(){return f.brandCheck(this,f.is.WebSocket),this.#a8.error}set onerror(a){f.brandCheck(this,f.is.WebSocket),this.#a8.error&&this.removeEventListener("error",this.#a8.error);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("error",b),this.#a8.error=a):this.#a8.error=null}get onclose(){return f.brandCheck(this,f.is.WebSocket),this.#a8.close}set onclose(a){f.brandCheck(this,f.is.WebSocket),this.#a8.close&&this.removeEventListener("close",this.#a8.close);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("close",b),this.#a8.close=a):this.#a8.close=null}get onmessage(){return f.brandCheck(this,f.is.WebSocket),this.#a8.message}set onmessage(a){f.brandCheck(this,f.is.WebSocket),this.#a8.message&&this.removeEventListener("message",this.#a8.message);let b=f.converters.EventHandlerNonNull(a);null!==b?(this.addEventListener("message",b),this.#a8.message=a):this.#a8.message=null}get binaryType(){return f.brandCheck(this,f.is.WebSocket),this.#bu}set binaryType(a){f.brandCheck(this,f.is.WebSocket),"blob"!==a&&"arraybuffer"!==a?this.#bu="blob":this.#bu=a}#aR(a,b){this.#aQ.socket=a.socket,this.#br||this.#aQ.socket.unref?.();let c=this.#aQ.controller.dispatcher?.webSocketOptions?.maxFragments,d=this.#aQ.controller.dispatcher?.webSocketOptions?.maxPayloadSize,e=new z(this.#aQ,b,{maxFragments:c,maxPayloadSize:d});e.on("drain",()=>this.#aQ.onParserDrain()),e.on("error",a=>this.#aQ.onParserError(a)),this.#aT=e,this.#bs=new F(a.socket),this.#aQ.readyState=j.OPEN;let f=a.headersList.get("sec-websocket-extensions");null!==f&&(this.#bq=f);let g=a.headersList.get("sec-websocket-protocol");if(null!==g&&(this.#bp=g),s("open",this),H.open.hasSubscribers){var h;let b=a.headersList.entries;H.open.publish({address:(h=a.socket,"function"==typeof h?.address?h.address():"function"==typeof h?.session?.socket?.address?h.session.socket.address():null),protocol:this.#bp,extensions:this.#bq,websocket:this,handshakeResponse:{status:a.status,statusText:a.statusText,headers:b}})}}#aS(a,b){let c;if(this.#aQ.readyState===j.OPEN){if(a===m.TEXT)try{c=t(b)}catch{y(this.#aQ,1007,"Received invalid UTF-8 in text frame.");return}else a===m.BINARY&&(c="blob"===this.#bu?new Blob([b]):u(b));s("message",this,E,{origin:this.#aJ.origin,data:c})}}#bt(){this.#aQ.socket.resume()}#aU(){let a=this.#aQ.closeState.has(k.SENT)&&this.#aQ.closeState.has(k.RECEIVED),b=1005,c="",d=this.#aT?.closingInfo;d&&!d.error&&(b=d.code??1005,c=d.reason),this.#aQ.readyState=j.CLOSED,this.#aQ.closeState.has(k.RECEIVED)||(b=1006,s("error",this,(a,b)=>new C(a,b),{error:TypeError(c)})),s("close",this,(a,b)=>new D(a,b),{wasClean:a,code:b,reason:c}),H.close.hasSubscribers&&H.close.publish({websocket:this,code:b,reason:c})}static{d=(a,b)=>{if(Buffer.isBuffer(b)){if(b.length>125)throw TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(void 0!==b)throw TypeError("Expected buffer payload");let c=a.#aQ.readyState;if(o(c)&&!p(c)&&!q(c)){let c=new G(b);a.#aQ.socket.write(c.createFrame(m.PING))}},f.is.WebSocket=a=>null!=a&&"object"==typeof a&&#aQ in a}}K.CONNECTING=K.prototype.CONNECTING=j.CONNECTING,K.OPEN=K.prototype.OPEN=j.OPEN,K.CLOSING=K.prototype.CLOSING=j.CLOSING,K.CLOSED=K.prototype.CLOSED=j.CLOSED,Object.defineProperties(K.prototype,{CONNECTING:i,OPEN:i,CLOSING:i,CLOSED:i,url:A,readyState:A,bufferedAmount:A,onopen:A,onerror:A,onclose:A,close:A,onmessage:A,binaryType:A,send:A,extensions:A,protocol:A,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(K,{CONNECTING:i,OPEN:i,CLOSING:i,CLOSED:i}),f.converters["sequence<DOMString>"]=f.sequenceConverter(f.converters.DOMString),f.converters["DOMString or sequence<DOMString>"]=function(a,b,c){return f.util.Type(a)===f.util.Types.OBJECT&&Symbol.iterator in a?f.converters["sequence<DOMString>"](a):f.converters.DOMString(a,b,c)},f.converters.WebSocketInit=f.dictionaryConverter([{key:"protocols",converter:f.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:f.converters.any,defaultValue:()=>B()},{key:"headers",converter:f.nullableConverter(f.converters.HeadersInit)}]),f.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(a){return f.util.Type(a)!==f.util.Types.OBJECT||Symbol.iterator in a?{protocols:f.converters["DOMString or sequence<DOMString>"](a)}:f.converters.WebSocketInit(a)},f.converters.WebSocketSendData=function(a){return f.util.Type(a)===f.util.Types.OBJECT&&(f.is.Blob(a)||f.is.BufferSource(a))?a:f.converters.USVString(a)},a.exports={WebSocket:K,ping:d}},52655:(a,b,c)=>{"use strict";function d(a){return void 0===a?`call_${Date.now()}`:`call_${a}_${Date.now()}`}function e(a){let b=a?.request||a||{},c=b.toolConfig?.functionCallingConfig?.mode;if(!c)return;let d=b.toolConfig.functionCallingConfig.allowedFunctionNames;return"NONE"===c?"none":"ANY"===c?Array.isArray(d)&&1===d.length?{type:"function",function:{name:d[0]}}:"required":"AUTO"===c||"VALIDATED"===c?"auto":void 0}function f(a=0,b=0,c=""){let d=c?`_${c.replace(/[^a-zA-Z0-9_-]/g,"")}`:"";return`call_msg${a}_tc${b}${d}`}c.d(b,{Fq:()=>e,J4:()=>f,eG:()=>d})},52748:(a,b,c)=>{"use strict";var d=c(68531);c(87350),c(18762),c(20830),c(38421),c(82689),c(73081),c(81556),c(17438),c(19016),d.h.OPENAI_RESPONSES,d.h.OPENAI_RESPONSES,d.h.CLAUDE,d.h.CLAUDE,d.h.ANTIGRAVITY,d.h.ANTIGRAVITY,d.h.GEMINI,d.h.ANTIGRAVITY,d.h.GEMINI_CLI,d.h.ANTIGRAVITY},53552:(a,b,c)=>{"use strict";let{InvalidArgumentError:d}=c(61448),e=c(40106);class f extends e{constructor(a,b){if("string"==typeof a&&(a=new URL(a)),"http:"!==a.protocol)throw new d("h2c-client: Only h2c protocol is supported");const{maxConcurrentStreams:c,pipelining:e,...f}=b??{},g=c??100;let h=100;if(null!=c&&(!Number.isInteger(c)||c<1))throw new d("maxConcurrentStreams must be a positive integer, greater than 0");if(null!=e&&Number.isInteger(e)&&e>0&&(h=e),h>g)throw new d("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(a,{...f,maxConcurrentStreams:g,pipelining:h,allowH2:!0,useH2c:!0})}}a.exports=f},53859:(a,b,c)=>{"use strict";c.d(b,{nJ:()=>p,ok:()=>o});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="switchboard";function k(a){if("win32"===process.platform){let b=process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming");return g().join(b,a)}return g().join(i().homedir(),`.${a}`)}let l=["db/data.sqlite","machine-id","jwt-secret","auth","db.json"];function m(a){return l.some(b=>e().existsSync(g().join(a,b)))}function n(){let a=k(j);if(m(a))return a;let b=k("9router");return m(b)?(console.warn(`[DATA_DIR] using legacy data directory '${b}' (set DATA_DIR='${a}' to switch)`),b):a}function o(){let a=process.env.DATA_DIR;if(!a)return n();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),n();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),n();throw b}}let p=o()},54383:(a,b,c)=>{"use strict";c.d(b,{R:()=>f});var d=c(85513);let e=/^arn:(aws|aws-us-gov):codewhisperer:([^:]+):(\d{12}):profile\/([^/]+)$/;function f(a){let b="string"==typeof a?a.trim():"",c=b.match(e);return c&&(0,d.i7)(c[2])?{profileArn:b,region:c[2]}:null}},54849:(a,b,c)=>{"use strict";let{WebsocketFrameSend:d}=c(45221),{opcodes:e,sendHints:f}=c(62026),g=c(50329);class h{#bv=new g;#bw=!1;#bx;constructor(a){this.#bx=a}add(a,b,c){if(c!==f.blob){if(this.#bw){let d={promise:null,callback:b,frame:i(a,c)};this.#bv.push(d)}else if(c===f.text){let{0:c,1:e}=d.createFastTextFrame(a);this.#bx.cork(),this.#bx.write(c),this.#bx.write(e,b),this.#bx.uncork()}else this.#bx.write(i(a,c),b);return}let e={promise:a.arrayBuffer().then(a=>{e.promise=null,e.frame=i(a,c)}),callback:b,frame:null};this.#bv.push(e),this.#bw||this.#by()}async #by(){this.#bw=!0;let a=this.#bv;for(;!a.isEmpty();){let b=a.shift();null!==b.promise&&await b.promise,this.#bx.write(b.frame,b.callback),b.callback=b.frame=null}this.#bw=!1}}function i(a,b){return new d(function(a,b){switch(b){case f.text:case f.typedArray:return new Uint8Array(a.buffer,a.byteOffset,a.byteLength);case f.arrayBuffer:case f.blob:return new Uint8Array(a)}}(a,b)).createFrame(b===f.text?e.TEXT:e.BINARY)}a.exports={SendQueue:h}},55261:(a,b,c)=>{},55285:(a,b,c)=>{"use strict";let d,e=c(77030),f=c(34589),g=c(84285),{InvalidArgumentError:h,ConnectTimeoutError:i}=c(61448),j=class{constructor(a){this._maxCachedSessions=a,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(a=>{if(this._sessionCache.size<this._maxCachedSessions)return;let b=this._sessionCache.get(a);void 0!==b&&void 0===b.deref()&&this._sessionCache.delete(a)})}get(a){let b=this._sessionCache.get(a);return b?b.deref():null}set(a,b){if(0!==this._maxCachedSessions){if(this._sessionCache.has(a))this._sessionCache.delete(a);else if(this._sessionCache.size>=this._maxCachedSessions){for(let[a,b]of this._sessionCache)if(void 0===b.deref())return void this._sessionCache.delete(a);let a=this._sessionCache.keys().next();a.done||this._sessionCache.delete(a.value)}this._sessionCache.set(a,new WeakRef(b)),this._sessionRegistry.register(b,a)}}};a.exports=function({allowH2:a,preferH2:b,useH2c:k,maxCachedSessions:l,socketPath:m,timeout:n,session:o,...p}){if(null!=l&&(!Number.isInteger(l)||l<0))throw new h("maxCachedSessions must be a positive integer or zero");let q={path:m,...p},r=new j(null==l?100:l);return n=null==n?1e4:n,a=null==a||a,function({hostname:h,host:j,protocol:l,port:m,servername:p,localAddress:s,httpSocket:t},u){let v;if("https:"===l){d||(d=c(41692));let e=(p=p||q.servername||g.getServerName(j)||null)||h;f(e);let i=o||r.get(e)||null;m=m||443,(v=d.connect({highWaterMark:16384,...q,servername:p,session:i,localAddress:s,ALPNProtocols:a?b?["h2","http/1.1"]:["http/1.1","h2"]:["http/1.1"],socket:t,port:m,host:h})).on("session",function(a){r.set(e,a)})}else{f(!t,"httpSocket can only be sent on TLS update"),m=m||80;let a={highWaterMark:65536,...q,localAddress:s,port:m,host:h},b=e.isIP(h);0!==b&&p&&p!==h&&(a.host=p,a.lookup=(a,c,d)=>{c.all?d(null,[{address:h,family:b}]):d(null,h,b)}),v=e.connect(a),!0===k&&(v.alpnProtocol="h2")}if(null==q.keepAlive||q.keepAlive){let a=void 0===q.keepAliveInitialDelay?6e4:q.keepAliveInitialDelay;v.setKeepAlive(!0,a)}let w=g.setupConnectTimeout(new WeakRef(v),{timeout:n,hostname:h,port:m});return v.setNoDelay(!0).once("https:"===l?"secureConnect":"connect",function(){if(queueMicrotask(w),u){let a=u;u=null,a(null,this)}}).on("error",function(a){if(queueMicrotask(w),u){let b=u;u=null,b(function(a,b,c){if(a instanceof AggregateError&&("ETIMEDOUT"===a.code||a.errors.some(a=>null!=a&&"ETIMEDOUT"===a.code))){let d="Connect Timeout Error";Array.isArray(b.autoSelectFamilyAttemptedAddresses)?d+=` (attempted addresses: ${b.autoSelectFamilyAttemptedAddresses.join(", ")},`:d+=` (attempted address: ${c.hostname}:${c.port},`;let e=new i(d+=` timeout: ${c.timeout}ms)`);return e.cause=a,e}return a}(a,this,{timeout:n,hostname:h,port:m}))}}),v}}},55720:(a,b,c)=>{"use strict";let{getResponseData:d,buildKey:e,addMockDispatch:f}=c(70634),{kDispatches:g,kDispatchKey:h,kDefaultHeaders:i,kDefaultTrailers:j,kContentLength:k,kMockDispatch:l,kIgnoreTrailingSlash:m}=c(80830),{InvalidArgumentError:n}=c(61448),{serializePathWithQuery:o}=c(84285),{types:{isPromise:p}}=c(57975);class q{constructor(a){this[l]=a}delay(a){if("number"!=typeof a||!Number.isInteger(a)||a<=0)throw new n("waitInMs must be a valid integer > 0");return this[l].delay=a,this}persist(){return this[l].persist=!0,this}times(a){if("number"!=typeof a||!Number.isInteger(a)||a<=0)throw new n("repeatTimes must be a valid integer > 0");return this[l].times=a,this}}class r{constructor(a,b){if("object"!=typeof a)throw new n("opts must be an object");if(void 0===a.path)throw new n("opts.path must be defined");if(void 0===a.method&&(a.method="GET"),"string"==typeof a.path)if(a.query)a.path=o(a.path,a.query);else{const b=new URL(a.path,"data://");a.path=b.pathname+b.search}"string"==typeof a.method&&(a.method=a.method.toUpperCase()),this[h]=e(a),this[g]=b,this[m]=a.ignoreTrailingSlash??!1,this[i]={},this[j]={},this[k]=!1}createMockScopeDispatchData({statusCode:a,data:b,responseOptions:c}){let e=d(b),f=this[k]?{"content-length":e.length}:{};return{statusCode:a,data:b,headers:{...this[i],...f,...c.headers},trailers:{...this[j],...c.trailers}}}validateReplyParameters(a){if(void 0===a.statusCode)throw new n("statusCode must be defined");if("object"!=typeof a.responseOptions||null===a.responseOptions)throw new n("responseOptions must be an object")}reply(a){if("function"==typeof a){let b=a=>{if("object"!=typeof a||null===a)throw new n("reply options callback must return an object");let b={data:"",responseOptions:{},...a};return this.validateReplyParameters(b),{...this.createMockScopeDispatchData(b)}};return new q(f(this[g],this[h],c=>{let d=a(c);return p(d)?d.then(b):b(d)},{ignoreTrailingSlash:this[m]}))}let b={statusCode:a,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(b);let c=this.createMockScopeDispatchData(b);return new q(f(this[g],this[h],c,{ignoreTrailingSlash:this[m]}))}replyWithError(a){if(void 0===a)throw new n("error must be defined");return new q(f(this[g],this[h],{error:a},{ignoreTrailingSlash:this[m]}))}defaultReplyHeaders(a){if(void 0===a)throw new n("headers must be defined");return this[i]=a,this}defaultReplyTrailers(a){if(void 0===a)throw new n("trailers must be defined");return this[j]=a,this}replyContentLength(){return this[k]=!0,this}}a.exports.MockInterceptor=r,a.exports.MockScope=q},56416:(a,b,c)=>{var d=c(45654);c(63070),c(33889);var e=d.asn1,f=a.exports=d.pkcs7asn1=d.pkcs7asn1||{};d.pkcs7=d.pkcs7||{},d.pkcs7.asn1=f;var g={name:"ContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};f.contentInfoValidator=g;var h={name:"EncryptedContentInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};f.envelopedDataValidator={name:"EnvelopedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(h)},f.encryptedDataValidator={name:"EncryptedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"}].concat(h)};var i={name:"SignerInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};f.signedDataValidator={name:"SignedData",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},g,{name:"SignedData.Certificates",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,capture:"signerInfos",optional:!0,value:[i]}]},f.recipientInfoValidator={name:"RecipientInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:e.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},56698:(a,b,c)=>{"use strict";let d=c(34589);class e{#bz=!1;#bA;#aQ;#bB;#bC;constructor(a,b,c){if("function"!=typeof a)throw TypeError("callback must be a function");this.#bA=a,this.#aQ=b,this.#bC=c}onRequestStart(a,b){this.#bz=!1,this.#bB=b}onRequestUpgrade(a,b,c,d){this.#aQ.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,e){if(d(null!=this.#bA),this.#bz=304===b||this.#bC&&b>=500&&b<=504,this.#bA(this.#bz,this.#bB,b,c),this.#bA=null,this.#bz)return!0;this.#aQ.onRequestStart?.(a,this.#bB),this.#aQ.onResponseStart?.(a,b,c,e)}onResponseData(a,b){if(!this.#bz)return this.#aQ.onResponseData?.(a,b)}onResponseEnd(a,b){this.#bz||this.#aQ.onResponseEnd?.(a,b)}onResponseError(a,b){if(!this.#bz){if(this.#bA){if(this.#bC){this.#bz=!0,this.#bA(!0,this.#bB),this.#bA=null;return}this.#bA(!1),this.#bA=null}if("function"==typeof this.#aQ.onResponseError)this.#aQ.onResponseError(a,b);else throw b}}}a.exports=e},56758:(a,b,c)=>{"use strict";let d={__proto__:null,"node:crypto":()=>c(77598),"node:sqlite":()=>c(79868)},e=["crypto","sqlite"];class f{#bD=new Map;clear(){this.#bD.clear()}has(a){return this.#bD.get(a)??this.#bE(a)}set(a,b){if(!1===e.includes(a))throw TypeError(`unknown feature: ${a}`);this.#bD.set(a,b)}#bE(a){let b=function(a){if(e.includes(a)){var b=`node:${a}`;try{return d[b](),!0}catch(a){if("ERR_UNKNOWN_BUILTIN_MODULE"!==a.code&&"ERR_NO_CRYPTO"!==a.code)throw a;return!1}}throw TypeError(`unknown feature: ${a}`)}(a);return this.#bD.set(a,b),b}}let g=new f;a.exports.runtimeFeatures=g,a.exports.default=g},57431:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CLIENT_KEY_POLICY_BOUNDS:()=>i,__resetApiKeyVerifyMemoForTests:()=>t,authenticateApiKey:()=>A,createApiKey:()=>x,deleteApiKey:()=>z,getApiKeyById:()=>w,getApiKeys:()=>v,getClientKeySpend:()=>u,normalizeClientKeyPatch:()=>o,updateApiKey:()=>y,validateApiKey:()=>B});var d=c(77598),e=c.n(d),f=c(27137),g=c(24081),h=c(20639);let i=Object.freeze({maxAllowlistEntries:100,maxTargetLength:256,maxRatePerMinute:6e4,maxConcurrency:1e3,maxSpendUsd:1e6}),j=new Set(["name","isActive","allowedModels","allowedCombos","expiresAt","rateLimitPerMinute","concurrencyLimit","spendLimitUsd"]);function k(a){if(Array.isArray(a))return a;if("string"!=typeof a||""===a)return[];try{let b=JSON.parse(a);return Array.isArray(b)?b:[]}catch{return[]}}function l(a){if(!a)return null;let b=(0,h.BA)(a.key);return{id:a.id,keyPrefix:b.prefix||"sk-…",name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,createdAt:a.createdAt,rotationRequired:2!==b.version||!b.lookupDigest,allowedModels:k(a.allowedModels),allowedCombos:k(a.allowedCombos),expiresAt:a.expiresAt||null,rateLimitPerMinute:null==a.rateLimitPerMinute?null:Number(a.rateLimitPerMinute),concurrencyLimit:null==a.concurrencyLimit?null:Number(a.concurrencyLimit),spendLimitUsd:null==a.spendLimitUsd?null:Number(a.spendLimitUsd),spentUsd:Number(a.spentUsd||0)}}function m(a,b){if(null==b)return[];if(!Array.isArray(b))throw Error(`${a} must be an array`);if(b.length>i.maxAllowlistEntries)throw Error(`${a} must contain at most ${i.maxAllowlistEntries} entries`);let c=[],d=new Set;for(let e of b){if("string"!=typeof e)throw Error(`${a} entries must be strings`);let b=e.trim();if(!b)throw Error(`${a} entries must not be empty`);if(b.length>i.maxTargetLength)throw Error(`${a} entry length exceeds ${i.maxTargetLength}`);d.has(b)||(d.add(b),c.push(b))}return c}function n(a,b,c){if(null==b||""===b)return null;if(!Number.isInteger(b)||b<1||b>c)throw Error(`${a} must be an integer from 1 through ${c}`);return b}function o(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("client key patch must be an object");for(let b of Object.keys(a))if(!j.has(b))throw Error(`unknown client key field: ${b}`);let b={};if(Object.hasOwn(a,"name")){if("string"!=typeof a.name)throw Error("name must be a string");b.name=a.name}if(Object.hasOwn(a,"isActive")){if("boolean"!=typeof a.isActive)throw Error("isActive must be a boolean");b.isActive=a.isActive}if(Object.hasOwn(a,"allowedModels")&&(b.allowedModels=m("allowedModels",a.allowedModels)),Object.hasOwn(a,"allowedCombos")&&(b.allowedCombos=m("allowedCombos",a.allowedCombos)),Object.hasOwn(a,"expiresAt"))if(null==a.expiresAt||""===a.expiresAt)b.expiresAt=null;else{if("string"!=typeof a.expiresAt||!/^\d{4}-\d{2}-\d{2}T.*(?:Z|[+-]\d{2}:\d{2})$/.test(a.expiresAt))throw Error("expiresAt must be a valid ISO instant");let c=new Date(a.expiresAt);if(Number.isNaN(c.getTime()))throw Error("expiresAt must be a valid ISO instant");b.expiresAt=c.toISOString()}if(Object.hasOwn(a,"rateLimitPerMinute")&&(b.rateLimitPerMinute=n("rateLimitPerMinute",a.rateLimitPerMinute,i.maxRatePerMinute)),Object.hasOwn(a,"concurrencyLimit")&&(b.concurrencyLimit=n("concurrencyLimit",a.concurrencyLimit,i.maxConcurrency)),Object.hasOwn(a,"spendLimitUsd")){let c=a.spendLimitUsd;if(null==c||""===c)b.spendLimitUsd=null;else if("number"!=typeof c||!Number.isFinite(c)||c<0||c>i.maxSpendUsd)throw Error(`spendLimitUsd must be finite from 0 through ${i.maxSpendUsd}`);else b.spendLimitUsd=c}return b}let p="SELECT k.* FROM apiKeys k",q=new Map;function r(a,b,c){if(q.has(a))q.delete(a);else if(q.size>=256){let a=q.keys().next().value;void 0!==a&&q.delete(a)}q.set(a,{rawSha256:b,id:c,expiresAt:Date.now()+6e4})}function s(a){for(let[b,c]of q)c.id===a&&q.delete(b)}function t(){q.clear()}async function u(a){let b=(await (0,g.c)()).get("SELECT spentUsd FROM apiKeys WHERE id = ?",[a]);return Number(b?.spentUsd||0)}async function v(){return(await (0,g.c)()).all(`${p} ORDER BY k.createdAt ASC`).map(l)}async function w(a){return l((await (0,g.c)()).get(`${p} WHERE k.id = ?`,[a]))}async function x(a,b){if(!b)throw Error("machineId is required");let d=await (0,g.c)(),{generateApiKeyWithMachine:e}=await c.e(6103).then(c.bind(c,86103)),i=e(b),j=(0,h.ws)(i.key),k={id:(0,f.A)(),key:j,name:a,machineId:b,isActive:1,createdAt:new Date().toISOString(),allowedModels:null,allowedCombos:null,expiresAt:null,rateLimitPerMinute:null,concurrencyLimit:null,spendLimitUsd:null,spentUsd:0};return d.run(`INSERT INTO apiKeys(id, key, keyPrefix, lookupDigest, name, machineId, isActive, createdAt, allowedModels, allowedCombos, expiresAt, rateLimitPerMinute, concurrencyLimit, spendLimitUsd, spentUsd)
|
|
366
366
|
VALUES(?, ?, ?, ?, ?, ?, 1, ?, NULL, NULL, NULL, NULL, NULL, NULL, 0)`,[k.id,j,(0,h.E8)(i.key),(0,h.cb)(i.key),a,b,k.createdAt]),{...l(k),key:i.key}}async function y(a,b){let c=o(b),d=await (0,g.c)(),e=null;return d.transaction(()=>{let b=d.get(`${p} WHERE k.id = ?`,[a]);if(!b)return;let f={...l(b),...c};d.run(`UPDATE apiKeys
|
|
367
367
|
SET name = ?, isActive = ?, allowedModels = ?, allowedCombos = ?, expiresAt = ?, rateLimitPerMinute = ?, concurrencyLimit = ?, spendLimitUsd = ?
|
|
368
|
-
WHERE id = ?`,[f.name,+!!f.isActive,JSON.stringify(f.allowedModels),JSON.stringify(f.allowedCombos),f.expiresAt,f.rateLimitPerMinute,f.concurrencyLimit,f.spendLimitUsd,a]),e={...f}}),e&&s(a),e}async function z(a){let b=await (0,g.c)(),c=(b.run("DELETE FROM apiKeys WHERE id = ?",[a])?.changes??0)>0;return c&&s(a),c}async function A(a){if(!a||"string"!=typeof a)return null;let b=await (0,g.c)(),c=(0,h.cb)(a),d=(0,h.E8)(a),f=c?e().createHash("sha256").update(a).digest("hex"):null;if(c&&f){let a,d=(a=q.get(c))?a.expiresAt<=Date.now()?(q.delete(c),null):(0,h.lO)(a.rawSha256,f)?(q.delete(c),q.set(c,a),a):null:null;if(d){let a=b.get(`${p} WHERE k.id = ?`,[d.id]);if(a&&(1===a.isActive||!0===a.isActive))return a.spentUsd=await u(a.id),l(a);q.delete(c)}}let i=c?b.get(`${p} WHERE k.isActive = 1 AND k.lookupDigest = ?`,[c]):null;if(i)return(2===(0,h.BA)(i.key).version?await (0,h.ue)(i.key,a):(0,h.O0)(i.key,a))?(c&&f&&r(c,f,i.id),i.spentUsd=await u(i.id),l(i)):null;for(let e of b.all(`${p} WHERE k.isActive = 1 AND k.lookupDigest IS NULL AND k.keyPrefix = ? AND k.key NOT LIKE 'v2:%'`,[d])){let d=(0,h.BA)(e.key);if((0,h.O0)(e.key,a)){if(d.legacy||1===d.version&&c){let d=(0,h.ws)(a,c);b.run("UPDATE apiKeys SET key = ?, keyPrefix = ?, lookupDigest = ? WHERE id = ?",[d,(0,h.E8)(a),c,e.id]),c&&q.delete(c),e.key=d,e.keyPrefix=(0,h.E8)(a),e.lookupDigest=c}return c&&f&&r(c,f,e.id),e.spentUsd=await u(e.id),l(e)}}return null}async function B(a){return!!await A(a)}},57435:(a,b,c)=>{"use strict";let{Readable:d,Duplex:e,PassThrough:f}=c(57075),g=c(34589),{AsyncResource:h}=c(16698),{InvalidArgumentError:i,InvalidReturnValueError:j,RequestAbortedError:k}=c(61448),l=c(84285),{kBodyUsed:m}=c(49176),{addSignal:n,removeSignal:o}=c(73135);function p(){}let q=Symbol("resume");class r extends d{constructor(){super({autoDestroy:!0}),this[q]=null,this[m]=!0}_read(){let{[q]:a}=this;a&&(this[q]=null,a())}_destroy(a,b){this._read(),b(a)}}class s extends d{constructor(a){super({autoDestroy:!0}),this[q]=a}_read(){this[q]()}_destroy(a,b){a||this._readableState.endEmitted||(a=new k),b(a)}}class t extends h{constructor(a,b){if(!a||"object"!=typeof a)throw new i("invalid opts");if("function"!=typeof b)throw new i("invalid handler");const{signal:c,method:d,opaque:f,onInfo:g,responseHeaders:h}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===d)throw new i("invalid method");if(g&&"function"!=typeof g)throw new i("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=f||null,this.responseHeaders=h||null,this.handler=b,this.abort=null,this.context=null,this.onInfo=g||null,this.req=new r().on("error",p),this.ret=new e({readableObjectMode:a.objectMode,autoDestroy:!0,read:()=>{let{body:a}=this;a?.resume&&a.resume()},write:(a,b,c)=>{let{req:d}=this;d.push(a,b)||d._readableState.destroyed?c():d[q]=c},destroy:(a,b)=>{let{body:c,req:d,res:e,ret:f,abort:g}=this;a||f._readableState.endEmitted||(a=new k),g&&a&&g(),l.destroy(c,a),l.destroy(d,a),l.destroy(e,a),o(this),b(a)}}).on("prefinish",()=>{let{req:a}=this;a.push(null)}),this.res=null,n(this,c)}onRequestStart(a,b){let{res:c}=this;this.reason?a.abort(this.reason):(g(!c,"pipeline cannot be retried"),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){let e,{opaque:f,handler:g,context:h}=this;if(b<200){if(this.onInfo){let d=a?.rawHeaders,e="raw"===this.responseHeaders?l.parseRawHeaders(d):c;this.onInfo({statusCode:b,headers:e})}return}this.res=new s(()=>a.resume());try{this.handler=null;let d=a?.rawHeaders,i="raw"===this.responseHeaders?l.parseRawHeaders(d):c;e=this.runInAsyncScope(g,null,{statusCode:b,headers:i,opaque:f,body:this.res,context:h})}catch(a){throw this.res.on("error",p),a}if(!e||"function"!=typeof e.on)throw new j("expected Readable");e.on("data",a=>{let{ret:b,body:c}=this;!b.push(a)&&c.pause&&c.pause()}).on("error",a=>{let{ret:b}=this;l.destroy(b,a)}).on("end",()=>{let{ret:a}=this;a.push(null)}).on("close",()=>{let{ret:a}=this;a._readableState.ended||l.destroy(a,new k)}),this.body=e}onResponseData(a,b){let{res:c}=this;!1===c.push(b)&&a.pause()}onResponseEnd(a,b){let{res:c}=this;c.push(null)}onResponseError(a,b){let{ret:c}=this;this.handler=null,l.destroy(c,b)}}a.exports=function(a,b){try{let c=new t(a,b);return this.dispatch({...a,body:c.req},c),c.ret}catch(a){return new f().destroy(a)}}},57690:(a,b,c)=>{"use strict";let d;c.d(b,{KN:()=>m,uV:()=>n});let e={pricing:{},capabilities:{}};function f(a,b){if(!a)throw Error(b)}let g=!1;function h(a){if("u"<typeof process)return null;if("function"!=typeof process.getBuiltinModule)return!g&&process.versions?.node&&(g=!0,console.warn(`[switchboard] generated model catalog disabled: process.getBuiltinModule requires Node >= 20.12 (running ${process.versions.node}); falling back to hand-maintained data only`)),null;try{return process.getBuiltinModule(a)}catch{return null}}function i(){return void 0===d&&(d=function(){let a=h("node:fs");if(!a)return e;for(let b of function(){let a=[],b=h("node:path");if(b&&"function"==typeof process.cwd)try{a.push(b.join(process.cwd(),"open-sse","providers","generated","catalog.json"))}catch{}let d=h("node:url");if(d)try{a.push(d.fileURLToPath(new c.U(c(19659))))}catch{}return a}())if("string"==typeof b)try{return function(a){let b=JSON.parse(a);return null===b||"object"!=typeof b?e:{pricing:b.pricing&&"object"==typeof b.pricing?b.pricing:{},capabilities:b.capabilities&&"object"==typeof b.capabilities?b.capabilities:{}}}(a.readFileSync(b,"utf8"))}catch{}return e}()),d}let j=new WeakMap;function k(a){let b=j.get(a);if(!b){for(let c of(b=new Map,Object.keys(a).sort())){let d=c.toLowerCase();b.has(d)||b.set(d,a[c])}j.set(a,b)}return b}function l(a,b){if(!b)return null;f("string"==typeof b,"model must be a string");let c=b.includes("/")?b.split("/").pop():b;return f("string"==typeof c,"model base must be a string"),a[c]||a[b]||k(a).get(c.toLowerCase())||k(a).get(b.toLowerCase())||null}function m(a){return l(i().pricing,a)}function n(a){return l(i().capabilities,a)}},58609:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(24081),e=c(50743);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},59529:(a,b,c)=>{"use strict";c.d(b,{VG:()=>h});var d=c(22256),e=c(38421),f=c(10793),g=c(50969);class h extends d.Hv{constructor(){super("gemini-cli",e.xq["gemini-cli"])}buildUrl(a,b,c=0){return`${this.config.baseUrl}:${b?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0){return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":(0,f.sX)(this._currentModel),"X-Goog-Api-Client":f.go,Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b,c,d){this._currentModel=a;let e=function(a){if(!a||"object"!=typeof a)return a;let{stream:b,...c}=a;if(!c.request||"object"!=typeof c.request)return c;let{stream:d,...e}=c.request;return{...c,request:e}}(b);return e&&e.request&&e.model?e:{project:d?.projectId||e?.project,model:a,request:e}}parseError(a,b){let c=super.parseError(a,b);if(429!==a.status||!b)return c;try{let a=JSON.parse(b),d=a?.error?.details;if(Array.isArray(d)){for(let a of d)if(a?.["@type"]==="type.googleapis.com/google.rpc.RetryInfo"&&a?.retryDelay){c.retryAfter=a.retryDelay;let b=function(a){if("string"==typeof a){let b=a.match(/^(\d+(?:\.\d+)?)s$/);if(!b)return null;let c=Math.round(1e3*Number(b[1]));return Number.isFinite(c)?c:null}if("number"==typeof a)return Number.isFinite(a)?Math.round(1e3*a):null;if(a&&"object"==typeof a){let b=Number(a.seconds||0),c=Number(a.nanos||0);return Number.isFinite(b)&&Number.isFinite(c)?Math.round(1e3*b+c/1e6):null}return null}(a.retryDelay);null!==b&&b>0&&(c.resetsAtMs=Date.now()+b);break}}}catch{}return c}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;try{let d=await (0,g.Fm)(f.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.refreshToken,client_id:this.config.clientId,client_secret:this.config.clientSecret}),identity:this.config.identity,provider:this.provider,format:this.config.format},c);if(!d.ok)return null;let e=await d.json();return b?.info?.("TOKEN","Gemini CLI refreshed"),{accessToken:e.access_token,refreshToken:e.refresh_token||a.refreshToken,expiresIn:e.expires_in,projectId:a.projectId}}catch(a){return b?.error?.("TOKEN",`Gemini CLI refresh error: ${a.message}`),null}}}},59882:(a,b,c)=>{"use strict";c.d(b,{$3:()=>q,$R:()=>i,Dm:()=>s,E$:()=>k,Zb:()=>h,jI:()=>j,ti:()=>n});var d=c(74570),e=c(3507),f=c(48161),g=c(83382);let h=["Accept","Authorization","Content-Type","User-Agent","X-Claude-Code-Session-Id","X-Stainless-Arch","X-Stainless-Lang","X-Stainless-OS","X-Stainless-Package-Version","X-Stainless-Retry-Count","X-Stainless-Runtime","X-Stainless-Runtime-Version","X-Stainless-Timeout","anthropic-beta","anthropic-dangerous-direct-browser-access","anthropic-version","x-app","x-client-request-id","Connection","Host","Accept-Encoding","Content-Length"],i=h.filter(a=>"X-Stainless-Timeout"!==a),j={"claude-cli":{id:"claude-cli",tls:"claude-code",alpn:["http/1.1"],headerOrder:h,source:{npm:"@anthropic-ai/claude-code",capture:"claude-code-native",tlsSpec:"claude-code"},headers:function(a){let b=a?.version||"2.1.289",c=a?.entrypoint||"cli";return{"Anthropic-Version":d.b8,"Anthropic-Beta":a?.betas||"claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,effort-2025-11-24,structured-outputs-2025-12-15","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":a?.userAgent||`claude-cli/${b} (external, ${c})`,"X-App":"cli","X-Stainless-Runtime-Version":a?.runtimeVersion||process.version,"X-Stainless-Package-Version":a?.packageVersion||"0.128.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":a?.arch||(0,e.Tc)(),"X-Stainless-Os":a?.os||(0,e.vv)(),"X-Stainless-Timeout":"600"}}},"codex-cli":{id:"codex-cli",tls:"chrome",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","originator","session_id","User-Agent","version","chatgpt-account-id"],source:{npm:"@openai/codex"},headers:function(a){let b=a?.version||"0.149.0";return{originator:"codex_cli_rs","User-Agent":`codex_cli_rs/${b}`,version:b}}},"gemini-cli":{id:"gemini-cli",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Content-Type","Authorization","User-Agent","X-Goog-Api-Client","Accept"],source:{npm:"@google/gemini-cli"},headers:function(a){let b=a?.version||"0.56.0",c=a?.upstreamModel||"unknown",d="ia32"===(0,e.LY)()?"x86":(0,e.LY)(),f="u">typeof process&&process.version?process.version.replace(/^v/,""):"unknown";return{"User-Agent":`GeminiCLI/${b}/${c} (${(0,e.ol)()}; ${d}; terminal)`,"X-Goog-Api-Client":a?.apiClient||`google-genai-sdk/1.41.0 gl-node/v${f}`}}},"openai-node":{id:"openai-node",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent"],source:{npm:"openai"},headers:function(){return{"User-Agent":`OpenAI/NodeJS/${process.version.replace(/^v/,"")}`}}},cline:{id:"cline",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","HTTP-Referer","X-Title","User-Agent","X-PLATFORM","X-PLATFORM-VERSION","X-CLIENT-TYPE","X-CLIENT-VERSION","X-CORE-VERSION","X-IS-MULTIROOT"],source:{npm:"cline"},headers:function(a){let b=a?.version||"3.0.0";return{"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`Cline/${b}`,"X-PLATFORM":(0,e.ol)()||"unknown","X-PLATFORM-VERSION":a?.platformVersion||(0,f.release)()||"unknown","X-CLIENT-TYPE":"extension","X-CLIENT-VERSION":b,"X-CORE-VERSION":b,"X-IS-MULTIROOT":"false"}}},chrome:{id:"chrome",tls:"chrome",alpn:["h2","http/1.1"],headerOrder:["User-Agent","Accept","Accept-Language","Accept-Encoding"],source:{capture:"chrome"},headers:function(a){let b,c=a?.chromeVersion||"136";return{"User-Agent":`Mozilla/5.0 (${"darwin"===(b=(0,e.ol)())?"Macintosh; Intel Mac OS X 10_15_7":"win32"===b?"Windows NT 10.0; Win64; x64":"X11; Linux x86_64"}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${c}.0.0.0 Safari/537.36`}}},cursor:{id:"cursor",tls:"node",alpn:["h2","http/1.1"],headerOrder:[],source:{capture:"cursor"},headers:()=>({})},antigravity:{id:"antigravity",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent","Accept"],source:{capture:"antigravity"},headers:function(a){let b=a?.version||"2.9.1";return{"User-Agent":`antigravity/${b} ${(0,e.ol)()}/${(0,e.LY)()}`}}},copilot:{id:"copilot",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","copilot-integration-id","editor-version","editor-plugin-version","user-agent","openai-intent","x-github-api-version"],source:{capture:"github-copilot"},headers:function(a){let b=a?.vscodeVersion||"1.110.0",c=a?.chatVersion||a?.version||"0.38.0";return{"copilot-integration-id":"vscode-chat","editor-version":`vscode/${b}`,"editor-plugin-version":`copilot-chat/${c}`,"user-agent":`GitHubCopilotChat/${c}`,"openai-intent":"conversation-panel","x-github-api-version":a?.apiVersion||"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user"}}},qwen:{id:"qwen",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent","X-Stainless-Arch","X-Stainless-Os"],source:{capture:"qwen-code"},headers:function(a){let{os:b,arch:c,stainlessOs:d,stainlessArch:f}=a?.qwenOsArch||{os:"win32"===(0,e.ol)()?"windows":"darwin"===(0,e.ol)()?"darwin":"linux",arch:"arm64"===(0,e.LY)()?"arm64":"x64",stainlessOs:(0,e.vv)(),stainlessArch:(0,e.Tc)()},g=a?.version||"0.12.3",h=`QwenCode/${g} (${b}; ${c})`;return{"User-Agent":h,"X-DashScope-UserAgent":h,"X-Stainless-Arch":f,"X-Stainless-Os":d,"X-Stainless-Lang":"js","X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":a?.runtimeVersion||process.version,"X-Stainless-Package-Version":a?.packageVersion||"5.11.0"}}},kimi:{id:"kimi",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","X-Msh-Version","X-Msh-Device-Model"],source:{capture:"kimi-code"},headers:function(){return{"X-Msh-Version":"2.1.2","X-Msh-Device-Model":`${(0,e.ol)()} ${(0,e.LY)()}`}}},"grok-cli":{id:"grok-cli",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent"],source:{capture:"grok-cli"},headers:function(a){return{"User-Agent":`grok-cli/${a?.version||"1.0.0"}`}}},"grok-build":{id:"grok-build",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","Accept","User-Agent","x-grok-client-identifier","x-grok-client-version"],source:{capture:"@xai-official/grok 0.2.99"},headers:function(){let a;return{"User-Agent":`grok-shell/${g.uG} (${(0,e.ol)()||"linux"}; ${"x64"===(a=(0,e.LY)())?"x86_64":"arm64"===a?"aarch64":"ia32"===a?"x86":a||"x86_64"})`,"x-grok-client-identifier":g.rK,"x-grok-client-version":g.uG}}},"muse-code":{id:"muse-code",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent","Accept"],source:{capture:"muse-code"},headers:a=>({"User-Agent":`muse-code/${a?.version||"1.0.2"}`})}};function k(a){return j[a]||j["openai-node"]}let l=new Set(["openai","openai-responses","openai-compat"]),m=new Set(["claude"]);function n(a,b={}){if("string"==typeof a&&a)return a;if(a&&"object"==typeof a&&a.profile)return a.profile;let c=b.format||"",d=b.provider||"";return"claude"===c||m.has(c)||"claude"===d||d.startsWith("anthropic-compatible")?"claude-cli":"codex"===d?"codex-cli":"gemini-cli"===d?"gemini-cli":"antigravity"===d?"antigravity":"github"===d?"copilot":"qwen"===d?"qwen":"cline"===d||"clinepass"===d?"cline":"kimi"===d||"kimi-coding"===d?"kimi":"xai"===d?"grok-cli":"grok-cli"===d?"grok-build":"grok-web"===d?"chrome":"cursor"===d||"cursor"===c?"cursor":"muse"===d||"meta"===d?"muse-code":(l.has(c),"openai-node")}let o=new Set(["user-agent","anthropic-beta","x-stainless-package-version","x-stainless-runtime-version","x-stainless-os","x-stainless-arch"]),p=new Set(["x-stainless-helper-method","x-stainless-retry-count"]);function q(a,b,c={}){var d;let e,f=k(b),g=(d=c.snapshot,"function"==typeof(e=k(b)).headers?e.headers(d):{...e.headers||{}});!0===c.stream&&"claude-cli"===b?g["X-Stainless-Helper-Method"]="stream":"claude-cli"===b&&delete g["X-Stainless-Helper-Method"],"number"==typeof c.retryCount&&"claude-cli"===b&&(g["X-Stainless-Retry-Count"]=String(c.retryCount));let h=new Map;for(let[b,c]of Object.entries(a||{})){let a=b.toLowerCase();("authorization"===a||"x-api-key"===a||"api-key"===a)&&h.set(a,[b,c])}let i=!0===c.preserveUserAgent&&"claude-cli"!==b&&Object.entries(a||{}).find(([a])=>"user-agent"===a.toLowerCase())||null,j=r(a,g),l=c.overlay&&"object"==typeof c.overlay?"claude-cli"===b?function(a,b){let c,d,e={...a||{}},f=0!==(d=Object.values(c=Object.fromEntries([...o].map(a=>{let b;return[a,(b=Object.keys(e||{}).find(b=>b.toLowerCase()===a))?e[b]:void 0]}))).filter(a=>null!=a).length)&&d===o.size&&String(c["user-agent"]).match(/claude-(?:cli|code)\/(\d+\.\d+\.\d+)/i)?.[1]===b?.version;for(let a of Object.keys(e)){let b=a.toLowerCase();(p.has(b)||!f&&o.has(b))&&delete e[a]}return e}(c.overlay,c.snapshot):{...c.overlay}:{};for(let a of Object.keys(l))h.has(a.toLowerCase())&&delete l[a];let m=r(j,l);if(i&&!Object.keys(l).some(a=>"user-agent"===a.toLowerCase())){for(let a of Object.keys(m))"user-agent"===a.toLowerCase()&&delete m[a];m[i[0]]=i[1]}if("claude-cli"===b){if(!0===c.stream)m["X-Stainless-Helper-Method"]="stream";else for(let a of Object.keys(m))"x-stainless-helper-method"===a.toLowerCase()&&delete m[a];if("number"==typeof c.retryCount){for(let a of Object.keys(m))"x-stainless-retry-count"===a.toLowerCase()&&delete m[a];m["X-Stainless-Retry-Count"]=String(c.retryCount)}}for(let[a,[b,c]]of h){for(let b of Object.keys(m))b.toLowerCase()===a&&delete m[b];m[b]=c}return f?.headerOrder?s(m,f.headerOrder):m}function r(...a){let b={};for(let c of a)for(let[a,d]of Object.entries(c||{})){let c=Object.keys(b).find(b=>b.toLowerCase()===a.toLowerCase());c&&delete b[c],b[a]=d}return b}function s(a,b){if(!b||!b.length)return{...a};let c=new Set,d={},e=new Map;for(let[b,c]of Object.entries(a))e.set(b.toLowerCase(),[b,c]);for(let a of b){let b=e.get(a.toLowerCase());b&&(d[b[0]]=b[1],c.add(a.toLowerCase()))}for(let[b,e]of Object.entries(a))c.has(b.toLowerCase())||(d[b]=e);return d}},59970:(a,b,c)=>{"use strict";let d,e=Symbol.for("undici.globalDispatcher.2"),f=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:g}=c(61448),h=c(37417),i=c(74399);function j(a){if(!a||"function"!=typeof a.dispatch)throw new g("Argument agent must implement Agent");try{Object.defineProperty(globalThis,e,{value:a,writable:!0,enumerable:!1,configurable:!1})}catch(b){if(b instanceof TypeError){d=a;return}throw b}try{let b=a instanceof i?a:new i(a);Object.defineProperty(globalThis,f,{value:b,writable:!0,enumerable:!1,configurable:!1})}catch(a){if(!(a instanceof TypeError))throw a}}function k(){return globalThis[e]??d}void 0===k()&&j(new h),a.exports={setGlobalDispatcher:j,getGlobalDispatcher:k,installedExports:["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"]}},60823:(a,b,c)=>{"use strict";let d=c(34589);a.exports=class{#aQ;#bF=!1;#bG=!1;#bH=!1;constructor(a){if("object"!=typeof a||null===a)throw TypeError("handler must be an object");this.#aQ=a}onRequestStart(...a){this.#aQ.onRequestStart?.(...a)}onRequestUpgrade(...a){return d(!this.#bF),d(!this.#bG),this.#aQ.onRequestUpgrade?.(...a)}onResponseStart(...a){return d(!this.#bF),d(!this.#bG),d(!this.#bH),this.#bH=!0,this.#aQ.onResponseStart?.(...a)}onResponseData(...a){return d(!this.#bF),d(!this.#bG),this.#aQ.onResponseData?.(...a)}onResponseEnd(...a){return d(!this.#bF),d(!this.#bG),this.#bF=!0,this.#aQ.onResponseEnd?.(...a)}onResponseError(...a){return this.#bG=!0,this.#aQ.onResponseError?.(...a)}onBodySent(...a){return this.#aQ.onBodySent?.(...a)}onRequestSent(...a){return this.#aQ.onRequestSent?.(...a)}}},61330:(a,b,c)=>{"use strict";let{BalancedPoolMissingUpstreamError:d,InvalidArgumentError:e}=c(61448),{PoolBase:f,kClients:g,kNeedDrain:h,kAddClient:i,kRemoveClient:j,kGetDispatcher:k}=c(39065),l=c(35689),{kOriginless:m,kUrl:n}=c(49176),o=c(84285),p=Symbol("factory"),q=Symbol("options"),r=Symbol("kGreatestCommonDivisor"),s=Symbol("kCurrentWeight"),t=Symbol("kIndex"),u=Symbol("kWeight"),v=Symbol("kMaxWeightPerServer"),w=Symbol("kErrorPenalty");function x(a,b){return new l(a,b)}class y extends f{constructor(a=[],{factory:b=x,connect:c,tls:d,...f}={}){if("function"!=typeof b)throw new e("factory must be a function.");for(const e of(super(f),this[m]=!0,c&&"function"!=typeof c&&(c={...c}),d&&"function"!=typeof d&&(d={...d}),this[q]={...o.deepClone(f),connect:c,tls:d},this[t]=-1,this[s]=0,this[v]=this[q].maxWeightPerServer||100,this[w]=this[q].errorPenalty||15,Array.isArray(a)||(a=[a]),this[p]=b,a))this.addUpstream(e);this._updateBalancedPoolStats()}addUpstream(a){let b=o.parseOrigin(a).origin;if(this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed))return this;let c=this[p](b,this[q]);for(let a of(this[i](c),c.on("connect",()=>{c[u]=Math.min(this[v],c[u]+this[w])}),c.on("connectionError",()=>{c[u]=Math.max(1,c[u]-this[w]),this._updateBalancedPoolStats()}),c.on("disconnect",(...a)=>{let b=a[2];b&&"UND_ERR_SOCKET"===b.code&&(c[u]=Math.max(1,c[u]-this[w]),this._updateBalancedPoolStats())}),this[g]))a[u]=this[v];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let a=0;for(let b=0;b<this[g].length;b++)a=function(a,b){if(0===a)return b;for(;0!==b;){let c=b;b=a%b,a=c}return a}(this[g][b][u],a);this[r]=a}removeUpstream(a){let b=o.parseOrigin(a).origin,c=this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed);return c&&this[j](c),this}getUpstream(a){let b=o.parseOrigin(a).origin;return this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed)}get upstreams(){return this[g].filter(a=>!0!==a.closed&&!0!==a.destroyed).map(a=>a[n].origin)}[k](){if(0===this[g].length)throw new d;let a=0,b=-1;for(;a++<this[g].length;){this[t]=(this[t]+1)%this[g].length;let a=this[g][this[t]];if((0===this[t]&&(this[s]=this[s]-this[r],this[s]<=0&&(this[s]=this[v])),!a[h]&&!0!==a.closed&&!0!==a.destroyed)&&((-1===b||a[u]>this[g][b][u])&&(b=this[t]),a[u]>=this[s]))return a}if(-1!==b)return this[s]=this[g][b][u],this[t]=b,this[g][b]}}a.exports=y},61448:a=>{"use strict";let b=Symbol.for("undici.error.UND_ERR");class c extends Error{constructor(a,b){super(a,b),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](a){return a&&!0===a[b]}get[b](){return!0}}let d=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");class e extends c{constructor(a){super(a),this.name="ConnectTimeoutError",this.message=a||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[d]}get[d](){return!0}}let f=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");class g extends c{constructor(a){super(a),this.name="HeadersTimeoutError",this.message=a||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[f]}get[f](){return!0}}let h=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");class i extends c{constructor(a){super(a),this.name="HeadersOverflowError",this.message=a||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](a){return a&&!0===a[h]}get[h](){return!0}}let j=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");class k extends c{constructor(a){super(a),this.name="BodyTimeoutError",this.message=a||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[j]}get[j](){return!0}}let l=Symbol.for("undici.error.UND_ERR_INVALID_ARG");class m extends c{constructor(a){super(a),this.name="InvalidArgumentError",this.message=a||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](a){return a&&!0===a[l]}get[l](){return!0}}let n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");class o extends c{constructor(a){super(a),this.name="InvalidReturnValueError",this.message=a||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](a){return a&&!0===a[n]}get[n](){return!0}}let p=Symbol.for("undici.error.UND_ERR_ABORT");class q extends c{constructor(a){super(a),this.name="AbortError",this.message=a||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](a){return a&&!0===a[p]}get[p](){return!0}}let r=Symbol.for("undici.error.UND_ERR_ABORTED");class s extends q{constructor(a){super(a),this.name="AbortError",this.message=a||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](a){return a&&!0===a[r]}get[r](){return!0}}let t=Symbol.for("undici.error.UND_ERR_INFO");class u extends c{constructor(a,b){super(a,b),this.name="InformationalError",this.message=a||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](a){return a&&!0===a[t]}get[t](){return!0}}let v=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");class w extends c{constructor(a){super(a),this.name="RequestContentLengthMismatchError",this.message=a||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](a){return a&&!0===a[v]}get[v](){return!0}}let x=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");class y extends c{constructor(a){super(a),this.name="ResponseContentLengthMismatchError",this.message=a||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](a){return a&&!0===a[x]}get[x](){return!0}}let z=Symbol.for("undici.error.UND_ERR_DESTROYED");class A extends c{constructor(a){super(a),this.name="ClientDestroyedError",this.message=a||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](a){return a&&!0===a[z]}get[z](){return!0}}let B=Symbol.for("undici.error.UND_ERR_CLOSED");class C extends c{constructor(a){super(a),this.name="ClientClosedError",this.message=a||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](a){return a&&!0===a[B]}get[B](){return!0}}let D=Symbol.for("undici.error.UND_ERR_SOCKET");class E extends c{constructor(a,b){super(a),this.name="SocketError",this.message=a||"Socket error",this.code="UND_ERR_SOCKET",this.socket=b}static[Symbol.hasInstance](a){return a&&!0===a[D]}get[D](){return!0}}let F=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");class G extends c{constructor(a){super(a),this.name="NotSupportedError",this.message=a||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](a){return a&&!0===a[F]}get[F](){return!0}}let H=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");class I extends c{constructor(a){super(a),this.name="MissingUpstreamError",this.message=a||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](a){return a&&!0===a[H]}get[H](){return!0}}let J=Symbol.for("undici.error.UND_ERR_HTTP_PARSER");class K extends Error{constructor(a,b,c){super(a),this.name="HTTPParserError",this.code=b?`HPE_${b}`:void 0,this.data=c?c.toString():void 0}static[Symbol.hasInstance](a){return a&&!0===a[J]}get[J](){return!0}}let L=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class M extends c{constructor(a){super(a),this.name="ResponseExceededMaxSizeError",this.message=a||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](a){return a&&!0===a[L]}get[L](){return!0}}let N=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class O extends c{constructor(a,b,{headers:c,data:d}){super(a),this.name="RequestRetryError",this.message=a||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=b,this.data=d,this.headers=c}static[Symbol.hasInstance](a){return a&&!0===a[N]}get[N](){return!0}}let P=Symbol.for("undici.error.UND_ERR_RESPONSE");class Q extends c{constructor(a,b,{headers:c,body:d}){super(a),this.name="ResponseError",this.message=a||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=b,this.body=d,this.headers=c}static[Symbol.hasInstance](a){return a&&!0===a[P]}get[P](){return!0}}let R=Symbol.for("undici.error.UND_ERR_PRX_TLS");class S extends c{constructor(a,b,c={}){super(b,{cause:a,...c}),this.name="SecureProxyConnectionError",this.message=b||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=a}static[Symbol.hasInstance](a){return a&&!0===a[R]}get[R](){return!0}}let T=Symbol.for("undici.error.UND_ERR_PRX_CONN");class U extends c{constructor(a,b,c={}){super(b,{cause:a,...c}),this.name="ProxyConnectionError",this.message=b||"Proxy Connection failed",this.code="UND_ERR_PRX_CONN",this.cause=a}static[Symbol.hasInstance](a){return a&&!0===a[T]}get[T](){return!0}}let V=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class W extends c{constructor(a){super(a),this.name="MaxOriginsReachedError",this.message=a||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](a){return a&&!0===a[V]}get[V](){return!0}}class X extends c{constructor(a,b){super(a),this.name="Socks5ProxyError",this.message=a||"SOCKS5 proxy error",this.code=b||"UND_ERR_SOCKS5"}}let Y=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");class Z extends c{constructor(a){super(a),this.name="MessageSizeExceededError",this.message=a||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](a){return a&&!0===a[Y]}get[Y](){return!0}}a.exports={AbortError:q,HTTPParserError:K,UndiciError:c,HeadersTimeoutError:g,HeadersOverflowError:i,BodyTimeoutError:k,RequestContentLengthMismatchError:w,ConnectTimeoutError:e,InvalidArgumentError:m,InvalidReturnValueError:o,RequestAbortedError:s,ClientDestroyedError:A,ClientClosedError:C,InformationalError:u,SocketError:E,NotSupportedError:G,ResponseContentLengthMismatchError:y,BalancedPoolMissingUpstreamError:I,ResponseExceededMaxSizeError:M,RequestRetryError:O,ResponseError:Q,SecureProxyConnectionError:S,ProxyConnectionError:U,MaxOriginsReachedError:W,Socks5ProxyError:X,MessageSizeExceededError:Z}},62026:a=>{"use strict";a.exports={uid:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",sentCloseFrameState:{SENT:1,RECEIVED:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:65535,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{text:1,typedArray:2,arrayBuffer:3,blob:4}}},62457:(a,b,c)=>{"use strict";c.d(b,{Ut:()=>e,a_:()=>f,bC:()=>d,lW:()=>g,zh:()=>h});let d={STOP:"stop",LENGTH:"length",TOOL_CALLS:"tool_calls",CONTENT_FILTER:"content_filter",ERROR:"error"},e={END_TURN:"end_turn",MAX_TOKENS:"max_tokens",TOOL_USE:"tool_use",STOP_SEQUENCE:"stop_sequence"},f={STOP:"STOP",MAX_TOKENS:"MAX_TOKENS",SAFETY:"SAFETY",RECITATION:"RECITATION",BLOCKLIST:"BLOCKLIST",PROHIBITED_CONTENT:"PROHIBITED_CONTENT",SPII:"SPII",IMAGE_SAFETY:"IMAGE_SAFETY",MALFORMED_FUNCTION_CALL:"MALFORMED_FUNCTION_CALL",UNEXPECTED_TOOL_CALL:"UNEXPECTED_TOOL_CALL",FINISH_REASON_UNSPECIFIED:"FINISH_REASON_UNSPECIFIED",OTHER:"OTHER",LANGUAGE:"LANGUAGE",NO_IMAGE:"NO_IMAGE"},g=new Set([f.MALFORMED_FUNCTION_CALL,f.UNEXPECTED_TOOL_CALL,f.FINISH_REASON_UNSPECIFIED,f.OTHER,f.LANGUAGE,f.NO_IMAGE]),h=new Set([f.SAFETY,f.RECITATION,f.BLOCKLIST,f.SPII,f.IMAGE_SAFETY,f.PROHIBITED_CONTENT])},62571:(a,b,c)=>{"use strict";let d=c(53053),e=c(57975),f=e.debuglog("undici"),g=e.debuglog("fetch"),h=e.debuglog("websocket"),i={beforeConnect:d.channel("undici:client:beforeConnect"),connected:d.channel("undici:client:connected"),connectError:d.channel("undici:client:connectError"),sendHeaders:d.channel("undici:client:sendHeaders"),create:d.channel("undici:request:create"),bodySent:d.channel("undici:request:bodySent"),bodyChunkSent:d.channel("undici:request:bodyChunkSent"),bodyChunkReceived:d.channel("undici:request:bodyChunkReceived"),headers:d.channel("undici:request:headers"),trailers:d.channel("undici:request:trailers"),error:d.channel("undici:request:error"),open:d.channel("undici:websocket:open"),close:d.channel("undici:websocket:close"),socketError:d.channel("undici:websocket:socket_error"),ping:d.channel("undici:websocket:ping"),pong:d.channel("undici:websocket:pong"),proxyConnected:d.channel("undici:proxy:connected")},j=!1;function k(a=f){if(!j){if(i.beforeConnect.hasSubscribers||i.connected.hasSubscribers||i.connectError.hasSubscribers||i.sendHeaders.hasSubscribers){j=!0;return}j=!0,d.subscribe("undici:client:beforeConnect",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f}}=b;a("connecting to %s%s using %s%s",f,e?`:${e}`:"",d,c)}),d.subscribe("undici:client:connected",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f}}=b;a("connected to %s%s using %s%s",f,e?`:${e}`:"",d,c)}),d.subscribe("undici:client:connectError",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f},error:g}=b;a("connection to %s%s using %s%s errored - %s",f,e?`:${e}`:"",d,c,g.message)}),d.subscribe("undici:client:sendHeaders",b=>{let{request:{method:c,path:d,origin:e}}=b;a("sending request to %s %s%s",c,e,d)})}}let l=!1,m=!1;(f.enabled||g.enabled)&&(k(g.enabled?g:f),function(a=f){if(!l){if(i.headers.hasSubscribers||i.trailers.hasSubscribers||i.error.hasSubscribers){l=!0;return}l=!0,d.subscribe("undici:request:headers",b=>{let{request:{method:c,path:d,origin:e},response:{statusCode:f}}=b;a("received response to %s %s%s - HTTP %d",c,e,d,f)}),d.subscribe("undici:request:trailers",b=>{let{request:{method:c,path:d,origin:e}}=b;a("trailers received from %s %s%s",c,e,d)}),d.subscribe("undici:request:error",b=>{let{request:{method:c,path:d,origin:e},error:f}=b;a("request to %s %s%s errored - %s",c,e,d,f.message)})}}(g.enabled?g:f)),h.enabled&&(k(f.enabled?f:h),function(a=h){if(!m){if(i.open.hasSubscribers||i.close.hasSubscribers||i.socketError.hasSubscribers||i.ping.hasSubscribers||i.pong.hasSubscribers){m=!0;return}m=!0,d.subscribe("undici:websocket:open",b=>{if(null!=b.address){let{address:c,port:d}=b.address;a("connection opened %s%s",c,d?`:${d}`:"")}else a("connection opened")}),d.subscribe("undici:websocket:close",b=>{let{websocket:c,code:d,reason:e}=b;a("closed connection to %s - %s %s",c.url,d,e)}),d.subscribe("undici:websocket:socket_error",b=>{a("connection errored - %s",b.message)}),d.subscribe("undici:websocket:ping",b=>{a("ping received")}),d.subscribe("undici:websocket:pong",b=>{a("pong received")})}}(h)),a.exports={channels:i}},62692:(a,b,c)=>{"use strict";c.d(b,{B:()=>m});var d=c(22256),e=c(38421),f=c(43835),g=c(27137),h=c(96997),i=c(19016),j=c(49471),k=c(85513),l=c(54383);class m extends d.Hv{constructor(){super("kiro",e.xq.kiro)}buildHeaders(a,b=!0){let c={...this.config.headers,"Amz-Sdk-Request":"attempt=1; max=3","Amz-Sdk-Invocation-Id":(0,g.A)()},d=a?.providerSpecificData?.authMethod,e="api_key"===d,f=a?.apiKey||(e?a?.accessToken:null);return e&&f?(c.Authorization=`Bearer ${f}`,c.tokentype="API_KEY"):a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`,"external_idp"===d&&(c.TokenType="EXTERNAL_IDP")),c}getOrderedBaseUrls(a){let b=this.getBaseUrls(),c=a?.providerSpecificData?.authMethod;if("api_key"!==c&&"external_idp"!==c&&"idc"!==c)return b;let d=(0,l.R)(a?.providerSpecificData?.profileArn),e=d?.region||(0,k.l6)((a?.providerSpecificData?.region||"").trim()),f=b.filter(a=>a.includes("amazonaws.com")),g=b.filter(a=>!a.includes("amazonaws.com"));if(0===f.length||"us-east-1"===e)return f.length>0?[...f,...g]:b;let h=f.find(a=>a.includes("://q."));if(!h)return[...f,...g];let i=e.startsWith("us-gov-")?`q-fips.${e}.amazonaws.com`:`q.${e}.amazonaws.com`;return[h.replace(/q\.[a-z0-9-]+\.amazonaws\.com/,i),...f.filter(a=>a!==h),...g]}buildUrl(a,b,c=0,d=null){let e=this.getOrderedBaseUrls(d);return e[c]||e[0]||this.config.baseUrl}transformRequest(a,b,c,d){return b}async execute(a){let b=await super.execute(a);return b?.response?.ok&&(b.response=this.transformEventStreamToSSE(b.response,a.model)),b}transformEventStreamToSSE(a,b){let c=new Uint8Array(0),d=0,e=`chatcmpl-${Date.now()}`,g=Math.floor(Date.now()/1e3),h=(0,f.$D)(b).upstream,k=(0,j.nl)("kiro",h).contextWindow||2e5,l={endDetected:!1,finishEmitted:!1,upstreamError:null,hasToolCalls:!1,hasReasoningContent:!1,reasoningChunkCount:0,toolCallIndex:0,seenToolIds:new Map,inThinking:!1},m=new TransformStream({async transform(a,f){let h=d,i=new Uint8Array(c.length+a.length);i.set(c),i.set(a,c.length),c=i;let j=0;for(;c.length>=16&&j<1e3;){j++;let a=new DataView(c.buffer,c.byteOffset).getUint32(0,!1);if(a<16||a>c.length||c.length<a)break;let h=c.slice(0,a);c=c.slice(a);let i=function(a){try{let b=new DataView(a.buffer,a.byteOffset).getUint32(4,!1),c={},d=12,e=12+b;for(;d<e&&d<a.length;){let b=a[d];if(++d+b>a.length)break;let e=new TextDecoder().decode(a.slice(d,d+b)),f=a[d+=b];if(d++,7===f){let b=a[d]<<8|a[d+1];if((d+=2)+b>a.length)break;let f=new TextDecoder().decode(a.slice(d,d+b));d+=b,c[e]=f}else break}let f=12+b,g=a.length-4,h=null;if(g>f){let b=new TextDecoder().decode(a.slice(f,g));if(!b||!b.trim())return{headers:c,payload:null};try{h=JSON.parse(b)}catch(a){console.warn(`[Kiro] Failed to parse payload: ${a.message} | payload: ${b.substring(0,100)}`),h={raw:b}}}return{headers:c,payload:h}}catch{return null}}(h);if(!i)continue;let m=i.headers[":event-type"]||"",n=i.headers[":exception-type"]||"";if(n||"exception"===i.headers[":message-type"]){let a=i.payload&&"object"==typeof i.payload?i.payload:{};l.upstreamError=String(a.message||a.Message||("string"==typeof i.payload?i.payload:"")||n||"Kiro upstream exception"),l.finishEmitted=!0;let c={id:e,object:"chat.completion.chunk",created:g,model:b,choices:[{index:0,delta:{},finish_reason:null}],error:{message:l.upstreamError,type:"server_error",code:n||"upstream_exception"}};d++,f.enqueue(new TextEncoder().encode(`data: ${JSON.stringify(c)}
|
|
368
|
+
WHERE id = ?`,[f.name,+!!f.isActive,JSON.stringify(f.allowedModels),JSON.stringify(f.allowedCombos),f.expiresAt,f.rateLimitPerMinute,f.concurrencyLimit,f.spendLimitUsd,a]),e={...f}}),e&&s(a),e}async function z(a){let b=await (0,g.c)(),c=(b.run("DELETE FROM apiKeys WHERE id = ?",[a])?.changes??0)>0;return c&&s(a),c}async function A(a){if(!a||"string"!=typeof a)return null;let b=await (0,g.c)(),c=(0,h.cb)(a),d=(0,h.E8)(a),f=c?e().createHash("sha256").update(a).digest("hex"):null;if(c&&f){let a,d=(a=q.get(c))?a.expiresAt<=Date.now()?(q.delete(c),null):(0,h.lO)(a.rawSha256,f)?(q.delete(c),q.set(c,a),a):null:null;if(d){let a=b.get(`${p} WHERE k.id = ?`,[d.id]);if(a&&(1===a.isActive||!0===a.isActive))return a.spentUsd=await u(a.id),l(a);q.delete(c)}}let i=c?b.get(`${p} WHERE k.isActive = 1 AND k.lookupDigest = ?`,[c]):null;if(i)return(2===(0,h.BA)(i.key).version?await (0,h.ue)(i.key,a):(0,h.O0)(i.key,a))?(c&&f&&r(c,f,i.id),i.spentUsd=await u(i.id),l(i)):null;for(let e of b.all(`${p} WHERE k.isActive = 1 AND k.lookupDigest IS NULL AND k.keyPrefix = ? AND k.key NOT LIKE 'v2:%'`,[d])){let d=(0,h.BA)(e.key);if((0,h.O0)(e.key,a)){if(d.legacy||1===d.version&&c){let d=(0,h.ws)(a,c);b.run("UPDATE apiKeys SET key = ?, keyPrefix = ?, lookupDigest = ? WHERE id = ?",[d,(0,h.E8)(a),c,e.id]),c&&q.delete(c),e.key=d,e.keyPrefix=(0,h.E8)(a),e.lookupDigest=c}return c&&f&&r(c,f,e.id),e.spentUsd=await u(e.id),l(e)}}return null}async function B(a){return!!await A(a)}},57435:(a,b,c)=>{"use strict";let{Readable:d,Duplex:e,PassThrough:f}=c(57075),g=c(34589),{AsyncResource:h}=c(16698),{InvalidArgumentError:i,InvalidReturnValueError:j,RequestAbortedError:k}=c(61448),l=c(84285),{kBodyUsed:m}=c(49176),{addSignal:n,removeSignal:o}=c(73135);function p(){}let q=Symbol("resume");class r extends d{constructor(){super({autoDestroy:!0}),this[q]=null,this[m]=!0}_read(){let{[q]:a}=this;a&&(this[q]=null,a())}_destroy(a,b){this._read(),b(a)}}class s extends d{constructor(a){super({autoDestroy:!0}),this[q]=a}_read(){this[q]()}_destroy(a,b){a||this._readableState.endEmitted||(a=new k),b(a)}}class t extends h{constructor(a,b){if(!a||"object"!=typeof a)throw new i("invalid opts");if("function"!=typeof b)throw new i("invalid handler");const{signal:c,method:d,opaque:f,onInfo:g,responseHeaders:h}=a;if(c&&"function"!=typeof c.on&&"function"!=typeof c.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===d)throw new i("invalid method");if(g&&"function"!=typeof g)throw new i("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=f||null,this.responseHeaders=h||null,this.handler=b,this.abort=null,this.context=null,this.onInfo=g||null,this.req=new r().on("error",p),this.ret=new e({readableObjectMode:a.objectMode,autoDestroy:!0,read:()=>{let{body:a}=this;a?.resume&&a.resume()},write:(a,b,c)=>{let{req:d}=this;d.push(a,b)||d._readableState.destroyed?c():d[q]=c},destroy:(a,b)=>{let{body:c,req:d,res:e,ret:f,abort:g}=this;a||f._readableState.endEmitted||(a=new k),g&&a&&g(),l.destroy(c,a),l.destroy(d,a),l.destroy(e,a),o(this),b(a)}}).on("prefinish",()=>{let{req:a}=this;a.push(null)}),this.res=null,n(this,c)}onRequestStart(a,b){let{res:c}=this;this.reason?a.abort(this.reason):(g(!c,"pipeline cannot be retried"),this.abort=b=>a.abort(b),this.context=b)}onResponseStart(a,b,c,d){let e,{opaque:f,handler:g,context:h}=this;if(b<200){if(this.onInfo){let d=a?.rawHeaders,e="raw"===this.responseHeaders?l.parseRawHeaders(d):c;this.onInfo({statusCode:b,headers:e})}return}this.res=new s(()=>a.resume());try{this.handler=null;let d=a?.rawHeaders,i="raw"===this.responseHeaders?l.parseRawHeaders(d):c;e=this.runInAsyncScope(g,null,{statusCode:b,headers:i,opaque:f,body:this.res,context:h})}catch(a){throw this.res.on("error",p),a}if(!e||"function"!=typeof e.on)throw new j("expected Readable");e.on("data",a=>{let{ret:b,body:c}=this;!b.push(a)&&c.pause&&c.pause()}).on("error",a=>{let{ret:b}=this;l.destroy(b,a)}).on("end",()=>{let{ret:a}=this;a.push(null)}).on("close",()=>{let{ret:a}=this;a._readableState.ended||l.destroy(a,new k)}),this.body=e}onResponseData(a,b){let{res:c}=this;!1===c.push(b)&&a.pause()}onResponseEnd(a,b){let{res:c}=this;c.push(null)}onResponseError(a,b){let{ret:c}=this;this.handler=null,l.destroy(c,b)}}a.exports=function(a,b){try{let c=new t(a,b);return this.dispatch({...a,body:c.req},c),c.ret}catch(a){return new f().destroy(a)}}},57690:(a,b,c)=>{"use strict";let d;c.d(b,{KN:()=>m,uV:()=>n});let e={pricing:{},capabilities:{}};function f(a,b){if(!a)throw Error(b)}let g=!1;function h(a){if("u"<typeof process)return null;if("function"!=typeof process.getBuiltinModule)return!g&&process.versions?.node&&(g=!0,console.warn(`[switchboard] generated model catalog disabled: process.getBuiltinModule requires Node >= 20.12 (running ${process.versions.node}); falling back to hand-maintained data only`)),null;try{return process.getBuiltinModule(a)}catch{return null}}function i(){return void 0===d&&(d=function(){let a=h("node:fs");if(!a)return e;for(let b of function(){let a=[],b=h("node:path");if(b&&"function"==typeof process.cwd)try{a.push(b.join(process.cwd(),"open-sse","providers","generated","catalog.json"))}catch{}let d=h("node:url");if(d)try{a.push(d.fileURLToPath(new c.U(c(19659))))}catch{}return a}())if("string"==typeof b)try{return function(a){let b=JSON.parse(a);return null===b||"object"!=typeof b?e:{pricing:b.pricing&&"object"==typeof b.pricing?b.pricing:{},capabilities:b.capabilities&&"object"==typeof b.capabilities?b.capabilities:{}}}(a.readFileSync(b,"utf8"))}catch{}return e}()),d}let j=new WeakMap;function k(a){let b=j.get(a);if(!b){for(let c of(b=new Map,Object.keys(a).sort())){let d=c.toLowerCase();b.has(d)||b.set(d,a[c])}j.set(a,b)}return b}function l(a,b){if(!b)return null;f("string"==typeof b,"model must be a string");let c=b.includes("/")?b.split("/").pop():b;return f("string"==typeof c,"model base must be a string"),a[c]||a[b]||k(a).get(c.toLowerCase())||k(a).get(b.toLowerCase())||null}function m(a){return l(i().pricing,a)}function n(a){return l(i().capabilities,a)}},58609:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(24081),e=c(50743);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},59529:(a,b,c)=>{"use strict";c.d(b,{VG:()=>h});var d=c(22256),e=c(38421),f=c(10793),g=c(50969);class h extends d.Hv{constructor(){super("gemini-cli",e.xq["gemini-cli"])}buildUrl(a,b,c=0){return`${this.config.baseUrl}:${b?"streamGenerateContent?alt=sse":"generateContent"}`}buildHeaders(a,b=!0){return{"Content-Type":"application/json",Authorization:`Bearer ${a.accessToken}`,"User-Agent":(0,f.sX)(this._currentModel),"X-Goog-Api-Client":f.go,Accept:b?"text/event-stream":"application/json"}}transformRequest(a,b,c,d){this._currentModel=a;let e=function(a){if(!a||"object"!=typeof a)return a;let{stream:b,...c}=a;if(!c.request||"object"!=typeof c.request)return c;let{stream:d,...e}=c.request;return{...c,request:e}}(b);return e&&e.request&&e.model?e:{project:d?.projectId||e?.project,model:a,request:e}}parseError(a,b){let c=super.parseError(a,b);if(429!==a.status||!b)return c;try{let a=JSON.parse(b),d=a?.error?.details;if(Array.isArray(d)){for(let a of d)if(a?.["@type"]==="type.googleapis.com/google.rpc.RetryInfo"&&a?.retryDelay){c.retryAfter=a.retryDelay;let b=function(a){if("string"==typeof a){let b=a.match(/^(\d+(?:\.\d+)?)s$/);if(!b)return null;let c=Math.round(1e3*Number(b[1]));return Number.isFinite(c)?c:null}if("number"==typeof a)return Number.isFinite(a)?Math.round(1e3*a):null;if(a&&"object"==typeof a){let b=Number(a.seconds||0),c=Number(a.nanos||0);return Number.isFinite(b)&&Number.isFinite(c)?Math.round(1e3*b+c/1e6):null}return null}(a.retryDelay);null!==b&&b>0&&(c.resetsAtMs=Date.now()+b);break}}}catch{}return c}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;try{let d=await (0,g.Fm)(f.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.refreshToken,client_id:this.config.clientId,client_secret:this.config.clientSecret}),identity:this.config.identity,provider:this.provider,format:this.config.format},c);if(!d.ok)return null;let e=await d.json();return b?.info?.("TOKEN","Gemini CLI refreshed"),{accessToken:e.access_token,refreshToken:e.refresh_token||a.refreshToken,expiresIn:e.expires_in,projectId:a.projectId}}catch(a){return b?.error?.("TOKEN",`Gemini CLI refresh error: ${a.message}`),null}}}},59882:(a,b,c)=>{"use strict";c.d(b,{$3:()=>q,$R:()=>i,Dm:()=>s,E$:()=>k,Zb:()=>h,jI:()=>j,ti:()=>n});var d=c(74570),e=c(3507),f=c(48161),g=c(83382);let h=["Accept","Authorization","Content-Type","User-Agent","X-Claude-Code-Session-Id","X-Stainless-Arch","X-Stainless-Lang","X-Stainless-OS","X-Stainless-Package-Version","X-Stainless-Retry-Count","X-Stainless-Runtime","X-Stainless-Runtime-Version","X-Stainless-Timeout","anthropic-beta","anthropic-dangerous-direct-browser-access","anthropic-version","x-app","x-client-request-id","Connection","Host","Accept-Encoding","Content-Length"],i=h.filter(a=>"X-Stainless-Timeout"!==a),j={"claude-cli":{id:"claude-cli",tls:"claude-code",alpn:["http/1.1"],headerOrder:h,source:{npm:"@anthropic-ai/claude-code",capture:"claude-code-native",tlsSpec:"claude-code"},headers:function(a){let b=a?.version||"2.1.302",c=a?.entrypoint||"cli";return{"Anthropic-Version":d.b8,"Anthropic-Beta":a?.betas||"claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,effort-2025-11-24,structured-outputs-2025-12-15","Anthropic-Dangerous-Direct-Browser-Access":"true","User-Agent":a?.userAgent||`claude-cli/${b} (external, ${c})`,"X-App":"cli","X-Stainless-Runtime-Version":a?.runtimeVersion||process.version,"X-Stainless-Package-Version":a?.packageVersion||"0.128.0","X-Stainless-Runtime":"node","X-Stainless-Lang":"js","X-Stainless-Arch":a?.arch||(0,e.Tc)(),"X-Stainless-Os":a?.os||(0,e.vv)(),"X-Stainless-Timeout":"600"}}},"codex-cli":{id:"codex-cli",tls:"chrome",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","originator","session_id","User-Agent","version","chatgpt-account-id"],source:{npm:"@openai/codex"},headers:function(a){let b=a?.version||"0.163.0";return{originator:"codex_cli_rs","User-Agent":`codex_cli_rs/${b}`,version:b}}},"gemini-cli":{id:"gemini-cli",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Content-Type","Authorization","User-Agent","X-Goog-Api-Client","Accept"],source:{npm:"@google/gemini-cli"},headers:function(a){let b=a?.version||"0.56.0",c=a?.upstreamModel||"unknown",d="ia32"===(0,e.LY)()?"x86":(0,e.LY)(),f="u">typeof process&&process.version?process.version.replace(/^v/,""):"unknown";return{"User-Agent":`GeminiCLI/${b}/${c} (${(0,e.ol)()}; ${d}; terminal)`,"X-Goog-Api-Client":a?.apiClient||`google-genai-sdk/1.41.0 gl-node/v${f}`}}},"openai-node":{id:"openai-node",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent"],source:{npm:"openai"},headers:function(){return{"User-Agent":`OpenAI/NodeJS/${process.version.replace(/^v/,"")}`}}},cline:{id:"cline",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","HTTP-Referer","X-Title","User-Agent","X-PLATFORM","X-PLATFORM-VERSION","X-CLIENT-TYPE","X-CLIENT-VERSION","X-CORE-VERSION","X-IS-MULTIROOT"],source:{npm:"cline"},headers:function(a){let b=a?.version||"3.0.0";return{"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`Cline/${b}`,"X-PLATFORM":(0,e.ol)()||"unknown","X-PLATFORM-VERSION":a?.platformVersion||(0,f.release)()||"unknown","X-CLIENT-TYPE":"extension","X-CLIENT-VERSION":b,"X-CORE-VERSION":b,"X-IS-MULTIROOT":"false"}}},chrome:{id:"chrome",tls:"chrome",alpn:["h2","http/1.1"],headerOrder:["User-Agent","Accept","Accept-Language","Accept-Encoding"],source:{capture:"chrome"},headers:function(a){let b,c=a?.chromeVersion||"136";return{"User-Agent":`Mozilla/5.0 (${"darwin"===(b=(0,e.ol)())?"Macintosh; Intel Mac OS X 10_15_7":"win32"===b?"Windows NT 10.0; Win64; x64":"X11; Linux x86_64"}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${c}.0.0.0 Safari/537.36`}}},cursor:{id:"cursor",tls:"node",alpn:["h2","http/1.1"],headerOrder:[],source:{capture:"cursor"},headers:()=>({})},antigravity:{id:"antigravity",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent","Accept"],source:{capture:"antigravity"},headers:function(a){let b=a?.version||"2.9.1";return{"User-Agent":`antigravity/${b} ${(0,e.ol)()}/${(0,e.LY)()}`}}},copilot:{id:"copilot",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","copilot-integration-id","editor-version","editor-plugin-version","user-agent","openai-intent","x-github-api-version"],source:{capture:"github-copilot"},headers:function(a){let b=a?.vscodeVersion||"1.110.0",c=a?.chatVersion||a?.version||"0.38.0";return{"copilot-integration-id":"vscode-chat","editor-version":`vscode/${b}`,"editor-plugin-version":`copilot-chat/${c}`,"user-agent":`GitHubCopilotChat/${c}`,"openai-intent":"conversation-panel","x-github-api-version":a?.apiVersion||"2025-04-01","x-vscode-user-agent-library-version":"electron-fetch","X-Initiator":"user"}}},qwen:{id:"qwen",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent","X-Stainless-Arch","X-Stainless-Os"],source:{capture:"qwen-code"},headers:function(a){let{os:b,arch:c,stainlessOs:d,stainlessArch:f}=a?.qwenOsArch||{os:"win32"===(0,e.ol)()?"windows":"darwin"===(0,e.ol)()?"darwin":"linux",arch:"arm64"===(0,e.LY)()?"arm64":"x64",stainlessOs:(0,e.vv)(),stainlessArch:(0,e.Tc)()},g=a?.version||"0.12.3",h=`QwenCode/${g} (${b}; ${c})`;return{"User-Agent":h,"X-DashScope-UserAgent":h,"X-Stainless-Arch":f,"X-Stainless-Os":d,"X-Stainless-Lang":"js","X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":a?.runtimeVersion||process.version,"X-Stainless-Package-Version":a?.packageVersion||"5.11.0"}}},kimi:{id:"kimi",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","X-Msh-Version","X-Msh-Device-Model"],source:{capture:"kimi-code"},headers:function(){return{"X-Msh-Version":"2.1.2","X-Msh-Device-Model":`${(0,e.ol)()} ${(0,e.LY)()}`}}},"grok-cli":{id:"grok-cli",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent"],source:{capture:"grok-cli"},headers:function(a){return{"User-Agent":`grok-cli/${a?.version||"1.0.0"}`}}},"grok-build":{id:"grok-build",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","Accept","User-Agent","x-grok-client-identifier","x-grok-client-version"],source:{capture:"@xai-official/grok 0.2.99"},headers:function(){let a;return{"User-Agent":`grok-shell/${g.uG} (${(0,e.ol)()||"linux"}; ${"x64"===(a=(0,e.LY)())?"x86_64":"arm64"===a?"aarch64":"ia32"===a?"x86":a||"x86_64"})`,"x-grok-client-identifier":g.rK,"x-grok-client-version":g.uG}}},"muse-code":{id:"muse-code",tls:"node",alpn:["h2","http/1.1"],headerOrder:["Authorization","Content-Type","User-Agent","Accept"],source:{capture:"muse-code"},headers:a=>({"User-Agent":`muse-code/${a?.version||"1.0.2"}`})}};function k(a){return j[a]||j["openai-node"]}let l=new Set(["openai","openai-responses","openai-compat"]),m=new Set(["claude"]);function n(a,b={}){if("string"==typeof a&&a)return a;if(a&&"object"==typeof a&&a.profile)return a.profile;let c=b.format||"",d=b.provider||"";return"claude"===c||m.has(c)||"claude"===d||d.startsWith("anthropic-compatible")?"claude-cli":"codex"===d?"codex-cli":"gemini-cli"===d?"gemini-cli":"antigravity"===d?"antigravity":"github"===d?"copilot":"qwen"===d?"qwen":"cline"===d||"clinepass"===d?"cline":"kimi"===d||"kimi-coding"===d?"kimi":"xai"===d?"grok-cli":"grok-cli"===d?"grok-build":"grok-web"===d?"chrome":"cursor"===d||"cursor"===c?"cursor":"muse"===d||"meta"===d?"muse-code":(l.has(c),"openai-node")}let o=new Set(["user-agent","anthropic-beta","x-stainless-package-version","x-stainless-runtime-version","x-stainless-os","x-stainless-arch"]),p=new Set(["x-stainless-helper-method","x-stainless-retry-count"]);function q(a,b,c={}){var d;let e,f=k(b),g=(d=c.snapshot,"function"==typeof(e=k(b)).headers?e.headers(d):{...e.headers||{}});!0===c.stream&&"claude-cli"===b?g["X-Stainless-Helper-Method"]="stream":"claude-cli"===b&&delete g["X-Stainless-Helper-Method"],"number"==typeof c.retryCount&&"claude-cli"===b&&(g["X-Stainless-Retry-Count"]=String(c.retryCount));let h=new Map;for(let[b,c]of Object.entries(a||{})){let a=b.toLowerCase();("authorization"===a||"x-api-key"===a||"api-key"===a)&&h.set(a,[b,c])}let i=!0===c.preserveUserAgent&&"claude-cli"!==b&&Object.entries(a||{}).find(([a])=>"user-agent"===a.toLowerCase())||null,j=r(a,g),l=c.overlay&&"object"==typeof c.overlay?"claude-cli"===b?function(a,b){let c,d,e={...a||{}},f=0!==(d=Object.values(c=Object.fromEntries([...o].map(a=>{let b;return[a,(b=Object.keys(e||{}).find(b=>b.toLowerCase()===a))?e[b]:void 0]}))).filter(a=>null!=a).length)&&d===o.size&&String(c["user-agent"]).match(/claude-(?:cli|code)\/(\d+\.\d+\.\d+)/i)?.[1]===b?.version;for(let a of Object.keys(e)){let b=a.toLowerCase();(p.has(b)||!f&&o.has(b))&&delete e[a]}return e}(c.overlay,c.snapshot):{...c.overlay}:{};for(let a of Object.keys(l))h.has(a.toLowerCase())&&delete l[a];let m=r(j,l);if(i&&!Object.keys(l).some(a=>"user-agent"===a.toLowerCase())){for(let a of Object.keys(m))"user-agent"===a.toLowerCase()&&delete m[a];m[i[0]]=i[1]}if("claude-cli"===b){if(!0===c.stream)m["X-Stainless-Helper-Method"]="stream";else for(let a of Object.keys(m))"x-stainless-helper-method"===a.toLowerCase()&&delete m[a];if("number"==typeof c.retryCount){for(let a of Object.keys(m))"x-stainless-retry-count"===a.toLowerCase()&&delete m[a];m["X-Stainless-Retry-Count"]=String(c.retryCount)}}for(let[a,[b,c]]of h){for(let b of Object.keys(m))b.toLowerCase()===a&&delete m[b];m[b]=c}return f?.headerOrder?s(m,f.headerOrder):m}function r(...a){let b={};for(let c of a)for(let[a,d]of Object.entries(c||{})){let c=Object.keys(b).find(b=>b.toLowerCase()===a.toLowerCase());c&&delete b[c],b[a]=d}return b}function s(a,b){if(!b||!b.length)return{...a};let c=new Set,d={},e=new Map;for(let[b,c]of Object.entries(a))e.set(b.toLowerCase(),[b,c]);for(let a of b){let b=e.get(a.toLowerCase());b&&(d[b[0]]=b[1],c.add(a.toLowerCase()))}for(let[b,e]of Object.entries(a))c.has(b.toLowerCase())||(d[b]=e);return d}},59970:(a,b,c)=>{"use strict";let d,e=Symbol.for("undici.globalDispatcher.2"),f=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:g}=c(61448),h=c(37417),i=c(74399);function j(a){if(!a||"function"!=typeof a.dispatch)throw new g("Argument agent must implement Agent");try{Object.defineProperty(globalThis,e,{value:a,writable:!0,enumerable:!1,configurable:!1})}catch(b){if(b instanceof TypeError){d=a;return}throw b}try{let b=a instanceof i?a:new i(a);Object.defineProperty(globalThis,f,{value:b,writable:!0,enumerable:!1,configurable:!1})}catch(a){if(!(a instanceof TypeError))throw a}}function k(){return globalThis[e]??d}void 0===k()&&j(new h),a.exports={setGlobalDispatcher:j,getGlobalDispatcher:k,installedExports:["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"]}},60823:(a,b,c)=>{"use strict";let d=c(34589);a.exports=class{#aQ;#bF=!1;#bG=!1;#bH=!1;constructor(a){if("object"!=typeof a||null===a)throw TypeError("handler must be an object");this.#aQ=a}onRequestStart(...a){this.#aQ.onRequestStart?.(...a)}onRequestUpgrade(...a){return d(!this.#bF),d(!this.#bG),this.#aQ.onRequestUpgrade?.(...a)}onResponseStart(...a){return d(!this.#bF),d(!this.#bG),d(!this.#bH),this.#bH=!0,this.#aQ.onResponseStart?.(...a)}onResponseData(...a){return d(!this.#bF),d(!this.#bG),this.#aQ.onResponseData?.(...a)}onResponseEnd(...a){return d(!this.#bF),d(!this.#bG),this.#bF=!0,this.#aQ.onResponseEnd?.(...a)}onResponseError(...a){return this.#bG=!0,this.#aQ.onResponseError?.(...a)}onBodySent(...a){return this.#aQ.onBodySent?.(...a)}onRequestSent(...a){return this.#aQ.onRequestSent?.(...a)}}},61330:(a,b,c)=>{"use strict";let{BalancedPoolMissingUpstreamError:d,InvalidArgumentError:e}=c(61448),{PoolBase:f,kClients:g,kNeedDrain:h,kAddClient:i,kRemoveClient:j,kGetDispatcher:k}=c(39065),l=c(35689),{kOriginless:m,kUrl:n}=c(49176),o=c(84285),p=Symbol("factory"),q=Symbol("options"),r=Symbol("kGreatestCommonDivisor"),s=Symbol("kCurrentWeight"),t=Symbol("kIndex"),u=Symbol("kWeight"),v=Symbol("kMaxWeightPerServer"),w=Symbol("kErrorPenalty");function x(a,b){return new l(a,b)}class y extends f{constructor(a=[],{factory:b=x,connect:c,tls:d,...f}={}){if("function"!=typeof b)throw new e("factory must be a function.");for(const e of(super(f),this[m]=!0,c&&"function"!=typeof c&&(c={...c}),d&&"function"!=typeof d&&(d={...d}),this[q]={...o.deepClone(f),connect:c,tls:d},this[t]=-1,this[s]=0,this[v]=this[q].maxWeightPerServer||100,this[w]=this[q].errorPenalty||15,Array.isArray(a)||(a=[a]),this[p]=b,a))this.addUpstream(e);this._updateBalancedPoolStats()}addUpstream(a){let b=o.parseOrigin(a).origin;if(this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed))return this;let c=this[p](b,this[q]);for(let a of(this[i](c),c.on("connect",()=>{c[u]=Math.min(this[v],c[u]+this[w])}),c.on("connectionError",()=>{c[u]=Math.max(1,c[u]-this[w]),this._updateBalancedPoolStats()}),c.on("disconnect",(...a)=>{let b=a[2];b&&"UND_ERR_SOCKET"===b.code&&(c[u]=Math.max(1,c[u]-this[w]),this._updateBalancedPoolStats())}),this[g]))a[u]=this[v];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let a=0;for(let b=0;b<this[g].length;b++)a=function(a,b){if(0===a)return b;for(;0!==b;){let c=b;b=a%b,a=c}return a}(this[g][b][u],a);this[r]=a}removeUpstream(a){let b=o.parseOrigin(a).origin,c=this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed);return c&&this[j](c),this}getUpstream(a){let b=o.parseOrigin(a).origin;return this[g].find(a=>a[n].origin===b&&!0!==a.closed&&!0!==a.destroyed)}get upstreams(){return this[g].filter(a=>!0!==a.closed&&!0!==a.destroyed).map(a=>a[n].origin)}[k](){if(0===this[g].length)throw new d;let a=0,b=-1;for(;a++<this[g].length;){this[t]=(this[t]+1)%this[g].length;let a=this[g][this[t]];if((0===this[t]&&(this[s]=this[s]-this[r],this[s]<=0&&(this[s]=this[v])),!a[h]&&!0!==a.closed&&!0!==a.destroyed)&&((-1===b||a[u]>this[g][b][u])&&(b=this[t]),a[u]>=this[s]))return a}if(-1!==b)return this[s]=this[g][b][u],this[t]=b,this[g][b]}}a.exports=y},61448:a=>{"use strict";let b=Symbol.for("undici.error.UND_ERR");class c extends Error{constructor(a,b){super(a,b),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](a){return a&&!0===a[b]}get[b](){return!0}}let d=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");class e extends c{constructor(a){super(a),this.name="ConnectTimeoutError",this.message=a||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[d]}get[d](){return!0}}let f=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");class g extends c{constructor(a){super(a),this.name="HeadersTimeoutError",this.message=a||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[f]}get[f](){return!0}}let h=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");class i extends c{constructor(a){super(a),this.name="HeadersOverflowError",this.message=a||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](a){return a&&!0===a[h]}get[h](){return!0}}let j=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");class k extends c{constructor(a){super(a),this.name="BodyTimeoutError",this.message=a||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](a){return a&&!0===a[j]}get[j](){return!0}}let l=Symbol.for("undici.error.UND_ERR_INVALID_ARG");class m extends c{constructor(a){super(a),this.name="InvalidArgumentError",this.message=a||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](a){return a&&!0===a[l]}get[l](){return!0}}let n=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");class o extends c{constructor(a){super(a),this.name="InvalidReturnValueError",this.message=a||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](a){return a&&!0===a[n]}get[n](){return!0}}let p=Symbol.for("undici.error.UND_ERR_ABORT");class q extends c{constructor(a){super(a),this.name="AbortError",this.message=a||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](a){return a&&!0===a[p]}get[p](){return!0}}let r=Symbol.for("undici.error.UND_ERR_ABORTED");class s extends q{constructor(a){super(a),this.name="AbortError",this.message=a||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](a){return a&&!0===a[r]}get[r](){return!0}}let t=Symbol.for("undici.error.UND_ERR_INFO");class u extends c{constructor(a,b){super(a,b),this.name="InformationalError",this.message=a||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](a){return a&&!0===a[t]}get[t](){return!0}}let v=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");class w extends c{constructor(a){super(a),this.name="RequestContentLengthMismatchError",this.message=a||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](a){return a&&!0===a[v]}get[v](){return!0}}let x=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");class y extends c{constructor(a){super(a),this.name="ResponseContentLengthMismatchError",this.message=a||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](a){return a&&!0===a[x]}get[x](){return!0}}let z=Symbol.for("undici.error.UND_ERR_DESTROYED");class A extends c{constructor(a){super(a),this.name="ClientDestroyedError",this.message=a||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](a){return a&&!0===a[z]}get[z](){return!0}}let B=Symbol.for("undici.error.UND_ERR_CLOSED");class C extends c{constructor(a){super(a),this.name="ClientClosedError",this.message=a||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](a){return a&&!0===a[B]}get[B](){return!0}}let D=Symbol.for("undici.error.UND_ERR_SOCKET");class E extends c{constructor(a,b){super(a),this.name="SocketError",this.message=a||"Socket error",this.code="UND_ERR_SOCKET",this.socket=b}static[Symbol.hasInstance](a){return a&&!0===a[D]}get[D](){return!0}}let F=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");class G extends c{constructor(a){super(a),this.name="NotSupportedError",this.message=a||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](a){return a&&!0===a[F]}get[F](){return!0}}let H=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");class I extends c{constructor(a){super(a),this.name="MissingUpstreamError",this.message=a||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](a){return a&&!0===a[H]}get[H](){return!0}}let J=Symbol.for("undici.error.UND_ERR_HTTP_PARSER");class K extends Error{constructor(a,b,c){super(a),this.name="HTTPParserError",this.code=b?`HPE_${b}`:void 0,this.data=c?c.toString():void 0}static[Symbol.hasInstance](a){return a&&!0===a[J]}get[J](){return!0}}let L=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class M extends c{constructor(a){super(a),this.name="ResponseExceededMaxSizeError",this.message=a||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](a){return a&&!0===a[L]}get[L](){return!0}}let N=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class O extends c{constructor(a,b,{headers:c,data:d}){super(a),this.name="RequestRetryError",this.message=a||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=b,this.data=d,this.headers=c}static[Symbol.hasInstance](a){return a&&!0===a[N]}get[N](){return!0}}let P=Symbol.for("undici.error.UND_ERR_RESPONSE");class Q extends c{constructor(a,b,{headers:c,body:d}){super(a),this.name="ResponseError",this.message=a||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=b,this.body=d,this.headers=c}static[Symbol.hasInstance](a){return a&&!0===a[P]}get[P](){return!0}}let R=Symbol.for("undici.error.UND_ERR_PRX_TLS");class S extends c{constructor(a,b,c={}){super(b,{cause:a,...c}),this.name="SecureProxyConnectionError",this.message=b||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=a}static[Symbol.hasInstance](a){return a&&!0===a[R]}get[R](){return!0}}let T=Symbol.for("undici.error.UND_ERR_PRX_CONN");class U extends c{constructor(a,b,c={}){super(b,{cause:a,...c}),this.name="ProxyConnectionError",this.message=b||"Proxy Connection failed",this.code="UND_ERR_PRX_CONN",this.cause=a}static[Symbol.hasInstance](a){return a&&!0===a[T]}get[T](){return!0}}let V=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class W extends c{constructor(a){super(a),this.name="MaxOriginsReachedError",this.message=a||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](a){return a&&!0===a[V]}get[V](){return!0}}class X extends c{constructor(a,b){super(a),this.name="Socks5ProxyError",this.message=a||"SOCKS5 proxy error",this.code=b||"UND_ERR_SOCKS5"}}let Y=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED");class Z extends c{constructor(a){super(a),this.name="MessageSizeExceededError",this.message=a||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](a){return a&&!0===a[Y]}get[Y](){return!0}}a.exports={AbortError:q,HTTPParserError:K,UndiciError:c,HeadersTimeoutError:g,HeadersOverflowError:i,BodyTimeoutError:k,RequestContentLengthMismatchError:w,ConnectTimeoutError:e,InvalidArgumentError:m,InvalidReturnValueError:o,RequestAbortedError:s,ClientDestroyedError:A,ClientClosedError:C,InformationalError:u,SocketError:E,NotSupportedError:G,ResponseContentLengthMismatchError:y,BalancedPoolMissingUpstreamError:I,ResponseExceededMaxSizeError:M,RequestRetryError:O,ResponseError:Q,SecureProxyConnectionError:S,ProxyConnectionError:U,MaxOriginsReachedError:W,Socks5ProxyError:X,MessageSizeExceededError:Z}},62026:a=>{"use strict";a.exports={uid:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",sentCloseFrameState:{SENT:1,RECEIVED:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:65535,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{text:1,typedArray:2,arrayBuffer:3,blob:4}}},62457:(a,b,c)=>{"use strict";c.d(b,{Ut:()=>e,a_:()=>f,bC:()=>d,lW:()=>g,zh:()=>h});let d={STOP:"stop",LENGTH:"length",TOOL_CALLS:"tool_calls",CONTENT_FILTER:"content_filter",ERROR:"error"},e={END_TURN:"end_turn",MAX_TOKENS:"max_tokens",TOOL_USE:"tool_use",STOP_SEQUENCE:"stop_sequence"},f={STOP:"STOP",MAX_TOKENS:"MAX_TOKENS",SAFETY:"SAFETY",RECITATION:"RECITATION",BLOCKLIST:"BLOCKLIST",PROHIBITED_CONTENT:"PROHIBITED_CONTENT",SPII:"SPII",IMAGE_SAFETY:"IMAGE_SAFETY",MALFORMED_FUNCTION_CALL:"MALFORMED_FUNCTION_CALL",UNEXPECTED_TOOL_CALL:"UNEXPECTED_TOOL_CALL",FINISH_REASON_UNSPECIFIED:"FINISH_REASON_UNSPECIFIED",OTHER:"OTHER",LANGUAGE:"LANGUAGE",NO_IMAGE:"NO_IMAGE"},g=new Set([f.MALFORMED_FUNCTION_CALL,f.UNEXPECTED_TOOL_CALL,f.FINISH_REASON_UNSPECIFIED,f.OTHER,f.LANGUAGE,f.NO_IMAGE]),h=new Set([f.SAFETY,f.RECITATION,f.BLOCKLIST,f.SPII,f.IMAGE_SAFETY,f.PROHIBITED_CONTENT])},62571:(a,b,c)=>{"use strict";let d=c(53053),e=c(57975),f=e.debuglog("undici"),g=e.debuglog("fetch"),h=e.debuglog("websocket"),i={beforeConnect:d.channel("undici:client:beforeConnect"),connected:d.channel("undici:client:connected"),connectError:d.channel("undici:client:connectError"),sendHeaders:d.channel("undici:client:sendHeaders"),create:d.channel("undici:request:create"),bodySent:d.channel("undici:request:bodySent"),bodyChunkSent:d.channel("undici:request:bodyChunkSent"),bodyChunkReceived:d.channel("undici:request:bodyChunkReceived"),headers:d.channel("undici:request:headers"),trailers:d.channel("undici:request:trailers"),error:d.channel("undici:request:error"),open:d.channel("undici:websocket:open"),close:d.channel("undici:websocket:close"),socketError:d.channel("undici:websocket:socket_error"),ping:d.channel("undici:websocket:ping"),pong:d.channel("undici:websocket:pong"),proxyConnected:d.channel("undici:proxy:connected")},j=!1;function k(a=f){if(!j){if(i.beforeConnect.hasSubscribers||i.connected.hasSubscribers||i.connectError.hasSubscribers||i.sendHeaders.hasSubscribers){j=!0;return}j=!0,d.subscribe("undici:client:beforeConnect",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f}}=b;a("connecting to %s%s using %s%s",f,e?`:${e}`:"",d,c)}),d.subscribe("undici:client:connected",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f}}=b;a("connected to %s%s using %s%s",f,e?`:${e}`:"",d,c)}),d.subscribe("undici:client:connectError",b=>{let{connectParams:{version:c,protocol:d,port:e,host:f},error:g}=b;a("connection to %s%s using %s%s errored - %s",f,e?`:${e}`:"",d,c,g.message)}),d.subscribe("undici:client:sendHeaders",b=>{let{request:{method:c,path:d,origin:e}}=b;a("sending request to %s %s%s",c,e,d)})}}let l=!1,m=!1;(f.enabled||g.enabled)&&(k(g.enabled?g:f),function(a=f){if(!l){if(i.headers.hasSubscribers||i.trailers.hasSubscribers||i.error.hasSubscribers){l=!0;return}l=!0,d.subscribe("undici:request:headers",b=>{let{request:{method:c,path:d,origin:e},response:{statusCode:f}}=b;a("received response to %s %s%s - HTTP %d",c,e,d,f)}),d.subscribe("undici:request:trailers",b=>{let{request:{method:c,path:d,origin:e}}=b;a("trailers received from %s %s%s",c,e,d)}),d.subscribe("undici:request:error",b=>{let{request:{method:c,path:d,origin:e},error:f}=b;a("request to %s %s%s errored - %s",c,e,d,f.message)})}}(g.enabled?g:f)),h.enabled&&(k(f.enabled?f:h),function(a=h){if(!m){if(i.open.hasSubscribers||i.close.hasSubscribers||i.socketError.hasSubscribers||i.ping.hasSubscribers||i.pong.hasSubscribers){m=!0;return}m=!0,d.subscribe("undici:websocket:open",b=>{if(null!=b.address){let{address:c,port:d}=b.address;a("connection opened %s%s",c,d?`:${d}`:"")}else a("connection opened")}),d.subscribe("undici:websocket:close",b=>{let{websocket:c,code:d,reason:e}=b;a("closed connection to %s - %s %s",c.url,d,e)}),d.subscribe("undici:websocket:socket_error",b=>{a("connection errored - %s",b.message)}),d.subscribe("undici:websocket:ping",b=>{a("ping received")}),d.subscribe("undici:websocket:pong",b=>{a("pong received")})}}(h)),a.exports={channels:i}},62692:(a,b,c)=>{"use strict";c.d(b,{B:()=>m});var d=c(22256),e=c(38421),f=c(43835),g=c(27137),h=c(96997),i=c(19016),j=c(49471),k=c(85513),l=c(54383);class m extends d.Hv{constructor(){super("kiro",e.xq.kiro)}buildHeaders(a,b=!0){let c={...this.config.headers,"Amz-Sdk-Request":"attempt=1; max=3","Amz-Sdk-Invocation-Id":(0,g.A)()},d=a?.providerSpecificData?.authMethod,e="api_key"===d,f=a?.apiKey||(e?a?.accessToken:null);return e&&f?(c.Authorization=`Bearer ${f}`,c.tokentype="API_KEY"):a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`,"external_idp"===d&&(c.TokenType="EXTERNAL_IDP")),c}getOrderedBaseUrls(a){let b=this.getBaseUrls(),c=a?.providerSpecificData?.authMethod;if("api_key"!==c&&"external_idp"!==c&&"idc"!==c)return b;let d=(0,l.R)(a?.providerSpecificData?.profileArn),e=d?.region||(0,k.l6)((a?.providerSpecificData?.region||"").trim()),f=b.filter(a=>a.includes("amazonaws.com")),g=b.filter(a=>!a.includes("amazonaws.com"));if(0===f.length||"us-east-1"===e)return f.length>0?[...f,...g]:b;let h=f.find(a=>a.includes("://q."));if(!h)return[...f,...g];let i=e.startsWith("us-gov-")?`q-fips.${e}.amazonaws.com`:`q.${e}.amazonaws.com`;return[h.replace(/q\.[a-z0-9-]+\.amazonaws\.com/,i),...f.filter(a=>a!==h),...g]}buildUrl(a,b,c=0,d=null){let e=this.getOrderedBaseUrls(d);return e[c]||e[0]||this.config.baseUrl}transformRequest(a,b,c,d){return b}async execute(a){let b=await super.execute(a);return b?.response?.ok&&(b.response=this.transformEventStreamToSSE(b.response,a.model)),b}transformEventStreamToSSE(a,b){let c=new Uint8Array(0),d=0,e=`chatcmpl-${Date.now()}`,g=Math.floor(Date.now()/1e3),h=(0,f.$D)(b).upstream,k=(0,j.nl)("kiro",h).contextWindow||2e5,l={endDetected:!1,finishEmitted:!1,upstreamError:null,hasToolCalls:!1,hasReasoningContent:!1,reasoningChunkCount:0,toolCallIndex:0,seenToolIds:new Map,inThinking:!1},m=new TransformStream({async transform(a,f){let h=d,i=new Uint8Array(c.length+a.length);i.set(c),i.set(a,c.length),c=i;let j=0;for(;c.length>=16&&j<1e3;){j++;let a=new DataView(c.buffer,c.byteOffset).getUint32(0,!1);if(a<16||a>c.length||c.length<a)break;let h=c.slice(0,a);c=c.slice(a);let i=function(a){try{let b=new DataView(a.buffer,a.byteOffset).getUint32(4,!1),c={},d=12,e=12+b;for(;d<e&&d<a.length;){let b=a[d];if(++d+b>a.length)break;let e=new TextDecoder().decode(a.slice(d,d+b)),f=a[d+=b];if(d++,7===f){let b=a[d]<<8|a[d+1];if((d+=2)+b>a.length)break;let f=new TextDecoder().decode(a.slice(d,d+b));d+=b,c[e]=f}else break}let f=12+b,g=a.length-4,h=null;if(g>f){let b=new TextDecoder().decode(a.slice(f,g));if(!b||!b.trim())return{headers:c,payload:null};try{h=JSON.parse(b)}catch(a){console.warn(`[Kiro] Failed to parse payload: ${a.message} | payload: ${b.substring(0,100)}`),h={raw:b}}}return{headers:c,payload:h}}catch{return null}}(h);if(!i)continue;let m=i.headers[":event-type"]||"",n=i.headers[":exception-type"]||"";if(n||"exception"===i.headers[":message-type"]){let a=i.payload&&"object"==typeof i.payload?i.payload:{};l.upstreamError=String(a.message||a.Message||("string"==typeof i.payload?i.payload:"")||n||"Kiro upstream exception"),l.finishEmitted=!0;let c={id:e,object:"chat.completion.chunk",created:g,model:b,choices:[{index:0,delta:{},finish_reason:null}],error:{message:l.upstreamError,type:"server_error",code:n||"upstream_exception"}};d++,f.enqueue(new TextEncoder().encode(`data: ${JSON.stringify(c)}
|
|
369
369
|
|
|
370
370
|
`));continue}if(l.totalContentLength||(l.totalContentLength=0),l.contextUsagePercentage||(l.contextUsagePercentage=0),"assistantResponseEvent"===m&&i.payload?.content){let a=i.payload.content;if(l.inThinking)if(a.includes("</thinking>")){l.inThinking=!1;let b=a.split("</thinking>").slice(1).join("</thinking>");a=b.startsWith("\n")?b.substring(1):b}else a="";else if(a.includes("<thinking>"))if(l.inThinking=!0,a.includes("</thinking>")){l.inThinking=!1;let b=a.split("<thinking>")[0],c=a.split("</thinking>").slice(1).join("</thinking>");a=b+(c.startsWith("\n")?c.substring(1):c)}else a=a.split("<thinking>")[0];if(!a&&l.hasReasoningContent)continue;l.totalContentLength+=a.length;let c={id:e,object:"chat.completion.chunk",created:g,model:b,choices:[{index:0,delta:0===d?{role:"assistant",content:a}:{content:a},finish_reason:null}]};d++,f.enqueue(new TextEncoder().encode(`data: ${JSON.stringify(c)}
|
|
371
371
|
|
|
@@ -387,7 +387,7 @@ ${a.format(b)}`.trim():`${b.length} interceptors are pending:
|
|
|
387
387
|
|
|
388
388
|
${a.format(b)}`.trim())}}a.exports=G},65737:(a,b,c)=>{var d=c(45654);c(45518),c(63070),c(88819),c(1277),c(15529),c(36105),c(49345),c(87981),c(10401),c(33889);var e=d.asn1,f=a.exports=d.pki=d.pki||{},g=f.oids,h={};h.CN=g.commonName,h.commonName="CN",h.C=g.countryName,h.countryName="C",h.L=g.localityName,h.localityName="L",h.ST=g.stateOrProvinceName,h.stateOrProvinceName="ST",h.O=g.organizationName,h.organizationName="O",h.OU=g.organizationalUnitName,h.organizationalUnitName="OU",h.E=g.emailAddress,h.emailAddress="E";var i=d.pki.rsa.publicKeyValidator,j={name:"Certificate",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:e.Class.UNIVERSAL,type:e.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:e.Class.UNIVERSAL,type:e.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:e.Class.UNIVERSAL,type:e.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:e.Class.UNIVERSAL,type:e.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},i,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:e.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:e.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},k={name:"rsapss",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:e.Class.UNIVERSAL,type:e.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:e.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:e.Class.UNIVERSAL,type:e.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:e.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:e.Class.UNIVERSAL,type:e.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:e.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:e.Class.UNIVERSAL,type:e.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},i,{name:"CertificationRequestInfo.attributes",tagClass:e.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:e.Class.UNIVERSAL,type:e.Type.SET,constructed:!0}]}]}]},m={name:"CertificationRequest",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:e.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:e.Class.UNIVERSAL,type:e.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function n(a,b){"string"==typeof b&&(b={shortName:b});for(var c,d=null,e=0;null===d&&e<a.attributes.length;++e)c=a.attributes[e],b.type&&b.type===c.type||b.name&&b.name===c.name?d=c:b.shortName&&b.shortName===c.shortName&&(d=c);return d}f.RDNAttributesAsArray=function(a,b){for(var c,d,f,i=[],j=0;j<a.value.length;++j){c=a.value[j];for(var k=0;k<c.value.length;++k)f={},d=c.value[k],f.type=e.derToOid(d.value[0].value),f.value=d.value[1].value,f.valueTagClass=d.value[1].type,f.type in g&&(f.name=g[f.type],f.name in h&&(f.shortName=h[f.name])),b&&(b.update(f.type),b.update(f.value)),i.push(f)}return i},f.CRIAttributesAsArray=function(a){for(var b=[],c=0;c<a.length;++c)for(var d=a[c],i=e.derToOid(d.value[0].value),j=d.value[1].value,k=0;k<j.length;++k){var l={};if(l.type=i,l.value=j[k].value,l.valueTagClass=j[k].type,l.type in g&&(l.name=g[l.type],l.name in h&&(l.shortName=h[l.name])),l.type===g.extensionRequest){l.extensions=[];for(var m=0;m<l.value.length;++m)l.extensions.push(f.certificateExtensionFromAsn1(l.value[m]))}b.push(l)}return b};var o=function(a,b,c){var d={};if(a!==g["RSASSA-PSS"])return d;c&&(d={hash:{algorithmOid:g.sha1},mgf:{algorithmOid:g.mgf1,hash:{algorithmOid:g.sha1}},saltLength:20});var f={},h=[];if(!e.validate(b,k,f,h)){var i=Error("Cannot read RSASSA-PSS parameter block.");throw i.errors=h,i}return void 0!==f.hashOid&&(d.hash=d.hash||{},d.hash.algorithmOid=e.derToOid(f.hashOid)),void 0!==f.maskGenOid&&(d.mgf=d.mgf||{},d.mgf.algorithmOid=e.derToOid(f.maskGenOid),d.mgf.hash=d.mgf.hash||{},d.mgf.hash.algorithmOid=e.derToOid(f.maskGenHashOid)),void 0!==f.saltLength&&(d.saltLength=f.saltLength.charCodeAt(0)),d},p=function(a){switch(g[a.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return d.md.sha1.create();case"md5WithRSAEncryption":return d.md.md5.create();case"sha256WithRSAEncryption":case"RSASSA-PSS":return d.md.sha256.create();case"sha384WithRSAEncryption":return d.md.sha384.create();case"sha512WithRSAEncryption":return d.md.sha512.create();default:var b=Error("Could not compute "+a.type+" digest. Unknown signature OID.");throw b.signatureOid=a.signatureOid,b}},q=function(a){var b,c,e,f=a.certificate;switch(f.signatureOid){case g.sha1WithRSAEncryption:case g.sha1WithRSASignature:break;case g["RSASSA-PSS"]:if(void 0===(c=g[f.signatureParameters.mgf.hash.algorithmOid])||void 0===d.md[c]){var h=Error("Unsupported MGF hash function.");throw h.oid=f.signatureParameters.mgf.hash.algorithmOid,h.name=c,h}if(void 0===(e=g[f.signatureParameters.mgf.algorithmOid])||void 0===d.mgf[e]){var h=Error("Unsupported MGF function.");throw h.oid=f.signatureParameters.mgf.algorithmOid,h.name=e,h}if(e=d.mgf[e].create(d.md[c].create()),void 0===(c=g[f.signatureParameters.hash.algorithmOid])||void 0===d.md[c]){var h=Error("Unsupported RSASSA-PSS hash function.");throw h.oid=f.signatureParameters.hash.algorithmOid,h.name=c,h}b=d.pss.create(d.md[c].create(),e,f.signatureParameters.saltLength)}return f.publicKey.verify(a.md.digest().getBytes(),a.signature,b)};function r(a){for(var b,c,f=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),g=a.attributes,h=0;h<g.length;++h){var i=(b=g[h]).value,j=e.Type.PRINTABLESTRING;"valueTagClass"in b&&(j=b.valueTagClass)===e.Type.UTF8&&(i=d.util.encodeUtf8(i)),c=e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(b.type).getBytes()),e.create(e.Class.UNIVERSAL,j,!1,i)])]),f.value.push(c)}return f}function s(a){for(var b,c=0;c<a.length;++c){if(void 0===(b=a[c]).name&&(b.type&&b.type in f.oids?b.name=f.oids[b.type]:b.shortName&&b.shortName in h&&(b.name=f.oids[h[b.shortName]])),void 0===b.type)if(b.name&&b.name in f.oids)b.type=f.oids[b.name];else{var d=Error("Attribute type not specified.");throw d.attribute=b,d}if(void 0===b.shortName&&b.name&&b.name in h&&(b.shortName=h[b.name]),b.type===g.extensionRequest&&(b.valueConstructed=!0,b.valueTagClass=e.Type.SEQUENCE,!b.value&&b.extensions)){b.value=[];for(var i=0;i<b.extensions.length;++i)b.value.push(f.certificateExtensionToAsn1(t(b.extensions[i])))}if(void 0===b.value){var d=Error("Attribute value not specified.");throw d.attribute=b,d}}}function t(a,b){if(b=b||{},void 0===a.name&&a.id&&a.id in f.oids&&(a.name=f.oids[a.id]),void 0===a.id)if(a.name&&a.name in f.oids)a.id=f.oids[a.name];else{var c=Error("Extension ID not specified.");throw c.extension=a,c}if(void 0!==a.value)return a;if("keyUsage"===a.name){var h=0,i=0,j=0;a.digitalSignature&&(i|=128,h=7),a.nonRepudiation&&(i|=64,h=6),a.keyEncipherment&&(i|=32,h=5),a.dataEncipherment&&(i|=16,h=4),a.keyAgreement&&(i|=8,h=3),a.keyCertSign&&(i|=4,h=2),a.cRLSign&&(i|=2,h=1),a.encipherOnly&&(i|=1,h=0),a.decipherOnly&&(j|=128,h=7);var k=String.fromCharCode(h);0!==j?k+=String.fromCharCode(i)+String.fromCharCode(j):0!==i&&(k+=String.fromCharCode(i)),a.value=e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,k)}else if("basicConstraints"===a.name)a.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),a.cA&&a.value.value.push(e.create(e.Class.UNIVERSAL,e.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in a&&a.value.value.push(e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(a.pathLenConstraint).getBytes()));else if("extKeyUsage"===a.name){a.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);var l=a.value.value;for(var m in a)!0===a[m]&&(m in g?l.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(g[m]).getBytes())):-1!==m.indexOf(".")&&l.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(m).getBytes())))}else if("nsCertType"===a.name){var h=0,i=0;a.client&&(i|=128,h=7),a.server&&(i|=64,h=6),a.email&&(i|=32,h=5),a.objsign&&(i|=16,h=4),a.reserved&&(i|=8,h=3),a.sslCA&&(i|=4,h=2),a.emailCA&&(i|=2,h=1),a.objCA&&(i|=1,h=0);var k=String.fromCharCode(h);0!==i&&(k+=String.fromCharCode(i)),a.value=e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,k)}else if("subjectAltName"===a.name||"issuerAltName"===a.name){a.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);for(var n,o=0;o<a.altNames.length;++o){var k=(n=a.altNames[o]).value;if(7===n.type&&n.ip){if(null===(k=d.util.bytesFromIP(n.ip))){var c=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw c.extension=a,c}}else 8===n.type&&(k=n.oid?e.oidToDer(e.oidToDer(n.oid)):e.oidToDer(k));a.value.value.push(e.create(e.Class.CONTEXT_SPECIFIC,n.type,!1,k))}}else if("nsComment"===a.name&&b.cert){if(!/^[\x00-\x7F]*$/.test(a.comment)||a.comment.length<1||a.comment.length>128)throw Error('Invalid "nsComment" content.');a.value=e.create(e.Class.UNIVERSAL,e.Type.IA5STRING,!1,a.comment)}else if("subjectKeyIdentifier"===a.name&&b.cert){var p=b.cert.generateSubjectKeyIdentifier();a.subjectKeyIdentifier=p.toHex(),a.value=e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===a.name&&b.cert){a.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);var l=a.value.value;if(a.keyIdentifier){var q=!0===a.keyIdentifier?b.cert.generateSubjectKeyIdentifier().getBytes():a.keyIdentifier;l.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!1,q))}if(a.authorityCertIssuer){var s=[e.create(e.Class.CONTEXT_SPECIFIC,4,!0,[r(!0===a.authorityCertIssuer?b.cert.issuer:a.authorityCertIssuer)])];l.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,s))}if(a.serialNumber){var t=d.util.hexToBytes(!0===a.serialNumber?b.cert.serialNumber:a.serialNumber);l.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!1,t))}}else if("cRLDistributionPoints"===a.name){a.value=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);for(var n,l=a.value.value,u=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]),v=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]),o=0;o<a.altNames.length;++o){var k=(n=a.altNames[o]).value;if(7===n.type&&n.ip){if(null===(k=d.util.bytesFromIP(n.ip))){var c=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw c.extension=a,c}}else 8===n.type&&(k=n.oid?e.oidToDer(e.oidToDer(n.oid)):e.oidToDer(k));v.value.push(e.create(e.Class.CONTEXT_SPECIFIC,n.type,!1,k))}u.value.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[v])),l.push(u)}if(void 0===a.value){var c=Error("Extension value not specified.");throw c.extension=a,c}return a}function u(a,b){if(a!==g["RSASSA-PSS"])return e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"");var c=[];return void 0!==b.hash.algorithmOid&&c.push(e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(b.hash.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])])),void 0!==b.mgf.algorithmOid&&c.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(b.mgf.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(b.mgf.hash.algorithmOid).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.NULL,!1,"")])])])),void 0!==b.saltLength&&c.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(b.saltLength).getBytes())])),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,c)}f.certificateFromPem=function(a,b,c){var g=d.pem.decode(a)[0];if("CERTIFICATE"!==g.type&&"X509 CERTIFICATE"!==g.type&&"TRUSTED CERTIFICATE"!==g.type){var h=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw h.headerType=g.type,h}if(g.procType&&"ENCRYPTED"===g.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var i=e.fromDer(g.body,c);return f.certificateFromAsn1(i,b)},f.certificateToPem=function(a,b){var c={type:"CERTIFICATE",body:e.toDer(f.certificateToAsn1(a)).getBytes()};return d.pem.encode(c,{maxline:b})},f.publicKeyFromPem=function(a){var b=d.pem.decode(a)[0];if("PUBLIC KEY"!==b.type&&"RSA PUBLIC KEY"!==b.type){var c=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw c.headerType=b.type,c}if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");var g=e.fromDer(b.body);return f.publicKeyFromAsn1(g)},f.publicKeyToPem=function(a,b){var c={type:"PUBLIC KEY",body:e.toDer(f.publicKeyToAsn1(a)).getBytes()};return d.pem.encode(c,{maxline:b})},f.publicKeyToRSAPublicKeyPem=function(a,b){var c={type:"RSA PUBLIC KEY",body:e.toDer(f.publicKeyToRSAPublicKey(a)).getBytes()};return d.pem.encode(c,{maxline:b})},f.getPublicKeyFingerprint=function(a,b){var c,g=(b=b||{}).md||d.md.sha1.create();switch(b.type||"RSAPublicKey"){case"RSAPublicKey":c=e.toDer(f.publicKeyToRSAPublicKey(a)).getBytes();break;case"SubjectPublicKeyInfo":c=e.toDer(f.publicKeyToAsn1(a)).getBytes();break;default:throw Error('Unknown fingerprint type "'+b.type+'".')}g.start(),g.update(c);var h=g.digest();if("hex"===b.encoding){var i=h.toHex();return b.delimiter?i.match(/.{2}/g).join(b.delimiter):i}if("binary"===b.encoding)return h.getBytes();if(b.encoding)throw Error('Unknown encoding "'+b.encoding+'".');return h},f.certificationRequestFromPem=function(a,b,c){var g=d.pem.decode(a)[0];if("CERTIFICATE REQUEST"!==g.type){var h=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw h.headerType=g.type,h}if(g.procType&&"ENCRYPTED"===g.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");var i=e.fromDer(g.body,c);return f.certificationRequestFromAsn1(i,b)},f.certificationRequestToPem=function(a,b){var c={type:"CERTIFICATE REQUEST",body:e.toDer(f.certificationRequestToAsn1(a)).getBytes()};return d.pem.encode(c,{maxline:b})},f.createCertificate=function(){var a={};return a.version=2,a.serialNumber="00",a.signatureOid=null,a.signature=null,a.siginfo={},a.siginfo.algorithmOid=null,a.validity={},a.validity.notBefore=new Date,a.validity.notAfter=new Date,a.issuer={},a.issuer.getField=function(b){return n(a.issuer,b)},a.issuer.addField=function(b){s([b]),a.issuer.attributes.push(b)},a.issuer.attributes=[],a.issuer.hash=null,a.subject={},a.subject.getField=function(b){return n(a.subject,b)},a.subject.addField=function(b){s([b]),a.subject.attributes.push(b)},a.subject.attributes=[],a.subject.hash=null,a.extensions=[],a.publicKey=null,a.md=null,a.setSubject=function(b,c){s(b),a.subject.attributes=b,delete a.subject.uniqueId,c&&(a.subject.uniqueId=c),a.subject.hash=null},a.setIssuer=function(b,c){s(b),a.issuer.attributes=b,delete a.issuer.uniqueId,c&&(a.issuer.uniqueId=c),a.issuer.hash=null},a.setExtensions=function(b){for(var c=0;c<b.length;++c)t(b[c],{cert:a});a.extensions=b},a.getExtension=function(b){"string"==typeof b&&(b={name:b});for(var c,d=null,e=0;null===d&&e<a.extensions.length;++e)c=a.extensions[e],b.id&&c.id===b.id?d=c:b.name&&c.name===b.name&&(d=c);return d},a.sign=function(b,c){a.md=c||d.md.sha1.create();var h=g[a.md.algorithm+"WithRSAEncryption"];if(!h){var i=Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw i.algorithm=a.md.algorithm,i}a.signatureOid=a.siginfo.algorithmOid=h,a.tbsCertificate=f.getTBSCertificate(a);var j=e.toDer(a.tbsCertificate);a.md.update(j.getBytes()),a.signature=b.sign(a.md)},a.verify=function(b){var c=!1;if(!a.issued(b)){var d=b.issuer,g=a.subject,h=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw h.expectedIssuer=g.attributes,h.actualIssuer=d.attributes,h}var i=b.md;if(null===i){i=p({signatureOid:b.signatureOid,type:"certificate"});var j=b.tbsCertificate||f.getTBSCertificate(b),k=e.toDer(j);i.update(k.getBytes())}return null!==i&&(c=q({certificate:a,md:i,signature:b.signature})),c},a.isIssuer=function(b){var c=!1,d=a.issuer,e=b.subject;if(d.hash&&e.hash)c=d.hash===e.hash;else if(d.attributes.length===e.attributes.length){c=!0;for(var f,g,h=0;c&&h<d.attributes.length;++h)f=d.attributes[h],g=e.attributes[h],(f.type!==g.type||f.value!==g.value)&&(c=!1)}return c},a.issued=function(b){return b.isIssuer(a)},a.generateSubjectKeyIdentifier=function(){return f.getPublicKeyFingerprint(a.publicKey,{type:"RSAPublicKey"})},a.verifySubjectKeyIdentifier=function(){for(var b=g.subjectKeyIdentifier,c=0;c<a.extensions.length;++c){var e=a.extensions[c];if(e.id===b){var f=a.generateSubjectKeyIdentifier().getBytes();return d.util.hexToBytes(e.subjectKeyIdentifier)===f}}return!1},a},f.certificateFromAsn1=function(a,b){var c={},g=[];if(!e.validate(a,j,c,g)){var h=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw h.errors=g,h}if(e.derToOid(c.publicKeyOid)!==f.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var i=f.createCertificate();i.version=c.certVersion?c.certVersion.charCodeAt(0):0,i.serialNumber=d.util.createBuffer(c.certSerialNumber).toHex(),i.signatureOid=d.asn1.derToOid(c.certSignatureOid),i.signatureParameters=o(i.signatureOid,c.certSignatureParams,!0),i.siginfo.algorithmOid=d.asn1.derToOid(c.certinfoSignatureOid),i.siginfo.parameters=o(i.siginfo.algorithmOid,c.certinfoSignatureParams,!1),i.signature=c.certSignature;var k=[];if(void 0!==c.certValidity1UTCTime&&k.push(e.utcTimeToDate(c.certValidity1UTCTime)),void 0!==c.certValidity2GeneralizedTime&&k.push(e.generalizedTimeToDate(c.certValidity2GeneralizedTime)),void 0!==c.certValidity3UTCTime&&k.push(e.utcTimeToDate(c.certValidity3UTCTime)),void 0!==c.certValidity4GeneralizedTime&&k.push(e.generalizedTimeToDate(c.certValidity4GeneralizedTime)),k.length>2)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(k.length<2)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(i.validity.notBefore=k[0],i.validity.notAfter=k[1],i.tbsCertificate=c.tbsCertificate,b){i.md=p({signatureOid:i.signatureOid,type:"certificate"});var l=e.toDer(i.tbsCertificate);i.md.update(l.getBytes())}var m=d.md.sha1.create(),q=e.toDer(c.certIssuer);m.update(q.getBytes()),i.issuer.getField=function(a){return n(i.issuer,a)},i.issuer.addField=function(a){s([a]),i.issuer.attributes.push(a)},i.issuer.attributes=f.RDNAttributesAsArray(c.certIssuer),c.certIssuerUniqueId&&(i.issuer.uniqueId=c.certIssuerUniqueId),i.issuer.hash=m.digest().toHex();var r=d.md.sha1.create(),t=e.toDer(c.certSubject);return r.update(t.getBytes()),i.subject.getField=function(a){return n(i.subject,a)},i.subject.addField=function(a){s([a]),i.subject.attributes.push(a)},i.subject.attributes=f.RDNAttributesAsArray(c.certSubject),c.certSubjectUniqueId&&(i.subject.uniqueId=c.certSubjectUniqueId),i.subject.hash=r.digest().toHex(),c.certExtensions?i.extensions=f.certificateExtensionsFromAsn1(c.certExtensions):i.extensions=[],i.publicKey=f.publicKeyFromAsn1(c.subjectPublicKeyInfo),i},f.certificateExtensionsFromAsn1=function(a){for(var b=[],c=0;c<a.value.length;++c)for(var d=a.value[c],e=0;e<d.value.length;++e)b.push(f.certificateExtensionFromAsn1(d.value[e]));return b},f.certificateExtensionFromAsn1=function(a){var b={};if(b.id=e.derToOid(a.value[0].value),b.critical=!1,a.value[1].type===e.Type.BOOLEAN?(b.critical=0!==a.value[1].value.charCodeAt(0),b.value=a.value[2].value):b.value=a.value[1].value,b.id in g){if(b.name=g[b.id],"keyUsage"===b.name){var c=e.fromDer(b.value),f=0,h=0;c.value.length>1&&(f=c.value.charCodeAt(1),h=c.value.length>2?c.value.charCodeAt(2):0),b.digitalSignature=(128&f)==128,b.nonRepudiation=(64&f)==64,b.keyEncipherment=(32&f)==32,b.dataEncipherment=(16&f)==16,b.keyAgreement=(8&f)==8,b.keyCertSign=(4&f)==4,b.cRLSign=(2&f)==2,b.encipherOnly=(1&f)==1,b.decipherOnly=(128&h)==128}else if("basicConstraints"===b.name){var c=e.fromDer(b.value);c.value.length>0&&c.value[0].type===e.Type.BOOLEAN?b.cA=0!==c.value[0].value.charCodeAt(0):b.cA=!1;var i=null;c.value.length>0&&c.value[0].type===e.Type.INTEGER?i=c.value[0].value:c.value.length>1&&(i=c.value[1].value),null!==i&&(b.pathLenConstraint=e.derToInteger(i))}else if("extKeyUsage"===b.name)for(var c=e.fromDer(b.value),j=0;j<c.value.length;++j){var k=e.derToOid(c.value[j].value);k in g?b[g[k]]=!0:b[k]=!0}else if("nsCertType"===b.name){var c=e.fromDer(b.value),f=0;c.value.length>1&&(f=c.value.charCodeAt(1)),b.client=(128&f)==128,b.server=(64&f)==64,b.email=(32&f)==32,b.objsign=(16&f)==16,b.reserved=(8&f)==8,b.sslCA=(4&f)==4,b.emailCA=(2&f)==2,b.objCA=(1&f)==1}else if("subjectAltName"===b.name||"issuerAltName"===b.name){b.altNames=[];for(var l,c=e.fromDer(b.value),m=0;m<c.value.length;++m){var n={type:(l=c.value[m]).type,value:l.value};switch(b.altNames.push(n),l.type){case 1:case 2:case 6:break;case 7:n.ip=d.util.bytesToIP(l.value);break;case 8:n.oid=e.derToOid(l.value)}}}else if("subjectKeyIdentifier"===b.name){var c=e.fromDer(b.value);b.subjectKeyIdentifier=d.util.bytesToHex(c.value)}}return b},f.certificationRequestFromAsn1=function(a,b){var c={},g=[];if(!e.validate(a,m,c,g)){var h=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw h.errors=g,h}if(e.derToOid(c.publicKeyOid)!==f.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var i=f.createCertificationRequest();if(i.version=c.csrVersion?c.csrVersion.charCodeAt(0):0,i.signatureOid=d.asn1.derToOid(c.csrSignatureOid),i.signatureParameters=o(i.signatureOid,c.csrSignatureParams,!0),i.siginfo.algorithmOid=d.asn1.derToOid(c.csrSignatureOid),i.siginfo.parameters=o(i.siginfo.algorithmOid,c.csrSignatureParams,!1),i.signature=c.csrSignature,i.certificationRequestInfo=c.certificationRequestInfo,b){i.md=p({signatureOid:i.signatureOid,type:"certification request"});var j=e.toDer(i.certificationRequestInfo);i.md.update(j.getBytes())}var k=d.md.sha1.create();return i.subject.getField=function(a){return n(i.subject,a)},i.subject.addField=function(a){s([a]),i.subject.attributes.push(a)},i.subject.attributes=f.RDNAttributesAsArray(c.certificationRequestInfoSubject,k),i.subject.hash=k.digest().toHex(),i.publicKey=f.publicKeyFromAsn1(c.subjectPublicKeyInfo),i.getAttribute=function(a){return n(i,a)},i.addAttribute=function(a){s([a]),i.attributes.push(a)},i.attributes=f.CRIAttributesAsArray(c.certificationRequestInfoAttributes||[]),i},f.createCertificationRequest=function(){var a={};return a.version=0,a.signatureOid=null,a.signature=null,a.siginfo={},a.siginfo.algorithmOid=null,a.subject={},a.subject.getField=function(b){return n(a.subject,b)},a.subject.addField=function(b){s([b]),a.subject.attributes.push(b)},a.subject.attributes=[],a.subject.hash=null,a.publicKey=null,a.attributes=[],a.getAttribute=function(b){return n(a,b)},a.addAttribute=function(b){s([b]),a.attributes.push(b)},a.md=null,a.setSubject=function(b){s(b),a.subject.attributes=b,a.subject.hash=null},a.setAttributes=function(b){s(b),a.attributes=b},a.sign=function(b,c){a.md=c||d.md.sha1.create();var h=g[a.md.algorithm+"WithRSAEncryption"];if(!h){var i=Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw i.algorithm=a.md.algorithm,i}a.signatureOid=a.siginfo.algorithmOid=h,a.certificationRequestInfo=f.getCertificationRequestInfo(a);var j=e.toDer(a.certificationRequestInfo);a.md.update(j.getBytes()),a.signature=b.sign(a.md)},a.verify=function(){var b=!1,c=a.md;if(null===c){c=p({signatureOid:a.signatureOid,type:"certification request"});var d=a.certificationRequestInfo||f.getCertificationRequestInfo(a),g=e.toDer(d);c.update(g.getBytes())}return null!==c&&(b=q({certificate:a,md:c,signature:a.signature})),b},a};var v=new Date("1950-01-01T00:00:00Z"),w=new Date("2050-01-01T00:00:00Z");function x(a){return a>=v&&a<w?e.create(e.Class.UNIVERSAL,e.Type.UTCTIME,!1,e.dateToUtcTime(a)):e.create(e.Class.UNIVERSAL,e.Type.GENERALIZEDTIME,!1,e.dateToGeneralizedTime(a))}f.getTBSCertificate=function(a){var b=x(a.validity.notBefore),c=x(a.validity.notAfter),g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(a.version).getBytes())]),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,d.util.hexToBytes(a.serialNumber)),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.siginfo.algorithmOid).getBytes()),u(a.siginfo.algorithmOid,a.siginfo.parameters)]),r(a.issuer),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[b,c]),r(a.subject),f.publicKeyToAsn1(a.publicKey)]);return a.issuer.uniqueId&&g.value.push(e.create(e.Class.CONTEXT_SPECIFIC,1,!0,[e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+a.issuer.uniqueId)])),a.subject.uniqueId&&g.value.push(e.create(e.Class.CONTEXT_SPECIFIC,2,!0,[e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+a.subject.uniqueId)])),a.extensions.length>0&&g.value.push(f.certificateExtensionsToAsn1(a.extensions)),g},f.getCertificationRequestInfo=function(a){return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,e.integerToDer(a.version).getBytes()),r(a.subject),f.publicKeyToAsn1(a.publicKey),function(a){var b=e.create(e.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===a.attributes.length)return b;for(var c=a.attributes,f=0;f<c.length;++f){var g=c[f],h=g.value,i=e.Type.UTF8;"valueTagClass"in g&&(i=g.valueTagClass),i===e.Type.UTF8&&(h=d.util.encodeUtf8(h));var j=!1;"valueConstructed"in g&&(j=g.valueConstructed);var k=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(g.type).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SET,!0,[e.create(e.Class.UNIVERSAL,i,j,h)])]);b.value.push(k)}return b}(a)])},f.distinguishedNameToAsn1=function(a){return r(a)},f.certificateToAsn1=function(a){var b=a.tbsCertificate||f.getTBSCertificate(a);return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[b,e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.signatureOid).getBytes()),u(a.signatureOid,a.signatureParameters)]),e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+a.signature)])},f.certificateExtensionsToAsn1=function(a){var b=e.create(e.Class.CONTEXT_SPECIFIC,3,!0,[]),c=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);b.value.push(c);for(var d=0;d<a.length;++d)c.value.push(f.certificateExtensionToAsn1(a[d]));return b},f.certificateExtensionToAsn1=function(a){var b=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[]);b.value.push(e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.id).getBytes())),a.critical&&b.value.push(e.create(e.Class.UNIVERSAL,e.Type.BOOLEAN,!1,String.fromCharCode(255)));var c=a.value;return"string"!=typeof a.value&&(c=e.toDer(c).getBytes()),b.value.push(e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,c)),b},f.certificationRequestToAsn1=function(a){var b=a.certificationRequestInfo||f.getCertificationRequestInfo(a);return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[b,e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(a.signatureOid).getBytes()),u(a.signatureOid,a.signatureParameters)]),e.create(e.Class.UNIVERSAL,e.Type.BITSTRING,!1,"\0"+a.signature)])},f.createCaStore=function(a){var b={certs:{}};function c(a){return g(a),b.certs[a.hash]||null}function g(a){if(!a.hash){var b=d.md.sha1.create();a.attributes=f.RDNAttributesAsArray(r(a),b),a.hash=b.digest().toHex()}}if(b.getIssuer=function(a){return c(a.issuer)},b.addCertificate=function(a){if("string"==typeof a&&(a=d.pki.certificateFromPem(a)),g(a.subject),!b.hasCertificate(a))if(a.subject.hash in b.certs){var c=b.certs[a.subject.hash];d.util.isArray(c)||(c=[c]),c.push(a),b.certs[a.subject.hash]=c}else b.certs[a.subject.hash]=a},b.hasCertificate=function(a){"string"==typeof a&&(a=d.pki.certificateFromPem(a));var b=c(a.subject);if(!b)return!1;d.util.isArray(b)||(b=[b]);for(var g=e.toDer(f.certificateToAsn1(a)).getBytes(),h=0;h<b.length;++h)if(g===e.toDer(f.certificateToAsn1(b[h])).getBytes())return!0;return!1},b.listAllCertificates=function(){var a=[];for(var c in b.certs)if(b.certs.hasOwnProperty(c)){var e=b.certs[c];if(d.util.isArray(e))for(var f=0;f<e.length;++f)a.push(e[f]);else a.push(e)}return a},b.removeCertificate=function(a){if("string"==typeof a&&(a=d.pki.certificateFromPem(a)),g(a.subject),!b.hasCertificate(a))return null;var h,i=c(a.subject);if(!d.util.isArray(i))return h=b.certs[a.subject.hash],delete b.certs[a.subject.hash],h;for(var j=e.toDer(f.certificateToAsn1(a)).getBytes(),k=0;k<i.length;++k)j===e.toDer(f.certificateToAsn1(i[k])).getBytes()&&(h=i[k],i.splice(k,1));return 0===i.length&&delete b.certs[a.subject.hash],h},a)for(var h=0;h<a.length;++h){var i=a[h];b.addCertificate(i)}return b},f.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},f.verifyCertificateChain=function(a,b,c){"function"==typeof c&&(c={verify:c}),c=c||{};var e=(b=b.slice(0)).slice(0),g=c.validityCheckDate;void 0===g&&(g=new Date);var h=!0,i=null,j=0;do{var k=b.shift(),l=null,m=!1;if(g&&(g<k.validity.notBefore||g>k.validity.notAfter)&&(i={message:"Certificate is not valid yet or has expired.",error:f.certificateError.certificate_expired,notBefore:k.validity.notBefore,notAfter:k.validity.notAfter,now:g}),null===i){if(null===(l=b[0]||a.getIssuer(k))&&k.isIssuer(k)&&(m=!0,l=k),l){var n=l;d.util.isArray(n)||(n=[n]);for(var o=!1;!o&&n.length>0;){l=n.shift();try{o=l.verify(k)}catch(a){}}o||(i={message:"Certificate signature is invalid.",error:f.certificateError.bad_certificate})}null!==i||l&&!m||a.hasCertificate(k)||(i={message:"Certificate is not trusted.",error:f.certificateError.unknown_ca})}if(null===i&&l&&!k.isIssuer(l)&&(i={message:"Certificate issuer is invalid.",error:f.certificateError.bad_certificate}),null===i)for(var p={keyUsage:!0,basicConstraints:!0},q=0;null===i&&q<k.extensions.length;++q){var r=k.extensions[q];!r.critical||r.name in p||(i={message:"Certificate has an unsupported critical extension.",error:f.certificateError.unsupported_certificate})}if(null===i&&(!h||0===b.length&&(!l||m))){var s=k.getExtension("basicConstraints"),t=k.getExtension("keyUsage");null===t||t.keyCertSign&&null!==s||(i={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:f.certificateError.bad_certificate}),null===i&&null===s&&(i={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:f.certificateError.bad_certificate}),null!==i||null===s||s.cA||(i={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:f.certificateError.bad_certificate}),null===i&&null!==t&&"pathLenConstraint"in s&&j-1>s.pathLenConstraint&&(i={message:"Certificate basicConstraints pathLenConstraint violated.",error:f.certificateError.bad_certificate})}var u=null===i||i.error,v=c.verify?c.verify(u,j,e):u;if(!0===v)i=null;else throw!0===u&&(i={message:"The application rejected the certificate.",error:f.certificateError.bad_certificate}),(v||0===v)&&("object"!=typeof v||d.util.isArray(v)?"string"==typeof v&&(i.error=v):(v.message&&(i.message=v.message),v.error&&(i.error=v.error))),i;h=!1,++j}while(b.length>0);return!0}},66498:(a,b,c)=>{"use strict";let{promisify:d}=c(57975),e=c(40106),{buildMockDispatch:f}=c(70634),{kDispatches:g,kMockAgent:h,kClose:i,kOriginalClose:j,kOrigin:k,kOriginalDispatch:l,kConnected:m,kIgnoreTrailingSlash:n}=c(80830),{MockInterceptor:o}=c(55720),p=c(49176),{InvalidArgumentError:q}=c(61448);class r extends e{constructor(a,b){if(!b||!b.agent||"function"!=typeof b.agent.dispatch)throw new q("Argument opts.agent must implement Agent");super(a,b),this[h]=b.agent,this[k]=a,this[n]=b.ignoreTrailingSlash??!1,this[g]=[],this[m]=1,this[l]=this.dispatch,this[j]=this.close.bind(this),this.dispatch=f.call(this),this.close=this[i]}get[p.kConnected](){return this[m]}intercept(a){return new o(a&&{ignoreTrailingSlash:this[n],...a},this[g])}cleanMocks(){this[g]=[]}async [i](){await d(this[j])(),this[m]=0,this[h][p.kClients].delete(this[k])}}a.exports=r},66568:(a,b,c)=>{var d=c(45654);c(33889),a.exports=d.cipher=d.cipher||{},d.cipher.algorithms=d.cipher.algorithms||{},d.cipher.createCipher=function(a,b){var c=a;if("string"==typeof c&&(c=d.cipher.getAlgorithm(c))&&(c=c()),!c)throw Error("Unsupported algorithm: "+a);return new d.cipher.BlockCipher({algorithm:c,key:b,decrypt:!1})},d.cipher.createDecipher=function(a,b){var c=a;if("string"==typeof c&&(c=d.cipher.getAlgorithm(c))&&(c=c()),!c)throw Error("Unsupported algorithm: "+a);return new d.cipher.BlockCipher({algorithm:c,key:b,decrypt:!0})},d.cipher.registerAlgorithm=function(a,b){a=a.toUpperCase(),d.cipher.algorithms[a]=b},d.cipher.getAlgorithm=function(a){return(a=a.toUpperCase())in d.cipher.algorithms?d.cipher.algorithms[a]:null};var e=d.cipher.BlockCipher=function(a){this.algorithm=a.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=a.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=a.decrypt,this.algorithm.initialize(a)};e.prototype.start=function(a){var b={};for(var c in a=a||{})b[c]=a[c];b.decrypt=this._decrypt,this._finish=!1,this._input=d.util.createBuffer(),this.output=a.output||d.util.createBuffer(),this.mode.start(b)},e.prototype.update=function(a){for(a&&this._input.putBuffer(a);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},e.prototype.finish=function(a){a&&("ECB"===this.mode.name||"CBC"===this.mode.name)&&(this.mode.pad=function(b){return a(this.blockSize,b,!1)},this.mode.unpad=function(b){return a(this.blockSize,b,!0)});var b={};return b.decrypt=this._decrypt,b.overflow=this._input.length()%this.blockSize,(!!this._decrypt||!this.mode.pad||!!this.mode.pad(this._input,b))&&(this._finish=!0,this.update(),(!this._decrypt||!this.mode.unpad||!!this.mode.unpad(this.output,b))&&(!this.mode.afterFinish||!!this.mode.afterFinish(this.output,b)))}},67382:(a,b,c)=>{var d=c(45654);c(33889);var e=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],f=[1,2,3,5];a.exports=d.rc2=d.rc2||{},d.rc2.expandKey=function(a,b){"string"==typeof a&&(a=d.util.createBuffer(a)),b=b||128;var c,f=a,g=a.length(),h=b,i=Math.ceil(h/8);for(c=g;c<128;c++)f.putByte(e[f.at(c-1)+f.at(c-g)&255]);for(f.setAt(128-i,e[f.at(128-i)&255>>(7&h)]),c=127-i;c>=0;c--)f.setAt(c,e[f.at(c+1)^f.at(c+i)]);return f};var g=function(a,b,c){var e,g,h,i,j=!1,k=null,l=null,m=null,n=[];for(a=d.rc2.expandKey(a,b),h=0;h<64;h++)n.push(a.getInt16Le());c?(e=function(a){for(h=0;h<4;h++){var b,c;a[h]+=n[i]+(a[(h+3)%4]&a[(h+2)%4])+(~a[(h+3)%4]&a[(h+1)%4]),a[h]=(b=a[h])<<(c=f[h])&65535|(65535&b)>>16-c,i++}},g=function(a){for(h=0;h<4;h++)a[h]+=n[63&a[(h+3)%4]]}):(e=function(a){for(h=3;h>=0;h--){var b,c;a[h]=(65535&(b=a[h]))>>(c=f[h])|b<<16-c&65535,a[h]-=n[i]+(a[(h+3)%4]&a[(h+2)%4])+(~a[(h+3)%4]&a[(h+1)%4]),i--}},g=function(a){for(h=3;h>=0;h--)a[h]-=n[63&a[(h+3)%4]]});var o=function(a){var b=[];for(h=0;h<4;h++){var d=k.getInt16Le();null!==m&&(c?d^=m.getInt16Le():m.putInt16Le(d)),b.push(65535&d)}i=63*!c;for(var e=0;e<a.length;e++)for(var f=0;f<a[e][0];f++)a[e][1](b);for(h=0;h<4;h++)null!==m&&(c?m.putInt16Le(b[h]):b[h]^=m.getInt16Le()),l.putInt16Le(b[h])},p=null;return p={start:function(a,b){a&&"string"==typeof a&&(a=d.util.createBuffer(a)),j=!1,k=d.util.createBuffer(),l=b||new d.util.createBuffer,m=a,p.output=l},update:function(a){for(j||k.putBuffer(a);k.length()>=8;)o([[5,e],[1,g],[6,e],[1,g],[5,e]])},finish:function(a){var b=!0;if(c)if(a)b=a(8,k,!c);else{var d=8===k.length()?8:8-k.length();k.fillWithByte(d,d)}if(b&&(j=!0,p.update()),!c&&(b=0===k.length()))if(a)b=a(8,l,!c);else{var e=l.length(),f=l.at(e-1);f>e?b=!1:l.truncate(f)}return b}}};d.rc2.startEncrypting=function(a,b,c){var e=d.rc2.createEncryptionCipher(a,128);return e.start(b,c),e},d.rc2.createEncryptionCipher=function(a,b){return g(a,b,!0)},d.rc2.startDecrypting=function(a,b,c){var e=d.rc2.createDecryptionCipher(a,128);return e.start(b,c),e},d.rc2.createDecryptionCipher=function(a,b){return g(a,b,!1)}},67449:a=>{"use strict";let b=new TextDecoder;a.exports={utf8DecodeBytes:function(a){return 0===a.length?"":(239===a[0]&&187===a[1]&&191===a[2]&&(a=a.subarray(3)),b.decode(a))}}},67519:(a,b,c)=>{"use strict";let d=c(84285),e=c(34589),{InvalidArgumentError:f}=c(61448),{kRequestOrigin:g}=c(49176),h=[300,301,302,303,307,308],i=()=>{};class j{static buildDispatch(a,b){if(null!=b&&(!Number.isInteger(b)||b<0))throw new f("maxRedirections must be a positive number");let c=a.dispatch.bind(a);return(a,d)=>c(a,new j(c,b,a,d))}constructor(a,b,c,e){if(null!=b&&(!Number.isInteger(b)||b<0))throw new f("maxRedirections must be a positive number");if(null!=c.throwOnMaxRedirect&&"boolean"!=typeof c.throwOnMaxRedirect)throw new f("throwOnMaxRedirect must be a boolean");this.dispatch=a,this.location=null;const{maxRedirections:g,stripHeadersOnRedirect:h,stripHeadersOnCrossOriginRedirect:i,...j}=c;this.opts=j,this.opts.body=d.wrapRequestBody(this.opts.body),this.stripHeadersOnRedirect=l(h,"stripHeadersOnRedirect"),this.stripHeadersOnCrossOriginRedirect=l(i,"stripHeadersOnCrossOriginRedirect"),this.maxRedirections=b,this.handler=e,this.history=[]}onRequestStart(a,b){this.handler.onRequestStart?.(a,{...b,history:this.history})}onBodySent(a){this.handler.onBodySent?.(a)}onRequestSent(){this.handler.onRequestSent?.()}onRequestUpgrade(a,b,c,d){this.handler.onRequestUpgrade?.(a,b,c,d)}onResponseStart(a,b,c,j){if(b<200)return void this.handler.onResponseStart?.(a,b,c,j);if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw Error("max redirects");let l=303===b;(301===b||302===b)&&"POST"===this.opts.method&&(this.opts.method="GET",d.isStream(this.opts.body)&&d.destroy(this.opts.body.on("error",i)),this.opts.body=null,l=!0),303===b&&"HEAD"!==this.opts.method&&(this.opts.method="GET",d.isStream(this.opts.body)&&d.destroy(this.opts.body.on("error",i)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||d.isDisturbed(this.opts.body)||-1===h.indexOf(b)?null:c.location;let m=void 0===this.opts[g]?this.opts.origin:this.opts[g];if(m&&this.history.push(new URL(this.opts.path,m)),!this.location)return void this.handler.onResponseStart?.(a,b,c,j);let n=m?new URL(this.opts.path,m):void 0,{origin:o,pathname:p,search:q}=d.parseURL(new URL(this.location,n)),r=q?`${p}${q}`:p,s=`${o}${r}`;for(let a of this.history)if(a.toString()===s)throw new f(`Redirect loop detected. Cannot redirect to ${o}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=function(a,b,c,f,g){let h=[];if(Array.isArray(a))for(let d=0;d<a.length;d+=2)k(a[d],b,c,f,g)||h.push(a[d],a[d+1]);else if(a&&"object"==typeof a)for(let[e,i]of d.hasSafeIterator(a)?a:Object.entries(a))k(e,b,c,f,g)||h.push(e,i);else e(null==a,"headers must be an object or an array");return h}(this.opts.headers,l,m!==o,this.stripHeadersOnRedirect,this.stripHeadersOnCrossOriginRedirect),this.opts.path=r,this.opts.origin=o,this.opts[g]=o,this.opts.query=null}onResponseData(a,b){this.location||this.handler.onResponseData?.(a,b)}onResponseEnd(a,b){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(a,b)}onResponseError(a,b){this.handler.onResponseError?.(a,b)}}function k(a,b,c,e,f){let g=d.headerNameToString(a);return!!("host"===g||e?.has(g)||c&&f?.has(g)||b&&g.startsWith("content-"))||!!c&&("authorization"===g||"cookie"===g||"proxy-authorization"===g)}function l(a,b){if(null==a)return null;if(!Array.isArray(a))throw new f(`${b} must be an array`);let c=new Set;for(let e of a){if("string"!=typeof e)throw new f(`${b} must contain header names`);c.add(d.headerNameToString(e))}return c}a.exports=j},67594:(a,b,c)=>{"use strict";c.d(b,{j:()=>i});var d=c(22256),e=c(38421),f=c(77321),g=c(49623);let h=new Set;class i extends d.Hv{constructor(){super("opencode",e.xq.opencode)}transformRequest(a,b,c,d){return super.transformRequest(a,b,c,d),(0,f.Z)({provider:this.provider,model:a,body:b})}buildUrl(a){let b=this.config.baseUrl;return h.has(a)?`${b}/zen/v1/messages`:`${b}/zen/v1/chat/completions`}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",Authorization:"Bearer public","x-opencode-client":"desktop"};return c["x-opencode-session"]||(c["x-opencode-session"]=(0,g.oV)({headers:a?.rawHeaders,connectionId:a?.connectionId,scope:"opencode"})),b&&(c.Accept="text/event-stream"),c}}},68176:(a,b,c)=>{"use strict";c.d(b,{H:()=>g});let d=Symbol.for("switchboard.adapterShutdownRegistry"),e=globalThis[d]??={closers:new Set,flushers:new Set,listener:null,signalHandlers:null};function f(){for(let a of[e.flushers,e.closers])for(let b of[...a])if(a.delete(b))try{b()}catch{}}if(e.flushers??=new Set,!e.listener)for(let[a,b]of(e.listener=()=>{f()},process.on("beforeExit",e.listener),process.on("exit",e.listener),e.signalHandlers=Object.fromEntries(["SIGTERM","SIGINT",..."win32"===process.platform?["SIGBREAK"]:[]].map(a=>[a,()=>(a=>{if(f(),e.signalHandlers){for(let[a,b]of Object.entries(e.signalHandlers))process.removeListener(a,b);e.signalHandlers=null}if(!(process.listenerCount(a)>0))try{process.kill(process.pid,a)}catch{process.exit("SIGINT"===a?130:143)}})(a)])),Object.entries(e.signalHandlers)))process.on(a,b);function g(a,{flush:b=!1}={}){let c=b?e.flushers:e.closers;c.add(a);let d=!0;return()=>!!d&&(d=!1,c.delete(a))}},68531:(a,b,c)=>{"use strict";c.d(b,{h:()=>d});let d={OPENAI:"openai",OPENAI_RESPONSES:"openai-responses",OPENAI_RESPONSE:"openai-response",CLAUDE:"claude",GEMINI:"gemini",GEMINI_CLI:"gemini-cli",VERTEX:"vertex",CODEX:"codex",ANTIGRAVITY:"antigravity",KIRO:"kiro",CURSOR:"cursor",OLLAMA:"ollama",COMMANDCODE:"commandcode"}},68759:(a,b,c)=>{"use strict";let d;a=c.nmd(a);let{Buffer:e}=c(4573);Object.defineProperty(a,"exports",{get:()=>d||(d=e.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAw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0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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UUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiAD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AgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBA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AWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAM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gYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0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ACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgA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MkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAEL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c)=>{"use strict";c.d(b,{Qm:()=>d,lc:()=>e});let d=2e4;function e(a){let b="string"==typeof a?a:String(a??""),c=b.indexOf("/");return -1===c?b:b.slice(0,c)}},69445:(a,b,c)=>{a.exports=c(1277),c(38627),c(4554),c(6680),c(37691)},69493:(a,b,c)=>{"use strict";c(68531),c(9960),c(75371),c(22268),c(80152),c(82689),c(82703),c(81556),c(17438),c(25720),c(39490)},69537:(a,b,c)=>{"use strict";c.d(b,{A:()=>n});var d=c(74570);let e={id:"deepseek",priority:110,alias:"deepseek",aliases:["ds"],uiAlias:"ds",display:{name:"DeepSeek",icon:"bolt",color:"#4D6BFE",textIcon:"DS",website:"https://deepseek.com",notice:{apiKeyUrl:"https://platform.deepseek.com/api_keys"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.deepseek.com/chat/completions",validateUrl:"https://api.deepseek.com/models",reasoningInject:{scope:"all"}},transports:[{identity:"openai-node",format:"openai",baseUrl:"https://api.deepseek.com/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"openai-node",format:"claude",baseUrl:"https://api.deepseek.com/anthropic/v1/messages",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro"},{id:"deepseek-v4-pro-max",name:"DeepSeek V4 Pro Max",upstreamModelId:"deepseek-v4-pro"},{id:"deepseek-v4-pro-none",name:"DeepSeek V4 Pro No Thinking",upstreamModelId:"deepseek-v4-pro"},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash"},{id:"deepseek-chat",name:"DeepSeek V3.2 Chat"},{id:"deepseek-reasoner",name:"DeepSeek V3.2 Reasoner"}],features:{usage:!0,usageApikey:!0}},f={id:"glm",priority:140,alias:"glm",display:{name:"GLM Coding",icon:"code",color:"#2563EB",textIcon:"GL",website:"https://open.bigmodel.cn",notice:{apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys"}},category:"apikey",transport:{identity:"claude-cli",baseUrl:"https://api.z.ai/api/anthropic/v1/messages",format:"claude",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"},usage:{url:"https://api.z.ai/api/monitor/usage/quota/limit"}},transports:[{identity:"claude-cli",format:"openai",baseUrl:"https://api.z.ai/api/coding/paas/v4/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"claude-cli",format:"claude",baseUrl:"https://api.z.ai/api/anthropic/v1/messages",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"glm-5.3",name:"GLM 5.3"},{id:"glm-5.2",name:"GLM 5.2"},{id:"glm-5.1",name:"GLM 5.1"},{id:"glm-5",name:"GLM 5"},{id:"glm-4.7",name:"GLM 4.7"},{id:"glm-4.6v",name:"GLM 4.6V (Vision)"}],features:{usage:!0,usageApikey:!0}};var g=c(45431);let h={id:"kimi-coding",hidden:!0,priority:120,alias:"kmc",display:{name:"Kimi Coding",icon:"psychology",color:"#1E40AF",textIcon:"KC",website:"https://kimi.moonshot.cn",notice:{signupUrl:"https://kimi.moonshot.cn"}},category:"oauth",transport:{identity:"kimi",baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",urlSuffix:"?beta=true",headers:{...d.Bi},clientId:"17e5f671-d194-4dfb-9706-5516cb48c098",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshUrl:"https://auth.kimi.com/api/oauth/token",auth:{combined:!0,header:"x-api-key",scheme:"raw",hooks:["kimiHeaders"]}},transports:[{identity:"kimi",format:"openai",baseUrl:"https://api.kimi.com/coding/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["kimiHeaders"]}},{identity:"kimi",format:"claude",baseUrl:"https://api.kimi.com/coding/v1/messages",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw",hooks:["kimiHeaders"]}}],models:[{id:"kimi-k2.6",name:"Kimi K2.6"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}],oauth:{deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token",refreshLeadMs:3e5},features:{usage:!0}},i={id:"kimi",priority:170,alias:"kimi",display:{name:"Kimi",icon:"psychology",color:"#1E3A8A",textIcon:"KM",website:"https://kimi.moonshot.cn",notice:{apiKeyUrl:"https://platform.moonshot.ai/console/api-keys"}},category:"apikey",transport:{identity:"kimi",baseUrl:"https://api.kimi.com/coding/v1/messages",format:"claude",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}},transports:[{identity:"kimi",format:"openai",baseUrl:"https://api.kimi.com/coding/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"kimi",format:"claude",baseUrl:"https://api.kimi.com/coding/v1/messages",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"kimi-k2.6",name:"Kimi K2.6"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"kimi-k2.5-thinking",name:"Kimi K2.5 Thinking"},{id:"kimi-latest",name:"Kimi Latest"}],serviceKinds:["llm","webSearch"],features:{usage:!0,usageApikey:!0},searchViaChat:{defaultModel:"kimi-k2.5",endpoint:"https://api.moonshot.cn/v1/chat/completions",pricingUrl:"https://platform.moonshot.ai/docs/pricing/chat"}},j={id:"minimax-cn",priority:190,alias:"minimax-cn",display:{name:"Minimax (China)",icon:"memory",color:"#DC2626",textIcon:"MC",website:"https://www.minimaxi.com",notice:{apiKeyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key"}},category:"apikey",transport:{identity:"claude-cli",baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",format:"claude",urlSuffix:"?beta=true",headers:{...d.Bi},quirks:{dropOutputConfig:!0},reasoningInject:{scope:"all"},auth:{combined:!0,header:"x-api-key",scheme:"raw"},usage:{urls:["https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains","https://api.minimaxi.com/v1/api/openplatform/coding_plan/remains"]}},transports:[{identity:"claude-cli",format:"openai",baseUrl:"https://api.minimaxi.com/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"claude-cli",format:"claude",baseUrl:"https://api.minimaxi.com/anthropic/v1/messages",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"MiniMax-M3",name:"MiniMax M3",targetFormat:"claude"},{id:"MiniMax-M2.7",name:"MiniMax M2.7"},{id:"MiniMax-M2.5",name:"MiniMax M2.5"},{id:"MiniMax-M2.1",name:"MiniMax M2.1"},{id:"speech-2.8-hd",name:"Speech 2.8 HD",kind:"tts"},{id:"speech-2.8-turbo",name:"Speech 2.8 Turbo",kind:"tts"},{id:"speech-2.6-hd",name:"Speech 2.6 HD",kind:"tts"},{id:"speech-2.6-turbo",name:"Speech 2.6 Turbo",kind:"tts"},{id:"speech-02-hd",name:"Speech 02 HD",kind:"tts"},{id:"speech-02-turbo",name:"Speech 02 Turbo",kind:"tts"},{id:"speech-01-hd",name:"Speech 01 HD",kind:"tts"},{id:"speech-01-turbo",name:"Speech 01 Turbo",kind:"tts"}],serviceKinds:["llm","tts"],ttsConfig:{identity:"claude-cli",baseUrl:"https://api.minimaxi.com/v1/t2a_v2",authType:"apikey",authHeader:"bearer",format:"minimax-tts"},features:{usage:!0,usageApikey:!0}},k={id:"minimax",priority:90,alias:"minimax",display:{name:"Minimax Coding",icon:"memory",color:"#7C3AED",textIcon:"MM",website:"https://www.minimaxi.com",notice:{apiKeyUrl:"https://platform.minimaxi.com/user-center/basic-information/interface-key"}},category:"apikey",transport:{identity:"claude-cli",baseUrl:"https://api.minimax.io/anthropic/v1/messages",format:"claude",urlSuffix:"?beta=true",headers:{...d.Bi},quirks:{dropOutputConfig:!0},reasoningInject:{scope:"all"},auth:{combined:!0,header:"x-api-key",scheme:"raw"},usage:{urls:["https://www.minimax.io/v1/token_plan/remains","https://api.minimax.io/v1/api/openplatform/coding_plan/remains"]}},transports:[{identity:"claude-cli",format:"openai",baseUrl:"https://api.minimax.io/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"claude-cli",format:"claude",baseUrl:"https://api.minimax.io/anthropic/v1/messages",urlSuffix:"?beta=true",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"MiniMax-M3",name:"MiniMax M3",targetFormat:"claude"},{id:"MiniMax-M2.7",name:"MiniMax M2.7"},{id:"MiniMax-M2.5",name:"MiniMax M2.5"},{id:"MiniMax-M2.1",name:"MiniMax M2.1"},{id:"minimax-image-01",name:"MiniMax Image 01",params:["n","size","response_format"],kind:"image"},{id:"speech-2.8-hd",name:"Speech 2.8 HD",kind:"tts"},{id:"speech-2.8-turbo",name:"Speech 2.8 Turbo",kind:"tts"},{id:"speech-2.6-hd",name:"Speech 2.6 HD",kind:"tts"},{id:"speech-2.6-turbo",name:"Speech 2.6 Turbo",kind:"tts"},{id:"speech-02-hd",name:"Speech 02 HD",kind:"tts"},{id:"speech-02-turbo",name:"Speech 02 Turbo",kind:"tts"},{id:"speech-01-hd",name:"Speech 01 HD",kind:"tts"},{id:"speech-01-turbo",name:"Speech 01 Turbo",kind:"tts"}],serviceKinds:["llm","image","imageToText","webSearch","tts"],ttsConfig:{identity:"claude-cli",baseUrl:"https://api.minimax.io/v1/t2a_v2",authType:"apikey",authHeader:"bearer",format:"minimax-tts"},imageConfig:{identity:"claude-cli",baseUrl:"https://api.minimaxi.com/v1/images/generations"},searchViaChat:{defaultModel:"MiniMax-M2.7",endpoint:"https://api.minimaxi.com/v1/text/chatcompletion_v2",pricingUrl:"https://www.minimaxi.com/document/price"},features:{usage:!0,usageApikey:!0}},l={id:"xiaomi-mimo",priority:290,alias:"xiaomi-mimo",aliases:["mimo"],uiAlias:"mimo",display:{name:"Xiaomi MiMo",icon:"smart_toy",color:"#FF6900",textIcon:"XM",website:"https://xiaomimimo.com",notice:{apiKeyUrl:"https://xiaomimimo.com"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",validateUrl:"https://api.xiaomimimo.com/v1/models"},transports:[{identity:"openai-node",format:"openai",baseUrl:"https://api.xiaomimimo.com/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"openai-node",format:"claude",baseUrl:"https://api.xiaomimimo.com/anthropic/v1/messages",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"mimo-v2.5-pro",name:"MiMo V2.5 Pro"},{id:"mimo-v2.5",name:"MiMo V2.5"},{id:"mimo-v2-omni",name:"MiMo V2 Omni"},{id:"mimo-v2-flash",name:"MiMo V2 Flash"}]},m={id:"xiaomi-tokenplan",priority:300,alias:"xiaomi-tokenplan",aliases:["xmtp"],uiAlias:"xmtp",display:{name:"Xiaomi MiMo (Token Plan)",icon:"smart_toy",color:"#FF6700",textIcon:"XT",website:"https://mimo.xiaomi.com",notice:{text:"Xiaomi MiMo Token Plan subscription (API key starts with tp-). Token Plan keys are cluster-specific — select the region matching your subscription.",apiKeyUrl:"https://mimo.xiaomi.com"}},category:"apikey",hasProviderSpecificData:!0,regions:[{id:"sgp",label:"Singapore (新加坡)"},{id:"cn",label:"China (中国大陆)"},{id:"ams",label:"Amsterdam (阿姆斯特丹)"}],defaultRegion:"sgp",transport:{identity:"openai-node",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1/chat/completions",regions:{sgp:"https://token-plan-sgp.xiaomimimo.com/v1",cn:"https://token-plan-cn.xiaomimimo.com/v1",ams:"https://token-plan-ams.xiaomimimo.com/v1"},defaultRegion:"sgp"},transports:[{identity:"openai-node",format:"openai",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"openai-node",format:"claude",headers:{...d.Bi},auth:{combined:!0,header:"x-api-key",scheme:"raw"}}],models:[{id:"mimo-v2.5-pro",name:"MiMo V2.5 Pro"},{id:"mimo-v2.5-pro-claude",name:"MiMo V2.5 Pro (Claude Native)",targetFormat:"claude",upstreamModelId:"mimo-v2.5-pro"},{id:"mimo-v2.5",name:"MiMo V2.5"},{id:"mimo-v2-pro",name:"MiMo V2 Pro"},{id:"mimo-v2-omni",name:"MiMo V2 Omni"},{id:"mimo-v2-tts",name:"MiMo V2 TTS"},{id:"mimo-v2.5-tts",name:"MiMo V2.5 TTS"},{id:"mimo-v2.5-tts-voiceclone",name:"MiMo V2.5 TTS Voice Clone"},{id:"mimo-v2.5-tts-voicedesign",name:"MiMo V2.5 TTS Voice Design"}]},n=[{id:"alicode-intl",priority:10,alias:"alicode-intl",display:{name:"Alibaba Intl",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://modelstudio.console.alibabacloud.com",notice:{apiKeyUrl:"https://modelstudio.console.alibabacloud.com/?apiKey=1"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions",headers:{},quirks:{preserveCacheControl:!0}},models:[{id:"qwen3.5-plus",name:"Qwen3.5 Plus"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"glm-5",name:"GLM 5"},{id:"MiniMax-M2.5",name:"MiniMax M2.5"},{id:"qwen3-coder-next",name:"Qwen3 Coder Next"},{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"glm-4.7",name:"GLM 4.7"}]},{id:"alicode",priority:20,alias:"alicode",display:{name:"Alibaba",icon:"cloud",color:"#FF6A00",textIcon:"ALi",website:"https://bailian.console.aliyun.com",notice:{apiKeyUrl:"https://bailian.console.aliyun.com/?apiKey=1"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://coding.dashscope.aliyuncs.com/v1/chat/completions",headers:{},quirks:{preserveCacheControl:!0}},models:[{id:"qwen3.5-plus",name:"Qwen3.5 Plus"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"glm-5",name:"GLM 5"},{id:"MiniMax-M2.5",name:"MiniMax M2.5"},{id:"qwen3-max-2026-01-23",name:"Qwen3 Max"},{id:"qwen3-coder-next",name:"Qwen3 Coder Next"},{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"glm-4.7",name:"GLM 4.7"}]},{id:"anthropic",priority:30,alias:"anthropic",display:{name:"Anthropic",icon:"smart_toy",color:"#D97757",textIcon:"AN",website:"https://console.anthropic.com",notice:{apiKeyUrl:"https://console.anthropic.com/settings/keys"}},category:"apikey",transport:{identity:"claude-cli",baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Beta":"claude-code-20250219,interleaved-thinking-2025-05-14"},auth:{apiKey:{header:"x-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"}}},models:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"claude-opus-4-20250514",name:"Claude Opus 4"},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"}],serviceKinds:["llm","imageToText"]},{id:"antigravity",priority:20,alias:"ag",uiAlias:"ag",display:{name:"Antigravity",icon:"rocket_launch",color:"#F59E0B",website:"https://antigravity.google",notice:{signupUrl:"https://antigravity.google"},deprecated:!0,deprecationNotice:"RISK_NOTICE"},category:"oauth",serviceKinds:["llm","image"],modelsFetcher:{url:"https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",method:"POST",type:"google-available-models",headers:{"X-Client-Name":"antigravity"}},transport:{identity:"antigravity",baseUrls:["https://daily-cloudcode-pa.googleapis.com","https://daily-cloudcode-pa.sandbox.googleapis.com"],format:"antigravity",retry:{429:{attempts:3},500:{attempts:3},503:{attempts:3}},usage:{quotaApiUrl:"https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",loadProjectApiUrl:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",tokenUrl:"https://oauth2.googleapis.com/token"},clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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"},models:[{id:"gemini-3.8-flash-high",name:"Gemini 3.8 Flash (High)"},{id:"gemini-3.7-flash-high",name:"Gemini 3.7 Flash (High)"},{id:"gemini-3.6-flash-high",name:"Gemini 3.6 Flash (High)"},{id:"gemini-3-flash-agent",name:"Gemini 3.5 Flash (High)"},{id:"gemini-3.5-flash-low",name:"Gemini 3.5 Flash (Medium)"},{id:"gemini-3.5-flash-extra-low",name:"Gemini 3.5 Flash (Low)"},{id:"gemini-pro-agent",name:"Gemini 3.1 Pro (High)"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro (Low)"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Thinking)"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 (Thinking)"},{id:"gpt-oss-120b-medium",name:"GPT-OSS 120B (Medium)"},{id:"gemini-3-flash",name:"Gemini 3 Flash",thinking:!1},{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite"},{id:"gemini-3.1-flash-image",name:"Gemini 3.1 Flash (Image)",kind:"image",imageGen:!0,capabilities:["textToImage"]}],oauth:{authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",refreshLeadMs:3e5},features:{usage:!0}},{id:"assemblyai",priority:30,alias:"assemblyai",aliases:["aai"],uiAlias:"aai",display:{name:"AssemblyAI",icon:"record_voice_over",color:"#0062FF",textIcon:"AA",website:"https://assemblyai.com",notice:{apiKeyUrl:"https://www.assemblyai.com/app/api-keys"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.assemblyai.com/v1/audio/transcriptions",validateUrl:"https://api.assemblyai.com/v1/account"},models:[{id:"universal-3-pro",name:"Universal 3 Pro",params:["language"],kind:"stt"},{id:"universal-2",name:"Universal 2",params:["language"],kind:"stt"},{id:"best",name:"Best (Nano + Universal)",kind:"stt"},{id:"nano",name:"Nano (Fast)",kind:"stt"}],serviceKinds:["stt"],sttConfig:{identity:"openai-node",baseUrl:"https://api.assemblyai.com/v2/transcript",authType:"apikey",authHeader:"authorization",format:"assemblyai"}},{id:"aws-polly",alias:"polly",display:{name:"AWS Polly",icon:"record_voice_over",color:"#FF9900",textIcon:"PL",website:"https://aws.amazon.com/polly/",notice:{text:"Use AWS Secret Access Key as API key; set providerSpecificData.accessKeyId and optional region.",apiKeyUrl:"https://console.aws.amazon.com/iam/home#/security_credentials"}},category:"apikey",authType:"apikey",serviceKinds:["tts"],ttsConfig:{identity:"openai-node",baseUrl:"https://polly.{region}.amazonaws.com/v1/speech",authType:"apikey",authHeader:"aws-sigv4",format:"aws-polly",models:[{id:"standard",name:"Standard"},{identity:"openai-node",id:"neural",name:"Neural"},{identity:"openai-node",id:"long-form",name:"Long-form"},{identity:"openai-node",id:"generative",name:"Generative"}]},hasProviderSpecificData:!0},{id:"azure",priority:40,alias:"azure",display:{name:"Azure OpenAI",icon:"cloud",color:"#0078D4",textIcon:"AZ",website:"https://azure.microsoft.com/en-us/products/ai-services/openai-service",notice:{apiKeyUrl:"https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI"}},category:"apikey",hasProviderSpecificData:!0,transport:{identity:"openai-node",baseUrl:"",headers:{}}},{id:"black-forest-labs",priority:50,alias:"black-forest-labs",aliases:["bfl"],uiAlias:"bfl",display:{name:"Black Forest Labs",icon:"image",color:"#111827",textIcon:"BF",website:"https://blackforestlabs.ai",notice:{apiKeyUrl:"https://api.bfl.ai"}},category:"apikey",authType:"apikey",transport:null,models:[{id:"flux-pro-1.1",name:"FLUX Pro 1.1",params:["n","size"],kind:"image"},{id:"flux-pro-1.1-ultra",name:"FLUX Pro 1.1 Ultra",params:["size"],kind:"image"},{id:"flux-pro",name:"FLUX Pro",params:["n","size"],kind:"image"},{id:"flux-dev",name:"FLUX Dev",params:["n","size"],kind:"image"},{id:"flux-kontext-pro",name:"FLUX Kontext Pro (Edit)",params:["size"],capabilities:["edit"],kind:"image"},{id:"flux-kontext-max",name:"FLUX Kontext Max (Edit)",params:["size"],capabilities:["edit"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"https://api.bfl.ai/v1"}},{id:"blackbox",priority:50,alias:"blackbox",aliases:["bb"],uiAlias:"bb",display:{name:"Blackbox AI",icon:"smart_toy",color:"#5B5FEF",textIcon:"BB",website:"https://blackbox.ai",notice:{apiKeyUrl:"https://www.blackbox.ai/api-management"}},category:"apikey",serviceKinds:["llm"],thinkingConfig:{options:["auto","none","low","medium","high","xhigh"],defaultMode:"auto"},transport:{identity:"openai-node",baseUrl:"https://api.blackbox.ai/v1/chat/completions",thinkingFormat:"openai"},models:[{id:"claude-fable-5",name:"Claude Fable 5",upstreamModelId:"blackboxai/anthropic/claude-fable-5"},{id:"claude-opus-4.8",name:"Claude Opus 4.8",upstreamModelId:"blackboxai/anthropic/claude-opus-4.8"},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",upstreamModelId:"blackboxai/anthropic/claude-sonnet-4.6"},{id:"gpt-5.5",name:"GPT-5.5",upstreamModelId:"blackboxai/openai/gpt-5.5"},{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",upstreamModelId:"blackboxai/openai/gpt-5.4-pro"},{id:"gpt-5.4",name:"GPT-5.4",upstreamModelId:"blackboxai/openai/gpt-5.4"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",upstreamModelId:"blackboxai/openai/gpt-5.3-codex"},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",upstreamModelId:"blackboxai/openai/gpt-5.4-nano"},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",upstreamModelId:"blackboxai/deepseek/deepseek-v4-flash"},{id:"grok-4.3",name:"Grok 4.3",upstreamModelId:"blackboxai/x-ai/grok-4.3"}]},{id:"brave-search",alias:"brave",display:{name:"Brave Search",icon:"travel_explore",color:"#FB542B",textIcon:"BR",website:"https://brave.com/search/api",notice:{apiKeyUrl:"https://api-dashboard.search.brave.com/app/keys"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch"],searchConfig:{identity:"openai-node",baseUrl:"https://api.search.brave.com/res/v1",method:"GET",authType:"apikey",authHeader:"x-subscription-token",costPerQuery:.005,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5}},{id:"byteplus",priority:70,alias:"byteplus",aliases:["bpm"],uiAlias:"bpm",display:{name:"BytePlus ModelArk",icon:"cloud",color:"#2563EB",textIcon:"BP",website:"https://console.byteplus.com/ark",notice:{text:"Free credits for new accounts. Access to Seed 2.0, Kimi K2 Thinking, GLM 4.7, GPT-OSS-120B models.",apiKeyUrl:"https://console.byteplus.com/ark/region:ark+ap-southeast-1/apiKey"}},category:"freeTier",transport:{identity:"openai-node",baseUrl:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",headers:{}},models:[{id:"seed-2-0-pro-260328",name:"Seed 2.0 Pro"},{id:"seed-2-0-code-preview-260328",name:"Seed 2.0 Code Preview"},{id:"seed-2-0-mini-260215",name:"Seed 2.0 Mini"},{id:"seed-2-0-lite-260228",name:"Seed 2.0 Lite"},{id:"kimi-k2-thinking-251104",name:"Kimi K2 Thinking"},{id:"glm-4-7-251222",name:"GLM 4.7"},{id:"gpt-oss-120b-250805",name:"GPT-OSS-120B"}],serviceKinds:["llm"]},{id:"cartesia",alias:"cartesia",display:{name:"Cartesia",icon:"spatial_audio",color:"#FF4F8B",textIcon:"CA",website:"https://cartesia.ai",notice:{apiKeyUrl:"https://play.cartesia.ai/keys"}},category:"apikey",authType:"apikey",serviceKinds:["tts"],ttsConfig:{identity:"openai-node",baseUrl:"https://api.cartesia.ai/tts/bytes",authType:"apikey",authHeader:"x-api-key",format:"cartesia",models:[{id:"sonic-2",name:"Sonic 2"},{identity:"openai-node",id:"sonic-3",name:"Sonic 3"}]},hidden:!0},{id:"cerebras",priority:60,alias:"cerebras",display:{name:"Cerebras",icon:"memory",color:"#FF4F00",textIcon:"CB",website:"https://www.cerebras.ai",notice:{apiKeyUrl:"https://cloud.cerebras.ai/platform"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.cerebras.ai/v1/chat/completions",validateUrl:"https://api.cerebras.ai/v1/models",quirks:{dropClientMetadata:!0}},models:[{id:"gpt-oss-120b",name:"GPT OSS 120B"},{id:"zai-glm-4.7",name:"ZAI GLM 4.7"},{id:"llama-3.3-70b",name:"Llama 3.3 70B"},{id:"llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout"},{id:"qwen-3-235b-a22b-instruct-2507",name:"Qwen3 235B A22B"},{id:"qwen-3-32b",name:"Qwen3 32B"}]},{id:"chutes",priority:70,alias:"chutes",aliases:["ch"],uiAlias:"ch",display:{name:"Chutes AI",icon:"water_drop",color:"#ffffffff",textIcon:"CH",website:"https://chutes.ai",notice:{apiKeyUrl:"https://chutes.ai/app/api"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://llm.chutes.ai/v1/chat/completions",validateUrl:"https://llm.chutes.ai/v1/models"}},{id:"claude",priority:10,alias:"cc",uiAlias:"cc",display:{name:"Claude Code",icon:"smart_toy",color:"#D97757",website:"https://claude.ai",notice:{signupUrl:"https://claude.ai"},deprecated:!0,deprecationNotice:"RISK_NOTICE"},category:"oauth",transport:{identity:"claude-cli",baseUrl:"https://api.anthropic.com/v1/messages",format:"claude",urlSuffix:"?beta=true",headers:{"Anthropic-Version":"2023-06-01","Anthropic-Dangerous-Direct-Browser-Access":"true"},quirks:{cloakToolsOnOAuth:!0},auth:{apiKey:{header:"x-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"}},usage:{oauthUrl:"https://api.anthropic.com/api/oauth/usage",orgUrl:"https://api.anthropic.com/v1/organizations/{org_id}/usage",settingsUrl:"https://api.anthropic.com/v1/settings"}},models:[{id:"claude-fable-5",name:"Claude Fable 5"},{id:"claude-fable-5-1",name:"Claude Fable 5.1"},{id:"claude-opus-5",name:"Claude Opus 5"},{id:"claude-sonnet-5",name:"Claude Sonnet 5"},{id:"claude-opus-4-8",name:"Claude Opus 4.8"},{id:"claude-opus-4-7",name:"Claude Opus 4.7"},{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6"},{id:"claude-opus-4-5-20251101",name:"Claude 4.5 Opus"},{id:"claude-haiku-4-5-20251001",name:"Claude 4.5 Haiku"},{id:"claude-sonnet-4-5-20250929",name:"Claude 4.5 Sonnet"},{id:"claude-opus-4-1-20250805",name:"Claude 4.1 Opus"},{id:"claude-opus-4-20250514",name:"Claude 4 Opus"},{id:"claude-sonnet-4-20250514",name:"Claude 4 Sonnet"},{id:"claude-3-7-sonnet-20250219",name:"Claude 3.7 Sonnet"},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku"}],oauth:{clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256",refreshLeadMs:144e5,refresh:{encoding:"json"}},features:{usage:!0}},{id:"cline",priority:80,alias:"cl",uiAlias:"cl",display:{name:"Cline",icon:"smart_toy",color:"#5B9BD5",textIcon:"CL",website:"https://cline.bot",notice:{signupUrl:"https://cline.bot"}},category:"oauth",transport:{identity:"cline",baseUrl:"https://api.cline.bot/api/v1/chat/completions",tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["clineHeaders"]}},models:[{id:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7"},{id:"anthropic/claude-sonnet-4.6",name:"Claude Sonnet 4.6"},{id:"anthropic/claude-opus-4.6",name:"Claude Opus 4.6"},{id:"openai/gpt-5.3-codex",name:"GPT-5.3 Codex"},{id:"openai/gpt-5.4",name:"GPT-5.4"},{id:"google/gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview"},{id:"google/gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview"},{id:"kwaipilot/kat-coder-pro",name:"KAT Coder Pro"}],oauth:{appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"}},{id:"clinepass",priority:85,alias:"clinepass",aliases:["cline-pass"],uiAlias:"clinepass",display:{name:"ClinePass",icon:"vpn_key",color:"#5B9BD5",textIcon:"CP",website:"https://cline.bot",notice:{signupUrl:"https://app.cline.bot"}},category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,transport:{identity:"cline",baseUrl:"https://api.cline.bot/api/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["clineHeaders"]}},models:[{id:"cline-pass/glm-5.2",name:"GLM-5.2 (ClinePass)"},{id:"cline-pass/kimi-k2.7-code",name:"Kimi K2.7 Code (ClinePass)"},{id:"cline-pass/kimi-k2.6",name:"Kimi K2.6 (ClinePass)"},{id:"cline-pass/deepseek-v4-pro",name:"DeepSeek V4 Pro (ClinePass)"},{id:"cline-pass/deepseek-v4-flash",name:"DeepSeek V4 Flash (ClinePass)"},{id:"cline-pass/mimo-v2.5",name:"MiMo-V2.5 (ClinePass)"},{id:"cline-pass/mimo-v2.5-pro",name:"MiMo-V2.5-Pro (ClinePass)"},{id:"cline-pass/minimax-m3",name:"MiniMax M3 (ClinePass)"},{id:"cline-pass/qwen3.7-max",name:"Qwen3.7 Max (ClinePass)"},{id:"cline-pass/qwen3.7-plus",name:"Qwen3.7 Plus (ClinePass)"}],oauth:{appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},thinkingConfig:{options:["auto","on","off"],defaultMode:"auto"}},{id:"cloudflare-ai",priority:60,hasFree:!0,alias:"cloudflare-ai",aliases:["cf"],uiAlias:"cf",display:{name:"Cloudflare",icon:"cloud",color:"#F38020",textIcon:"CF",website:"https://developers.cloudflare.com/workers-ai/",notice:{text:"Workers AI free tier. Requires a Cloudflare API token and Account ID.",apiKeyUrl:"https://dash.cloudflare.com/profile/api-tokens"}},category:"freeTier",hasProviderSpecificData:!0,transport:{identity:"openai-node",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{accountId}/ai/v1/chat/completions",thinkingFormat:"openai"},models:[{id:"@cf/meta/llama-3.2-1b-instruct",name:"Llama 3.2 1B Instruct"},{id:"@cf/meta/llama-3.2-3b-instruct",name:"Llama 3.2 3B Instruct"},{id:"@cf/meta/llama-3.1-8b-instruct-fp8-fast",name:"Llama 3.1 8B Instruct FP8 Fast"},{id:"@cf/meta/llama-3.1-8b-instruct-awq",name:"Llama 3.1 8B Instruct AWQ"},{id:"@cf/mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B Instruct"},{id:"@cf/meta/llama-3.1-70b-instruct-fp8-fast",name:"Llama 3.1 70B Instruct FP8 Fast"},{id:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",name:"Llama 3.3 70B Instruct FP8 Fast"},{id:"@cf/deepseek-ai/deepseek-r1-distill-qwen-32b",name:"DeepSeek R1 Distill Qwen 32B"},{id:"@cf/moonshotai/kimi-k2.5",name:"Kimi K2.5"},{id:"@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6"},{id:"@cf/zai-org/glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"@cf/qwen/qwq-32b",name:"QwQ 32B"},{id:"@cf/qwen/qwen2.5-coder-32b-instruct",name:"Qwen 2.5 Coder 32B Instruct"},{id:"@cf/black-forest-labs/flux-2-klein-9b",name:"FLUX.2 Klein 9B",params:["size"],kind:"image"},{id:"@cf/black-forest-labs/flux-2-klein-4b",name:"FLUX.2 Klein 4B",params:["size"],kind:"image"},{id:"@cf/black-forest-labs/flux-2-dev",name:"FLUX.2 Dev",params:["size"],kind:"image"},{id:"@cf/leonardo/lucid-origin",name:"Lucid Origin",params:["size"],kind:"image"},{id:"@cf/leonardo/phoenix-1.0",name:"Phoenix 1.0",params:["size"],kind:"image"},{id:"@cf/black-forest-labs/flux-1-schnell",name:"FLUX.1 Schnell",params:["size"],kind:"image"},{id:"@cf/bytedance/stable-diffusion-xl-lightning",name:"SDXL Lightning",params:["size"],kind:"image"},{id:"@cf/lykon/dreamshaper-8-lcm",name:"DreamShaper 8 LCM",params:["size"],kind:"image"},{id:"@cf/runwayml/stable-diffusion-v1-5-img2img",name:"Stable Diffusion v1.5 Img2Img",params:["size"],capabilities:["edit"],kind:"image"},{id:"@cf/runwayml/stable-diffusion-v1-5-inpainting",name:"Stable Diffusion v1.5 Inpainting",params:["size"],capabilities:["edit","mask"],kind:"image"},{id:"@cf/stabilityai/stable-diffusion-xl-base-1.0",name:"SDXL Base 1.0",params:["size"],kind:"image"}],serviceKinds:["llm","image"],imageConfig:{identity:"openai-node",baseUrl:"https://api.cloudflare.com/client/v4/accounts"}},{id:"codebuddy-cn",alias:"cbcn",uiAlias:"cbcn",hidden:!1,priority:90,display:{name:"CodeBuddy CN",icon:"smart_toy",color:"#006EFF",website:"https://copilot.tencent.com",notice:{signupUrl:"https://copilot.tencent.com"}},category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,transport:{identity:"openai-node",baseUrl:"https://copilot.tencent.com/v2/chat/completions",forceStream:!0,thinkingFormat:"openai",headers:{"User-Agent":"CLI/2.108.1 CodeBuddy/2.108.1","X-Product":"SaaS","X-IDE-Type":"CLI","X-IDE-Name":"CLI","x-requested-with":"XMLHttpRequest","x-codebuddy-request":"1"},auth:{combined:!0,header:"Authorization",scheme:"bearer"},usage:{url:"https://copilot.tencent.com/v2/billing/meter/get-user-resource"}},models:[{id:"glm-5.2",name:"GLM-5.2"},{id:"glm-5.1",name:"GLM-5.1"},{id:"glm-5.0",name:"GLM-5.0"},{id:"glm-5.0-turbo",name:"GLM-5.0-Turbo"},{id:"glm-5v-turbo",name:"GLM-5v-Turbo"},{id:"glm-4.7",name:"GLM-4.7"},{id:"minimax-m3",name:"MiniMax-M3"},{id:"minimax-m2.7",name:"MiniMax-M2.7"},{id:"kimi-k2.7",name:"Kimi-K2.7-Code"},{id:"kimi-k2.6",name:"Kimi-K2.6"},{id:"kimi-k2.5",name:"Kimi-K2.5"},{id:"hy3-preview",name:"Hy3 Preview"},{id:"deepseek-v4-pro",name:"DeepSeek-V4-Pro"},{id:"deepseek-v4-flash",name:"DeepSeek-V4-Flash"},{id:"deepseek-v3-2-volc",name:"DeepSeek-V3.2"}],oauth:{baseUrl:"https://copilot.tencent.com",stateUrl:"https://copilot.tencent.com/v2/plugin/auth/state",tokenUrl:"https://copilot.tencent.com/v2/plugin/auth/token",refreshUrl:"https://copilot.tencent.com/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",platform:"CLI",pollInterval:5e3},features:{usage:!0,usageApikey:!0}},{id:"codex",priority:30,alias:"cx",uiAlias:"cx",display:{name:"OpenAI Codex",icon:"code",color:"#3B82F6",website:"https://chatgpt.com/codex",notice:{signupUrl:"https://chatgpt.com/codex"},deprecated:!0,deprecationNotice:"RISK_NOTICE",kindNotice:{image:"Requires a ChatGPT Plus (or higher) account. Free accounts are not supported for image generation."}},category:"oauth",thinkingConfig:{options:["auto","none","low","medium","high"],defaultMode:"auto"},transport:{identity:"codex-cli",baseUrl:"https://chatgpt.com/backend-api/codex/responses",format:"openai-responses",forceStream:!0,usage:{url:"https://chatgpt.com/backend-api/wham/usage",resetCreditsUrl:"https://chatgpt.com/backend-api/wham/rate-limit-reset-credits",resetCreditsConsumeUrl:"https://chatgpt.com/backend-api/wham/rate-limit-reset-credits/consume"}},models:[{id:"gpt-5.5",name:"GPT 5.5"},{id:"gpt-5.5-review",name:"GPT 5.5 Review",upstreamModelId:"gpt-5.5",quotaFamily:"review"},{id:"gpt-5.4",name:"GPT 5.4"},{id:"gpt-5.4-review",name:"GPT 5.4 Review",upstreamModelId:"gpt-5.4",quotaFamily:"review"},{id:"gpt-5.4-mini",name:"GPT 5.4 Mini"},{id:"gpt-5.4-mini-review",name:"GPT 5.4 Mini Review",upstreamModelId:"gpt-5.4-mini",quotaFamily:"review"},{id:"gpt-5.3-codex",name:"GPT 5.3 Codex"},{id:"gpt-5.3-codex-review",name:"GPT 5.3 Codex Review",upstreamModelId:"gpt-5.3-codex",quotaFamily:"review"},{id:"gpt-5.3-codex-xhigh",name:"GPT 5.3 Codex (xHigh)"},{id:"gpt-5.3-codex-xhigh-review",name:"GPT 5.3 Codex (xHigh) Review",upstreamModelId:"gpt-5.3-codex-xhigh",quotaFamily:"review"},{id:"gpt-5.3-codex-high",name:"GPT 5.3 Codex (High)"},{id:"gpt-5.3-codex-high-review",name:"GPT 5.3 Codex (High) Review",upstreamModelId:"gpt-5.3-codex-high",quotaFamily:"review"},{id:"gpt-5.3-codex-low",name:"GPT 5.3 Codex (Low)"},{id:"gpt-5.3-codex-low-review",name:"GPT 5.3 Codex (Low) Review",upstreamModelId:"gpt-5.3-codex-low",quotaFamily:"review"},{id:"gpt-5.3-codex-none",name:"GPT 5.3 Codex (None)"},{id:"gpt-5.3-codex-none-review",name:"GPT 5.3 Codex (None) Review",upstreamModelId:"gpt-5.3-codex-none",quotaFamily:"review"},{id:"gpt-5.3-codex-spark",name:"GPT 5.3 Codex Spark"},{id:"gpt-5.3-codex-spark-review",name:"GPT 5.3 Codex Spark Review",upstreamModelId:"gpt-5.3-codex-spark",quotaFamily:"review"},{id:"gpt-5.5-image",name:"GPT 5.5 Image",capabilities:["text2img","edit"],params:["size","quality","background","image_detail","output_format"],kind:"image"},{id:"gpt-5.4-image",name:"GPT 5.4 Image",capabilities:["text2img","edit"],params:["size","quality","background","image_detail","output_format"],kind:"image"},{id:"gpt-5.3-image",name:"GPT 5.3 Image",capabilities:["text2img","edit"],params:["size","quality","background","image_detail","output_format"],kind:"image"}],serviceKinds:["llm","image"],oauth:{clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",fixedPort:1455,callbackPath:"/auth/callback",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"},refreshLeadMs:432e6,maxRefreshAgeMs:6912e5,trackRefreshAt:!0,acceptsRawAccessToken:!0,rawAccessTokenIssuers:["https://auth.openai.com","https://auth0.openai.com"]},features:{usage:!0}},{id:"cohere",priority:90,alias:"cohere",display:{name:"Cohere",icon:"hub",color:"#39594D",textIcon:"CO",website:"https://cohere.com",notice:{apiKeyUrl:"https://dashboard.cohere.com/api-keys"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.cohere.ai/v1/chat/completions",validateUrl:"https://api.cohere.ai/v1/models"},models:[{id:"command-r-plus-08-2024",name:"Command R+ (Aug 2024)"},{id:"command-r-08-2024",name:"Command R (Aug 2024)"},{id:"command-a-03-2025",name:"Command A (Mar 2025)"}]},{id:"comfyui",priority:120,alias:"comfyui",display:{name:"ComfyUI",icon:"account_tree",color:"#4CAF50",textIcon:"CF",website:"https://github.com/comfyanonymous/ComfyUI"},category:"apikey",transport:null,models:[{id:"flux-dev",name:"FLUX Dev",params:["n","size"],kind:"image"},{id:"sdxl",name:"SDXL",params:["n","size"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"http://localhost:8188"}},{id:"commandcode",priority:100,alias:"commandcode",aliases:["cmc"],uiAlias:"cmc",display:{name:"Command Code",icon:"smart_toy",color:"#000000",textIcon:"CC",website:"https://commandcode.ai",notice:{text:"Use your CommandCode CLI API key (starts with user_...) from ~/.commandcode/auth.json or commandcode.ai/studio.",apiKeyUrl:"https://commandcode.ai/studio"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.commandcode.ai/alpha/generate",format:"commandcode",forceStream:!0,headers:{"x-command-code-version":"0.25.7","x-cli-environment":"cli"}},modelsFetcher:{url:"https://api.commandcode.ai/provider/v1/models",method:"GET",type:"openai",requiresAuth:!0},models:[{id:"deepseek/deepseek-v4-pro",name:"DeepSeek V4 Pro"},{id:"deepseek/deepseek-v4-flash",name:"DeepSeek V4 Flash"},{id:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code"},{id:"moonshotai/Kimi-K2.7-Code-Highspeed",name:"Kimi K2.7 Code HighSpeed"},{id:"moonshotai/Kimi-K2.6",name:"Kimi K2.6"},{id:"moonshotai/Kimi-K2.5",name:"Kimi K2.5"},{id:"zai-org/GLM-5.2",name:"GLM 5.2"},{id:"zai-org/GLM-5.2-Fast",name:"GLM 5.2 Fast"},{id:"zai-org/GLM-5.1",name:"GLM 5.1"},{id:"zai-org/GLM-5",name:"GLM 5"},{id:"MiniMaxAI/MiniMax-M3",name:"MiniMax M3"},{id:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax M2.7"},{id:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax M2.5"},{id:"xiaomi/mimo-v2.5-pro",name:"MiMo V2.5 Pro"},{id:"xiaomi/mimo-v2.5",name:"MiMo V2.5"},{id:"Qwen/Qwen3.6-Max-Preview",name:"Qwen 3.6 Max Preview"},{id:"Qwen/Qwen3.6-Plus",name:"Qwen 3.6 Plus"},{id:"Qwen/Qwen3.7-Max",name:"Qwen 3.7 Max"},{id:"Qwen/Qwen3.7-Plus",name:"Qwen 3.7 Plus"},{id:"stepfun/Step-3.7-Flash",name:"Step 3.7 Flash"},{id:"stepfun/Step-3.5-Flash",name:"Step 3.5 Flash"},{id:"tencent/Hy3",name:"Tencent Hy3"},{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra"}]},{id:"coqui",alias:"coqui",display:{name:"Coqui TTS",icon:"record_voice_over",color:"#10B981",textIcon:"CQ",website:"https://github.com/coqui-ai/TTS"},category:"freeTier",authType:"none",serviceKinds:["tts"],noAuth:!0,ttsConfig:{identity:"openai-node",baseUrl:"http://localhost:5002/api/tts",authType:"none",authHeader:"none",format:"coqui",models:[{id:"tts_models/en/ljspeech/tacotron2-DDC",name:"Tacotron2 DDC (LJSpeech)"}]},hidden:!0},{id:"cursor",priority:50,alias:"cu",uiAlias:"cu",display:{name:"Cursor IDE",icon:"edit_note",color:"#00D4AA",website:"https://cursor.com",notice:{signupUrl:"https://cursor.com"}},category:"oauth",transport:{identity:"openai-node",baseUrl:"https://api2.cursor.sh",chatPath:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",format:"cursor",headers:{"connect-accept-encoding":"gzip","connect-protocol-version":"1","Content-Type":"application/connect+proto","User-Agent":"connect-es/1.6.1"},clientVersion:"3.1.0"},models:[{id:"default",name:"Auto (Server Picks)"},{id:"claude-4.5-opus-high-thinking",name:"Claude 4.5 Opus High Thinking"},{id:"claude-4.5-opus-high",name:"Claude 4.5 Opus High"},{id:"claude-4.5-sonnet-thinking",name:"Claude 4.5 Sonnet Thinking"},{id:"claude-4.5-sonnet",name:"Claude 4.5 Sonnet"},{id:"claude-4.5-haiku",name:"Claude 4.5 Haiku"},{id:"claude-4.5-opus",name:"Claude 4.5 Opus"},{id:"gpt-5.2-codex",name:"GPT 5.2 Codex"},{id:"claude-4.6-opus-max",name:"Claude 4.6 Opus Max"},{id:"claude-4.6-sonnet-medium-thinking",name:"Claude 4.6 Sonnet Medium Thinking"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gpt-5.2",name:"GPT 5.2"},{id:"gpt-5.3-codex",name:"GPT 5.3 Codex"},{id:"composer-2.5",name:"Composer 2.5"},{id:"composer-2.5-fast",name:"Composer 2.5 Fast"}],oauth:{apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetUsableModels",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}}},{id:"deepgram",priority:20,alias:"deepgram",aliases:["dg"],uiAlias:"dg",display:{name:"Deepgram",icon:"mic",color:"#13EF93",textIcon:"DG",website:"https://deepgram.com",notice:{text:"$200 free credit on signup (no card required). Aura-1: $0.015/1k chars, Aura-2: $0.030/1k chars (Pay-As-You-Go).",apiKeyUrl:"https://console.deepgram.com/api-keys"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.deepgram.com/v1/listen"},models:[{id:"nova-3",name:"Nova 3",params:["language"],kind:"stt"},{id:"nova-2",name:"Nova 2",params:["language"],kind:"stt"},{id:"whisper-large",name:"Whisper Large",params:["language"],kind:"stt"},{id:"nova",name:"Nova",kind:"stt"}],serviceKinds:["stt"],sttConfig:{identity:"openai-node",baseUrl:"https://api.deepgram.com/v1/listen",authType:"apikey",authHeader:"token",format:"deepgram"}},e,{id:"edge-tts",alias:"edge-tts",display:{name:"Edge TTS",icon:"record_voice_over",color:"#0078D4",textIcon:"ET"},category:"freeTier",authType:"none",serviceKinds:["tts"],mediaPriority:5,noAuth:!0,ttsConfig:{identity:"openai-node",baseUrl:"edge-tts",authType:"none",authHeader:"none",format:"edge-tts",models:[]}},{id:"elevenlabs",alias:"el",display:{name:"ElevenLabs",icon:"record_voice_over",color:"#6C47FF",textIcon:"EL",website:"https://elevenlabs.io",notice:{apiKeyUrl:"https://elevenlabs.io/app/settings/api-keys"}},category:"apikey",authType:"apikey",serviceKinds:["tts"],ttsConfig:{identity:"openai-node",baseUrl:"https://api.elevenlabs.io/v1/text-to-speech",authType:"apikey",authHeader:"xi-api-key",format:"elevenlabs",models:[{id:"eleven_multilingual_v2",name:"Eleven Multilingual v2"},{identity:"openai-node",id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5"}]}},{id:"exa",alias:"exa",display:{name:"Exa",icon:"manage_search",color:"#2563EB",textIcon:"EX",website:"https://exa.ai",notice:{apiKeyUrl:"https://dashboard.exa.ai/api-keys"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch","webFetch"],searchConfig:{identity:"openai-node",baseUrl:"https://api.exa.ai/search",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.007,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5},fetchConfig:{identity:"openai-node",baseUrl:"https://api.exa.ai/contents",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.001,freeMonthlyQuota:1e3,formats:["text","markdown"],maxCharacters:1e5,timeoutMs:15e3}},{id:"fal-ai",priority:90,hasFree:!0,alias:"fal-ai",aliases:["fal"],uiAlias:"fal",display:{name:"Fal.ai",icon:"image",color:"#2563EB",textIcon:"FL",website:"https://fal.ai",notice:{apiKeyUrl:"https://fal.ai/dashboard/keys"}},category:"apikey",authType:"apikey",transport:null,models:[{id:"fal-ai/flux/schnell",name:"FLUX Schnell",params:["n","size"],kind:"image"},{id:"fal-ai/flux/dev",name:"FLUX Dev",params:["n","size"],kind:"image"},{id:"fal-ai/flux-pro/v1.1",name:"FLUX Pro v1.1",params:["n","size"],kind:"image"},{id:"fal-ai/flux-pro/v1.1-ultra",name:"FLUX Pro v1.1 Ultra",params:["n","size"],kind:"image"},{id:"fal-ai/recraft-v3",name:"Recraft V3",params:["n","size","style"],kind:"image"},{id:"fal-ai/ideogram/v2",name:"Ideogram V2",params:["n","size","style"],kind:"image"},{id:"fal-ai/stable-diffusion-v35-large",name:"SD 3.5 Large",params:["n","size"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"https://queue.fal.run"}},{id:"firecrawl",alias:"firecrawl",display:{name:"Firecrawl",icon:"local_fire_department",color:"#F59E0B",textIcon:"FC",website:"https://firecrawl.dev",notice:{apiKeyUrl:"https://www.firecrawl.dev/app/api-keys"}},category:"apikey",authType:"apikey",serviceKinds:["webFetch"],fetchConfig:{identity:"openai-node",baseUrl:"https://api.firecrawl.dev/v1/scrape",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.002,freeMonthlyQuota:500,formats:["markdown","html","text"],maxCharacters:2e5,timeoutMs:3e4}},{id:"fireworks",priority:50,alias:"fireworks",display:{name:"Fireworks AI",icon:"local_fire_department",color:"#7B2EF2",textIcon:"FW",website:"https://fireworks.ai",notice:{apiKeyUrl:"https://fireworks.ai/account/api-keys"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.fireworks.ai/inference/v1/chat/completions",validateUrl:"https://api.fireworks.ai/inference/v1/models"},models:[{id:"accounts/fireworks/models/deepseek-v3p1",name:"DeepSeek V3.1"},{id:"accounts/fireworks/models/llama-v3p3-70b-instruct",name:"Llama 3.3 70B"},{id:"accounts/fireworks/models/qwen3-235b-a22b",name:"Qwen3 235B"},{id:"nomic-ai/nomic-embed-text-v1.5",name:"Nomic Embed Text v1.5",kind:"embedding"}],serviceKinds:["llm","embedding"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.fireworks.ai/inference/v1/embeddings"}},{id:"gemini-cli",priority:20,hasFree:!0,alias:"gc",uiAlias:"gc",display:{name:"Gemini CLI",icon:"terminal",color:"#4285F4",website:"https://github.com/google-gemini/gemini-cli",notice:{signupUrl:"https://github.com/google-gemini/gemini-cli"},deprecated:!0,deprecationNotice:"RISK_NOTICE"},category:"free",transport:{identity:"gemini-cli",baseUrl:"https://cloudcode-pa.googleapis.com/v1internal",format:"gemini-cli",usage:{quotaUrl:"https://cloudcode-pa.googleapis.com/v1internal:retrieveUserQuota",loadCodeAssistUrl:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist"},clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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"},models:[{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview"},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"}],oauth:{authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"],refresh:{encoding:"form"}},features:{usage:!0}},{id:"gemini",priority:50,hasFree:!0,alias:"gemini",display:{name:"Gemini",icon:"diamond",color:"#4285F4",textIcon:"GE",website:"https://ai.google.dev",notice:{apiKeyUrl:"https://aistudio.google.com/app/apikey"}},category:"freeTier",mediaPriority:1,transport:{identity:"openai-node",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",format:"gemini",clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",auth:{apiKey:{header:"x-goog-api-key",scheme:"raw"},oauth:{header:"Authorization",scheme:"bearer"}}},models:[{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview"},{id:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite"},{id:"gemma-4-31b-it",name:"Gemma 4 31B IT"},{id:"gemini-embedding-2-preview",name:"Gemini Embedding 2 Preview",kind:"embedding"},{id:"gemini-embedding-001",name:"Gemini Embedding 001",kind:"embedding"},{id:"text-embedding-005",name:"Text Embedding 005",kind:"embedding"},{id:"text-embedding-004",name:"Text Embedding 004 (Legacy)",kind:"embedding"},{id:"gemini-3.1-flash-image-preview",name:"Gemini 3.1 Flash Image (Nano Banana 2)",params:[],kind:"image"},{id:"gemini-3-pro-image-preview",name:"Gemini 3 Pro Image (Nano Banana Pro)",params:[],kind:"image"},{id:"gemini-2.5-flash-image",name:"Gemini 2.5 Flash Image (Nano Banana)",params:[],kind:"image"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro (Best)",params:["language","prompt"],kind:"stt"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",params:["language","prompt"],kind:"stt"},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite (Cheapest)",params:["language","prompt"],kind:"stt"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",params:["language","prompt"],kind:"stt"},{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS",kind:"tts"},{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS",kind:"tts"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS",kind:"tts"},{id:"embedding-001",name:"Embedding 001",dimensions:768,kind:"embedding"}],serviceKinds:["llm","embedding","image","imageToText","webSearch","tts","stt"],ttsConfig:{identity:"openai-node",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",format:"gemini-tts"},sttConfig:{identity:"openai-node",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key",format:"gemini-stt"},embeddingConfig:{identity:"openai-node",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models",authType:"apikey",authHeader:"key"},imageConfig:{identity:"openai-node",baseUrl:"https://generativelanguage.googleapis.com/v1beta/models"},searchViaChat:{defaultModel:"gemini-2.5-flash",endpoint:"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent",pricingUrl:"https://ai.google.dev/pricing",freeTier:"Free tier: 15 RPM, 1M tokens/day on gemini-2.5-flash via AI Studio."}},{id:"github",priority:40,alias:"gh",uiAlias:"gh",display:{name:"GitHub Copilot",icon:"code",color:"#333333",website:"https://github.com/features/copilot",notice:{signupUrl:"https://github.com/features/copilot"},deprecated:!0,deprecationNotice:"RISK_NOTICE"},category:"oauth",transport:{identity:"copilot",baseUrl:"https://api.githubcopilot.com/chat/completions",responsesUrl:"https://api.githubcopilot.com/responses",usage:{url:"https://api.github.com/copilot_internal/user"}},models:[{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5.2-codex",name:"GPT-5.2 Codex"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex"},{id:"gpt-5.4",name:"GPT-5.4"},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"claude-opus-4.5",name:"Claude Opus 4.5"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-sonnet-4.6",name:"Claude Sonnet 4.6"},{id:"claude-opus-4.6",name:"Claude Opus 4.6"},{id:"claude-opus-4.7",name:"Claude Opus 4.7"},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash"},{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro"},{id:"grok-code-fast-1",name:"Grok Code Fast 1"},{id:"oswe-vscode-prime",name:"Raptor Mini"},{id:"goldeneye-free-auto",name:"GoldenEye"},{id:"text-embedding-3-small",name:"Text Embedding 3 Small (GitHub)",kind:"embedding"},{id:"text-embedding-3-large",name:"Text Embedding 3 Large (GitHub)",kind:"embedding"}],serviceKinds:["llm","embedding"],embeddingConfig:{identity:"copilot",baseUrl:"https://models.github.ai/inference/embeddings",authType:"apikey",authHeader:"bearer"},oauth:{clientId:"Iv1.b507a08c87ecfe98",authorizeUrl:"https://github.com/login/oauth/authorize",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token"},features:{usage:!0}},{id:"gitlab",hidden:!0,priority:100,display:{name:"GitLab Duo",icon:"code",color:"#FC6D26",textIcon:"GL",website:"https://gitlab.com",notice:{signupUrl:"https://gitlab.com"}},category:"oauth",transport:{identity:"openai-node",baseUrl:"https://gitlab.com/api/v4/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},oauth:{defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"}},{id:"glm-cn",priority:130,alias:"glm-cn",display:{name:"GLM (China)",icon:"code",color:"#DC2626",textIcon:"GC",website:"https://open.bigmodel.cn",notice:{apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",headers:{},usage:{url:"https://open.bigmodel.cn/api/monitor/usage/quota/limit"}},models:[{id:"glm-5.3",name:"GLM 5.3"},{id:"glm-5.2",name:"GLM 5.2"},{id:"glm-5.1",name:"GLM 5.1"},{id:"glm-5",name:"GLM 5"},{id:"glm-4.7",name:"GLM-4.7"},{id:"glm-4.6",name:"GLM-4.6"},{id:"glm-4.5-air",name:"GLM-4.5-Air"}],features:{usage:!0,usageApikey:!0}},f,{id:"google-pse",alias:"gpse",display:{name:"Google PSE",icon:"search",color:"#4285F4",textIcon:"GP",website:"https://programmablesearchengine.google.com",notice:{apiKeyUrl:"https://programmablesearchengine.google.com/controlpanel/create"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch"],searchConfig:{identity:"openai-node",baseUrl:"https://www.googleapis.com/customsearch/v1",method:"GET",authType:"apikey",authHeader:"key",costPerQuery:.005,freeMonthlyQuota:3e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:10,timeoutMs:1e4,cacheTTLMs:3e5}},{id:"google-tts",alias:"google-tts",display:{name:"Google TTS",icon:"record_voice_over",color:"#4285F4",textIcon:"GT"},category:"freeTier",authType:"none",serviceKinds:["tts"],mediaPriority:5,noAuth:!0,ttsConfig:{identity:"openai-node",baseUrl:"google-tts",authType:"none",authHeader:"none",format:"google-tts",models:[]}},g.A,{id:"grok-web",priority:150,alias:"grok-web",aliases:["gw"],uiAlias:"gw",display:{name:"Grok Web (Subscription)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"GW",website:"https://grok.com"},category:"webCookie",authType:"cookie",authHint:"Paste your sso= cookie value from grok.com",transport:{identity:"chrome",baseUrl:"https://grok.com/rest/app-chat/conversations/new",format:"grok-web",authType:"cookie"},models:[{id:"grok-3",name:"Grok 3"},{id:"grok-3-mini",name:"Grok 3 Mini (Thinking)"},{id:"grok-3-thinking",name:"Grok 3 Thinking"},{id:"grok-4",name:"Grok 4"},{id:"grok-4-mini",name:"Grok 4 Mini (Thinking)"},{id:"grok-4-thinking",name:"Grok 4 Thinking"},{id:"grok-4-heavy",name:"Grok 4 Heavy (SuperGrok)"},{id:"grok-4.1-mini",name:"Grok 4.1 Mini (Thinking)"},{id:"grok-4.1-fast",name:"Grok 4.1 Fast"},{id:"grok-4.1-expert",name:"Grok 4.1 Expert"},{id:"grok-4.1-thinking",name:"Grok 4.1 Thinking"},{id:"grok-4.2",name:"Grok 4.2 (4.20 Beta)"}],passthroughModels:!0},{id:"groq",priority:60,hasFree:!0,alias:"groq",display:{name:"Groq",icon:"speed",color:"#F55036",textIcon:"GQ",website:"https://groq.com",notice:{apiKeyUrl:"https://console.groq.com/keys"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.groq.com/openai/v1/chat/completions",validateUrl:"https://api.groq.com/openai/v1/models"},models:[{id:"llama-3.3-70b-versatile",name:"Llama 3.3 70B"},{id:"meta-llama/llama-4-maverick-17b-128e-instruct",name:"Llama 4 Maverick"},{id:"qwen/qwen3-32b",name:"Qwen3 32B"},{id:"openai/gpt-oss-120b",name:"GPT-OSS 120B"},{id:"whisper-large-v3",name:"Whisper Large v3",params:["language","response_format","temperature","prompt"],kind:"stt"},{id:"whisper-large-v3-turbo",name:"Whisper Large v3 Turbo",params:["language","response_format","temperature","prompt"],kind:"stt"},{id:"distil-whisper-large-v3-en",name:"Distil Whisper Large v3 EN",params:["language","response_format","temperature","prompt"],kind:"stt"}],serviceKinds:["llm","imageToText","stt"],sttConfig:{identity:"openai-node",baseUrl:"https://api.groq.com/openai/v1/audio/transcriptions",authType:"apikey",authHeader:"bearer",format:"openai"}},{id:"huggingface",priority:70,hasFree:!0,alias:"huggingface",aliases:["hf"],uiAlias:"hf",display:{name:"HuggingFace",icon:"face",color:"#FFD21E",textIcon:"HF",website:"https://huggingface.co",notice:{apiKeyUrl:"https://huggingface.co/settings/tokens"}},category:"apikey",authType:"apikey",hiddenKinds:["tts"],transport:null,models:[{id:"black-forest-labs/FLUX.1-schnell",name:"FLUX.1 Schnell",params:[],kind:"image"},{id:"stabilityai/stable-diffusion-xl-base-1.0",name:"SDXL Base 1.0",params:[],kind:"image"},{id:"openai/whisper-large-v3",name:"Whisper Large v3 (HF)",params:["language"],kind:"stt"},{id:"openai/whisper-small",name:"Whisper Small (HF)",params:["language"],kind:"stt"}],serviceKinds:["image","stt"],imageConfig:{identity:"openai-node",baseUrl:"https://api-inference.huggingface.co/models"}},{id:"hyperbolic",priority:160,alias:"hyperbolic",aliases:["hyp"],uiAlias:"hyp",display:{name:"Hyperbolic",icon:"bolt",color:"#00D4FF",textIcon:"HY",website:"https://hyperbolic.xyz",notice:{apiKeyUrl:"https://app.hyperbolic.xyz/settings"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.hyperbolic.xyz/v1/chat/completions",validateUrl:"https://api.hyperbolic.xyz/v1/models"},models:[{id:"Qwen/QwQ-32B",name:"QwQ 32B"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"deepseek-ai/DeepSeek-V3",name:"DeepSeek V3"},{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama 3.3 70B"},{id:"meta-llama/Llama-3.2-3B-Instruct",name:"Llama 3.2 3B"},{id:"Qwen/Qwen2.5-72B-Instruct",name:"Qwen 2.5 72B"},{id:"Qwen/Qwen2.5-Coder-32B-Instruct",name:"Qwen 2.5 Coder 32B"},{id:"NousResearch/Hermes-3-Llama-3.1-70B",name:"Hermes 3 70B"}]},{id:"iflow",hidden:!0,priority:110,alias:"if",display:{name:"iFlow AI",icon:"water_drop",color:"#6366F1",website:"https://iflow.cn",notice:{signupUrl:"https://iflow.cn"}},category:"oauth",transport:{identity:"openai-node",baseUrl:"https://apis.iflow.cn/v1/chat/completions",thinkingFormat:"openai",headers:{"User-Agent":"iFlow-Cli"}},models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-max",name:"Qwen3 Max"},{id:"qwen3-vl-plus",name:"Qwen3 VL Plus"},{id:"qwen3-max-preview",name:"Qwen3 Max Preview"},{id:"qwen3-235b",name:"Qwen3 235B A22B"},{id:"qwen3-235b-a22b-instruct",name:"Qwen3 235B A22B Instruct"},{id:"qwen3-235b-a22b-thinking-2507",name:"Qwen3 235B A22B Thinking"},{id:"qwen3-32b",name:"Qwen3 32B"},{id:"kimi-k2",name:"Kimi K2"},{id:"deepseek-v3.2",name:"DeepSeek V3.2 Exp"},{id:"deepseek-v3.1",name:"DeepSeek V3.1 Terminus"},{id:"deepseek-v3",name:"DeepSeek V3 671B"},{id:"deepseek-r1",name:"DeepSeek R1"},{id:"glm-4.7",name:"GLM 4.7"},{id:"iflow-rome-30ba3b",name:"iFlow ROME"}],oauth:{clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"},refreshLeadMs:864e5}},{id:"inworld",alias:"inworld",display:{name:"Inworld TTS",icon:"record_voice_over",color:"#FF6B6B",textIcon:"IW",website:"https://inworld.ai",notice:{text:"Free tier: 40 minutes/month TTS. Paid: TTS-1.5 Mini $0.01/min ($15/1M chars), TTS-1.5 Max $0.025/min ($30/1M chars). 270+ voices, 15 languages.",apiKeyUrl:"https://platform.inworld.ai/api-keys"}},category:"apikey",authType:"apikey",serviceKinds:["tts"],ttsConfig:{identity:"openai-node",baseUrl:"https://api.inworld.ai/tts/v1/voice",authType:"apikey",authHeader:"basic",format:"inworld",models:[{id:"inworld-tts-1.5-mini",name:"Inworld TTS 1.5 Mini ($0.01/min)"},{identity:"openai-node",id:"inworld-tts-1.5-max",name:"Inworld TTS 1.5 Max ($0.025/min)"}]}},{id:"jina-ai",alias:"jina",display:{name:"Jina AI",icon:"blur_on",color:"#2563EB",textIcon:"JA",website:"https://jina.ai",notice:{text:"10M free tokens on signup (non-commercial), no credit card required.",apiKeyUrl:"https://jina.ai/?sui=apikey"}},category:"apikey",authType:"apikey",serviceKinds:["embedding"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.jina.ai/v1/embeddings",authType:"apikey",authHeader:"bearer",models:[{id:"jina-embeddings-v3",name:"Jina Embeddings v3",dimensions:1024},{identity:"openai-node",id:"jina-embeddings-v2-base-en",name:"Jina Embeddings v2 Base EN",dimensions:768},{identity:"openai-node",id:"jina-embeddings-v2-base-code",name:"Jina Embeddings v2 Base Code",dimensions:768}]}},{id:"jina-reader",alias:"jina-reader",display:{name:"Jina Reader",icon:"menu_book",color:"#000000",textIcon:"JR",website:"https://jina.ai/reader",notice:{apiKeyUrl:"https://jina.ai/?sui=apikey"}},category:"apikey",authType:"apikey",serviceKinds:["webFetch"],fetchConfig:{identity:"openai-node",baseUrl:"https://r.jina.ai",method:"GET",authType:"apikey",authHeader:"bearer",costPerQuery:0,freeMonthlyQuota:1e6,formats:["markdown","text","html"],maxCharacters:2e5,timeoutMs:3e4}},{id:"kilocode",priority:70,alias:"kc",uiAlias:"kc",display:{name:"Kilo Code",icon:"code",color:"#FF6B35",textIcon:"KC",website:"https://kilocode.ai",notice:{signupUrl:"https://kilocode.ai"}},category:"oauth",transport:{identity:"openai-node",baseUrl:"https://api.kilo.ai/api/openrouter/chat/completions",headers:{},auth:{combined:!0,header:"Authorization",scheme:"bearer",hooks:["kilocodeOrg"]}},models:[{id:"anthropic/claude-sonnet-4-20250514",name:"Claude Sonnet 4"},{id:"anthropic/claude-opus-4-20250514",name:"Claude Opus 4"},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro"},{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash"},{id:"openai/gpt-4.1",name:"GPT-4.1"},{id:"openai/o3",name:"o3"},{id:"deepseek/deepseek-chat",name:"DeepSeek Chat"},{id:"deepseek/deepseek-reasoner",name:"DeepSeek Reasoner"}],modelsFetcher:{url:"https://api.kilo.ai/api/gateway/models",type:"openrouter-free"},passthroughModels:!0,oauth:{apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"}},{id:"kimchi",priority:95,alias:"kimchi",uiAlias:"kimchi",display:{name:"Kimchi",icon:"restaurant",color:"#FF521D",textIcon:"KC",website:"https://kimchi.dev",notice:{signupUrl:"https://app.kimchi.dev"}},category:"oauth",authModes:["oauth"],hasOAuth:!0,transport:{identity:"openai-node",baseUrl:"https://llm.kimchi.dev/openai/v1/chat/completions",format:"openai",headers:{"User-Agent":"kimchi/0.1.50"},auth:{combined:!0,header:"Authorization",scheme:"bearer"}},models:[{id:"minimax-m3",name:"MiniMax-M3"},{id:"kimi-k2.7",name:"Kimi-K2.7"},{id:"kimi-k2.6",name:"Kimi-K2.6"},{id:"kimi-k2.5",name:"Kimi-K2.5"},{id:"nemotron-3-ultra-fp4",name:"Nemotron 3 Ultra FP4"},{id:"minimax-m2.7",name:"MiniMax-M2.7"},{id:"claude-opus-4-6",name:"Claude Opus 4.6"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6"}],serviceKinds:["llm","imageToText"],oauth:{webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},passthroughModels:!0},h,i,{id:"kiro",priority:10,alias:"kr",uiAlias:"kr",display:{name:"Kiro AI",icon:"psychology_alt",color:"#FF6B35",website:"https://kiro.dev",notice:{signupUrl:"https://kiro.dev"},deprecated:!0,deprecationNotice:"RISK_NOTICE"},category:"free",transport:{identity:"openai-node",baseUrl:"https://runtime.us-east-1.kiro.dev/generateAssistantResponse",baseUrls:["https://runtime.us-east-1.kiro.dev/generateAssistantResponse","https://codewhisperer.us-east-1.amazonaws.com/generateAssistantResponse","https://q.us-east-1.amazonaws.com/generateAssistantResponse"],format:"kiro",retry:{429:0},headers:{"Content-Type":"application/json",Accept:"application/vnd.amazon.eventstream","X-Amz-Target":"AmazonCodeWhispererStreamingService.GenerateAssistantResponse","User-Agent":"AWS-SDK-JS/3.0.0 kiro-ide/1.0.0","X-Amz-User-Agent":"aws-sdk-js/3.0.0 kiro-ide/1.0.0"},tokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authUrl:"https://prod.us-east-1.auth.desktop.kiro.dev",usage:{cwHost:"https://codewhisperer.us-east-1.amazonaws.com",qHost:"https://q.us-east-1.amazonaws.com",limitsPath:"/getUsageLimits"}},models:[{id:"claude-opus-4.8",name:"Claude Opus 4.8"},{id:"claude-opus-4.8-thinking",name:"Claude Opus 4.8 (Thinking)"},{id:"claude-opus-4.8-agentic",name:"Claude Opus 4.8 (Agentic)"},{id:"claude-opus-4.8-thinking-agentic",name:"Claude Opus 4.8 (Thinking + Agentic)"},{id:"claude-opus-4.7",name:"Claude Opus 4.7"},{id:"claude-opus-4.7-thinking",name:"Claude Opus 4.7 (Thinking)"},{id:"claude-opus-4.7-agentic",name:"Claude Opus 4.7 (Agentic)"},{id:"claude-opus-4.7-thinking-agentic",name:"Claude Opus 4.7 (Thinking + Agentic)"},{id:"claude-opus-4.5",name:"Claude Opus 4.5"},{id:"claude-opus-4.5-thinking",name:"Claude Opus 4.5 (Thinking)"},{id:"claude-opus-4.5-agentic",name:"Claude Opus 4.5 (Agentic)"},{id:"claude-opus-4.5-thinking-agentic",name:"Claude Opus 4.5 (Thinking + Agentic)"},{id:"claude-sonnet-5",name:"Claude Sonnet 5"},{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",strip:["image","audio"]},{id:"qwen3-coder-next",name:"Qwen3 Coder Next",strip:["image","audio"]},{id:"glm-5",name:"GLM 5"},{id:"MiniMax-M2.5",name:"MiniMax M2.5"},{id:"claude-sonnet-5-thinking",name:"Claude Sonnet 5 (Thinking)"},{id:"claude-sonnet-4.5-thinking",name:"Claude Sonnet 4.5 (Thinking)"},{id:"claude-haiku-4.5-thinking",name:"Claude Haiku 4.5 (Thinking)"},{id:"claude-sonnet-5-agentic",name:"Claude Sonnet 5 (Agentic)"},{id:"claude-sonnet-4.5-agentic",name:"Claude Sonnet 4.5 (Agentic)"},{id:"claude-haiku-4.5-agentic",name:"Claude Haiku 4.5 (Agentic)"},{id:"claude-sonnet-5-thinking-agentic",name:"Claude Sonnet 5 (Thinking + Agentic)"},{id:"claude-sonnet-4.5-thinking-agentic",name:"Claude Sonnet 4.5 (Thinking + Agentic)"},{id:"claude-haiku-4.5-thinking-agentic",name:"Claude Haiku 4.5 (Thinking + Agentic)"}],oauth:{ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},features:{usage:!0,usageApikey:!0}},{id:"linkup",alias:"linkup",display:{name:"Linkup",icon:"link",color:"#0EA5E9",textIcon:"LK",website:"https://linkup.so",notice:{apiKeyUrl:"https://app.linkup.so/api-keys"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch"],searchConfig:{identity:"openai-node",baseUrl:"https://api.linkup.so/v1/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.005,freeMonthlyQuota:1e3,searchTypes:["web"],defaultMaxResults:5,maxMaxResults:50,timeoutMs:1e4,cacheTTLMs:3e5}},{id:"local-device",alias:"local-device",display:{name:"Local Device",icon:"speaker",color:"#64748B",textIcon:"LD"},category:"freeTier",authType:"none",serviceKinds:["tts"],mediaPriority:5,noAuth:!0,ttsConfig:{identity:"openai-node",baseUrl:"local-device",authType:"none",authHeader:"none",format:"local-device",models:[]}},{id:"mimo-free",priority:50,hasFree:!0,alias:"mmf",uiAlias:"mmf",display:{name:"MiMo Code Free",icon:"smart_toy",color:"#FF6900",textIcon:"MF"},category:"free",noAuth:!0,transport:{identity:"openai-node",baseUrl:"https://api.xiaomimimo.com/api/free-ai/openai/chat",noAuth:!0},models:[{id:"mimo-auto",name:"MiMo Auto"}],modelsFetcher:{url:"https://models.dev/api.json",type:"mimo-free"},passthroughModels:!0},j,k,{id:"mistral",priority:80,alias:"mistral",display:{name:"Mistral",icon:"air",color:"#FF7000",textIcon:"MI",website:"https://mistral.ai",notice:{apiKeyUrl:"https://console.mistral.ai/api-keys"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.mistral.ai/v1/chat/completions",validateUrl:"https://api.mistral.ai/v1/models",quirks:{dropClientMetadata:!0}},models:[{id:"mistral-large-latest",name:"Mistral Large 3"},{id:"codestral-latest",name:"Codestral"},{id:"mistral-medium-latest",name:"Mistral Medium 3"},{id:"mistral-embed",name:"Mistral Embed",kind:"embedding"}],serviceKinds:["llm","imageToText","embedding"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.mistral.ai/v1/embeddings",authType:"apikey",authHeader:"bearer"}},{id:"mmf",hidden:!0,priority:200,display:{name:"MMF",icon:"hub",color:"#6366F1",textIcon:"MF"},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.xiaomimimo.com/api/free-ai/openai/chat",noAuth:!0},models:[{id:"mimo-auto",name:"MiMo Auto"}]},{id:"muse",priority:285,alias:"muse",aliases:["meta","meta-ai","muse-code"],uiAlias:"muse",display:{name:"Meta Muse",icon:"psychology",color:"#0081FB",textIcon:"MU",website:"https://api.meta.ai",notice:{text:"Sign in with your Meta account via device code, or use a Meta Muse API key.",apiKeyUrl:"https://api.meta.ai",signupUrl:"https://auth.meta.com"}},category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,thinkingConfig:{options:["none","minimal","low","medium","high","xhigh","max"],defaultMode:"high"},transport:{identity:"muse-code",baseUrl:"https://api.meta.ai/v1/chat/completions",format:"openai",validateUrl:"https://api.meta.ai/v1/models",modelsUrl:"https://api.meta.ai/v1/models",usage:{url:"https://api.meta.ai/muse-code/key"},retry:{429:{attempts:3,delayMs:2e3},502:{attempts:2,delayMs:1500},503:{attempts:2,delayMs:1500}}},models:[{id:"muse-spark-1.3",name:"Muse Spark 1.3",contextLength:1048576,maxOutputTokens:65536,thinking:{levels:["minimal","low","medium","high","xhigh","max"]}},{id:"muse-spark-1.3-contributor",name:"Muse Spark 1.3 Contributor",contextLength:1048576,maxOutputTokens:65536,thinking:{levels:["minimal","low","medium","high","xhigh","max"]}},{id:"muse-spark-1.2",name:"Muse Spark 1.2",contextLength:1048576,maxOutputTokens:65536,thinking:{levels:["minimal","low","medium","high","xhigh"]}},{id:"muse-spark-1.2-contributor",name:"Muse Spark 1.2 Contributor",contextLength:1048576,maxOutputTokens:65536,thinking:{levels:["minimal","low","medium","high","xhigh"]}},{id:"muse-spark-1.1",name:"Muse Spark 1.1",contextLength:1048576,maxOutputTokens:65536,thinking:{levels:["low","medium","high","xhigh"]}}],serviceKinds:["llm"],oauth:{clientId:"1031625952748946",deviceCodeUrl:"https://auth.meta.com/oidc/device/authorization/",tokenUrl:"https://auth.meta.com/oidc/device/token/",mintUrl:"https://api.meta.ai/muse-code/key",grantType:"urn:ietf:params:oauth:grant-type:device_code",pollInterval:5e3},features:{usage:!0}},{id:"nanobanana",priority:80,hasFree:!0,alias:"nanobanana",aliases:["nb"],uiAlias:"nb",display:{name:"NanoBanana API",icon:"extension",color:"#FFD700",textIcon:"\uD83C\uDF4C",website:"https://nanobananaapi.ai",notice:{text:"3rd-party proxy for Google Nano Banana (Gemini 2.5/3 Flash Image). For official, use Gemini provider.",apiKeyUrl:"https://nanobananaapi.ai/dashboard"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.nanobananaapi.ai/v1/chat/completions",validateUrl:"https://api.nanobananaapi.ai/v1/models"},models:[{id:"nanobanana-flash",name:"NanoBanana Flash",params:["n","size"],kind:"image"},{id:"nanobanana-pro",name:"NanoBanana Pro",params:["n","size"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"https://api.nanobananaapi.ai/api/v1/nanobanana/generate",pollUrl:"https://api.nanobananaapi.ai/api/v1/nanobanana/record-info"}},{id:"nebius",priority:70,alias:"nebius",display:{name:"Nebius AI",icon:"cloud",color:"#6C5CE7",textIcon:"NB",website:"https://nebius.com",notice:{apiKeyUrl:"https://studio.nebius.com/settings/api-keys"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.studio.nebius.ai/v1/chat/completions",validateUrl:"https://api.studio.nebius.ai/v1/models"},models:[{id:"meta-llama/Llama-3.3-70B-Instruct",name:"Llama 3.3 70B Instruct"},{id:"Qwen/Qwen3-Embedding-8B",name:"Qwen3 Embedding 8B",kind:"embedding"}],serviceKinds:["llm","embedding"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.tokenfactory.nebius.com/v1/embeddings"}},{id:"nvidia",priority:20,hasFree:!0,alias:"nvidia",display:{name:"NVIDIA NIM",icon:"developer_board",color:"#76B900",textIcon:"NV",website:"https://developer.nvidia.com/nim",notice:{text:"Free access for NVIDIA Developer Program members (prototyping & testing).",apiKeyUrl:"https://build.nvidia.com/settings/api-keys"}},category:"freeTier",transport:{identity:"openai-node",baseUrl:"https://integrate.api.nvidia.com/v1/chat/completions",validateUrl:"https://integrate.api.nvidia.com/v1/models"},models:[{id:"minimaxai/minimax-m2.7",name:"MiniMax M2.7"},{id:"minimaxai/minimax-m3",name:"MiniMax M3"},{id:"z-ai/glm-5.2",name:"GLM 5.2"},{id:"deepseek-ai/deepseek-v4-pro",name:"DeepSeek V4 Pro"},{id:"deepseek-ai/deepseek-v4-flash",name:"DeepSeek V4 Flash"},{id:"moonshotai/kimi-k2.6",name:"Kimi K2.6"},{id:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra"},{id:"nvidia/nv-embedqa-e5-v5",name:"NV EmbedQA E5 v5",kind:"embedding"},{id:"nvidia/parakeet-ctc-1.1b-asr",name:"Parakeet CTC 1.1B",params:["language"],kind:"stt"},{id:"fastpitch",name:"FastPitch",kind:"tts"},{id:"tacotron2",name:"Tacotron2",kind:"tts"}],serviceKinds:["llm","tts","embedding"],ttsConfig:{identity:"openai-node",baseUrl:"https://integrate.api.nvidia.com/v1/audio/speech",authType:"apikey",authHeader:"bearer",format:"nvidia-tts"},embeddingConfig:{identity:"openai-node",baseUrl:"https://integrate.api.nvidia.com/v1/embeddings",authType:"apikey",authHeader:"bearer"}},{id:"ollama-local",priority:50,hasFree:!0,alias:"ollama-local",display:{name:"Ollama Local",icon:"cloud",color:"#ffffffff",textIcon:"OL",website:"https://ollama.com"},category:"apikey",transport:{identity:"openai-node",baseUrl:"http://localhost:11434/api/chat",format:"ollama"},serviceKinds:["llm"]},{id:"ollama",priority:30,hasFree:!0,alias:"ollama",display:{name:"Ollama Cloud",icon:"cloud",color:"#ffffffff",textIcon:"OL",website:"https://ollama.com",notice:{text:"Free tier: light usage, 1 cloud model at a time (limits reset every 5h & 7d). Pro $20/mo \xb7 Max $100/mo.",apiKeyUrl:"https://ollama.com/settings/keys"}},category:"freeTier",transport:{identity:"openai-node",baseUrl:"https://ollama.com/api/chat",validateUrl:"https://ollama.com/api/tags",format:"ollama"},models:[{id:"gpt-oss:120b",name:"GPT OSS 120B"},{id:"kimi-k2.5",name:"Kimi K2.5"},{id:"glm-5",name:"GLM 5"},{id:"minimax-m2.5",name:"MiniMax M2.5"},{id:"glm-4.7-flash",name:"GLM 4.7 Flash"},{id:"qwen3.5",name:"Qwen3.5"},{id:"minimax-m3",name:"MiniMax M3"}],serviceKinds:["llm"],features:{usage:!0,usageApikey:!0}},{id:"openai",priority:30,alias:"openai",display:{name:"OpenAI",icon:"auto_awesome",color:"#10A37F",textIcon:"OA",website:"https://platform.openai.com",notice:{apiKeyUrl:"https://platform.openai.com/api-keys"}},category:"apikey",thinkingConfig:{options:["auto","none","low","medium","high"],defaultMode:"auto"},transport:{identity:"openai-node",baseUrl:"https://api.openai.com/v1/chat/completions",forceStream:!0},models:[{id:"gpt-5.4",name:"GPT-5.4"},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini"},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano"},{id:"gpt-5.2",name:"GPT-5.2"},{id:"gpt-5.1",name:"GPT-5.1"},{id:"gpt-5",name:"GPT-5"},{id:"gpt-5-mini",name:"GPT-5 Mini"},{id:"gpt-5-nano",name:"GPT-5 Nano"},{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"gpt-4.1",name:"GPT-4.1"},{id:"gpt-4.1-mini",name:"GPT-4.1 Mini"},{id:"gpt-4.1-nano",name:"GPT-4.1 Nano"},{id:"o3",name:"O3"},{id:"o3-mini",name:"O3 Mini"},{id:"o3-pro",name:"O3 Pro"},{id:"o4-mini",name:"O4 Mini"},{id:"o1",name:"O1"},{id:"o1-mini",name:"O1 Mini"},{id:"text-embedding-3-large",name:"Text Embedding 3 Large",kind:"embedding"},{id:"text-embedding-3-small",name:"Text Embedding 3 Small",kind:"embedding"},{id:"text-embedding-ada-002",name:"Text Embedding Ada 002",kind:"embedding"},{id:"tts-1",name:"TTS-1",kind:"tts"},{id:"tts-1-hd",name:"TTS-1 HD",kind:"tts"},{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS",kind:"tts"},{id:"whisper-1",name:"Whisper 1",params:["language","response_format","temperature","prompt"],kind:"stt"},{id:"gpt-4o-transcribe",name:"GPT-4o Transcribe",params:["language","response_format","temperature","prompt"],kind:"stt"},{id:"gpt-4o-mini-transcribe",name:"GPT-4o Mini Transcribe",params:["language","response_format","temperature","prompt"],kind:"stt"},{id:"gpt-image-1",name:"GPT Image 1",params:["n","size","quality","response_format"],kind:"image"},{id:"dall-e-3",name:"DALL-E 3",params:["size","quality","style","response_format"],kind:"image"},{id:"dall-e-2",name:"DALL-E 2",params:["n","size","response_format"],kind:"image"}],serviceKinds:["llm","embedding","tts","stt","image","imageToText","webSearch"],ttsConfig:{identity:"openai-node",baseUrl:"https://api.openai.com/v1/audio/speech",authType:"apikey",authHeader:"bearer",format:"openai",defaultModel:"gpt-4o-mini-tts"},sttConfig:{identity:"openai-node",baseUrl:"https://api.openai.com/v1/audio/transcriptions",authType:"apikey",authHeader:"bearer",format:"openai"},embeddingConfig:{identity:"openai-node",baseUrl:"https://api.openai.com/v1/embeddings",authType:"apikey",authHeader:"bearer"},imageConfig:{identity:"openai-node",baseUrl:"https://api.openai.com/v1/images/generations"},searchViaChat:{defaultModel:"gpt-4o-mini",pricingUrl:"https://openai.com/api/pricing"}},{id:"opencode-go",priority:210,alias:"opencode-go",aliases:["ocg"],uiAlias:"ocg",display:{name:"OpenCode",icon:"terminal",color:"#E87040",textIcon:"OC",website:"https://opencode.ai/auth",notice:{text:"OpenCode subscription (multiple plans). Access to Kimi, GLM, Qwen, MiMo, MiniMax models.",apiKeyUrl:"https://opencode.ai/auth"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",headers:{}},transports:[{identity:"openai-node",format:"openai",baseUrl:"https://opencode.ai/zen/go/v1/chat/completions",auth:{combined:!0,header:"Authorization",scheme:"bearer"}},{identity:"openai-node",format:"claude",baseUrl:"https://opencode.ai/zen/go/v1/messages",auth:{combined:!0,header:"x-api-key",scheme:"raw",anthropicVersion:!0}},{identity:"openai-node",format:"openai-responses",baseUrl:"https://opencode.ai/zen/go/v1/responses",auth:{combined:!0,header:"Authorization",scheme:"bearer"}}],models:[{id:"glm-5.2",name:"GLM 5.2",supportedFormats:["openai"]},{id:"glm-5.1",name:"GLM 5.1",supportedFormats:["openai"]},{id:"kimi-k2.7-code",name:"Kimi K2.7 Code",supportedFormats:["openai"]},{id:"kimi-k2.6",name:"Kimi K2.6",supportedFormats:["openai"]},{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",supportedFormats:["openai","claude","openai-responses"]},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",supportedFormats:["openai","claude","openai-responses"]},{id:"mimo-v2.5",name:"MiMo V2.5",supportedFormats:["openai"]},{id:"mimo-v2.5-pro",name:"MiMo V2.5 Pro",supportedFormats:["openai"]},{id:"minimax-m3",name:"MiniMax M3",targetFormat:"claude",supportedFormats:["openai","claude"]},{id:"minimax-m2.7",name:"MiniMax M2.7",targetFormat:"claude",supportedFormats:["openai","claude"]},{id:"minimax-m2.5",name:"MiniMax M2.5",targetFormat:"claude",supportedFormats:["openai","claude"]},{id:"qwen3.7-max",name:"Qwen 3.7 Max",targetFormat:"claude",supportedFormats:["openai","claude"]},{id:"qwen3.7-plus",name:"Qwen 3.7 Plus",targetFormat:"claude",supportedFormats:["openai","claude"]},{id:"qwen3.6-plus",name:"Qwen 3.6 Plus",targetFormat:"claude",supportedFormats:["openai","claude"]}]},{id:"opencode",priority:40,hasFree:!0,alias:"oc",uiAlias:"oc",display:{name:"OpenCode Free",icon:"terminal",color:"#E87040",textIcon:"OC"},category:"free",noAuth:!0,transport:{identity:"openai-node",baseUrl:"https://opencode.ai",headers:{"x-opencode-client":"desktop"},noAuth:!0},models:[],modelsFetcher:{url:"https://opencode.ai/zen/v1/models",type:"opencode-free"},passthroughModels:!0},{id:"openrouter",priority:10,hasFree:!0,alias:"openrouter",display:{name:"OpenRouter",icon:"router",color:"#F97316",textIcon:"OR",website:"https://openrouter.ai",notice:{text:"Free tier: 27+ free models, no credit card needed, 200 req/day. After 0 credit: 1,000 req/day.",apiKeyUrl:"https://openrouter.ai/settings/keys"}},category:"freeTier",transport:{baseUrl:"https://openrouter.ai/api/v1/chat/completions",thinkingFormat:"openai",identity:"openai-node"},models:[{id:"openai/text-embedding-3-large",name:"OpenAI Text Embedding 3 Large",kind:"embedding"},{id:"openai/text-embedding-3-small",name:"OpenAI Text Embedding 3 Small",kind:"embedding"},{id:"openai/text-embedding-ada-002",name:"OpenAI Text Embedding Ada 002",kind:"embedding"},{id:"qwen/qwen3-embedding-8b",name:"Qwen3 Embedding 8B",kind:"embedding"},{id:"perplexity/pplx-embed-v1-4b",name:"Perplexity Embed V1 4B",kind:"embedding"},{id:"perplexity/pplx-embed-v1-0.6b",name:"Perplexity Embed V1 0.6B",kind:"embedding"},{id:"nvidia/llama-nemotron-embed-vl-1b-v2:free",name:"NVIDIA Nemotron Embed VL 1B V2 (Free)",kind:"embedding"},{id:"openai/gpt-4o-mini-tts",name:"GPT-4o Mini TTS",kind:"tts"},{id:"openai/tts-1-hd",name:"TTS-1 HD",kind:"tts"},{id:"openai/tts-1",name:"TTS-1",kind:"tts"},{id:"openai/dall-e-3",name:"DALL-E 3 (via OpenRouter)",params:["size","quality","style","response_format"],kind:"image"},{id:"openai/gpt-image-1",name:"GPT Image 1 (via OpenRouter)",params:["n","size","quality","response_format"],kind:"image"},{id:"google/imagen-3.0-generate-002",name:"Imagen 3 (via OpenRouter)",params:["n","size"],kind:"image"},{id:"black-forest-labs/FLUX.1-schnell",name:"FLUX.1 Schnell (via OpenRouter)",params:["n","size"],kind:"image"}],serviceKinds:["llm","embedding","tts","imageToText"],ttsConfig:{identity:"openai-node",baseUrl:"https://openrouter.ai/api/v1/chat/completions",defaultModel:"openai/gpt-4o-mini-tts"},embeddingConfig:{identity:"openai-node",baseUrl:"https://openrouter.ai/api/v1/embeddings",authType:"apikey",authHeader:"bearer"},imageConfig:{identity:"openai-node",baseUrl:"https://openrouter.ai/api/v1/images/generations"},modelsFetcher:{url:"https://openrouter.ai/api/v1/models",type:"openrouter-free"},passthroughModels:!0},{id:"perplexity-web",priority:220,alias:"perplexity-web",aliases:["pw"],uiAlias:"pw",display:{name:"Perplexity Web (Pro/Max)",icon:"search",color:"#20808D",textIcon:"PW",website:"https://www.perplexity.ai"},category:"webCookie",authType:"cookie",authHint:"Paste your __Secure-next-auth.session-token cookie value from perplexity.ai",transport:{identity:"chrome",baseUrl:"https://www.perplexity.ai/rest/sse/perplexity_ask",format:"perplexity-web",authType:"cookie"},models:[{id:"pplx-auto",name:"Perplexity Auto (Free)"},{id:"pplx-sonar",name:"Perplexity Sonar"},{id:"pplx-gpt",name:"GPT-5.4 (via Perplexity)"},{id:"pplx-gemini",name:"Gemini 3.1 Pro (via Perplexity)"},{id:"pplx-sonnet",name:"Claude Sonnet 4.6 (via Perplexity)"},{id:"pplx-opus",name:"Claude Opus 4.6 (via Perplexity)"},{id:"pplx-nemotron",name:"Nemotron 3 Super (via Perplexity)"}]},{id:"perplexity",priority:180,alias:"perplexity",aliases:["pplx"],uiAlias:"pplx",display:{name:"Perplexity",icon:"search",color:"#20808D",textIcon:"PP",website:"https://www.perplexity.ai",notice:{apiKeyUrl:"https://www.perplexity.ai/settings/api"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.perplexity.ai/chat/completions",validateUrl:"https://api.perplexity.ai/models"},models:[{id:"sonar-pro",name:"Sonar Pro"},{id:"sonar",name:"Sonar"}],serviceKinds:["llm","webSearch"],searchViaChat:{defaultModel:"sonar",endpoint:"https://api.perplexity.ai/chat/completions",pricingUrl:"https://docs.perplexity.ai/guides/pricing"}},{id:"playht",alias:"playht",display:{name:"PlayHT",icon:"play_circle",color:"#00B4D8",textIcon:"PH",website:"https://play.ht",notice:{apiKeyUrl:"https://play.ht/studio/api-access"}},category:"apikey",authType:"apikey",serviceKinds:["tts"],ttsConfig:{identity:"openai-node",baseUrl:"https://api.play.ht/api/v2/tts/stream",authType:"apikey",authHeader:"playht",format:"playht",models:[{id:"PlayDialog",name:"PlayDialog"},{identity:"openai-node",id:"Play3.0-mini",name:"Play 3.0 Mini"}]},hidden:!0},{id:"qoder",priority:30,alias:"qd",uiAlias:"qd",display:{name:"Qoder",icon:"water_drop",color:"#EC4899",website:"https://qoder.com",notice:{signupUrl:"https://qoder.com"},deprecated:!0,deprecationNotice:"RISK_NOTICE"},category:"free",transport:{identity:"openai-node",baseUrl:"https://api3.qoder.sh/algo/api/v2/service/pro/sse/agent_chat_generation",headers:{},timeoutMs:12e4,stallTimeoutMs:12e4,usage:{url:"https://openapi.qoder.sh/api/v2/quota/usage"}},models:[{id:"qmodel_latest",name:"Qoder Qwen 3.7 Max"}],oauth:{openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},features:{usage:!0}},{id:"qwen",priority:130,alias:"qw",display:{name:"Qwen Code",icon:"psychology",color:"#10B981",website:"https://chat.qwen.ai",notice:{signupUrl:"https://chat.qwen.ai"}},category:"oauth",transport:{identity:"qwen",baseUrl:"https://portal.qwen.ai/v1/chat/completions"},models:[{id:"qwen3-coder-plus",name:"Qwen3 Coder Plus"},{id:"qwen3-coder-flash",name:"Qwen3 Coder Flash"},{id:"vision-model",name:"Qwen3 Vision Model"},{id:"coder-model",name:"Qwen3.6 Coder Model"}],oauth:{clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256",refreshLeadMs:12e5}},{id:"recraft",priority:70,alias:"recraft",display:{name:"Recraft",icon:"image",color:"#EC4899",textIcon:"RC",website:"https://recraft.ai",notice:{apiKeyUrl:"https://www.recraft.ai/profile/api"}},category:"apikey",authType:"apikey",transport:null,models:[{id:"recraftv3",name:"Recraft V3",params:["n","size","style"],kind:"image"},{id:"recraftv2",name:"Recraft V2",params:["n","size","style"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"https://external.api.recraft.ai/v1/images/generations"}},{id:"runwayml",priority:80,alias:"runwayml",aliases:["runway"],uiAlias:"runway",display:{name:"Runway ML",icon:"movie",color:"#000000",textIcon:"RW",website:"https://runwayml.com",notice:{apiKeyUrl:"https://dev.runwayml.com"}},category:"apikey",authType:"apikey",transport:null,models:[{id:"gen4_image",name:"Gen-4 Image",params:["size"],kind:"image"},{id:"gen4_image_turbo",name:"Gen-4 Image Turbo",params:["size"],kind:"image"},{id:"gen4_turbo",name:"Gen-4 Turbo",params:[],kind:"video"},{id:"gen3a_turbo",name:"Gen-3 Alpha Turbo",params:[],kind:"video"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"https://api.dev.runwayml.com/v1"}},{id:"sdwebui",priority:110,alias:"sdwebui",display:{name:"SD WebUI",icon:"brush",color:"#FF7043",textIcon:"SD",website:"https://github.com/AUTOMATIC1111/stable-diffusion-webui"},category:"apikey",transport:null,models:[{id:"stable-diffusion-v1-5",name:"Stable Diffusion v1.5",params:["n","size"],kind:"image"},{id:"sdxl-base-1.0",name:"SDXL Base 1.0",params:["n","size"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"http://localhost:7860/sdapi/v1/txt2img"}},{id:"searchapi",alias:"searchapi",display:{name:"SearchAPI",icon:"search",color:"#0EA5A4",textIcon:"SA",website:"https://www.searchapi.io",notice:{apiKeyUrl:"https://www.searchapi.io/dashboard"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch"],searchConfig:{identity:"openai-node",baseUrl:"https://www.searchapi.io/api/v1/search",method:"GET",authType:"apikey",authHeader:"api_key",costPerQuery:.004,freeMonthlyQuota:100,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},{id:"searxng",alias:"searxng",display:{name:"SearXNG",icon:"saved_search",color:"#3B82F6",textIcon:"SX",website:"https://docs.searxng.org"},category:"freeTier",authType:"none",serviceKinds:["webSearch"],noAuth:!0,searchConfig:{identity:"openai-node",baseUrl:"http://localhost:8888/search",method:"GET",authType:"none",authHeader:"none",costPerQuery:0,freeMonthlyQuota:999999,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:50,timeoutMs:1e4,cacheTTLMs:18e4}},{id:"selfhosted-embedding",priority:50,alias:"selfhosted-embedding",display:{name:"Self-hosted Embedding",icon:"data_array",color:"#14B8A6",textIcon:"SE",website:"https://github.com/ggml-org/llama.cpp"},category:"apikey",authType:"apikey",models:[{id:"embedding",name:"Self-hosted embedding model",kind:"embedding"}],serviceKinds:["embedding"],embeddingConfig:{identity:"openai-node",authType:"none",authHeader:"bearer",format:"openai"}},{id:"selfhosted-stt",priority:50,alias:"selfhosted-stt",display:{name:"Self-hosted STT",icon:"mic",color:"#14B8A6",textIcon:"ST",website:"https://github.com/ggml-org/whisper.cpp"},category:"apikey",authType:"apikey",models:[{id:"whisper-1",name:"Whisper (self-hosted)",params:["language","response_format","temperature","prompt"],kind:"stt"}],serviceKinds:["stt"],sttConfig:{identity:"openai-node",authType:"none",authHeader:"bearer",format:"openai"}},{id:"selfhosted-tts",priority:50,alias:"selfhosted-tts",display:{name:"Self-hosted TTS",icon:"record_voice_over",color:"#14B8A6",textIcon:"TT",website:"https://github.com/remsky/Kokoro-FastAPI"},category:"apikey",authType:"apikey",models:[{id:"kokoro",name:"Kokoro (self-hosted)",params:["voice","response_format","speed"],kind:"tts"}],serviceKinds:["tts"],ttsConfig:{identity:"openai-node",authType:"none",authHeader:"bearer",format:"openai",defaultModel:"kokoro",defaultVoice:"af_heart"}},{id:"serper",alias:"serper",display:{name:"Serper",icon:"search",color:"#4F46E5",textIcon:"SP",website:"https://serper.dev",notice:{apiKeyUrl:"https://serper.dev/api-key"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch"],searchConfig:{identity:"openai-node",baseUrl:"https://google.serper.dev",method:"POST",authType:"apikey",authHeader:"x-api-key",costPerQuery:.001,freeMonthlyQuota:2500,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}},{id:"siliconflow",priority:250,alias:"siliconflow",display:{name:"SiliconFlow",icon:"cloud_queue",color:"#5B6EF5",textIcon:"SF",website:"https://cloud.siliconflow.com",notice:{apiKeyUrl:"https://cloud.siliconflow.com/account/ak"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.siliconflow.com/v1/chat/completions",validateUrl:"https://api.siliconflow.com/v1/models",thinkingFormat:"openai"},models:[{id:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro"},{id:"deepseek-ai/DeepSeek-V4-Flash",name:"DeepSeek V4 Flash"},{id:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek V3.2"},{id:"deepseek-ai/DeepSeek-V3.2-Exp",name:"DeepSeek V3.2 Exp"},{id:"deepseek-ai/DeepSeek-V3.1",name:"DeepSeek V3.1"},{id:"deepseek-ai/DeepSeek-V3.1-Terminus",name:"DeepSeek V3.1 Terminus"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"Qwen/Qwen3.5-397B-A17B",name:"Qwen 3.5 397B A17B"},{id:"Qwen/Qwen3.5-122B-A10B",name:"Qwen 3.5 122B A10B"},{id:"zai-org/GLM-5.1",name:"GLM 5.1"},{id:"zai-org/GLM-5",name:"GLM 5"},{id:"moonshotai/Kimi-K2.6",name:"Kimi K2.6"},{id:"moonshotai/Kimi-K2.5",name:"Kimi K2.5"},{id:"openai/gpt-oss-120b",name:"GPT OSS 120B"},{id:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax M2.5"},{id:"inclusionAI/Ling-flash-2.0",name:"Ling Flash 2.0"}]},{id:"stability-ai",priority:60,alias:"stability-ai",aliases:["stability"],uiAlias:"stability",display:{name:"Stability AI",icon:"image",color:"#8B5CF6",textIcon:"SA",website:"https://stability.ai",notice:{apiKeyUrl:"https://platform.stability.ai/account/keys"}},category:"apikey",authType:"apikey",transport:null,models:[{id:"stable-image-ultra",name:"Stable Image Ultra",params:["size"],kind:"image"},{id:"stable-image-core",name:"Stable Image Core",params:["size","style"],kind:"image"},{id:"sd3.5-large",name:"Stable Diffusion 3.5 Large",params:["size"],kind:"image"},{id:"sd3.5-large-turbo",name:"Stable Diffusion 3.5 Large Turbo",params:["size"],kind:"image"},{id:"sd3.5-medium",name:"Stable Diffusion 3.5 Medium",params:["size"],kind:"image"}],serviceKinds:["image"],imageConfig:{identity:"openai-node",baseUrl:"https://api.stability.ai/v2beta/stable-image/generate"}},{id:"tavily",alias:"tavily",display:{name:"Tavily",icon:"search",color:"#5B21B6",textIcon:"TV",website:"https://tavily.com",notice:{apiKeyUrl:"https://app.tavily.com/home"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch","webFetch"],searchConfig:{identity:"openai-node",baseUrl:"https://api.tavily.com/search",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.008,freeMonthlyQuota:1e3,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:20,timeoutMs:1e4,cacheTTLMs:3e5},fetchConfig:{identity:"openai-node",baseUrl:"https://api.tavily.com/extract",method:"POST",authType:"apikey",authHeader:"bearer",costPerQuery:.008,freeMonthlyQuota:1e3,formats:["markdown","text"],maxCharacters:1e5,timeoutMs:15e3}},{id:"together",priority:60,alias:"together",display:{name:"Together AI",icon:"group_work",color:"#0F6FFF",textIcon:"TG",website:"https://www.together.ai",notice:{apiKeyUrl:"https://api.together.xyz/settings/api-keys"}},category:"apikey",authType:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.together.xyz/v1/chat/completions",validateUrl:"https://api.together.xyz/v1/models"},models:[{id:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B Turbo"},{id:"deepseek-ai/DeepSeek-R1",name:"DeepSeek R1"},{id:"Qwen/Qwen3-235B-A22B",name:"Qwen3 235B"},{id:"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8",name:"Llama 4 Maverick"},{id:"BAAI/bge-large-en-v1.5",name:"BGE Large EN v1.5",kind:"embedding"},{id:"togethercomputer/m2-bert-80M-8k-retrieval",name:"M2 BERT 80M 8K",kind:"embedding"}],serviceKinds:["llm","embedding"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.together.xyz/v1/embeddings"}},{id:"topaz",alias:"topaz",display:{name:"Topaz",icon:"image",color:"#059669",textIcon:"TP",website:"https://topazlabs.com",notice:{apiKeyUrl:"https://topazlabs.com/account"}},category:"apikey",authType:"apikey",serviceKinds:["image"]},{id:"tortoise",alias:"tortoise",display:{name:"Tortoise TTS",icon:"record_voice_over",color:"#7C3AED",textIcon:"TT",website:"https://github.com/neonbjb/tortoise-tts"},category:"freeTier",authType:"none",serviceKinds:["tts"],noAuth:!0,ttsConfig:{identity:"openai-node",baseUrl:"http://localhost:5000/api/tts",authType:"none",authHeader:"none",format:"tortoise",models:[{id:"tortoise-v2",name:"Tortoise v2"}]},hidden:!0},{id:"venice",priority:115,alias:"venice",aliases:["vn"],uiAlias:"venice",display:{name:"Venice AI",icon:"shield",color:"#DC2626",textIcon:"VE",website:"https://venice.ai",notice:{text:"OpenAI-compatible. Private inference + uncensored models (Venice Uncensored, GLM, Qwen, DeepSeek, Llama).",apiKeyUrl:"https://venice.ai/settings/api"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://api.venice.ai/api/v1/chat/completions",validateUrl:"https://api.venice.ai/api/v1/models",thinkingFormat:"openai"},models:[{id:"venice-uncensored-1-2",name:"Venice Uncensored 1.2"},{id:"zai-org-glm-5",name:"GLM-5"},{id:"qwen3-235b-a22b-instruct-2507",name:"Qwen3 235B A22B Instruct"},{id:"qwen3-coder-480b-a35b-instruct-turbo",name:"Qwen3 Coder 480B A35B Turbo"},{id:"qwen3-vl-235b-a22b",name:"Qwen3 VL 235B A22B"},{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro"},{id:"llama-3.3-70b",name:"Llama 3.3 70B"},{id:"hermes-3-llama-3.1-405b",name:"Hermes 3 Llama 3.1 405B"},{id:"mistral-small-3-2-24b-instruct",name:"Mistral Small 3.2 24B"},{id:"text-embedding-3-large",name:"Text Embedding 3 Large",kind:"embedding"},{id:"text-embedding-bge-m3",name:"BGE-M3 Embedding",kind:"embedding"},{id:"text-embedding-qwen3-8b",name:"Qwen3 8B Embedding",kind:"embedding"},{id:"venice-sd35",name:"Venice SD3.5",params:["n","size"],kind:"image"},{id:"flux-2-pro",name:"FLUX.2 Pro",params:["n","size"],kind:"image"},{id:"gpt-image-2",name:"GPT Image 2 (via Venice)",params:["n","size","quality"],kind:"image"}],serviceKinds:["llm","embedding","image"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.venice.ai/api/v1/embeddings",authType:"apikey",authHeader:"bearer"},imageConfig:{identity:"openai-node",baseUrl:"https://api.venice.ai/api/v1/images/generations"},modelsFetcher:{url:"https://api.venice.ai/api/v1/models",type:"openai"},passthroughModels:!0},{id:"vercel-ai-gateway",priority:160,alias:"vercel-ai-gateway",aliases:["vercel"],uiAlias:"vercel",display:{name:"Vercel AI Gateway",icon:"deployed_code",color:"#111827",textIcon:"VG",website:"https://vercel.com/ai-gateway",notice:{text:"Unified OpenAI-compatible endpoint from Vercel. Use your AI Gateway API key, then pick models with provider/model IDs like anthropic/claude-sonnet-4.6 or openai/gpt-5.4.",apiKeyUrl:"https://vercel.com/dashboard/~/ai-gateway"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://ai-gateway.vercel.sh/v1/chat/completions",thinkingFormat:"openai",retry:{429:2},usage:{url:"https://ai-gateway.vercel.sh/v1/credits"}},serviceKinds:["llm","embedding","image","imageToText","webSearch"],embeddingConfig:{identity:"openai-node",baseUrl:"https://ai-gateway.vercel.sh/v1/embeddings"},imageConfig:{identity:"openai-node",baseUrl:"https://ai-gateway.vercel.sh/v1/images/generations"},searchViaChat:{defaultModel:"openai/gpt-4o-mini",pricingUrl:"https://vercel.com/docs/ai-gateway/pricing"},modelsFetcher:{url:"https://ai-gateway.vercel.sh/v1/models",type:"openai"},passthroughModels:!0,features:{usage:!0,usageApikey:!0}},{id:"vertex-partner",priority:260,alias:"vertex-partner",aliases:["vxp"],uiAlias:"vxp",display:{name:"Vertex Partner",icon:"cloud",color:"#34A853",textIcon:"VP",website:"https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models",notice:{apiKeyUrl:"https://console.cloud.google.com/iam-admin/serviceaccounts"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://aiplatform.googleapis.com"},models:[{id:"deepseek-ai/deepseek-v3.2-maas",name:"DeepSeek V3.2 (Vertex)"},{id:"qwen/qwen3-next-80b-a3b-thinking-maas",name:"Qwen3 Next 80B Thinking (Vertex)"},{id:"qwen/qwen3-next-80b-a3b-instruct-maas",name:"Qwen3 Next 80B Instruct (Vertex)"},{id:"zai-org/glm-5-maas",name:"GLM-5 (Vertex)"}]},{id:"vertex",priority:40,alias:"vertex",aliases:["vx"],uiAlias:"vx",display:{name:"Vertex AI",icon:"cloud",color:"#4285F4",textIcon:"VX",website:"https://cloud.google.com/vertex-ai",notice:{text:"New Google Cloud accounts get $300 free credits. Requires GCP project + Service Account with Vertex AI API enabled.",apiKeyUrl:"https://console.cloud.google.com/iam-admin/serviceaccounts"}},category:"freeTier",transport:{identity:"openai-node",baseUrl:"https://aiplatform.googleapis.com",format:"vertex"},models:[{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview"},{id:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview"},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash"}],serviceKinds:["llm","imageToText"]},{id:"volcengine-ark",priority:270,alias:"volcengine-ark",aliases:["ark"],uiAlias:"ark",display:{name:"Volcengine Ark",icon:"cloud",color:"#1677FF",textIcon:"ARK",website:"https://ark.cn-beijing.volces.com",notice:{apiKeyUrl:"https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey"}},category:"apikey",transport:{identity:"openai-node",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",headers:{}},models:[{id:"Doubao-Seed-2.0-Code",name:"Doubao-Seed-2.0-Code"},{id:"Doubao-Seed-2.0-pro",name:"Doubao-Seed-2.0-pro"},{id:"Doubao-Seed-2.0-lite",name:"Doubao-Seed-2.0-lite"},{id:"Doubao-Seed-Code",name:"Doubao-Seed-Code"},{id:"DeepSeek-V4-Flash",name:"DeepSeek-V4-Flash"},{id:"DeepSeek-V4-Pro",name:"DeepSeek-V4-Pro"},{id:"GLM-5.1",name:"GLM-5.1"},{id:"MiniMax-M2.7",name:"MiniMax-M2.7"},{id:"Kimi-K2.6",name:"Kimi-K2.6"}]},{id:"voyage-ai",priority:40,alias:"voyage-ai",uiAlias:"voyage",display:{name:"Voyage AI",icon:"data_array",color:"#0EA5E9",textIcon:"VG",website:"https://www.voyageai.com",notice:{apiKeyUrl:"https://dash.voyageai.com/api-keys"}},category:"apikey",authType:"apikey",transport:null,models:[{id:"voyage-3-large",name:"Voyage 3 Large",kind:"embedding"},{id:"voyage-3.5",name:"Voyage 3.5",kind:"embedding"},{id:"voyage-3.5-lite",name:"Voyage 3.5 Lite",kind:"embedding"},{id:"voyage-code-3",name:"Voyage Code 3",kind:"embedding"},{id:"voyage-finance-2",name:"Voyage Finance 2",kind:"embedding"},{id:"voyage-law-2",name:"Voyage Law 2",kind:"embedding"},{id:"voyage-multilingual-2",name:"Voyage Multilingual 2",kind:"embedding"}],serviceKinds:["embedding"],embeddingConfig:{identity:"openai-node",baseUrl:"https://api.voyageai.com/v1/embeddings"}},{id:"xai",priority:280,alias:"xai",display:{name:"xAI (Grok)",icon:"auto_awesome",color:"#1DA1F2",textIcon:"XA",website:"https://x.ai",notice:{apiKeyUrl:"https://console.x.ai"}},category:"oauth",authModes:["oauth","apikey"],hasOAuth:!0,transport:{identity:"grok-cli",baseUrl:"https://api.x.ai/v1/chat/completions",validateUrl:"https://api.x.ai/v1/models",responsesUrl:"https://api.x.ai/v1/responses",clientId:"b1a00492-073a-47ea-816f-4c329264a828",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token"},models:[{id:"grok-4",name:"Grok 4"},{id:"grok-4-fast-reasoning",name:"Grok 4 Fast Reasoning"},{id:"grok-code-fast-1",name:"Grok Code Fast"},{id:"grok-3",name:"Grok 3"},{id:"grok-2-image-1212",name:"Grok 2 Image",params:["n","response_format"],kind:"image"},{id:"grok-imagine-video",name:"Grok Imagine Video",params:["duration","aspect_ratio","resolution"],kind:"video"}],serviceKinds:["llm","imageToText","webSearch","image","video"],imageConfig:{identity:"grok-cli",baseUrl:"https://api.x.ai/v1/images/generations",bodyFields:["model","prompt","n","response_format"]},videoConfig:{identity:"grok-cli",baseUrl:"https://api.x.ai/v1/videos"},searchViaChat:{defaultModel:"grok-4.20-reasoning",endpoint:"https://api.x.ai/v1/responses",pricingUrl:"https://x.ai/api#pricing"}},l,m,{id:"youcom",alias:"youcom",display:{name:"You.com Search",icon:"search",color:"#7C3AED",textIcon:"YC",website:"https://you.com",notice:{apiKeyUrl:"https://api.you.com"}},category:"apikey",authType:"apikey",serviceKinds:["webSearch"],searchConfig:{identity:"openai-node",baseUrl:"https://ydc-index.io/v1/search",method:"GET",authType:"apikey",authHeader:"x-api-key",costPerQuery:.005,freeMonthlyQuota:0,searchTypes:["web","news"],defaultMaxResults:5,maxMaxResults:100,timeoutMs:1e4,cacheTTLMs:3e5}}]},69632:(a,b,c)=>{"use strict";c.d(b,{H:()=>o});var d=c(99887),e=c(68531),f=c(11897),g=c(18184),h=c(90694),i=c(29055),j=c(52655),k=c(96684);function l(a,b){a.responseId||(a.responseId=`chatcmpl-${Date.now()}`,a.created=Math.floor(Date.now()/1e3),a.model=a.model||b||"commandcode",a.chunkIndex=0,a.toolIndex=0,a.finishReason=null,a.usage=null),a.toolIndexById instanceof Map||(a.toolIndexById=new Map),a.openTools instanceof Set||(a.openTools=new Set),"number"!=typeof a.toolIndex&&(a.toolIndex=0),"number"!=typeof a.chunkIndex&&(a.chunkIndex=0)}function m(a,b,c=null){return(0,g.k)({id:a.responseId,created:a.created,model:a.model},b,c)}let n=a=>(0,k.F)(a,"commandcode");function o(a,b){if(!a){if(b.commandcodeFinished||!((b.chunkIndex||0)>0||(b.toolIndex||0)>0))return null;b.commandcodeFinished=!0,l(b);let a=m(b,{},b.finishReason||f.bC.STOP),c=(0,h.B)(b.usage,"commandcode");return c&&(a.usage=c),[a]}if(a&&"object"==typeof a&&"chat.completion.chunk"===a.object)return a;let c=a;if("string"==typeof a){let b=a.trim();if(!b)return null;let d=b.startsWith("data:")?b.slice(5).trim():b;if(!d||"[DONE]"===d)return null;try{c=JSON.parse(d)}catch{return null}}if(!c||"object"!=typeof c||!c.type)return null;l(b,c.model);let d=[];switch(c.type){case"text-delta":{let a=c.text||c.delta||"";if(!a)break;let e=0===b.chunkIndex?{role:f.z7.ASSISTANT,content:a}:{content:a};b.chunkIndex++,d.push(m(b,e));break}case"reasoning-delta":{let a=c.text||"";if(!a)break;let e=(0,i.B)(a,0===b.chunkIndex);b.chunkIndex++,d.push(m(b,e));break}case"tool-input-start":{let a=c.id||c.toolCallId||(0,j.eG)(b.toolIndex),e=b.toolIndexById.get(a);null==e&&(e=b.toolIndex++,b.toolIndexById.set(a,e)),b.openTools.add(a);let g={...0===b.chunkIndex?{role:f.z7.ASSISTANT}:{},tool_calls:[{index:e,id:a,type:f.x4.FUNCTION,function:{name:c.toolName||"",arguments:""}}]};b.chunkIndex++,d.push(m(b,g));break}case"tool-input-delta":{let a=c.id||c.toolCallId||(b.openTools?.size===1?[...b.openTools][0]:void 0),e=b.toolIndexById.get(a);if(null==e)break;let f={tool_calls:[{index:e,function:{arguments:c.delta||c.inputTextDelta||""}}]};d.push(m(b,f));break}case"tool-call":{let a=c.toolCallId||c.id||(0,j.eG)(b.toolIndex);if(b.toolIndexById.has(a))break;let e=b.toolIndex++;b.toolIndexById.set(a,e);let g="string"==typeof c.input?c.input:JSON.stringify(c.input??{}),h={...0===b.chunkIndex?{role:f.z7.ASSISTANT}:{},tool_calls:[{index:e,id:a,type:f.x4.FUNCTION,function:{name:c.toolName||"",arguments:g}}]};b.chunkIndex++,d.push(m(b,h));break}case"finish-step":b.finishReason=n(c.finishReason),c.usage&&(b.usage=c.usage);break;case"finish":{if(b.commandcodeFinished)break;b.commandcodeFinished=!0;let a=b.finishReason||n(c.finishReason||"stop"),e=m(b,{},a),f=c.totalUsage||b.usage,g=(0,h.B)(f,"commandcode");g&&(e.usage=g),d.push(e);break}case"error":{if(b.commandcodeFinished)break;b.commandcodeFinished=!0,b.finishReason=f.bC.STOP;let a=c.error??c.message??"unknown",e="string"==typeof a?a:JSON.stringify(a);d.push(m(b,{content:`
|
|
389
389
|
|
|
390
|
-
[CommandCode error: ${e}]`})),d.push(m(b,{},f.bC.STOP))}}return d.length?d:null}(0,d.kz)(e.h.COMMANDCODE,e.h.OPENAI,null,o)},69641:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(22884),c(87350),c(39541);var d=c(68531);c(82812),c(18762),c(20830),c(96997),c(1654),c(98976),c(6125),c(50969),c(13161),c(38421),c(80152),c(82689),c(7878),c(17438);var e=c(95695);c(81556),c(49926),c(69493),c(52748),c(978),c(96998),c(76441),c(55261),c(4879),c(34578),c(78116),c(25720),c(49623),c(31629),c(23493),c(33871),c(50132),c(49471),c(46036),c(14896);var f=a([e]);e=(f.then?(await f)():f)[0],d.h.GEMINI,d.h.GEMINI_CLI,d.h.ANTIGRAVITY,d.h.VERTEX,b()}catch(a){b(a)}})},70106:(a,b,c)=>{"use strict";let{parseSetCookie:d}=c(5831),{stringify:e}=c(84698),{webidl:f}=c(32984);function g(a){try{f.brandCheck(a,f.is.Headers);return}catch{}f.brandCheck(a,f.util.MakeTypeAssertion(globalThis.Headers))}function h(a,b){f.argumentLengthCheck(arguments,2,"setCookie"),g(a);let c=e(b=f.converters.Cookie(b));c&&a.append("set-cookie",c,!0)}f.converters.DeleteCookieAttributes=f.dictionaryConverter([{converter:f.nullableConverter(f.converters.DOMString),key:"path",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.DOMString),key:"domain",defaultValue:()=>null}]),f.converters.Cookie=f.dictionaryConverter([{converter:f.converters.DOMString,key:"name"},{converter:f.converters.DOMString,key:"value"},{converter:f.nullableConverter(a=>"number"==typeof a?f.converters["unsigned long long"](a):new Date(a)),key:"expires",defaultValue:()=>null},{converter:f.nullableConverter(f.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.DOMString),key:"path",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.boolean),key:"secure",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:f.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:f.sequenceConverter(f.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]),a.exports={getCookies:function(a){f.argumentLengthCheck(arguments,1,"getCookies"),g(a);let b=a.get("cookie"),c={__proto__:null};if(!b)return c;for(let a of b.split(";")){let[b,...d]=a.split("=");c[b.trim()]=d.join("=")}return c},deleteCookie:function(a,b,c){g(a);let d="deleteCookie";f.argumentLengthCheck(arguments,2,d),b=f.converters.DOMString(b,d,"name"),c=f.converters.DeleteCookieAttributes(c),h(a,{name:b,value:"",expires:new Date(0),...c})},getSetCookies:function(a){f.argumentLengthCheck(arguments,1,"getSetCookies"),g(a);let b=a.getSetCookie();return b?b.map(a=>d(a)):[]},setCookie:h,parseCookie:function(a){return d(a=f.converters.DOMString(a))}}},70459:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),{Console:e}=c(37540),f=process.versions.icu?"✅":"Y ",g=process.versions.icu?"❌":"N ";a.exports=class{constructor({disableColors:a}={}){this.transform=new d({transform(a,b,c){c(null,a)}}),this.logger=new e({stdout:this.transform,inspectOptions:{colors:!a&&!process.env.CI}})}format(a){let b=a.map(({method:a,path:b,data:{statusCode:c},persist:d,times:e,timesInvoked:h,origin:i})=>({Method:a,Origin:i,Path:b,"Status code":c,Persistent:d?f:g,Invocations:h,Remaining:d?1/0:e-h}));return this.logger.table(b),this.transform.read().toString()}}},70625:(a,b,c)=>{"use strict";c.d(b,{Iq:()=>B,Kn:()=>v,dV:()=>w,zi:()=>x});var d=c(73024),e=c(76760),f=c(77598),g=c(59882),h=c(3507);let i=["claude-cli","codex-cli","gemini-cli"],j=new Map,k=new Map,l=new Set,m=null;function n(){let a=process.env.DATA_DIR||e.join(process.env.HOME||process.env.USERPROFILE||".",".switchboard");return e.join(a,"identity")}function o(a){return e.join(n(),`${a}.json`)}let p=function(){try{return JSON.parse(d.readFileSync(e.join(process.cwd(),"open-sse","identity","snapshots","versions.json"),"utf8"))}catch{try{return JSON.parse(d.readFileSync(new c.U(c(13839)),"utf8"))}catch{return{}}}}();function q(a){let b=p[a],c=b?.version;if(!c)return null;if("claude-cli"!==a)return{version:c,latestVersion:b.latestVersion};let d=b.tlsSpecRev||c;return{version:c,billingVersion:c,tlsSpecRev:d,latestVersion:b.latestVersion,capturedAt:b.capturedAt,entrypoint:b.entrypoint||"cli",userAgent:`claude-cli/${c} (external, ${b.entrypoint||"cli"})`,packageVersion:b.packageVersion||"0.128.0",runtimeVersion:b.runtimeVersion||"v26.3.0",betas:b.betas||"claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,effort-2025-11-24,structured-outputs-2025-12-15"}}function r(a){let b=String(a||"").split(".").map(Number);return 3===b.length&&b.every(Number.isInteger)?b:null}function s(a){let b=String(a?.tlsSpecRev||"").match(/(\d+\.\d+\.\d+)/);return b?.[1]||null}function t(a,b){let c=r(a),d=r(b);if(!c||!d)return 0;for(let a=0;a<3;a++)if(c[a]!==d[a])return c[a]-d[a];return 0}function u(a){return!!(a?.version&&a?.billingVersion===a.version&&s(a)===a.version&&a.version===(z(p["claude-cli"]?.tlsSpecRev)||p["claude-cli"]?.version||null)&&a?.userAgent?.includes(`claude-cli/${a.version}`)&&a?.packageVersion&&a?.runtimeVersion&&a?.betas)}function v(a){return{version:a?.version||null,billingVersion:a?.billingVersion||null,tlsVersion:s(a),userAgentVersion:z(a?.userAgent)}}function w(a){if(j.has(a))return j.get(a);let b=null;try{b=JSON.parse(d.readFileSync(o(a),"utf8"))}catch{b=q(a)}return"claude-cli"!==a||u(b)||(b=q(a)),b&&j.set(a,b),b}function x(a){let b=w(a);return"claude-cli"!==a||u(b)?b:q(a)}function y(a,b){if(b&&"object"==typeof b){j.set(a,b);try{d.mkdirSync(n(),{recursive:!0}),d.writeFileSync(o(a),JSON.stringify(b,null,2))}catch{}}}function z(a){if("string"!=typeof a)return null;let b=a.match(/claude-cli\/(\d+\.\d+\.\d+)/i)||a.match(/codex_cli_rs\/(\d+\.\d+\.\d+)/i)||a.match(/GeminiCLI\/(\d+\.\d+\.\d+)/i)||a.match(/Cline\/(\d+\.\d+\.\d+)/i)||a.match(/antigravity\/(\d+\.\d+\.\d+)/i)||a.match(/QwenCode\/(\d+\.\d+\.\d+)/i)||a.match(/GitHubCopilotChat\/(\d+\.\d+\.\d+)/i);return b?b[1]:null}let A={"claude-cli":/claude-(?:cli|code)\//i,"codex-cli":/codex_cli_rs\//i,"gemini-cli":/GeminiCLI\//i,cline:/Cline\//i,antigravity:/antigravity\//i,qwen:/QwenCode\//i,copilot:/GitHubCopilotChat\//i};function B(a){let b=a||"anonymous";if(k.has(b))return k.get(b);let c=(0,f.createHash)("sha256").update(`device:${b}`).digest("hex"),d={buildHash:c.slice(0,3),deviceId:c,accountUuid:`${c.slice(0,8)}-${c.slice(8,12)}-4${c.slice(13,16)}-a${c.slice(17,20)}-${c.slice(20,32)}`,os:(0,h.vv)(),arch:(0,h.Tc)()};return k.set(b,d),d}function C(a,b){l.has(a)||(l.add(a),console.warn(`[IDENTITY_STALE] ${a}: ${b}`))}async function D(a,b){let c=g.jI[a]?.source?.npm;if(!c)return null;let d=await b(`https://registry.npmjs.org/${encodeURIComponent(c)}/latest`,{headers:{Accept:"application/json"}});if(!d.ok)return null;let e=await d.json();return r(e?.version)?e.version:null}async function E(a=globalThis.fetch){"function"==typeof a&&await Promise.all(i.map(async b=>{try{var c;let d,e=await D(b,a);if(!e)return;let f=x(b)||q(b)||{};if("claude-cli"===b){t(e,f.version)>0&&(y(b,{...f,latestVersion:e,checkedAt:Date.now()}),C(b,`npm ${e} is ahead of captured tuple ${f.version}`));return}if(c=f,!(!((d=A[b])&&c?.userAgent)||d.test(c.userAgent))||t(f.version,e)>0)C(b,`stored snapshot ${f.version} cannot belong to ${b}; reset to npm ${e}`),f=q(b)||{};else if(0>=t(e,f.version))return;let g="codex-cli"===b?`codex_cli_rs/${e}`:f.userAgent;y(b,{...f,version:e,...g?{userAgent:g}:{},checkedAt:Date.now()})}catch{}}))}function F(){let a=Date.now();for(let b of Object.keys(g.jI)){let c=x(b)||q(b),d=c?.capturedAt;if(!d)continue;let e=a-new Date(d).getTime();if(Number.isFinite(e)&&e>2592e6){let a=Math.floor(e/864e5);C(b,`snapshot is ${a}d old; run npm run identity:refresh`)}}}"1"!==process.env.SWITCHBOARD_DISABLE_IDENTITY_POLL&&queueMicrotask(()=>(function(a=globalThis.fetch){return m||"function"!=typeof a||(E(a),F(),m=setInterval(()=>{E(a),F()},216e5),m.unref?.()),m})())},70634:(a,b,c)=>{"use strict";let{MockNotMatchedError:d}=c(28998),{kDispatches:e,kMockAgent:f,kOriginalDispatch:g,kOrigin:h,kGetNetConnect:i,kTotalDispatchCount:j}=c(80830),{serializePathWithQuery:k,parseHeaders:l}=c(84285),{STATUS_CODES:m}=c(37067),{types:{isPromise:n}}=c(57975),{InvalidArgumentError:o}=c(61448),p=Symbol("request aborted");function q(a,b){return"string"==typeof a?a===b:a instanceof RegExp?a.test(b):"function"==typeof a&&!0===a(b)}function r(a){return Object.fromEntries(Object.entries(a).map(([a,b])=>[a.toLocaleLowerCase(),b]))}function s(a,b){if(Array.isArray(a)){for(let c=0;c<a.length;c+=2)if(a[c].toLocaleLowerCase()===b.toLocaleLowerCase())return a[c+1];return}return"function"==typeof a.get?a.get(b):r(a)[b.toLocaleLowerCase()]}function t(a){let b=a.slice(),c=[];for(let a=0;a<b.length;a+=2)c.push([b[a],b[a+1]]);return Object.fromEntries(c)}function u(a,b){if("function"==typeof a.headers)return Array.isArray(b)&&(b=t(b)),a.headers(b?r(b):{});if(void 0===a.headers)return!0;if("object"!=typeof b||"object"!=typeof a.headers)return!1;for(let[c,d]of Object.entries(a.headers))if(!q(d,s(b,c)))return!1;return!0}function v(a){if("string"!=typeof a)return a;let b=a.split("?",3);if(2!==b.length)return a;let c=new URLSearchParams(b.pop());return c.sort(),[...b,c.toString()].join("?")}function w(a){if(Buffer.isBuffer(a)||a instanceof Uint8Array)return a;if(a instanceof ArrayBuffer)return a;if(ArrayBuffer.isView(a))return new Uint8Array(a.buffer,a.byteOffset,a.byteLength);if("object"==typeof a)return JSON.stringify(a);else if(a)return a.toString();else return""}function x(a,b){let c=b.query?k(b.path,b.query):b.path,e="string"==typeof c?v(c):c,f=z(e),g=a.filter(({consumed:a})=>!a).filter(({path:a,ignoreTrailingSlash:b})=>b?q(z(v(a)),f):q(v(a),e));if(0===g.length)throw new d(`Mock dispatch not matched for path '${e}'`);if(0===(g=g.filter(({method:a})=>q(a,b.method))).length)throw new d(`Mock dispatch not matched for method '${b.method}' on path '${e}'`);if(0===(g=g.filter(({body:a})=>void 0===a||q(a,b.body))).length)throw new d(`Mock dispatch not matched for body '${b.body}' on path '${e}'`);if(0===(g=g.filter(a=>u(a,b.headers))).length){let a="object"==typeof b.headers?JSON.stringify(b.headers):b.headers;throw new d(`Mock dispatch not matched for headers '${a}' on path '${e}'`)}return g[0]}function y(a,b){let c=a.findIndex(a=>!!a.consumed&&function(a,{path:b,method:c,body:d,headers:e}){let f=q(a.path,b),g=q(a.method,c),h=void 0===a.body||q(a.body,d),i=u(a,e);return f&&g&&h&&i}(a,b));-1!==c&&a.splice(c,1)}function z(a){if("string"!=typeof a)return a;for(;a.endsWith("/");)a=a.slice(0,-1);return 0===a.length&&(a="/"),a}function A(a){let{path:b,method:c,body:d,headers:e,query:f}=a;return{path:b,method:c,body:d,headers:e,query:f}}function B(a){let b=Object.keys(a),c=[];for(let d=0;d<b.length;++d){let e=b[d],f=a[e],g=Buffer.from(`${e}`);if(Array.isArray(f))for(let a=0;a<f.length;++a)c.push(g,Buffer.from(`${f[a]}`));else c.push(g,Buffer.from(`${f}`))}return c}function C(a){return m[a]||"unknown"}function D(a,b){let c=A(a),d=x(this[e],c),f=this[e];d.timesInvoked++;let{timesInvoked:g,times:h}=d;d.consumed=!d.persist&&g>=h,d.pending=g<h;let i="function"==typeof b.onBodySent||"function"==typeof b.onRequestSent;if(d.data.callback&&(!i||null==a.body)){let{callback:e,...g}=d.data,h=e(a);if(n(h))return h.then(e=>{null==e||"object"!=typeof e?b.onResponseError(null,new o("reply options callback must return an object")):E(f,d,c,a,b,{...g,...e})},a=>{b.onResponseError(null,a)}),!0;if(null==h||"object"!=typeof h)throw new o("reply options callback must return an object");return E(f,d,c,a,b,{...g,...h})}return E(f,d,c,a,b)}function E(a,b,c,d,e,f){let{data:g,delay:h}=b,i=f??g;if(null!==i.error)return y(a,c),e.onResponseError(null,i.error),!0;let j=!1,k=null,m={paused:!1,rawHeaders:null,rawTrailers:null,pause(){this.paused=!0},resume(){this.paused=!1},abort:a=>{j||(j=!0,null!==k&&(clearTimeout(k),k=null),e.onResponseError?.(m,a))}},q=d;if(e.onRequestStart?.(m,null),j)return!0;let r=function(a,b,c,d){var e;if("function"!=typeof b.onBodySent&&"function"!=typeof b.onRequestSent)return a;if(null==a)return H(b,c,d)?a:p;if(a&&"function"==typeof a[Symbol.asyncIterator])return F(a,b,c,d);if("string"!=typeof(e=a)&&!Buffer.isBuffer(e)&&!ArrayBuffer.isView(e)&&"function"==typeof e[Symbol.iterator]){let e=[];for(let f of a)if(d()||(e.push(f),!G(b,c,f)||d()))return p;return H(b,c,d)?e:p}return d()||!G(b,c,a)?p:H(b,c,d)?a:p}(d.body,e,m,()=>j);if(n(r))return r.then(a=>{a!==p&&(a!==d.body&&(q={...d,body:a}),s())},a=>m.abort(a)),!0;if(r===p)return!0;function s(){if(i.callback){let b,{callback:d,...f}=i;try{b=d(q)}catch(b){y(a,c),e.onResponseError(null,b);return}if(n(b))return void b.then(b=>{null==b||"object"!=typeof b?e.onResponseError(null,new o("reply options callback must return an object")):u(a,{...f,...b})},a=>{e.onResponseError(null,a)});if(null==b||"object"!=typeof b)throw new o("reply options callback must return an object");return void u(a,{...f,...b})}"number"==typeof h&&h>0?k=setTimeout(()=>{k=null,u(a)},h):u(a)}function u(a,b=i){if(j)return;let{statusCode:f,data:g,headers:h,trailers:k}=b,o=Array.isArray(d.headers)?t(d.headers):d.headers,p="function"==typeof g?g({...q,headers:o}):g;if(n(p))return p.then(c=>u(a,{...b,data:c}));if(j)return;let r=w(p),s=B(h??{}),v=B(k??{});m.rawHeaders=s,m.rawTrailers=v,e.onResponseStart?.(m,f,l(s),C(f)),e.onResponseData?.(m,Buffer.from(r)),e.onResponseEnd?.(m,l(v)),y(a,c)}return r!==d.body&&(q={...d,body:r}),s(),!0}async function F(a,b,c,d){let e=[];for await(let f of a)if(d()||(e.push(f),!G(b,c,f)||d()))return p;return H(b,c,d)?{async *[Symbol.asyncIterator](){yield*e}}:p}function G(a,b,c){try{return a.onBodySent?.(c),!0}catch(a){return b.abort(a),!1}}function H(a,b,c){try{return a.onRequestSent?.(),!c()}catch(a){return b.abort(a),!1}}function I(a,b){let c=new URL(b);return!0===a||!!(Array.isArray(a)&&a.some(a=>q(a,c.host)))}a.exports={getResponseData:w,getMockDispatch:x,addMockDispatch:function(a,b,c,d){let e={timesInvoked:0,times:1,persist:!1,consumed:!1,...d},f="function"==typeof c?{callback:c}:{...c},g={...e,...b,pending:!0,data:{error:null,...f}};return a.push(g),a[j]=(a[j]||0)+1,g},deleteMockDispatch:y,buildKey:A,generateKeyValues:B,matchValue:q,getResponse:async function a(a){let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString("utf8")},getStatusText:C,mockDispatch:D,buildMockDispatch:function(){let a=this[f],b=this[h],c=this[g];return function(f,g){if(a.isMockActive)try{D.call(this,f,g)}catch(h){if("UND_MOCK_ERR_MOCK_NOT_MATCHED"===h.code){let k=a[i](),l=this[e][j]||this[e].length,m=this[e].filter(({consumed:a})=>!a).length,n=`, ${m} interceptor(s) remaining out of ${l} defined`;if(!1===k)throw new d(`${h.message}: subsequent request to origin ${b} was not allowed (net.connect disabled)${n}`);if(I(k,b))c.call(this,"__mockAgentBodyForDispatch"in f?{...f,body:f.__mockAgentBodyForDispatch}:f,g);else throw new d(`${h.message}: subsequent request to origin ${b} was not allowed (net.connect is not enabled for this origin)${n}`)}else throw h}else c.call(this,f,g)}},checkNetConnect:I,buildAndValidateMockOptions:function(a){let{agent:b,...c}=a;if("enableCallHistory"in c&&"boolean"!=typeof c.enableCallHistory)throw new o("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in c&&"boolean"!=typeof c.acceptNonStandardSearchParameters)throw new o("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in c&&"boolean"!=typeof c.ignoreTrailingSlash)throw new o("options.ignoreTrailingSlash must to be a boolean");return c},getHeaderByName:s,buildHeadersFromArray:t,normalizeSearchParams:function(a){if("string"!=typeof a)return a;let b=new URLSearchParams(a),c=new URLSearchParams;for(let[a,d]of b.entries()){if(a=a.replace("[]",""),/^(['"]).*\1$/.test(d)){c.append(a,d);continue}if(d.includes(",")){for(let b of d.split(","))c.append(a,b);continue}c.append(a,d)}return c},normalizeOrigin:function(a){return"string"==typeof a||a instanceof URL?a instanceof URL?a.origin:a.toLowerCase():a}}},70707:(a,b,c)=>{"use strict";let d=c(67519);a.exports=function({maxRedirections:a,throwOnMaxRedirect:b,stripHeadersOnRedirect:c,stripHeadersOnCrossOriginRedirect:e}={}){return f=>function(g,h){let{maxRedirections:i=a,throwOnMaxRedirect:j=b,stripHeadersOnRedirect:k=c,stripHeadersOnCrossOriginRedirect:l=e,...m}=g;if(null==i||0===i)return f(g,h);let n={...m,throwOnMaxRedirect:j,stripHeadersOnRedirect:k,stripHeadersOnCrossOriginRedirect:l},o=new d(f,i,n,h);return f(n,o)}}},70710:(a,b,c)=>{var d,e=c(45654);c(76632),c(1277),c(33889);var f=e.pkcs5=e.pkcs5||{};e.util.isNodejs&&!e.options.usePureJavaScript&&(d=c(55511)),a.exports=e.pbkdf2=f.pbkdf2=function(a,b,c,f,g,h){if("function"==typeof g&&(h=g,g=null),e.util.isNodejs&&!e.options.usePureJavaScript&&d.pbkdf2&&(null===g||"object"!=typeof g)&&(d.pbkdf2Sync.length>4||!g||"sha1"===g))return("string"!=typeof g&&(g="sha1"),a=Buffer.from(a,"binary"),b=Buffer.from(b,"binary"),h)?4===d.pbkdf2Sync.length?d.pbkdf2(a,b,c,f,function(a,b){if(a)return h(a);h(null,b.toString("binary"))}):d.pbkdf2(a,b,c,f,g,function(a,b){if(a)return h(a);h(null,b.toString("binary"))}):4===d.pbkdf2Sync.length?d.pbkdf2Sync(a,b,c,f).toString("binary"):d.pbkdf2Sync(a,b,c,f,g).toString("binary");if(null==g&&(g="sha1"),"string"==typeof g){if(!(g in e.md.algorithms))throw Error("Unknown hash algorithm: "+g);g=e.md[g].create()}var i=g.digestLength;if(f>0xffffffff*i){var j=Error("Derived key is too long.");if(h)return h(j);throw j}var k=Math.ceil(f/i),l=f-(k-1)*i,m=e.hmac.create();m.start(g,a);var n="";if(!h){for(var o=1;o<=k;++o){m.start(null,null),m.update(b),m.update(e.util.int32ToBytes(o)),q=s=m.digest().getBytes();for(var p=2;p<=c;++p)m.start(null,null),m.update(s),r=m.digest().getBytes(),q=e.util.xorBytes(q,r,i),s=r;n+=o<k?q:q.substr(0,l)}return n}var q,r,s,p,o=1;!function a(){if(o>k)return h(null,n);m.start(null,null),m.update(b),m.update(e.util.int32ToBytes(o)),q=s=m.digest().getBytes(),p=2,function b(){if(p<=c)return m.start(null,null),m.update(s),r=m.digest().getBytes(),q=e.util.xorBytes(q,r,i),s=r,++p,e.util.setImmediate(b);n+=o<k?q:q.substr(0,l),++o,a()}()}()}},70745:(a,b,c)=>{"use strict";let d=c(34589),{utf8DecodeBytes:e}=c(67449),f=/[\u0009\u000A\u000C\u000D\u0020]/g;function g(a){return 9===a||10===a||12===a||13===a||32===a}let h=/[^\x00-\xFF]/,i=/[^\x00-\x7F]/;function j(a,b,c,d){let e=0,f=a.length-1;if(b)for(;e<a.length&&d(a.charCodeAt(e));)e++;if(c)for(;f>=e&&d(a.charCodeAt(f));)f--;return 0===e&&f===a.length-1?a:a.slice(e,f+1)}a.exports={asciiLowercase:function(a){return i.test(a)?a.replace(/[A-Z]+/g,a=>a.toLowerCase()):a.toLowerCase()},collectASequenceOfCodePoints:function(a,b,c){let d="";for(;c.position<b.length&&a(b[c.position]);)d+=b[c.position],c.position++;return d},collectASequenceOfCodePointsFast:function(a,b,c){let d=b.indexOf(a,c.position),e=c.position;return -1===d?(c.position=b.length,b.slice(e)):(c.position=d,b.slice(e,c.position))},forgivingBase64:function(a){let b=(a=a.replace(f,"")).length;if(b%4==0&&61===a.charCodeAt(b-1)&&(--b,61===a.charCodeAt(b-1)&&--b),b%4==1||/[^+/0-9A-Za-z]/.test(a.length===b?a:a.substring(0,b)))return"failure";let c=Buffer.from(a,"base64");return new Uint8Array(c.buffer,c.byteOffset,c.byteLength)},isASCIIWhitespace:g,isomorphicDecode:function(a){let b=a.length;if(65535>b)return String.fromCharCode.apply(null,a);let c="",d=0,e=65535;for(;d<b;)d+e>b&&(e=b-d),c+=String.fromCharCode.apply(null,a.subarray(d,d+=e));return c},isomorphicEncode:function(a){return d(!h.test(a)),a},parseJSONFromBytes:function(a){return JSON.parse(e(a))},removeASCIIWhitespace:function(a,b=!0,c=!0){return j(a,b,c,g)},removeChars:j,serializeJavascriptValueToJSONString:function(a){let b=JSON.stringify(a);if(void 0===b)throw TypeError("Value is not JSON serializable");return d("string"==typeof b),b}}},70799:(a,b,c)=>{"use strict";c.d(b,{JA:()=>l});var d=c(55511),e=c(77598);let f=function(a){return Array.isArray(a)?a=Buffer.from(a):"string"==typeof a&&(a=Buffer.from(a,"utf8")),(0,e.createHash)("sha1").update(a).digest()},g=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,h=function(a){let b;if(!("string"==typeof a&&g.test(a)))throw TypeError("Invalid UUID");return Uint8Array.of((b=parseInt(a.slice(0,8),16))>>>24,b>>>16&255,b>>>8&255,255&b,(b=parseInt(a.slice(9,13),16))>>>8,255&b,(b=parseInt(a.slice(14,18),16))>>>8,255&b,(b=parseInt(a.slice(19,23),16))>>>8,255&b,(b=parseInt(a.slice(24,36),16))/0x10000000000&255,b/0x100000000&255,b>>>24&255,b>>>16&255,b>>>8&255,255&b)};var i=c(82009);function j(a,b,c,d){var e=b,g=d;let j="string"==typeof a?function(a){let b=new Uint8Array((a=unescape(encodeURIComponent(a))).length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}(a):a,k="string"==typeof e?h(e):e;if("string"==typeof e&&(e=h(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+j.length);if(l.set(k),l.set(j,k.length),(l=f(l))[6]=15&l[6]|80,l[8]=63&l[8]|128,c){if((g??=0)<0||g+16>c.length)throw RangeError(`UUID byte range ${g}:${g+15} is out of buffer bounds`);for(let a=0;a<16;++a)c[g+a]=l[a];return c}return(0,i.k)(l)}function k(a,b=""){return d.createHash("sha256").update(a+b).digest("hex")}function l(a,b=null,c=!0){let e=a.includes("::")?a.split("::")[1]:a,f=b||k(e,"machineId"),g=j(e,j.DNS),h=k(e),i=function(a){let b=Math.floor(Date.now()/1e6),c=new Uint8Array([b>>40&255,b>>32&255,b>>24&255,b>>16&255,b>>8&255,255&b]),d=165;for(let a=0;a<c.length;a++)c[a]=(c[a]^d)+a%256&255,d=c[a];let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",f="";for(let a=0;a<c.length;a+=3){let b=c[a],d=a+1<c.length?c[a+1]:0,g=a+2<c.length?c[a+2]:0;f+=e[b>>2],f+=e[(3&b)<<4|d>>4],a+1<c.length&&(f+=e[(15&d)<<2|g>>6]),a+2<c.length&&(f+=e[63&g])}return`${f}${a}`}(f),m="linux";"u">typeof process&&("win32"===process.platform?m="windows":"darwin"===process.platform&&(m="macos"));let n="x64";return"u">typeof process&&"arm64"===process.arch&&(n="aarch64"),{authorization:`Bearer ${e}`,"connect-accept-encoding":"gzip","connect-protocol-version":"1","content-type":"application/connect+proto","user-agent":"connect-es/1.6.1","x-amzn-trace-id":`Root=${d.randomUUID()}`,"x-client-key":h,"x-cursor-checksum":i,"x-cursor-client-version":"3.1.0","x-cursor-client-type":"ide","x-cursor-client-os":m,"x-cursor-client-arch":n,"x-cursor-client-device-type":"desktop","x-cursor-config-version":d.randomUUID(),"x-cursor-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC","x-ghost-mode":c?"true":"false","x-request-id":d.randomUUID(),"x-session-id":g}}j.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",j.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8"},70815:(a,b,c)=>{"use strict";c.d(b,{$s:()=>i,Bl:()=>j,M8:()=>h,ui:()=>k});var d=c(24081);let e="vault_fts",f=null;function g(a){if(null!==f)return f;try{a.run("CREATE VIRTUAL TABLE IF NOT EXISTS vault_fts USING fts5(text, entryId UNINDEXED, chunkIndex UNINDEXED, conversationId UNINDEXED, tokenize='porter unicode61')"),f=!0}catch{f=!1}return f}async function h({id:a,conversationId:b,toolName:c,content:f,chunks:i,ttlMs:j}={}){try{if("string"!=typeof a||!a||"string"!=typeof b||!b||"string"!=typeof f||!f)return!1;let h=Buffer.byteLength(f,"utf8"),k=Number(j);if(h>5242880||!Number.isFinite(k)||k<=0)return!1;let l=await (0,d.c)(),m=Date.now(),n=new Date(m).toISOString(),o=new Date(m+k).toISOString(),p=Array.isArray(i)&&i.length>0?i:[f];if(p.length>2e3)return!1;l.run(`INSERT OR REPLACE INTO vault_entries(id, conversationId, toolName, content, sizeBytes, createdAt, expiresAt, lastAccessedAt)
|
|
390
|
+
[CommandCode error: ${e}]`})),d.push(m(b,{},f.bC.STOP))}}return d.length?d:null}(0,d.kz)(e.h.COMMANDCODE,e.h.OPENAI,null,o)},69641:(a,b,c)=>{"use strict";c.a(a,async(a,b)=>{try{c(22884),c(87350),c(17525);var d=c(68531);c(82812),c(18762),c(20830),c(96997),c(1654),c(98976),c(6125),c(50969),c(13161),c(38421),c(80152),c(82689),c(7878),c(17438);var e=c(95695);c(81556),c(49926),c(69493),c(52748),c(978),c(96998),c(76441),c(55261),c(4879),c(34578),c(78116),c(25720),c(49623),c(31629),c(23493),c(33871),c(50132),c(49471),c(46036),c(14896);var f=a([e]);e=(f.then?(await f)():f)[0],d.h.GEMINI,d.h.GEMINI_CLI,d.h.ANTIGRAVITY,d.h.VERTEX,b()}catch(a){b(a)}})},70106:(a,b,c)=>{"use strict";let{parseSetCookie:d}=c(5831),{stringify:e}=c(84698),{webidl:f}=c(32984);function g(a){try{f.brandCheck(a,f.is.Headers);return}catch{}f.brandCheck(a,f.util.MakeTypeAssertion(globalThis.Headers))}function h(a,b){f.argumentLengthCheck(arguments,2,"setCookie"),g(a);let c=e(b=f.converters.Cookie(b));c&&a.append("set-cookie",c,!0)}f.converters.DeleteCookieAttributes=f.dictionaryConverter([{converter:f.nullableConverter(f.converters.DOMString),key:"path",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.DOMString),key:"domain",defaultValue:()=>null}]),f.converters.Cookie=f.dictionaryConverter([{converter:f.converters.DOMString,key:"name"},{converter:f.converters.DOMString,key:"value"},{converter:f.nullableConverter(a=>"number"==typeof a?f.converters["unsigned long long"](a):new Date(a)),key:"expires",defaultValue:()=>null},{converter:f.nullableConverter(f.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.DOMString),key:"path",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.boolean),key:"secure",defaultValue:()=>null},{converter:f.nullableConverter(f.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:f.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:f.sequenceConverter(f.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]),a.exports={getCookies:function(a){f.argumentLengthCheck(arguments,1,"getCookies"),g(a);let b=a.get("cookie"),c={__proto__:null};if(!b)return c;for(let a of b.split(";")){let[b,...d]=a.split("=");c[b.trim()]=d.join("=")}return c},deleteCookie:function(a,b,c){g(a);let d="deleteCookie";f.argumentLengthCheck(arguments,2,d),b=f.converters.DOMString(b,d,"name"),c=f.converters.DeleteCookieAttributes(c),h(a,{name:b,value:"",expires:new Date(0),...c})},getSetCookies:function(a){f.argumentLengthCheck(arguments,1,"getSetCookies"),g(a);let b=a.getSetCookie();return b?b.map(a=>d(a)):[]},setCookie:h,parseCookie:function(a){return d(a=f.converters.DOMString(a))}}},70459:(a,b,c)=>{"use strict";let{Transform:d}=c(57075),{Console:e}=c(37540),f=process.versions.icu?"✅":"Y ",g=process.versions.icu?"❌":"N ";a.exports=class{constructor({disableColors:a}={}){this.transform=new d({transform(a,b,c){c(null,a)}}),this.logger=new e({stdout:this.transform,inspectOptions:{colors:!a&&!process.env.CI}})}format(a){let b=a.map(({method:a,path:b,data:{statusCode:c},persist:d,times:e,timesInvoked:h,origin:i})=>({Method:a,Origin:i,Path:b,"Status code":c,Persistent:d?f:g,Invocations:h,Remaining:d?1/0:e-h}));return this.logger.table(b),this.transform.read().toString()}}},70625:(a,b,c)=>{"use strict";c.d(b,{Iq:()=>B,Kn:()=>v,dV:()=>w,zi:()=>x});var d=c(73024),e=c(76760),f=c(77598),g=c(59882),h=c(3507);let i=["claude-cli","codex-cli","gemini-cli"],j=new Map,k=new Map,l=new Set,m=null;function n(){let a=process.env.DATA_DIR||e.join(process.env.HOME||process.env.USERPROFILE||".",".switchboard");return e.join(a,"identity")}function o(a){return e.join(n(),`${a}.json`)}let p=function(){try{return JSON.parse(d.readFileSync(e.join(process.cwd(),"open-sse","identity","snapshots","versions.json"),"utf8"))}catch{try{return JSON.parse(d.readFileSync(new c.U(c(13839)),"utf8"))}catch{return{}}}}();function q(a){let b=p[a],c=b?.version;if(!c)return null;if("claude-cli"!==a)return{version:c,latestVersion:b.latestVersion};let d=b.tlsSpecRev||c;return{version:c,billingVersion:c,tlsSpecRev:d,latestVersion:b.latestVersion,capturedAt:b.capturedAt,entrypoint:b.entrypoint||"cli",userAgent:`claude-cli/${c} (external, ${b.entrypoint||"cli"})`,packageVersion:b.packageVersion||"0.128.0",runtimeVersion:b.runtimeVersion||"v26.3.0",betas:b.betas||"claude-code-20250219,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,effort-2025-11-24,structured-outputs-2025-12-15"}}function r(a){let b=String(a||"").split(".").map(Number);return 3===b.length&&b.every(Number.isInteger)?b:null}function s(a){let b=String(a?.tlsSpecRev||"").match(/(\d+\.\d+\.\d+)/);return b?.[1]||null}function t(a,b){let c=r(a),d=r(b);if(!c||!d)return 0;for(let a=0;a<3;a++)if(c[a]!==d[a])return c[a]-d[a];return 0}function u(a){return!!(a?.version&&a?.billingVersion===a.version&&s(a)===a.version&&a.version===(z(p["claude-cli"]?.tlsSpecRev)||p["claude-cli"]?.version||null)&&a?.userAgent?.includes(`claude-cli/${a.version}`)&&a?.packageVersion&&a?.runtimeVersion&&a?.betas)}function v(a){return{version:a?.version||null,billingVersion:a?.billingVersion||null,tlsVersion:s(a),userAgentVersion:z(a?.userAgent)}}function w(a){if(j.has(a))return j.get(a);let b=null;try{b=JSON.parse(d.readFileSync(o(a),"utf8"))}catch{b=q(a)}return"claude-cli"!==a||u(b)||(b=q(a)),b&&j.set(a,b),b}function x(a){let b=w(a);return"claude-cli"!==a||u(b)?b:q(a)}function y(a,b){if(b&&"object"==typeof b){j.set(a,b);try{d.mkdirSync(n(),{recursive:!0}),d.writeFileSync(o(a),JSON.stringify(b,null,2))}catch{}}}function z(a){if("string"!=typeof a)return null;let b=a.match(/claude-cli\/(\d+\.\d+\.\d+)/i)||a.match(/codex_cli_rs\/(\d+\.\d+\.\d+)/i)||a.match(/GeminiCLI\/(\d+\.\d+\.\d+)/i)||a.match(/Cline\/(\d+\.\d+\.\d+)/i)||a.match(/antigravity\/(\d+\.\d+\.\d+)/i)||a.match(/QwenCode\/(\d+\.\d+\.\d+)/i)||a.match(/GitHubCopilotChat\/(\d+\.\d+\.\d+)/i);return b?b[1]:null}let A={"claude-cli":/claude-(?:cli|code)\//i,"codex-cli":/codex_cli_rs\//i,"gemini-cli":/GeminiCLI\//i,cline:/Cline\//i,antigravity:/antigravity\//i,qwen:/QwenCode\//i,copilot:/GitHubCopilotChat\//i};function B(a){let b=a||"anonymous";if(k.has(b))return k.get(b);let c=(0,f.createHash)("sha256").update(`device:${b}`).digest("hex"),d={buildHash:c.slice(0,3),deviceId:c,accountUuid:`${c.slice(0,8)}-${c.slice(8,12)}-4${c.slice(13,16)}-a${c.slice(17,20)}-${c.slice(20,32)}`,os:(0,h.vv)(),arch:(0,h.Tc)()};return k.set(b,d),d}function C(a,b){l.has(a)||(l.add(a),console.warn(`[IDENTITY_STALE] ${a}: ${b}`))}async function D(a,b){let c=g.jI[a]?.source?.npm;if(!c)return null;let d=await b(`https://registry.npmjs.org/${encodeURIComponent(c)}/latest`,{headers:{Accept:"application/json"}});if(!d.ok)return null;let e=await d.json();return r(e?.version)?e.version:null}async function E(a=globalThis.fetch){"function"==typeof a&&await Promise.all(i.map(async b=>{try{var c;let d,e=await D(b,a);if(!e)return;let f=x(b)||q(b)||{};if("claude-cli"===b){t(e,f.version)>0&&(y(b,{...f,latestVersion:e,checkedAt:Date.now()}),C(b,`npm ${e} is ahead of captured tuple ${f.version}`));return}if(c=f,!(!((d=A[b])&&c?.userAgent)||d.test(c.userAgent))||t(f.version,e)>0)C(b,`stored snapshot ${f.version} cannot belong to ${b}; reset to npm ${e}`),f=q(b)||{};else if(0>=t(e,f.version))return;let g="codex-cli"===b?`codex_cli_rs/${e}`:f.userAgent;y(b,{...f,version:e,...g?{userAgent:g}:{},checkedAt:Date.now()})}catch{}}))}function F(){let a=Date.now();for(let b of Object.keys(g.jI)){let c=x(b)||q(b),d=c?.capturedAt;if(!d)continue;let e=a-new Date(d).getTime();if(Number.isFinite(e)&&e>2592e6){let a=Math.floor(e/864e5);C(b,`snapshot is ${a}d old; run npm run identity:refresh`)}}}"1"!==process.env.SWITCHBOARD_DISABLE_IDENTITY_POLL&&queueMicrotask(()=>(function(a=globalThis.fetch){return m||"function"!=typeof a||(E(a),F(),m=setInterval(()=>{E(a),F()},216e5),m.unref?.()),m})())},70634:(a,b,c)=>{"use strict";let{MockNotMatchedError:d}=c(28998),{kDispatches:e,kMockAgent:f,kOriginalDispatch:g,kOrigin:h,kGetNetConnect:i,kTotalDispatchCount:j}=c(80830),{serializePathWithQuery:k,parseHeaders:l}=c(84285),{STATUS_CODES:m}=c(37067),{types:{isPromise:n}}=c(57975),{InvalidArgumentError:o}=c(61448),p=Symbol("request aborted");function q(a,b){return"string"==typeof a?a===b:a instanceof RegExp?a.test(b):"function"==typeof a&&!0===a(b)}function r(a){return Object.fromEntries(Object.entries(a).map(([a,b])=>[a.toLocaleLowerCase(),b]))}function s(a,b){if(Array.isArray(a)){for(let c=0;c<a.length;c+=2)if(a[c].toLocaleLowerCase()===b.toLocaleLowerCase())return a[c+1];return}return"function"==typeof a.get?a.get(b):r(a)[b.toLocaleLowerCase()]}function t(a){let b=a.slice(),c=[];for(let a=0;a<b.length;a+=2)c.push([b[a],b[a+1]]);return Object.fromEntries(c)}function u(a,b){if("function"==typeof a.headers)return Array.isArray(b)&&(b=t(b)),a.headers(b?r(b):{});if(void 0===a.headers)return!0;if("object"!=typeof b||"object"!=typeof a.headers)return!1;for(let[c,d]of Object.entries(a.headers))if(!q(d,s(b,c)))return!1;return!0}function v(a){if("string"!=typeof a)return a;let b=a.split("?",3);if(2!==b.length)return a;let c=new URLSearchParams(b.pop());return c.sort(),[...b,c.toString()].join("?")}function w(a){if(Buffer.isBuffer(a)||a instanceof Uint8Array)return a;if(a instanceof ArrayBuffer)return a;if(ArrayBuffer.isView(a))return new Uint8Array(a.buffer,a.byteOffset,a.byteLength);if("object"==typeof a)return JSON.stringify(a);else if(a)return a.toString();else return""}function x(a,b){let c=b.query?k(b.path,b.query):b.path,e="string"==typeof c?v(c):c,f=z(e),g=a.filter(({consumed:a})=>!a).filter(({path:a,ignoreTrailingSlash:b})=>b?q(z(v(a)),f):q(v(a),e));if(0===g.length)throw new d(`Mock dispatch not matched for path '${e}'`);if(0===(g=g.filter(({method:a})=>q(a,b.method))).length)throw new d(`Mock dispatch not matched for method '${b.method}' on path '${e}'`);if(0===(g=g.filter(({body:a})=>void 0===a||q(a,b.body))).length)throw new d(`Mock dispatch not matched for body '${b.body}' on path '${e}'`);if(0===(g=g.filter(a=>u(a,b.headers))).length){let a="object"==typeof b.headers?JSON.stringify(b.headers):b.headers;throw new d(`Mock dispatch not matched for headers '${a}' on path '${e}'`)}return g[0]}function y(a,b){let c=a.findIndex(a=>!!a.consumed&&function(a,{path:b,method:c,body:d,headers:e}){let f=q(a.path,b),g=q(a.method,c),h=void 0===a.body||q(a.body,d),i=u(a,e);return f&&g&&h&&i}(a,b));-1!==c&&a.splice(c,1)}function z(a){if("string"!=typeof a)return a;for(;a.endsWith("/");)a=a.slice(0,-1);return 0===a.length&&(a="/"),a}function A(a){let{path:b,method:c,body:d,headers:e,query:f}=a;return{path:b,method:c,body:d,headers:e,query:f}}function B(a){let b=Object.keys(a),c=[];for(let d=0;d<b.length;++d){let e=b[d],f=a[e],g=Buffer.from(`${e}`);if(Array.isArray(f))for(let a=0;a<f.length;++a)c.push(g,Buffer.from(`${f[a]}`));else c.push(g,Buffer.from(`${f}`))}return c}function C(a){return m[a]||"unknown"}function D(a,b){let c=A(a),d=x(this[e],c),f=this[e];d.timesInvoked++;let{timesInvoked:g,times:h}=d;d.consumed=!d.persist&&g>=h,d.pending=g<h;let i="function"==typeof b.onBodySent||"function"==typeof b.onRequestSent;if(d.data.callback&&(!i||null==a.body)){let{callback:e,...g}=d.data,h=e(a);if(n(h))return h.then(e=>{null==e||"object"!=typeof e?b.onResponseError(null,new o("reply options callback must return an object")):E(f,d,c,a,b,{...g,...e})},a=>{b.onResponseError(null,a)}),!0;if(null==h||"object"!=typeof h)throw new o("reply options callback must return an object");return E(f,d,c,a,b,{...g,...h})}return E(f,d,c,a,b)}function E(a,b,c,d,e,f){let{data:g,delay:h}=b,i=f??g;if(null!==i.error)return y(a,c),e.onResponseError(null,i.error),!0;let j=!1,k=null,m={paused:!1,rawHeaders:null,rawTrailers:null,pause(){this.paused=!0},resume(){this.paused=!1},abort:a=>{j||(j=!0,null!==k&&(clearTimeout(k),k=null),e.onResponseError?.(m,a))}},q=d;if(e.onRequestStart?.(m,null),j)return!0;let r=function(a,b,c,d){var e;if("function"!=typeof b.onBodySent&&"function"!=typeof b.onRequestSent)return a;if(null==a)return H(b,c,d)?a:p;if(a&&"function"==typeof a[Symbol.asyncIterator])return F(a,b,c,d);if("string"!=typeof(e=a)&&!Buffer.isBuffer(e)&&!ArrayBuffer.isView(e)&&"function"==typeof e[Symbol.iterator]){let e=[];for(let f of a)if(d()||(e.push(f),!G(b,c,f)||d()))return p;return H(b,c,d)?e:p}return d()||!G(b,c,a)?p:H(b,c,d)?a:p}(d.body,e,m,()=>j);if(n(r))return r.then(a=>{a!==p&&(a!==d.body&&(q={...d,body:a}),s())},a=>m.abort(a)),!0;if(r===p)return!0;function s(){if(i.callback){let b,{callback:d,...f}=i;try{b=d(q)}catch(b){y(a,c),e.onResponseError(null,b);return}if(n(b))return void b.then(b=>{null==b||"object"!=typeof b?e.onResponseError(null,new o("reply options callback must return an object")):u(a,{...f,...b})},a=>{e.onResponseError(null,a)});if(null==b||"object"!=typeof b)throw new o("reply options callback must return an object");return void u(a,{...f,...b})}"number"==typeof h&&h>0?k=setTimeout(()=>{k=null,u(a)},h):u(a)}function u(a,b=i){if(j)return;let{statusCode:f,data:g,headers:h,trailers:k}=b,o=Array.isArray(d.headers)?t(d.headers):d.headers,p="function"==typeof g?g({...q,headers:o}):g;if(n(p))return p.then(c=>u(a,{...b,data:c}));if(j)return;let r=w(p),s=B(h??{}),v=B(k??{});m.rawHeaders=s,m.rawTrailers=v,e.onResponseStart?.(m,f,l(s),C(f)),e.onResponseData?.(m,Buffer.from(r)),e.onResponseEnd?.(m,l(v)),y(a,c)}return r!==d.body&&(q={...d,body:r}),s(),!0}async function F(a,b,c,d){let e=[];for await(let f of a)if(d()||(e.push(f),!G(b,c,f)||d()))return p;return H(b,c,d)?{async *[Symbol.asyncIterator](){yield*e}}:p}function G(a,b,c){try{return a.onBodySent?.(c),!0}catch(a){return b.abort(a),!1}}function H(a,b,c){try{return a.onRequestSent?.(),!c()}catch(a){return b.abort(a),!1}}function I(a,b){let c=new URL(b);return!0===a||!!(Array.isArray(a)&&a.some(a=>q(a,c.host)))}a.exports={getResponseData:w,getMockDispatch:x,addMockDispatch:function(a,b,c,d){let e={timesInvoked:0,times:1,persist:!1,consumed:!1,...d},f="function"==typeof c?{callback:c}:{...c},g={...e,...b,pending:!0,data:{error:null,...f}};return a.push(g),a[j]=(a[j]||0)+1,g},deleteMockDispatch:y,buildKey:A,generateKeyValues:B,matchValue:q,getResponse:async function a(a){let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString("utf8")},getStatusText:C,mockDispatch:D,buildMockDispatch:function(){let a=this[f],b=this[h],c=this[g];return function(f,g){if(a.isMockActive)try{D.call(this,f,g)}catch(h){if("UND_MOCK_ERR_MOCK_NOT_MATCHED"===h.code){let k=a[i](),l=this[e][j]||this[e].length,m=this[e].filter(({consumed:a})=>!a).length,n=`, ${m} interceptor(s) remaining out of ${l} defined`;if(!1===k)throw new d(`${h.message}: subsequent request to origin ${b} was not allowed (net.connect disabled)${n}`);if(I(k,b))c.call(this,"__mockAgentBodyForDispatch"in f?{...f,body:f.__mockAgentBodyForDispatch}:f,g);else throw new d(`${h.message}: subsequent request to origin ${b} was not allowed (net.connect is not enabled for this origin)${n}`)}else throw h}else c.call(this,f,g)}},checkNetConnect:I,buildAndValidateMockOptions:function(a){let{agent:b,...c}=a;if("enableCallHistory"in c&&"boolean"!=typeof c.enableCallHistory)throw new o("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in c&&"boolean"!=typeof c.acceptNonStandardSearchParameters)throw new o("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in c&&"boolean"!=typeof c.ignoreTrailingSlash)throw new o("options.ignoreTrailingSlash must to be a boolean");return c},getHeaderByName:s,buildHeadersFromArray:t,normalizeSearchParams:function(a){if("string"!=typeof a)return a;let b=new URLSearchParams(a),c=new URLSearchParams;for(let[a,d]of b.entries()){if(a=a.replace("[]",""),/^(['"]).*\1$/.test(d)){c.append(a,d);continue}if(d.includes(",")){for(let b of d.split(","))c.append(a,b);continue}c.append(a,d)}return c},normalizeOrigin:function(a){return"string"==typeof a||a instanceof URL?a instanceof URL?a.origin:a.toLowerCase():a}}},70707:(a,b,c)=>{"use strict";let d=c(67519);a.exports=function({maxRedirections:a,throwOnMaxRedirect:b,stripHeadersOnRedirect:c,stripHeadersOnCrossOriginRedirect:e}={}){return f=>function(g,h){let{maxRedirections:i=a,throwOnMaxRedirect:j=b,stripHeadersOnRedirect:k=c,stripHeadersOnCrossOriginRedirect:l=e,...m}=g;if(null==i||0===i)return f(g,h);let n={...m,throwOnMaxRedirect:j,stripHeadersOnRedirect:k,stripHeadersOnCrossOriginRedirect:l},o=new d(f,i,n,h);return f(n,o)}}},70710:(a,b,c)=>{var d,e=c(45654);c(76632),c(1277),c(33889);var f=e.pkcs5=e.pkcs5||{};e.util.isNodejs&&!e.options.usePureJavaScript&&(d=c(55511)),a.exports=e.pbkdf2=f.pbkdf2=function(a,b,c,f,g,h){if("function"==typeof g&&(h=g,g=null),e.util.isNodejs&&!e.options.usePureJavaScript&&d.pbkdf2&&(null===g||"object"!=typeof g)&&(d.pbkdf2Sync.length>4||!g||"sha1"===g))return("string"!=typeof g&&(g="sha1"),a=Buffer.from(a,"binary"),b=Buffer.from(b,"binary"),h)?4===d.pbkdf2Sync.length?d.pbkdf2(a,b,c,f,function(a,b){if(a)return h(a);h(null,b.toString("binary"))}):d.pbkdf2(a,b,c,f,g,function(a,b){if(a)return h(a);h(null,b.toString("binary"))}):4===d.pbkdf2Sync.length?d.pbkdf2Sync(a,b,c,f).toString("binary"):d.pbkdf2Sync(a,b,c,f,g).toString("binary");if(null==g&&(g="sha1"),"string"==typeof g){if(!(g in e.md.algorithms))throw Error("Unknown hash algorithm: "+g);g=e.md[g].create()}var i=g.digestLength;if(f>0xffffffff*i){var j=Error("Derived key is too long.");if(h)return h(j);throw j}var k=Math.ceil(f/i),l=f-(k-1)*i,m=e.hmac.create();m.start(g,a);var n="";if(!h){for(var o=1;o<=k;++o){m.start(null,null),m.update(b),m.update(e.util.int32ToBytes(o)),q=s=m.digest().getBytes();for(var p=2;p<=c;++p)m.start(null,null),m.update(s),r=m.digest().getBytes(),q=e.util.xorBytes(q,r,i),s=r;n+=o<k?q:q.substr(0,l)}return n}var q,r,s,p,o=1;!function a(){if(o>k)return h(null,n);m.start(null,null),m.update(b),m.update(e.util.int32ToBytes(o)),q=s=m.digest().getBytes(),p=2,function b(){if(p<=c)return m.start(null,null),m.update(s),r=m.digest().getBytes(),q=e.util.xorBytes(q,r,i),s=r,++p,e.util.setImmediate(b);n+=o<k?q:q.substr(0,l),++o,a()}()}()}},70745:(a,b,c)=>{"use strict";let d=c(34589),{utf8DecodeBytes:e}=c(67449),f=/[\u0009\u000A\u000C\u000D\u0020]/g;function g(a){return 9===a||10===a||12===a||13===a||32===a}let h=/[^\x00-\xFF]/,i=/[^\x00-\x7F]/;function j(a,b,c,d){let e=0,f=a.length-1;if(b)for(;e<a.length&&d(a.charCodeAt(e));)e++;if(c)for(;f>=e&&d(a.charCodeAt(f));)f--;return 0===e&&f===a.length-1?a:a.slice(e,f+1)}a.exports={asciiLowercase:function(a){return i.test(a)?a.replace(/[A-Z]+/g,a=>a.toLowerCase()):a.toLowerCase()},collectASequenceOfCodePoints:function(a,b,c){let d="";for(;c.position<b.length&&a(b[c.position]);)d+=b[c.position],c.position++;return d},collectASequenceOfCodePointsFast:function(a,b,c){let d=b.indexOf(a,c.position),e=c.position;return -1===d?(c.position=b.length,b.slice(e)):(c.position=d,b.slice(e,c.position))},forgivingBase64:function(a){let b=(a=a.replace(f,"")).length;if(b%4==0&&61===a.charCodeAt(b-1)&&(--b,61===a.charCodeAt(b-1)&&--b),b%4==1||/[^+/0-9A-Za-z]/.test(a.length===b?a:a.substring(0,b)))return"failure";let c=Buffer.from(a,"base64");return new Uint8Array(c.buffer,c.byteOffset,c.byteLength)},isASCIIWhitespace:g,isomorphicDecode:function(a){let b=a.length;if(65535>b)return String.fromCharCode.apply(null,a);let c="",d=0,e=65535;for(;d<b;)d+e>b&&(e=b-d),c+=String.fromCharCode.apply(null,a.subarray(d,d+=e));return c},isomorphicEncode:function(a){return d(!h.test(a)),a},parseJSONFromBytes:function(a){return JSON.parse(e(a))},removeASCIIWhitespace:function(a,b=!0,c=!0){return j(a,b,c,g)},removeChars:j,serializeJavascriptValueToJSONString:function(a){let b=JSON.stringify(a);if(void 0===b)throw TypeError("Value is not JSON serializable");return d("string"==typeof b),b}}},70799:(a,b,c)=>{"use strict";c.d(b,{JA:()=>l});var d=c(55511),e=c(77598);let f=function(a){return Array.isArray(a)?a=Buffer.from(a):"string"==typeof a&&(a=Buffer.from(a,"utf8")),(0,e.createHash)("sha1").update(a).digest()},g=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,h=function(a){let b;if(!("string"==typeof a&&g.test(a)))throw TypeError("Invalid UUID");return Uint8Array.of((b=parseInt(a.slice(0,8),16))>>>24,b>>>16&255,b>>>8&255,255&b,(b=parseInt(a.slice(9,13),16))>>>8,255&b,(b=parseInt(a.slice(14,18),16))>>>8,255&b,(b=parseInt(a.slice(19,23),16))>>>8,255&b,(b=parseInt(a.slice(24,36),16))/0x10000000000&255,b/0x100000000&255,b>>>24&255,b>>>16&255,b>>>8&255,255&b)};var i=c(82009);function j(a,b,c,d){var e=b,g=d;let j="string"==typeof a?function(a){let b=new Uint8Array((a=unescape(encodeURIComponent(a))).length);for(let c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b}(a):a,k="string"==typeof e?h(e):e;if("string"==typeof e&&(e=h(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+j.length);if(l.set(k),l.set(j,k.length),(l=f(l))[6]=15&l[6]|80,l[8]=63&l[8]|128,c){if((g??=0)<0||g+16>c.length)throw RangeError(`UUID byte range ${g}:${g+15} is out of buffer bounds`);for(let a=0;a<16;++a)c[g+a]=l[a];return c}return(0,i.k)(l)}function k(a,b=""){return d.createHash("sha256").update(a+b).digest("hex")}function l(a,b=null,c=!0){let e=a.includes("::")?a.split("::")[1]:a,f=b||k(e,"machineId"),g=j(e,j.DNS),h=k(e),i=function(a){let b=Math.floor(Date.now()/1e6),c=new Uint8Array([b>>40&255,b>>32&255,b>>24&255,b>>16&255,b>>8&255,255&b]),d=165;for(let a=0;a<c.length;a++)c[a]=(c[a]^d)+a%256&255,d=c[a];let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",f="";for(let a=0;a<c.length;a+=3){let b=c[a],d=a+1<c.length?c[a+1]:0,g=a+2<c.length?c[a+2]:0;f+=e[b>>2],f+=e[(3&b)<<4|d>>4],a+1<c.length&&(f+=e[(15&d)<<2|g>>6]),a+2<c.length&&(f+=e[63&g])}return`${f}${a}`}(f),m="linux";"u">typeof process&&("win32"===process.platform?m="windows":"darwin"===process.platform&&(m="macos"));let n="x64";return"u">typeof process&&"arm64"===process.arch&&(n="aarch64"),{authorization:`Bearer ${e}`,"connect-accept-encoding":"gzip","connect-protocol-version":"1","content-type":"application/connect+proto","user-agent":"connect-es/1.6.1","x-amzn-trace-id":`Root=${d.randomUUID()}`,"x-client-key":h,"x-cursor-checksum":i,"x-cursor-client-version":"3.1.0","x-cursor-client-type":"ide","x-cursor-client-os":m,"x-cursor-client-arch":n,"x-cursor-client-device-type":"desktop","x-cursor-config-version":d.randomUUID(),"x-cursor-timezone":Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC","x-ghost-mode":c?"true":"false","x-request-id":d.randomUUID(),"x-session-id":g}}j.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",j.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8"},70815:(a,b,c)=>{"use strict";c.d(b,{$s:()=>i,Bl:()=>j,M8:()=>h,ui:()=>k});var d=c(24081);let e="vault_fts",f=null;function g(a){if(null!==f)return f;try{a.run("CREATE VIRTUAL TABLE IF NOT EXISTS vault_fts USING fts5(text, entryId UNINDEXED, chunkIndex UNINDEXED, conversationId UNINDEXED, tokenize='porter unicode61')"),f=!0}catch{f=!1}return f}async function h({id:a,conversationId:b,toolName:c,content:f,chunks:i,ttlMs:j}={}){try{if("string"!=typeof a||!a||"string"!=typeof b||!b||"string"!=typeof f||!f)return!1;let h=Buffer.byteLength(f,"utf8"),k=Number(j);if(h>5242880||!Number.isFinite(k)||k<=0)return!1;let l=await (0,d.c)(),m=Date.now(),n=new Date(m).toISOString(),o=new Date(m+k).toISOString(),p=Array.isArray(i)&&i.length>0?i:[f];if(p.length>2e3)return!1;l.run(`INSERT OR REPLACE INTO vault_entries(id, conversationId, toolName, content, sizeBytes, createdAt, expiresAt, lastAccessedAt)
|
|
391
391
|
VALUES(?, ?, ?, ?, ?, ?, ?, ?)`,[a,b,c||null,f,h,n,o,n]),l.run("DELETE FROM vault_chunks WHERE entryId = ?",[a]);for(let c=0;c<p.length;c+=1){let d=p[c];if("string"!=typeof d)throw Error("invalid vault chunk");l.run("INSERT INTO vault_chunks(entryId, chunkIndex, conversationId, text) VALUES(?, ?, ?, ?)",[a,c,b,d])}if(g(l))try{l.run(`DELETE FROM ${e} WHERE entryId = ?`,[a]);for(let c=0;c<p.length;c+=1)l.run(`INSERT INTO ${e}(text, entryId, chunkIndex, conversationId) VALUES(?, ?, ?, ?)`,[p[c],a,c,b])}catch{}let q=l.get("SELECT COUNT(*) AS count FROM vault_entries")?.count||0,r=Number(q)-200;return r>0&&function(a,b){if(!Number.isInteger(b)||b<=0)return;let c="SELECT id FROM vault_entries ORDER BY lastAccessedAt ASC LIMIT ?";if(a.run(`DELETE FROM vault_chunks WHERE entryId IN (${c})`,[b]),g(a))try{a.run(`DELETE FROM ${e} WHERE entryId IN (${c})`,[b])}catch{}a.run(`DELETE FROM vault_entries WHERE id IN (${c})`,[b])}(l,r),!0}catch{return!1}}async function i({conversationId:a,query:b,vaultId:c=null,limit:f=5}={}){try{if("string"!=typeof a||!a||"string"!=typeof b||!b.trim())return[];let i=Math.max(1,Math.min(20,Math.floor(Number(f)||5))),l=function(a){try{if("string"!=typeof a)return[];return(a.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]).filter(a=>a.length>=2).slice(0,12)}catch{return[]}}(b),m=await (0,d.c)(),n=new Date().toISOString(),o=[];if(l.length>0&&g(m))try{let b=l.map(a=>`"${a}"`).join(" OR "),d=c?` AND ${e}.entryId = ?`:"",f=c?[b,a,n,c,i]:[b,a,n,i];o=m.all(`SELECT ${e}.entryId AS entryId, ${e}.chunkIndex AS chunkIndex, ${e}.text AS text, bm25(${e}) AS rank
|
|
392
392
|
FROM ${e} JOIN vault_entries ON vault_entries.id = ${e}.entryId
|
|
393
393
|
WHERE ${e} MATCH ? AND ${e}.conversationId = ? AND vault_entries.expiresAt > ?${d} ORDER BY rank LIMIT ?`,f)}catch{o=[]}if(0===o.length&&l.length>0){var h;let b=l.map(()=>"lower(vault_chunks.text) LIKE ?").join(" OR "),d=c?[a,n,c,...l.map(a=>`%${a}%`),4*i]:[a,n,...l.map(a=>`%${a}%`),4*i];h=m.all(`SELECT vault_chunks.entryId AS entryId, vault_chunks.chunkIndex AS chunkIndex, vault_chunks.text AS text
|
|
@@ -420,7 +420,7 @@ ${b}
|
|
|
420
420
|
Respond ONLY with the JSON object, no other text.`)}else"json_object"===a.type&&u.push("You must respond with valid JSON. Respond ONLY with a JSON object, no other text.")}let v=d?.accessToken||d?.apiKey||"",w="string"==typeof v&&v.includes("sk-ant-oat"),x={type:k.R4.TEXT,text:f.Co};if(u.length>0){let a=u.join("\n"),b={type:k.R4.TEXT,text:a,cache_control:{type:"ephemeral",ttl:"1h"}};s.system=w?[x,b]:[b]}else w&&(s.system=[x]);if(b.tools&&Array.isArray(b.tools)){for(let a of(s.tools=[],b.tools)){let b=a.type;if(b&&b!==k.x4.FUNCTION){s.tools.push(a);continue}let c=a.function??a,d=c.name,f=""+d;e.set(f,d),s.tools.push({name:f,description:"string"==typeof c.description?c.description:String(c.description||""),input_schema:c.parameters||c.input_schema||{type:"object",properties:{},required:[]}})}s.tools.length>0&&(s.tools[s.tools.length-1].cache_control={type:"ephemeral",ttl:"1h"})}return b.tool_choice&&(s.tool_choice=function(a){if(!a)return{type:"auto"};if("string"==typeof a)return"required"===a?{type:"any"}:"none"===a?{type:"none"}:{type:"auto"};if("object"==typeof a){if(a.function?.name)return{type:"tool",name:a.function.name};if(q.has(a.type))return a}return{type:"auto"}}(b.tool_choice)),!1===b.parallel_tool_calls&&s.tools?.length>0&&s.tool_choice?.type!=="none"&&(s.tool_choice={...s.tool_choice||{type:"auto"},disable_parallel_tool_use:!0}),e.size>0&&(s._toolNameMap=e),(0,l.n)(s,{maxTemperature:1}),s}function p(a){if("string"==typeof a.file_url&&/^https?:\/\//.test(a.file_url))return{type:k.R4.DOCUMENT,source:{type:"url",url:a.file_url}};let b=a.file_data,c="string"==typeof b?(0,i.W$)(b):null;if(c&&"application/pdf"===c.mimeType)return{type:k.R4.DOCUMENT,source:{type:"base64",media_type:c.mimeType,data:c.base64}};if(c&&c.mimeType.startsWith("text/"))try{return{type:k.R4.TEXT,text:Buffer.from(c.base64,"base64").toString("utf-8")}}catch{return{type:k.R4.TEXT,text:`[file omitted: ${c.mimeType}]`}}return c?{type:k.R4.TEXT,text:`[file omitted: ${c.mimeType}]`}:a.file_id?{type:k.R4.TEXT,text:`[file omitted: ${a.file_id}]`}:null}let q=new Set(["auto","any","tool","none"]);function r(a,b,c){let d=o(a,b,c);return d.system&&Array.isArray(d.system)&&(d.system=d.system.filter(a=>!a.text||a.text!==f.Co),0===d.system.length&&delete d.system),d.tools&&Array.isArray(d.tools)&&(d.tools=d.tools.map(a=>a.name&&a.name.startsWith("")?{...a,name:a.name.slice(0)}:a)),d.messages&&Array.isArray(d.messages)&&(d.messages=d.messages.map(a=>{if(!a.content||!Array.isArray(a.content))return a;let b=a.content.map(a=>a.type===k.R4.TOOL_USE&&a.name&&a.name.startsWith("")?{...a,name:a.name.slice(0)}:a);return{...a,content:b}})),d}(0,d.kz)(e.h.OPENAI,e.h.CLAUDE,o,null)},84698:a=>{"use strict";function b(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<33||c>126||34===c||40===c||41===c||60===c||62===c||64===c||44===c||59===c||58===c||92===c||47===c||91===c||93===c||63===c||61===c||123===c||125===c)throw Error("Invalid cookie name")}}function c(a){let b=a.length,c=0;if('"'===a[0]){if(1===b||'"'!==a[b-1])throw Error("Invalid cookie value");--b,++c}for(;c<b;){let b=a.charCodeAt(c++);if(b<33||b>126||34===b||44===b||59===b||92===b)throw Error("Invalid cookie value")}}function d(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c<32||c>126||59===c)throw Error("Invalid cookie path")}}function e(a){return a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122}let f=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],h=Array(61).fill(0).map((a,b)=>b.toString().padStart(2,"0"));function i(a){return"number"==typeof a&&(a=new Date(a)),`${f[a.getUTCDay()]}, ${h[a.getUTCDate()]} ${g[a.getUTCMonth()]} ${a.getUTCFullYear()} ${h[a.getUTCHours()]}:${h[a.getUTCMinutes()]}:${h[a.getUTCSeconds()]} GMT`}a.exports={isCTLExcludingHtab:function(a){for(let b=0;b<a.length;++b){let c=a.charCodeAt(b);if(c>=0&&c<=8||c>=10&&c<=31||127===c)return!0}return!1},validateCookieName:b,validateCookiePath:d,validateCookieValue:c,toIMFDate:i,stringify:function(a){if(0===a.name.length)return null;b(a.name),c(a.value);let f=[`${a.name}=${a.value}`];if(a.name.startsWith("__Secure-")&&(a.secure=!0),a.name.startsWith("__Host-")&&(a.secure=!0,a.domain=null,a.path="/"),a.secure&&f.push("Secure"),a.httpOnly&&f.push("HttpOnly"),"number"==typeof a.maxAge){if(a.maxAge<0)throw Error("Invalid cookie max-age");f.push(`Max-Age=${a.maxAge}`)}for(let g of(a.domain&&(!function(a){if(" "===a)return;if(a.length>255)throw Error("Invalid cookie domain");let b=0;for(let c=0;c<a.length;++c){let d=a.charCodeAt(c);if(46===d){if(0===b||45===a.charCodeAt(c-1))throw Error("Invalid cookie domain");b=0;continue}if(0===b&&!e(d)||!e(d)&&45!==d||++b>63)throw Error("Invalid cookie domain")}if(0===b||45===a.charCodeAt(a.length-1))throw Error("Invalid cookie domain")}(a.domain),f.push(`Domain=${a.domain}`)),a.path&&(d(a.path),f.push(`Path=${a.path}`)),null!=a.expires&&"Invalid Date"!==a.expires.toString()&&f.push(`Expires=${i(a.expires)}`),a.sameSite&&f.push(`SameSite=${a.sameSite}`),a.unparsed)){if(!g.includes("="))throw Error("Invalid unparsed");let[a,...d]=g.split("="),e=a.trim(),h=d.join("=");b(e),c(h),f.push(`${e}=${h}`)}return f.join("; ")}}},85513:(a,b,c)=>{"use strict";c.d(b,{i7:()=>e,l6:()=>f});let d=/^[a-z]{2}(?:-[a-z0-9]+)+-\d{1,2}$/;function e(a){return"string"==typeof a&&d.test(a)}function f(a,b="us-east-1"){return e(a)?a:b}},86363:(a,b,c)=>{"use strict";function d(a,b){}c.d(b,{s:()=>d})},86538:(a,b,c)=>{"use strict";var d=c(69537);let e={el:"elevenlabs",jina:"jina-ai","jina-ai":"jina-ai",polly:"aws-polly","aws-polly":"aws-polly"};for(let a of d.A)for(let b of(e[a.id]=a.id,a.alias&&(e[a.alias]=a.id),a.aliases||[]))e[b]=a.id},86625:(a,b,c)=>{"use strict";let{promisify:d}=c(57975),e=c(35689),{buildMockDispatch:f}=c(70634),{kDispatches:g,kMockAgent:h,kClose:i,kOriginalClose:j,kOrigin:k,kOriginalDispatch:l,kConnected:m,kIgnoreTrailingSlash:n}=c(80830),{MockInterceptor:o}=c(55720),p=c(49176),{InvalidArgumentError:q}=c(61448);class r extends e{constructor(a,b){if(!b||!b.agent||"function"!=typeof b.agent.dispatch)throw new q("Argument opts.agent must implement Agent");super(a,b),this[h]=b.agent,this[k]=a,this[n]=b.ignoreTrailingSlash??!1,this[g]=[],this[m]=1,this[l]=this.dispatch,this[j]=this.close.bind(this),this.dispatch=f.call(this),this.close=this[i]}get[p.kConnected](){return this[m]}intercept(a){return new o(a&&{ignoreTrailingSlash:this[n],...a},this[g])}cleanMocks(){this[g]=[]}async [i](){await d(this[j])(),this[m]=0,this[h][p.kClients].delete(this[k])}}a.exports=r},86772:(a,b,c)=>{"use strict";let d=c(29021),e=c(33873),f=c(74075),{DATA_DIR:g}=c(37436),{LOG_BLACKLIST_URL_PARTS:h}=c(794);function i(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let j=e.join(g,"logs","mitm");d.existsSync(j)||d.mkdirSync(j,{recursive:!0});let k=/^\s*(\{\s*\}|\[\s*\]|null)?\s*$/,l=new Set(["authorization","proxy-authorization","cookie","set-cookie","x-api-key","api-key","x-auth-token"]),m=new Set(["api-key","apikey","api_key","token","access-token","access_token","accesstoken","refresh-token","refresh_token","refreshtoken","secret","password","auth"]),n=new Set([...m,"key"]),o="[REDACTED]";function p(a){let b={};for(let[c,d]of Object.entries(a||{}))b[c]=l.has(String(c).toLowerCase())?o:d;return b}function q(a){return Array.isArray(a)?a.map(q):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).map(([a,b])=>[a,m.has(String(a).toLowerCase())?o:q(b)])):"string"==typeof a?a.replace(/Bearer\s+[A-Za-z0-9._~+/=-]{4,}/gi,`Bearer ${o}`):a}function r(a,b=80){return String(a).replace(/[^a-zA-Z0-9]/g,"_").substring(0,b)}function s(a){return!!a&&h.some(b=>a.includes(b))}a.exports={log:a=>console.log(`[${i()}] [MITM] ${a}`),err:a=>console.error(`[${i()}] ❌ [MITM] ${a}`),dumpRequest:function(a,b,c="raw"){if(s(a.url))return null;try{let f=new Date().toISOString().replace(/[:.]/g,"-"),g=r((a.headers.host||"")+a.url),h=e.join(j,`${f}_${c}_${g}.req.json`),i=null;try{i=JSON.parse(b.toString())}catch{}return d.writeFileSync(h,JSON.stringify({method:a.method,url:function(a){if(!a||!a.includes("?"))return a;let b=a.indexOf("?"),c=a.slice(0,b),d=a.slice(b+1).split("&").map(a=>{let b=a.indexOf("="),c=-1===b?a:a.slice(0,b);try{if(n.has(decodeURIComponent(c).toLowerCase()))return`${c}=${o}`}catch{}return a});return`${c}?${d.join("&")}`}(a.url),host:a.headers.host,headers:p(a.headers),body:i?q(i):q(b.toString("utf8"))},null,2)),h}catch{return null}},createResponseDumper:function(a,b="raw"){if(s(a.url))return null;let c=new Date().toISOString().replace(/[:.]/g,"-"),g=r((a.headers.host||"")+a.url),h=e.join(j,`${c}_${b}_${g}.res.txt`),i=0,l={},m=[];return{writeHeader:(a,b)=>{i=a,l=b||{}},writeChunk:a=>{null!=a&&m.push(Buffer.isBuffer(a)?a:Buffer.from(a))},end:()=>{try{let a=Buffer.concat(m),b=l["content-encoding"]||l["Content-Encoding"],c=(function(a,b){if(!a||0===a.length)return a;try{let c=(b||"").toLowerCase();if(c.includes("gzip"))return f.gunzipSync(a);if(c.includes("br"))return f.brotliDecompressSync(a);if(c.includes("deflate"))return f.inflateSync(a)}catch{}return a})(a,b).toString("utf8");if(k.test(c))return;let e=p({...l});delete e["content-encoding"],delete e["Content-Encoding"];let g=`STATUS: ${i}
|
|
421
421
|
HEADERS: ${JSON.stringify(e,null,2)}
|
|
422
422
|
---BODY---
|
|
423
|
-
${function(a){try{let b=JSON.parse(a);return JSON.stringify(q(b))}catch{return q(a)}}(c)}`;d.writeFileSync(h,g)}catch{}},file:h}},clearDumpDir:function(){try{if(!d.existsSync(j))return;for(let a of d.readdirSync(j))try{d.rmSync(e.join(j,a),{recursive:!0,force:!0})}catch{}}catch{}}}},87085:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,RequestAbortedError:e}=c(61448),f=c(60823);class g extends f{#ad=1048576;#bT=!1;#aC=0;aborted=!1;reason=!1;constructor({maxSize:a,signal:b},c){if(null!=a&&(!Number.isFinite(a)||a<1))throw new d("maxSize must be a number greater than 0");super(c),this.#ad=a??this.#ad}#bS(a){this.aborted=!0,this.reason=a}onRequestStart(a,b){return a.abort=this.#bS.bind(this),super.onRequestStart(a,b)}onResponseStart(a,b,c,d){let f=c["content-length"];if(null!=f&&f>this.#ad)throw new e(`Response size (${f}) larger than maxSize (${this.#ad})`);return!0===this.aborted||super.onResponseStart(a,b,c,d)}onResponseError(a,b){super.onResponseError(a,!0===this.aborted?this.reason:b)}onResponseData(a,b){if(this.#aC=this.#aC+b.length,this.#aC>this.#ad)throw new e(`Response size (${this.#aC}) larger than maxSize (${this.#ad})`);return this.#aC===this.#ad&&(this.#bT=!0),!0}onResponseEnd(a,b){!0===this.aborted?super.onResponseError(a,this.reason):super.onResponseEnd(a,this.#bT?{}:b)}}a.exports=function({maxSize:a}={maxSize:1048576}){return b=>function(c,d){let{dumpMaxSize:e=a}=c,f=new g({maxSize:e,signal:c.signal},d);return b(c,f)}}},87350:(a,b,c)=>{"use strict";c.d(b,{Ws:()=>aj});var d=c(68531);c(82812),c(25720),c(30816),c(22884),c(
|
|
423
|
+
${function(a){try{let b=JSON.parse(a);return JSON.stringify(q(b))}catch{return q(a)}}(c)}`;d.writeFileSync(h,g)}catch{}},file:h}},clearDumpDir:function(){try{if(!d.existsSync(j))return;for(let a of d.readdirSync(j))try{d.rmSync(e.join(j,a),{recursive:!0,force:!0})}catch{}}catch{}}}},87085:(a,b,c)=>{"use strict";let{InvalidArgumentError:d,RequestAbortedError:e}=c(61448),f=c(60823);class g extends f{#ad=1048576;#bT=!1;#aC=0;aborted=!1;reason=!1;constructor({maxSize:a,signal:b},c){if(null!=a&&(!Number.isFinite(a)||a<1))throw new d("maxSize must be a number greater than 0");super(c),this.#ad=a??this.#ad}#bS(a){this.aborted=!0,this.reason=a}onRequestStart(a,b){return a.abort=this.#bS.bind(this),super.onRequestStart(a,b)}onResponseStart(a,b,c,d){let f=c["content-length"];if(null!=f&&f>this.#ad)throw new e(`Response size (${f}) larger than maxSize (${this.#ad})`);return!0===this.aborted||super.onResponseStart(a,b,c,d)}onResponseError(a,b){super.onResponseError(a,!0===this.aborted?this.reason:b)}onResponseData(a,b){if(this.#aC=this.#aC+b.length,this.#aC>this.#ad)throw new e(`Response size (${this.#aC}) larger than maxSize (${this.#ad})`);return this.#aC===this.#ad&&(this.#bT=!0),!0}onResponseEnd(a,b){!0===this.aborted?super.onResponseError(a,this.reason):super.onResponseEnd(a,this.#bT?{}:b)}}a.exports=function({maxSize:a}={maxSize:1048576}){return b=>function(c,d){let{dumpMaxSize:e=a}=c,f=new g({maxSize:e,signal:c.signal},d);return b(c,f)}}},87350:(a,b,c)=>{"use strict";c.d(b,{Ws:()=>aj});var d=c(68531);c(82812),c(25720),c(30816),c(22884),c(17525);var e=c(49623);c(65369),c(15251);var f=c(99887);c(45504);var g=c(84460),h=c(10962),i=c(26408),j=c(90242),k=c(52655),l=c(26317),m=c(11897);function n(a){let b=(a||[]).flatMap(a=>a?.parts||[]),c=new Map;for(let a of b){let b=a?.functionCall;if(!b?.name)continue;let d=c.get(b.name)||[];b.id||(b.id=`call_${b.name}_${d.length}`),d.push(b.id),c.set(b.name,d)}let d=new Map;for(let a of b){let b=a?.functionResponse;if(!b?.name)continue;let e=d.get(b.name)||0;b.id||(b.id=c.get(b.name)?.[e]??`call_${b.name}_${e}`),d.set(b.name,e+1)}}function o(a,b,c){let d=b?.request||b||{},e={model:a,messages:[],stream:c};if(d.generationConfig){let a=d.generationConfig;if(a.maxOutputTokens){let b={max_tokens:a.maxOutputTokens,tools:d.tools};e.max_tokens=(0,h.M)(b)}if(void 0!==a.temperature&&(e.temperature=a.temperature),void 0!==a.topP&&(e.top_p=a.topP),a.thinkingConfig?.thinkingBudget){let b=(0,l.Vp)(a.thinkingConfig.thinkingBudget);b&&(e.reasoning_effort=b)}}if(d.systemInstruction){var f;let a="string"==typeof(f=d.systemInstruction)?f:f.parts&&Array.isArray(f.parts)?f.parts.map(a=>a.text||"").filter(Boolean).join("\n"):"";a&&e.messages.push({role:m.z7.SYSTEM,content:a})}let g=(0,k.Fq)(d);if(void 0!==g&&(e.tool_choice=g),d.contents&&Array.isArray(d.contents))for(let a of(n(d.contents),d.contents)){let b=function(a){let b=a.role===m.RV.USER?m.z7.USER:m.z7.ASSISTANT;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[],e="";for(let b of a.parts){if(!0===b.thought){void 0!==b.text&&(e+=b.text);continue}if(void 0!==b.text&&c.push({type:m.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:m.x4.IMAGE_URL,image_url:{url:(0,i.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.fileData){let a=b.fileData.fileUri||"";(b.fileData.mimeType||"").startsWith("image/")?c.push({type:m.x4.IMAGE_URL,image_url:{url:a}}):a&&c.push({type:m.x4.TEXT,text:`[File: ${a}]`})}if(b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:m.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse)return{role:m.z7.TOOL,tool_call_id:b.functionResponse.id||`call_${b.functionResponse.name}`,content:JSON.stringify(b.functionResponse.response?.result??b.functionResponse.response??{})}}if(d.length>0){let a={role:m.z7.ASSISTANT};return c.length>0&&(a.content=1===c.length?c[0].text:c),e&&(a.reasoning_content=e),a.tool_calls=d,a}if(c.length>0||e){let a={role:b};return c.length>0&&(a.content=(0,j.z)(c)),e&&(a.reasoning_content=e),a}return null}(a);b&&e.messages.push(b)}if(d.tools&&Array.isArray(d.tools)){for(let a of(e.tools=[],d.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)e.tools.push({type:m.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:b.parameters||{type:"object",properties:{}}}})}return e}function p(a,b,c){let d=b?.request||b;if(!d||!Array.isArray(d.contents))return o(a,b,c);let e=[];for(let a of d.contents){if(!a||!Array.isArray(a.parts)||!a.parts.some(a=>a&&a.functionResponse)){e.push(a);continue}let b=[],c=()=>{b.length>0&&(e.push({...a,parts:b}),b=[])};for(let d of a.parts)d&&d.functionResponse?(c(),e.push({...a,parts:[d]})):b.push(d);c()}return o(a,{...b,...b?.request?{request:{...d,contents:e}}:{contents:e}},c)}(0,f.kz)(d.h.GEMINI,d.h.OPENAI,p,null),(0,f.kz)(d.h.GEMINI_CLI,d.h.OPENAI,p,null);var q=c(69226),r=c(10793),s=c(22435),t=c(27547);function u(){return crypto.randomUUID()}function v(a){if(!a)return"_unknown";let b=a.replace(/[^a-zA-Z0-9_.:\-]/g,"_");return/^[a-zA-Z_]/.test(b)||(b="_"+b),b.substring(0,64)}function w(a){let b=[];for(let c of a||[]){if(!c?.role||!Array.isArray(c.parts)||0===c.parts.length)continue;let a=b.at(-1);a?.role===c.role?a.parts.push(...c.parts):b.push({...c,parts:[...c.parts]})}return b}function x(a,b,c,d=q.bf){let e={model:a,contents:[],generationConfig:{},safetySettings:s.fc};void 0!==b.temperature&&(e.generationConfig.temperature=b.temperature),void 0!==b.top_p&&(e.generationConfig.topP=b.top_p),void 0!==b.top_k&&(e.generationConfig.topK=b.top_k);let f=b.max_tokens??b.max_completion_tokens??b.max_output_tokens;if(void 0!==f&&(e.generationConfig.maxOutputTokens=f),void 0!==b.stop){let a=(Array.isArray(b.stop)?b.stop:[b.stop]).filter(a=>"string"==typeof a&&a);a.length>0&&(e.generationConfig.stopSequences=a.slice(0,5))}b.response_format?.type==="json_object"?e.generationConfig.responseMimeType="application/json":b.response_format?.type==="json_schema"&&b.response_format.json_schema?.schema&&(e.generationConfig.responseMimeType="application/json",e.generationConfig.responseSchema=(0,s.Yr)(structuredClone(b.response_format.json_schema.schema)));let g={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(a.role===m.z7.ASSISTANT&&a.tool_calls)for(let b of a.tool_calls)b.type===m.x4.FUNCTION&&b.id&&b.function?.name&&(g[b.id]=b.function.name)}let h=new Map;if(b.messages&&Array.isArray(b.messages))for(let a of b.messages)a.role===m.z7.TOOL&&a.tool_call_id&&h.set(a.tool_call_id,a.content??"");if(b.messages&&Array.isArray(b.messages))for(let a=0;a<b.messages.length;a++){let c=b.messages[a],f=c.role===m.z7.DEVELOPER?m.z7.SYSTEM:c.role,i=c.content;if(f===m.z7.SYSTEM&&b.messages.length>1){let a="string"==typeof i?i:(0,s.kU)(i,"\n");if(a){let b=e.systemInstruction?.parts?.[0]?.text;e.systemInstruction={role:m.RV.USER,parts:[{text:b?`${b}
|
|
424
424
|
${a}`:a}]}}}else if(f===m.z7.USER||f===m.z7.SYSTEM&&1===b.messages.length){let a=(0,s.S6)(i);a.length>0&&e.contents.push({role:m.RV.USER,parts:a})}else if(f===m.z7.ASSISTANT){let a=[];if(c.reasoning_content&&(a.push({thought:!0,text:c.reasoning_content}),a.push({thoughtSignature:d,text:""})),i){let b="string"==typeof i?i:(0,s.kU)(i);b&&a.push({text:b})}if(c.tool_calls&&Array.isArray(c.tool_calls)){let b=[];for(let e of c.tool_calls){if(e.type!==m.x4.FUNCTION)continue;let c=(0,s.pT)(e.function?.arguments||"{}")??{};a.push({thoughtSignature:d,functionCall:{id:e.id,name:v(e.function.name),args:c}}),b.push(e.id)}if(a.length>0&&e.contents.push({role:m.RV.MODEL,parts:a}),b.some(a=>h.has(a))){let a=[];for(let c of b){if(!h.has(c))continue;let b=g[c];if(!b){let a=c.split("-");b=a.length>2?a.slice(0,-2).join("-"):c}let d=h.get(c),e=(0,s.pT)(d);a.push({functionResponse:{id:c,name:v(b),response:{result:null===e?d??"":e}}})}a.length>0&&e.contents.push({role:m.RV.USER,parts:a})}}else a.length>0&&e.contents.push({role:m.RV.MODEL,parts:a})}}if(b.tools&&Array.isArray(b.tools)&&b.tools.length>0){let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,s.Yr)(structuredClone(c.input_schema||{type:"object",properties:{}}));a.push({name:v(c.name),description:c.description||"",parameters:b})}else if(c.type===m.x4.FUNCTION&&c.function){let b=c.function,d=(0,s.Yr)(structuredClone(b.parameters||{type:"object",properties:{}}));a.push({name:v(b.name),description:b.description||"",parameters:d})}a.length>0&&(e.tools=[{functionDeclarations:a}])}return e.tools?.length>0&&void 0!==b.tool_choice&&(e.toolConfig={functionCallingConfig:function(a){if("none"===a)return{mode:"NONE"};if("required"===a)return{mode:"ANY"};if("auto"===a)return{mode:"AUTO"};if("object"==typeof a&&null!==a){if("none"===a.type)return{mode:"NONE"};if("any"===a.type||"required"===a.type)return{mode:"ANY"};let b=a.function?.name||a.name;if(b)return{mode:"ANY",allowedFunctionNames:[v(b)]}}return{mode:"AUTO"}}(b.tool_choice)}),e.contents=w(e.contents),(0,t.n)(e.generationConfig),e}function y(a,b,c){let d=x(a,b,c,q.$G);if(d.tools?.[0]?.functionDeclarations){for(let a of d.tools[0].functionDeclarations)if(a.parameters){let b=(0,s.Yr)(a.parameters);a.parameters=b}}return d}function z(a,b,c=null,d=!1){let f={project:c?.projectId||(0,s.w_)(),model:a,userAgent:d?"antigravity":"gemini-cli",requestId:d?`agent-${u()}`:(0,s.KZ)(),request:{sessionId:(0,e.E9)(c?._clientSessionId)||(d?(0,e.RF)(c?.email||c?.connectionId):(0,s.f6)()),contents:b.contents,systemInstruction:b.systemInstruction,generationConfig:b.generationConfig,tools:b.tools}};if(b.toolConfig&&(f.request.toolConfig=b.toolConfig),d){f.requestType="agent";let a=[{text:r.$V},{text:`Please ignore the following [ignore]${r.$V}[/ignore]`}];f.request.systemInstruction?.parts?f.request.systemInstruction.parts.unshift(...a):f.request.systemInstruction={role:m.RV.USER,parts:a},b.tools?.length>0&&!b.toolConfig&&(f.request.toolConfig={functionCallingConfig:{mode:"VALIDATED"}})}else f.request.safetySettings=b.safetySettings;return f}(0,f.kz)(d.h.OPENAI,d.h.GEMINI,function(a,b,c){return x(a,b,c)},null),(0,f.kz)(d.h.OPENAI,d.h.GEMINI_CLI,(a,b,c,d)=>z(a,y(a,b,c),d),null),(0,f.kz)(d.h.OPENAI,d.h.ANTIGRAVITY,function(a,b,c,d=null){if(/^(claude|anthropic)[-/]/i.test(String(a||""))){let f=(0,g.C)(a,b,c);return function(a,b,c=null,d=q.bf){let f={project:c?.projectId||(0,s.w_)(),model:a,userAgent:"antigravity",requestId:`agent-${u()}`,requestType:"agent",request:{sessionId:(0,e.E9)(c?._clientSessionId)||(0,e.RF)(c?.email||c?.connectionId),contents:[],generationConfig:{temperature:b.temperature??1,maxOutputTokens:b.max_tokens||4096}}},g={};if(b.messages&&Array.isArray(b.messages)){for(let a of b.messages)if(Array.isArray(a.content))for(let b of a.content)b.type===m.R4.TOOL_USE&&b.id&&b.name&&(g[b.id]=b.name)}if(b.messages&&Array.isArray(b.messages))for(let a of b.messages){let b=[];if(Array.isArray(a.content)){for(let c of a.content)if(c.type===m.R4.TEXT)b.push({text:c.text});else if(c.type===m.R4.TOOL_USE)b.push({thoughtSignature:d,functionCall:{id:c.id,name:v(c.name),args:c.input||{}}});else if(c.type===m.R4.TOOL_RESULT){let a=c.content;Array.isArray(a)&&(a=a.map(a=>a.type===m.R4.TEXT?a.text:JSON.stringify(a)).join("\n"));let d=g[c.tool_use_id]?v(g[c.tool_use_id]):"tool";b.push({functionResponse:{id:c.tool_use_id,name:d,response:{result:(0,s.pT)(a)||a}}})}}else"string"==typeof a.content&&b.push({text:a.content});b.length>0&&f.request.contents.push({role:a.role===m.z7.ASSISTANT?m.RV.MODEL:m.RV.USER,parts:b})}if(b.tools&&Array.isArray(b.tools)){var h;let a=[];for(let c of b.tools)if(c.name&&c.input_schema){let b=(0,s.Yr)(c.input_schema);a.push({name:v(c.name),description:c.description||"",parameters:b})}a.length>0&&(f.request.tools=[{functionDeclarations:a}],f.request.toolConfig={functionCallingConfig:(h=b.tool_choice,h?.type==="none"?{mode:"NONE"}:h?.type==="auto"?{mode:"AUTO"}:h?.type==="any"?{mode:"ANY"}:h?.type==="tool"&&h.name?{mode:"ANY",allowedFunctionNames:[v(h.name)]}:{mode:"VALIDATED"})})}let i=[{text:r.$V},{text:`Please ignore the following [ignore]${r.$V}[/ignore]`}];if(b.system)if(Array.isArray(b.system))for(let a of b.system)a.text&&i.push({text:a.text});else"string"==typeof b.system&&i.push({text:b.system});return f.request.systemInstruction?.parts?f.request.systemInstruction.parts.unshift(...i):f.request.systemInstruction={role:m.RV.USER,parts:i},f.request.contents=w(f.request.contents),f}(a,f,d)}let f=y(a,b,c);return z(a,f,d,!0)},null),(0,f.kz)(d.h.OPENAI,d.h.VERTEX,function(a,b,c){var d=x(a,b,c,q.n6);if(!d?.contents)return d;for(let a of d.contents)if(Array.isArray(a.parts))for(let b of a.parts)void 0!==b.thoughtSignature&&(b.thoughtSignature=q.n6),b.functionCall&&"id"in b.functionCall&&delete b.functionCall.id,b.functionResponse&&"id"in b.functionResponse&&delete b.functionResponse.id;return d},null),(0,f.kz)(d.h.ANTIGRAVITY,d.h.OPENAI,function(a,b,c){let d=b.request||b,e={model:a,messages:[],stream:c};if(d.generationConfig){let a=d.generationConfig;if(a.maxOutputTokens){let b={max_tokens:a.maxOutputTokens,tools:d.tools};e.max_tokens=(0,h.M)(b)}if(void 0!==a.temperature&&(e.temperature=a.temperature),void 0!==a.topP&&(e.top_p=a.topP),void 0!==a.topK&&(e.top_k=a.topK),a.thinkingConfig){let b=a.thinkingConfig;if("string"==typeof b.thinkingLevel){let a={minimal:"low",low:"low",medium:"medium",high:"high"}[b.thinkingLevel.toLowerCase()];a&&(e.reasoning_effort=a)}else{let a=(0,l.Vp)(b.thinkingBudget||0);a&&(e.reasoning_effort=a)}}}let f=(0,k.Fq)(d);if(void 0!==f&&(e.tool_choice=f),d.systemInstruction){var g;let a="string"==typeof(g=d.systemInstruction)?g:g.parts&&Array.isArray(g.parts)?g.parts.map(a=>a.text||"").filter(Boolean).join("\n"):"";a&&e.messages.push({role:m.z7.SYSTEM,content:a})}if(d.contents&&Array.isArray(d.contents))for(let a of(n(d.contents),d.contents)){let b=function(a){let b=a.role===m.RV.MODEL?m.z7.ASSISTANT:a.role===m.RV.USER?m.z7.USER:a.role;if(!a.parts||!Array.isArray(a.parts))return null;let c=[],d=[],e=[],f="";for(let b of a.parts){if(!0===b.thought&&b.text){f+=b.text;continue}if(b.thoughtSignature&&void 0!==b.text){b.text&&c.push({type:m.x4.TEXT,text:b.text});continue}if(void 0!==b.text&&""!==b.text&&c.push({type:m.x4.TEXT,text:b.text}),b.inlineData&&c.push({type:m.x4.IMAGE_URL,image_url:{url:(0,i.$q)(b.inlineData.mimeType,b.inlineData.data)}}),b.fileData){let a=b.fileData.fileUri||"";(b.fileData.mimeType||"").startsWith("image/")?c.push({type:m.x4.IMAGE_URL,image_url:{url:a}}):a&&c.push({type:m.x4.TEXT,text:`[File: ${a}]`})}if(b.functionCall&&d.push({id:b.functionCall.id||`call_${b.functionCall.name}`,type:m.x4.FUNCTION,function:{name:b.functionCall.name,arguments:JSON.stringify(b.functionCall.args||{})}}),b.functionResponse){let a=b.functionResponse,c={role:m.z7.TOOL,tool_call_id:a.id||`call_${a.name}`,content:JSON.stringify(a.response?.result??a.response??{})};("ERROR"===a.status||!0===a.isError||!0===a.is_error)&&(c.is_error=!0),e.push(c)}}if(e.length>0){if(d.length>0||c.length>0||f){let a={role:m.z7.ASSISTANT};return c.length>0&&(a.content=(0,j.z)(c)),f&&(a.reasoning_content=f),d.length>0&&(a.tool_calls=d),[a,...e]}return e}if(d.length>0){let a={role:m.z7.ASSISTANT};return c.length>0&&(a.content=(0,j.z)(c)),f&&(a.reasoning_content=f),a.tool_calls=d,a}if(c.length>0||f){let a={role:b};return c.length>0&&(a.content=(0,j.z)(c)),f&&(a.reasoning_content=f),a}return null}(a);b&&(Array.isArray(b)?e.messages.push(...b):e.messages.push(b))}if(d.tools&&Array.isArray(d.tools)){for(let a of(e.tools=[],d.tools))if(a.functionDeclarations)for(let b of a.functionDeclarations)e.tools.push({type:m.x4.FUNCTION,function:{name:b.name,description:b.description||"",parameters:function a(b){if(!b||"object"!=typeof b)return b;let c=Array.isArray(b)?[...b]:{...b};if("string"==typeof c.type&&(c.type=c.type.toLowerCase()),delete c.enumDescriptions,c.properties){let b={};for(let[d,e]of Object.entries(c.properties))b[d]=a(e);c.properties=b}return c.items&&(c.items=a(c.items)),c}(b.parameters)||{type:"object",properties:{}}}})}return e},null),c(89666);var A=c(27137),B=c(43835);function C(a,b){let c;try{c="string"==typeof b?b:JSON.stringify(b??{})}catch{c="{}"}return`[Tool call: ${a||"unknown"}(${c})]`}function D(a){let b=Array.isArray(a)?a.map(a=>"string"==typeof a?a:a.text||"").join("\n"):"string"==typeof a?a:"";return`[Tool result: ${b}]`}(0,f.kz)(d.h.OPENAI,d.h.KIRO,function(a,b,c,d){let f=b.messages||[],g=b.tools||[],h="number"==typeof b.max_tokens?b.max_tokens:"number"==typeof b.max_completion_tokens?b.max_completion_tokens:32e3,j=b.temperature,k=b.top_p,{upstream:l,agentic:n}=(0,B.$D)(a),o=(0,B.P9)(b,d?.rawHeaders,a),{history:p,currentMessage:q}=function(a,b,c){let d=[],e=null,f=b&&b.length>0;f||(a=function(a){let b=[];for(let c of a){if(c.role===m.z7.TOOL){b.push({role:m.z7.USER,content:D(c.content)});continue}if(c.role===m.z7.ASSISTANT){let a=[];if(c.reasoning_content&&a.push(c.reasoning_content),Array.isArray(c.content))for(let b of c.content)b.type===m.R4.TOOL_USE?a.push(C(b.name,b.input)):b.type===m.R4.THINKING&&b.thinking?a.push(b.thinking):(b.type===m.x4.TEXT||b.text)&&a.push(b.text||"");else"string"==typeof c.content&&a.push(c.content);for(let b of c.tool_calls||[])a.push(C(b.function?.name,b.function?.arguments));b.push({role:m.z7.ASSISTANT,content:a.filter(Boolean).join("\n")});continue}if(c.role===m.z7.USER&&Array.isArray(c.content)){let a=c.content.map(a=>a.type===m.R4.TOOL_RESULT?{type:m.x4.TEXT,text:D(a.content)}:a);b.push({...c,content:a});continue}b.push(c)}return b}(a));let g=[],h=[],j=[],k=[],l=null,n=!1,o=null,p=()=>{if("user"===l){let a={userInputMessage:{content:g.join("\n\n").trim()||"continue",modelId:""}};k.length>0&&(a.userInputMessage.images=k),j.length>0&&(a.userInputMessage.userInputMessageContext={toolResults:j}),f&&!n&&(a.userInputMessage.userInputMessageContext||(a.userInputMessage.userInputMessageContext={}),o=b.map(a=>{let b=a.function?.name||a.name,c=a.function?.description||a.description||"";c.trim()||(c=`Tool: ${b}`);let d=a.function?.parameters||a.parameters||a.input_schema||{};return{toolSpecification:{name:b,description:c,inputSchema:{json:0===Object.keys(d).length?{type:"object",properties:{},required:[]}:{...d,required:d.required??[]}}}}}),a.userInputMessage.userInputMessageContext.tools=o,n=!0),d.push(a),e=a,g=[],j=[],k=[]}else if("assistant"===l){let a=h.join("\n\n").trim()||"...";d.push({assistantResponseMessage:{content:a}}),h=[]}};for(let b=0;b<a.length;b++){let c=a[b],e=c.role,f=e===m.z7.SYSTEM;if((e===m.z7.SYSTEM||e===m.z7.TOOL)&&(e=m.z7.USER),e!==l&&null!==l&&p(),l=e,e===m.z7.USER){let a="";if("string"==typeof c.content)a=c.content;else if(Array.isArray(c.content)){let b=[];for(let a of c.content)if(a.type===m.x4.TEXT||a.text)b.push(a.text||"");else if(a.type===m.x4.IMAGE_URL){let c=a.image_url?.url||"",d=(0,i.W$)(c);if(d){let a=d.mimeType.split("/")[1]||d.mimeType;k.push({format:a,source:{bytes:d.base64}})}else(c.startsWith("http://")||c.startsWith("https://"))&&b.push(`[Image: ${c}]`)}else if(a.type===m.R4.IMAGE)if(a.source?.type==="base64"&&a.source?.data){let b=a.source.media_type||m.BY,c=b.split("/")[1]||b;k.push({format:c,source:{bytes:a.source.data}})}else a.source?.type==="url"&&a.source.url&&b.push(`[Image: ${a.source.url}]`);a=b.join("\n");let d=c.content.filter(a=>a.type===m.R4.TOOL_RESULT);d.length>0&&d.forEach(a=>{let b=Array.isArray(a.content)?a.content.map(a=>a.text||"").join("\n"):"string"==typeof a.content?a.content:"";j.push({toolUseId:a.tool_use_id,status:"success",content:[{text:b}]})})}if(c.role===m.z7.TOOL){let a="string"==typeof c.content?c.content:"";j.push({toolUseId:c.tool_call_id,status:"success",content:[{text:a||"[No response received]"}]})}else a&&g.push(f?`<instructions>
|
|
425
425
|
${a}
|
|
426
426
|
</instructions>`:a)}else if(e===m.z7.ASSISTANT){let a="",b=[];if(Array.isArray(c.content)?(a=c.content.filter(a=>a.type===m.x4.TEXT).map(a=>a.text).join("\n").trim(),b=c.content.filter(a=>a.type===m.R4.TOOL_USE)):"string"==typeof c.content&&(a=c.content.trim()),c.tool_calls&&c.tool_calls.length>0&&(b=c.tool_calls),a&&h.push(a),b.length>0){p();let a=d[d.length-1];a?.assistantResponseMessage&&(a.assistantResponseMessage.toolUses=b.map(a=>a.function?{toolUseId:a.id||(0,A.A)(),name:a.function.name,input:function(a,b){if("string"!=typeof a)return a??b;try{return JSON.parse(a)}catch{return b}}(a.function.arguments,{})}:{toolUseId:a.id||(0,A.A)(),name:a.name,input:a.input||{}})),l=null}}}null!==l&&p();for(let a=d.length-1;a>=0;a--)if(d[a].userInputMessage){e=d.splice(a,1)[0];break}let q=o??d.find(a=>a.userInputMessage?.userInputMessageContext?.tools)?.userInputMessage?.userInputMessageContext?.tools;d.forEach(a=>{a.userInputMessage?.userInputMessageContext?.tools&&delete a.userInputMessage.userInputMessageContext.tools,a.userInputMessage?.userInputMessageContext&&0===Object.keys(a.userInputMessage.userInputMessageContext).length&&delete a.userInputMessage.userInputMessageContext,a.userInputMessage&&!a.userInputMessage.modelId&&(a.userInputMessage.modelId=c)});let r=[];for(let a=0;a<d.length;a++){let b=d[a];if(b.userInputMessage&&r.length>0&&r[r.length-1].userInputMessage){let a=r[r.length-1];a.userInputMessage.content+="\n\n"+b.userInputMessage.content;let c=a.userInputMessage.userInputMessageContext,d=b.userInputMessage.userInputMessageContext;d&&(c?(d.toolResults?.length>0&&(c.toolResults=[...c.toolResults||[],...d.toolResults]),d.tools?.length>0&&(c.tools=[...c.tools||[],...d.tools])):a.userInputMessage.userInputMessageContext=d)}else r.push(b)}return e||(e={userInputMessage:{content:"",modelId:c}}),f&&function(a,b){let c=new Set;for(let b of a){let a=b.assistantResponseMessage;if(a)for(let b of a.toolUses||[])b.toolUseId&&c.add(b.toolUseId)}for(let d of b?[...a,b]:a){let a=d.userInputMessage,b=a?.userInputMessageContext;if(!b?.toolResults?.length)continue;let e=[],f=[];for(let a of b.toolResults)c.has(a.toolUseId)?e.push(a):f.push(D(a.content));if(0===f.length)continue;let g=f.join("\n");a.content=a.content?`${a.content}
|