@rabbi696/ezrouter 0.6.15 → 0.6.16
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/README.md +72 -1
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +27 -27
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +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/convoy/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.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/error-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +10 -6
- 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 +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +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 +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
- 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 +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +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 +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/routing-health/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +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/changelog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +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/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +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/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/export/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +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/combos/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/convoy/rules/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js +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 +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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -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/mcp-gateway/instances/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp-gateway/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +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 +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/enabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/enabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +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 +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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +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 +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-health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing-health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/token-saver/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tool-disclosure/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +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/error-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +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 +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 +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 +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/alpha/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +3 -3
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +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 +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 +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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.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 +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.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 +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +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 +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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.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 +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +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 +27 -27
- package/app/.next-cli-build/server/chunks/1253.js +1 -1
- package/app/.next-cli-build/server/chunks/1482.js +4 -2
- package/app/.next-cli-build/server/chunks/1531.js +1 -1
- package/app/.next-cli-build/server/chunks/1641.js +1 -0
- package/app/.next-cli-build/server/chunks/1733.js +1 -1
- package/app/.next-cli-build/server/chunks/1847.js +1 -1
- package/app/.next-cli-build/server/chunks/2269.js +1 -1
- package/app/.next-cli-build/server/chunks/2348.js +1 -1
- package/app/.next-cli-build/server/chunks/2898.js +1 -1
- package/app/.next-cli-build/server/chunks/3583.js +2 -2
- package/app/.next-cli-build/server/chunks/3593.js +2 -2
- package/app/.next-cli-build/server/chunks/369.js +22 -22
- package/app/.next-cli-build/server/chunks/3886.js +1 -1
- package/app/.next-cli-build/server/chunks/3912.js +1 -1
- package/app/.next-cli-build/server/chunks/3977.js +2 -2
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/4378.js +3 -3
- package/app/.next-cli-build/server/chunks/4485.js +1 -1
- package/app/.next-cli-build/server/chunks/4574.js +1 -1
- package/app/.next-cli-build/server/chunks/4646.js +1 -1
- package/app/.next-cli-build/server/chunks/4704.js +2 -2
- package/app/.next-cli-build/server/chunks/4739.js +2 -2
- package/app/.next-cli-build/server/chunks/4768.js +1 -1
- package/app/.next-cli-build/server/chunks/4780.js +2 -2
- package/app/.next-cli-build/server/chunks/4803.js +2 -2
- package/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/app/.next-cli-build/server/chunks/4878.js +1 -1
- package/app/.next-cli-build/server/chunks/5011.js +1 -1
- package/app/.next-cli-build/server/chunks/507.js +2 -2
- package/app/.next-cli-build/server/chunks/5130.js +1 -1
- package/app/.next-cli-build/server/chunks/{8421.js → 5251.js} +1 -1
- package/app/.next-cli-build/server/chunks/5258.js +2 -2
- package/app/.next-cli-build/server/chunks/5434.js +1 -1
- package/app/.next-cli-build/server/chunks/5460.js +40 -0
- package/app/.next-cli-build/server/chunks/5704.js +254 -0
- package/app/.next-cli-build/server/chunks/5872.js +1 -0
- package/app/.next-cli-build/server/chunks/5875.js +1 -1
- package/app/.next-cli-build/server/chunks/6252.js +2 -2
- package/app/.next-cli-build/server/chunks/6420.js +1 -1
- package/app/.next-cli-build/server/chunks/6670.js +2 -2
- package/app/.next-cli-build/server/chunks/6769.js +1 -0
- package/app/.next-cli-build/server/chunks/6799.js +2 -2
- package/app/.next-cli-build/server/chunks/698.js +2 -2
- package/app/.next-cli-build/server/chunks/7073.js +2 -2
- package/app/.next-cli-build/server/chunks/7218.js +1 -1
- package/app/.next-cli-build/server/chunks/7239.js +2 -2
- package/app/.next-cli-build/server/chunks/7362.js +1 -1
- package/app/.next-cli-build/server/chunks/7594.js +6 -6
- package/app/.next-cli-build/server/chunks/7663.js +1 -1
- package/app/.next-cli-build/server/chunks/7677.js +1 -1
- package/app/.next-cli-build/server/chunks/7775.js +1 -1
- package/app/.next-cli-build/server/chunks/7811.js +1 -0
- package/app/.next-cli-build/server/chunks/7965.js +2 -2
- package/app/.next-cli-build/server/chunks/8062.js +2 -2
- package/app/.next-cli-build/server/chunks/8129.js +1 -1
- package/app/.next-cli-build/server/chunks/8231.js +1 -1
- package/app/.next-cli-build/server/chunks/8243.js +5 -5
- package/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/app/.next-cli-build/server/chunks/8469.js +2 -2
- package/app/.next-cli-build/server/chunks/8520.js +2 -2
- package/app/.next-cli-build/server/chunks/8644.js +1 -1
- package/app/.next-cli-build/server/chunks/8772.js +1 -1
- package/app/.next-cli-build/server/chunks/8976.js +1 -1
- package/app/.next-cli-build/server/chunks/9026.js +24 -24
- package/app/.next-cli-build/server/chunks/9062.js +1 -1
- package/app/.next-cli-build/server/chunks/9303.js +1 -1
- package/app/.next-cli-build/server/chunks/9485.js +1 -1
- package/app/.next-cli-build/server/chunks/9718.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +3 -3
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/1321-73fdccd2b1bf151d.js +1 -0
- package/app/.next-cli-build/static/chunks/{5497-8766958582f95dc7.js → 5497-ff58e90f4053e184.js} +3 -3
- package/app/.next-cli-build/static/chunks/{6252-34f2d410651e1103.js → 6252-886aa8324e135e9c.js} +13 -13
- package/app/.next-cli-build/static/chunks/8105-9b41dc96e4b019cf.js +1 -0
- package/app/.next-cli-build/static/chunks/9227-4471c8f39a105c5f.js +5 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-89b4f70958736f2a.js → page-c35f746b4bd9fc90.js} +18 -14
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-fa195b4f7348e2d6.js → page-0868ecc0d2f1bd04.js} +2 -2
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-a31d9ca05cc3d528.js → page-6cb070834a750fdd.js} +1 -1
- package/app/CHANGELOG.md +54 -32
- package/app/package.json +1 -1
- package/app/public/CHANGELOG.md +54 -32
- package/app/src/mitm/server.js +24 -24
- package/cli.js +71 -69
- package/package.json +1 -1
- package/src/cli/commands/connect.js +157 -15
- package/src/cli/commands/connectTools.js +222 -4
- package/src/cli/commands/show.js +101 -0
- package/src/cli/menus/providers.js +8 -0
- package/app/.next-cli-build/server/chunks/3252.js +0 -1
- package/app/.next-cli-build/server/chunks/3267.js +0 -40
- package/app/.next-cli-build/server/chunks/6707.js +0 -1
- package/app/.next-cli-build/server/chunks/8450.js +0 -254
- package/app/.next-cli-build/server/chunks/9143.js +0 -1
- package/app/.next-cli-build/static/chunks/1321-043afc56cba448b8.js +0 -1
- package/app/.next-cli-build/static/chunks/8105-9dfc2c5ffef6e778.js +0 -1
- package/app/.next-cli-build/static/chunks/9227-af65f6ac1fca28c9.js +0 -3
- /package/app/.next-cli-build/static/{zQapcWqcr7oLVi5jh7t01 → Y5Sk8uSUyB0vJ-ZgW1X1U}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{zQapcWqcr7oLVi5jh7t01 → Y5Sk8uSUyB0vJ-ZgW1X1U}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=5872,exports.ids=[5872],exports.modules={2364:(a,b,c)=>{c.r(b),c.d(b,{GET:()=>W,OPTIONS:()=>V,buildModelsList:()=>S,fetchCompatibleModelIds:()=>M,getCachedModelsList:()=>U,getModelListPolicy:()=>Y});var d=c(81329),e=c(40615),f=c(89718),g=c(23433),h=c(99471);c(38775);var i=c(16655),j=c(74452),k=c(50287),l=c(72162),m=c(27811),n=c(58569),o=c(86925),p=c(9155),q=c(89843),r=c(28730),s=c(85640),t=c(11847);let u=new Map;async function v(a,b){let c=new AbortController,d=setTimeout(()=>c.abort(),1e4);try{let d=await (0,q.proxyAwareFetch)("https://api.githubcopilot.com/models",{method:"GET",headers:{Authorization:`Bearer ${a}`,"Content-Type":"application/json","Copilot-Integration-Id":"vscode-chat","editor-version":`vscode/${r.x0.VSCODE_VERSION}`,"editor-plugin-version":`copilot-chat/${r.x0.COPILOT_CHAT_VERSION}`,"user-agent":r.x0.USER_AGENT,"x-github-api-version":r.x0.API_VERSION},cache:"no-store",signal:b||c.signal});if(!d.ok){let a=Error(`Copilot /models returned ${d.status}`);throw a.status=d.status,a}let e=await d.json();return Array.isArray(e?.data)?e.data:[]}finally{clearTimeout(d)}}async function w(a,b={}){let c,d=a?.providerSpecificData?.copilotToken||a?.accessToken;if(!d)return b.log?.debug?.("COPILOT_MODELS","No copilotToken/accessToken; skipping live fetch"),null;let e=a?.providerSpecificData?.copilotToken||a?.accessToken||"copilot-anonymous",f=Date.now();if(!b.forceRefresh){let a=u.get(e);if(a&&a.expiresAt>f)return{models:a.models}}try{c=await v(d,b.signal)}catch(d){if(!d||401!==d.status&&403!==d.status||!a.accessToken)return b.log?.warn?.("COPILOT_MODELS",`Live model fetch failed: ${d?.message||d}`),null;{b.log?.info?.("COPILOT_MODELS",`Got ${d.status}; refreshing Copilot token`);let e=await (0,s.jR)(a.accessToken);if(!e?.token)return b.log?.warn?.("COPILOT_MODELS","Token refresh did not return a token"),null;if("function"==typeof b.onCredentialsRefreshed)try{await b.onCredentialsRefreshed({copilotToken:e.token,copilotTokenExpiresAt:e.expiresAt})}catch(a){b.log?.warn?.("COPILOT_MODELS",`onCredentialsRefreshed failed: ${a?.message||a}`)}try{c=await v(e.token,b.signal)}catch(a){return b.log?.warn?.("COPILOT_MODELS",`Retry after refresh failed: ${a?.message||a}`),null}}}let g=function(a){let b=new Set(["auto"]),c=[{id:"auto",name:"Auto"}];for(let d of a){if(!d||"object"!=typeof d||d.capabilities?.type!=="chat"||d.policy&&"enabled"!==d.policy.state)continue;let a=d.id;if(!a||b.has(a))continue;b.add(a);let e=d.capabilities||{},f=e.limits||{},g=e.supports||{},h={...(0,t.getCapabilitiesForModel)("github",a),...Number.isFinite(f.max_context_window_tokens)?{contextWindow:f.max_context_window_tokens}:{},...Number.isFinite(f.max_prompt_tokens)?{maxPrompt:f.max_prompt_tokens}:{},...Number.isFinite(f.max_output_tokens)?{maxOutput:f.max_output_tokens}:{},..."boolean"==typeof g.vision?{vision:g.vision}:{},..."boolean"==typeof g.tool_calls?{tools:g.tool_calls}:{},...!0===g.adaptive_thinking||Array.isArray(g.reasoning_effort)?{reasoning:!0}:{}};c.push({id:a,name:d.name||a,capabilities:h})}return c}(c);return g.length?(u.set(e,{expiresAt:f+3e5,models:g}),{models:g}):null}var x=c(40694),y=c(63123),z=c(26588);c(49934);var A=c(17218),B=c(67828),C=c(39326),D=c(68001);async function E(a,b){let c=await (0,p.EV)({provider:b,accessToken:a.accessToken,apiKey:a.apiKey,refreshToken:a.refreshToken,email:a.email,displayName:a.displayName,providerSpecificData:a.providerSpecificData||{}}),d=(0,p.So)(c);return d.length?{models:d.map(a=>({id:a.id,name:a.name}))}:null}let F={...Object.fromEntries(Object.entries(d.Xg).map(([a,b])=>[b,a])),...e.js};function G(a){let b=a.indexOf("/");if(b<=0)return null;let c=a.slice(0,b);return(0,t.getCapabilitiesForModel)(F[c]||c,a.slice(b+1))}let H={kiro:async a=>{let b=await (0,n.cW)({accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}},{log:console});return b?.models?.length?{models:b.models}:null},qoder:async a=>E(a,"qoder"),"qoder-cn":async a=>E(a,"qoder-cn"),kimchi:async a=>{let b=await (0,o.av)({accessToken:a.accessToken,apiKey:a.apiKey,providerSpecificData:a.providerSpecificData||{}},{log:console});return b?.models?.length?{models:b.models}:null},github:async a=>{let b=await w({accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData||{}},{log:console,onCredentialsRefreshed:async b=>{await (0,B.vN)(a.id,{copilotToken:b.copilotToken,copilotTokenExpiresAt:b.copilotTokenExpiresAt,existingProviderSpecificData:a.providerSpecificData||{}})}});return b?.models?.length?{models:b.models}:null},clinepass:async a=>{let b=await (0,x.P)({accessToken:a.accessToken,apiKey:a.apiKey});return b?.models?.length?{models:b.models}:null},cline:async a=>{let b=await (0,x.M)({accessToken:a.accessToken,apiKey:a.apiKey});return b?.models?.length?{models:b.models}:null},"grok-cli":async a=>{let b=await (0,C.B)(a.providerSpecificData||{}),c=await (0,y.M)({...a,connectionId:a.id},{log:console,proxyOptions:{connectionProxyEnabled:!0===b.connectionProxyEnabled,connectionProxyUrl:b.connectionProxyUrl||"",connectionNoProxy:b.connectionNoProxy||"",vercelRelayUrl:b.vercelRelayUrl||"",strictProxy:!0===b.strictProxy},onCredentialsRefreshed:async b=>{await (0,B.vN)(a.id,{...b,existingProviderSpecificData:a.providerSpecificData||{}})}});return c?.models?.length?{models:c.models}:null},cursor:async a=>{let b=await (0,z.FD)({accessToken:a.accessToken,providerSpecificData:a.providerSpecificData||{}},{log:console});return b?.models?.length?{models:b.models}:null}},I="x-9r-internal-models-fetch",J={image:"image",tts:"tts",embedding:"embedding",stt:"stt",imageToText:"imageToText",video:"video"};function K(a){let b=a?.kind||a?.type;return b&&J[b]||"llm"}function L(a){let b=String(a).toLowerCase();return/embed/.test(b)?"embedding":/tts|speech|audio|voice/.test(b)?"tts":/image|imagen|dall-?e|flux|sdxl|sd-|stable-diffusion/.test(b)?"image":"llm"}async function M(a){if(!a?.apiKey)return[];let b="string"==typeof a?.providerSpecificData?.baseUrl?a.providerSpecificData.baseUrl.trim().replace(/\/$/,""):"";if(!b)return[];let c=`${b}/models`,d={"Content-Type":"application/json"};if((0,e.mq)(a.provider))d.Authorization=`Bearer ${a.apiKey}`;else{if(!(0,e.gb)(a.provider))return[];c.endsWith("/messages/models")?c=c.slice(0,-9):c.endsWith("/messages")&&(c=`${c.slice(0,-9)}/models`),d["x-api-key"]=a.apiKey,d["anthropic-version"]="2023-06-01",d.Authorization=`Bearer ${a.apiKey}`}try{var f;let a=new AbortController,b=setTimeout(()=>a.abort(),5e3),e=await fetch(c,{method:"GET",headers:{...d,[I]:"1"},cache:"no-store",signal:a.signal});if(clearTimeout(b),!e.ok)return[];let g=(f=await e.json(),Array.isArray(f)?f:f?.data||f?.models||f?.results||[]);return Array.from(new Set(g.map(a=>a?.id||a?.name||a?.model).filter(a=>"string"==typeof a&&""!==a.trim())))}catch{return[]}}function N(a,b){let c=e.AI_PROVIDERS[a],d=Array.isArray(c?.serviceKinds)&&c.serviceKinds.length>0?c.serviceKinds:["llm"];return b.some(a=>d.includes(a))}function O(a,b){let c=a?.kind||"llm";return b.includes(c)}function P(a,b,c){let d={id:a.name,object:"model",owned_by:"combo"};if("webSearch"===a.kind||"webFetch"===a.kind)d.kind=a.kind;else{let e=(0,t.aggregateComboCapabilities)(a.models,b,G);e&&(d.capabilities=e);let{contextWindow:f,maxOutput:g}=function a(b,c,d=new Set){let e="string"==typeof b?.name?b.name:null;if(e){if(d.has(e))return{contextWindow:void 0,maxOutput:void 0};d.add(e)}let f=1/0,g=1/0;try{for(let e of Array.isArray(b?.models)?b.models:[]){if("string"!=typeof e)continue;if(0>=e.indexOf("/")){let b=c.get(e);if(b){let e=a(b,c,d);Number.isFinite(e.contextWindow)&&(f=Math.min(f,e.contextWindow)),Number.isFinite(e.maxOutput)&&(g=Math.min(g,e.maxOutput));continue}}let b=G(e)||(0,t.getCapabilitiesForModel)(null,e);Number.isFinite(b?.contextWindow)&&(f=Math.min(f,b.contextWindow)),Number.isFinite(b?.maxOutput)&&(g=Math.min(g,b.maxOutput))}}finally{e&&d.delete(e)}return{contextWindow:Number.isFinite(f)?f:void 0,maxOutput:Number.isFinite(g)?g:void 0}}(a,c);Number.isFinite(f)&&(d.context_length=f),Number.isFinite(g)&&(d.max_completion_tokens=g)}return d}let Q=new Map;async function R(a){if(!a?.url||!a?.type)return[];let b=Q.get(a.url);if(b&&Date.now()<b.expiresAt)return b.ids;try{let b=new AbortController,c=setTimeout(()=>b.abort(),5e3),d=await fetch(a.url,{cache:"no-store",signal:b.signal});if(clearTimeout(c),!d.ok)return[];let e=await d.json(),f=e.data??e.models??e,g=D.S[a.type];if(!g)return[];let h=(g(Array.isArray(f)?f:[])||[]).map(a=>a?.id).filter(a=>"string"==typeof a&&""!==a.trim());return Q.set(a.url,{ids:h,expiresAt:Date.now()+6e5}),h}catch{return[]}}async function S(a,b={}){let c=!0===b.skipDynamicFetch,g=[],j=!1;try{g=(g=await (0,f.getProviderConnections)()).filter(a=>!1!==a.isActive)}catch(a){j=!0,console.log("Could not fetch providers, returning all models")}let k=[];try{k=await (0,f.Uv)()}catch(a){console.log("Could not fetch combos")}let m=Object.fromEntries(k.map(a=>[a.name,a.models])),n={};try{n=await (0,f.mt)()}catch(a){console.log("Could not fetch settings, using defaults")}if(n.exposeComboOnly){let b=new Set,c=[];for(let d of k){if(!O(d,a))continue;let e=P(d,m);b.has(e.id)||(b.add(e.id),c.push(e))}return c}let o=[];try{o=await (0,f.uv)()}catch(a){console.log("Could not fetch custom models")}let p={};try{p=await (0,f.OM)()}catch(a){console.log("Could not fetch model aliases")}let q={};try{q=await (0,i.vF)()}catch(a){console.log("Could not fetch disabled models")}let r=(a,b)=>Array.isArray(q[a])&&q[a].includes(b),s={};try{s=await (0,l.Kz)()}catch(a){console.log("Could not fetch enabled models")}let u=(a,b)=>{let c=d.Xg[a]||a;for(let d of[s[(b?.providerSpecificData?.prefix||(0,e.wG)(a)||c).trim()],s[c],s[a],b?.providerSpecificData?.enabledModels]){if(!Array.isArray(d))continue;let a=Array.from(new Set(d.filter(a=>"string"==typeof a&&""!==a.trim())));if(a.length>0)return a}return[]},v=new Map;for(let a of g)v.has(a.provider)||v.set(a.provider,a);let w=[],x=new Map(k.filter(a=>"string"==typeof a?.name).map(a=>[a.name,a]));for(let b of k){if(!O(b,a))continue;let c=P(b,m,x);w.push(c)}if(0===g.length){let b=new Set;if(!j)for(let a of A.default)(!0===a.noAuth||a.transport?.noAuth===!0)&&b.add(a.id);for(let[c,e]of Object.entries(d.vq)){let d=F[c]||c;if(!N(d,a)||!j&&!b.has(d))continue;let f=u(d,null);for(let b of e)a.includes(K(b))&&(!(f.length>0)||f.includes(b.id))&&(r(c,b.id)||w.push({id:`${c}/${b.id}`,object:"model",owned_by:c,capabilities:(0,t.getCapabilitiesForModel)(c,b.id)}))}for(let b of o){if(!b?.id||b.type&&"llm"!==b.type||!a.includes("llm"))continue;let c=b.providerAlias;if(!c)continue;let d=String(b.id).trim();d&&w.push({id:`${c}/${d}`,object:"model",owned_by:c})}}else for(let[b,f]of v.entries()){if(!N(b,a))continue;let g=d.Xg[b]||b,h=(f?.providerSpecificData?.prefix||(0,e.wG)(b)||g).trim(),i=d.vq[g]||[],j=u(b,f),k=j.length>0,l=(0,e.mq)(b)||(0,e.gb)(b),m=new Map(i.map(a=>[a.id,K(a)])),n=new Map,q=new Map,s=k?j:i.map(a=>a.id),v=l&&o.some(a=>{if(!a?.id)return!1;let c=a.providerAlias;return c===g||c===h||c===b});!l||0!==s.length||v||c||(s=await M(f));let x=H[b];if(x&&!k)try{let a=await x(f);a?.models?.length&&(s=a.models.map(a=>a.id),n=new Map(a.models.filter(a=>a?.id).map(a=>[a.id,K(a)])),q=new Map(a.models.filter(a=>a?.id&&a.capabilities).map(a=>[a.id,a.capabilities])))}catch(a){console.log(`Live model fetch failed for ${b}: ${a?.message||a}`)}let y=s.map(a=>a.startsWith(`${h}/`)?a.slice(h.length+1):a.startsWith(`${g}/`)?a.slice(g.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim()),z=new Map,A=new Map;for(let c of Array.from(new Set([...y,...o.filter(c=>{if(!c?.id)return!1;let e=(0,d.CP)(c)||"llm";if(!a.includes(e)&&!("imageToText"===e&&a.includes("llm")))return!1;let f=c.providerAlias;return f===g||f===h||f===b}).map(a=>{let b=String(a.id).trim();return b&&(z.set(b,(0,d.CP)(a)||"llm"),a.caps&&"object"==typeof a.caps&&A.set(b,a.caps)),b}).filter(a=>""!==a),...Object.values(p||{}).filter(a=>"string"==typeof a&&!!a.includes("/")&&(a.startsWith(`${h}/`)||a.startsWith(`${g}/`)||a.startsWith(`${b}/`))).map(a=>a.startsWith(`${h}/`)?a.slice(h.length+1):a.startsWith(`${g}/`)?a.slice(g.length+1):a.startsWith(`${b}/`)?a.slice(b.length+1):a).filter(a=>"string"==typeof a&&""!==a.trim())]))){let d=z.get(c),e=n.get(c),f=d||e||m.get(c)||L(c),i="imageToText"===f&&a.includes("llm");if(!a.includes(f)&&!i||r(h,c)||r(g,c))continue;let j={id:`${h}/${c}`,object:"model",owned_by:h},k=q.get(c)||(0,t.capabilitiesFromServiceKind)(d||e)||("llm"===f?(0,t.getCapabilitiesForModel)(b,c):null),l=(0,t.withDeclaredCapabilities)(k,A.get(c));if(l&&(j.capabilities=l),"llm"===f||i){let a=l?.contextWindow,d=l?.maxOutput;if(!Number.isFinite(a)||!Number.isFinite(d)){let e=(0,t.getCapabilitiesForModel)(b,c);Number.isFinite(a)||(a=e.contextWindow),Number.isFinite(d)||(d=e.maxOutput)}Number.isFinite(a)&&(j.context_length=a),Number.isFinite(d)&&(j.max_completion_tokens=d)}w.push(j)}let B=e.AI_PROVIDERS[b];a.includes("webSearch")&&B?.searchConfig&&w.push({id:`${h}/search`,object:"model",kind:"webSearch",owned_by:h}),a.includes("webFetch")&&B?.fetchConfig&&w.push({id:`${h}/fetch`,object:"model",kind:"webFetch",owned_by:h})}for(let[b,f]of Object.entries(e.AI_PROVIDERS)){if(f?.noAuth!==!0||f?.hidden===!0||v.has(b)||!N(b,a))continue;let g=d.Xg[b]||b,h=((0,e.wG)(b)||g).trim(),i=d.vq[g]||[],j=i.map(a=>a.id);f.modelsFetcher&&(!0===f.passthroughModels||0===j.length)&&!c&&(j=Array.from(new Set([...j,...await R(f.modelsFetcher)])));let k=new Map(i.map(a=>[a.id,K(a)]));for(let b of j){let c=k.get(b)||L(b);if(!a.includes(c)||r(h,b)||r(g,b))continue;let d={id:`${h}/${b}`,object:"model",owned_by:h};if("llm"===c){let a=(0,t.getCapabilitiesForModel)(g,b);a&&(d.capabilities=a),Number.isFinite(a?.contextWindow)&&(d.context_length=a.contextWindow),Number.isFinite(a?.maxOutput)&&(d.max_completion_tokens=a.maxOutput)}w.push(d)}}let y=[],z=new Set;for(let a of w)!a?.id||z.has(a.id)||(z.add(a.id),y.push(a));if(a.includes("llm")){let b=new Set;for(let a of g){let c=a.provider,f=d.Xg[c]||c,g=(a?.providerSpecificData?.prefix||(0,e.wG)(c)||f).trim();b.add(g),b.add(f),b.add(c)}for(let c of o){if(!c?.id)continue;let e=(0,d.CP)(c)||"llm",f="imageToText"===e;if(!a.includes(e)&&!f)continue;let g=c.providerAlias;if(!g||b.has(g))continue;let h=String(c.id).trim();if(!h||r(g,h))continue;let i=`${g}/${h}`;if(z.has(i))continue;z.add(i);let j={id:i,object:"model",owned_by:g},k=(0,t.getCapabilitiesForModel)(g,h);k&&(j.capabilities=k),Number.isFinite(k?.contextWindow)&&(j.context_length=k.contextWindow),Number.isFinite(k?.maxOutput)&&(j.max_completion_tokens=k.maxOutput),y.push(j)}for(let a of(await (0,h.Y)())){if(!a?.id)continue;let b=String(a.id).trim();if(!b||r("oc",b))continue;let c=`oc/${b}`;if(z.has(c))continue;z.add(c);let d={id:c,object:"model",owned_by:"oc"},e=(0,t.getCapabilitiesForModel)("oc",b);e&&(d.capabilities=e),Number.isFinite(e?.contextWindow)&&(d.context_length=e.contextWindow),Number.isFinite(e?.maxOutput)&&(d.max_completion_tokens=e.maxOutput),y.push(d)}}let B=b.apiKey,C=B?.allowedModels;return Array.isArray(C)&&0!==C.length?y.filter(a=>C.includes(a.id)):y}let T=new Map;async function U(a,b={}){var c,d;let e=(c=!0===b.skipDynamicFetch,d=b.apiKey?.id,`${c?"internal":"full"}::${d||"public"}::${a.join("|")}`),f=T.get(e);if(!0===b.forceFresh){let c=await S(a,b);return T.set(e,{data:c,builtAt:Date.now()}),c}if(f?.building)return f.data??f.building;if(f&&Date.now()-f.builtAt<3e4)return f.data;let g=S(a,b).then(a=>{let b=T.get(e),c=Array.isArray(b?.data)&&b.data.length>0;return 0===a.length&&c?b.data:(T.set(e,{data:a,builtAt:Date.now()}),a)}).catch(a=>{let b=T.get(e);throw b?.data?T.set(e,{data:b.data,builtAt:b.builtAt}):T.delete(e),a});return(T.set(e,f?{...f,building:g}:{data:null,builtAt:0,building:g}),f)?(g.catch(()=>{}),f.data):g}async function V(){return new Response(null,{headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, OPTIONS","Access-Control-Allow-Headers":"*"}})}async function W(a){try{let b=a?.headers?.get(I)==="1",c=await Y(a);if(c.error)return Response.json({error:{message:"Invalid API key",type:"authentication_error"}},{status:401,headers:{"Access-Control-Allow-Origin":"*"}});let d=await U(["llm"],{skipDynamicFetch:b,apiKey:c.key}),e=(0,g.Tr)(a),f=e?await (0,j.getApiKeyScopeByKey)(e):null,h=(0,k.C)(d,f),i=await (0,m.j)(await (0,m.TM)(a),h);return Response.json({object:"list",data:i},{headers:{"Access-Control-Allow-Origin":"*"}})}catch(a){return console.log("Error fetching models:",a),Response.json({error:{message:a.message,type:"server_error"}},{status:500})}}async function X(a){let b=(0,g.Tr)(a);if(!b)return{present:!1,key:null};let c=await (0,f.y7)(b),d=c?.expiresAt&&new Date(c.expiresAt).getTime()<=Date.now();return{present:!0,key:c?.isActive&&!d?c:null}}async function Y(a){let b=await (0,f.mt)(),c=await X(a);return b.requireApiKey&&!c.key||c.present&&!c.key?{error:!0}:{key:c.key}}},16655:(a,b,c)=>{c.d(b,{oF:()=>d.oF,tm:()=>d.tm,vF:()=>d.vF});var d=c(33079)},50287:(a,b,c)=>{c.d(b,{C:()=>e});var d=c(29686);function e(a,b){return b&&Array.isArray(a)?a.filter(a=>(0,d.MH)(b,a?.id)):a}},66451:(a,b,c)=>{c.d(b,{PN:()=>j,Xh:()=>k,g2:()=>i,js:()=>m,sc:()=>l});var d=c(17218),e=c(29485);let f={el:"elevenlabs",jina:"jina-ai","jina-ai":"jina-ai",polly:"aws-polly","aws-polly":"aws-polly"};for(let a of d.default)for(let b of(f[a.id]=a.id,a.alias&&(f[a.alias]=a.id),a.aliases||[]))f[b]=a.id;let g={"grok-build":"gcli/grok-build"},h=new Map;for(let a of d.default)a.noAuth&&a.modelsFetcher&&a.alias&&h.set(a.id,a.alias);function i(a){return f[a]||a}function j(a){if(!a)return null;let b=[];for(let[c,d]of Object.entries(e.PROVIDER_MODELS))Array.isArray(d)&&d.some(b=>b&&b.id===a)&&b.push(c);if(0===b.length)return null;if(1===b.length)return i(b[0]);let c=b.find(b=>a.startsWith(b));return c?i(c):null}function k(a){if(!a)return{provider:null,model:null,isAlias:!1,providerAlias:null};if(a.includes("/")){let b=a.indexOf("/"),c=a.slice(0,b),d=a.slice(b+1);return{provider:i(c),model:d,isAlias:!1,providerAlias:c}}return{provider:null,model:a,isAlias:!0,providerAlias:null}}function l(a,b){if(!b)return null;let c=b[a];if(!c)return null;if("string"==typeof c&&c.includes("/")){let a=c.indexOf("/");return{provider:i(c.slice(0,a)),model:c.slice(a+1)}}return"object"==typeof c&&c.provider&&c.model?{provider:i(c.provider),model:c.model}:null}async function m(a,b){let c=k(a);if(!c.isAlias)return{provider:c.provider,model:c.model};let d="function"==typeof b?await b():b,e=l(c.model,d)||l(c.model,g);return e||{provider:function(a){if(!a)return"openai";let b=a.toLowerCase();return"default"===b||"auto"===b?"cursor":n.find(([a])=>a.test(b))?.[1]||"openai"}(c.model),model:c.model}}let n=[[/^codex-auto-review$/,"codex"],[/^gpt-[56]\./,"codex"],[/^gpt-6-/,"codex"],[/^gpt-daybreak-/,"codex"],[/^gpt-reserve/,"codex"],[/^claude-/,"anthropic"],[/^gemini-/,"gemini"],[/^grok-/,"xai"],[/^gpt-/,"openai"],[/^o[134]/,"openai"],[/^deepseek-/,"openrouter"]]},72162:(a,b,c)=>{c.d(b,{Kz:()=>d.Kz,gy:()=>d.gy});var d=c(33079)},81329:(a,b,c)=>{c.d(b,{CP:()=>f,Xg:()=>d.Xg,bs:()=>g,eh:()=>e,vq:()=>d.PROVIDER_MODELS,zc:()=>i});var d=c(29485);Object.entries(c(40615).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.PROVIDER_MODELS).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name}))),f=(a,b=null)=>a?.kind||a?.type||b,g={vision:{icon:"visibility",label:"Vision",desc:"Supports image input",color:"text-blue-500"},reasoning:{icon:"neurology",label:"Reasoning",desc:"Supports reasoning / thinking",color:"text-amber-500"}},h={"gemini-live":{label:"Gemini Live (realtime WebSocket)",desc:"Streams audio over bidiGenerateContent and returns incremental transcription segments"}};function i(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(h,a.trim())}Object.freeze(Object.keys(h))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=5875,exports.ids=[5875,9718],exports.modules={3894:(a,b,c)=>{"use strict";c.d(b,{F_:()=>g,Nc:()=>h,Qh:()=>t,Su:()=>q,ag:()=>o,kI:()=>p,rl:()=>u,sy:()=>s});var d=c(79646),e=c(33873),f=c.n(e);let g=["code","ml"],h={code:["tree-sitter","tree-sitter-language-pack"],ml:["torch","huggingface-hub"]},i="win32"===process.platform,j=i?"where":"which",k=i?[`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python314\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python313\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python312\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python311\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python310\\Scripts`,`${process.env.APPDATA||""}\\Python\\Python314\\Scripts`,`${process.env.APPDATA||""}\\Python\\Python313\\Scripts`,"C:\\Python314","C:\\Python313","C:\\Python312","C:\\Python311","C:\\Python310"]:["/usr/local/bin","/opt/homebrew/bin","/Library/Frameworks/Python.framework/Versions/3.13/bin","/Library/Frameworks/Python.framework/Versions/3.12/bin","/Library/Frameworks/Python.framework/Versions/3.11/bin","/Library/Frameworks/Python.framework/Versions/3.10/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],l=[...k,process.env.PATH||""].filter(Boolean).join(f().delimiter),m=["python3.13","python3.12","python3.11","python3.10","python3","python"],n=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]),o=process.env.HEADROOM_URL||"http://localhost:8787";function p(){try{let a=(0,d.execSync)(`${j} headroom`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l},timeout:3e3}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function q(){let a=null;for(let b of function(){let a=[],b=p();if(b){let c=f().dirname(b);for(let b of i?["python.exe","python3.exe"]:["python3","python3.13","python"])a.push(f().join(c,b))}for(let b of k)if(b)for(let c of m)a.push(f().join(b,i?`${c}.exe`:c));return a.push(...m),a}())try{let c=(0,d.execFileSync)(b,["--version"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l},timeout:8e3}).toString().trim().match(/(\d+)\.(\d+)/);if(!c)continue;let[e,f]=[parseInt(c[1],10),parseInt(c[2],10)];if(!(e>3||3===e&&f>=10))continue;a||(a=b);try{return(0,d.execFileSync)(b,["-m","pip","show","headroom-ai"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}),b}catch{}}catch{}return a}async function r(a){if(!a)return!1;let b=String(a).replace(/\/$/,"");try{return(await fetch(`${b}/health`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function s(a){try{let b=new URL(a);return n.has(b.hostname)}catch{return!1}}async function t(a){let b=p(),c=q(),d=!!b,e=await r(a),f=s(a),g=d?u(c):{installed:!1,version:null,extras:{code:!1,ml:!1}};return{installed:d,path:b,running:e,python:c,localUrl:f,canStart:d&&f,version:g.version,extras:g.extras}}function u(a){let b=a||q();if(!b)return{installed:!1,version:null,extras:{code:!1,ml:!1}};try{let a=(0,d.execFileSync)(b,["-m","pip","list","--format=json","--disable-pip-version-check"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}).toString(),c=JSON.parse(a),e=new Set(c.map(a=>String(a.name||"").toLowerCase()));if(!e.has("headroom-ai"))return{installed:!1,version:null,extras:{code:!1,ml:!1}};let f=c.find(a=>a.name?.toLowerCase()==="headroom-ai")?.version||null,i={};for(let a of g)i[a]=h[a].some(a=>e.has(a));return{installed:!0,version:f,extras:i}}catch{return{installed:!1,version:null,extras:{code:!1,ml:!1}}}}},33016:(a,b,c)=>{"use strict";c.d(b,{BS:()=>r,HI:()=>w,Ic:()=>v,ZT:()=>u,cx:()=>t,ow:()=>s,sW:()=>x});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(79646),i=c(49120),j=c(3894);let k=g().join(i.n,"headroom"),l=g().join(k,"proxy.pid"),m=g().join(k,"proxy.log"),n=g().join(k,"install.log");function o(){e().existsSync(k)||e().mkdirSync(k,{recursive:!0})}function p(){try{e().existsSync(l)&&e().unlinkSync(l)}catch{}}function q(a){if(!a||"number"!=typeof a)return!1;try{return process.kill(a,0),!0}catch{return!1}}function r(){let a=function(){try{if(e().existsSync(l))return parseInt(e().readFileSync(l,"utf8"),10)}catch{}return null}();return a&&q(a)?a:null}async function s({port:a=8787,codeAware:b=!1,kompress:c=!1,lossless:d=!1}={}){var f;let g=Number(a)>0&&65536>Number(a)?Number(a):8787,i=(0,j.kI)();if(!i){let a=Error("Headroom CLI not installed");throw a.code="NOT_INSTALLED",a}let k=r();if(k)return{pid:k,alreadyRunning:!0};o();let n=e().openSync(m,"a"),t=["proxy","--port",String(g),...function({codeAware:a,kompress:b,lossless:c}={}){let d=[];return a&&d.push("--code-aware"),!1===b&&d.push("--disable-kompress"),c&&d.push("--lossless"),d}({codeAware:b,kompress:c,lossless:d})],u=(0,h.spawn)(i,t,{stdio:["ignore",n,n],detached:!0,windowsHide:!0,env:{...process.env}});if(!u.pid){e().closeSync(n);let a=Error("Failed to spawn headroom proxy");throw a.code="SPAWN_FAILED",a}u.unref(),f=u.pid,o(),e().writeFileSync(l,String(f)),await new Promise((a,b)=>{let c=setTimeout(()=>{q(u.pid)?a():b(Error("headroom proxy exited during startup — see proxy.log"))},8e3);u.once("exit",a=>{clearTimeout(c),p(),e().closeSync(n);let d=Error(`headroom proxy exited early (code=${a}) — see proxy.log`);d.code="EARLY_EXIT",b(d)})}),e().closeSync(n);let v=`http://localhost:${g}`;for(let a=0;a<5;a++)try{if((await fetch(`${v}/health`,{signal:AbortSignal.timeout(1e3)})).ok)return{pid:u.pid,alreadyRunning:!1}}catch{await new Promise(a=>setTimeout(a,500))}try{process.kill(u.pid)}catch{}throw p(),Error("headroom proxy started but not serving HTTP requests — see proxy.log")}function t(){let a=r();if(!a)return{stopped:!1,reason:"not_running"};try{return process.kill(a,"SIGTERM"),setTimeout(()=>{if(q(a))try{process.kill(a,"SIGKILL")}catch{}},2e3),p(),{stopped:!0,pid:a}}catch(b){p();let a=Error(`Failed to stop headroom proxy: ${b.message}`);throw a.code="STOP_FAILED",a}}async function u(a={}){let b=r();if(b){try{process.kill(b,"SIGTERM")}catch{}for(let a=0;a<30&&q(b);a++)await new Promise(a=>setTimeout(a,100));if(q(b)){try{process.kill(b,"SIGKILL")}catch{}await new Promise(a=>setTimeout(a,300))}p()}return s(a)}async function v(a=[]){let b=Array.isArray(a)?a.filter(a=>j.F_.includes(a)):[],c=(0,j.Su)();if(!c){let a=Error("Python >= 3.10 not found");throw a.code="NO_PYTHON",a}if(!(0,j.kI)()){let a=Error("headroom-ai not installed (run `pip install headroom-ai[proxy]` first)");throw a.code="NOT_INSTALLED",a}let d=["proxy",...b].join(","),f=`headroom-ai[${d}]`;o();let g=e().openSync(n,"w"),i=(0,h.spawn)(c,["-m","pip","install","--upgrade",f],{stdio:["ignore",g,g],windowsHide:!0,env:{...process.env}});return new Promise((a,d)=>{i.once("error",a=>{e().closeSync(g),d(a)}),i.once("exit",h=>{if(e().closeSync(g),0===h)a({success:!0,code:h,spec:f,extras:b,...(0,j.rl)(c)});else{let a=Error(`pip install exited with code=${h} — see headroom/install.log`);a.code="INSTALL_FAILED",d(a)}})})}async function w(a=[]){let b=Array.isArray(a)?a.filter(a=>j.F_.includes(a)):[],c=(0,j.Su)();if(!c){let a=Error("Python >= 3.10 not found");throw a.code="NO_PYTHON",a}let d=[...new Set(b.flatMap(a=>j.Nc[a]||[]))];if(0===d.length){let a=Error("No valid extras to remove");throw a.code="INVALID_EXTRAS",a}let f=["-m","pip","uninstall","-y",...d];o();let g=e().openSync(n,"w"),i=(0,h.spawn)(c,f,{stdio:["ignore",g,g],windowsHide:!0,env:{...process.env}});return new Promise((a,f)=>{i.once("error",a=>{e().closeSync(g),f(a)}),i.once("exit",h=>{if(e().closeSync(g),0===h)a({success:!0,code:h,removed:d,extras:b,...(0,j.rl)(c)});else{let a=Error(`pip uninstall exited with code=${h} — see headroom/install.log`);a.code="UNINSTALL_FAILED",f(a)}})})}function x(a=15){try{if(!e().existsSync(n))return"";return e().readFileSync(n,"utf8").split(/\r?\n/).filter(Boolean).slice(-a).join("\n")}catch{return""}}},78335:()=>{},89718:(a,b,c)=>{"use strict";c.d(b,{$e:()=>d.$e,CF:()=>d.CF,CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,Ko:()=>d.Ko,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q6:()=>d.Q6,Q_:()=>d.Q_,Qu:()=>d.Qu,RT:()=>d.RT,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,__:()=>d.__,aQ:()=>d.aQ,bI:()=>d.bI,c:()=>d.c,dA:()=>d.dA,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,lk:()=>d.lk,mV:()=>d.mV,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,pO:()=>d.pO,qr:()=>d.qr,r4:()=>d.r4,sZ:()=>d.sZ,t$:()=>d.t$,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,xN:()=>d.xN,y7:()=>d.y7,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(
|
|
1
|
+
exports.id=5875,exports.ids=[5875,9718],exports.modules={3894:(a,b,c)=>{"use strict";c.d(b,{F_:()=>g,Nc:()=>h,Qh:()=>t,Su:()=>q,ag:()=>o,kI:()=>p,rl:()=>u,sy:()=>s});var d=c(79646),e=c(33873),f=c.n(e);let g=["code","ml"],h={code:["tree-sitter","tree-sitter-language-pack"],ml:["torch","huggingface-hub"]},i="win32"===process.platform,j=i?"where":"which",k=i?[`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python314\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python313\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python312\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python311\\Scripts`,`${process.env.LOCALAPPDATA||""}\\Programs\\Python\\Python310\\Scripts`,`${process.env.APPDATA||""}\\Python\\Python314\\Scripts`,`${process.env.APPDATA||""}\\Python\\Python313\\Scripts`,"C:\\Python314","C:\\Python313","C:\\Python312","C:\\Python311","C:\\Python310"]:["/usr/local/bin","/opt/homebrew/bin","/Library/Frameworks/Python.framework/Versions/3.13/bin","/Library/Frameworks/Python.framework/Versions/3.12/bin","/Library/Frameworks/Python.framework/Versions/3.11/bin","/Library/Frameworks/Python.framework/Versions/3.10/bin",`${process.env.HOME||""}/.local/bin`,"/usr/bin","/bin"],l=[...k,process.env.PATH||""].filter(Boolean).join(f().delimiter),m=["python3.13","python3.12","python3.11","python3.10","python3","python"],n=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]),o=process.env.HEADROOM_URL||"http://localhost:8787";function p(){try{let a=(0,d.execSync)(`${j} headroom`,{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l},timeout:3e3}).toString().trim();return a?a.split(/\r?\n/)[0].trim():null}catch{return null}}function q(){let a=null;for(let b of function(){let a=[],b=p();if(b){let c=f().dirname(b);for(let b of i?["python.exe","python3.exe"]:["python3","python3.13","python"])a.push(f().join(c,b))}for(let b of k)if(b)for(let c of m)a.push(f().join(b,i?`${c}.exe`:c));return a.push(...m),a}())try{let c=(0,d.execFileSync)(b,["--version"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,env:{...process.env,PATH:l},timeout:8e3}).toString().trim().match(/(\d+)\.(\d+)/);if(!c)continue;let[e,f]=[parseInt(c[1],10),parseInt(c[2],10)];if(!(e>3||3===e&&f>=10))continue;a||(a=b);try{return(0,d.execFileSync)(b,["-m","pip","show","headroom-ai"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}),b}catch{}}catch{}return a}async function r(a){if(!a)return!1;let b=String(a).replace(/\/$/,"");try{return(await fetch(`${b}/health`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}function s(a){try{let b=new URL(a);return n.has(b.hostname)}catch{return!1}}async function t(a){let b=p(),c=q(),d=!!b,e=await r(a),f=s(a),g=d?u(c):{installed:!1,version:null,extras:{code:!1,ml:!1}};return{installed:d,path:b,running:e,python:c,localUrl:f,canStart:d&&f,version:g.version,extras:g.extras}}function u(a){let b=a||q();if(!b)return{installed:!1,version:null,extras:{code:!1,ml:!1}};try{let a=(0,d.execFileSync)(b,["-m","pip","list","--format=json","--disable-pip-version-check"],{stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:8e3,env:{...process.env,PATH:l}}).toString(),c=JSON.parse(a),e=new Set(c.map(a=>String(a.name||"").toLowerCase()));if(!e.has("headroom-ai"))return{installed:!1,version:null,extras:{code:!1,ml:!1}};let f=c.find(a=>a.name?.toLowerCase()==="headroom-ai")?.version||null,i={};for(let a of g)i[a]=h[a].some(a=>e.has(a));return{installed:!0,version:f,extras:i}}catch{return{installed:!1,version:null,extras:{code:!1,ml:!1}}}}},33016:(a,b,c)=>{"use strict";c.d(b,{BS:()=>r,HI:()=>w,Ic:()=>v,ZT:()=>u,cx:()=>t,ow:()=>s,sW:()=>x});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(79646),i=c(49120),j=c(3894);let k=g().join(i.n,"headroom"),l=g().join(k,"proxy.pid"),m=g().join(k,"proxy.log"),n=g().join(k,"install.log");function o(){e().existsSync(k)||e().mkdirSync(k,{recursive:!0})}function p(){try{e().existsSync(l)&&e().unlinkSync(l)}catch{}}function q(a){if(!a||"number"!=typeof a)return!1;try{return process.kill(a,0),!0}catch{return!1}}function r(){let a=function(){try{if(e().existsSync(l))return parseInt(e().readFileSync(l,"utf8"),10)}catch{}return null}();return a&&q(a)?a:null}async function s({port:a=8787,codeAware:b=!1,kompress:c=!1,lossless:d=!1}={}){var f;let g=Number(a)>0&&65536>Number(a)?Number(a):8787,i=(0,j.kI)();if(!i){let a=Error("Headroom CLI not installed");throw a.code="NOT_INSTALLED",a}let k=r();if(k)return{pid:k,alreadyRunning:!0};o();let n=e().openSync(m,"a"),t=["proxy","--port",String(g),...function({codeAware:a,kompress:b,lossless:c}={}){let d=[];return a&&d.push("--code-aware"),!1===b&&d.push("--disable-kompress"),c&&d.push("--lossless"),d}({codeAware:b,kompress:c,lossless:d})],u=(0,h.spawn)(i,t,{stdio:["ignore",n,n],detached:!0,windowsHide:!0,env:{...process.env}});if(!u.pid){e().closeSync(n);let a=Error("Failed to spawn headroom proxy");throw a.code="SPAWN_FAILED",a}u.unref(),f=u.pid,o(),e().writeFileSync(l,String(f)),await new Promise((a,b)=>{let c=setTimeout(()=>{q(u.pid)?a():b(Error("headroom proxy exited during startup — see proxy.log"))},8e3);u.once("exit",a=>{clearTimeout(c),p(),e().closeSync(n);let d=Error(`headroom proxy exited early (code=${a}) — see proxy.log`);d.code="EARLY_EXIT",b(d)})}),e().closeSync(n);let v=`http://localhost:${g}`;for(let a=0;a<5;a++)try{if((await fetch(`${v}/health`,{signal:AbortSignal.timeout(1e3)})).ok)return{pid:u.pid,alreadyRunning:!1}}catch{await new Promise(a=>setTimeout(a,500))}try{process.kill(u.pid)}catch{}throw p(),Error("headroom proxy started but not serving HTTP requests — see proxy.log")}function t(){let a=r();if(!a)return{stopped:!1,reason:"not_running"};try{return process.kill(a,"SIGTERM"),setTimeout(()=>{if(q(a))try{process.kill(a,"SIGKILL")}catch{}},2e3),p(),{stopped:!0,pid:a}}catch(b){p();let a=Error(`Failed to stop headroom proxy: ${b.message}`);throw a.code="STOP_FAILED",a}}async function u(a={}){let b=r();if(b){try{process.kill(b,"SIGTERM")}catch{}for(let a=0;a<30&&q(b);a++)await new Promise(a=>setTimeout(a,100));if(q(b)){try{process.kill(b,"SIGKILL")}catch{}await new Promise(a=>setTimeout(a,300))}p()}return s(a)}async function v(a=[]){let b=Array.isArray(a)?a.filter(a=>j.F_.includes(a)):[],c=(0,j.Su)();if(!c){let a=Error("Python >= 3.10 not found");throw a.code="NO_PYTHON",a}if(!(0,j.kI)()){let a=Error("headroom-ai not installed (run `pip install headroom-ai[proxy]` first)");throw a.code="NOT_INSTALLED",a}let d=["proxy",...b].join(","),f=`headroom-ai[${d}]`;o();let g=e().openSync(n,"w"),i=(0,h.spawn)(c,["-m","pip","install","--upgrade",f],{stdio:["ignore",g,g],windowsHide:!0,env:{...process.env}});return new Promise((a,d)=>{i.once("error",a=>{e().closeSync(g),d(a)}),i.once("exit",h=>{if(e().closeSync(g),0===h)a({success:!0,code:h,spec:f,extras:b,...(0,j.rl)(c)});else{let a=Error(`pip install exited with code=${h} — see headroom/install.log`);a.code="INSTALL_FAILED",d(a)}})})}async function w(a=[]){let b=Array.isArray(a)?a.filter(a=>j.F_.includes(a)):[],c=(0,j.Su)();if(!c){let a=Error("Python >= 3.10 not found");throw a.code="NO_PYTHON",a}let d=[...new Set(b.flatMap(a=>j.Nc[a]||[]))];if(0===d.length){let a=Error("No valid extras to remove");throw a.code="INVALID_EXTRAS",a}let f=["-m","pip","uninstall","-y",...d];o();let g=e().openSync(n,"w"),i=(0,h.spawn)(c,f,{stdio:["ignore",g,g],windowsHide:!0,env:{...process.env}});return new Promise((a,f)=>{i.once("error",a=>{e().closeSync(g),f(a)}),i.once("exit",h=>{if(e().closeSync(g),0===h)a({success:!0,code:h,removed:d,extras:b,...(0,j.rl)(c)});else{let a=Error(`pip uninstall exited with code=${h} — see headroom/install.log`);a.code="UNINSTALL_FAILED",f(a)}})})}function x(a=15){try{if(!e().existsSync(n))return"";return e().readFileSync(n,"utf8").split(/\r?\n/).filter(Boolean).slice(-a).join("\n")}catch{return""}}},78335:()=>{},89718:(a,b,c)=>{"use strict";c.d(b,{$e:()=>d.$e,CF:()=>d.CF,CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,Ko:()=>d.Ko,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q6:()=>d.Q6,Q_:()=>d.Q_,Qu:()=>d.Qu,RT:()=>d.RT,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,__:()=>d.__,aQ:()=>d.aQ,bI:()=>d.bI,c:()=>d.c,dA:()=>d.dA,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,lk:()=>d.lk,mV:()=>d.mV,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,pO:()=>d.pO,qr:()=>d.qr,r4:()=>d.r4,sZ:()=>d.sZ,t$:()=>d.t$,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,xN:()=>d.xN,y7:()=>d.y7,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(33079)},96487:()=>{}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=6252,exports.ids=[6252],exports.modules={34050:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=
|
|
1
|
+
"use strict";exports.id=6252,exports.ids=[6252],exports.modules={34050:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=7,e=`
|
|
2
2
|
PRAGMA journal_mode = WAL;
|
|
3
3
|
PRAGMA synchronous = NORMAL;
|
|
4
4
|
PRAGMA temp_store = MEMORY;
|
|
@@ -6,4 +6,4 @@ PRAGMA mmap_size = 30000000;
|
|
|
6
6
|
PRAGMA cache_size = -64000;
|
|
7
7
|
PRAGMA foreign_keys = ON;
|
|
8
8
|
PRAGMA busy_timeout = 5000;
|
|
9
|
-
`,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL",scope:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",config:"TEXT",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},mcpInstances:{columns:{id:"TEXT PRIMARY KEY",slug:"TEXT UNIQUE NOT NULL",title:"TEXT",kind:"TEXT NOT NULL",transport:"TEXT NOT NULL",url:"TEXT",command:"TEXT",args:"TEXT",env:"TEXT",headers:"TEXT",oauth:"INTEGER DEFAULT 0",oauthTokens:"TEXT",enabled:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_inst_slug ON mcpInstances(slug)","CREATE INDEX IF NOT EXISTS idx_mcp_inst_enabled ON mcpInstances(enabled)"]},mcpGatewayKeys:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT",key:"TEXT UNIQUE NOT NULL",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_gwkey ON mcpGatewayKeys(key)"]},mcpKeyGrants:{columns:{keyId:"TEXT NOT NULL",instanceId:"TEXT NOT NULL",toolAllowlist:"TEXT"},primaryKey:"PRIMARY KEY (keyId, instanceId)",indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_grant_key ON mcpKeyGrants(keyId)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]},errorLogs:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",endpoint:"TEXT",provider:"TEXT",model:"TEXT",connectionId:"TEXT",comboName:"TEXT",statusCode:"TEXT",errorMessage:"TEXT",request:"TEXT",providerRequest:"TEXT",providerResponse:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_el_ts ON errorLogs(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_el_provider ON errorLogs(provider)","CREATE INDEX IF NOT EXISTS idx_el_model ON errorLogs(model)","CREATE INDEX IF NOT EXISTS idx_el_conn ON errorLogs(connectionId)","CREATE INDEX IF NOT EXISTS idx_el_combo ON errorLogs(comboName)"]},tokenSaverDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},convoyRules:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT NOT NULL",enabled:"INTEGER DEFAULT 1",priority:"INTEGER DEFAULT 0",matchType:"TEXT NOT NULL DEFAULT 'literal'",action:"TEXT NOT NULL DEFAULT 'replace'",pattern:"TEXT NOT NULL",replacement:"TEXT DEFAULT ''",caseSensitive:"INTEGER DEFAULT 1",providerIds:"TEXT DEFAULT '[]'",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_cr_enabled ON convoyRules(enabled)","CREATE INDEX IF NOT EXISTS idx_cr_priority ON convoyRules(enabled, priority)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},66252:(a,b,c)=>{c.d(b,{createSqlJsAdapter:()=>m});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(46293),i=c.n(h),j=c(34050);c(11356);let k=null;async function l(){return k||(k=await i()())}async function m(a){let b=await l(),c=e().existsSync(a)?e().readFileSync(a):null,d=new b.Database(c);d.exec(j.oG);let f=!1,h=null,i=0;function k(){let b,c=d.export(),h=g().dirname(a),j=g().join(h,`.${g().basename(a)}.tmp-${process.pid}-${i++}`);try{b=e().openSync(j,"w"),e().writeFileSync(b,Buffer.from(c)),e().fsyncSync(b)}catch(a){if(void 0!==b)try{e().closeSync(b)}catch{}try{e().unlinkSync(j)}catch{}throw a}e().closeSync(b);try{e().renameSync(j,a)}catch(a){try{e().unlinkSync(j)}catch{}throw a}f=!1}function m(){f=!0,h&&clearTimeout(h),h=setTimeout(()=>{if(h=null,f)try{k()}catch(a){console.error("[sqljs] save failed:",a)}},100)}function n(a){if(!(!a||Array.isArray(a)&&0===a.length))return a}let o=()=>{if(f)try{k()}catch{}},p=()=>{o(),process.exit(0)};return process.once("beforeExit",o),process.once("SIGINT",p),process.once("SIGTERM",p),{driver:"sql.js",run:function(a,b=[]){let c=d.prepare(a);try{c.bind(n(b)),c.step();let a=d.getRowsModified(),e=d.exec("SELECT last_insert_rowid() as id")[0]?.values?.[0]?.[0]??null;return m(),{changes:a,lastInsertRowid:e}}finally{c.free()}},get:function(a,b=[]){let c=d.prepare(a);try{if(c.bind(n(b)),c.step())return c.getAsObject();return}finally{c.free()}},all:function(a,b=[]){let c=d.prepare(a);try{c.bind(n(b));let a=[];for(;c.step();)a.push(c.getAsObject());return a}finally{c.free()}},exec:function(a){d.exec(a),m()},transaction:function(a){let b=`sp_${Math.random().toString(36).slice(2)}`;d.exec(`SAVEPOINT ${b}`);try{let c=a();return d.exec(`RELEASE ${b}`),m(),c}catch(a){try{d.exec(`ROLLBACK TO ${b}`),d.exec(`RELEASE ${b}`)}catch{}throw a}},close:function(){h&&clearTimeout(h),f&&k(),d.close()},raw:d}}}};
|
|
9
|
+
`,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL",scope:"TEXT",accessRestricted:"INTEGER DEFAULT 0",accessAllow:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",config:"TEXT",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},mcpInstances:{columns:{id:"TEXT PRIMARY KEY",slug:"TEXT UNIQUE NOT NULL",title:"TEXT",kind:"TEXT NOT NULL",transport:"TEXT NOT NULL",url:"TEXT",command:"TEXT",args:"TEXT",env:"TEXT",headers:"TEXT",oauth:"INTEGER DEFAULT 0",oauthTokens:"TEXT",enabled:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_inst_slug ON mcpInstances(slug)","CREATE INDEX IF NOT EXISTS idx_mcp_inst_enabled ON mcpInstances(enabled)"]},mcpGatewayKeys:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT",key:"TEXT UNIQUE NOT NULL",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_gwkey ON mcpGatewayKeys(key)"]},mcpKeyGrants:{columns:{keyId:"TEXT NOT NULL",instanceId:"TEXT NOT NULL",toolAllowlist:"TEXT"},primaryKey:"PRIMARY KEY (keyId, instanceId)",indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_grant_key ON mcpKeyGrants(keyId)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]},errorLogs:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",endpoint:"TEXT",provider:"TEXT",model:"TEXT",connectionId:"TEXT",comboName:"TEXT",statusCode:"TEXT",errorMessage:"TEXT",request:"TEXT",providerRequest:"TEXT",providerResponse:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_el_ts ON errorLogs(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_el_provider ON errorLogs(provider)","CREATE INDEX IF NOT EXISTS idx_el_model ON errorLogs(model)","CREATE INDEX IF NOT EXISTS idx_el_conn ON errorLogs(connectionId)","CREATE INDEX IF NOT EXISTS idx_el_combo ON errorLogs(comboName)"]},tokenSaverDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},convoyRules:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT NOT NULL",enabled:"INTEGER DEFAULT 1",priority:"INTEGER DEFAULT 0",matchType:"TEXT NOT NULL DEFAULT 'literal'",action:"TEXT NOT NULL DEFAULT 'replace'",pattern:"TEXT NOT NULL",replacement:"TEXT DEFAULT ''",caseSensitive:"INTEGER DEFAULT 1",providerIds:"TEXT DEFAULT '[]'",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_cr_enabled ON convoyRules(enabled)","CREATE INDEX IF NOT EXISTS idx_cr_priority ON convoyRules(enabled, priority)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},66252:(a,b,c)=>{c.d(b,{createSqlJsAdapter:()=>m});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(46293),i=c.n(h),j=c(34050);c(11356);let k=null;async function l(){return k||(k=await i()())}async function m(a){let b=await l(),c=e().existsSync(a)?e().readFileSync(a):null,d=new b.Database(c);d.exec(j.oG);let f=!1,h=null,i=0;function k(){let b,c=d.export(),h=g().dirname(a),j=g().join(h,`.${g().basename(a)}.tmp-${process.pid}-${i++}`);try{b=e().openSync(j,"w"),e().writeFileSync(b,Buffer.from(c)),e().fsyncSync(b)}catch(a){if(void 0!==b)try{e().closeSync(b)}catch{}try{e().unlinkSync(j)}catch{}throw a}e().closeSync(b);try{e().renameSync(j,a)}catch(a){try{e().unlinkSync(j)}catch{}throw a}f=!1}function m(){f=!0,h&&clearTimeout(h),h=setTimeout(()=>{if(h=null,f)try{k()}catch(a){console.error("[sqljs] save failed:",a)}},100)}function n(a){if(!(!a||Array.isArray(a)&&0===a.length))return a}let o=()=>{if(f)try{k()}catch{}},p=()=>{o(),process.exit(0)};return process.once("beforeExit",o),process.once("SIGINT",p),process.once("SIGTERM",p),{driver:"sql.js",run:function(a,b=[]){let c=d.prepare(a);try{c.bind(n(b)),c.step();let a=d.getRowsModified(),e=d.exec("SELECT last_insert_rowid() as id")[0]?.values?.[0]?.[0]??null;return m(),{changes:a,lastInsertRowid:e}}finally{c.free()}},get:function(a,b=[]){let c=d.prepare(a);try{if(c.bind(n(b)),c.step())return c.getAsObject();return}finally{c.free()}},all:function(a,b=[]){let c=d.prepare(a);try{c.bind(n(b));let a=[];for(;c.step();)a.push(c.getAsObject());return a}finally{c.free()}},exec:function(a){d.exec(a),m()},transaction:function(a){let b=`sp_${Math.random().toString(36).slice(2)}`;d.exec(`SAVEPOINT ${b}`);try{let c=a();return d.exec(`RELEASE ${b}`),m(),c}catch(a){try{d.exec(`ROLLBACK TO ${b}`),d.exec(`RELEASE ${b}`)}catch{}throw a}},close:function(){h&&clearTimeout(h),f&&k(),d.close()},raw:d}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=6420,exports.ids=[6420],exports.modules={13808:(a,b,c)=>{c.d(b,{$N:()=>f,OK:()=>g,Zl:()=>h,lz:()=>i});var d=c(55511),e=c.n(d);function f(a=32){return e().randomBytes(a).toString("base64url")}function g(a){return e().createHash("sha256").update(a).digest("base64url")}function h(){return e().randomBytes(32).toString("base64url")}function i(a=32){let b=f(a),c=g(b);return{codeVerifier:b,codeChallenge:c,state:h()}}},36187:(a,b,c)=>{c.d(b,{PY:()=>ae,exchangeTokens:()=>aa,extractCodexAccountInfo:()=>e.YR,fetchKiroProfileArn:()=>e.gR,kP:()=>_,sO:()=>$,Su:()=>ac,Re:()=>ab}),c(30369);var d=c(13808),e=c(53129),f=c(92990);let g={config:f.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},h={config:f.DI,flowType:"authorization_code_pkce",fixedPort:f.DI.fixedPort,callbackPath:f.DI.callbackPath,buildAuthUrl:(a,b,c,d)=>{let e=Object.entries({response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c}).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${e}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=(0,e.YR)(a.id_token),c={accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in,lastRefreshAt:new Date().toISOString()},d=b.email||(0,e.J_)(a.access_token);return d&&(c.email=d),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}};var i=c(55511),j=c.n(i),k=c(73159);let l=null;async function m(){if(l)return l;try{let a=await fetch(k.oT.discoveryUrl,{headers:{Accept:"application/json"}});if(a.ok){let b=await a.json();return l={authorizeUrl:(0,e.js)(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:(0,e.js)(b.token_endpoint,"token_endpoint")}}}catch{}return l={authorizeUrl:k.oT.authorizeUrl,tokenUrl:k.oT.tokenUrl}}let n={config:k.oT,flowType:"authorization_code_pkce",fixedPort:k.oT.loopbackPort,callbackPath:k.oT.callbackPath,pkceVerifierBytes:k.Ue,prepareConfig:async a=>{let b=await m();return{...a,authorizeUrl:b.authorizeUrl,tokenUrl:b.tokenUrl}},buildAuthUrl:(a,b,c,d)=>{let e=j().randomBytes(16).toString("hex"),f=Object.entries({response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c,nonce:e,plan:"generic",referrer:"cli-proxy-api"}).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`xAI token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b={accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope},c=(0,e.pG)(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}};var o=c(13247);let p={config:f.qp,flowType:"device_code",requestDeviceCode:async a=>{let b=new URLSearchParams({client_id:a.clientId,scope:a.scope});a.referrer&&b.set("referrer",a.referrer);let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":o.hY},body:b});if(!c.ok){let a=await c.text();throw Error(`Grok CLI device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":o.hY},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId})});try{c=await d.json()}catch{c={error:"invalid_response",error_description:await d.text()}}let e=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:d.ok||e,data:c}},postExchange:async a=>{try{let b=await fetch("https://cli-chat-proxy.grok.com/v1/user",{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","User-Agent":o.hY,"x-xai-token-auth":"xai-grok-cli","x-grok-client-version":o.uG}});if(b.ok)return{user:await b.json()}}catch{}return{user:null}},mapTokens:(a,b)=>{let c=(0,e.pG)(a.id_token)||(0,e.J_)(a.access_token)||b?.user?.email||null,d=b?.user?.userId||b?.user?.principalId||null,f=[b?.user?.firstName,b?.user?.lastName].filter(Boolean).join(" ").trim()||null,g=a.expires_in?new Date(Date.now()+1e3*a.expires_in).toISOString():null;return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,expiresAt:g,scope:a.scope,email:c||void 0,displayName:f||void 0,providerSpecificData:{authMethod:"device_code",idToken:a.id_token||null,email:c||null,userId:d,hasGrokCodeAccess:b?.user?.hasGrokCodeAccess??null,subscriptionTier:b?.user?.subscriptionTier??null}}}},q="1.0.0",r={config:f.sA,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-api-version":q},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Muse Code device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-api-version":q},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId})});try{c=await d.json()}catch{c={error:"invalid_response",error_description:await d.text()}}let e=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:d.ok||e,data:c}},postExchange:async a=>{let b,c;for(let c=0;(429===(b=await fetch("https://api.meta.ai/muse-code/key",{method:"POST",headers:{Accept:"application/json",Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","x-api-version":q},body:JSON.stringify({onboard:!0}),redirect:"error"})).status||b.status>=500)&&!(c>=2);c++)await new Promise(a=>setTimeout(a,5e3*(c+1)));let d=await b.text();if(!b.ok){let a=`${b.status} ${d.slice(0,200)}`;try{let b=JSON.parse(d);(b?.title||b?.detail)&&(a=[b.title,b.detail].filter(Boolean).join(": "),b.action_url&&(a+=` — ${b.action_url}`))}catch{}throw Error(`Muse Code key mint failed: ${a}`)}try{c=JSON.parse(d)}catch{throw Error("Muse Code key mint returned invalid JSON")}if(!1===c.is_subs_active)throw Error("Muse Code subscription is inactive — activate it on muse.ai first");let e=c.action_url||c.require_payment_action_url;if(!c.api_key&&(c.require_payment||e))throw Error(`Muse Code subscription required${e?`: ${e}`:""}`);if(!c.api_key)throw Error("Muse Code key response is missing api_key");return{key:c}},mapTokens:(a,b)=>{let c=b?.key||{};return{accessToken:c.api_key,refreshToken:null,expiresIn:null,email:c.user_email?.trim().toLowerCase()||void 0,providerSpecificData:{authMethod:"device_code",oauthAccessToken:a.access_token,subscriptionTier:c.subs_tier_name||null}}}},s={config:f.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${f.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,f.cD)(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},t={config:f.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c}),signal:AbortSignal.timeout(1e4)});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":f.YT.loadCodeAssistUserAgent,"x-request-source":"local"},c=(0,f.cD)(),d={};try{let b=await fetch(`${f.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"},signal:AbortSignal.timeout(5e3)});b.ok&&(d=await b.json())}catch(a){console.log("Failed to fetch user info:",a)}let e="",g="legacy-tier";try{let a=await fetch(f.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c}),signal:AbortSignal.timeout(5e3)});if(a.ok){let b=await a.json();if(e=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){g=a.id.trim();break}}}}catch(a){console.log("Failed to load code assist:",a)}return e&&(async()=>{for(let a=0;a<10;a++){try{let a=await fetch(f.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:g,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:d,projectId:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},u={config:f.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${f.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})};function v(a){return{config:a,flowType:"device_code",requestDeviceCode:async a=>{let{QoderService:b}=await c.e(3912).then(c.bind(c,91531)),d=await new b(a).initiateDeviceFlow();return{device_code:d.nonce,user_code:d.nonce.slice(0,8).toUpperCase(),verification_uri:a.loginUrl,verification_uri_complete:d.verificationUriComplete,expires_in:300,interval:2,codeVerifier:d.codeVerifier,_qoderNonce:d.nonce,_qoderMachineId:d.machineId,_qoderMachineToken:d.machineToken}},pollToken:async(a,b,d,e)=>{let f,{QoderService:g}=await c.e(3912).then(c.bind(c,91531)),h=new g(a),i=b||e?._qoderNonce,j=d||e?._qoderVerifier;if(!i||!j)return{ok:!1,data:{error:"invalid_request",error_description:"Missing nonce/verifier"}};try{f=await h.pollDeviceToken({nonce:i,codeVerifier:j})}catch(a){return{ok:!1,data:{error:"poll_failed",error_description:a.message}}}if("pending"===f.status)return{ok:!1,data:{error:"authorization_pending"}};let k=await h.fetchUserInfo(f.accessToken),l=Math.max(86400,Math.floor((f.expireTime-Date.now())/1e3));return{ok:!0,data:{access_token:f.accessToken,refresh_token:f.refreshToken,expires_in:l,_qoderUserId:f.userId,_qoderMachineId:e?._qoderMachineId||"",_qoderMachineToken:e?._qoderMachineToken||e?._qoderMachineId||"",_qoderName:k.name,_qoderEmail:k.email,_qoderOrganizationId:k.organizationId}}},mapTokens:a=>{let b=(a._qoderEmail||"").trim(),c=(a._qoderName||"").trim()||null,d=a._qoderUserId||"",e=b||(d?`qoder-user-${d}`:null);return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,email:e,displayName:c,providerSpecificData:{authMethod:"device",userId:d,machineId:a._qoderMachineId||"",machineToken:a._qoderMachineToken||a._qoderMachineId||"",organizationId:a._qoderOrganizationId||""}}}}}let w=v(f.hF),x=v(f.t3),y={config:f.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(a){c={error:"invalid_response",error_description:await d.text()}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(f.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":f.Nu.apiVersion,"User-Agent":f.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(f.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":f.Nu.apiVersion,"User-Agent":f.Nu.userAgent}});return{copilotToken:c,userInfo:d.ok?await d.json():{}}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,name:b?.userInfo?.login||b?.userInfo?.name,displayName:b?.userInfo?.name||b?.userInfo?.login,email:b?.userInfo?.email||null,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},z={config:f.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1";(0,f.S6)(d);let e=("string"==typeof c.startUrl?c.startUrl.trim():"")||a.startUrl,g="idc"===c.authMethod?"idc":"builder-id",h=`https://oidc.${d}.amazonaws.com/client/register`,i=`https://oidc.${d}.amazonaws.com/device_authorization`,j=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl})});if(!j.ok){let a=await j.text();throw Error(`Client registration failed: ${a}`)}let k=await j.json(),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:k.clientId,clientSecret:k.clientSecret,startUrl:e})});if(!l.ok){let a=await l.text();throw Error(`Device authorization failed: ${a}`)}let m=await l.json();return{device_code:m.deviceCode,user_code:m.userCode,verification_uri:m.verificationUri,verification_uri_complete:m.verificationUriComplete,expires_in:m.expiresIn,interval:m.interval||5,_clientId:k.clientId,_clientSecret:k.clientSecret,_region:d,_authMethod:g,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,g=d?._region||"us-east-1";(0,f.S6)(g);let h=`https://oidc.${g}.amazonaws.com/token`,i=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await i.json()}catch(a){e={error:"invalid_response",error_description:await i.text()}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=(0,e.J_)(a.access_token);return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,email:b,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret,region:a._region||"us-east-1",authMethod:a._authMethod||"builder-id",startUrl:a._startUrl||f.Tx.startUrl}}}},A={config:f.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},B={config:f.aV,flowType:"device_code",requestDeviceCode:async a=>{let{buildKimiHeaders:b}=await Promise.resolve().then(c.bind(c,28730)),d=j().randomUUID(),e={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...b(d)},f=await fetch(a.deviceCodeUrl,{method:"POST",headers:e,body:new URLSearchParams({client_id:a.clientId})});if(!f.ok){let a=await f.text();throw Error(`Device code request failed: ${a}`)}let g=await f.json(),h=a.authorizeDeviceUrl||"https://www.kimi.com/code/authorize_device";return{device_code:g.device_code,user_code:g.user_code,verification_uri:g.verification_uri||h,verification_uri_complete:g.verification_uri_complete||`${h}?user_code=${g.user_code}`,expires_in:g.expires_in,interval:g.interval||5,_kimiDeviceId:d}},pollToken:async(a,b,d,e)=>{let f,{buildKimiHeaders:g}=await Promise.resolve().then(c.bind(c,28730)),h=e?._kimiDeviceId,i={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...g(h)},j=await fetch(a.tokenUrl,{method:"POST",headers:i,body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{f=await j.json()}catch{f={error:"invalid_response",error_description:"non-json token response"}}return"authorization_pending"===f.error||"slow_down"===f.error?{ok:!0,data:f}:(f.access_token&&h&&(f._kimiDeviceId=h),{ok:j.ok||!!f.access_token||!!f.error,data:f})},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{authMethod:"device_code",...a._kimiDeviceId?{deviceId:a._kimiDeviceId}:{}}})},C={config:f.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},D={config:f.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},E={config:f.w1,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`ClinePass token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},F={config:f.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=new URLSearchParams({client_id:e.clientId||"",redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${g.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},G={config:f.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(`${a.tokenUrl}?state=${encodeURIComponent(b)}`,{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer",expires_in:d.data.expiresIn}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||86400,providerSpecificData:{}})},H={config:f.DV,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy Intl state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy Intl state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(`${a.tokenUrl}?state=${encodeURIComponent(b)}`,{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer",expires_in:d.data.expiresIn}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||86400,providerSpecificData:{}})},I={config:f.Td,flowType:"browser_token",buildAuthUrl:(a,b,c)=>{let d=(a.webAppUrl||"https://app.kimchi.dev").replace(/\/+$/,""),e=new URLSearchParams({callback:b,state:c});return`${d}/cli-auth?${e.toString()}`},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!c)throw Error("Missing Kimchi token");let d=a.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",e=await fetch(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`}});if(!e.ok)throw Error(`Kimchi token validation failed: ${e.status}`);let f={};if(a.userInfoUrl)try{let b=await fetch(a.userInfoUrl,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`}});b.ok&&(f=await b.json())}catch{f={}}return{access_token:c,token_type:"Bearer",_kimchiUser:f}},mapTokens:a=>{let b=a._kimchiUser||{},c=b.id?String(b.id):"",d=b.username||"",e=b.email||(c?`kimchi-user-${c}`:null);return{accessToken:a.access_token,refreshToken:null,email:e,displayName:b.name||d||null,providerSpecificData:{authMethod:"browser_token",userId:c,username:d}}}};function J(a,b){for(let c of b){let b=a;for(let a of c){if(null==b||"object"!=typeof b){b=void 0;break}b=b[a]}if("string"==typeof b&&b.trim())return b.trim();if("number"==typeof b)return String(b)}return null}async function K(a){let b=JSON.stringify({loginTraceID:a,login_trace_id:a}),c="no successful response";for(let a of f.SK.loginGuidanceUrls)try{let d=await fetch(a,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent},body:b});if(!d.ok){c=`${a} HTTP ${d.status}`;continue}let e=await d.json(),g=J(e,[["Result","LoginHost"],["Result","loginHost"],["Result","LoginURL"],["result","loginHost"],["data","Result","LoginHost"],["data","loginHost"],["LoginHost"],["loginHost"]]);if(g)return g;c=`${a} missing LoginHost`}catch(b){c=`${a} ${b.message}`}throw Error(`Trae GetLoginGuidance failed: ${c}`)}function L(){return[...f.SK.apiOrigins]}async function M(a,b){let c=JSON.stringify({ClientID:f.SK.clientId,RefreshToken:a,ClientSecret:f.SK.clientSecret,UserID:""}),d="no successful response";for(let e of L()){let g=`${e.replace(/\/$/,"")}${f.SK.exchangeTokenPath}`;try{let e,h={Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent};b&&(h["x-cloudide-token"]=b);let i=await fetch(g,{method:"POST",headers:h,body:c}),j=await i.text();if(!i.ok){d=`${g} HTTP ${i.status}`;continue}try{e=JSON.parse(j)}catch{d=`${g} invalid JSON`;continue}let k=J(e,[["Result","AccessToken"],["Result","accessToken"],["result","access_token"],["accessToken"]]);if(!k){let a=J(e,[["message"],["msg"],["error"],["Result","Message"]])||"missing AccessToken";d=`${g} ${a}`;continue}return{accessToken:k,refreshToken:J(e,[["Result","RefreshToken"],["result","refresh_token"],["refreshToken"]])||a,expiresIn:null,expiresAt:J(e,[["Result","ExpiresAt"],["Result","expiresAt"],["result","expires_at"],["expiresAt"]])}}catch(a){d=`${g} ${a.message}`}}throw Error(`Trae ExchangeToken failed: ${d}`)}async function N(a){for(let b of L()){let c=`${b.replace(/\/$/,"")}${f.SK.getUserInfoPath}`;try{let b=await fetch(c,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent,"x-cloudide-token":a},body:JSON.stringify({})});if(!b.ok)continue;let d=await b.json();return{email:J(d,[["Result","NonPlainTextEmail"],["Result","Email"],["Result","email"],["email"],["data","email"]]),name:J(d,[["Result","ScreenName"],["Result","Nickname"],["Result","Name"],["result","nickname"],["nickname"],["name"]]),aiRegion:J(d,[["Result","AIRegion"],["Result","aiRegion"],["aiRegion"]]),region:J(d,[["Result","Region"],["Result","region"],["region"]]),tenant:J(d,[["Result","TenantID"],["Result","tenantId"],["tenantId"]]),userId:J(d,[["Result","UserID"],["Result","userId"],["userId"]])}}catch{}}return{email:null,name:null}}let O={config:f.SK,flowType:"authorization_code",callbackPath:f.SK.callbackPath,prepareConfig:async a=>{let b=j().randomUUID(),c=await K(b);return{...a,loginTraceID:b,loginHost:c}},buildAuthUrl:(a,b,c)=>{var d;let e,g,h={plugin_version:f.SK.defaultPluginVersion,machine_id:j().randomUUID(),device_id:f.SK.defaultDeviceId,x_device_brand:"unknown",x_device_type:"unknown",x_os_version:"unknown",x_env:"",x_app_version:f.SK.defaultAppVersion,x_app_type:f.SK.defaultAppType},i=a.loginTraceID||c;return d=a.loginHost,(e=new URL(d.startsWith("http")?d:`https://${d.replace(/^\/+/,"")}`)).pathname=f.SK.authorizationPath,(g=new URLSearchParams).set("login_version","1"),g.set("auth_from","trae"),g.set("login_channel","native_ide"),g.set("plugin_version",h.plugin_version),g.set("auth_type","local"),g.set("client_id",f.SK.clientId),g.set("redirect","0"),g.set("login_trace_id",i),g.set("auth_callback_url",b),g.set("machine_id",h.machine_id),g.set("device_id",h.device_id),g.set("x_device_id",h.device_id),g.set("x_machine_id",h.machine_id),g.set("x_device_brand",h.x_device_brand),g.set("x_device_type",h.x_device_type),g.set("x_os_version",h.x_os_version),g.set("x_env",h.x_env),g.set("x_app_version",h.x_app_version),g.set("x_app_type",h.x_app_type),e.search=g.toString(),e.toString()},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!(/[?=&]/.test(c)&&(c.includes("refreshToken")||c.includes("refresh_token"))))return{accessToken:c.replace(/^(Cloud-IDE-JWT|Bearer)\s+/i,""),refreshToken:null,expiresIn:24*f.SK.tokenLifetimeDays*3600,_authMethod:"imported"};let{refreshToken:d,cloudideToken:e}=function(a){let b=String(a||"").trim(),c=b;b.includes("?")&&(c=b.slice(b.indexOf("?")+1)),b.startsWith("#")&&(c=b.slice(1));let d=Object.fromEntries(new URLSearchParams(c)),e=a=>{for(let b of a){let a=d[b];if(a&&String(a).trim())return String(a).trim()}return null},f=e(["error","error_code","errorCode"]);if(f){let a=e(["error_description","error_desc","message"]);throw Error(a?`Trae auth failed: ${f} (${a})`:`Trae auth failed: ${f}`)}let g=e(["refreshToken","refresh_token","RefreshToken"]);if(!g)throw Error("Trae callback missing refreshToken");let h=e(["loginHost","login_host","LoginHost","host","consoleHost"]);if(!h)throw Error("Trae callback missing loginHost");return{refreshToken:g,loginHost:h,cloudideToken:e(["x-cloudide-token","xCloudideToken","accessToken","access_token","token"])}}(c);return{...await M(d,e),_authMethod:"oauth"}},postExchange:async a=>({userInfo:await N(a.accessToken)}),mapTokens:(a,b)=>{let c,d=a.expiresIn||(a.expiresAt?Math.max(60,Number(a.expiresAt)-Math.floor(Date.now()/1e3)):24*f.SK.tokenLifetimeDays*3600),e=b?.userInfo||{},g=e.aiRegion||"US-East";return{accessToken:a.accessToken,refreshToken:a.refreshToken,expiresIn:d,email:e.email||void 0,displayName:e.name||void 0,providerSpecificData:{authMethod:a._authMethod||"oauth",aiRegion:g,region:e.region||g,tenant:e.tenant||"marscode",userId:e.userId||"",scope:"sg"===(c=(g||"").toLowerCase())||c.includes("singapore")?"marscode-sg":"cn"===c||c.includes("cn")||c.includes("china")?"marscode-cn":"marscode-us",webId:"",bizUserId:"",userUniqueId:"",appLanguage:"en",appVersion:f.SK.defaultAppVersion,userRegion:"SG"===g?"SG":"US",userIdentity:"Free"}}}};async function P(a,b,c){let d=`${a.replace(/\/$/,"")}${b}`,e=await fetch(d,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.eD.userAgent},body:JSON.stringify(c)}),g=await e.text();if(!e.ok)throw Error(`Windsurf ${b} HTTP ${e.status}: ${g.slice(0,200)}`);try{return JSON.parse(g)}catch{throw Error(`Windsurf ${b} invalid JSON`)}}async function Q(a){let b=await P(f.eD.registerApiBaseUrl,f.eD.registerPath,{firebase_id_token:a}),c=J(b,[["apiKey"],["api_key"]]);if(!c)throw Error("Windsurf RegisterUser missing apiKey");return{apiKey:c,apiServerUrl:J(b,[["apiServerUrl"],["api_server_url"]])||f.eD.defaultApiServerUrl,name:J(b,[["name"]])}}async function R(a,b){try{let c=await P(a,f.eD.oneTimeAuthPath,{firebaseIdToken:b}),d=J(c,[["authToken"],["auth_token"]]);if(!d)return{email:null,name:null};let e=await P(a,f.eD.currentUserPath,{authToken:d,includeSubscription:!0}),g=e.user||e;return{email:J(g,[["email"]]),name:J(g,[["name"]])}}catch{return{email:null,name:null}}}let S={config:f.eD,flowType:"authorization_code",callbackPath:f.eD.callbackPath,buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({response_type:"token",client_id:a.clientId,redirect_uri:b,state:c,prompt:"login",redirect_parameters_type:"query",workflow:"onboarding"});return`${a.authBaseUrl}${a.signInPath}?${d.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=String(b||"").trim();if(!(f.includes("?")||f.includes("access_token="))){let b=f.replace(/^Bearer\s+/i,"");if(b.startsWith("sk-ws-"))return{accessToken:b,refreshToken:null,expiresIn:null,apiServerUrl:a.defaultApiServerUrl,firebaseIdToken:null,_authMethod:"imported"};let c=await Q(b);return{accessToken:c.apiKey,refreshToken:null,expiresIn:null,apiServerUrl:c.apiServerUrl,firebaseIdToken:b,_authMethod:"imported"}}let{firebaseIdToken:g}=function(a,b){let c=String(a||"").trim(),d=c;c.includes("?")&&(d=c.slice(c.indexOf("?")+1)),c.startsWith("#")&&(d=c.slice(1));let e=Object.fromEntries(new URLSearchParams(d)),f=a=>{for(let b of a){let a=e[b];if(a&&String(a).trim())return String(a).trim()}return null},g=f(["error"]);if(g){let a=f(["error_description"]);throw Error(a?`Windsurf auth failed: ${g} (${a})`:`Windsurf auth failed: ${g}`)}let h=f(["access_token","token"]);if(!h)throw Error("Windsurf callback missing access_token");let i=f(["state"]);if(b&&i&&i!==b)throw Error("Windsurf callback state mismatch");return{firebaseIdToken:h}}(f,e),h=await Q(g);return{accessToken:h.apiKey,refreshToken:null,expiresIn:null,apiServerUrl:h.apiServerUrl,firebaseIdToken:g,_authMethod:"oauth"}},postExchange:async a=>a.firebaseIdToken?{userInfo:await R(a.apiServerUrl,a.firebaseIdToken)}:{userInfo:{email:null,name:null}},mapTokens:(a,b)=>({accessToken:a.accessToken,refreshToken:null,expiresIn:null,email:b?.userInfo?.email||void 0,displayName:b?.userInfo?.name||void 0,providerSpecificData:{authMethod:a._authMethod||"oauth",apiServerUrl:a.apiServerUrl,firebaseIdToken:a.firebaseIdToken}})};var T=c(49934);async function U(a,b){let c=await V(a,b),d={Authorization:`Bearer ${c}`,"Content-Type":"application/json"},e=function(a){let b=(Array.isArray(a?.organizations)?a.organizations:[]).map(a=>({organization:a,projects:(a?.projects||[]).filter(a=>"2"!==String(a?.projectType??"").trim())})).filter(({organization:a,projects:b})=>!!(a?.organizationId&&b.length));if(!b.length)return null;let c=b.find(({organization:a})=>X(a.organizationName))||b[0],d=c.projects.find(a=>X(a?.projectName))||c.projects[0];return c.organization?.organizationId&&d?.projectId?{organizationId:c.organization.organizationId,projectId:d.projectId}:null}(await W(`${a.apiBaseUrl}/api/biz/customer/getCustomerInfo`,{headers:d},"customer info"));if(!e)throw Error("Unable to resolve Z.ai organization and project for the coding plan");let f=`${a.apiBaseUrl}/api/biz/v1/organization/${e.organizationId}/projects/${e.projectId}/api_keys`,g=await W(f,{headers:d},"api keys")||[],h=Array.isArray(g)?g.find(b=>b?.name===a.planApiKeyName):null;h||(h=await W(f,{method:"POST",headers:d,body:JSON.stringify({name:a.planApiKeyName})},"api key create"));let i=h?.apiKey?.trim();if(!i)throw Error("Z.ai api_keys response is missing apiKey");let j=await W(`${f}/copy/${encodeURIComponent(i)}`,{headers:d},"api key copy"),k=j?.secretKey?.trim();if(!k)throw Error("Z.ai api key copy response is missing secretKey");return{planApiKey:`${i}.${k}`,businessToken:c}}async function V(a,b){let c=await W(a.businessLoginUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b})},"Z.ai business login"),d=c?.access_token?.trim()||c?.accessToken?.trim();if(!d)throw Error("Z.ai business login response is missing access_token");return d}async function W(a,b,c){let d,e=await fetch(a,b),f=await e.text();if(!e.ok)throw Error(`Z.ai ${c} request failed (HTTP ${e.status}): ${f.slice(0,200)}`);try{d=JSON.parse(f)}catch{throw Error(`Z.ai ${c} response is not valid JSON`)}if(!Y(d?.code)||d?.success===!1)throw Error(d?.msg||`Z.ai ${c} returned business error ${d?.code}`);return d?.data??d??null}function X(a){let b=String(a||"").trim().toLowerCase();return b.includes("默认机构")||b.includes("默认项目")||"default"===b}function Y(a){return null==a||0===a||200===a||"0"===a||"200"===a}let Z={claude:g,codex:h,xai:n,"grok-cli":p,muse:r,"gemini-cli":s,antigravity:t,iflow:u,qoder:w,"qoder-cn":x,github:y,kiro:z,cursor:A,kimi:B,kilocode:C,cline:D,clinepass:E,gitlab:F,"codebuddy-cn":G,"codebuddy-intl":H,kimchi:I,trae:O,windsurf:S,zed:{config:f.RY,flowType:"authorization_code",callbackPath:"/",prepareConfig:async(a,b)=>{let c=Number(b?.nativeAppPort)||f.RY.defaultNativeAppPort,d=(0,T.le)(a,{nativeAppPort:c});return{...a,...d}},buildAuthUrl:(a,b,c)=>a.authUrl,exchangeToken:async(a,b,c,d,e,f)=>{let{userId:g,encryptedAccessToken:h}=(0,T.Q_)(b);return{accessToken:(0,T.Wc)(h,d),userId:g,systemId:f?.systemId||a.systemId}},postExchange:async a=>{let b={accessToken:a.accessToken,providerSpecificData:{userId:a.userId,systemId:a.systemId}},c=null;try{c=await (0,T.qJ)(b,{config:f.RY})}catch{}let d=(0,T.k9)(b,c);return{userInfo:c,organizationId:d,email:c?.email||null,name:c?.name||c?.display_name||null}},mapTokens:(a,b)=>({accessToken:a.accessToken,refreshToken:null,expiresIn:null,email:b?.email||void 0,displayName:b?.name||void 0,providerSpecificData:{authMethod:"oauth",userId:a.userId,systemId:a.systemId,organizationId:b?.organizationId||""}})},glm:{config:f._0,flowType:"device_code",requestDeviceCode:async a=>{let b=j().randomBytes(32).toString("hex"),c=await fetch(a.cliInitUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({provider:a.providerId||"zai"})});if(!c.ok){let a=await c.text();throw Error(`ZCode OAuth init failed: ${a}`)}let d=await c.json();if(!Y(d.code)||!d.data)throw Error(d.msg||"ZCode OAuth init returned no data");let e=d.data;if(!e.flow_id||!e.authorize_url)throw Error("ZCode OAuth init response missing flow_id/authorize_url");return{device_code:e.flow_id,verification_uri:e.authorize_url,expires_in:function(a){let b=Number(a);if(!Number.isFinite(b)||b<=0)return null;let c=Math.floor(((b>1e12?b:1e3*b)-Date.now())/1e3);return c>0?c:null}(e.expires_at)??300,interval:e.poll_interval_sec||3,_zcodePollToken:b}},pollToken:async(a,b,c,d)=>{let e=d?._zcodePollToken;if(!e)return{ok:!0,data:{error:"access_denied",error_description:"Missing ZCode poll token — restart the login flow"}};let f=await fetch(`${a.cliPollUrl}/${encodeURIComponent(b)}`,{headers:{Authorization:`Bearer ${e}`}});if(!f.ok)return{ok:!0,data:{error:"access_denied",error_description:`ZCode poll failed (HTTP ${f.status})`}};let g=await f.json();if(!Y(g.code))return{ok:!0,data:{error:"access_denied",error_description:g.msg||"ZCode poll failed"}};let h=g.data||{};if("pending"===h.status)return{ok:!0,data:{error:"authorization_pending"}};if("failed"===h.status)return{ok:!0,data:{error:"access_denied",error_description:"ZCode authorization failed or was cancelled"}};if("ready"!==h.status)return{ok:!0,data:{error:"authorization_pending",error_description:`Unknown status: ${h.status}`}};let i=h[a.providerId]||h[h.providerId]||{},j=i.access_token||i.accessToken||h.accessToken||h.access_token;if(!j)return{ok:!0,data:{error:"access_denied",error_description:"ZCode poll response missing access token"}};let{planApiKey:k,businessToken:l}=await U(a,j);return{ok:!0,data:{access_token:k,_zcodeJwtToken:h.token||"",_zaiBusinessToken:l,_zaiRefreshToken:i.refresh_token||i.refreshToken||h.refresh_token||h.refreshToken||"",_zcodeUser:h.user||{}}}},mapTokens:a=>{let b=a._zcodeUser||{},c=b.name||b.email||null;return{accessToken:a.access_token,refreshToken:null,email:b.email||null,...c?{displayName:c}:{},providerSpecificData:{authMethod:"cli_poll",username:b.name||void 0,userId:b.user_id||void 0,zcodeJwtToken:a._zcodeJwtToken||void 0,zaiBusinessToken:a._zaiBusinessToken||void 0,...a._zaiRefreshToken?{zaiRefreshToken:a._zaiRefreshToken}:{}}}}}};function $(a){let b=Z["kimi-coding"===a?"kimi":a];if(!b)throw Error(`Unknown provider: ${a}`);return b}async function _(a,b,c){let e=$(a),f=e.prepareConfig?await e.prepareConfig(e.config,c||{}):e.config,{codeVerifier:g,codeChallenge:h,state:i}=(0,d.lz)(e.pkceVerifierBytes),j=f.loginTraceID||i,k=f.privateKeyVerifier||g;return{authUrl:"device_code"===e.flowType?null:"authorization_code_pkce"===e.flowType?e.buildAuthUrl(f,b,j,h,c||{}):e.buildAuthUrl(f,b,j,void 0,c||{}),state:j,codeVerifier:k,codeChallenge:h,redirectUri:b,flowType:e.flowType,fixedPort:e.fixedPort,callbackPath:e.callbackPath||"/callback",...f.systemId?{systemId:f.systemId}:{}}}async function aa(a,b,c,d,e,f){let g=$(a),h=g.prepareConfig?await g.prepareConfig(g.config,f||{}):g.config,i=await g.exchangeToken(h,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(i)),g.mapTokens(i,j)}async function ab(a,b,c){let d=$(a);if("device_code"!==d.flowType)throw Error(`Provider ${a} does not support device code flow`);return await d.requestDeviceCode(d.config,b,c||{})}async function ac(a,b,c,d){let f=$(a);if("device_code"!==f.flowType)throw Error(`Provider ${a} does not support device code flow`);let g=await f.pollToken(f.config,b,c,d);if(g.ok)if(g.data.access_token){let b=null;if(f.postExchange)try{b=await f.postExchange(g.data)}catch(b){return console.warn(`[oauth] ${a} postExchange failed:`,b?.message||b),{success:!1,error:"exchange_failed",errorDescription:b.message,fatal:!0}}let c=f.mapTokens(g.data,b);if("kiro"===a&&!c.providerSpecificData?.profileArn){let a=await (0,e.gR)(c.accessToken);a&&(c.providerSpecificData.profileArn=a)}return{success:!0,tokens:c}}else if("authorization_pending"===g.data.error||"slow_down"===g.data.error)return{success:!1,error:g.data.error,errorDescription:g.data.error_description||g.data.message,pending:"authorization_pending"===g.data.error};else return{success:!1,error:g.data.error||"no_access_token",errorDescription:g.data.error_description||g.data.message||"No access token received"};return{success:!1,error:g.data.error,errorDescription:g.data.error_description}}let ad=!1;async function ae(){if(!ad){ad=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await c.e(9718).then(c.bind(c,89718));for(let c of(await a()).filter(a=>{if("codex"!==a.provider||"oauth"!==a.authType||!a.idToken)return!1;let b=!!a.email,c=!!a.providerSpecificData?.chatgptAccountId;return!b||!c})){let a=(0,e.YR)(c.idToken);if(!a.email&&!a.chatgptAccountId)continue;let d={};!c.email&&a.email&&(d.email=a.email),(a.chatgptAccountId||a.chatgptPlanType)&&(d.providerSpecificData={...c.providerSpecificData||{},chatgptAccountId:a.chatgptAccountId,chatgptPlanType:a.chatgptPlanType}),Object.keys(d).length&&await b(c.id,d)}}catch(a){ad=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}},47370:(a,b,c)=>{c.d(b,{BY:()=>d.BY,E5:()=>d.E5,QB:()=>d.QB,SL:()=>d.SL,Zx:()=>d.Zx,_V:()=>d._V,j$:()=>d.j$,ox:()=>d.ox,rg:()=>d.rg,sZ:()=>d.sZ,uw:()=>d.uw,wV:()=>d.wV});var d=c(53267)},53129:(a,b,c)=>{function d(a,b){let c,d=String(a||"").trim();if(!d)throw Error(`xai discovery ${b} is empty`);try{c=new URL(d)}catch(a){throw Error(`xai discovery ${b} is invalid: ${a.message}`)}if("https:"!==c.protocol)throw Error(`xai discovery ${b} must use https: ${d}`);let e=c.hostname.toLowerCase().trim();if("x.ai"!==e&&!e.endsWith(".x.ai"))throw Error(`xai discovery ${b} host ${e} is not on x.ai`);return d}function e(a){if(!a||"string"!=typeof a)return;let b=a.split(".");if(3===b.length)try{let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),c=(4-a.length%4)%4,d=Buffer.from(a+"=".repeat(c),"base64").toString("utf8"),e=JSON.parse(d);return e.email||e.preferred_username||e.sub||void 0}catch{return}}function f(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4,e=c+"=".repeat(d);return JSON.parse(Buffer.from(e,"base64").toString("utf8"))}catch{return null}}function g(a){let b=f(a);if(b)return b.email||b.preferred_username||b.sub||void 0}async function h(a){if(!a)return null;try{let b=await fetch("https://codewhisperer.us-east-1.amazonaws.com/ListAvailableProfiles",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({maxResults:10})});if(!b.ok)return null;let c=await b.json();return c.profiles?.find(a=>a.arn?.trim())?.arn?.trim()||null}catch{return null}}function i(a){let b=f(a);if(!b)return{};let c=b["https://api.openai.com/auth"]||{};return{email:b.email,chatgptAccountId:c.chatgpt_account_id||b.account_id,chatgptPlanType:c.chatgpt_plan_type||b.plan_type}}c.d(b,{J_:()=>g,YR:()=>i,gR:()=>h,js:()=>d,pG:()=>e})},73159:(a,b,c)=>{c.d(b,{Ue:()=>k,oT:()=>l});var d=c(39141);let e=d.xq.xai?.clientId,f="https://auth.x.ai",g="/oauth2/authorize",h="/oauth2/token",i="/.well-known/openid-configuration",j="/callback",k=96,l={clientId:e,issuer:f,authEndpointPath:g,tokenEndpointPath:h,discoveryPath:i,authorizeUrl:`${f}${g}`,tokenUrl:`${f}${h}`,discoveryUrl:`${f}${i}`,scope:"openid profile email offline_access grok-cli:access api:access",apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${j}`,loopbackPort:56121,callbackPath:j,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/9router",codeChallengeMethod:"S256"}}};
|
|
1
|
+
"use strict";exports.id=6420,exports.ids=[6420],exports.modules={13808:(a,b,c)=>{c.d(b,{$N:()=>f,OK:()=>g,Zl:()=>h,lz:()=>i});var d=c(55511),e=c.n(d);function f(a=32){return e().randomBytes(a).toString("base64url")}function g(a){return e().createHash("sha256").update(a).digest("base64url")}function h(){return e().randomBytes(32).toString("base64url")}function i(a=32){let b=f(a),c=g(b);return{codeVerifier:b,codeChallenge:c,state:h()}}},36187:(a,b,c)=>{c.d(b,{PY:()=>ae,exchangeTokens:()=>aa,extractCodexAccountInfo:()=>e.YR,fetchKiroProfileArn:()=>e.gR,kP:()=>_,sO:()=>$,Su:()=>ac,Re:()=>ab}),c(30369);var d=c(13808),e=c(53129),f=c(92990);let g={config:f.OV,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d)=>{let e=new URLSearchParams({code:"true",client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c});return`${a.authorizeUrl}?${e.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=b,g="";if(f.includes("#")){let a=f.split("#");f=a[0],g=a[1]||""}let h=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({code:f,state:g||e,grant_type:"authorization_code",client_id:a.clientId,redirect_uri:c,code_verifier:d})});if(!h.ok){let a=await h.text();throw Error(`Token exchange failed: ${a}`)}return await h.json()},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope})},h={config:f.DI,flowType:"authorization_code_pkce",fixedPort:f.DI.fixedPort,callbackPath:f.DI.callbackPath,buildAuthUrl:(a,b,c,d)=>{let e=Object.entries({response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,...a.extraParams,state:c}).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${e}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b=(0,e.YR)(a.id_token),c={accessToken:a.access_token,refreshToken:a.refresh_token,idToken:a.id_token,expiresIn:a.expires_in,lastRefreshAt:new Date().toISOString()},d=b.email||(0,e.J_)(a.access_token);return d&&(c.email=d),(b.chatgptAccountId||b.chatgptPlanType)&&(c.providerSpecificData={chatgptAccountId:b.chatgptAccountId,chatgptPlanType:b.chatgptPlanType}),c}};var i=c(55511),j=c.n(i),k=c(73159);let l=null;async function m(){if(l)return l;try{let a=await fetch(k.oT.discoveryUrl,{headers:{Accept:"application/json"}});if(a.ok){let b=await a.json();return l={authorizeUrl:(0,e.js)(b.authorization_endpoint,"authorization_endpoint"),tokenUrl:(0,e.js)(b.token_endpoint,"token_endpoint")}}}catch{}return l={authorizeUrl:k.oT.authorizeUrl,tokenUrl:k.oT.tokenUrl}}let n={config:k.oT,flowType:"authorization_code_pkce",fixedPort:k.oT.loopbackPort,callbackPath:k.oT.callbackPath,pkceVerifierBytes:k.Ue,prepareConfig:async a=>{let b=await m();return{...a,authorizeUrl:b.authorizeUrl,tokenUrl:b.tokenUrl}},buildAuthUrl:(a,b,c,d)=>{let e=j().randomBytes(16).toString("hex"),f=Object.entries({response_type:"code",client_id:a.clientId,redirect_uri:b,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod,state:c,nonce:e,plan:"generic",referrer:"cli-proxy-api"}).map(([a,b])=>`${a}=${encodeURIComponent(b)}`).join("&");return`${a.authorizeUrl}?${f}`},exchangeToken:async(a,b,c,d)=>{let e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,code:b,redirect_uri:c,code_verifier:d})});if(!e.ok){let a=await e.text();throw Error(`xAI token exchange failed: ${a}`)}return await e.json()},mapTokens:a=>{let b={accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope},c=(0,e.pG)(a.id_token);return c&&(b.email=c),a.id_token&&(b.providerSpecificData={idToken:a.id_token}),b}};var o=c(13247);let p={config:f.qp,flowType:"device_code",requestDeviceCode:async a=>{let b=new URLSearchParams({client_id:a.clientId,scope:a.scope});a.referrer&&b.set("referrer",a.referrer);let c=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":o.hY},body:b});if(!c.ok){let a=await c.text();throw Error(`Grok CLI device code request failed: ${a}`)}return await c.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","User-Agent":o.hY},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId})});try{c=await d.json()}catch{c={error:"invalid_response",error_description:await d.text()}}let e=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:d.ok||e,data:c}},postExchange:async a=>{try{let b=await fetch("https://cli-chat-proxy.grok.com/v1/user",{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","User-Agent":o.hY,"x-xai-token-auth":"xai-grok-cli","x-grok-client-version":o.uG}});if(b.ok)return{user:await b.json()}}catch{}return{user:null}},mapTokens:(a,b)=>{let c=(0,e.pG)(a.id_token)||(0,e.J_)(a.access_token)||b?.user?.email||null,d=b?.user?.userId||b?.user?.principalId||null,f=[b?.user?.firstName,b?.user?.lastName].filter(Boolean).join(" ").trim()||null,g=a.expires_in?new Date(Date.now()+1e3*a.expires_in).toISOString():null;return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,expiresAt:g,scope:a.scope,email:c||void 0,displayName:f||void 0,providerSpecificData:{authMethod:"device_code",idToken:a.id_token||null,email:c||null,userId:d,hasGrokCodeAccess:b?.user?.hasGrokCodeAccess??null,subscriptionTier:b?.user?.subscriptionTier??null}}}},q="1.0.0",r={config:f.sA,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-api-version":q},body:new URLSearchParams({client_id:a.clientId})});if(!b.ok){let a=await b.text();throw Error(`Muse Code device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json","x-api-version":q},body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:b,client_id:a.clientId})});try{c=await d.json()}catch{c={error:"invalid_response",error_description:await d.text()}}let e=c?.error==="authorization_pending"||c?.error==="slow_down";return{ok:d.ok||e,data:c}},postExchange:async a=>{let b,c;for(let c=0;(429===(b=await fetch("https://api.meta.ai/muse-code/key",{method:"POST",headers:{Accept:"application/json",Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","x-api-version":q},body:JSON.stringify({onboard:!0}),redirect:"error"})).status||b.status>=500)&&!(c>=2);c++)await new Promise(a=>setTimeout(a,5e3*(c+1)));let d=await b.text();if(!b.ok){let a=`${b.status} ${d.slice(0,200)}`;try{let b=JSON.parse(d);(b?.title||b?.detail)&&(a=[b.title,b.detail].filter(Boolean).join(": "),b.action_url&&(a+=` — ${b.action_url}`))}catch{}throw Error(`Muse Code key mint failed: ${a}`)}try{c=JSON.parse(d)}catch{throw Error("Muse Code key mint returned invalid JSON")}if(!1===c.is_subs_active)throw Error("Muse Code subscription is inactive — activate it on muse.ai first");let e=c.action_url||c.require_payment_action_url;if(!c.api_key&&(c.require_payment||e))throw Error(`Muse Code subscription required${e?`: ${e}`:""}`);if(!c.api_key)throw Error("Muse Code key response is missing api_key");return{key:c}},mapTokens:(a,b)=>{let c=b?.key||{};return{accessToken:c.api_key,refreshToken:null,expiresIn:null,email:c.user_email?.trim().toLowerCase()||void 0,providerSpecificData:{authMethod:"device_code",oauthAccessToken:a.access_token,subscriptionTier:c.subs_tier_name||null}}}},s={config:f.LT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b=await fetch(`${f.LT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`}}),c=b.ok?await b.json():{},d="";try{let b=await fetch("https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({metadata:(0,f.cD)(),mode:1})});if(b.ok){let a=await b.json();d=a.cloudaicompanionProject?.id||a.cloudaicompanionProject||""}}catch(a){console.log("Failed to fetch project ID:",a)}return{userInfo:c,projectId:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},t={config:f.YT,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({client_id:a.clientId,response_type:"code",redirect_uri:b,scope:a.scopes.join(" "),state:c,access_type:"offline",prompt:"consent"});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"authorization_code",client_id:a.clientId,client_secret:a.clientSecret,code:b,redirect_uri:c}),signal:AbortSignal.timeout(1e4)});if(!d.ok){let a=await d.text();throw Error(`Token exchange failed: ${a}`)}return await d.json()},postExchange:async a=>{let b={Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json","User-Agent":f.YT.loadCodeAssistUserAgent,"x-request-source":"local"},c=(0,f.cD)(),d={};try{let b=await fetch(`${f.YT.userInfoUrl}?alt=json`,{headers:{Authorization:`Bearer ${a.access_token}`,"x-request-source":"local"},signal:AbortSignal.timeout(5e3)});b.ok&&(d=await b.json())}catch(a){console.log("Failed to fetch user info:",a)}let e="",g="legacy-tier";try{let a=await fetch(f.YT.loadCodeAssistEndpoint,{method:"POST",headers:b,body:JSON.stringify({metadata:c}),signal:AbortSignal.timeout(5e3)});if(a.ok){let b=await a.json();if(e=b.cloudaicompanionProject?.id||b.cloudaicompanionProject||"",Array.isArray(b.allowedTiers)){for(let a of b.allowedTiers)if(a.isDefault&&a.id){g=a.id.trim();break}}}}catch(a){console.log("Failed to load code assist:",a)}return e&&(async()=>{for(let a=0;a<10;a++){try{let a=await fetch(f.YT.onboardUserEndpoint,{method:"POST",headers:b,body:JSON.stringify({tierId:g,metadata:c})});if(a.ok){let b=await a.json();if(!0===b.done)break}}catch(a){break}await new Promise(a=>setTimeout(a,5e3))}})().catch(()=>{}),{userInfo:d,projectId:e}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,email:b?.userInfo?.email,projectId:b?.projectId})},u={config:f.ZL,flowType:"authorization_code",buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({loginMethod:a.extraParams.loginMethod,type:a.extraParams.type,redirect:b,state:c,client_id:a.clientId});return`${a.authorizeUrl}?${d.toString()}`},exchangeToken:async(a,b,c)=>{let d=Buffer.from(`${a.clientId}:${a.clientSecret}`).toString("base64"),e=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",Authorization:`Basic ${d}`},body:new URLSearchParams({grant_type:"authorization_code",code:b,redirect_uri:c,client_id:a.clientId,client_secret:a.clientSecret})});if(!e.ok){let a=await e.text();throw Error(`Token exchange failed: ${a}`)}return await e.json()},postExchange:async a=>{let b=await fetch(`${f.ZL.userInfoUrl}?accessToken=${encodeURIComponent(a.access_token)}`,{headers:{Accept:"application/json"}});if(!b.ok){let a=await b.text();throw Error(`Failed to fetch user info: ${a}`)}let c=await b.json();if(!c.success)throw Error(`User info request failed: ${c.message||"Unknown error"}`);let d=c.data||{};if(!d.apiKey||""===d.apiKey.trim())throw Error("Empty API key returned from iFlow");if(!(d.email?.trim()||d.phone?.trim()))throw Error("Missing account email/phone in user info");return{userInfo:d}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,apiKey:b?.userInfo?.apiKey,email:b?.userInfo?.email||b?.userInfo?.phone,displayName:b?.userInfo?.nickname||b?.userInfo?.name})};function v(a){return{config:a,flowType:"device_code",requestDeviceCode:async a=>{let{QoderService:b}=await c.e(3912).then(c.bind(c,91531)),d=await new b(a).initiateDeviceFlow();return{device_code:d.nonce,user_code:d.nonce.slice(0,8).toUpperCase(),verification_uri:a.loginUrl,verification_uri_complete:d.verificationUriComplete,expires_in:300,interval:2,codeVerifier:d.codeVerifier,_qoderNonce:d.nonce,_qoderMachineId:d.machineId,_qoderMachineToken:d.machineToken}},pollToken:async(a,b,d,e)=>{let f,{QoderService:g}=await c.e(3912).then(c.bind(c,91531)),h=new g(a),i=b||e?._qoderNonce,j=d||e?._qoderVerifier;if(!i||!j)return{ok:!1,data:{error:"invalid_request",error_description:"Missing nonce/verifier"}};try{f=await h.pollDeviceToken({nonce:i,codeVerifier:j})}catch(a){return{ok:!1,data:{error:"poll_failed",error_description:a.message}}}if("pending"===f.status)return{ok:!1,data:{error:"authorization_pending"}};let k=await h.fetchUserInfo(f.accessToken),l=Math.max(86400,Math.floor((f.expireTime-Date.now())/1e3));return{ok:!0,data:{access_token:f.accessToken,refresh_token:f.refreshToken,expires_in:l,_qoderUserId:f.userId,_qoderMachineId:e?._qoderMachineId||"",_qoderMachineToken:e?._qoderMachineToken||e?._qoderMachineId||"",_qoderName:k.name,_qoderEmail:k.email,_qoderOrganizationId:k.organizationId}}},mapTokens:a=>{let b=(a._qoderEmail||"").trim(),c=(a._qoderName||"").trim()||null,d=a._qoderUserId||"",e=b||(d?`qoder-user-${d}`:null);return{accessToken:a.access_token,refreshToken:a.refresh_token||null,expiresIn:a.expires_in,email:e,displayName:c,providerSpecificData:{authMethod:"device",userId:d,machineId:a._qoderMachineId||"",machineToken:a._qoderMachineToken||a._qoderMachineId||"",organizationId:a._qoderOrganizationId||""}}}}}let w=v(f.hF),x=v(f.t3),y={config:f.Nu,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.deviceCodeUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,scope:a.scopes})});if(!b.ok){let a=await b.text();throw Error(`Device code request failed: ${a}`)}return await b.json()},pollToken:async(a,b)=>{let c,d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({client_id:a.clientId,device_code:b,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})});try{c=await d.json()}catch(a){c={error:"invalid_response",error_description:await d.text()}}return{ok:d.ok,data:c}},postExchange:async a=>{let b=await fetch(f.Nu.copilotTokenUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":f.Nu.apiVersion,"User-Agent":f.Nu.userAgent}}),c=b.ok?await b.json():{},d=await fetch(f.Nu.userInfoUrl,{headers:{Authorization:`Bearer ${a.access_token}`,Accept:"application/json","X-GitHub-Api-Version":f.Nu.apiVersion,"User-Agent":f.Nu.userAgent}});return{copilotToken:c,userInfo:d.ok?await d.json():{}}},mapTokens:(a,b)=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,name:b?.userInfo?.login||b?.userInfo?.name,displayName:b?.userInfo?.name||b?.userInfo?.login,email:b?.userInfo?.email||null,providerSpecificData:{copilotToken:b?.copilotToken?.token,copilotTokenExpiresAt:b?.copilotToken?.expires_at,githubUserId:b?.userInfo?.id,githubLogin:b?.userInfo?.login,githubName:b?.userInfo?.name,githubEmail:b?.userInfo?.email}})},z={config:f.Tx,flowType:"device_code",requestDeviceCode:async(a,b,c={})=>{let d=("string"==typeof c.region?c.region.trim():"")||"us-east-1";(0,f.S6)(d);let e=("string"==typeof c.startUrl?c.startUrl.trim():"")||a.startUrl,g="idc"===c.authMethod?"idc":"builder-id",h=`https://oidc.${d}.amazonaws.com/client/register`,i=`https://oidc.${d}.amazonaws.com/device_authorization`,j=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientName:a.clientName,clientType:a.clientType,scopes:a.scopes,grantTypes:a.grantTypes,issuerUrl:a.issuerUrl})});if(!j.ok){let a=await j.text();throw Error(`Client registration failed: ${a}`)}let k=await j.json(),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:k.clientId,clientSecret:k.clientSecret,startUrl:e})});if(!l.ok){let a=await l.text();throw Error(`Device authorization failed: ${a}`)}let m=await l.json();return{device_code:m.deviceCode,user_code:m.userCode,verification_uri:m.verificationUri,verification_uri_complete:m.verificationUriComplete,expires_in:m.expiresIn,interval:m.interval||5,_clientId:k.clientId,_clientSecret:k.clientSecret,_region:d,_authMethod:g,_startUrl:e}},pollToken:async(a,b,c,d)=>{let e,g=d?._region||"us-east-1";(0,f.S6)(g);let h=`https://oidc.${g}.amazonaws.com/token`,i=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({clientId:d?._clientId,clientSecret:d?._clientSecret,deviceCode:b,grantType:"urn:ietf:params:oauth:grant-type:device_code"})});try{e=await i.json()}catch(a){e={error:"invalid_response",error_description:await i.text()}}return e.accessToken?{ok:!0,data:{access_token:e.accessToken,refresh_token:e.refreshToken,expires_in:e.expiresIn,profile_arn:e?.profileArn||null,_clientId:d?._clientId,_clientSecret:d?._clientSecret,_region:d?._region,_authMethod:d?._authMethod,_startUrl:d?._startUrl}}:{ok:!1,data:{error:e.error||"authorization_pending",error_description:e.error_description||e.message}}},mapTokens:a=>{let b=(0,e.J_)(a.access_token);return{accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,email:b,providerSpecificData:{profileArn:a?.profile_arn||null,clientId:a._clientId,clientSecret:a._clientSecret,region:a._region||"us-east-1",authMethod:a._authMethod||"builder-id",startUrl:a._startUrl||f.Tx.startUrl}}}},A={config:f.WN,flowType:"import_token",mapTokens:a=>({accessToken:a.accessToken,refreshToken:null,expiresIn:a.expiresIn||86400,providerSpecificData:{machineId:a.machineId,authMethod:"imported"}})},B={config:f.aV,flowType:"device_code",requestDeviceCode:async a=>{let{buildKimiHeaders:b}=await Promise.resolve().then(c.bind(c,28730)),d=j().randomUUID(),e={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...b(d)},f=await fetch(a.deviceCodeUrl,{method:"POST",headers:e,body:new URLSearchParams({client_id:a.clientId})});if(!f.ok){let a=await f.text();throw Error(`Device code request failed: ${a}`)}let g=await f.json(),h=a.authorizeDeviceUrl||"https://www.kimi.com/code/authorize_device";return{device_code:g.device_code,user_code:g.user_code,verification_uri:g.verification_uri||h,verification_uri_complete:g.verification_uri_complete||`${h}?user_code=${g.user_code}`,expires_in:g.expires_in,interval:g.interval||5,_kimiDeviceId:d}},pollToken:async(a,b,d,e)=>{let f,{buildKimiHeaders:g}=await Promise.resolve().then(c.bind(c,28730)),h=e?._kimiDeviceId,i={"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json",...g(h)},j=await fetch(a.tokenUrl,{method:"POST",headers:i,body:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:a.clientId,device_code:b})});try{f=await j.json()}catch{f={error:"invalid_response",error_description:"non-json token response"}}return"authorization_pending"===f.error||"slow_down"===f.error?{ok:!0,data:f}:(f.access_token&&h&&(f._kimiDeviceId=h),{ok:j.ok||!!f.access_token||!!f.error,data:f})},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,providerSpecificData:{authMethod:"device_code",...a._kimiDeviceId?{deviceId:a._kimiDeviceId}:{}}})},C={config:f.MZ,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(a.initiateUrl,{method:"POST",headers:{"Content-Type":"application/json"}});if(!b.ok){if(429===b.status)throw Error("Too many pending authorization requests. Please try again later.");let a=await b.text();throw Error(`Device auth initiation failed: ${a}`)}let c=await b.json();return{device_code:c.code,user_code:c.code,verification_uri:c.verificationUrl,verification_uri_complete:c.verificationUrl,expires_in:c.expiresIn||300,interval:3}},pollToken:async(a,b)=>{let c=await fetch(`${a.pollUrlBase}/${b}`);if(202===c.status)return{ok:!1,data:{error:"authorization_pending"}};if(403===c.status)return{ok:!1,data:{error:"access_denied",error_description:"Authorization denied by user"}};if(410===c.status)return{ok:!1,data:{error:"expired_token",error_description:"Authorization code expired"}};if(!c.ok)return{ok:!1,data:{error:"poll_failed",error_description:`Poll failed: ${c.status}`}};let d=await c.json();if("approved"===d.status&&d.token){let b=null;try{let c=await fetch(`${a.apiBaseUrl}/api/profile`,{headers:{Authorization:`Bearer ${d.token}`}});if(c.ok){let a=await c.json();b=a.organizations?.[0]?.id||null}}catch{}return{ok:!0,data:{access_token:d.token,_userEmail:d.userEmail,_orgId:b}}}return{ok:!1,data:{error:"authorization_pending"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:null,expiresIn:null,email:a._userEmail,...a._orgId?{providerSpecificData:{orgId:a._orgId}}:{}})},D={config:f.lB,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`Cline token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},E={config:f.w1,flowType:"authorization_code",buildAuthUrl:(a,b)=>{let c=new URLSearchParams({client_type:"extension",callback_url:b,redirect_uri:b});return`${a.authorizeUrl}?${c.toString()}`},exchangeToken:async(a,b,c)=>{try{let a=b,c=4-a.length%4;4!==c&&(a+="=".repeat(c));let d=Buffer.from(a,"base64").toString("utf-8"),e=d.lastIndexOf("}");if(-1===e)throw Error("No JSON found in decoded code");let f=JSON.parse(d.substring(0,e+1));return{access_token:f.accessToken,refresh_token:f.refreshToken,email:f.email,firstName:f.firstName,lastName:f.lastName,expires_at:f.expiresAt}}catch(f){let d=await fetch(a.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:b,client_type:"extension",redirect_uri:c})});if(!d.ok){let a=await d.text();throw Error(`ClinePass token exchange failed: ${a}`)}let e=await d.json();return{access_token:e.data?.accessToken||e.accessToken,refresh_token:e.data?.refreshToken||e.refreshToken,email:e.data?.userInfo?.email||"",expires_at:e.data?.expiresAt||e.expiresAt}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_at?Math.floor((new Date(a.expires_at).getTime()-Date.now())/1e3):3600,email:a.email,providerSpecificData:{firstName:a.firstName,lastName:a.lastName}})},F={config:f.f7,flowType:"authorization_code_pkce",buildAuthUrl:(a,b,c,d,e={})=>{let f=e.baseUrl||a.defaultBaseUrl,g=new URLSearchParams({client_id:e.clientId||"",redirect_uri:b,response_type:"code",state:c,scope:a.scope,code_challenge:d,code_challenge_method:a.codeChallengeMethod});return`${f}${a.authorizeUrlPath}?${g.toString()}`},exchangeToken:async(a,b,c,d,e,f={})=>{let g=f.baseUrl||a.defaultBaseUrl,h=f.clientId||"",i=f.clientSecret||"",j=new URLSearchParams({client_id:h,grant_type:"authorization_code",code:b,redirect_uri:c,code_verifier:d});i&&j.set("client_secret",i);let k=await fetch(`${g}${a.tokenUrlPath}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:j.toString()});if(!k.ok)throw Error(`GitLab token exchange failed: ${await k.text()}`);let l=await k.json(),m=await fetch(`${g}${a.userInfoUrlPath}`,{headers:{Authorization:`Bearer ${l.access_token}`}}),n=m.ok?await m.json():{};return{...l,_user:n,_baseUrl:g,_clientId:h}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in,scope:a.scope,providerSpecificData:{username:a._user?.username||"",email:a._user?.email||a._user?.public_email||"",name:a._user?.name||"",baseUrl:a._baseUrl,clientId:a._clientId,authKind:"oauth"}})},G={config:f.Nl,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(`${a.tokenUrl}?state=${encodeURIComponent(b)}`,{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"copilot.tencent.com","X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer",expires_in:d.data.expiresIn}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||86400,providerSpecificData:{}})},H={config:f.DV,flowType:"device_code",requestDeviceCode:async a=>{let b=await fetch(`${a.stateUrl}?platform=${a.platform}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-No-Authorization":"true","X-No-User-Id":"true","X-Product":"SaaS"},body:"{}"});if(!b.ok)throw Error(`CodeBuddy Intl state request failed: ${await b.text()}`);let c=await b.json();if(0!==c.code||!c.data?.state||!c.data?.authUrl)throw Error(`CodeBuddy Intl state error: ${c.msg||"missing state/authUrl"}`);return{device_code:c.data.state,verification_uri:c.data.authUrl,user_code:"",interval:a.pollInterval/1e3,_isCodeBuddy:!0}},pollToken:async(a,b)=>{let c=await fetch(`${a.tokenUrl}?state=${encodeURIComponent(b)}`,{method:"GET",headers:{Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":"www.codebuddy.ai","X-No-Authorization":"true","X-No-User-Id":"true","X-No-Enterprise-Id":"true","X-No-Department-Info":"true","X-Product":"SaaS"}});if(!c.ok)return{ok:!1,data:{error:"request_failed"}};let d=await c.json();return 0===d.code&&d.data?.accessToken?{ok:!0,data:{access_token:d.data.accessToken,refresh_token:d.data.refreshToken||"",token_type:d.data.tokenType||"Bearer",expires_in:d.data.expiresIn}}:11217===d.code?{ok:!0,data:{error:"authorization_pending"}}:{ok:!1,data:{error:d.msg||"unknown_error"}}},mapTokens:a=>({accessToken:a.access_token,refreshToken:a.refresh_token,expiresIn:a.expires_in||86400,providerSpecificData:{}})},I={config:f.Td,flowType:"browser_token",buildAuthUrl:(a,b,c)=>{let d=(a.webAppUrl||"https://app.kimchi.dev").replace(/\/+$/,""),e=new URLSearchParams({callback:b,state:c});return`${d}/cli-auth?${e.toString()}`},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!c)throw Error("Missing Kimchi token");let d=a.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",e=await fetch(d,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`}});if(!e.ok)throw Error(`Kimchi token validation failed: ${e.status}`);let f={};if(a.userInfoUrl)try{let b=await fetch(a.userInfoUrl,{method:"GET",headers:{Accept:"application/json",Authorization:`Bearer ${c}`}});b.ok&&(f=await b.json())}catch{f={}}return{access_token:c,token_type:"Bearer",_kimchiUser:f}},mapTokens:a=>{let b=a._kimchiUser||{},c=b.id?String(b.id):"",d=b.username||"",e=b.email||(c?`kimchi-user-${c}`:null);return{accessToken:a.access_token,refreshToken:null,email:e,displayName:b.name||d||null,providerSpecificData:{authMethod:"browser_token",userId:c,username:d}}}};function J(a,b){for(let c of b){let b=a;for(let a of c){if(null==b||"object"!=typeof b){b=void 0;break}b=b[a]}if("string"==typeof b&&b.trim())return b.trim();if("number"==typeof b)return String(b)}return null}async function K(a){let b=JSON.stringify({loginTraceID:a,login_trace_id:a}),c="no successful response";for(let a of f.SK.loginGuidanceUrls)try{let d=await fetch(a,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent},body:b});if(!d.ok){c=`${a} HTTP ${d.status}`;continue}let e=await d.json(),g=J(e,[["Result","LoginHost"],["Result","loginHost"],["Result","LoginURL"],["result","loginHost"],["data","Result","LoginHost"],["data","loginHost"],["LoginHost"],["loginHost"]]);if(g)return g;c=`${a} missing LoginHost`}catch(b){c=`${a} ${b.message}`}throw Error(`Trae GetLoginGuidance failed: ${c}`)}function L(){return[...f.SK.apiOrigins]}async function M(a,b){let c=JSON.stringify({ClientID:f.SK.clientId,RefreshToken:a,ClientSecret:f.SK.clientSecret,UserID:""}),d="no successful response";for(let e of L()){let g=`${e.replace(/\/$/,"")}${f.SK.exchangeTokenPath}`;try{let e,h={Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent};b&&(h["x-cloudide-token"]=b);let i=await fetch(g,{method:"POST",headers:h,body:c}),j=await i.text();if(!i.ok){d=`${g} HTTP ${i.status}`;continue}try{e=JSON.parse(j)}catch{d=`${g} invalid JSON`;continue}let k=J(e,[["Result","AccessToken"],["Result","accessToken"],["result","access_token"],["accessToken"]]);if(!k){let a=J(e,[["message"],["msg"],["error"],["Result","Message"]])||"missing AccessToken";d=`${g} ${a}`;continue}return{accessToken:k,refreshToken:J(e,[["Result","RefreshToken"],["result","refresh_token"],["refreshToken"]])||a,expiresIn:null,expiresAt:J(e,[["Result","ExpiresAt"],["Result","expiresAt"],["result","expires_at"],["expiresAt"]])}}catch(a){d=`${g} ${a.message}`}}throw Error(`Trae ExchangeToken failed: ${d}`)}async function N(a){for(let b of L()){let c=`${b.replace(/\/$/,"")}${f.SK.getUserInfoPath}`;try{let b=await fetch(c,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.SK.userAgent,"x-cloudide-token":a},body:JSON.stringify({})});if(!b.ok)continue;let d=await b.json();return{email:J(d,[["Result","NonPlainTextEmail"],["Result","Email"],["Result","email"],["email"],["data","email"]]),name:J(d,[["Result","ScreenName"],["Result","Nickname"],["Result","Name"],["result","nickname"],["nickname"],["name"]]),aiRegion:J(d,[["Result","AIRegion"],["Result","aiRegion"],["aiRegion"]]),region:J(d,[["Result","Region"],["Result","region"],["region"]]),tenant:J(d,[["Result","TenantID"],["Result","tenantId"],["tenantId"]]),userId:J(d,[["Result","UserID"],["Result","userId"],["userId"]])}}catch{}}return{email:null,name:null}}let O={config:f.SK,flowType:"authorization_code",callbackPath:f.SK.callbackPath,prepareConfig:async a=>{let b=j().randomUUID(),c=await K(b);return{...a,loginTraceID:b,loginHost:c}},buildAuthUrl:(a,b,c)=>{var d;let e,g,h={plugin_version:f.SK.defaultPluginVersion,machine_id:j().randomUUID(),device_id:f.SK.defaultDeviceId,x_device_brand:"unknown",x_device_type:"unknown",x_os_version:"unknown",x_env:"",x_app_version:f.SK.defaultAppVersion,x_app_type:f.SK.defaultAppType},i=a.loginTraceID||c;return d=a.loginHost,(e=new URL(d.startsWith("http")?d:`https://${d.replace(/^\/+/,"")}`)).pathname=f.SK.authorizationPath,(g=new URLSearchParams).set("login_version","1"),g.set("auth_from","trae"),g.set("login_channel","native_ide"),g.set("plugin_version",h.plugin_version),g.set("auth_type","local"),g.set("client_id",f.SK.clientId),g.set("redirect","0"),g.set("login_trace_id",i),g.set("auth_callback_url",b),g.set("machine_id",h.machine_id),g.set("device_id",h.device_id),g.set("x_device_id",h.device_id),g.set("x_machine_id",h.machine_id),g.set("x_device_brand",h.x_device_brand),g.set("x_device_type",h.x_device_type),g.set("x_os_version",h.x_os_version),g.set("x_env",h.x_env),g.set("x_app_version",h.x_app_version),g.set("x_app_type",h.x_app_type),e.search=g.toString(),e.toString()},exchangeToken:async(a,b)=>{let c=String(b||"").trim();if(!(/[?=&]/.test(c)&&(c.includes("refreshToken")||c.includes("refresh_token"))))return{accessToken:c.replace(/^(Cloud-IDE-JWT|Bearer)\s+/i,""),refreshToken:null,expiresIn:24*f.SK.tokenLifetimeDays*3600,_authMethod:"imported"};let{refreshToken:d,cloudideToken:e}=function(a){let b=String(a||"").trim(),c=b;b.includes("?")&&(c=b.slice(b.indexOf("?")+1)),b.startsWith("#")&&(c=b.slice(1));let d=Object.fromEntries(new URLSearchParams(c)),e=a=>{for(let b of a){let a=d[b];if(a&&String(a).trim())return String(a).trim()}return null},f=e(["error","error_code","errorCode"]);if(f){let a=e(["error_description","error_desc","message"]);throw Error(a?`Trae auth failed: ${f} (${a})`:`Trae auth failed: ${f}`)}let g=e(["refreshToken","refresh_token","RefreshToken"]);if(!g)throw Error("Trae callback missing refreshToken");let h=e(["loginHost","login_host","LoginHost","host","consoleHost"]);if(!h)throw Error("Trae callback missing loginHost");return{refreshToken:g,loginHost:h,cloudideToken:e(["x-cloudide-token","xCloudideToken","accessToken","access_token","token"])}}(c);return{...await M(d,e),_authMethod:"oauth"}},postExchange:async a=>({userInfo:await N(a.accessToken)}),mapTokens:(a,b)=>{let c,d=a.expiresIn||(a.expiresAt?Math.max(60,Number(a.expiresAt)-Math.floor(Date.now()/1e3)):24*f.SK.tokenLifetimeDays*3600),e=b?.userInfo||{},g=e.aiRegion||"US-East";return{accessToken:a.accessToken,refreshToken:a.refreshToken,expiresIn:d,email:e.email||void 0,displayName:e.name||void 0,providerSpecificData:{authMethod:a._authMethod||"oauth",aiRegion:g,region:e.region||g,tenant:e.tenant||"marscode",userId:e.userId||"",scope:"sg"===(c=(g||"").toLowerCase())||c.includes("singapore")?"marscode-sg":"cn"===c||c.includes("cn")||c.includes("china")?"marscode-cn":"marscode-us",webId:"",bizUserId:"",userUniqueId:"",appLanguage:"en",appVersion:f.SK.defaultAppVersion,userRegion:"SG"===g?"SG":"US",userIdentity:"Free"}}}};async function P(a,b,c){let d=`${a.replace(/\/$/,"")}${b}`,e=await fetch(d,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":f.eD.userAgent},body:JSON.stringify(c)}),g=await e.text();if(!e.ok)throw Error(`Windsurf ${b} HTTP ${e.status}: ${g.slice(0,200)}`);try{return JSON.parse(g)}catch{throw Error(`Windsurf ${b} invalid JSON`)}}async function Q(a){let b=await P(f.eD.registerApiBaseUrl,f.eD.registerPath,{firebase_id_token:a}),c=J(b,[["apiKey"],["api_key"]]);if(!c)throw Error("Windsurf RegisterUser missing apiKey");return{apiKey:c,apiServerUrl:J(b,[["apiServerUrl"],["api_server_url"]])||f.eD.defaultApiServerUrl,name:J(b,[["name"]])}}async function R(a,b){try{let c=await P(a,f.eD.oneTimeAuthPath,{firebaseIdToken:b}),d=J(c,[["authToken"],["auth_token"]]);if(!d)return{email:null,name:null};let e=await P(a,f.eD.currentUserPath,{authToken:d,includeSubscription:!0}),g=e.user||e;return{email:J(g,[["email"]]),name:J(g,[["name"]])}}catch{return{email:null,name:null}}}let S={config:f.eD,flowType:"authorization_code",callbackPath:f.eD.callbackPath,buildAuthUrl:(a,b,c)=>{let d=new URLSearchParams({response_type:"token",client_id:a.clientId,redirect_uri:b,state:c,prompt:"login",redirect_parameters_type:"query",workflow:"onboarding"});return`${a.authBaseUrl}${a.signInPath}?${d.toString()}`},exchangeToken:async(a,b,c,d,e)=>{let f=String(b||"").trim();if(!(f.includes("?")||f.includes("access_token="))){let b=f.replace(/^Bearer\s+/i,"");if(b.startsWith("sk-ws-"))return{accessToken:b,refreshToken:null,expiresIn:null,apiServerUrl:a.defaultApiServerUrl,firebaseIdToken:null,_authMethod:"imported"};let c=await Q(b);return{accessToken:c.apiKey,refreshToken:null,expiresIn:null,apiServerUrl:c.apiServerUrl,firebaseIdToken:b,_authMethod:"imported"}}let{firebaseIdToken:g}=function(a,b){let c=String(a||"").trim(),d=c;c.includes("?")&&(d=c.slice(c.indexOf("?")+1)),c.startsWith("#")&&(d=c.slice(1));let e=Object.fromEntries(new URLSearchParams(d)),f=a=>{for(let b of a){let a=e[b];if(a&&String(a).trim())return String(a).trim()}return null},g=f(["error"]);if(g){let a=f(["error_description"]);throw Error(a?`Windsurf auth failed: ${g} (${a})`:`Windsurf auth failed: ${g}`)}let h=f(["access_token","token"]);if(!h)throw Error("Windsurf callback missing access_token");let i=f(["state"]);if(b&&i&&i!==b)throw Error("Windsurf callback state mismatch");return{firebaseIdToken:h}}(f,e),h=await Q(g);return{accessToken:h.apiKey,refreshToken:null,expiresIn:null,apiServerUrl:h.apiServerUrl,firebaseIdToken:g,_authMethod:"oauth"}},postExchange:async a=>a.firebaseIdToken?{userInfo:await R(a.apiServerUrl,a.firebaseIdToken)}:{userInfo:{email:null,name:null}},mapTokens:(a,b)=>({accessToken:a.accessToken,refreshToken:null,expiresIn:null,email:b?.userInfo?.email||void 0,displayName:b?.userInfo?.name||void 0,providerSpecificData:{authMethod:a._authMethod||"oauth",apiServerUrl:a.apiServerUrl,firebaseIdToken:a.firebaseIdToken}})};var T=c(49934);async function U(a,b){let c=await V(a,b),d={Authorization:`Bearer ${c}`,"Content-Type":"application/json"},e=function(a){let b=(Array.isArray(a?.organizations)?a.organizations:[]).map(a=>({organization:a,projects:(a?.projects||[]).filter(a=>"2"!==String(a?.projectType??"").trim())})).filter(({organization:a,projects:b})=>!!(a?.organizationId&&b.length));if(!b.length)return null;let c=b.find(({organization:a})=>X(a.organizationName))||b[0],d=c.projects.find(a=>X(a?.projectName))||c.projects[0];return c.organization?.organizationId&&d?.projectId?{organizationId:c.organization.organizationId,projectId:d.projectId}:null}(await W(`${a.apiBaseUrl}/api/biz/customer/getCustomerInfo`,{headers:d},"customer info"));if(!e)throw Error("Unable to resolve Z.ai organization and project for the coding plan");let f=`${a.apiBaseUrl}/api/biz/v1/organization/${e.organizationId}/projects/${e.projectId}/api_keys`,g=await W(f,{headers:d},"api keys")||[],h=Array.isArray(g)?g.find(b=>b?.name===a.planApiKeyName):null;h||(h=await W(f,{method:"POST",headers:d,body:JSON.stringify({name:a.planApiKeyName})},"api key create"));let i=h?.apiKey?.trim();if(!i)throw Error("Z.ai api_keys response is missing apiKey");let j=await W(`${f}/copy/${encodeURIComponent(i)}`,{headers:d},"api key copy"),k=j?.secretKey?.trim();if(!k)throw Error("Z.ai api key copy response is missing secretKey");return{planApiKey:`${i}.${k}`,businessToken:c}}async function V(a,b){let c=await W(a.businessLoginUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b})},"Z.ai business login"),d=c?.access_token?.trim()||c?.accessToken?.trim();if(!d)throw Error("Z.ai business login response is missing access_token");return d}async function W(a,b,c){let d,e=await fetch(a,b),f=await e.text();if(!e.ok)throw Error(`Z.ai ${c} request failed (HTTP ${e.status}): ${f.slice(0,200)}`);try{d=JSON.parse(f)}catch{throw Error(`Z.ai ${c} response is not valid JSON`)}if(!Y(d?.code)||d?.success===!1)throw Error(d?.msg||`Z.ai ${c} returned business error ${d?.code}`);return d?.data??d??null}function X(a){let b=String(a||"").trim().toLowerCase();return b.includes("默认机构")||b.includes("默认项目")||"default"===b}function Y(a){return null==a||0===a||200===a||"0"===a||"200"===a}let Z={claude:g,codex:h,xai:n,"grok-cli":p,muse:r,"gemini-cli":s,antigravity:t,iflow:u,qoder:w,"qoder-cn":x,github:y,kiro:z,cursor:A,kimi:B,kilocode:C,cline:D,clinepass:E,gitlab:F,"codebuddy-cn":G,"codebuddy-intl":H,kimchi:I,trae:O,windsurf:S,zed:{config:f.RY,flowType:"authorization_code",callbackPath:"/",prepareConfig:async(a,b)=>{let c=Number(b?.nativeAppPort)||f.RY.defaultNativeAppPort,d=(0,T.le)(a,{nativeAppPort:c});return{...a,...d}},buildAuthUrl:(a,b,c)=>a.authUrl,exchangeToken:async(a,b,c,d,e,f)=>{let{userId:g,encryptedAccessToken:h}=(0,T.Q_)(b);return{accessToken:(0,T.Wc)(h,d),userId:g,systemId:f?.systemId||a.systemId}},postExchange:async a=>{let b={accessToken:a.accessToken,providerSpecificData:{userId:a.userId,systemId:a.systemId}},c=null;try{c=await (0,T.qJ)(b,{config:f.RY})}catch{}let d=(0,T.k9)(b,c);return{userInfo:c,organizationId:d,email:c?.email||null,name:c?.name||c?.display_name||null}},mapTokens:(a,b)=>({accessToken:a.accessToken,refreshToken:null,expiresIn:null,email:b?.email||void 0,displayName:b?.name||void 0,providerSpecificData:{authMethod:"oauth",userId:a.userId,systemId:a.systemId,organizationId:b?.organizationId||""}})},glm:{config:f._0,flowType:"device_code",requestDeviceCode:async a=>{let b=j().randomBytes(32).toString("hex"),c=await fetch(a.cliInitUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b}`},body:JSON.stringify({provider:a.providerId||"zai"})});if(!c.ok){let a=await c.text();throw Error(`ZCode OAuth init failed: ${a}`)}let d=await c.json();if(!Y(d.code)||!d.data)throw Error(d.msg||"ZCode OAuth init returned no data");let e=d.data;if(!e.flow_id||!e.authorize_url)throw Error("ZCode OAuth init response missing flow_id/authorize_url");return{device_code:e.flow_id,verification_uri:e.authorize_url,expires_in:function(a){let b=Number(a);if(!Number.isFinite(b)||b<=0)return null;let c=Math.floor(((b>1e12?b:1e3*b)-Date.now())/1e3);return c>0?c:null}(e.expires_at)??300,interval:e.poll_interval_sec||3,_zcodePollToken:b}},pollToken:async(a,b,c,d)=>{let e=d?._zcodePollToken;if(!e)return{ok:!0,data:{error:"access_denied",error_description:"Missing ZCode poll token — restart the login flow"}};let f=await fetch(`${a.cliPollUrl}/${encodeURIComponent(b)}`,{headers:{Authorization:`Bearer ${e}`}});if(!f.ok)return{ok:!0,data:{error:"access_denied",error_description:`ZCode poll failed (HTTP ${f.status})`}};let g=await f.json();if(!Y(g.code))return{ok:!0,data:{error:"access_denied",error_description:g.msg||"ZCode poll failed"}};let h=g.data||{};if("pending"===h.status)return{ok:!0,data:{error:"authorization_pending"}};if("failed"===h.status)return{ok:!0,data:{error:"access_denied",error_description:"ZCode authorization failed or was cancelled"}};if("ready"!==h.status)return{ok:!0,data:{error:"authorization_pending",error_description:`Unknown status: ${h.status}`}};let i=h[a.providerId]||h[h.providerId]||{},j=i.access_token||i.accessToken||h.accessToken||h.access_token;if(!j)return{ok:!0,data:{error:"access_denied",error_description:"ZCode poll response missing access token"}};let{planApiKey:k,businessToken:l}=await U(a,j);return{ok:!0,data:{access_token:k,_zcodeJwtToken:h.token||"",_zaiBusinessToken:l,_zaiRefreshToken:i.refresh_token||i.refreshToken||h.refresh_token||h.refreshToken||"",_zcodeUser:h.user||{}}}},mapTokens:a=>{let b=a._zcodeUser||{},c=b.name||b.email||null;return{accessToken:a.access_token,refreshToken:null,email:b.email||null,...c?{displayName:c}:{},providerSpecificData:{authMethod:"cli_poll",username:b.name||void 0,userId:b.user_id||void 0,zcodeJwtToken:a._zcodeJwtToken||void 0,zaiBusinessToken:a._zaiBusinessToken||void 0,...a._zaiRefreshToken?{zaiRefreshToken:a._zaiRefreshToken}:{}}}}}};function $(a){let b=Z["kimi-coding"===a?"kimi":a];if(!b)throw Error(`Unknown provider: ${a}`);return b}async function _(a,b,c){let e=$(a),f=e.prepareConfig?await e.prepareConfig(e.config,c||{}):e.config,{codeVerifier:g,codeChallenge:h,state:i}=(0,d.lz)(e.pkceVerifierBytes),j=f.loginTraceID||i,k=f.privateKeyVerifier||g;return{authUrl:"device_code"===e.flowType?null:"authorization_code_pkce"===e.flowType?e.buildAuthUrl(f,b,j,h,c||{}):e.buildAuthUrl(f,b,j,void 0,c||{}),state:j,codeVerifier:k,codeChallenge:h,redirectUri:b,flowType:e.flowType,fixedPort:e.fixedPort,callbackPath:e.callbackPath||"/callback",...f.systemId?{systemId:f.systemId}:{}}}async function aa(a,b,c,d,e,f){let g=$(a),h=g.prepareConfig?await g.prepareConfig(g.config,f||{}):g.config,i=await g.exchangeToken(h,b,c,d,e,f||{}),j=null;return g.postExchange&&(j=await g.postExchange(i)),g.mapTokens(i,j)}async function ab(a,b,c){let d=$(a);if("device_code"!==d.flowType)throw Error(`Provider ${a} does not support device code flow`);return await d.requestDeviceCode(d.config,b,c||{})}async function ac(a,b,c,d){let f=$(a);if("device_code"!==f.flowType)throw Error(`Provider ${a} does not support device code flow`);let g=await f.pollToken(f.config,b,c,d);if(g.ok)if(g.data.access_token){let b=null;if(f.postExchange)try{b=await f.postExchange(g.data)}catch(b){return console.warn(`[oauth] ${a} postExchange failed:`,b?.message||b),{success:!1,error:"exchange_failed",errorDescription:b.message,fatal:!0}}let c=f.mapTokens(g.data,b);if("kiro"===a&&!c.providerSpecificData?.profileArn){let a=await (0,e.gR)(c.accessToken);a&&(c.providerSpecificData.profileArn=a)}return{success:!0,tokens:c}}else if("authorization_pending"===g.data.error||"slow_down"===g.data.error)return{success:!1,error:g.data.error,errorDescription:g.data.error_description||g.data.message,pending:"authorization_pending"===g.data.error};else return{success:!1,error:g.data.error||"no_access_token",errorDescription:g.data.error_description||g.data.message||"No access token received"};return{success:!1,error:g.data.error,errorDescription:g.data.error_description}}let ad=!1;async function ae(){if(!ad){ad=!0;try{let{getProviderConnections:a,updateProviderConnection:b}=await c.e(9718).then(c.bind(c,89718));for(let c of(await a()).filter(a=>{if("codex"!==a.provider||"oauth"!==a.authType||!a.idToken)return!1;let b=!!a.email,c=!!a.providerSpecificData?.chatgptAccountId;return!b||!c})){let a=(0,e.YR)(c.idToken);if(!a.email&&!a.chatgptAccountId)continue;let d={};!c.email&&a.email&&(d.email=a.email),(a.chatgptAccountId||a.chatgptPlanType)&&(d.providerSpecificData={...c.providerSpecificData||{},chatgptAccountId:a.chatgptAccountId,chatgptPlanType:a.chatgptPlanType}),Object.keys(d).length&&await b(c.id,d)}}catch(a){ad=!1,console.log("backfillCodexEmails failed:",a?.message||a)}}}},47370:(a,b,c)=>{c.d(b,{BY:()=>d.BY,E5:()=>d.E5,QB:()=>d.QB,SL:()=>d.SL,Zx:()=>d.Zx,_V:()=>d._V,j$:()=>d.j$,ox:()=>d.ox,rg:()=>d.rg,sZ:()=>d.sZ,uw:()=>d.uw,wV:()=>d.wV});var d=c(33079)},53129:(a,b,c)=>{function d(a,b){let c,d=String(a||"").trim();if(!d)throw Error(`xai discovery ${b} is empty`);try{c=new URL(d)}catch(a){throw Error(`xai discovery ${b} is invalid: ${a.message}`)}if("https:"!==c.protocol)throw Error(`xai discovery ${b} must use https: ${d}`);let e=c.hostname.toLowerCase().trim();if("x.ai"!==e&&!e.endsWith(".x.ai"))throw Error(`xai discovery ${b} host ${e} is not on x.ai`);return d}function e(a){if(!a||"string"!=typeof a)return;let b=a.split(".");if(3===b.length)try{let a=b[1].replace(/-/g,"+").replace(/_/g,"/"),c=(4-a.length%4)%4,d=Buffer.from(a+"=".repeat(c),"base64").toString("utf8"),e=JSON.parse(d);return e.email||e.preferred_username||e.sub||void 0}catch{return}}function f(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4,e=c+"=".repeat(d);return JSON.parse(Buffer.from(e,"base64").toString("utf8"))}catch{return null}}function g(a){let b=f(a);if(b)return b.email||b.preferred_username||b.sub||void 0}async function h(a){if(!a)return null;try{let b=await fetch("https://codewhisperer.us-east-1.amazonaws.com/ListAvailableProfiles",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({maxResults:10})});if(!b.ok)return null;let c=await b.json();return c.profiles?.find(a=>a.arn?.trim())?.arn?.trim()||null}catch{return null}}function i(a){let b=f(a);if(!b)return{};let c=b["https://api.openai.com/auth"]||{};return{email:b.email,chatgptAccountId:c.chatgpt_account_id||b.account_id,chatgptPlanType:c.chatgpt_plan_type||b.plan_type}}c.d(b,{J_:()=>g,YR:()=>i,gR:()=>h,js:()=>d,pG:()=>e})},73159:(a,b,c)=>{c.d(b,{Ue:()=>k,oT:()=>l});var d=c(39141);let e=d.xq.xai?.clientId,f="https://auth.x.ai",g="/oauth2/authorize",h="/oauth2/token",i="/.well-known/openid-configuration",j="/callback",k=96,l={clientId:e,issuer:f,authEndpointPath:g,tokenEndpointPath:h,discoveryPath:i,authorizeUrl:`${f}${g}`,tokenUrl:`${f}${h}`,discoveryUrl:`${f}${i}`,scope:"openid profile email offline_access grok-cli:access api:access",apiBaseUrl:"https://api.x.ai/v1",redirectUri:`http://127.0.0.1:56121${j}`,loopbackPort:56121,callbackPath:j,pkceVerifierBytes:96,refreshLeadSeconds:300,userAgent:"grok-cli/9router",codeChallengeMethod:"S256"}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";exports.id=6670,exports.ids=[6670],exports.modules={36670:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>w});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(95658),i=c(63775);let j=[{version:1,name:"initial",up(a){for(let[b,c]of Object.entries(i.CG))for(let d of(a.exec((0,i.zE)(b,c)),c.indexes||[]))a.exec(d)}},{version:2,name:"convoy-provider-scope",up(a){a.all("PRAGMA table_info(convoyRules)").some(a=>"providerIds"===a.name)||a.exec("ALTER TABLE convoyRules ADD COLUMN providerIds TEXT DEFAULT '[]'")}},{version:2,name:"api-key-policies",up(a){let b=new Set(a.all("PRAGMA table_info(apiKeys)").map(a=>a.name));for(let[c,d]of Object.entries({expiresAt:"TEXT",tokenLimit:"INTEGER",tokensUsed:"INTEGER NOT NULL DEFAULT 0",tokensReserved:"INTEGER NOT NULL DEFAULT 0",allowedModels:"TEXT"}))b.has(c)||a.exec(`ALTER TABLE apiKeys ADD COLUMN ${c} ${d}`)},version:3},{version:4,name:"combo-config",up(a){for(let b of(a.exec((0,i.zE)("combos",i.CG.combos)),a.all("PRAGMA table_info(combos)").map(a=>a.name).includes("config")||a.exec("ALTER TABLE combos ADD COLUMN config TEXT"),i.CG.combos.indexes||[]))try{a.exec(b)}catch{}}},{version:5,name:"mcp gateway",up(a){for(let b of(a.exec((0,i.zE)("mcpInstances",i.CG.mcpInstances)),i.CG.mcpInstances.indexes||[]))a.exec(b);for(let b of(a.exec((0,i.zE)("mcpGatewayKeys",i.CG.mcpGatewayKeys)),i.CG.mcpGatewayKeys.indexes||[]))a.exec(b)}},{version:6,name:"mcp grant tool allowlist",up(a){for(let b of(a.exec((0,i.zE)("mcpKeyGrants",i.CG.mcpKeyGrants)),i.CG.mcpKeyGrants.indexes||[]))a.exec(b)}},{version:7,name:"cleanup-test-connections",up(a){a.run("DELETE FROM providerConnections WHERE (provider LIKE 'openai-compatible-%' AND (name LIKE 'seed-%' OR provider LIKE 'openai-compatible-ord-%' OR provider LIKE 'openai-compatible-seq-%' OR provider LIKE 'openai-compatible-del-%' OR provider LIKE 'openai-compatible-upd-%' OR provider LIKE 'openai-compatible-clash-%' OR provider = 'openai-compatible-other')) OR provider = 'kimchi-nope' OR (email LIKE '%@example.com' AND name LIKE 'guard-%')")}}].sort((a,b)=>a.version-b.version);var k=c(62674);let l=null;function m(){if(l)return l;try{let a=g().join(process.cwd(),"package.json");l=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{l="0.0.0"}return l}let n=["requestDetails"];function o(a){(0,h.Jh)();let b=m(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function p(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(3))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var q=c(644);let r=g().join(h.HG,".migrated-from-json"),s=new WeakSet;class t extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function u(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new t(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function v(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function w(a){if(s.has(a))return;try{let b=a.get("PRAGMA quick_check(1)"),c=Object.values(b||{})[0];if(c&&"string"==typeof c&&"ok"!==c.toLowerCase())throw Error(`PRAGMA quick_check returned: ${c}`)}catch(b){let a=String(b?.message||"").toLowerCase();if(a.includes("malformed")||a.includes("corrupt")||a.includes("disk image"))throw console.error(`[DB][CRITICAL] SQLite database corruption detected on boot: ${b.message}. Refusing to start with corrupt DB to protect backups and data.`),b}s.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch(b){let a=String(b?.message||"").toLowerCase();if(a.includes("malformed")||a.includes("corrupt")||a.includes("disk image"))throw console.error(`[DB][CRITICAL] SQLite disk image is malformed: ${b.message}. Aborting to prevent data wipe.`),b;return!0}}(a);p(),a.exec((0,i.zE)("_meta",i.CG._meta));let c=parseInt((0,k.dy)(a,"backupSchemaVersion","0"),10)||0;if(!b&&c<i.f$)try{let b=o(`schema-${c}-to-${i.f$}`);!function(a,b,c="data.sqlite"){let d=g().join(b,c);try{e().rmSync(d,{force:!0})}catch{}let f=d.replace(/'/g,"''");a.exec(`ATTACH DATABASE '${f}' AS bak`);try{let b=new Set(n),c=a.all("SELECT name, sql FROM main.sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").filter(a=>!b.has(a.name));a.transaction(()=>{for(let b of c){let c=b.sql.replace(/CREATE TABLE\s+/i,"CREATE TABLE bak.");a.exec(c),a.exec(`INSERT INTO bak.${b.name} SELECT * FROM main.${b.name}`)}})}finally{try{a.exec("DETACH DATABASE bak")}catch{}}}(a,b),p(),console.log(`[DB][migrate] pre-schema backup ${c} → ${i.f$}: ${b}`)}catch(a){console.warn(`[DB][migrate] pre-schema backup failed (continuing): ${a.message}`)}!function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt((0,k.dy)(a,"schemaVersion","0"),10)||0;if(b>=(j.length?j[j.length-1].version:0))return;let c=j.filter(a=>a.version>b);for(let b of c)a.transaction(()=>{b.up(a),(0,k.np)(a,"schemaVersion",b.version)}),b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);c.length}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}(0,k.np)(a,"backupSchemaVersion",i.f$);let d=e().existsSync(r),f=v(h.Or.main),l=v(h.Or.usage),w=v(h.Or.disabled),x=v(h.Or.details);if(b&&(f||l||w||x)&&!d){let b=Date.now(),c=o("migrate-from-json");for(let a of Object.values(h.Or))!function(a,b,c=null){if(!e().existsSync(a))return;let d=c||g().basename(a),f=g().join(b,d);e().copyFileSync(a,f)}(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,q.s)(f.settings)]),u(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,q.s)(l),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),u(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,q.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),u(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,q.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),u(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),u(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,q.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,q.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,q.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,q.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,q.s)(c||{})])}if(l&&"object"==typeof l){for(let b of l.history||[]){let c=b.tokens||{};a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.apiKey||null,b.endpoint||null,c.prompt_tokens||c.input_tokens||0,c.completion_tokens||c.output_tokens||0,b.cost||0,b.status||"ok",(0,q.s)(c),(0,q.s)({})])}for(let[b,c]of Object.entries(l.dailySummary||{}))a.run("INSERT OR REPLACE INTO usageDaily(dateKey, data) VALUES(?, ?)",[b,(0,q.s)(c)]);"number"==typeof l.totalRequestsLifetime&&(0,k.np)(a,"totalRequestsLifetime",l.totalRequestsLifetime)}if(w&&"object"==typeof w.disabled)for(let[b,c]of Object.entries(w.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,q.s)(c||[])]);if(x&&Array.isArray(x.records))for(let b of x.records)a.run("INSERT OR REPLACE INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?)",[b.id,b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.status||null,(0,q.s)(b)]);(0,k.np)(a,"appVersion",m()),(0,k.np)(a,"backupSchemaVersion",i.f$),(0,k.np)(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof t)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(r,new Date().toISOString())}catch{}p(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}let y=m();(0,k.dy)(a,"appVersion",null)!==y&&(0,k.np)(a,"appVersion",y)}},62674:(a,b,c)=>{function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(36366)},63775:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=6,e=`
|
|
1
|
+
"use strict";exports.id=6670,exports.ids=[6670],exports.modules={36670:(a,b,c)=>{c.d(b,{runMigrationOnce:()=>w});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(95658),i=c(63775);let j=[{version:1,name:"initial",up(a){for(let[b,c]of Object.entries(i.CG))for(let d of(a.exec((0,i.zE)(b,c)),c.indexes||[]))a.exec(d)}},{version:2,name:"convoy-provider-scope",up(a){let b=a.all("PRAGMA table_info(convoyRules)");b.length>0&&!b.some(a=>"providerIds"===a.name)&&a.exec("ALTER TABLE convoyRules ADD COLUMN providerIds TEXT DEFAULT '[]'")}},{version:2,name:"api-key-policies",up(a){let b=new Set(a.all("PRAGMA table_info(apiKeys)").map(a=>a.name));for(let[c,d]of Object.entries({expiresAt:"TEXT",tokenLimit:"INTEGER",tokensUsed:"INTEGER NOT NULL DEFAULT 0",tokensReserved:"INTEGER NOT NULL DEFAULT 0",allowedModels:"TEXT"}))b.has(c)||a.exec(`ALTER TABLE apiKeys ADD COLUMN ${c} ${d}`)},version:3},{version:4,name:"combo-config",up(a){for(let b of(a.exec((0,i.zE)("combos",i.CG.combos)),a.all("PRAGMA table_info(combos)").map(a=>a.name).includes("config")||a.exec("ALTER TABLE combos ADD COLUMN config TEXT"),i.CG.combos.indexes||[]))try{a.exec(b)}catch{}}},{version:5,name:"mcp gateway",up(a){for(let b of(a.exec((0,i.zE)("mcpInstances",i.CG.mcpInstances)),i.CG.mcpInstances.indexes||[]))a.exec(b);for(let b of(a.exec((0,i.zE)("mcpGatewayKeys",i.CG.mcpGatewayKeys)),i.CG.mcpGatewayKeys.indexes||[]))a.exec(b)}},{version:6,name:"mcp grant tool allowlist",up(a){for(let b of(a.exec((0,i.zE)("mcpKeyGrants",i.CG.mcpKeyGrants)),i.CG.mcpKeyGrants.indexes||[]))a.exec(b)}},{version:7,name:"cleanup-test-connections",up(a){a.get("SELECT name FROM sqlite_master WHERE type='table' AND name='providerConnections'")&&a.run("DELETE FROM providerConnections WHERE (provider LIKE 'openai-compatible-%' AND (name LIKE 'seed-%' OR provider LIKE 'openai-compatible-ord-%' OR provider LIKE 'openai-compatible-seq-%' OR provider LIKE 'openai-compatible-del-%' OR provider LIKE 'openai-compatible-upd-%' OR provider LIKE 'openai-compatible-clash-%' OR provider = 'openai-compatible-other')) OR provider = 'kimchi-nope' OR (email LIKE '%@example.com' AND name LIKE 'guard-%')")}}].sort((a,b)=>a.version-b.version);var k=c(62674);let l=null;function m(){if(l)return l;try{let a=g().join(process.cwd(),"package.json");l=JSON.parse(e().readFileSync(a,"utf-8")).version||"0.0.0"}catch{l="0.0.0"}return l}let n=["requestDetails"];function o(a){(0,h.Jh)();let b=m(),c=`${a}-${b}-${function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${a.getFullYear()}${b(a.getMonth()+1)}${b(a.getDate())}-${b(a.getHours())}${b(a.getMinutes())}${b(a.getSeconds())}`}()}`,d=g().join(h.KQ,c);return e().mkdirSync(d,{recursive:!0}),d}function p(){if(e().existsSync(h.KQ))for(let a of e().readdirSync(h.KQ,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>({name:a.name,full:g().join(h.KQ,a.name),mtime:e().statSync(g().join(h.KQ,a.name)).mtimeMs})).sort((a,b)=>b.mtime-a.mtime).slice(3))try{e().rmSync(a.full,{recursive:!0,force:!0})}catch{}}var q=c(644);let r=g().join(h.HG,".migrated-from-json"),s=new WeakSet;class t extends Error{constructor(a,b){super(a),this.name="MigrationAborted",this.droppedRows=b}}function u(a,b,c,d,e){let f=[];for(let a of c)try{d(a)}catch(b){f.push({...e(a),reason:b.message})}let g=a.get(`SELECT COUNT(*) as c FROM ${b}`)?.c??0;if(g!==c.length)throw console.warn(`[DB][migrate] ${b} row-count mismatch: expected ${c.length}, got ${g}. Dropped:`,f),new t(`${b} row-count mismatch: expected ${c.length}, got ${g}`,f)}function v(a){if(!e().existsSync(a))return null;try{return JSON.parse(e().readFileSync(a,"utf-8"))}catch{return null}}async function w(a){if(s.has(a))return;try{let b=a.get("PRAGMA quick_check(1)"),c=Object.values(b||{})[0];if(c&&"string"==typeof c&&"ok"!==c.toLowerCase())throw Error(`PRAGMA quick_check returned: ${c}`)}catch(b){let a=String(b?.message||"").toLowerCase();if(a.includes("malformed")||a.includes("corrupt")||a.includes("disk image"))throw console.error(`[DB][CRITICAL] SQLite database corruption detected on boot: ${b.message}. Refusing to start with corrupt DB to protect backups and data.`),b}s.add(a);let b=function(a){try{let b=a.get("SELECT COUNT(*) as c FROM _meta");return!b||0===b.c}catch(b){let a=String(b?.message||"").toLowerCase();if(a.includes("malformed")||a.includes("corrupt")||a.includes("disk image"))throw console.error(`[DB][CRITICAL] SQLite disk image is malformed: ${b.message}. Aborting to prevent data wipe.`),b;return!0}}(a);p(),a.exec((0,i.zE)("_meta",i.CG._meta));let c=parseInt((0,k.dy)(a,"backupSchemaVersion","0"),10)||0;if(!b&&c<i.f$)try{let b=o(`schema-${c}-to-${i.f$}`);!function(a,b,c="data.sqlite"){let d=g().join(b,c);try{e().rmSync(d,{force:!0})}catch{}let f=d.replace(/'/g,"''");a.exec(`ATTACH DATABASE '${f}' AS bak`);try{let b=new Set(n),c=a.all("SELECT name, sql FROM main.sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").filter(a=>!b.has(a.name));a.transaction(()=>{for(let b of c){let c=b.sql.replace(/CREATE TABLE\s+/i,"CREATE TABLE bak.");a.exec(c),a.exec(`INSERT INTO bak.${b.name} SELECT * FROM main.${b.name}`)}})}finally{try{a.exec("DETACH DATABASE bak")}catch{}}}(a,b),p(),console.log(`[DB][migrate] pre-schema backup ${c} → ${i.f$}: ${b}`)}catch(a){console.warn(`[DB][migrate] pre-schema backup failed (continuing): ${a.message}`)}!function(a){a.exec((0,i.zE)("_meta",i.CG._meta));let b=parseInt((0,k.dy)(a,"schemaVersion","0"),10)||0;if(b>=(j.length?j[j.length-1].version:0))return;let c=j.filter(a=>a.version>b);for(let b of c)a.transaction(()=>{b.up(a),(0,k.np)(a,"schemaVersion",b.version)}),b.version,console.log(`[DB][migrate] applied #${b.version} ${b.name}`);c.length}(a);for(let[b,c]of Object.entries(i.CG)){a.exec((0,i.zE)(b,c));let d=new Set(a.all(`PRAGMA table_info(${b})`).map(a=>a.name));for(let[e,f]of Object.entries(c.columns))if(!d.has(e)){let c=f.replace(/PRIMARY KEY( AUTOINCREMENT)?/i,"").replace(/UNIQUE/i,"").trim();try{a.exec(`ALTER TABLE ${b} ADD COLUMN ${e} ${c}`),console.log(`[DB][sync] +column ${b}.${e}`)}catch(a){console.warn(`[DB][sync] add column ${b}.${e} failed: ${a.message}`)}}for(let b of c.indexes||[])try{a.exec(b)}catch{}}(0,k.np)(a,"backupSchemaVersion",i.f$);let d=e().existsSync(r),f=v(h.Or.main),l=v(h.Or.usage),w=v(h.Or.disabled),x=v(h.Or.details);if(b&&(f||l||w||x)&&!d){let b=Date.now(),c=o("migrate-from-json");for(let a of Object.values(h.Or))!function(a,b,c=null){if(!e().existsSync(a))return;let d=c||g().basename(a),f=g().join(b,d);e().copyFileSync(a,f)}(a,c);try{a.transaction(()=>{if(f&&"object"==typeof f){for(let[b,c]of(f.settings&&a.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,q.s)(f.settings)]),u(a,"providerConnections",f.providerConnections||[],b=>{let{id:c,provider:d,authType:e,name:f,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=b;a.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[c,d,e||"oauth",f||null,g||null,h||null,+(!1!==i),(0,q.s)(l),j||new Date().toISOString(),k||new Date().toISOString()])},a=>({id:a.id??null,provider:a.provider??null,name:a.name??null})),u(a,"providerNodes",f.providerNodes||[],b=>{let{id:c,type:d,name:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,d||null,e||null,(0,q.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null,type:a.type??null,name:a.name??null})),u(a,"proxyPools",f.proxyPools||[],b=>{let{id:c,isActive:d,testStatus:e,createdAt:f,updatedAt:g,...h}=b;a.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c,+(!1!==d),e||"unknown",(0,q.s)(h),f||new Date().toISOString(),g||new Date().toISOString()])},a=>({id:a.id??null})),u(a,"apiKeys",f.apiKeys||[],b=>{a.run("INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.key,b.name||null,b.machineId||null,+(!1!==b.isActive),b.createdAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),u(a,"combos",f.combos||[],b=>{a.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[b.id,b.name,b.kind||null,(0,q.s)(b.models||[]),b.createdAt||new Date().toISOString(),b.updatedAt||new Date().toISOString()])},a=>({id:a.id??null,name:a.name??null})),Object.entries(f.modelAliases||{})))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[b,(0,q.s)(c)]);for(let b of f.customModels||[]){let c=`${b.providerAlias}|${b.id}|${b.type||"llm"}`;a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[c,(0,q.s)(b)])}for(let[b,c]of Object.entries(f.mitmAlias||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[b,(0,q.s)(c||{})]);for(let[b,c]of Object.entries(f.pricing||{}))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[b,(0,q.s)(c||{})])}if(l&&"object"==typeof l){for(let b of l.history||[]){let c=b.tokens||{};a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.apiKey||null,b.endpoint||null,c.prompt_tokens||c.input_tokens||0,c.completion_tokens||c.output_tokens||0,b.cost||0,b.status||"ok",(0,q.s)(c),(0,q.s)({})])}for(let[b,c]of Object.entries(l.dailySummary||{}))a.run("INSERT OR REPLACE INTO usageDaily(dateKey, data) VALUES(?, ?)",[b,(0,q.s)(c)]);"number"==typeof l.totalRequestsLifetime&&(0,k.np)(a,"totalRequestsLifetime",l.totalRequestsLifetime)}if(w&&"object"==typeof w.disabled)for(let[b,c]of Object.entries(w.disabled))a.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('disabledModels', ?, ?)",[b,(0,q.s)(c||[])]);if(x&&Array.isArray(x.records))for(let b of x.records)a.run("INSERT OR REPLACE INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?)",[b.id,b.timestamp||new Date().toISOString(),b.provider||null,b.model||null,b.connectionId||null,b.status||null,(0,q.s)(b)]);(0,k.np)(a,"appVersion",m()),(0,k.np)(a,"backupSchemaVersion",i.f$),(0,k.np)(a,"migratedAt",new Date().toISOString())})}catch(a){if(a instanceof t)return void console.error(`[DB][migrate] aborted: ${a.message} | legacy JSON kept | backup: ${c}`);throw a}try{e().writeFileSync(r,new Date().toISOString())}catch{}p(),console.log(`[DB][migrate] JSON → SQLite in ${Date.now()-b}ms | legacy JSON kept at DATA_DIR | backup: ${c}`);return}let y=m();(0,k.dy)(a,"appVersion",null)!==y&&(0,k.np)(a,"appVersion",y)}},62674:(a,b,c)=>{function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(36366)},63775:(a,b,c)=>{c.d(b,{CG:()=>f,f$:()=>d,oG:()=>e,zE:()=>g});let d=7,e=`
|
|
2
2
|
PRAGMA journal_mode = WAL;
|
|
3
3
|
PRAGMA synchronous = NORMAL;
|
|
4
4
|
PRAGMA temp_store = MEMORY;
|
|
@@ -6,4 +6,4 @@ PRAGMA mmap_size = 30000000;
|
|
|
6
6
|
PRAGMA cache_size = -64000;
|
|
7
7
|
PRAGMA foreign_keys = ON;
|
|
8
8
|
PRAGMA busy_timeout = 5000;
|
|
9
|
-
`,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL",scope:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",config:"TEXT",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},mcpInstances:{columns:{id:"TEXT PRIMARY KEY",slug:"TEXT UNIQUE NOT NULL",title:"TEXT",kind:"TEXT NOT NULL",transport:"TEXT NOT NULL",url:"TEXT",command:"TEXT",args:"TEXT",env:"TEXT",headers:"TEXT",oauth:"INTEGER DEFAULT 0",oauthTokens:"TEXT",enabled:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_inst_slug ON mcpInstances(slug)","CREATE INDEX IF NOT EXISTS idx_mcp_inst_enabled ON mcpInstances(enabled)"]},mcpGatewayKeys:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT",key:"TEXT UNIQUE NOT NULL",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_gwkey ON mcpGatewayKeys(key)"]},mcpKeyGrants:{columns:{keyId:"TEXT NOT NULL",instanceId:"TEXT NOT NULL",toolAllowlist:"TEXT"},primaryKey:"PRIMARY KEY (keyId, instanceId)",indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_grant_key ON mcpKeyGrants(keyId)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]},errorLogs:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",endpoint:"TEXT",provider:"TEXT",model:"TEXT",connectionId:"TEXT",comboName:"TEXT",statusCode:"TEXT",errorMessage:"TEXT",request:"TEXT",providerRequest:"TEXT",providerResponse:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_el_ts ON errorLogs(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_el_provider ON errorLogs(provider)","CREATE INDEX IF NOT EXISTS idx_el_model ON errorLogs(model)","CREATE INDEX IF NOT EXISTS idx_el_conn ON errorLogs(connectionId)","CREATE INDEX IF NOT EXISTS idx_el_combo ON errorLogs(comboName)"]},tokenSaverDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},convoyRules:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT NOT NULL",enabled:"INTEGER DEFAULT 1",priority:"INTEGER DEFAULT 0",matchType:"TEXT NOT NULL DEFAULT 'literal'",action:"TEXT NOT NULL DEFAULT 'replace'",pattern:"TEXT NOT NULL",replacement:"TEXT DEFAULT ''",caseSensitive:"INTEGER DEFAULT 1",providerIds:"TEXT DEFAULT '[]'",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_cr_enabled ON convoyRules(enabled)","CREATE INDEX IF NOT EXISTS idx_cr_priority ON convoyRules(enabled, priority)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
|
|
9
|
+
`,f={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL",scope:"TEXT",accessRestricted:"INTEGER DEFAULT 0",accessAllow:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",config:"TEXT",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},mcpInstances:{columns:{id:"TEXT PRIMARY KEY",slug:"TEXT UNIQUE NOT NULL",title:"TEXT",kind:"TEXT NOT NULL",transport:"TEXT NOT NULL",url:"TEXT",command:"TEXT",args:"TEXT",env:"TEXT",headers:"TEXT",oauth:"INTEGER DEFAULT 0",oauthTokens:"TEXT",enabled:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_inst_slug ON mcpInstances(slug)","CREATE INDEX IF NOT EXISTS idx_mcp_inst_enabled ON mcpInstances(enabled)"]},mcpGatewayKeys:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT",key:"TEXT UNIQUE NOT NULL",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_gwkey ON mcpGatewayKeys(key)"]},mcpKeyGrants:{columns:{keyId:"TEXT NOT NULL",instanceId:"TEXT NOT NULL",toolAllowlist:"TEXT"},primaryKey:"PRIMARY KEY (keyId, instanceId)",indexes:["CREATE INDEX IF NOT EXISTS idx_mcp_grant_key ON mcpKeyGrants(keyId)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",endpoint:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]},errorLogs:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",endpoint:"TEXT",provider:"TEXT",model:"TEXT",connectionId:"TEXT",comboName:"TEXT",statusCode:"TEXT",errorMessage:"TEXT",request:"TEXT",providerRequest:"TEXT",providerResponse:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_el_ts ON errorLogs(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_el_provider ON errorLogs(provider)","CREATE INDEX IF NOT EXISTS idx_el_model ON errorLogs(model)","CREATE INDEX IF NOT EXISTS idx_el_conn ON errorLogs(connectionId)","CREATE INDEX IF NOT EXISTS idx_el_combo ON errorLogs(comboName)"]},tokenSaverDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},convoyRules:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT NOT NULL",enabled:"INTEGER DEFAULT 1",priority:"INTEGER DEFAULT 0",matchType:"TEXT NOT NULL DEFAULT 'literal'",action:"TEXT NOT NULL DEFAULT 'replace'",pattern:"TEXT NOT NULL",replacement:"TEXT DEFAULT ''",caseSensitive:"INTEGER DEFAULT 1",providerIds:"TEXT DEFAULT '[]'",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_cr_enabled ON convoyRules(enabled)","CREATE INDEX IF NOT EXISTS idx_cr_priority ON convoyRules(enabled, priority)"]}};function g(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=6769,exports.ids=[1531,3912,6769],exports.modules={91531:(a,b,c)=>{c.r(b),c.d(b,{QoderService:()=>j,resolveProfile:()=>d.mC});var d=c(78574),e=c(89843),f=c(55511),g=c.n(f);async function h(a){return a}async function i(a,b,c={}){let d=new AbortController,e=setTimeout(()=>d.abort("timeout"),15e3);try{return await a(b,{...c,signal:d.signal},null)}finally{clearTimeout(e)}}class j{constructor(a={}){this.config=a||{};const b=a.profile??a.protocolProfile??(a.openApiBaseUrl?.includes("qoder.com.cn")?"cn":"intl");this.profile=(0,d.mC)(b),this.machineTokenResolver=a.machineTokenResolver||h,this.fetchImpl=a.fetchImpl||e.proxyAwareFetch}loginUrl(){return this.config.loginUrl||this.profile.loginUrl}deviceTokenUrl(){return this.config.deviceTokenUrl||this.profile.deviceTokenUrl}userInfoUrl(){return this.config.userInfoUrl||this.profile.userInfoUrl}generatePkcePair(){let a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",b=43+Math.floor(86*Math.random()),c=g().randomBytes(b),d="";for(let e=0;e<b;e++)d+=a[c[e]%a.length];let e=g().createHash("sha256").update(d).digest().toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");return{verifier:d,challenge:e}}async initiateDeviceFlow(){let{verifier:a,challenge:b}=this.generatePkcePair(),c=g().randomUUID(),d=g().randomUUID(),e=await this.machineTokenResolver(d)||d,f=new URLSearchParams;f.set("challenge",b),f.set("challenge_method","S256"),f.set("nonce",c),f.set("machine_id",d);let h=this.profile.deviceClientId||null,i=this.profile.deviceRedirectUri||null;if(h&&f.set("client_id",h),i&&f.set("redirect_uri",i),"cn-work"===this.profile.id&&(!h||!i))throw Error("qoder cn-work device flow requires deviceClientId and deviceRedirectUri on profile");return{verificationUriComplete:`${this.loginUrl()}?${f.toString()}`,codeVerifier:a,nonce:c,machineId:d,machineToken:e}}async pollDeviceToken({nonce:a,codeVerifier:b}){let c;if(!a||!b)throw Error("pollDeviceToken: missing nonce or code verifier");let d=`${this.deviceTokenUrl()}?nonce=${encodeURIComponent(a)}&verifier=${encodeURIComponent(b)}&challenge_method=S256`,e=await i(this.fetchImpl,d,{method:"GET",headers:{Accept:"application/json","User-Agent":"Go-http-client/2.0"}});if(202===e.status||404===e.status)return{status:"pending"};let f=await e.text();if(!e.ok){let a=`Qoder device token poll failed: HTTP ${e.status}`;try{let b=JSON.parse(f);b.message&&(a=`Qoder device token poll failed: ${b.message}`)}catch{}throw Error(a)}try{c=JSON.parse(f)}catch(a){throw Error(`Qoder device token poll: invalid JSON response (${a.message})`)}if(!c.token)throw Error("Qoder device token poll returned 200 but no token");let g=j.parseExpiry(c.expires_at,c.expires_in);return{status:"ok",accessToken:c.token,refreshToken:c.refresh_token||"",userId:c.user_id||"",expireTime:g,rawResponse:c}}async fetchUserInfo(a){try{let b=await i(this.fetchImpl,this.userInfoUrl(),{method:"GET",headers:{Authorization:`Bearer ${a}`,Accept:"application/json","User-Agent":"Go-http-client/2.0"}});if(!b.ok)return{name:"",email:""};let c=await b.json();return{name:(c.name||c.username||"").trim(),email:(c.email||"").trim(),organizationId:(c.organization_id||"").trim()}}catch{return{name:"",email:""}}}async refreshDeviceToken(a){if(!a)throw Error("refreshDeviceToken: missing refresh token");let b=this.profile.refreshTokenUrl;if(!b)throw Error("refreshDeviceToken: profile has no refreshTokenUrl");let c=await i(this.fetchImpl,b,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","User-Agent":"Go-http-client/2.0"},body:JSON.stringify({refresh_token:a})}),d=await c.text(),e=null;try{e=d?JSON.parse(d):null}catch{e=null}if(!c.ok){let a=e&&(e.message||e.error_description||e.error)||`HTTP ${c.status}`,b=Error(`Qoder device token refresh failed: ${a}`);throw b.status=c.status,b.body=e,b}let f=e&&(e.device_token||e.token||e.access_token)||null,g=e&&(e.refresh_token||e.refreshToken)||a;if(!f||"string"!=typeof f)throw Error("Qoder device token refresh: missing device_token/token");let h=j.parseExpiry(e?.expires_at||e?.expiresAt,e?.expires_in??e?.expiresIn);return{accessToken:f,refreshToken:g,expiresIn:Math.max(60,Math.floor((h-Date.now())/1e3)),expireTime:h,rawResponse:e}}static parseExpiry(a,b){if("number"==typeof a&&Number.isFinite(a)&&a>0)return a;let c="string"==typeof a?a.trim():"";if(c){if(/^\d+$/.test(c)){let a=Number.parseInt(c,10);if(Number.isFinite(a)&&a>0)return a}let a=Date.parse(c);if(!Number.isNaN(a))return a}return"number"==typeof b&&Number.isFinite(b)&&b>=0?Date.now()+1e3*b:Date.now()+2592e6}}}};
|