@rabbi696/ezrouter 0.6.20 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +1 -1
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/react-loadable-manifest.json +1 -1
- 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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +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 +2 -2
- 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/(dashboard)/dashboard/wakeup/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/wakeup/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/wakeup/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 +8 -6
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +8 -6
- 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 +5 -5
- 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 +5 -3
- 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-profiles/route.js +22 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.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 +1 -1
- 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 +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 +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 +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 +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 +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 +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/netlify-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +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 +1 -1
- 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 +2 -2
- 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 +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 +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/wakeup/route.js +1 -1
- package/app/.next-cli-build/server/app/api/wakeup/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 +8 -6
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +8 -6
- 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 +5 -5
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +5 -3
- 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 +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/convoy.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +5 -3
- 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 +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +5 -3
- 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 +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +5 -3
- 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 +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +11 -9
- 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 +11 -9
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +5 -3
- 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 +8 -6
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +8 -6
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +5 -3
- 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 +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard/wakeup.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/wakeup.rsc +9 -7
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard/wakeup/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard/wakeup.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_full.segment.rsc +9 -7
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_index.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +10 -8
- 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 +10 -8
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +5 -3
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +8 -6
- 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 +8 -6
- 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 +5 -5
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +5 -3
- 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 +8 -6
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +8 -6
- 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 +5 -5
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +5 -3
- 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 +9 -7
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +9 -7
- 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 +5 -5
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +5 -3
- 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 +1 -1
- package/app/.next-cli-build/server/chunks/1133.js +1 -1
- package/app/.next-cli-build/server/chunks/1482.js +3 -3
- package/app/.next-cli-build/server/chunks/1522.js +1 -1
- package/app/.next-cli-build/server/chunks/1641.js +1 -1
- package/app/.next-cli-build/server/chunks/1733.js +1 -1
- package/app/.next-cli-build/server/chunks/1757.js +22 -2
- package/app/.next-cli-build/server/chunks/1837.js +3 -0
- package/app/.next-cli-build/server/chunks/1847.js +1 -1
- package/app/.next-cli-build/server/chunks/2180.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/290.js +1 -1
- package/app/.next-cli-build/server/chunks/321.js +7 -2
- package/app/.next-cli-build/server/chunks/3275.js +1 -1
- package/app/.next-cli-build/server/chunks/369.js +21 -21
- package/app/.next-cli-build/server/chunks/3977.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +3 -3
- package/app/.next-cli-build/server/chunks/4123.js +1 -1
- package/app/.next-cli-build/server/chunks/4827.js +1 -1
- package/app/.next-cli-build/server/chunks/5251.js +1 -1
- package/app/.next-cli-build/server/chunks/5292.js +1 -0
- package/app/.next-cli-build/server/chunks/5434.js +9 -2
- package/app/.next-cli-build/server/chunks/5460.js +8 -3
- package/app/.next-cli-build/server/chunks/5743.js +41 -14
- package/app/.next-cli-build/server/chunks/5749.js +1 -1
- package/app/.next-cli-build/server/chunks/5872.js +1 -1
- package/app/.next-cli-build/server/chunks/6038.js +1 -0
- package/app/.next-cli-build/server/chunks/615.js +1 -1
- package/app/.next-cli-build/server/chunks/6765.js +1 -0
- package/app/.next-cli-build/server/chunks/7358.js +1 -1
- package/app/.next-cli-build/server/chunks/7362.js +1 -1
- package/app/.next-cli-build/server/chunks/7716.js +1 -1
- package/app/.next-cli-build/server/chunks/7775.js +1 -1
- package/app/.next-cli-build/server/chunks/7811.js +1 -1
- package/app/.next-cli-build/server/chunks/8129.js +1 -1
- package/app/.next-cli-build/server/chunks/823.js +1 -1
- package/app/.next-cli-build/server/chunks/8306.js +1 -1
- package/app/.next-cli-build/server/chunks/8327.js +21 -21
- package/app/.next-cli-build/server/chunks/8540.js +1 -0
- package/app/.next-cli-build/server/chunks/8889.js +11 -0
- package/app/.next-cli-build/server/chunks/8976.js +1 -1
- package/app/.next-cli-build/server/chunks/9021.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/9616.js +1 -1
- package/app/.next-cli-build/server/chunks/9761.js +1 -1
- package/app/.next-cli-build/server/chunks/9865.js +1 -1
- package/app/.next-cli-build/server/chunks/9898.js +2 -2
- 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-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +8 -3
- package/app/.next-cli-build/server/next-font-manifest.js +1 -1
- package/app/.next-cli-build/server/next-font-manifest.json +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-4dc9ca385825ff93.js → 1321-8a4ed98cd27f3c72.js} +1 -1
- package/app/.next-cli-build/static/chunks/5497-b45e1c7b332ddf12.js +17 -0
- package/app/.next-cli-build/static/chunks/{6252-d239501a3a8eee2c.js → 6252-0f14a5b69160c9da.js} +19 -12
- package/app/.next-cli-build/static/chunks/{6509-e4e72b0db83cac55.js → 6509-3113291463d9844c.js} +1 -1
- package/app/.next-cli-build/static/chunks/8105-09b5824ceb7fd21b.js +1 -0
- package/app/.next-cli-build/static/chunks/{8982-8a01c5331ac1683d.js → 8528-a98a240ecd3ff495.js} +3 -3
- package/app/.next-cli-build/static/chunks/9227-96f7384b30545e0d.js +5 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-b29a8b9ee4742767.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-bb32b01b204c30e6.js +1 -0
- package/app/.next-cli-build/static/chunks/app/layout-734517e5db69aafd.js +1 -0
- package/app/.next-cli-build/static/chunks/{webpack-2e234f646b31f149.js → webpack-63e69ceb57f8fc86.js} +1 -1
- package/app/.next-cli-build/static/css/0288d77679ae04b4.css +1 -0
- package/app/.next-cli-build/static/css/{c974b0ba277faca7.css → 99e24003a7301d8b.css} +1 -1
- package/app/.next-cli-build/static/media/17cf9497af825577-s.woff2 +0 -0
- package/app/.next-cli-build/static/media/1abbc144918f74fd-s.p.woff2 +0 -0
- package/app/.next-cli-build/static/media/8c96cc4bd2a39381-s.p.woff2 +0 -0
- package/app/CHANGELOG.md +45 -0
- package/app/package.json +1 -1
- package/app/public/CHANGELOG.md +45 -0
- package/app/public/i18n/literals/fa.json +22 -9
- package/app/public/providers/subq.png +0 -0
- package/cli.js +35 -29
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/155.js +0 -11
- package/app/.next-cli-build/server/chunks/3583.js +0 -3
- package/app/.next-cli-build/server/chunks/3886.js +0 -1
- package/app/.next-cli-build/server/chunks/5516.js +0 -1
- package/app/.next-cli-build/server/chunks/73.js +0 -1
- package/app/.next-cli-build/server/chunks/7594.js +0 -28
- package/app/.next-cli-build/server/chunks/7677.js +0 -1
- package/app/.next-cli-build/server/chunks/8644.js +0 -1
- package/app/.next-cli-build/server/chunks/9386.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-4ef228b7ec9091c3.js +0 -17
- package/app/.next-cli-build/static/chunks/8105-1c0f06999d816cc5.js +0 -1
- package/app/.next-cli-build/static/chunks/9227-b3c96c0cd78c7abc.js +0 -5
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-6720afc00e5d9d9a.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-bb20d60bff37ceb9.js +0 -1
- package/app/.next-cli-build/static/chunks/app/layout-9e8ae435612b99fc.js +0 -1
- package/app/.next-cli-build/static/css/2e1a9a933f2e668f.css +0 -1
- /package/app/.next-cli-build/static/{OFz0mgH4Q9vd3XaqYDHtW → Y99WYOLLyt5Zmp6hx75Z1}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{OFz0mgH4Q9vd3XaqYDHtW → Y99WYOLLyt5Zmp6hx75Z1}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
exports.id=1482,exports.ids=[1482],exports.modules={19165:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},50416:(a,b,c)=>{"use strict";c.d(b,{default:()=>x});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377),j=c(67960),k=c(91937);function l({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:i}){return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(h.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),i]})}function m({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function n({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function o({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}var p=c(72738),q=c(92592);function r({value:a,onChange:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(()=>new Set),k=(0,e.useMemo)(()=>(function(a){let b=new Map;for(let c of a){if(!c?.id||"string"!=typeof c.id||!c.id.includes("/"))continue;let a=c.owned_by||c.id.slice(0,c.id.indexOf("/")),d=c.id.slice(c.id.indexOf("/")+1);b.has(a)||b.set(a,[]),b.get(a).push(d)}return b})(c),[c]),l=(0,e.useMemo)(()=>Array.from(k.keys()).sort((a,b)=>a.localeCompare(b)),[k]),m=null==a,n=(0,e.useMemo)(()=>new Set(a?.providers||[]),[a]);(0,e.useMemo)(()=>new Set(a?.models||[]),[a]);let o=b=>{let c=`${b}/`;return(a?.models||[]).filter(a=>a.startsWith(c))},s=(a,c)=>{0===a.length?b(null):b({providers:a,models:c})},t=a=>{j(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})};return g?(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Loading available providers…"}):(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,d.jsx)("input",{type:"checkbox",checked:m,onChange:a=>b(a.target.checked?null:{providers:[],models:[]})}),(0,d.jsx)("span",{children:"Unrestricted (key can reach every provider and model)"})]}),!m&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 max-h-80 overflow-y-auto border border-black/[0.06] dark:border-white/[0.06] rounded-lg p-2",children:[0===l.length&&(0,d.jsx)("p",{className:"text-sm text-text-muted px-2 py-1",children:"No providers configured yet."}),l.map(b=>{let c,e=(0,q.rs)(b),f=q.Q2[e],g=k.get(b)||[],h=(c=(0,q.rs)(b),n.has(b)||n.has(c)),j=o(b),l=i.has(b);return(0,d.jsxs)("div",{className:"border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 py-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:h,onChange:()=>{let c,d;return c=new Set(a?.providers||[]),d=(a?.models||[]).slice(),void(c.has(b)?(c.delete(b),d=d.filter(a=>!a.startsWith(`${b}/`))):c.add(b),s(Array.from(c),d))}}),(0,d.jsx)(p.A,{providerId:e,size:16}),(0,d.jsx)("button",{type:"button",className:"flex-1 text-left text-sm font-medium",onClick:()=>t(b),children:f?.name||b}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:h?0===j.length?`all ${g.length} models`:`${j.length}/${g.length} models`:""}),(0,d.jsx)("button",{type:"button",className:"material-symbols-outlined text-[16px] text-text-muted",onClick:()=>t(b),children:l?"expand_less":"expand_more"})]}),l&&(0,d.jsx)("div",{className:"pl-8 mt-1 flex flex-col gap-1",children:g.map(c=>{let e=`${b}/${c}`,f=h&&(0===j.length||j.includes(e));return(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)("input",{type:"checkbox",checked:f,onChange:()=>{let d,e,f,g,h,i;return(e=new Set(a?.providers||[])).add(b),f=`${b}/${c}`,g=o(b),h=k.get(b)||[],i=(a?.models||[]).filter(a=>!a.startsWith(`${b}/`)),void(0===g.length?d=h.filter(a=>a!==c).map(a=>`${b}/${a}`):g.includes(f)?d=g.filter(a=>a!==f):(d=[...g,f]).length===h.length&&(d=[]),s(Array.from(e),[...i,...d]))}}),(0,d.jsx)("span",{className:"font-mono",children:c})]},e)})})]},b)})]})]})}function s({apiKey:a,onChange:b,onRequestRestrict:c}){let f=a.access||{restricted:!1,allow:[]},[g,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)([]),[l,m]=(0,e.useState)({}),n=async()=>{i(!0);try{let[a,b]=await Promise.all([fetch("/api/providers"),fetch("/api/models/alias")]);a.ok&&k((await a.json()).connections||[]),b.ok&&m((await b.json()).aliases||{})}catch(a){console.log("Error loading picker data:",a)}},o=a=>b({restricted:!0,allow:a}),p=a=>o(f.allow.filter(b=>b!==a));return(0,d.jsxs)("div",{className:"mt-2","data-testid":"key-access",children:[(0,d.jsx)(h.lM,{size:"sm",checked:f.restricted,label:"Restrict access",onChange:a=>a?c():b({restricted:!1,allow:f.allow})}),f.restricted&&(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[0===f.allow.length&&(0,d.jsx)("span",{className:"text-xs text-orange-500",children:"No combos or models allowed — this key can call nothing."}),f.allow.map(a=>(0,d.jsxs)("span",{className:"flex items-center gap-1 rounded-xl border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-xs text-text-main",children:[a,(0,d.jsx)("button",{onClick:()=>p(a),className:"rounded text-text-muted hover:text-red-500",title:`Remove ${a}`,"aria-label":`Remove ${a}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"12px"},children:"close"})})]},a)),(0,d.jsxs)("button",{onClick:n,className:"flex items-center gap-0.5 rounded-xl border border-dashed border-black/10 px-2 py-0.5 text-xs font-medium text-primary hover:border-primary/50 dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"14px"},children:"add"}),"Add combo or model"]})]}),g&&(0,d.jsx)(h.rq,{isOpen:g,onClose:()=>i(!1),onSelect:a=>{let b=a?.value;b&&!f.allow.some(a=>a.toLowerCase()===b.toLowerCase())&&o([...f.allow,b])},onDeselect:a=>p(f.allow.find(b=>b.toLowerCase()===String(a?.value).toLowerCase())),activeProviders:j,modelAliases:l,title:`Allowed for "${a.name}"`,addedModelValues:f.allow,closeOnSelect:!1})]})}r.propTypes={value:g().shape({providers:g().arrayOf(g().string),models:g().arrayOf(g().string)}),onChange:g().func.isRequired},s.propTypes={apiKey:g().shape({id:g().string.isRequired,name:g().string,access:g().shape({restricted:g().bool,allow:g().arrayOf(g().string)})}).isRequired,onChange:g().func.isRequired,onRequestRestrict:g().func.isRequired};let t=[{label:"100K",value:"100000"},{label:"500K",value:"500000"},{label:"1M",value:"1000000"},{label:"5M",value:"5000000"},{label:"10M",value:"10000000"}];function u(a){let b=Math.max(0,Number(a)||0);return b>=1e6?`${(b/1e6).toFixed(+(b%1e6!=0))}M`:b>=1e3?`${(b/1e3).toFixed(+(b%1e3!=0))}K`:String(b)}function v({used:a,limit:b}){let c=Math.max(1,Number(b)||1),e=Math.max(0,Number(a)||0),f=Math.min(100,Math.round(e/c*100)),g=Math.max(0,c-e),h=f>=90?{bar:"bg-red-500",text:"text-red-600 dark:text-red-400"}:f>=75?{bar:"bg-amber-500",text:"text-amber-600 dark:text-amber-400"}:{bar:"bg-emerald-500",text:"text-text-muted"};return(0,d.jsxs)("div",{className:"mt-2 max-w-sm",title:`${u(e)} of ${u(c)} tokens used`,children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-3 text-[11px]",children:[(0,d.jsxs)("span",{className:h.text,children:[f,"% used"]}),(0,d.jsxs)("span",{className:"text-text-muted",children:[u(g)," remaining"]})]}),(0,d.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-black/10 dark:bg-white/10",role:"progressbar","aria-label":`Token usage: ${f}% used, ${u(g)} remaining`,"aria-valuemin":0,"aria-valuemax":c,"aria-valuenow":Math.min(e,c),children:(0,d.jsx)("div",{className:`h-full rounded-full transition-[width] duration-300 ${h.bar}`,style:{width:`${f}%`}})})]})}function w({apiKey:a,activeProviders:b,modelAliases:c,onClose:f,onSave:g}){let[i,j]=(0,e.useState)(a.expiresAt?a.expiresAt.slice(0,16):""),[k,l]=(0,e.useState)(a.allowedModels||[]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(null==a.tokenLimit?"unlimited":"unchanged"),[q,r]=(0,e.useState)(!1),[s,v]=(0,e.useState)(!1),x=null!=a.tokenLimit,y=async()=>{v(!0),await g({expiresAt:i||null,allowedModels:k,..."unlimited"===o?{tokenLimit:null}:m?{[x?"tokenLimitIncrement":"tokenLimit"]:m}:{}}),v(!1)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.aF,{isOpen:!0,onClose:f,title:`Edit ${a.name}`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Expires at (optional)",type:"datetime-local",value:i,onChange:a=>j(a.target.value),hint:"Leave blank for no expiry."}),(0,d.jsx)(h.pd,{label:x?"Add tokens":"Set token limit",type:"number",min:"1",step:"1",value:m,onChange:a=>{let b=a.target.value;n(b),p(b?"amount":x?"unchanged":"unlimited")},placeholder:x?"e.g. 500000":"e.g. 1000000",hint:x?`Added to the current ${u(a.tokenLimit)} limit; usage is preserved.`:"Choose Unlimited to remove the limit."}),(0,d.jsxs)("div",{className:"-mt-2 flex flex-wrap gap-1.5","aria-label":"Token limit presets",children:[t.map(a=>{let b="amount"===o&&m===a.value;return(0,d.jsx)("button",{type:"button",onClick:()=>{n(a.value),p("amount")},"aria-pressed":b,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${b?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:a.label},a.value)}),(0,d.jsx)("button",{type:"button",onClick:()=>{n(""),p("unlimited")},"aria-pressed":"unlimited"===o,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${"unlimited"===o?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:"Unlimited"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-1.5 block text-sm font-medium text-text-main",children:"Allowed models"}),(0,d.jsx)("div",{className:"flex min-h-12 flex-wrap gap-1 rounded-lg border border-border bg-surface-2 p-2",children:k.length?k.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs text-primary",children:[(0,d.jsx)("span",{children:a}),(0,d.jsx)("button",{type:"button",onClick:()=>l(b=>b.filter(b=>b!==a)),"aria-label":`Remove ${a}`,className:"material-symbols-outlined text-[14px]",children:"close"})]},a)):(0,d.jsx)("span",{className:"p-1 text-xs text-text-muted",children:"All models allowed"})}),(0,d.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"mt-2 flex w-full items-center justify-center gap-1 rounded-lg border border-dashed border-black/10 py-2 text-xs font-medium text-primary dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"}),"Edit model access"]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:y,fullWidth:!0,disabled:s,children:s?"Saving...":"Save changes"}),(0,d.jsx)(h.$n,{onClick:f,variant:"ghost",fullWidth:!0,disabled:s,children:"Cancel"})]})]})}),q&&(0,d.jsx)(h.rq,{isOpen:!0,onClose:()=>r(!1),onSelect:a=>l(b=>b.includes(a.value)?b:[...b,a.value]),onDeselect:a=>l(b=>b.filter(b=>b!==a.value)),activeProviders:b,modelAliases:c,addedModelValues:k,closeOnSelect:!1,title:"Edit allowed models"})]})}function x({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[p,q]=(0,e.useState)(!1),[u,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)([]),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)([]),[J,K]=(0,e.useState)({}),[L,M]=(0,e.useState)(null),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(null),[R,S]=(0,e.useState)(null),[T,U]=(0,e.useState)(null),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(!1),[Z,$]=(0,e.useState)(!0),[_,aa]=(0,e.useState)(!0),[ab,ac]=(0,e.useState)(!1),[ad,ae]=(0,e.useState)(!1),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(""),[al,am]=(0,e.useState)(""),[an,ao]=(0,e.useState)(!1),[ap,aq]=(0,e.useState)(""),[ar,as]=(0,e.useState)(null),[at,au]=(0,e.useState)(!1),[av,aw]=(0,e.useState)(!1),[ax,ay]=(0,e.useState)(!1),[az,aA]=(0,e.useState)(!1),[aB,aC]=(0,e.useState)(""),[aD,aE]=(0,e.useState)(!1),[aF,aG]=(0,e.useState)(""),[aH,aI]=(0,e.useState)(null),[aJ,aK]=(0,e.useState)(""),[aL,aM]=(0,e.useState)(""),[aN,aO]=(0,e.useState)(null),[aP,aQ]=(0,e.useState)(!1),[aR,aS]=(0,e.useState)([]),[aT,aU]=(0,e.useState)(""),[aV,aW]=(0,e.useState)(!1),[aX,aY]=(0,e.useState)(!1),[aZ,a$]=(0,e.useState)(!1),a_=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[a0,a1]=(0,e.useState)(!1),[a2,a3]=(0,e.useState)(!1),[a4,a5]=(0,e.useState)(new Set),[a6,a7]=(0,e.useState)(!1),{copied:a8,copy:a9}=(0,i.C)(),ba=!Z||!_,bb=Z?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=j.t6&&d(!1))},[]);let bc=async a=>{try{await k.A.getState().patchSettings({tunnelDashboardAccess:a})&&ac(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},bd=async a=>{try{await k.A.getState().patchSettings({requireApiKey:a})&&Y(a)}catch(a){console.log("Error updating requireApiKey:",a)}},be=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},bf=async(...a)=>{ao(!0),aq("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<j.Cp;){if(await new Promise(a=>setTimeout(a,j.Hx)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return ag(!0),ao(!1),aq(""),!0;if((Date.now()-c)%1e4<j.Hx)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return as({type:"error",message:"Tunnel process stopped unexpectedly."}),ao(!1),aq(""),!1}}catch{}}return as({type:"error",message:"Tunnel created but not reachable. Please try again."}),ao(!1),aq(""),!1},bg=async()=>{au(!1),ao(!0),as(null),aq("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?aq(`Downloading cloudflared... ${c.download.progress}%`):a&&aq("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void as({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void as({type:"error",message:"No tunnel URL returned"});ak(d),am(c.publicUrl||""),await bf(c.publicUrl,d)}catch(a){as({type:"error",message:a.message})}finally{a=!1,ao(!1),aq("")}},bh=async()=>{ao(!0),as(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(ag(!1),ak(""),aw(!1),as({type:"success",message:"Tunnel disabled"})):as({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){as({type:"error",message:a.message})}finally{ao(!1)}},bi=async()=>{aO(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aO(b.installed),b}}catch{}return aO(!1),{installed:!1}},bj=async()=>{aQ(!0),aI(null),aS([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aT})});aU("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aS(a=>[...a.slice(-50),d.message]);else if("done"===c){aO(!0),aQ(!1),aY(!1),bn();return}else"error"===c&&aI({type:"error",message:d.error||"Install failed"})}}}catch(a){aI({type:"error",message:a.message})}finally{aQ(!1)}},bk=async a=>{aG("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<j.Cp;){await new Promise(a=>setTimeout(a,j.Hx));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},bl=(a,b)=>{aK(a),aM(b)},bm=()=>{aK(""),aM("")},bn=async()=>{aY(!1),aW(!0),aE(!0),aI(null),aG("Connecting..."),bm();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aC(b.tunnelUrl||"");let a=await bk(b.tunnelUrl);ay(!0),aI(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){bl(b.authUrl,"Open Login Page"),aG('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){bm(),aG("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aC(b.tunnelUrl||"");let a=await bk(b.tunnelUrl);ay(!0),aI(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await bo(b.enableUrl):aI({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}bm(),aI({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await bo(b.enableUrl);aI({type:"error",message:b.error||"Failed to connect"})}catch(a){aI({type:"error",message:a.message})}finally{aE(!1),aW(!1),aG(""),bm()}},bo=async a=>{bl(a,"Open Funnel Settings"),aG('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){bm(),aC(b.tunnelUrl||"");let a=await bk(b.tunnelUrl);ay(!0),aI(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){bm(),aI({type:"error",message:b.error});return}}catch{}}bm(),aI({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bp=async()=>{aE(!0),aI(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(ay(!1),aC(""),a$(!1),aI({type:"success",message:"Tailscale disabled"})):aI({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){aI({type:"error",message:a.message})}finally{aE(!1)}},bq=async()=>{aI(null),aS([]);let a=await bi();a?.installed&&a?.hasCachedPassword?bn():aY(!0)},br=async()=>{if(u.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:u,expiresAt:z||null,tokenLimit:B||null,allowedModels:D,scope:L})}),b=await a.json();a.ok&&(O(b.key),await be(),y(""),A(""),C(""),E([]),G(!1),M(null),q(!1))}catch(a){console.log("Error creating key:",a)}},bs=async()=>{if(T)try{(await fetch(`/api/keys/${T.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:V})})).ok&&(c(a=>a.map(a=>a.id===T.id?{...a,scope:V}:a)),U(null),W(null))}catch(a){console.log("Error updating key scope:",a)}},bt=async a=>{S({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{S(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),a5(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},bu=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},bv=async(a,b)=>{let c=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error||"Failed to update key");await be(),Q(null)},bw=async(a,b)=>{try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({access:b})}),e=await d.json().catch(()=>({}));d.ok&&e.key?c(b=>b.map(b=>b.id===a?{...b,access:e.key.access}:b)):console.log("Error updating key access:",e.error||d.status)}catch(a){console.log("Error updating key access:",a)}},[bx,by]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(h.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(l,{label:"Local",url:bx,copyId:"local_url",copied:a8,onCopy:a9}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${af?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),af&&!an&&ah?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${al||aj}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>a9(`${al||aj}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===a8?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aw(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!af||an||ah?an?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ap||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{ao(!1),aq("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ar?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ar.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>au(!0),children:"Enable"})]}):ad?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>ae(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{ba?as({type:"error",message:`Security required: ${bb}`}):X?au(!0):as({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a0?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>aw(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ax?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ax&&!aD&&az?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{value:`${aB}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>a9(`${aB}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===a8?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>a$(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ax||aD||az?aD||aV?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aF||"Connecting..."]}),aJ&&(0,d.jsx)(h.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aJ,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:aL||"Open"}),(0,d.jsx)("button",{onClick:()=>{aE(!1),aW(!1),aG(""),bm()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aH?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aH.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:bq,children:"Enable"})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{ba?aI({type:"error",message:`Security required: ${bb}`}):bq()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a2?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>a$(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),ba&&!af&&!ax&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(o,{message:bb,action:{label:"Open settings",href:"/dashboard/profile"}})}),(af||ax)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!X&&(0,d.jsx)(o,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!Z||!_)&&(0,d.jsx)(o,{message:Z?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:Z?"Change password":"Enable",href:"/dashboard/profile"}})]}),(af||ax)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(h.lM,{checked:ab,onChange:()=>bc(!ab)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(n,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(h.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>q(!0),children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(h.lM,{checked:X,onChange:()=>bd(!X)})]}),a6&&!X&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(o,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>q(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,d.jsxs)("div",{className:`group flex items-start justify-between gap-3 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0 flex-wrap",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono break-all min-w-0",children:a4.has(a.id)?a.key:(b=a.key)&&!(b.length<=10)?b.slice(0,6)+"•".repeat(b.length-10)+b.slice(-4):b||""}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)("button",{onClick:()=>{var b;return b=a.id,void a5(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:a4.has(a.id)?"Hide key":"Show key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a4.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{onClick:()=>a9(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a8===a.id?"check":"content_copy"})})]})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString(),a.expiresAt?` \xb7 Expires ${new Date(a.expiresAt).toLocaleString()}`:" \xb7 No expiry",null!=a.tokenLimit?` \xb7 ${a.tokensUsed}/${a.tokenLimit} tokens`:" \xb7 Unlimited tokens"]}),null!=a.tokenLimit&&(0,d.jsx)(v,{used:a.tokensUsed,limit:a.tokenLimit}),Array.isArray(a.allowedModels)&&a.allowedModels.length>0&&(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1 truncate",title:a.allowedModels.join(", "),children:["Models: ",a.allowedModels.join(", ")]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),a.scope&&(0,d.jsxs)("p",{className:"text-xs text-primary mt-1",children:["Scoped (",(a.scope.providers||[]).length," provider",1===(a.scope.providers||[]).length?"":"s",")"]}),(0,d.jsx)(s,{apiKey:a,onChange:b=>bw(a.id,b),onRequestRestrict:()=>S({title:"Restrict API Key",message:`Restrict API key "${a.name}"?
|
|
1
|
+
exports.id=1482,exports.ids=[1482],exports.modules={19165:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>m,N9:()=>l,Nv:()=>o,RL:()=>k,YR:()=>i,ev:()=>n,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>j});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=3e4,j=5,k=1e4,l=6e4,m=5e3,n=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],o=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},70964:(a,b,c)=>{"use strict";c.d(b,{default:()=>z});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(50412),k=c(50377),l=c(67960),m=c(91937);function n({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:h}){return(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(j.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),h]})}function o({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function p({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}function q({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}var r=c(72738),s=c(92592);function t({value:a,onChange:b}){let[c,f]=(0,e.useState)([]),[g,h]=(0,e.useState)(!0),[i,j]=(0,e.useState)(()=>new Set),k=(0,e.useMemo)(()=>(function(a){let b=new Map;for(let c of a){if(!c?.id||"string"!=typeof c.id||!c.id.includes("/"))continue;let a=c.owned_by||c.id.slice(0,c.id.indexOf("/")),d=c.id.slice(c.id.indexOf("/")+1);b.has(a)||b.set(a,[]),b.get(a).push(d)}return b})(c),[c]),l=(0,e.useMemo)(()=>Array.from(k.keys()).sort((a,b)=>a.localeCompare(b)),[k]),m=null==a,n=(0,e.useMemo)(()=>new Set(a?.providers||[]),[a]);(0,e.useMemo)(()=>new Set(a?.models||[]),[a]);let o=b=>{let c=`${b}/`;return(a?.models||[]).filter(a=>a.startsWith(c))},p=(a,c)=>{0===a.length?b(null):b({providers:a,models:c})},q=a=>{j(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})};return g?(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Loading available providers…"}):(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,d.jsx)("input",{type:"checkbox",checked:m,onChange:a=>b(a.target.checked?null:{providers:[],models:[]})}),(0,d.jsx)("span",{children:"Unrestricted (key can reach every provider and model)"})]}),!m&&(0,d.jsxs)("div",{className:"flex flex-col gap-1 max-h-80 overflow-y-auto border border-black/[0.06] dark:border-white/[0.06] rounded-lg p-2",children:[0===l.length&&(0,d.jsx)("p",{className:"text-sm text-text-muted px-2 py-1",children:"No providers configured yet."}),l.map(b=>{let c,e=(0,s.rs)(b),f=s.Q2[e],g=k.get(b)||[],h=(c=(0,s.rs)(b),n.has(b)||n.has(c)),j=o(b),l=i.has(b);return(0,d.jsxs)("div",{className:"border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 py-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{type:"checkbox",checked:h,onChange:()=>{let c,d;return c=new Set(a?.providers||[]),d=(a?.models||[]).slice(),void(c.has(b)?(c.delete(b),d=d.filter(a=>!a.startsWith(`${b}/`))):c.add(b),p(Array.from(c),d))}}),(0,d.jsx)(r.A,{providerId:e,size:16}),(0,d.jsx)("button",{type:"button",className:"flex-1 text-left text-sm font-medium",onClick:()=>q(b),children:f?.name||b}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:h?0===j.length?`all ${g.length} models`:`${j.length}/${g.length} models`:""}),(0,d.jsx)("button",{type:"button",className:"material-symbols-outlined text-[16px] text-text-muted",onClick:()=>q(b),children:l?"expand_less":"expand_more"})]}),l&&(0,d.jsx)("div",{className:"pl-8 mt-1 flex flex-col gap-1",children:g.map(c=>{let e=`${b}/${c}`,f=h&&(0===j.length||j.includes(e));return(0,d.jsxs)("label",{className:"flex items-center gap-2 text-xs",children:[(0,d.jsx)("input",{type:"checkbox",checked:f,onChange:()=>{let d,e,f,g,h,i;return(e=new Set(a?.providers||[])).add(b),f=`${b}/${c}`,g=o(b),h=k.get(b)||[],i=(a?.models||[]).filter(a=>!a.startsWith(`${b}/`)),void(0===g.length?d=h.filter(a=>a!==c).map(a=>`${b}/${a}`):g.includes(f)?d=g.filter(a=>a!==f):(d=[...g,f]).length===h.length&&(d=[]),p(Array.from(e),[...i,...d]))}}),(0,d.jsx)("span",{className:"font-mono",children:c})]},e)})})]},b)})]})]})}function u({apiKey:a,onChange:b,onRequestRestrict:c}){let f=a.access||{restricted:!1,allow:[]},[g,h]=(0,e.useState)(!1),[i,k]=(0,e.useState)([]),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)({}),[p,q]=(0,e.useState)(""),r=async()=>{if(!l){m(!0);try{let[a,b]=await Promise.all([fetch("/api/providers"),fetch("/api/models/alias")]);a.ok&&k((await a.json()).connections||[]),b.ok&&o((await b.json()).aliases||{})}catch(a){console.log("Error loading picker data:",a)}}},t=a=>b({restricted:!0,allow:a}),v=a=>{let b=String(a||"").trim();b&&!f.allow.some(a=>a.toLowerCase()===b.toLowerCase())&&t([...f.allow,b])},w=a=>t(f.allow.filter(b=>b!==a)),x=()=>{v(p),q("")},y=[],z=new Set;for(let a of i){let b=(0,s.wG)(a.provider)||a.provider,c=`${b}/*`;z.has(b)||f.allow.some(a=>a.toLowerCase()===c.toLowerCase())||(z.add(b),y.push({value:c,label:s.Q2[a.provider]?.name||a.provider}))}return y.sort((a,b)=>a.label.localeCompare(b.label)),(0,d.jsxs)("div",{className:"mt-2","data-testid":"key-access",children:[(0,d.jsx)(j.lM,{size:"sm",checked:f.restricted,label:"Restrict access",onChange:a=>a?c():b({restricted:!1,allow:f.allow})}),f.restricted&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[0===f.allow.length&&(0,d.jsx)("span",{className:"text-xs text-orange-500",children:"No combos or models allowed — this key can call nothing."}),f.allow.map(a=>{let b=function(a){if("string"!=typeof a||!a.endsWith("/*"))return null;let b=a.slice(0,-2).trim();return b&&!b.includes("/")?b:null}(a);return(0,d.jsxs)("span",{className:"flex items-center gap-1 rounded-xl border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-xs text-text-main",title:b?`Every model of provider "${b}"`:void 0,children:[a,(0,d.jsx)("button",{onClick:()=>w(a),className:"rounded text-text-muted hover:text-red-500",title:`Remove ${a}`,"aria-label":`Remove ${a}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"12px"},children:"close"})})]},a)}),(0,d.jsxs)("button",{onClick:()=>{h(!0),r()},className:"flex items-center gap-0.5 rounded-xl border border-dashed border-black/10 px-2 py-0.5 text-xs font-medium text-primary hover:border-primary/50 dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"14px"},children:"add"}),"Add combo or model"]})]}),(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,d.jsxs)("select",{value:"",onFocus:r,onMouseDown:r,onChange:a=>v(a.target.value),className:"min-w-0 rounded-xl border border-black/10 bg-transparent px-2 py-0.5 text-xs text-text-main dark:border-white/10","aria-label":"Allow every model of a provider",children:[(0,d.jsx)("option",{value:"",disabled:!0,children:"All models of a provider…"}),y.map(a=>(0,d.jsxs)("option",{value:a.value,children:[a.label," (",a.value,")"]},a.value))]}),(0,d.jsx)("input",{value:p,onChange:a=>q(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),x())},placeholder:"Type a model, combo or provider/*","aria-label":"Type an allowed model, combo or provider/*",className:"min-w-0 flex-1 rounded-xl border border-black/10 bg-transparent px-2 py-0.5 font-mono text-xs text-text-main outline-none focus:border-primary/50 dark:border-white/10"}),(0,d.jsx)("button",{onClick:x,disabled:!p.trim(),className:"rounded-xl border border-black/10 px-2 py-0.5 text-xs font-medium text-primary hover:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10",children:"Add"})]})]}),g&&(0,d.jsx)(j.rq,{isOpen:g,onClose:()=>h(!1),onSelect:a=>v(a?.value),onDeselect:a=>w(f.allow.find(b=>b.toLowerCase()===String(a?.value).toLowerCase())),activeProviders:i,modelAliases:n,title:`Allowed for "${a.name}"`,addedModelValues:f.allow,closeOnSelect:!1})]})}t.propTypes={value:g().shape({providers:g().arrayOf(g().string),models:g().arrayOf(g().string)}),onChange:g().func.isRequired},Object.freeze({restricted:!1,allow:Object.freeze([])}),Object.freeze(["webSearch","webFetch"]),u.propTypes={apiKey:g().shape({id:g().string.isRequired,name:g().string,access:g().shape({restricted:g().bool,allow:g().arrayOf(g().string)})}).isRequired,onChange:g().func.isRequired,onRequestRestrict:g().func.isRequired};let v=[{label:"100K",value:"100000"},{label:"500K",value:"500000"},{label:"1M",value:"1000000"},{label:"5M",value:"5000000"},{label:"10M",value:"10000000"}];function w(a){let b=Math.max(0,Number(a)||0);return b>=1e6?`${(b/1e6).toFixed(+(b%1e6!=0))}M`:b>=1e3?`${(b/1e3).toFixed(+(b%1e3!=0))}K`:String(b)}function x({used:a,limit:b}){let c=Math.max(1,Number(b)||1),e=Math.max(0,Number(a)||0),f=Math.min(100,Math.round(e/c*100)),g=Math.max(0,c-e),h=f>=90?{bar:"bg-red-500",text:"text-red-600 dark:text-red-400"}:f>=75?{bar:"bg-amber-500",text:"text-amber-600 dark:text-amber-400"}:{bar:"bg-emerald-500",text:"text-text-muted"};return(0,d.jsxs)("div",{className:"mt-2 max-w-sm",title:`${w(e)} of ${w(c)} tokens used`,children:[(0,d.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-3 text-[11px]",children:[(0,d.jsxs)("span",{className:h.text,children:[f,"% used"]}),(0,d.jsxs)("span",{className:"text-text-muted",children:[w(g)," remaining"]})]}),(0,d.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-black/10 dark:bg-white/10",role:"progressbar","aria-label":`Token usage: ${f}% used, ${w(g)} remaining`,"aria-valuemin":0,"aria-valuemax":c,"aria-valuenow":Math.min(e,c),children:(0,d.jsx)("div",{className:`h-full rounded-full transition-[width] duration-300 ${h.bar}`,style:{width:`${f}%`}})})]})}function y({apiKey:a,activeProviders:b,modelAliases:c,onClose:f,onSave:g}){let[h,i]=(0,e.useState)(a.expiresAt?a.expiresAt.slice(0,16):""),[k,l]=(0,e.useState)(a.allowedModels||[]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(null==a.tokenLimit?"unlimited":"unchanged"),[q,r]=(0,e.useState)(!1),[s,t]=(0,e.useState)(!1),u=null!=a.tokenLimit,x=async()=>{t(!0),await g({expiresAt:h||null,allowedModels:k,..."unlimited"===o?{tokenLimit:null}:m?{[u?"tokenLimitIncrement":"tokenLimit"]:m}:{}}),t(!1)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.aF,{isOpen:!0,onClose:f,title:`Edit ${a.name}`,children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Expires at (optional)",type:"datetime-local",value:h,onChange:a=>i(a.target.value),hint:"Leave blank for no expiry."}),(0,d.jsx)(j.pd,{label:u?"Add tokens":"Set token limit",type:"number",min:"1",step:"1",value:m,onChange:a=>{let b=a.target.value;n(b),p(b?"amount":u?"unchanged":"unlimited")},placeholder:u?"e.g. 500000":"e.g. 1000000",hint:u?`Added to the current ${w(a.tokenLimit)} limit; usage is preserved.`:"Choose Unlimited to remove the limit."}),(0,d.jsxs)("div",{className:"-mt-2 flex flex-wrap gap-1.5","aria-label":"Token limit presets",children:[v.map(a=>{let b="amount"===o&&m===a.value;return(0,d.jsx)("button",{type:"button",onClick:()=>{n(a.value),p("amount")},"aria-pressed":b,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${b?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:a.label},a.value)}),(0,d.jsx)("button",{type:"button",onClick:()=>{n(""),p("unlimited")},"aria-pressed":"unlimited"===o,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${"unlimited"===o?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:"Unlimited"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-1.5 block text-sm font-medium text-text-main",children:"Allowed models"}),(0,d.jsx)("div",{className:"flex min-h-12 flex-wrap gap-1 rounded-lg border border-border bg-surface-2 p-2",children:k.length?k.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs text-primary",children:[(0,d.jsx)("span",{children:a}),(0,d.jsx)("button",{type:"button",onClick:()=>l(b=>b.filter(b=>b!==a)),"aria-label":`Remove ${a}`,className:"material-symbols-outlined text-[14px]",children:"close"})]},a)):(0,d.jsx)("span",{className:"p-1 text-xs text-text-muted",children:"All models allowed"})}),(0,d.jsxs)("button",{type:"button",onClick:()=>r(!0),className:"mt-2 flex w-full items-center justify-center gap-1 rounded-lg border border-dashed border-black/10 py-2 text-xs font-medium text-primary dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"edit"}),"Edit model access"]})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:x,fullWidth:!0,disabled:s,children:s?"Saving...":"Save changes"}),(0,d.jsx)(j.$n,{onClick:f,variant:"ghost",fullWidth:!0,disabled:s,children:"Cancel"})]})]})}),q&&(0,d.jsx)(j.rq,{isOpen:!0,onClose:()=>r(!1),onSelect:a=>l(b=>b.includes(a.value)?b:[...b,a.value]),onDeselect:a=>l(b=>b.filter(b=>b!==a.value)),activeProviders:b,modelAliases:c,addedModelValues:k,closeOnSelect:!1,title:"Edit allowed models"})]})}function z({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)(!0),[h,r]=(0,e.useState)(!1),[s,w]=(0,e.useState)(""),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(""),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)([]),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(null),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(null),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useState)(null),[W,X]=(0,e.useState)(null),[Y,Z]=(0,e.useState)(!1),[$,_]=(0,e.useState)(!0),[aa,ab]=(0,e.useState)(!0),[ac,ad]=(0,e.useState)(!1),[ae,af]=(0,e.useState)(!1),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(""),[am,an]=(0,e.useState)(""),[ao,ap]=(0,e.useState)(!1),[aq,ar]=(0,e.useState)(""),[as,at]=(0,e.useState)(null),[au,av]=(0,e.useState)(!1),[aw,ax]=(0,e.useState)(!1),[ay,az]=(0,e.useState)(!1),[aA,aB]=(0,e.useState)(!1),[aC,aD]=(0,e.useState)(""),[aE,aF]=(0,e.useState)(!1),[aG,aH]=(0,e.useState)(""),[aI,aJ]=(0,e.useState)(null),[aK,aL]=(0,e.useState)(""),[aM,aN]=(0,e.useState)(""),[aO,aP]=(0,e.useState)(null),[aQ,aR]=(0,e.useState)(!1),[aS,aT]=(0,e.useState)([]),[aU,aV]=(0,e.useState)(""),[aW,aX]=(0,e.useState)(!1),[aY,aZ]=(0,e.useState)(!1),[a$,a_]=(0,e.useState)(!1),a0=(0,e.useRef)(null);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[a1,a2]=(0,e.useState)(!1),[a3,a4]=(0,e.useState)(!1),[a5,a6]=(0,e.useState)(new Set),[a7,a8]=(0,e.useState)(!1),{copied:a9,copy:ba}=(0,k.C)(),bb=!$||!aa,bc=$?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=l.t6&&d(!1))},[]);let bd=async a=>{try{await m.A.getState().patchSettings({tunnelDashboardAccess:a})&&ad(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},be=async a=>{try{await m.A.getState().patchSettings({requireApiKey:a})&&Z(a)}catch(a){console.log("Error updating requireApiKey:",a)}},bf=async()=>{try{let a=await fetch("/api/keys"),b=await a.json();a.ok&&c(b.keys||[])}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},bg=async(...a)=>{ap(!0),ar("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<l.Cp;){if(await new Promise(a=>setTimeout(a,l.Hx)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return ah(!0),ap(!1),ar(""),!0;if((Date.now()-c)%1e4<l.Hx)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return at({type:"error",message:"Tunnel process stopped unexpectedly."}),ap(!1),ar(""),!1}}catch{}}return at({type:"error",message:"Tunnel created but not reachable. Please try again."}),ap(!1),ar(""),!1},bh=async()=>{av(!1),ap(!0),at(null),ar("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?ar(`Downloading cloudflared... ${c.download.progress}%`):a&&ar("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void at({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void at({type:"error",message:"No tunnel URL returned"});al(d),an(c.publicUrl||""),await bg(c.publicUrl,d)}catch(a){at({type:"error",message:a.message})}finally{a=!1,ap(!1),ar("")}},bi=async()=>{ap(!0),at(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(ah(!1),al(""),ax(!1),at({type:"success",message:"Tunnel disabled"})):at({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){at({type:"error",message:a.message})}finally{ap(!1)}},bj=async()=>{aP(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aP(b.installed),b}}catch{}return aP(!1),{installed:!1}},bk=async()=>{aR(!0),aJ(null),aT([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aU})});aV("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aT(a=>[...a.slice(-50),d.message]);else if("done"===c){aP(!0),aR(!1),aZ(!1),bo();return}else"error"===c&&aJ({type:"error",message:d.error||"Install failed"})}}}catch(a){aJ({type:"error",message:a.message})}finally{aR(!1)}},bl=async a=>{aH("Waiting for Tailscale ready...");let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<l.Cp;){await new Promise(a=>setTimeout(a,l.Hx));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},bm=(a,b)=>{aL(a),aN(b)},bn=()=>{aL(""),aN("")},bo=async()=>{aZ(!1),aX(!0),aF(!0),aJ(null),aH("Connecting..."),bn();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aD(b.tunnelUrl||"");let a=await bl(b.tunnelUrl);az(!0),aJ(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.needsLogin&&b.authUrl){bm(b.authUrl,"Open Login Page"),aH('Login required — click "Open Login Page" to continue');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){bn(),aH("Starting funnel...");let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aD(b.tunnelUrl||"");let a=await bl(b.tunnelUrl);az(!0),aJ(a?null:{type:"warning",message:"Connected but not reachable yet."})}else b.funnelNotEnabled&&b.enableUrl?await bp(b.enableUrl):aJ({type:"error",message:b.error||"Failed to start funnel"});return}}catch{}}bn(),aJ({type:"error",message:"Login timed out. Please try again."});return}if(b.funnelNotEnabled&&b.enableUrl)return void await bp(b.enableUrl);aJ({type:"error",message:b.error||"Failed to connect"})}catch(a){aJ({type:"error",message:a.message})}finally{aF(!1),aX(!1),aH(""),bn()}},bp=async a=>{bm(a,"Open Funnel Settings"),aH('Click "Open Funnel Settings" to enable Funnel...');for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){bn(),aD(b.tunnelUrl||"");let a=await bl(b.tunnelUrl);az(!0),aJ(a?null:{type:"warning",message:"Connected but not reachable yet."});return}if(b.funnelNotEnabled)continue;if(b.error){bn(),aJ({type:"error",message:b.error});return}}catch{}}bn(),aJ({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bq=async()=>{aF(!0),aJ(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(az(!1),aD(""),a_(!1),aJ({type:"success",message:"Tailscale disabled"})):aJ({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){aJ({type:"error",message:a.message})}finally{aF(!1)}},br=async()=>{aJ(null),aT([]);let a=await bj();a?.installed&&a?.hasCachedPassword?bo():aZ(!0)},bs=async()=>{if(s.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,expiresAt:A||null,tokenLimit:C||null,allowedModels:E,scope:M})}),b=await a.json();a.ok&&(P(b.key),await bf(),w(""),B(""),D(""),F([]),H(!1),N(null),r(!1))}catch(a){console.log("Error creating key:",a)}},bt=async()=>{if(U)try{(await fetch(`/api/keys/${U.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:W})})).ok&&(c(a=>a.map(a=>a.id===U.id?{...a,scope:W}:a)),V(null),X(null))}catch(a){console.log("Error updating key scope:",a)}},bu=async a=>{T({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{T(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),a6(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},bv=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},bw=async(a,b)=>{let c=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error||"Failed to update key");await bf(),R(null)},bx=async(a,b)=>{try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({access:b})}),e=await d.json().catch(()=>({}));d.ok&&e.key?c(b=>b.map(b=>b.id===a?{...b,access:e.key.access}:b)):console.log("Error updating key access:",e.error||d.status)}catch(a){console.log("Error updating key access:",a)}},[by,bz]=(0,e.useState)("/v1");return f?(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]}):(0,d.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,d.jsxs)(j.Zp,{children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(n,{label:"Local",url:by,copyId:"local_url",copied:a9,onCopy:ba}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ag?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),ag&&!ao&&ai?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{value:`${am||ak}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>ba(`${am||ak}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===a9?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>ax(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ag||ao||ai?ao?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aq||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{ap(!1),ar("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):as?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),as.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",onClick:()=>av(!0),children:"Enable"})]}):ae?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>af(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{bb?at({type:"error",message:`Security required: ${bc}`}):Y?av(!0):at({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a1?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>ax(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ay?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ay&&!aE&&aA?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{value:`${aC}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)("button",{onClick:()=>ba(`${aC}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===a9?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>a_(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ay||aE||aA?aE||aW?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aG||"Connecting..."]}),aK&&(0,d.jsx)(j.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aK,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:aM||"Open"}),(0,d.jsx)("button",{onClick:()=>{aF(!1),aX(!1),aH(""),bn()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aI?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aI.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",onClick:br,children:"Enable"})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{bb?aJ({type:"error",message:`Security required: ${bc}`}):br()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a3?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>a_(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),bb&&!ag&&!ay&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(q,{message:bc,action:{label:"Open settings",href:"/dashboard/profile"}})}),(ag||ay)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!Y&&(0,d.jsx)(q,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!$||!aa)&&(0,d.jsx)(q,{message:$?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:$?"Change password":"Enable",href:"/dashboard/profile"}})]}),(ag||ay)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(j.lM,{checked:ac,onChange:()=>bd(!ac)}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,d.jsx)(p,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,d.jsxs)(j.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,d.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>r(!0),children:"Create Key"})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,d.jsx)(j.lM,{checked:Y,onChange:()=>be(!Y)})]}),a7&&!Y&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(q,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>r(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,d.jsxs)("div",{className:`group flex items-start justify-between gap-3 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0 flex-wrap",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono break-all min-w-0",children:a5.has(a.id)?a.key:(b=a.key)&&!(b.length<=10)?b.slice(0,6)+"•".repeat(b.length-10)+b.slice(-4):b||""}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)("button",{onClick:()=>{var b;return b=a.id,void a6(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:a5.has(a.id)?"Hide key":"Show key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a5.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{onClick:()=>ba(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a9===a.id?"check":"content_copy"})})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap text-xs text-text-muted",children:[(0,d.jsxs)("span",{children:["Created ",new Date(a.createdAt).toLocaleDateString(),a.expiresAt?` \xb7 Expires ${new Date(a.expiresAt).toLocaleString()}`:" \xb7 No expiry",null!=a.tokenLimit?` \xb7 ${a.tokensUsed}/${a.tokenLimit} tokens`:" \xb7 Unlimited tokens"]}),a.usage?.requests>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)("span",{children:[a.usage.requests.toLocaleString()," reqs"]}),(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)("span",{children:[a.usage.totalTokens.toLocaleString()," tokens"]}),(0,d.jsx)("span",{children:"•"}),(0,d.jsxs)(i(),{href:"/dashboard/usage?view=apiKey",className:"text-primary hover:underline font-medium inline-flex items-center gap-0.5",children:["View usage",(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px] rtl:rotate-180",children:"arrow_forward"})]})]}):null]}),null!=a.tokenLimit&&(0,d.jsx)(x,{used:a.tokensUsed,limit:a.tokenLimit}),Array.isArray(a.allowedModels)&&a.allowedModels.length>0&&(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1 truncate",title:a.allowedModels.join(", "),children:["Models: ",a.allowedModels.join(", ")]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),a.scope&&(0,d.jsxs)("p",{className:"text-xs text-primary mt-1",children:["Scoped (",(a.scope.providers||[]).length," provider",1===(a.scope.providers||[]).length?"":"s",")"]}),(0,d.jsx)(u,{apiKey:a,onChange:b=>bx(a.id,b),onRequestRestrict:()=>T({title:"Restrict API Key",message:`Restrict API key "${a.name}"?
|
|
2
2
|
|
|
3
|
-
It will only be able to call the combos and models you add. Until you add one, it can call nothing.`,onConfirm:async()=>{
|
|
3
|
+
It will only be able to call the combos and models you add. Until you add one, it can call nothing.`,onConfirm:async()=>{T(null),bx(a.id,{restricted:!0,allow:a.access?.allow||[]})}})})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pt-0.5",children:[(0,d.jsx)("button",{onClick:()=>{V(a),X(a.scope??null)},className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:"Edit scope",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,d.jsx)(j.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?T({title:"Pause API Key",message:`Pause API key "${a.name}"?
|
|
4
4
|
|
|
5
|
-
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{S(null),bu(a.id,b)}}):bu(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{onClick:()=>Q(a),className:"p-2 hover:bg-primary/10 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:"Edit key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,d.jsx)("button",{onClick:()=>bt(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),P&&(0,d.jsx)(w,{apiKey:P,activeProviders:H,modelAliases:J,onClose:()=>Q(null),onSave:a=>bv(P.id,a)},P.id),(0,d.jsx)(h.aF,{isOpen:p,title:"Create API Key",onClose:()=>{q(!1),y(""),A(""),C(""),E([]),G(!1),M(null)},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(h.pd,{label:"Key Name",value:u,onChange:a=>y(a.target.value),placeholder:"Production Key"}),(0,d.jsx)(h.pd,{label:"Expires at (optional)",type:"datetime-local",value:z,onChange:a=>A(a.target.value),hint:"Leave blank for no expiry."}),(0,d.jsx)(h.pd,{label:"Token limit (optional)",type:"number",min:"1",step:"1",value:B,onChange:a=>C(a.target.value),placeholder:"Unlimited",hint:"Total input and output tokens. Strictly enforced."}),(0,d.jsxs)("div",{className:"-mt-2 flex flex-wrap gap-1.5","aria-label":"Token limit presets",children:[t.map(a=>{let b=B===a.value;return(0,d.jsx)("button",{type:"button",onClick:()=>C(a.value),"aria-pressed":b,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${b?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:a.label},a.value)}),(0,d.jsx)("button",{type:"button",onClick:()=>C(""),"aria-pressed":!B,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${!B?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:"Unlimited"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Allowed models (optional)"}),0===D.length?(0,d.jsxs)("div",{className:"rounded-lg border border-dashed border-black/10 bg-black/[0.01] px-3 py-4 text-center dark:border-white/10 dark:bg-white/[0.01]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mb-1 text-xl text-text-muted",children:"layers"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"All models are allowed"})]}):(0,d.jsx)("div",{className:"flex max-h-28 flex-wrap gap-1 overflow-y-auto rounded-lg border border-border bg-surface-2 p-2",children:D.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs text-primary",children:[(0,d.jsx)("span",{className:"max-w-48 truncate",children:a}),(0,d.jsx)("button",{type:"button",onClick:()=>E(b=>b.filter(b=>b!==a)),"aria-label":`Remove ${a}`,className:"material-symbols-outlined text-[14px] hover:text-red-500",children:"close"})]},a))}),(0,d.jsxs)("button",{type:"button",onClick:()=>G(!0),className:"flex w-full items-center justify-center gap-1 rounded-lg border border-dashed border-black/10 py-2 text-xs font-medium text-primary transition-colors hover:border-primary/50 dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),D.length?"Add another model":"Choose models"]}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Leave empty to allow every model."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Access Scope"}),(0,d.jsx)(r,{value:L,onChange:M})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:br,fullWidth:!0,disabled:!u.trim(),children:"Create"}),(0,d.jsx)(h.$n,{onClick:()=>{q(!1),y(""),A(""),C(""),E([]),G(!1),M(null)},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!T,title:`Edit Scope — ${T?.name||""}`,onClose:()=>{U(null),W(null)},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(r,{value:V,onChange:W}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bs,fullWidth:!0,children:"Save"}),(0,d.jsx)(h.$n,{onClick:()=>{U(null),W(null)},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),F&&(0,d.jsx)(h.rq,{isOpen:F,onClose:()=>G(!1),onSelect:a=>E(b=>b.includes(a.value)?b:[...b,a.value]),onDeselect:a=>E(b=>b.filter(b=>b!==a.value)),activeProviders:H,modelAliases:J,addedModelValues:D,closeOnSelect:!1,title:"Choose models for this API key"}),(0,d.jsx)(h.aF,{isOpen:!!N,title:"API Key Created",onClose:()=>O(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:N||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===a8?"check":"content_copy",onClick:()=>a9(N,"created_key"),children:"created_key"===a8?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>O(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:at,title:"Enable Tunnel",onClose:()=>au(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:j.oX.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bg,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(h.$n,{onClick:()=>au(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:av,title:"Disable Tunnel",onClose:()=>!an&&aw(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bh,fullWidth:!0,disabled:an,variant:"danger",children:an?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>aw(!1),variant:"ghost",fullWidth:!0,disabled:an,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:aX,title:"Tailscale Funnel",onClose:()=>{aP||(aY(!1),aU(""),aI(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aN&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aN&&!aP&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bj,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(h.$n,{onClick:()=>aY(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aP&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aR.length>0&&(0,d.jsx)("div",{ref:a_,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aR.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aN&&!aP&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>bn(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>aY(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aH&&(0,d.jsx)(m,{status:aH})]})}),(0,d.jsx)(h.aF,{isOpen:aZ,title:"Disable Tailscale",onClose:()=>!aD&&a$(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bp,fullWidth:!0,disabled:aD,variant:"danger",children:aD?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>a$(!1),variant:"ghost",fullWidth:!0,disabled:aD,children:"Cancel"})]})]})}),(0,d.jsx)(h.uo,{isOpen:!!R,onClose:()=>S(null),onConfirm:R?.onConfirm,title:R?.title||"Confirm",message:R?.message,variant:"danger"})]})}v.propTypes={used:g().number,limit:g().number.isRequired},w.propTypes={apiKey:g().object.isRequired,activeProviders:g().array.isRequired,modelAliases:g().object.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired},x.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.n,"machine-id"),m=h().join(k.n,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.n,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>m,N9:()=>l,Nv:()=>o,RL:()=>k,YR:()=>i,ev:()=>n,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>j});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=3e4,j=5,k=1e4,l=6e4,m=5e3,n=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],o=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}},89309:(a,b,c)=>{Promise.resolve().then(c.bind(c,50416))}};
|
|
5
|
+
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{T(null),bv(a.id,b)}}):bv(a.id,b)},title:a.isActive?"Pause key":"Resume key"}),(0,d.jsx)("button",{onClick:()=>R(a),className:"p-2 hover:bg-primary/10 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:"Edit key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})}),(0,d.jsx)("button",{onClick:()=>bu(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),Q&&(0,d.jsx)(y,{apiKey:Q,activeProviders:I,modelAliases:K,onClose:()=>R(null),onSave:a=>bw(Q.id,a)},Q.id),(0,d.jsx)(j.aF,{isOpen:h,title:"Create API Key",onClose:()=>{r(!1),w(""),B(""),D(""),F([]),H(!1),N(null)},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(j.pd,{label:"Key Name",value:s,onChange:a=>w(a.target.value),placeholder:"Production Key"}),(0,d.jsx)(j.pd,{label:"Expires at (optional)",type:"datetime-local",value:A,onChange:a=>B(a.target.value),hint:"Leave blank for no expiry."}),(0,d.jsx)(j.pd,{label:"Token limit (optional)",type:"number",min:"1",step:"1",value:C,onChange:a=>D(a.target.value),placeholder:"Unlimited",hint:"Total input and output tokens. Strictly enforced."}),(0,d.jsxs)("div",{className:"-mt-2 flex flex-wrap gap-1.5","aria-label":"Token limit presets",children:[v.map(a=>{let b=C===a.value;return(0,d.jsx)("button",{type:"button",onClick:()=>D(a.value),"aria-pressed":b,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${b?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:a.label},a.value)}),(0,d.jsx)("button",{type:"button",onClick:()=>D(""),"aria-pressed":!C,className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${!C?"border-primary bg-primary text-white":"border-border bg-surface-2 text-text-muted hover:border-primary/50 hover:text-primary"}`,children:"Unlimited"})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-text-main",children:"Allowed models (optional)"}),0===E.length?(0,d.jsxs)("div",{className:"rounded-lg border border-dashed border-black/10 bg-black/[0.01] px-3 py-4 text-center dark:border-white/10 dark:bg-white/[0.01]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined mb-1 text-xl text-text-muted",children:"layers"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"All models are allowed"})]}):(0,d.jsx)("div",{className:"flex max-h-28 flex-wrap gap-1 overflow-y-auto rounded-lg border border-border bg-surface-2 p-2",children:E.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs text-primary",children:[(0,d.jsx)("span",{className:"max-w-48 truncate",children:a}),(0,d.jsx)("button",{type:"button",onClick:()=>F(b=>b.filter(b=>b!==a)),"aria-label":`Remove ${a}`,className:"material-symbols-outlined text-[14px] hover:text-red-500",children:"close"})]},a))}),(0,d.jsxs)("button",{type:"button",onClick:()=>H(!0),className:"flex w-full items-center justify-center gap-1 rounded-lg border border-dashed border-black/10 py-2 text-xs font-medium text-primary transition-colors hover:border-primary/50 dark:border-white/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),E.length?"Add another model":"Choose models"]}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Leave empty to allow every model."})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium mb-2",children:"Access Scope"}),(0,d.jsx)(t,{value:M,onChange:N})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bs,fullWidth:!0,disabled:!s.trim(),children:"Create"}),(0,d.jsx)(j.$n,{onClick:()=>{r(!1),w(""),B(""),D(""),F([]),H(!1),N(null)},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:!!U,title:`Edit Scope — ${U?.name||""}`,onClose:()=>{V(null),X(null)},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)(t,{value:W,onChange:X}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bt,fullWidth:!0,children:"Save"}),(0,d.jsx)(j.$n,{onClick:()=>{V(null),X(null)},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),G&&(0,d.jsx)(j.rq,{isOpen:G,onClose:()=>H(!1),onSelect:a=>F(b=>b.includes(a.value)?b:[...b,a.value]),onDeselect:a=>F(b=>b.filter(b=>b!==a.value)),activeProviders:I,modelAliases:K,addedModelValues:E,closeOnSelect:!1,title:"Choose models for this API key"}),(0,d.jsx)(j.aF,{isOpen:!!O,title:"API Key Created",onClose:()=>P(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{value:O||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"created_key"===a9?"check":"content_copy",onClick:()=>ba(O,"created_key"),children:"created_key"===a9?"Copied!":"Copy"})]}),(0,d.jsx)(j.$n,{onClick:()=>P(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(j.aF,{isOpen:au,title:"Enable Tunnel",onClose:()=>av(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local 9Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:l.oX.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bh,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(j.$n,{onClick:()=>av(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:aw,title:"Disable Tunnel",onClose:()=>!ao&&ax(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bi,fullWidth:!0,disabled:ao,variant:"danger",children:ao?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>ax(!1),variant:"ghost",fullWidth:!0,disabled:ao,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:aY,title:"Tailscale Funnel",onClose:()=>{aQ||(aZ(!1),aV(""),aJ(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aO&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aO&&!aQ&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bk,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(j.$n,{onClick:()=>aZ(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aQ&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aS.length>0&&(0,d.jsx)("div",{ref:a0,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aS.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aO&&!aQ&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:()=>bo(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(j.$n,{onClick:()=>aZ(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aI&&(0,d.jsx)(o,{status:aI})]})}),(0,d.jsx)(j.aF,{isOpen:a$,title:"Disable Tailscale",onClose:()=>!aE&&a_(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bq,fullWidth:!0,disabled:aE,variant:"danger",children:aE?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>a_(!1),variant:"ghost",fullWidth:!0,disabled:aE,children:"Cancel"})]})]})}),(0,d.jsx)(j.uo,{isOpen:!!S,onClose:()=>T(null),onConfirm:S?.onConfirm,title:S?.title||"Confirm",message:S?.message,variant:"danger"})]})}x.propTypes={used:g().number,limit:g().number.isRequired},y.propTypes={apiKey:g().object.isRequired,activeProviders:g().array.isRequired,modelAliases:g().object.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired},z.propTypes={machineId:g().string.isRequired}},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}},89309:(a,b,c)=>{Promise.resolve().then(c.bind(c,70964))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=1522,exports.ids=[1522],exports.modules={6595:(a,b,c)=>{function d(a){return a.split(/[-_\s]+/).filter(Boolean).map(a=>/^\d/.test(a)?a:a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}c.d(b,{g5:()=>h,ec:()=>j,gr:()=>i,pk:()=>g,Kq:()=>f});let e=[[/^kimi-k(\d+(?:\.\d+)?)(-thinking)?$/i,a=>`Kimi K${a[1]}${a[2]?" Thinking":""}`],[/^glm-(\d+(?:\.\d+)?)(v)?$/i,a=>`GLM ${a[1]}${a[2]?"V (Vision)":""}`],[/^minimax-m(\d+(?:\.\d+)?)$/i,a=>`MiniMax M${a[1]}`],[/^gpt-(.+)$/i,a=>`GPT ${d(a[1])}`],[/^gemini-(.+)$/i,a=>`Gemini ${d(a[1])}`],[/^grok-(.+)$/i,a=>`Grok ${d(a[1])}`],[/^deepseek-(.+)$/i,a=>`DeepSeek ${d(a[1])}`],[/^qwen([\d.]+.*)$/i,a=>`Qwen ${d(a[1])}`]];function f(a){return"string"!=typeof a?a:a.replace(/(\d)-(\d)/g,"$1.$2")}function g(a){let b="string"==typeof a?{id:a}:a;return void 0!==b.name?b:{...b,name:function(a){if("string"!=typeof a)return a;for(let[b,c]of e){let d=a.match(b);if(d)return c(d)}return a}(b.id)}}function h(a){return a?.strip||[]}function i(a){return a?.targetFormat||null}function j(a){return a?.supportedFormats||null}},7972:(a,b,c)=>{c.d(b,{_M:()=>o,pp:()=>p,bU:()=>n,P9:()=>l});let d={alloy:{id:"alloy",name:"Alloy"},ash:{id:"ash",name:"Ash"},ballad:{id:"ballad",name:"Ballad"},cedar:{id:"cedar",name:"Cedar"},coral:{id:"coral",name:"Coral"},echo:{id:"echo",name:"Echo"},fable:{id:"fable",name:"Fable"},marin:{id:"marin",name:"Marin"},nova:{id:"nova",name:"Nova"},onyx:{id:"onyx",name:"Onyx"},sage:{id:"sage",name:"Sage"},shimmer:{id:"shimmer",name:"Shimmer"},verse:{id:"verse",name:"Verse"}},e=(...a)=>a.map(a=>({...d[a],type:"tts"})),f=e("alloy","ash","coral","echo","fable","nova","onyx","sage","shimmer"),g=e("alloy","ash","ballad","cedar","coral","echo","fable","marin","nova","onyx","sage","shimmer","verse"),h=["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Vindemiatrix","Sadachbia","Sadaltager","Sulafat"].map(a=>({id:a,name:a,type:"tts"})),i=[{id:"mimo_default",name:"mimo_default"},{id:"冰糖",name:"冰糖"},{id:"茉莉",name:"茉莉"},{id:"苏打",name:"苏打"},{id:"白桦",name:"白桦"},{id:"Mia",name:"Mia"},{id:"Chloe",name:"Chloe"},{id:"Milo",name:"Milo"},{id:"Dean",name:"Dean"}].map(a=>({type:"tts",...a})),j={eleven_v3:{maxChars:5e3,langCode:!0,classic:!1},eleven_multilingual_v2:{maxChars:1e4,langCode:!1,classic:!0},eleven_flash_v2_5:{maxChars:4e4,langCode:!0,classic:!0},eleven_turbo_v2_5:{maxChars:4e4,langCode:!0,classic:!0}},k={maxChars:5e3,langCode:!1,classic:!1},l=a=>j[a]||k,m=[{id:"mp3_44100_128",name:"MP3 128 kbps (default)",container:"mp3"},{id:"mp3_44100_192",name:"MP3 192 kbps (Creator+)",container:"mp3"},{id:"mp3_22050_32",name:"MP3 32 kbps (smallest)",container:"mp3"},{id:"pcm_44100",name:"PCM 44.1 kHz (Pro+)",container:"pcm"},{id:"pcm_16000",name:"PCM 16 kHz",container:"pcm"},{id:"ulaw_8000",name:"\xb5-law 8 kHz (telephony)",container:"ulaw"}],n=a=>m.find(b=>b.id===a)?.container||"mp3",o={openai:{models:[{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"tts-1",name:"TTS-1",type:"tts"}],voices:{"gpt-4o-mini-tts":g,"tts-1":f,"tts-1-hd":f},allVoices:g},openrouter:{models:[{id:"openai/gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"openai/tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"openai/tts-1",name:"TTS-1",type:"tts"}],voices:{"openai/gpt-4o-mini-tts":g,"openai/tts-1":f,"openai/tts-1-hd":f},allVoices:g},elevenlabs:{models:[{id:"eleven_v3",name:"Eleven v3 (Most Expressive \xb7 70+ langs)",type:"tts"},{id:"eleven_multilingual_v2",name:"Multilingual v2 (Quality)",type:"tts"},{id:"eleven_flash_v2_5",name:"Flash v2.5 (Fastest)",type:"tts"},{id:"eleven_turbo_v2_5",name:"Turbo v2.5 (Fast)",type:"tts"}]},"edge-tts":{defaults:[{id:"en-US-AriaNeural",name:"Aria (en-US)",type:"tts"},{id:"en-US-GuyNeural",name:"Guy (en-US)",type:"tts"},{id:"en-GB-SoniaNeural",name:"Sonia (en-GB)",type:"tts"},{id:"vi-VN-HoaiMyNeural",name:"Hoai My (vi-VN)",type:"tts"},{id:"vi-VN-NamMinhNeural",name:"Nam Minh (vi-VN)",type:"tts"},{id:"zh-CN-XiaoxiaoNeural",name:"Xiaoxiao (zh-CN)",type:"tts"},{id:"zh-CN-YunxiNeural",name:"Yunxi (zh-CN)",type:"tts"},{id:"fr-FR-DeniseNeural",name:"Denise (fr-FR)",type:"tts"},{id:"de-DE-KatjaNeural",name:"Katja (de-DE)",type:"tts"},{id:"ja-JP-NanamiNeural",name:"Nanami (ja-JP)",type:"tts"},{id:"ko-KR-SunHiNeural",name:"SunHi (ko-KR)",type:"tts"}]},"local-device":{defaults:[{id:"default",name:"System Default Voice",type:"tts"}]},"google-tts":{defaults:[{id:"af",name:"Afrikaans",type:"tts"},{id:"ar",name:"Arabic",type:"tts"},{id:"bg",name:"Bulgarian",type:"tts"},{id:"bn",name:"Bengali",type:"tts"},{id:"bs",name:"Bosnian",type:"tts"},{id:"ca",name:"Catalan",type:"tts"},{id:"cs",name:"Czech",type:"tts"},{id:"cy",name:"Welsh",type:"tts"},{id:"da",name:"Danish",type:"tts"},{id:"de",name:"German",type:"tts"},{id:"el",name:"Greek",type:"tts"},{id:"en",name:"English",type:"tts"},{id:"eo",name:"Esperanto",type:"tts"},{id:"es",name:"Spanish",type:"tts"},{id:"et",name:"Estonian",type:"tts"},{id:"fi",name:"Finnish",type:"tts"},{id:"fr",name:"French",type:"tts"},{id:"gu",name:"Gujarati",type:"tts"},{id:"hi",name:"Hindi",type:"tts"},{id:"hr",name:"Croatian",type:"tts"},{id:"hu",name:"Hungarian",type:"tts"},{id:"hy",name:"Armenian",type:"tts"},{id:"id",name:"Indonesian",type:"tts"},{id:"is",name:"Icelandic",type:"tts"},{id:"it",name:"Italian",type:"tts"},{id:"ja",name:"Japanese",type:"tts"},{id:"jw",name:"Javanese",type:"tts"},{id:"km",name:"Khmer",type:"tts"},{id:"kn",name:"Kannada",type:"tts"},{id:"ko",name:"Korean",type:"tts"},{id:"la",name:"Latin",type:"tts"},{id:"lv",name:"Latvian",type:"tts"},{id:"mk",name:"Macedonian",type:"tts"},{id:"ml",name:"Malayalam",type:"tts"},{id:"mr",name:"Marathi",type:"tts"},{id:"my",name:"Myanmar (Burmese)",type:"tts"},{id:"ne",name:"Nepali",type:"tts"},{id:"nl",name:"Dutch",type:"tts"},{id:"no",name:"Norwegian",type:"tts"},{id:"pl",name:"Polish",type:"tts"},{id:"pt",name:"Portuguese",type:"tts"},{id:"ro",name:"Romanian",type:"tts"},{id:"ru",name:"Russian",type:"tts"},{id:"si",name:"Sinhala",type:"tts"},{id:"sk",name:"Slovak",type:"tts"},{id:"sq",name:"Albanian",type:"tts"},{id:"sr",name:"Serbian",type:"tts"},{id:"su",name:"Sundanese",type:"tts"},{id:"sv",name:"Swedish",type:"tts"},{id:"sw",name:"Swahili",type:"tts"},{id:"ta",name:"Tamil",type:"tts"},{id:"te",name:"Telugu",type:"tts"},{id:"th",name:"Thai",type:"tts"},{id:"tl",name:"Filipino",type:"tts"},{id:"tr",name:"Turkish",type:"tts"},{id:"uk",name:"Ukrainian",type:"tts"},{id:"ur",name:"Urdu",type:"tts"},{id:"vi",name:"Vietnamese",type:"tts"},{id:"zh-CN",name:"Chinese (Simplified)",type:"tts"},{id:"zh-TW",name:"Chinese (Traditional)",type:"tts"}]},gemini:{models:[{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS",type:"tts"},{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS",type:"tts"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS",type:"tts"}],voices:{"gemini-3.1-flash-tts-preview":h,"gemini-2.5-flash-preview-tts":h,"gemini-2.5-pro-preview-tts":h},allVoices:h},"xiaomi-mimo":{models:[{id:"mimo-v2.5-tts",name:"MiMo V2.5 TTS",type:"tts"}],voices:{"mimo-v2.5-tts":i}}};function p(){let a={};for(let[b,c]of Object.entries(o))c.models&&(a[`${b}-tts-models`]=c.models),c.allVoices&&(a[`${b}-tts-voices`]=c.allVoices),c.defaults&&(a[b]=c.defaults);return a["openai-tts-voices"]=o.openai.allVoices,a["openrouter-tts-voices"]=o.openrouter.allVoices,a}},39141:(a,b,c)=>{c.d(b,{xq:()=>k,B$:()=>n,vq:()=>l,sr:()=>m});var d=c(
|
|
1
|
+
"use strict";exports.id=1522,exports.ids=[1522],exports.modules={6595:(a,b,c)=>{function d(a){return a.split(/[-_\s]+/).filter(Boolean).map(a=>/^\d/.test(a)?a:a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}c.d(b,{g5:()=>h,ec:()=>j,gr:()=>i,pk:()=>g,Kq:()=>f});let e=[[/^kimi-k(\d+(?:\.\d+)?)(-thinking)?$/i,a=>`Kimi K${a[1]}${a[2]?" Thinking":""}`],[/^glm-(\d+(?:\.\d+)?)(v)?$/i,a=>`GLM ${a[1]}${a[2]?"V (Vision)":""}`],[/^minimax-m(\d+(?:\.\d+)?)$/i,a=>`MiniMax M${a[1]}`],[/^gpt-(.+)$/i,a=>`GPT ${d(a[1])}`],[/^gemini-(.+)$/i,a=>`Gemini ${d(a[1])}`],[/^grok-(.+)$/i,a=>`Grok ${d(a[1])}`],[/^deepseek-(.+)$/i,a=>`DeepSeek ${d(a[1])}`],[/^qwen([\d.]+.*)$/i,a=>`Qwen ${d(a[1])}`]];function f(a){return"string"!=typeof a?a:a.replace(/(\d)-(\d)/g,"$1.$2")}function g(a){let b="string"==typeof a?{id:a}:a;return void 0!==b.name?b:{...b,name:function(a){if("string"!=typeof a)return a;for(let[b,c]of e){let d=a.match(b);if(d)return c(d)}return a}(b.id)}}function h(a){return a?.strip||[]}function i(a){return a?.targetFormat||null}function j(a){return a?.supportedFormats||null}},7972:(a,b,c)=>{c.d(b,{_M:()=>o,pp:()=>p,bU:()=>n,P9:()=>l});let d={alloy:{id:"alloy",name:"Alloy"},ash:{id:"ash",name:"Ash"},ballad:{id:"ballad",name:"Ballad"},cedar:{id:"cedar",name:"Cedar"},coral:{id:"coral",name:"Coral"},echo:{id:"echo",name:"Echo"},fable:{id:"fable",name:"Fable"},marin:{id:"marin",name:"Marin"},nova:{id:"nova",name:"Nova"},onyx:{id:"onyx",name:"Onyx"},sage:{id:"sage",name:"Sage"},shimmer:{id:"shimmer",name:"Shimmer"},verse:{id:"verse",name:"Verse"}},e=(...a)=>a.map(a=>({...d[a],type:"tts"})),f=e("alloy","ash","coral","echo","fable","nova","onyx","sage","shimmer"),g=e("alloy","ash","ballad","cedar","coral","echo","fable","marin","nova","onyx","sage","shimmer","verse"),h=["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Vindemiatrix","Sadachbia","Sadaltager","Sulafat"].map(a=>({id:a,name:a,type:"tts"})),i=[{id:"mimo_default",name:"mimo_default"},{id:"冰糖",name:"冰糖"},{id:"茉莉",name:"茉莉"},{id:"苏打",name:"苏打"},{id:"白桦",name:"白桦"},{id:"Mia",name:"Mia"},{id:"Chloe",name:"Chloe"},{id:"Milo",name:"Milo"},{id:"Dean",name:"Dean"}].map(a=>({type:"tts",...a})),j={eleven_v3:{maxChars:5e3,langCode:!0,classic:!1},eleven_multilingual_v2:{maxChars:1e4,langCode:!1,classic:!0},eleven_flash_v2_5:{maxChars:4e4,langCode:!0,classic:!0},eleven_turbo_v2_5:{maxChars:4e4,langCode:!0,classic:!0}},k={maxChars:5e3,langCode:!1,classic:!1},l=a=>j[a]||k,m=[{id:"mp3_44100_128",name:"MP3 128 kbps (default)",container:"mp3"},{id:"mp3_44100_192",name:"MP3 192 kbps (Creator+)",container:"mp3"},{id:"mp3_22050_32",name:"MP3 32 kbps (smallest)",container:"mp3"},{id:"pcm_44100",name:"PCM 44.1 kHz (Pro+)",container:"pcm"},{id:"pcm_16000",name:"PCM 16 kHz",container:"pcm"},{id:"ulaw_8000",name:"\xb5-law 8 kHz (telephony)",container:"ulaw"}],n=a=>m.find(b=>b.id===a)?.container||"mp3",o={openai:{models:[{id:"gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"tts-1",name:"TTS-1",type:"tts"}],voices:{"gpt-4o-mini-tts":g,"tts-1":f,"tts-1-hd":f},allVoices:g},openrouter:{models:[{id:"openai/gpt-4o-mini-tts",name:"GPT-4o Mini TTS",type:"tts"},{id:"openai/tts-1-hd",name:"TTS-1 HD",type:"tts"},{id:"openai/tts-1",name:"TTS-1",type:"tts"}],voices:{"openai/gpt-4o-mini-tts":g,"openai/tts-1":f,"openai/tts-1-hd":f},allVoices:g},elevenlabs:{models:[{id:"eleven_v3",name:"Eleven v3 (Most Expressive \xb7 70+ langs)",type:"tts"},{id:"eleven_multilingual_v2",name:"Multilingual v2 (Quality)",type:"tts"},{id:"eleven_flash_v2_5",name:"Flash v2.5 (Fastest)",type:"tts"},{id:"eleven_turbo_v2_5",name:"Turbo v2.5 (Fast)",type:"tts"}]},"edge-tts":{defaults:[{id:"en-US-AriaNeural",name:"Aria (en-US)",type:"tts"},{id:"en-US-GuyNeural",name:"Guy (en-US)",type:"tts"},{id:"en-GB-SoniaNeural",name:"Sonia (en-GB)",type:"tts"},{id:"vi-VN-HoaiMyNeural",name:"Hoai My (vi-VN)",type:"tts"},{id:"vi-VN-NamMinhNeural",name:"Nam Minh (vi-VN)",type:"tts"},{id:"zh-CN-XiaoxiaoNeural",name:"Xiaoxiao (zh-CN)",type:"tts"},{id:"zh-CN-YunxiNeural",name:"Yunxi (zh-CN)",type:"tts"},{id:"fr-FR-DeniseNeural",name:"Denise (fr-FR)",type:"tts"},{id:"de-DE-KatjaNeural",name:"Katja (de-DE)",type:"tts"},{id:"ja-JP-NanamiNeural",name:"Nanami (ja-JP)",type:"tts"},{id:"ko-KR-SunHiNeural",name:"SunHi (ko-KR)",type:"tts"}]},"local-device":{defaults:[{id:"default",name:"System Default Voice",type:"tts"}]},"google-tts":{defaults:[{id:"af",name:"Afrikaans",type:"tts"},{id:"ar",name:"Arabic",type:"tts"},{id:"bg",name:"Bulgarian",type:"tts"},{id:"bn",name:"Bengali",type:"tts"},{id:"bs",name:"Bosnian",type:"tts"},{id:"ca",name:"Catalan",type:"tts"},{id:"cs",name:"Czech",type:"tts"},{id:"cy",name:"Welsh",type:"tts"},{id:"da",name:"Danish",type:"tts"},{id:"de",name:"German",type:"tts"},{id:"el",name:"Greek",type:"tts"},{id:"en",name:"English",type:"tts"},{id:"eo",name:"Esperanto",type:"tts"},{id:"es",name:"Spanish",type:"tts"},{id:"et",name:"Estonian",type:"tts"},{id:"fi",name:"Finnish",type:"tts"},{id:"fr",name:"French",type:"tts"},{id:"gu",name:"Gujarati",type:"tts"},{id:"hi",name:"Hindi",type:"tts"},{id:"hr",name:"Croatian",type:"tts"},{id:"hu",name:"Hungarian",type:"tts"},{id:"hy",name:"Armenian",type:"tts"},{id:"id",name:"Indonesian",type:"tts"},{id:"is",name:"Icelandic",type:"tts"},{id:"it",name:"Italian",type:"tts"},{id:"ja",name:"Japanese",type:"tts"},{id:"jw",name:"Javanese",type:"tts"},{id:"km",name:"Khmer",type:"tts"},{id:"kn",name:"Kannada",type:"tts"},{id:"ko",name:"Korean",type:"tts"},{id:"la",name:"Latin",type:"tts"},{id:"lv",name:"Latvian",type:"tts"},{id:"mk",name:"Macedonian",type:"tts"},{id:"ml",name:"Malayalam",type:"tts"},{id:"mr",name:"Marathi",type:"tts"},{id:"my",name:"Myanmar (Burmese)",type:"tts"},{id:"ne",name:"Nepali",type:"tts"},{id:"nl",name:"Dutch",type:"tts"},{id:"no",name:"Norwegian",type:"tts"},{id:"pl",name:"Polish",type:"tts"},{id:"pt",name:"Portuguese",type:"tts"},{id:"ro",name:"Romanian",type:"tts"},{id:"ru",name:"Russian",type:"tts"},{id:"si",name:"Sinhala",type:"tts"},{id:"sk",name:"Slovak",type:"tts"},{id:"sq",name:"Albanian",type:"tts"},{id:"sr",name:"Serbian",type:"tts"},{id:"su",name:"Sundanese",type:"tts"},{id:"sv",name:"Swedish",type:"tts"},{id:"sw",name:"Swahili",type:"tts"},{id:"ta",name:"Tamil",type:"tts"},{id:"te",name:"Telugu",type:"tts"},{id:"th",name:"Thai",type:"tts"},{id:"tl",name:"Filipino",type:"tts"},{id:"tr",name:"Turkish",type:"tts"},{id:"uk",name:"Ukrainian",type:"tts"},{id:"ur",name:"Urdu",type:"tts"},{id:"vi",name:"Vietnamese",type:"tts"},{id:"zh-CN",name:"Chinese (Simplified)",type:"tts"},{id:"zh-TW",name:"Chinese (Traditional)",type:"tts"}]},gemini:{models:[{id:"gemini-3.1-flash-tts-preview",name:"Gemini 3.1 Flash TTS",type:"tts"},{id:"gemini-2.5-flash-preview-tts",name:"Gemini 2.5 Flash TTS",type:"tts"},{id:"gemini-2.5-pro-preview-tts",name:"Gemini 2.5 Pro TTS",type:"tts"}],voices:{"gemini-3.1-flash-tts-preview":h,"gemini-2.5-flash-preview-tts":h,"gemini-2.5-pro-preview-tts":h},allVoices:h},"xiaomi-mimo":{models:[{id:"mimo-v2.5-tts",name:"MiMo V2.5 TTS",type:"tts"}],voices:{"mimo-v2.5-tts":i}}};function p(){let a={};for(let[b,c]of Object.entries(o))c.models&&(a[`${b}-tts-models`]=c.models),c.allVoices&&(a[`${b}-tts-voices`]=c.allVoices),c.defaults&&(a[b]=c.defaults);return a["openai-tts-voices"]=o.openai.allVoices,a["openrouter-tts-voices"]=o.openrouter.allVoices,a}},39141:(a,b,c)=>{c.d(b,{xq:()=>k,B$:()=>n,vq:()=>l,sr:()=>m});var d=c(78540),e=c(60290);let f={baseUrl:"",format:"openai",headers:{},auth:{header:"Authorization",scheme:"bearer",source:["accessToken","apiKey"]},forceStream:!1,urlSuffix:"",quirks:{},passthroughModels:!1,retry:e.cI,timeoutMs:e.pH,executor:"default"};var g=c(6595),h=c(7972);let i=["clientId","clientSecret","tokenUrl"],j=new Set(["serviceKinds","ttsConfig","sttConfig","embeddingConfig","imageConfig","imageToTextConfig","videoConfig","musicConfig","searchViaChat","searchConfig","fetchConfig","systemoneConfig","modelsFetcher","mediaPriority","hiddenKinds"]),k={},l={},m={},n={};for(let a of d.default){a.transport&&(k[a.id]=function(a,b,c){let d={...a};if(d.format||(d.format=f.format),b)for(let a of i)void 0===d[a]&&void 0!==b[a]&&(d[a]=b[a]);return void 0!==c&&(d.protocolProfile=c),d}(a.transport,a.oauth,a.protocolProfile),a.transports&&(k[a.id].transports=a.transports),a.fastMode&&(k[a.id].fastMode=a.fastMode)),void 0!==a.models&&(l[a.alias||a.id]=a.models.map(g.pk)),a.oauth&&(m[a.id]={...a.oauth},void 0!==a.protocolProfile&&(m[a.id].protocolProfile=a.protocolProfile));let b={};for(let c of j)void 0!==a[c]&&(b[c]=a[c]);a.media&&Object.assign(b,a.media),Object.keys(b).length&&(n[a.id]=b)}Object.assign(l,(0,h.pp)())}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=1641,exports.ids=[1641],exports.modules={29273:(a,b,c)=>{c.d(b,{K:()=>h});var d=c(89718),e=c(23433),f=c(89865),g=c(60290);async function h(a,{model:b,body:c,reserveTokens:i=!1}={}){var j;let k,l=await (0,d.mt)(),m=(0,e.Tr)(a);if(!m)return l.requireApiKey?{error:(0,f.yj)(g.gx.UNAUTHORIZED,"Missing API key")}:{apiKey:null,body:c};let n="function"==typeof d.y7?await (0,d.y7)(m):null,o=n?.expiresAt&&new Date(n.expiresAt).getTime()<=Date.now();if(!n?.isActive||o)return l.requireApiKey?{error:(0,f.yj)(g.gx.UNAUTHORIZED,"Invalid API key")}:{apiKey:m,body:c};if(Array.isArray(n.allowedModels)&&n.allowedModels.length&&b){let a="string"==typeof c?.model?c.model:null;if(!n.allowedModels.includes(b)&&!n.allowedModels.includes(a))return{error:(0,f.yj)(g.gx.FORBIDDEN,"This API key is not allowed to use the selected model")}}if(!i||null==n.tokenLimit)return{apiKey:m,key:n,body:c};let p=n.tokenLimit-n.tokensUsed-n.tokensReserved,q=Math.max(1,Math.ceil(JSON.stringify(c?.messages||c?.input||c?.prompt||c?.query||"").length/4));if(p<=q)return{error:(0,f.yj)(g.gx.FORBIDDEN,"API key token quota exceeded")};let r=(j=Math.max(0,p-q),null==(k=c?.max_completion_tokens??c?.max_tokens??c?.max_output_tokens)?j:Math.min(j,Math.max(1,Number(k)||1))),s=await (0,d.mV)(m,q+r);return s.ok?{apiKey:m,key:n,body:c?.max_completion_tokens!=null?{...c,max_completion_tokens:r}:c?.max_output_tokens!=null?{...c,max_output_tokens:r}:{...c,max_tokens:r},reservation:s.reserved}:{error:(0,f.yj)(g.gx.FORBIDDEN,s.error)}}},66451:(a,b,c)=>{c.d(b,{PN:()=>j,Xh:()=>k,g2:()=>i,js:()=>m,sc:()=>l});var d=c(29386),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"]]},92990:(a,b,c)=>{c.d(b,{DI:()=>i,DV:()=>C,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,RY:()=>I,S6:()=>s,SK:()=>F,Td:()=>A,Tx:()=>q,V1:()=>J,WN:()=>t,Ww:()=>K,YT:()=>n,ZL:()=>m,_0:()=>H,aV:()=>u,cD:()=>o,eD:()=>G,f7:()=>y,hF:()=>k,lB:()=>w,oe:()=>E,qp:()=>B,sA:()=>D,t3:()=>l,w1:()=>x});var d=c(21820),e=c(92675),f=c(39141);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.dG,...f.sr["gemini-cli"]};({...f.sr.qwen});let k={...f.sr.qoder};({...f.sr["qoderwork-cn"]});let l={...f.sr["qoder-cn"]},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr.kimi,clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||process.env.KIMI_OAUTH_CLIENT_ID||f.xq.kimi?.clientId||f.sr.kimi?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.kimchi},B={...f.sr["grok-cli"]},C={...f.sr["codebuddy-intl"]},D={...f.sr.muse},E={platformUrl:process.env.MIMO_PLATFORM_URL||"https://platform.xiaomimimo.com",defaultBaseUrl:"https://api.xiaomimimo.com/v1",kn:"mimocode",callbackPath:"/",timeoutMs:3e5},F={clientId:"ono9krqynydwx5",clientSecret:"-",loginGuidanceUrls:["https://api.marscode.com/cloudide/api/v3/trae/GetLoginGuidance","https://api.trae.ai/cloudide/api/v3/trae/GetLoginGuidance","https://www.trae.ai/cloudide/api/v3/trae/GetLoginGuidance"],apiOrigins:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai","https://www.marscode.com"],exchangeTokenPath:"/cloudide/api/v3/trae/oauth/ExchangeToken",getUserInfoPath:"/cloudide/api/v3/trae/GetUserInfo",authorizationPath:"/authorization",callbackPath:"/callback",minAppVersion:"3.5.54",defaultAppVersion:"3.5.54",defaultAppType:"stable",defaultPluginVersion:"local",defaultDeviceId:"0",userAgent:"Trae/1.0.0 antigravity-cockpit-tools",webUrl:"https://www.trae.ai",authScheme:"Cloud-IDE-JWT",tokenLifetimeDays:14,oauthTimeoutMs:6e5},G={clientId:"3GUryQ7ldAeKEuD2obYnppsnmj58eP5u",authBaseUrl:"https://www.windsurf.com",signInPath:"/windsurf/signin",registerApiBaseUrl:"https://register.windsurf.com",registerPath:"/exa.seat_management_pb.SeatManagementService/RegisterUser",oneTimeAuthPath:"/exa.seat_management_pb.SeatManagementService/GetOneTimeAuthToken",currentUserPath:"/exa.seat_management_pb.SeatManagementService/GetCurrentUser",planStatusPath:"/exa.seat_management_pb.SeatManagementService/GetPlanStatus",userStatusPath:"/exa.seat_management_pb.SeatManagementService/GetUserStatus",defaultApiServerUrl:"https://server.codeium.com",firebaseApiKey:"AIzaSyDsOl-1XpT5err0Tcn0TFFod1H8gVGIycY",callbackPath:"/windsurf-auth-callback",userAgent:"antigravity-cockpit-tools",oauthTimeoutMs:6e5},H={...f.sr.glm},I={webBaseUrl:"https://zed.dev",cloudBaseUrl:"https://cloud.zed.dev",llmBaseUrl:"https://cloud.zed.dev",defaultNativeAppPort:58443,oauthTimeoutMs:6e5},J={...f.sr["frontier-for-all"]},K=3e5},96846:(a,b,c)=>{c.d(b,{g:()=>x,s:()=>y});var d=c(23433),e=c(89718),f=c(29273),g=c(40615),h=c(38775),i=c(27811),j=c(58552),k=c(28337),l=c(89865),m=c(60290),n=c(67828),o=c(7803);let p="__video_poll__",q=new Set([m.gx.UNAUTHORIZED,m.gx.PAYMENT_REQUIRED,m.gx.FORBIDDEN,m.gx.RATE_LIMITED]);async function r(a,b,c){if(b){let a=await (0,e.Mc)(b).catch(()=>null);if(a?.provider&&((0,j.WY)(a.provider)||(0,g.AR)(a.provider)))return a.provider}let d=new URL(a.url).searchParams.get("provider");if(d&&((0,j.WY)(d)||(0,g.AR)(d)))return d;let f=(0,k.U)(c);return f&&((0,j.WY)(f)||(0,g.AR)(f))?f:"xai"}let s=new Set([m.gx.UNAUTHORIZED,m.gx.FORBIDDEN,m.gx.RATE_LIMITED]);async function t(a){if((await (0,e.mt)()).requireApiKey){let{apiKey:b,valid:c}=await (0,d.$A)(a);if(!b)return(0,l.yj)(m.gx.UNAUTHORIZED,"Missing API key");if(!c)return(0,l.yj)(m.gx.UNAUTHORIZED,"Invalid API key")}return null}async function u(a){let b=a.headers.get("content-type")||"";if(b.includes("application/json")){let c,d=await a.text();try{c=JSON.parse(d)}catch{return{error:(0,l.yj)(m.gx.BAD_REQUEST,"Invalid JSON body")}}return{raw:d,parsed:c,contentType:b}}return{raw:Buffer.from(await a.arrayBuffer()),parsed:null,contentType:b}}async function v(a){if(!a?.model)return{provider:"xai",model:null};let b=String(a.model),c=await (0,h.mA)(b);return c.provider?(0,g.AR)(c.provider)?{provider:c.provider,model:c.model}:(0,j.WY)(c.provider)?{provider:c.provider,model:c.model}:b.includes("/")?{error:(0,l.yj)(m.gx.BAD_REQUEST,`Provider '${c.provider}' does not support video generation`)}:{provider:"xai",model:b}:{error:(0,l.yj)(m.gx.BAD_REQUEST,"Combos are not supported for video generation")}}function w(a,b){if(!b)return a;let c=new Headers(a.headers);return c.set("x-9router-connection-id",String(b)),new Response(a.body,{status:a.status,headers:c})}async function x(a,b){let c=await t(a);if(c)return c;let e=await u(a);if(e.error)return e.error;let g=await v(e.parsed);if(g.error)return g.error;let{provider:h,model:k}=g,p=await (0,f.K)(a,{model:k?`${h}/${k}`:"__implicit_video_model__"});if(p.error)return p.error;let q=await (0,i.QU)(await (0,i.TM)(a),e.parsed?.model?String(e.parsed.model):"",h,k);if(q)return q;let r=e.raw;e.parsed&&k&&e.parsed.model!==k&&(r=JSON.stringify({...e.parsed,model:k}));let x=a.headers.get("x-connection-id")||null,y=a.headers.get("idempotency-key")||null,z=new Set,A=null,B=null;for(;;){let c=await (0,d.c1)(h,z,k,{preferredConnectionId:x});if(!c||c.allRateLimited){if(c?.allRateLimited){let a=A||c.lastError||"Unavailable",b=B||Number(c.lastErrorCode)||m.gx.SERVICE_UNAVAILABLE;return(0,l.wO)(b,`[${h}/${k||"video"}] ${a}`,c.retryAfter,c.retryAfterHuman)}if(0===z.size)return(0,l.yj)(m.gx.BAD_REQUEST,`No credentials for provider: ${h}`);return(0,l.yj)(B||m.gx.SERVICE_UNAVAILABLE,A||"All accounts unavailable")}let f=await (0,n.checkAndRefreshToken)(h,c),g=await (0,j.F8)({provider:h,action:b,rawBody:r,contentType:e.contentType||null,idempotencyKey:y,credentials:f,signal:a.signal,log:o,onCredentialsRefreshed:async a=>{await (0,n.vN)(c.connectionId,{accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData,testStatus:"active"})}});if(g.success)return await (0,d.Pt)(c.connectionId,c,k),o.info("VIDEO",`${h.toUpperCase()} | ${b} accepted (connection ${c.connectionId})`),w(g.response,c.connectionId);let{shouldFallback:i}=await (0,d.vk)(c.connectionId,g.status,(0,j.NJ)(g.error,f),h,k);if(i&&s.has(g.status)){z.add(c.connectionId),A=g.error,B=g.status;continue}return g.response}}async function y(a,b){let c=await t(a);if(c)return c;if(!b)return(0,l.yj)(m.gx.BAD_REQUEST,"Missing video request id");let e=a.headers.get("x-connection-id")||null,f=await r(a,e,b),g=await (0,d.c1)(f,null,p,{preferredConnectionId:e,strictConnectionId:e});if(g?.allRateLimited)return(0,l.wO)(Number(g.lastErrorCode)||m.gx.SERVICE_UNAVAILABLE,g.lastError||"Video polling temporarily unavailable",g.retryAfter,g.retryAfterHuman);if(!g)return(0,l.yj)(m.gx.BAD_REQUEST,`No credentials for provider: ${f}`);let h=await (0,n.checkAndRefreshToken)(f,g),i=await (0,j.F8)({provider:f,requestId:b,credentials:h,signal:a.signal,log:o,onCredentialsRefreshed:async a=>{await (0,n.vN)(g.connectionId,{accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData,testStatus:"active"})}});return i.success?(await (0,d.Pt)(g.connectionId,g,p),w(i.response,g.connectionId)):((q.has(i.status)||i.status>=m.gx.SERVER_ERROR)&&await (0,d.vk)(g.connectionId,i.status,(0,j.NJ)(i.error,h),f,p),i.response)}}};
|
|
1
|
+
"use strict";exports.id=1641,exports.ids=[1641],exports.modules={29273:(a,b,c)=>{c.d(b,{K:()=>h});var d=c(89718),e=c(23433),f=c(89865),g=c(60290);async function h(a,{model:b,body:c,reserveTokens:i=!1}={}){var j;let k,l=await (0,d.mt)(),m=(0,e.Tr)(a);if(!m)return l.requireApiKey?{error:(0,f.yj)(g.gx.UNAUTHORIZED,"Missing API key")}:{apiKey:null,body:c};let n="function"==typeof d.y7?await (0,d.y7)(m):null,o=n?.expiresAt&&new Date(n.expiresAt).getTime()<=Date.now();if(!n?.isActive||o)return l.requireApiKey?{error:(0,f.yj)(g.gx.UNAUTHORIZED,"Invalid API key")}:{apiKey:m,body:c};if(Array.isArray(n.allowedModels)&&n.allowedModels.length&&b){let a="string"==typeof c?.model?c.model:null;if(!n.allowedModels.includes(b)&&!n.allowedModels.includes(a))return{error:(0,f.yj)(g.gx.FORBIDDEN,"This API key is not allowed to use the selected model")}}if(!i||null==n.tokenLimit)return{apiKey:m,key:n,body:c};let p=n.tokenLimit-n.tokensUsed-n.tokensReserved,q=Math.max(1,Math.ceil(JSON.stringify(c?.messages||c?.input||c?.prompt||c?.query||"").length/4));if(p<=q)return{error:(0,f.yj)(g.gx.FORBIDDEN,"API key token quota exceeded")};let r=(j=Math.max(0,p-q),null==(k=c?.max_completion_tokens??c?.max_tokens??c?.max_output_tokens)?j:Math.min(j,Math.max(1,Number(k)||1))),s=await (0,d.mV)(m,q+r);return s.ok?{apiKey:m,key:n,body:c?.max_completion_tokens!=null?{...c,max_completion_tokens:r}:c?.max_output_tokens!=null?{...c,max_output_tokens:r}:{...c,max_tokens:r},reservation:s.reserved}:{error:(0,f.yj)(g.gx.FORBIDDEN,s.error)}}},66451:(a,b,c)=>{c.d(b,{PN:()=>j,Xh:()=>k,g2:()=>i,js:()=>m,sc:()=>l});var d=c(78540),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"],[/^gpt-/,"openai"],[/^o[134]/,"openai"],[/^glm-/,"glm"],[/^qwen[-0-9]/,"qwen"],[/^deepseek-/,"deepseek"],[/^kimi-/,"kimi"],[/^moonshot-/,"kimi"],[/^minimax-/,"minimax"],[/^grok-/,"xai"],[/^(mistral|codestral)-/,"mistral"],[/^(cohere|command)-/,"cohere"],[/^(sonar|perplexity)-/,"perplexity"],[/^(llama|meta-llama)-/,"groq"],[/^yi-/,"lingyi"],[/^baichuan-/,"baichuan"],[/^doubao-/,"volcengine-ark"],[/^step-/,"stepfun"]]},92990:(a,b,c)=>{c.d(b,{DI:()=>i,DV:()=>C,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,RY:()=>I,S6:()=>s,SK:()=>F,Td:()=>A,Tx:()=>q,V1:()=>J,WN:()=>t,Ww:()=>K,YT:()=>n,ZL:()=>m,_0:()=>H,aV:()=>u,cD:()=>o,eD:()=>G,f7:()=>y,hF:()=>k,lB:()=>w,oe:()=>E,qp:()=>B,sA:()=>D,t3:()=>l,w1:()=>x});var d=c(21820),e=c(92675),f=c(39141);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.dG,...f.sr["gemini-cli"]};({...f.sr.qwen});let k={...f.sr.qoder};({...f.sr["qoderwork-cn"]});let l={...f.sr["qoder-cn"]},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr.kimi,clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||process.env.KIMI_OAUTH_CLIENT_ID||f.xq.kimi?.clientId||f.sr.kimi?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.kimchi},B={...f.sr["grok-cli"]},C={...f.sr["codebuddy-intl"]},D={...f.sr.muse},E={platformUrl:process.env.MIMO_PLATFORM_URL||"https://platform.xiaomimimo.com",defaultBaseUrl:"https://api.xiaomimimo.com/v1",kn:"mimocode",callbackPath:"/",timeoutMs:3e5},F={clientId:"ono9krqynydwx5",clientSecret:"-",loginGuidanceUrls:["https://api.marscode.com/cloudide/api/v3/trae/GetLoginGuidance","https://api.trae.ai/cloudide/api/v3/trae/GetLoginGuidance","https://www.trae.ai/cloudide/api/v3/trae/GetLoginGuidance"],apiOrigins:["https://api.marscode.com","https://api.trae.ai","https://www.trae.ai","https://www.marscode.com"],exchangeTokenPath:"/cloudide/api/v3/trae/oauth/ExchangeToken",getUserInfoPath:"/cloudide/api/v3/trae/GetUserInfo",authorizationPath:"/authorization",callbackPath:"/callback",minAppVersion:"3.5.54",defaultAppVersion:"3.5.54",defaultAppType:"stable",defaultPluginVersion:"local",defaultDeviceId:"0",userAgent:"Trae/1.0.0 antigravity-cockpit-tools",webUrl:"https://www.trae.ai",authScheme:"Cloud-IDE-JWT",tokenLifetimeDays:14,oauthTimeoutMs:6e5},G={clientId:"3GUryQ7ldAeKEuD2obYnppsnmj58eP5u",authBaseUrl:"https://www.windsurf.com",signInPath:"/windsurf/signin",registerApiBaseUrl:"https://register.windsurf.com",registerPath:"/exa.seat_management_pb.SeatManagementService/RegisterUser",oneTimeAuthPath:"/exa.seat_management_pb.SeatManagementService/GetOneTimeAuthToken",currentUserPath:"/exa.seat_management_pb.SeatManagementService/GetCurrentUser",planStatusPath:"/exa.seat_management_pb.SeatManagementService/GetPlanStatus",userStatusPath:"/exa.seat_management_pb.SeatManagementService/GetUserStatus",defaultApiServerUrl:"https://server.codeium.com",firebaseApiKey:"AIzaSyDsOl-1XpT5err0Tcn0TFFod1H8gVGIycY",callbackPath:"/windsurf-auth-callback",userAgent:"antigravity-cockpit-tools",oauthTimeoutMs:6e5},H={...f.sr.glm},I={webBaseUrl:"https://zed.dev",cloudBaseUrl:"https://cloud.zed.dev",llmBaseUrl:"https://cloud.zed.dev",defaultNativeAppPort:58443,oauthTimeoutMs:6e5},J={...f.sr["frontier-for-all"]},K=3e5},96846:(a,b,c)=>{c.d(b,{g:()=>x,s:()=>y});var d=c(23433),e=c(89718),f=c(29273),g=c(40615),h=c(38775),i=c(27811),j=c(58552),k=c(28337),l=c(89865),m=c(60290),n=c(67828),o=c(7803);let p="__video_poll__",q=new Set([m.gx.UNAUTHORIZED,m.gx.PAYMENT_REQUIRED,m.gx.FORBIDDEN,m.gx.RATE_LIMITED]);async function r(a,b,c){if(b){let a=await (0,e.Mc)(b).catch(()=>null);if(a?.provider&&((0,j.WY)(a.provider)||(0,g.AR)(a.provider)))return a.provider}let d=new URL(a.url).searchParams.get("provider");if(d&&((0,j.WY)(d)||(0,g.AR)(d)))return d;let f=(0,k.U)(c);return f&&((0,j.WY)(f)||(0,g.AR)(f))?f:"xai"}let s=new Set([m.gx.UNAUTHORIZED,m.gx.FORBIDDEN,m.gx.RATE_LIMITED]);async function t(a){if((await (0,e.mt)()).requireApiKey){let{apiKey:b,valid:c}=await (0,d.$A)(a);if(!b)return(0,l.yj)(m.gx.UNAUTHORIZED,"Missing API key");if(!c)return(0,l.yj)(m.gx.UNAUTHORIZED,"Invalid API key")}return null}async function u(a){let b=a.headers.get("content-type")||"";if(b.includes("application/json")){let c,d=await a.text();try{c=JSON.parse(d)}catch{return{error:(0,l.yj)(m.gx.BAD_REQUEST,"Invalid JSON body")}}return{raw:d,parsed:c,contentType:b}}return{raw:Buffer.from(await a.arrayBuffer()),parsed:null,contentType:b}}async function v(a){if(!a?.model)return{provider:"xai",model:null};let b=String(a.model),c=await (0,h.mA)(b);return c.provider?(0,g.AR)(c.provider)?{provider:c.provider,model:c.model}:(0,j.WY)(c.provider)?{provider:c.provider,model:c.model}:b.includes("/")?{error:(0,l.yj)(m.gx.BAD_REQUEST,`Provider '${c.provider}' does not support video generation`)}:{provider:"xai",model:b}:{error:(0,l.yj)(m.gx.BAD_REQUEST,"Combos are not supported for video generation")}}function w(a,b){if(!b)return a;let c=new Headers(a.headers);return c.set("x-9router-connection-id",String(b)),new Response(a.body,{status:a.status,headers:c})}async function x(a,b){let c=await t(a);if(c)return c;let e=await u(a);if(e.error)return e.error;let g=await v(e.parsed);if(g.error)return g.error;let{provider:h,model:k}=g,p=await (0,f.K)(a,{model:k?`${h}/${k}`:"__implicit_video_model__"});if(p.error)return p.error;let q=await (0,i.QU)(await (0,i.TM)(a),e.parsed?.model?String(e.parsed.model):"",h,k);if(q)return q;let r=e.raw;e.parsed&&k&&e.parsed.model!==k&&(r=JSON.stringify({...e.parsed,model:k}));let x=a.headers.get("x-connection-id")||null,y=a.headers.get("idempotency-key")||null,z=new Set,A=null,B=null;for(;;){let c=await (0,d.c1)(h,z,k,{preferredConnectionId:x});if(!c||c.allRateLimited){if(c?.allRateLimited){let a=A||c.lastError||"Unavailable",b=B||Number(c.lastErrorCode)||m.gx.SERVICE_UNAVAILABLE;return(0,l.wO)(b,`[${h}/${k||"video"}] ${a}`,c.retryAfter,c.retryAfterHuman)}if(0===z.size)return(0,l.yj)(m.gx.BAD_REQUEST,`No credentials for provider: ${h}`);return(0,l.yj)(B||m.gx.SERVICE_UNAVAILABLE,A||"All accounts unavailable")}let f=await (0,n.checkAndRefreshToken)(h,c),g=await (0,j.F8)({provider:h,action:b,rawBody:r,contentType:e.contentType||null,idempotencyKey:y,credentials:f,signal:a.signal,log:o,onCredentialsRefreshed:async a=>{await (0,n.vN)(c.connectionId,{accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData,testStatus:"active"})}});if(g.success)return await (0,d.Pt)(c.connectionId,c,k),o.info("VIDEO",`${h.toUpperCase()} | ${b} accepted (connection ${c.connectionId})`),w(g.response,c.connectionId);let{shouldFallback:i}=await (0,d.vk)(c.connectionId,g.status,(0,j.NJ)(g.error,f),h,k);if(i&&s.has(g.status)){z.add(c.connectionId),A=g.error,B=g.status;continue}return g.response}}async function y(a,b){let c=await t(a);if(c)return c;if(!b)return(0,l.yj)(m.gx.BAD_REQUEST,"Missing video request id");let e=a.headers.get("x-connection-id")||null,f=await r(a,e,b),g=await (0,d.c1)(f,null,p,{preferredConnectionId:e,strictConnectionId:e});if(g?.allRateLimited)return(0,l.wO)(Number(g.lastErrorCode)||m.gx.SERVICE_UNAVAILABLE,g.lastError||"Video polling temporarily unavailable",g.retryAfter,g.retryAfterHuman);if(!g)return(0,l.yj)(m.gx.BAD_REQUEST,`No credentials for provider: ${f}`);let h=await (0,n.checkAndRefreshToken)(f,g),i=await (0,j.F8)({provider:f,requestId:b,credentials:h,signal:a.signal,log:o,onCredentialsRefreshed:async a=>{await (0,n.vN)(g.connectionId,{accessToken:a.accessToken,refreshToken:a.refreshToken,providerSpecificData:a.providerSpecificData,testStatus:"active"})}});return i.success?(await (0,d.Pt)(g.connectionId,g,p),w(i.response,g.connectionId)):((q.has(i.status)||i.status>=m.gx.SERVER_ERROR)&&await (0,d.vk)(g.connectionId,i.status,(0,j.NJ)(i.error,h),f,p),i.response)}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=1733,exports.ids=[1733],exports.modules={27738:(a,b,c)=>{c.d(b,{Z:()=>h});var d=c(4630);let e=[{match:a=>/^kimi-/i.test(a||""),scope:"toolCalls"},{match:a=>/deepseek/i.test(a||""),scope:"all"}],f="deepseek-v4-pro",g={[`${f}-max`]:{thinkingType:"enabled",reasoningEffort:"max"},[`${f}-none`]:{thinkingType:"disabled",reasoningEffort:null}};function h({provider:a,model:b,body:c}){let i=d.xq[a]?.reasoningInject,j=e.find(a=>a.match(b));var k=function({provider:a,model:b,body:c}){let d=g[b];if("deepseek"!==a||!d||!c)return c;let e={...c,model:f,extra_body:{...c.extra_body||{},thinking:{...c.extra_body?.thinking||{},type:d.thinkingType}}};return d.reasoningEffort?e.reasoning_effort=d.reasoningEffort:delete e.reasoning_effort,e}({provider:a,model:b,body:c}),l=i||j;if(!l||!Array.isArray(k?.messages))return k;let m=k.messages.map(a=>!function(a,b){if(a?.role!=="assistant")return!1;let c=a.reasoning_content;return("string"!=typeof c||!(c.length>0))&&("toolCalls"!==b||Array.isArray(a.tool_calls)&&a.tool_calls.length>0)}(a,l.scope)?a:{...a,reasoning_content:" "});return{...k,messages:m}}},66451:(a,b,c)=>{c.d(b,{PN:()=>j,Xh:()=>k,g2:()=>i,js:()=>m,sc:()=>l});var d=c(29386),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"]]},96723:(a,b,c)=>{c.d(b,{j9:()=>P,f6:()=>G});var d=c(55511),e=c(55591),f=c(28730),g=c(85187),h=c(4630),i=c(60290),j=c(2081),k=c(27738),l=c(91576),m=c(29021),n=c(33873);let o="opencode.ai";var p=c(8382),q=c(69656),r=c(83199),s=c(92675);let t=null,u=!1,v="x-opencode-session",w="_opencodeSession",x="_opencodeRequest",y=/^ses_[0-9a-f]{12}[0-9A-Za-z]{14}$/,z=/^msg_[0-9a-f]{12}[0-9A-Za-z]{14}$/,A="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",B=new Set(["muse-spark-1.2-contributor-free","muse-spark-1.3-contributor-free"]),C=new Set(["union-alpha"]),D=0,E=0;function F(){let a=d.randomBytes(14),b="";for(let c=0;c<14;c++)b+=A[a[c]%62];return b}function G(a=Date.now()){a!==D&&(D=a,E=0),E++;let b=~(4096n*BigInt(a)+BigInt(E)),c=Array.from({length:6},(a,c)=>Number(b>>BigInt(40-8*c)&255n).toString(16).padStart(2,"0")).join("");return`ses_${c}${F()}`}function H(a=Date.now()){let b=4096n*BigInt(a)+1n,c=Array.from({length:6},(a,c)=>Number(b>>BigInt(40-8*c)&255n).toString(16).padStart(2,"0")).join("");return`msg_${c}${F()}`}function I(a,b=""){if("string"==typeof a&&y.test(a.trim()))return a.trim();let c=d.createHash("sha256").update(`opencode\0${b||"generic"}\0${a||""}`).digest(),e=c.subarray(0,6).toString("hex"),f="";for(let a=6;a<20;a++)f+=A[c[a]%62];return`ses_${e}${f}`}function J(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}let K=new Map,L=setInterval(()=>{let a=Date.now();for(let[b,c]of K)a-c.lastUsed>i.v1.sessionTtlMs&&K.delete(b)},i.v1.sessionCleanupIntervalMs);function M(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:z.test(b)?b:null}function N(a){return String(a||"").replace(/\([^()]+\)\s*$/,"").trim()}function O(a){let b=N(a);return B.has(b)||(0,p.nh)(b)}L.unref&&L.unref();class P extends g.H{constructor(){super("opencode",h.xq.opencode)}prepareRequestCredentials({body:a,credentials:b,providerSessionId:c,clientTool:e}={}){let f=b||{},g=function(a,b,c,e){let f=b?.rawHeaders||{},g=function(a){if(!a||"object"!=typeof a)return null;for(let[b,c]of Object.entries(a))if(b.toLowerCase()===v){let a=J(c);if(a&&y.test(a))return a}return null}(f);if(g)return g;let h=null;for(let[a,b]of Object.entries(f))if(a.toLowerCase()===v){h=J(b);break}let i=h||J(c);if(i)return I(i,e);if(b?.connectionId||function(a){try{if(!a||"object"!=typeof a)return!1;if("string"==typeof a.session_id&&a.session_id.trim()||"string"==typeof a.conversation_id&&a.conversation_id.trim()||"string"==typeof a.prompt_cache_key&&a.prompt_cache_key.trim()||a.metadata&&"string"==typeof a.metadata.user_id&&a.metadata.user_id.trim()||a.request&&null!=a.request.sessionId&&""!==String(a.request.sessionId))return!0;let b=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(b){let a="";for(let c of b)if(c?.role==="assistant"){let b=c.content;if("string"==typeof b)a+=b;else if(Array.isArray(b))for(let c of b)a+=c?.text||c?.output||"";if(a.length>=50)return!0}}return!1}catch{return!1}}(a)){let c=null;try{c=(0,l.oV)({headers:f,body:a,connectionId:b?.connectionId,scope:"opencode"})}catch{c=null}if(c)return I(c,e)}let j=function(a){let b=a?.connectionId||a?.id;if(b)return`opencode:conn:${String(b).slice(0,128)}`;let c=a?.rawHeaders||{},e=c.authorization||c.Authorization||c["x-api-key"]||c["X-Api-Key"]||"";if(e){let a=d.createHash("sha256").update(String(e)).digest("hex").slice(0,32);return`opencode:auth:${a}`}return"opencode:default"}(b),k=K.get(j);if(k)return k.lastUsed=Date.now(),K.delete(j),K.set(j,k),k.sessionId;let m=G();return K.size>=1e3&&K.delete(K.keys().next().value),K.set(j,{sessionId:m,lastUsed:Date.now()}),m}(a,f,c,e);return{...f,[w]:g,[x]:function(a,b,c){for(let[a,c]of Object.entries(b?.rawHeaders||{}))if("x-opencode-request"===a.toLowerCase()){let a=M(c);if(a)return a;break}return function(a,b){let c=function(a){try{if(!a||"object"!=typeof a)return"";let b=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(!b)return"string"==typeof a.input?a.input.slice(-600):"";for(let a=b.length-1;a>=0;a--){let c=b[a];if(!c||c.role&&"user"!==c.role)continue;let d=c.content;if("string"==typeof d&&d.trim())return d.trim().slice(-600);if(Array.isArray(d)){let a=d.map(a=>"string"==typeof a?a:a?.text||a?.input_text||"").join(" ").trim();if(a)return a.slice(-600)}}}catch{}return""}(b);if(!c)return H();let e=d.createHash("sha256").update(`opencode-req\0${a||""}\0${c}`).digest(),f=e.subarray(0,6).toString("hex"),g="";for(let a=6;a<20;a++)g+=A[e[a]%62];let h=`msg_${f}${g}`;return z.test(h)?h:H()}(c,a)}(a,f,g)}}transformRequest(a,b,c,d){if(b&&"object"==typeof b&&a&&!b.model&&(b.model=a),b&&"object"==typeof b&&(b.stream=!0),O(a||b?.model)&&b&&"object"==typeof b){"tool_choice"in b&&"auto"!==b.tool_choice&&this.config.quirks?.forceAutoToolChoiceModels?.includes(N(a))&&(b.tool_choice="auto");let c=(0,r.me)(b.input);c&&(b.input=c),Array.isArray(b.input)&&0!==b.input.length||(b.input=[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]),void 0===b.max_output_tokens&&(void 0!==b.max_completion_tokens?b.max_output_tokens=b.max_completion_tokens:void 0!==b.max_tokens&&(b.max_output_tokens=b.max_tokens)),void 0!==b.max_output_tokens&&(b.max_output_tokens=Math.max(16,Number(b.max_output_tokens)||16)),delete b.max_tokens,delete b.max_completion_tokens,function(a,b){let c=b.reasoning,d=c&&"object"==typeof c&&!Array.isArray(c)?c:null,e="string"==typeof b.reasoning_effort?b.reasoning_effort:d?.effort;if("string"!=typeof e)return;let f=N(a||b.model),g=(0,j.k)("opencode",f),h=e.toLowerCase().trim();("max"===h||"ultra"===h)&&g?.length&&!g.includes(h)&&("ultra"===h&&g.includes("max")?h="max":g.includes("xhigh")&&(h="xhigh")),b.reasoning={...d,effort:h},b.reasoning.summary||(b.reasoning.summary="auto"),delete b.reasoning_effort}(a,b),b.stream=!0,b.store=!1,function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,d=("string"==typeof a.name?a.name:"string"==typeof c?.name?c.name:"").trim();if(!d)return!1;let e="string"==typeof a.description?a.description:"string"==typeof c?.description?c.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:c?.parameters&&"object"==typeof c.parameters&&!Array.isArray(c.parameters)?c.parameters:{type:"object",properties:{}};for(let b of("object"!==g.type||g.properties||(g={...g,properties:{}}),Object.keys(a)))delete a[b];return a.type="function",a.name=d.slice(0,f.ix),e&&(a.description=e),a.parameters=g,b.add(a.name),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"",d=c.slice(0,f.ix);c&&(b.has(c)||b.has(d))?a.tool_choice.name=d:delete a.tool_choice}}(b),Array.isArray(b.input)&&(b.input=b.input.filter(a=>!!(!a||"object"!=typeof a||Array.isArray(a))||"reasoning"!==a.type&&((delete a.encrypted_content,delete a.reasoning_encrypted_content,"function_call"===a.type)?!!a.name&&"string"==typeof a.name&&""!==a.name.trim()&&(a.name=a.name.trim().slice(0,f.ix),a.call_id=(0,r.N8)(a.call_id),a.arguments=(0,r.We)(a.arguments),!0):("function_call_output"===a.type&&(a.call_id=(0,r.N8)(a.call_id),a.output=(0,r.DP)(a.output)),!0)))),(0,q.Ke)(b,!0)}else b&&"object"==typeof b&&(0,q.Ke)(b,!1);return(0,k.Z)({provider:this.provider,model:a,body:b})}buildUrl(a,b,c=0,d=null){let e=d?.runtimeTransport;if(e?.baseUrl)return e.urlSuffix?`${e.baseUrl}${e.urlSuffix}`:e.baseUrl;let f=this.config.baseUrl;return O(a)?`${f}/zen/v1/responses`:C.has(N(a))?`${f}/zen/v1/messages`:`${f}/zen/v1/chat/completions`}async execute(a){return!function(){let{mode:a}=function(){try{let a,b=JSON.parse(m.readFileSync((a=process.env.APPDATA||process.env.HOME||process.cwd(),n.join(a,"9router","oc-egress.json")),"utf8"));return{mode:"direct"===b.mode?"direct":"proxy",lastFlipAt:b.lastFlipAt||0,flips:b.flips||0}}catch{return{mode:"proxy",lastFlipAt:0,flips:0}}}(),b=(process.env.NO_PROXY||process.env.no_proxy||"").split(",").map(a=>a.trim()).filter(Boolean),c=b.includes(o);"direct"!==a||c?"direct"!==a&&c&&(process.env.NO_PROXY=b.filter(a=>a!==o).join(",")):process.env.NO_PROXY=[...b,o].join(",")}(),super.execute({...a,credentials:this.prepareRequestCredentials(a)})}buildHeaders(a,b=!0,c=""){let d=a?.rawHeaders||{},f={};for(let[a,b]of Object.entries(d))f[a.toLowerCase()]=b;let g=f["user-agent"]||"",h=function(a){let b=String(a||"").match(/opencode\/(\d+)\.(\d+)(?:\.(\d+))?/i);if(!b)return!1;let c=parseInt(b[1],10),d=parseInt(b[2],10);return c>1||1===c&&d>=17}(g),i=a?.[w]||this.prepareRequestCredentials({credentials:a})[w],j=M(f["x-opencode-request"]),k=a?.[x]||j||H(),l=(f["x-9r-real-ip"]||f["x-real-ip"]||"").trim(),m=l&&!(!l||"127.0.0.1"===l||"::1"===l||l.startsWith("::ffff:127.")||l.startsWith("10.")||l.startsWith("192.168.")||/^172\.(1[6-9]|2\d|3[01])\./.test(l)||l.startsWith("fc00:")||l.startsWith("fe80:"))?l:l?function(){if(t||u)return t;u=!0;let a=(a,b)=>{e.get(a,{timeout:4e3},a=>{let c="";a.on("data",a=>c+=a),a.on("end",()=>b(c.trim()))}).on("error",()=>b(""))};return a("https://4.icanhazip.com",b=>{/^(\d{1,3}\.){3}\d{1,3}$/.test(b)?(t=b,u=!1):a("https://ip.sb",b=>{/^(\d{1,3}\.){3}\d{1,3}$/.test(b)?(t=b,u=!1):a("https://ifconfig.me/ip",a=>{/^(\d{1,3}\.){3}\d{1,3}$/.test(a)&&(t=a),u=!1})})}),t}():"",n={"Content-Type":"application/json",Authorization:"Bearer public","User-Agent":h?g:"opencode/1.18.31","x-opencode-client":f["x-opencode-client"]||"desktop","x-opencode-session":i,"x-opencode-request":k,"x-opencode-project":f["x-opencode-project"]||"global",...m?{"x-real-ip":m}:{},Accept:b?"text/event-stream":"*/*"};return c.endsWith("/messages")&&(n["anthropic-version"]=s.b8),n}}}};
|
|
1
|
+
"use strict";exports.id=1733,exports.ids=[1733],exports.modules={10640:(a,b,c)=>{c.d(b,{C5:()=>n,J4:()=>h,SF:()=>m,dV:()=>o,eG:()=>g,fH:()=>k});var d=c(19956),e=c(83199);let f=/^[a-zA-Z0-9_-]+$/;function g(a){return void 0===a?`call_${Date.now()}`:`call_${a}_${Date.now()}`}function h(a=0,b=0,c=""){let d="string"==typeof c&&c?`_${c.replace(/[^a-zA-Z0-9_-]/g,"")}`:"";return`call_msg${a}_tc${b}${d}`}function i(a){if(!a||"string"!=typeof a)return null;let b=a.replace(/[^a-zA-Z0-9_-]/g,"");return b.length>0?b:null}function j(a,b,c){if(a){let c=i(a);if(c){let a=b.indexOf(c);return -1!==a&&b.splice(a,1),c}}return b.length>0?b.shift():c()}function k(a){if(!a.messages||!Array.isArray(a.messages))return a;let b=[];for(let c=0;c<a.messages.length;c++){let d=a.messages[c];if(null!==d&&"object"==typeof d){if("assistant"===d.role&&d.tool_calls&&Array.isArray(d.tool_calls))for(let a=0;a<d.tool_calls.length;a++){let b=d.tool_calls[a];if(null!==b&&"object"==typeof b){if(!b.id||!f.test(b.id)){let d=i(b.id);b.id=d||h(c,a,b.function?.name)}b.type||(b.type="function"),b.function?.arguments!==void 0&&(b.function.arguments=(0,e.We)(b.function.arguments))}}if(Array.isArray(d.content))for(let a=0;a<d.content.length;a++){let b=d.content[a];if(null!==b&&"object"==typeof b&&"tool_use"===b.type&&b.id&&!f.test(b.id)){let d=i(b.id);b.id=d||h(c,a,b.name)}}if("assistant"===d.role){b=l(d);continue}if("tool"===d.role&&(d.tool_call_id=j(d.tool_call_id,b,()=>h(c,0))),Array.isArray(d.content))for(let a=0;a<d.content.length;a++){let e=d.content[a];e&&"object"==typeof e&&"tool_result"===e.type&&(e.tool_use_id=j(e.tool_use_id,b,()=>h(c,a)))}}}return a}function l(a){if(!a||"object"!=typeof a||"assistant"!==a.role)return[];let b=[];if(a.tool_calls&&Array.isArray(a.tool_calls))for(let c of a.tool_calls)c&&"object"==typeof c&&c.id&&b.push(c.id);if(Array.isArray(a.content))for(let c of a.content)c&&"object"==typeof c&&"tool_use"===c.type&&c.id&&b.push(c.id);return b}function m(a){if(!a.messages||!Array.isArray(a.messages))return a;let b=a.messages.some(a=>Array.isArray(a?.content)&&a.content.some(a=>a?.type==="tool_use"||a?.type==="tool_result"))||!!a.system,c=[],d=!1;for(let e=0;e<a.messages.length;e++){let f=a.messages[e],g=a.messages[e+1];c.push(f);let h=l(f);if(0!==h.length&&(!g||!function(a,b){if(!a||!b.length)return!1;if("tool"===a.role&&a.tool_call_id)return b.includes(a.tool_call_id);if("user"===a.role&&Array.isArray(a.content)){for(let c of a.content)if("tool_result"===c.type&&b.includes(c.tool_use_id))return!0}return!1}(g,h)))for(let a of(d=!0,h))b?c.push({role:"user",content:[{type:"tool_result",tool_use_id:a,content:"[No response received]"}]}):c.push({role:"tool",tool_call_id:a,content:"[No response received]"})}return d&&(a.messages=c),a}function n(a){return Array.isArray(a)?a.map(a=>a?.type?a:{...a,type:"custom"}):a}function o(a,b,c,e){return b===d.h.CLAUDE&&Array.isArray(c)&&e?.[a]?.quirks?.requireClaudeToolType===!0}},17717:(a,b,c)=>{c.d(b,{SZ:()=>o,Tz:()=>l,jD:()=>k,jJ:()=>m,oF:()=>n});var d=c(4630),e=c(92675);let f="openai-compatible-",g={baseUrl:e.Es},h={baseUrl:e.ky};function i(a){return"string"==typeof a&&a.startsWith(f)}function j(a){return"string"==typeof a&&a.startsWith("anthropic-compatible-")}function k(a,b=null){let c=b?.providerSpecificData?.apiType;return"chat"===c||"responses"===c?c:"string"==typeof a&&a.startsWith(`${f}responses-`)?"responses":"chat"}function l(a){if(a.input&&(Array.isArray(a.input)||"string"==typeof a.input)&&!a.messages)return"openai-responses";if(a.request?.contents&&"antigravity"===a.userAgent)return"antigravity";if(a.contents&&Array.isArray(a.contents))return"gemini";if(a.stream_options||a.response_format||void 0!==a.logprobs||void 0!==a.top_logprobs||void 0!==a.n||void 0!==a.presence_penalty||void 0!==a.frequency_penalty||a.logit_bias||a.user)return"openai";if(a.messages&&Array.isArray(a.messages)){let b=a.messages[0];if(b?.content&&Array.isArray(b.content)){let c=b.content[0];if(c?.type==="text"&&!a.model?.includes("/")){if(a.system||a.anthropic_version)return"claude";let c=b.content.some(a=>"image"===a.type&&a.source?.type==="base64"),d=b.content.some(a=>"image_url"===a.type&&a.image_url?.url);if(c)return"claude";if(d)return"openai";if(b.content.some(a=>"tool_use"===a.type||"tool_result"===a.type))return"claude"}}if(void 0!==a.system||a.anthropic_version)return"claude"}return"openai"}function m(a,b=null){return i(a)?"responses"===k(a,b)?"openai-responses":"openai":j(a)?"claude":function(a,b=null){if(i(a)){let c=k(a,b);return{...d.xq.openai,format:"responses"===c?"openai-responses":"openai",baseUrl:g.baseUrl}}return j(a)?{...d.xq.anthropic,format:"claude",baseUrl:h.baseUrl}:d.xq[a]||d.xq.openai}(a,b).format||"openai"}function n(a,b,c=null,e=null){let f=d.xq[a],g=f?.transports;if(!Array.isArray(g)||!g.length)return null;if(!e||e.includes(b)){let a=g.find(a=>a.format===b);if(a)return a}if(c&&(!e||e.includes(c)))return g.find(a=>a.format===c)||null;if(Array.isArray(e)&&e.length){let a=g.find(a=>e.includes(a.format));if(a)return a}return null}function o(a){return!function(a){let b=a.messages||a.contents;if(!b?.length)return!0;let c=b[b.length-1];return c?.role==="user"}(a)&&delete a.thinking,a}},27738:(a,b,c)=>{c.d(b,{Z:()=>h});var d=c(4630);let e=[{match:a=>/^kimi-/i.test(a||""),scope:"toolCalls"},{match:a=>/deepseek/i.test(a||""),scope:"all"}],f="deepseek-v4-pro",g={[`${f}-max`]:{thinkingType:"enabled",reasoningEffort:"max"},[`${f}-none`]:{thinkingType:"disabled",reasoningEffort:null}};function h({provider:a,model:b,body:c}){let i=d.xq[a]?.reasoningInject,j=e.find(a=>a.match(b));var k=function({provider:a,model:b,body:c}){let d=g[b];if("deepseek"!==a||!d||!c)return c;let e={...c,model:f,extra_body:{...c.extra_body||{},thinking:{...c.extra_body?.thinking||{},type:d.thinkingType}}};return d.reasoningEffort?e.reasoning_effort=d.reasoningEffort:delete e.reasoning_effort,e}({provider:a,model:b,body:c}),l=i||j;if(!l||!Array.isArray(k?.messages))return k;let m=k.messages.map(a=>!function(a,b){if(a?.role!=="assistant")return!1;let c=a.reasoning_content;return("string"!=typeof c||!(c.length>0))&&("toolCalls"!==b||Array.isArray(a.tool_calls)&&a.tool_calls.length>0)}(a,l.scope)?a:{...a,reasoning_content:" "});return{...k,messages:m}}},66451:(a,b,c)=>{c.d(b,{PN:()=>j,Xh:()=>k,g2:()=>i,js:()=>m,sc:()=>l});var d=c(78540),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"],[/^gpt-/,"openai"],[/^o[134]/,"openai"],[/^glm-/,"glm"],[/^qwen[-0-9]/,"qwen"],[/^deepseek-/,"deepseek"],[/^kimi-/,"kimi"],[/^moonshot-/,"kimi"],[/^minimax-/,"minimax"],[/^grok-/,"xai"],[/^(mistral|codestral)-/,"mistral"],[/^(cohere|command)-/,"cohere"],[/^(sonar|perplexity)-/,"perplexity"],[/^(llama|meta-llama)-/,"groq"],[/^yi-/,"lingyi"],[/^baichuan-/,"baichuan"],[/^doubao-/,"volcengine-ark"],[/^step-/,"stepfun"]]},69656:(a,b,c)=>{c.d(b,{HR:()=>function a(b,c){if(!c?.size||!b)return b;if(Array.isArray(b))return b.map(b=>a(b,c));if("object"!=typeof b)return b;let d=b,e=(a,c)=>{d===b&&(d={...b}),d[a]=c};if("content_block_start"===b.type){let a=b.content_block;a?.type==="tool_use"&&"string"==typeof a.name&&c.has(a.name)&&e("content_block",{...a,name:c.get(a.name)})}Array.isArray(b.content)&&e("content",b.content.map(a=>a?.type==="tool_use"&&"string"==typeof a.name&&c.has(a.name)?{...a,name:c.get(a.name)}:a)),Array.isArray(b.choices)&&e("choices",b.choices.map(a=>{let b=!1,d={...a};for(let e of["delta","message"]){let f=a?.[e];if(!f||!Array.isArray(f.tool_calls)||0===f.tool_calls.length)continue;let g=f.tool_calls.map(a=>{let d=a?.function?.name;return"string"==typeof d&&c.has(d)?(b=!0,{...a,function:{...a.function,name:c.get(d)}}):a});d[e]={...f,tool_calls:g}}return b?d:a})),Array.isArray(b.output)&&e("output",b.output.map(a=>a?.type==="function_call"&&"string"==typeof a.name&&c.has(a.name)?{...a,name:c.get(a.name)}:a));let f=b.item;return f?.type==="function_call"&&"string"==typeof f.name&&c.has(f.name)&&e("item",{...f,name:c.get(f.name)}),d},Ke:()=>h,g4:()=>i});let d=["bash","glob","grep","read"],e=new WeakMap;function f(a){let b=String(a??"").trim().toLowerCase();return d.includes(b)?b:""}function g(a){if(!a||"object"!=typeof a||Array.isArray(a))return"";if("string"==typeof a.name&&a.name.trim())return a.name.trim();let b=a.function;return b&&"object"==typeof b&&!Array.isArray(b)&&"string"==typeof b.name?b.name.trim():""}function h(a,b){var c,h;if(!a||"object"!=typeof a)return new Map;let i=Array.isArray(a.tools)&&a.tools.length>0,{tools:j,map:k}=function(a){let b=new Map;if(!Array.isArray(a)||0===a.length)return{tools:a,map:b};let c=new Set,d=[];for(let e of a){if(!e||"object"!=typeof e||Array.isArray(e)){d.push(e);continue}let a=g(e),h=f(a);if(!h){d.push(e);continue}if(!c.has(h))if(c.add(h),a!==h){b.set(h,a);let c=e.function&&"object"==typeof e.function&&!Array.isArray(e.function)?e.function:null;d.push(c?{...e,function:{...c,name:h}}:{...e,name:h})}else d.push(e)}return{tools:d,map:b}}(a.tools);return a.tools=function(a,b){let c=Array.isArray(a)?a:[];for(let a of d)c.some(b=>f(g(b))===a)||c.push(b?{type:"function",name:a,description:"This tool is currently unavailable and must not be used.",parameters:{type:"object",properties:{}}}:{type:"function",function:{name:a,description:"This tool is currently unavailable and must not be used.",parameters:{type:"object",properties:{}}}});return c}(j,b),!function(a,b){if(!a||"object"!=typeof a||!b?.size)return;let c=a.tool_choice;if(!c||"object"!=typeof c||Array.isArray(c))return;if("string"==typeof c.name){let d=f(c.name);d&&b.has(d)&&(a.tool_choice={...c,name:d});return}let d=c.function;if(d&&"object"==typeof d&&!Array.isArray(d)&&"string"==typeof d.name){let e=f(d.name);e&&b.has(e)&&(a.tool_choice={...c,function:{...d,name:e}})}}(a,k),!a.tool_choice&&(b?a.tool_choice="auto":i||(a.tool_choice="none")),c=a,h=k,c&&"object"==typeof c&&h?.size&&e.set(c,h),k}function i(a){return a&&"object"==typeof a&&e.get(a)||null}},83199:(a,b,c)=>{c.d(b,{DP:()=>j,N8:()=>g,We:()=>h,km:()=>i,me:()=>e});var d=c(18226);function e(a){if("string"==typeof a){let b=""===a.trim()?"...":a;return[{type:d.Du.MESSAGE,role:d.z7.USER,content:[{type:d.Du.INPUT_TEXT,text:b}]}]}return Array.isArray(a)?0===a.length?[{type:d.Du.MESSAGE,role:d.z7.USER,content:[{type:d.Du.INPUT_TEXT,text:"..."}]}]:a:null}c(10640);let f=0;function g(a){return"string"==typeof a&&a?a.length>64?a.substring(0,64):a:`call_${Date.now()}_${f+=1}`}function h(a){if(null==a||""===a)return"{}";if("string"!=typeof a)try{return JSON.stringify(a)}catch{return"{}"}try{return JSON.parse(a),a}catch{return"{}"}}function i(a){if("string"==typeof a)return{text:a,images:[]};if(!Array.isArray(a))return{text:j(a),images:[]};let b=[],c=[],e=0;for(let f of a)if(null!=f){if("string"==typeof f){e++,b.push(f);continue}if(f.type===d.Du.INPUT_TEXT||f.type===d.x4.TEXT){e++,"string"==typeof f.text&&b.push(f.text);continue}if(f.type===d.Du.INPUT_IMAGE||f.type===d.x4.IMAGE_URL){e++;let a="string"==typeof f.image_url?f.image_url:f.image_url?.url||f.file_id||"",g="object"==typeof f.image_url?f.image_url?.detail:f.detail;"string"==typeof a&&a?c.push({type:d.x4.IMAGE_URL,image_url:{url:a,detail:g||"auto"}}):b.push("[image omitted: missing image payload]");continue}try{b.push(JSON.stringify(f))}catch{b.push(String(f))}}if(0===e)try{return{text:JSON.stringify(a),images:[]}}catch{return{text:String(a),images:[]}}return{text:b.join("\n"),images:c}}function j(a){if("string"==typeof a)return a;if(null==a)return"";if(Array.isArray(a))return a.map(a=>{try{return a?.text??JSON.stringify(a)}catch{return String(a)}}).join("");try{return JSON.stringify(a)}catch{return String(a)}}},85187:(a,b,c)=>{c.d(b,{H:()=>j});var d=c(60290),e=c(18129),f=c(89843),g=c(12828),h=c(92675),i=c(17717);class j{constructor(a,b){this.provider=a,this.config=b,this.noAuth=b?.noAuth||!1}getProvider(){return this.provider}getBaseUrls(){return this.config.baseUrls||(this.config.baseUrl?[this.config.baseUrl]:[])}getFallbackCount(a=null){return this.getBaseUrls().length||1}buildUrl(a,b,c=0,d=null){if(this.provider?.startsWith?.("openai-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.Es).replace(/\/$/,""),b="responses"===(0,i.jD)(this.provider,d);return`${a}${b?"/responses":"/chat/completions"}`}if(this.provider?.startsWith?.("anthropic-compatible-")){let a=(d?.providerSpecificData?.baseUrl||h.ky).replace(/\/$/,"");return`${a}/messages`}let e=this.getBaseUrls();return e[c]||e[0]||this.config.baseUrl}buildHeaders(a,b=!0){let c={"Content-Type":"application/json",...this.config.headers};return this.provider?.startsWith?.("anthropic-compatible-")?(a.apiKey?c["x-api-key"]=a.apiKey:a.accessToken&&(c.Authorization=`Bearer ${a.accessToken}`),c["anthropic-version"]||(c["anthropic-version"]=h.b8)):a.accessToken?c.Authorization=`Bearer ${a.accessToken}`:a.apiKey&&(c.Authorization=`Bearer ${a.apiKey}`),b&&(c.Accept="text/event-stream"),c}transformRequest(a,b,c,d){return b}shouldRetry(a,b,c=null){return a===d.gx.RATE_LIMITED&&b+1<this.getFallbackCount(c)}async refreshCredentials(a,b,c=null){return null}needsRefresh(a){return(0,e.fp)(this.provider,a)}parseError(a,b){return{status:a.status,message:b||`HTTP ${a.status}`}}async execute({model:a,body:b,stream:c,credentials:e,signal:h,log:i,proxyOptions:j=null,providerOverrides:k=null}){let l=this.getFallbackCount(e),m=null,n=0,o={},p={...d.cI,...this.config.retry},q=async(a,b,c,e=null)=>{let{attempts:f,delayMs:g}=(0,d.DR)(p[b]);if(f<=0||o[a]>=f)return!1;let h=g;if(e&&this.computeRetryDelay){let b=await this.computeRetryDelay(e,o[a]+1,g);if(!1===b)return!1;null!=b&&(h=b)}return o[a]++,i?.debug?.("RETRY",`${c} retry ${o[a]}/${f} after ${h/1e3}s`),await new Promise(a=>setTimeout(a,h)),!0};for(let p=0;p<l;p++){let r=this.transformRequest(a,b,c,e),s=this.buildUrl(a,c,p,e),t=this.buildHeaders(e,c,s,a,r);k?.headers&&Object.assign(t,k.headers),o[p]||(o[p]=0);let u=new AbortController,v=this.config?.timeoutMs||d.pH,w=setTimeout(()=>u.abort(Error("fetch connect timeout")),v),x=h?AbortSignal.any([h,u.signal]):u.signal;try{let a=JSON.stringify(r),b=Date.now();(0,g.s)("FETCH",`${this.provider.toUpperCase()} → ${s} | body=${a.length}B | connectTimeout=${v}ms`);let c=await (0,f.proxyAwareFetch)(s,{method:"POST",headers:t,body:a,signal:x},j);if(clearTimeout(w),!c)throw Error(`No response received from ${this.provider} (${s})`);let d=c.headers?.get?.("content-type")||"",h=c.headers?.get?.("content-length")||"?";if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ← ${c.status} | ttft=${Date.now()-b}ms | ct=${d} | cl=${h}`),await q(p,c.status,`status ${c.status}`,c)){p--;continue}if(this.shouldRetry(c.status,p,e)){i?.debug?.("RETRY",`${c.status} on ${s}, trying fallback ${p+1}`),n=c.status;continue}return{response:c,url:s,headers:t,transformedBody:r}}catch(b){clearTimeout(w),m=b;let a=u.signal.aborted&&"AbortError"===b.name;if((0,g.s)("FETCH",`${this.provider.toUpperCase()} ✖ ${b.name}: ${b.message}${a?" (connect timeout)":""}`),"AbortError"===b.name&&!a)throw b;if(await q(p,d.gx.BAD_GATEWAY,`network "${b.message}"`)){p--;continue}if(p+1<l){i?.debug?.("RETRY",`Error on ${s}, trying fallback ${p+1}`);continue}throw b}}throw m||Error(`All ${l} URLs failed with status ${n}`)}}},96723:(a,b,c)=>{c.d(b,{j9:()=>R,f6:()=>I});var d=c(55511),e=c(55591),f=c(28730),g=c(85187),h=c(4630),i=c(60290),j=c(2081),k=c(27738),l=c(91576),m=c(29021),n=c(33873);let o="opencode.ai";var p=c(8382),q=c(69656),r=c(83199),s=c(92675);let t=null,u=!1,v="x-opencode-session",w="_opencodeSession",x="_opencodeRequest",y=/^ses_[0-9a-f]{12}[0-9A-Za-z]{14}$/,z=/^msg_[0-9a-f]{12}[0-9A-Za-z]{14}$/,A="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",B=new Map,C=setInterval(()=>{let a=Date.now();for(let[b,c]of B)a-c.lastUsed>i.v1.sessionTtlMs&&B.delete(b)},i.v1.sessionCleanupIntervalMs);C.unref&&C.unref();let D=new Set(["muse-spark-1.2-contributor-free","muse-spark-1.3-contributor-free"]),E=new Set(["union-alpha"]),F=0,G=0;function H(){let a=d.randomBytes(14),b="";for(let c=0;c<14;c++)b+=A[a[c]%62];return b}function I(a=Date.now()){a!==F&&(F=a,G=0),G++;let b=~(4096n*BigInt(a)+BigInt(G)),c=Array.from({length:6},(a,c)=>Number(b>>BigInt(40-8*c)&255n).toString(16).padStart(2,"0")).join("");return`ses_${c}${H()}`}function J(a=Date.now()){let b=4096n*BigInt(a)+1n,c=Array.from({length:6},(a,c)=>Number(b>>BigInt(40-8*c)&255n).toString(16).padStart(2,"0")).join("");return`msg_${c}${H()}`}function K(a,b="",c=Date.now()){if("string"==typeof a&&y.test(a.trim()))return a.trim();let e=`opencode:tr:${b||"generic"}:${a||""}`,f=B.get(e);if(f)return f.lastUsed=Date.now(),B.delete(e),B.set(e,f),f.sessionId;c!==F&&(F=c,G=0),G++;let g=~(4096n*BigInt(c)+BigInt(G)),h=Array.from({length:6},(a,b)=>Number(g>>BigInt(40-8*b)&255n).toString(16).padStart(2,"0")).join(""),i=d.createHash("sha256").update(`opencode\0${b||"generic"}\0${a||""}`).digest(),j="";for(let a=6;a<20;a++)j+=A[i[a]%62];let k=`ses_${h}${j}`;return B.size>=1e3&&B.delete(B.keys().next().value),B.set(e,{sessionId:k,lastUsed:Date.now()}),k}function L(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:b}function M(a){if("string"!=typeof a)return null;let b=a.trim();return!b||b.length>256?null:z.test(b)?b:null}function N(a){return String(a||"").replace(/\([^()]+\)\s*$/,"").trim()}function O(a){let b=N(a);return D.has(b)||(0,p.nh)(b)}function P(a,b,c,e){let f=b?.rawHeaders||{},g=function(a){if(!a||"object"!=typeof a)return null;for(let[b,c]of Object.entries(a))if(b.toLowerCase()===v){let a=L(c);if(a&&y.test(a))return a}return null}(f);if(g)return g;let h=null;for(let[a,b]of Object.entries(f))if(a.toLowerCase()===v){h=L(b);break}let i=h||L(c);if(i)return K(i,e);if(b?.connectionId||function(a){try{if(!a||"object"!=typeof a)return!1;if("string"==typeof a.session_id&&a.session_id.trim()||"string"==typeof a.conversation_id&&a.conversation_id.trim()||"string"==typeof a.prompt_cache_key&&a.prompt_cache_key.trim()||a.metadata&&"string"==typeof a.metadata.user_id&&a.metadata.user_id.trim()||a.request&&null!=a.request.sessionId&&""!==String(a.request.sessionId))return!0;let b=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(b){let a="";for(let c of b)if(c?.role==="assistant"){let b=c.content;if("string"==typeof b)a+=b;else if(Array.isArray(b))for(let c of b)a+=c?.text||c?.output||"";if(a.length>=50)return!0}}return!1}catch{return!1}}(a)||function(a){if(!a||"object"!=typeof a)return!1;for(let b of Object.keys(a)){let a=b.toLowerCase();if("x-client-request-id"===a||"x-session-id"===a||"session-id"===a||"session_id"===a||"x-amp-thread-id"===a||"x-claude-code-session-id"===a||"x-conversation-id"===a||"conversation-id"===a||a.includes("session"))return!0}return!1}(f)){let c=null;try{c=(0,l.oV)({headers:f,body:a,connectionId:b?.connectionId,scope:"opencode"})}catch{c=null}if(c)return K(c,e)}let j=function(a){let b=a?.connectionId||a?.id;if(b)return`opencode:conn:${String(b).slice(0,128)}`;let c=a?.rawHeaders||{},e=c.authorization||c.Authorization||c["x-api-key"]||c["X-Api-Key"]||"";if(e){let a=d.createHash("sha256").update(String(e)).digest("hex").slice(0,32);return`opencode:auth:${a}`}return"opencode:default"}(b),k=B.get(j);if(k)return k.lastUsed=Date.now(),B.delete(j),B.set(j,k),k.sessionId;let m=I();return B.size>=1e3&&B.delete(B.keys().next().value),B.set(j,{sessionId:m,lastUsed:Date.now()}),m}function Q(a,b,c){for(let[a,c]of Object.entries(b?.rawHeaders||{}))if("x-opencode-request"===a.toLowerCase()){let a=M(c);if(a)return a;break}return function(a,b,c=Date.now()){let e=function(a){try{if(!a||"object"!=typeof a)return"";let b=Array.isArray(a.messages)?a.messages:Array.isArray(a.input)?a.input:null;if(!b)return"string"==typeof a.input?a.input.slice(-600):"";for(let a=b.length-1;a>=0;a--){let c=b[a];if(!c||c.role&&"user"!==c.role)continue;let d=c.content;if("string"==typeof d&&d.trim())return d.trim().slice(-600);if(Array.isArray(d)){let a=d.map(a=>"string"==typeof a?a:a?.text||a?.input_text||"").join(" ").trim();if(a)return a.slice(-600)}}}catch{}return""}(b);if(!e)return J(c);let f=d.createHash("sha256").update(`opencode-req\0${a||""}\0${e}`).digest(),g=4096n*BigInt(c)+1n,h=Array.from({length:6},(a,b)=>Number(g>>BigInt(40-8*b)&255n).toString(16).padStart(2,"0")).join(""),i="";for(let a=6;a<20;a++)i+=A[f[a]%62];let j=`msg_${h}${i}`;return z.test(j)?j:J(c)}(c,a)}class R extends g.H{constructor(){super("opencode",h.xq.opencode)}prepareRequestCredentials({body:a,credentials:b,providerSessionId:c,clientTool:d}={}){let e=b||{},f=P(a,e,c,d);return{...e,[w]:f,[x]:Q(a,e,f)}}transformRequest(a,b,c,d){if(d&&(d[w]||(d[w]=P(b,d)),d[x]||(d[x]=Q(b,d,d[w]))),b&&"object"==typeof b&&a&&!b.model&&(b.model=a),b&&"object"==typeof b&&(b.stream=!0),O(a||b?.model)&&b&&"object"==typeof b){"tool_choice"in b&&"auto"!==b.tool_choice&&this.config.quirks?.forceAutoToolChoiceModels?.includes(N(a))&&(b.tool_choice="auto");let c=(0,r.me)(b.input);c&&(b.input=c),Array.isArray(b.input)&&0!==b.input.length||(b.input=[{type:"message",role:"user",content:[{type:"input_text",text:"..."}]}]),void 0===b.max_output_tokens&&(void 0!==b.max_completion_tokens?b.max_output_tokens=b.max_completion_tokens:void 0!==b.max_tokens&&(b.max_output_tokens=b.max_tokens)),void 0!==b.max_output_tokens&&(b.max_output_tokens=Math.max(16,Number(b.max_output_tokens)||16)),delete b.max_tokens,delete b.max_completion_tokens,"number"==typeof b.max_output_tokens&&(b.max_output_tokens=Math.min(Math.max(b.max_output_tokens,16),65536)),function(a,b){let c=b.reasoning,d=c&&"object"==typeof c&&!Array.isArray(c)?c:null,e="string"==typeof b.reasoning_effort?b.reasoning_effort:d?.effort;if("string"!=typeof e)return;let f=N(a||b.model),g=(0,j.k)("opencode",f),h=e.toLowerCase().trim();("max"===h||"ultra"===h)&&g?.length&&!g.includes(h)&&("ultra"===h&&g.includes("max")?h="max":g.includes("xhigh")&&(h="xhigh")),b.reasoning={...d,effort:h},b.reasoning.summary||(b.reasoning.summary="auto"),delete b.reasoning_effort}(a,b),b.stream=!0,b.store=!1,function(a){if(!Array.isArray(a.tools))return;let b=new Set;if(a.tools=a.tools.filter(a=>{if(!a||"object"!=typeof a||Array.isArray(a))return!1;let c=a.function&&"object"==typeof a.function&&!Array.isArray(a.function)?a.function:null,d=("string"==typeof a.name?a.name:"string"==typeof c?.name?c.name:"").trim();if(!d)return!1;let e="string"==typeof a.description?a.description:"string"==typeof c?.description?c.description:"",g=a.parameters&&"object"==typeof a.parameters&&!Array.isArray(a.parameters)?a.parameters:c?.parameters&&"object"==typeof c.parameters&&!Array.isArray(c.parameters)?c.parameters:{type:"object",properties:{}};for(let b of("object"!==g.type||g.properties||(g={...g,properties:{}}),Object.keys(a)))delete a[b];return a.type="function",a.name=d.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,f.ix),e&&(a.description=e),a.parameters=g,b.add(a.name),!0}),a.tool_choice&&"object"==typeof a.tool_choice&&!Array.isArray(a.tool_choice)&&"function"===a.tool_choice.type){let c="string"==typeof a.tool_choice.name?a.tool_choice.name.trim():"",d=c.slice(0,f.ix);c&&(b.has(c)||b.has(d))?a.tool_choice.name=d:delete a.tool_choice}}(b),function(a){if(!Array.isArray(a.input))return;a.input=a.input.filter(a=>!!(!a||"object"!=typeof a||Array.isArray(a))||"reasoning"!==a.type&&((delete a.encrypted_content,delete a.reasoning_encrypted_content,"function_call"===a.type)?!!a.name&&"string"==typeof a.name&&""!==a.name.trim()&&(a.name=a.name.trim().replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,f.ix),a.call_id=(0,r.N8)(a.call_id),a.arguments=(0,r.We)(a.arguments),!0):("function_call_output"===a.type&&(a.call_id=(0,r.N8)(a.call_id),a.output=(0,r.DP)(a.output)),!0)));let b=new Set(a.input.filter(a=>a?.type==="function_call").map(a=>a.call_id));a.input=a.input.filter(a=>a?.type!=="function_call_output"||b.has(a.call_id));let c=new Set(a.input.filter(a=>a?.type==="function_call_output").map(a=>a.call_id)),d=[];for(let b of a.input)d.push(b),b?.type!=="function_call"||c.has(b.call_id)||(d.push({type:"function_call_output",call_id:b.call_id,output:"{}"}),c.add(b.call_id));a.input=d}(b),(0,q.Ke)(b,!0)}else b&&"object"==typeof b&&(0,q.Ke)(b,!1);return(0,k.Z)({provider:this.provider,model:a,body:b})}buildUrl(a,b,c=0,d=null){let e=d?.runtimeTransport;if(e?.baseUrl)return e.urlSuffix?`${e.baseUrl}${e.urlSuffix}`:e.baseUrl;let f=this.config.baseUrl;return O(a)?`${f}/zen/v1/responses`:E.has(N(a))?`${f}/zen/v1/messages`:`${f}/zen/v1/chat/completions`}async execute(a){return!function(){let{mode:a}=function(){try{let a,b=JSON.parse(m.readFileSync((a=process.env.APPDATA||process.env.HOME||process.cwd(),n.join(a,"9router","oc-egress.json")),"utf8"));return{mode:"direct"===b.mode?"direct":"proxy",lastFlipAt:b.lastFlipAt||0,flips:b.flips||0}}catch{return{mode:"proxy",lastFlipAt:0,flips:0}}}(),b=(process.env.NO_PROXY||process.env.no_proxy||"").split(",").map(a=>a.trim()).filter(Boolean),c=b.includes(o);"direct"!==a||c?"direct"!==a&&c&&(process.env.NO_PROXY=b.filter(a=>a!==o).join(",")):process.env.NO_PROXY=[...b,o].join(",")}(),super.execute({...a,credentials:this.prepareRequestCredentials(a)})}buildHeaders(a,b=!0,c=""){let d=a?.rawHeaders||{},f={};for(let[a,b]of Object.entries(d))f[a.toLowerCase()]=b;let g=f["user-agent"]||"",h=function(a){let b=String(a||"").match(/opencode\/(\d+)\.(\d+)(?:\.(\d+))?/i);if(!b)return!1;let c=parseInt(b[1],10),d=parseInt(b[2],10);return c>1||1===c&&d>=17}(g),i=a?.[w]||this.prepareRequestCredentials({credentials:a})[w],j=M(f["x-opencode-request"]),k=a?.[x]||j||J(),l=(f["x-9r-real-ip"]||f["x-real-ip"]||"").trim(),m=l&&!(!l||"127.0.0.1"===l||"::1"===l||l.startsWith("::ffff:127.")||l.startsWith("10.")||l.startsWith("192.168.")||/^172\.(1[6-9]|2\d|3[01])\./.test(l)||l.startsWith("fc00:")||l.startsWith("fe80:"))?l:l?function(){if(t||u)return t;u=!0;let a=(a,b)=>{e.get(a,{timeout:4e3},a=>{let c="";a.on("data",a=>c+=a),a.on("end",()=>b(c.trim()))}).on("error",()=>b(""))};return a("https://4.icanhazip.com",b=>{/^(\d{1,3}\.){3}\d{1,3}$/.test(b)?(t=b,u=!1):a("https://ip.sb",b=>{/^(\d{1,3}\.){3}\d{1,3}$/.test(b)?(t=b,u=!1):a("https://ifconfig.me/ip",a=>{/^(\d{1,3}\.){3}\d{1,3}$/.test(a)&&(t=a),u=!1})})}),t}():"",n={"Content-Type":"application/json",Authorization:"Bearer public","User-Agent":h?g:"opencode/1.19.0","x-opencode-client":f["x-opencode-client"]||"desktop","x-opencode-session":i,"x-opencode-request":k,"x-opencode-project":f["x-opencode-project"]||"global",...m?{"x-real-ip":m}:{},Accept:b?"text/event-stream":"*/*"};return c.endsWith("/messages")&&(n["anthropic-version"]=s.b8),n}}}};
|