67router 1.0.2 → 1.0.3
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 +2 -2
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +17 -17
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +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_client-reference-manifest.js +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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_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_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.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/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.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/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +3 -3
- 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/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login/page_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 +3 -3
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +2 -2
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/6540.js +1 -1
- package/app/.next-cli-build/server/chunks/7037.js +1 -1
- package/app/.next-cli-build/server/chunks/827.js +1 -1
- package/app/.next-cli-build/server/chunks/8635.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8895.js +4 -4
- package/app/.next-cli-build/server/chunks/9100.js +1 -1
- package/app/.next-cli-build/server/chunks/9604.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/static/chunks/{1321-6c2d72b4ca4e6eed.js → 1321-10507ce87a2d1e74.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-058be880d6c5b4e0.js → 5497-3353154ebc0a5eb1.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-4b073ba7273cde14.js +1 -0
- package/app/cli/.build-home/AppData/Roaming/67router/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/67router/db/data.sqlite-wal +0 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-49a84b0cda78a0cb.js +0 -1
- /package/app/.next-cli-build/static/{dsHxdInmFi9NHH3ULl21u → eXoiEKu5yWZkk7npUXFrc}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{dsHxdInmFi9NHH3ULl21u → eXoiEKu5yWZkk7npUXFrc}/_ssgManifest.js +0 -0
package/app/.next-cli-build/static/chunks/{5497-058be880d6c5b4e0.js → 5497-3353154ebc0a5eb1.js}
RENAMED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`,children:[w.includes(e.name)&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),e.name]},e.id)})})]}),Object.entries(X).map(([e,t])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,r.jsx)(o.A,{src:`/providers/${e}.png`,alt:t.name,size:14,fallbackText:(t.name||e).slice(0,2).toUpperCase(),fallbackColor:t.color}),(0,r.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,r.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=i===e.value,a=e.isPlaceholder;return(0,r.jsx)("button",{onClick:()=>ee(e),title:a?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|
|
5
5
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
6
6
|
${a?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":t?"bg-primary text-white border-primary":w.includes(e.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
7
|
-
`,children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[w.includes(e.value)&&!a&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,r.jsx)(d.default,{caps:S(e.value)})]}):(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)(d.default,{caps:S(e.value)})]})]})},e.value)})})]},e)),0===Object.keys(X).length&&0===Z.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}f.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onSelect:i().func.isRequired,onDeselect:i().func,selectedModel:i().string,activeProviders:i().arrayOf(i().shape({provider:i().string.isRequired})),title:i().string,modelAliases:i().object,kindFilter:i().string,addedModelValues:i().arrayOf(i().string),closeOnSelect:i().bool}},73579:(e,t,a)=>{a.d(t,{default:()=>x});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(81127),o=a(11910),d=a(92542),c=a(56061),m=a(88105),u=a(98);function x({isOpen:e,connection:t,proxyPools:a,onSave:s,onClose:i}){let[p,h]=(0,n.useState)({name:"",priority:1,apiKey:""}),[g,f]=(0,n.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[b,v]=(0,n.useState)({accountId:""}),[j,y]=(0,n.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[k,w]=(0,n.useState)(!1),[N,C]=(0,n.useState)(""),[S,O]=(0,n.useState)(!1),[F,W]=(0,n.useState)(null),[I,A]=(0,n.useState)(!1),[E,P]=(0,n.useState)(null),[T,_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(t){if(h({name:t.name||"",priority:t.priority||1,apiKey:""}),"azure"===t.provider&&t.providerSpecificData&&f({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&v({accountId:t.providerSpecificData.accountId||""}),m.Q2?.[t.provider]?.credentialForm==="aws"){let e=t.providerSpecificData||{};y({profile:e.profile||"",region:e.region||"",accessKeyId:e.accessKeyId||"",sessionToken:""}),w(!1)}let e=m.Q2?.[t.provider];e?.regions&&C(t.providerSpecificData?.region||e.defaultRegion||e.regions[0]?.id||""),W(null),P(null)}},[t,e]);let $=t?.authType==="oauth",z=t?.provider==="azure",R=t?.provider==="cloudflare-ai",D=m.Q2?.[t?.provider]?.credentialForm==="aws",L=!!t&&((0,m.mq)(t.provider)||(0,m.gb)(t.provider)),U=t&&m.Q2?.[t.provider]?.regions||null,q=()=>{if(U&&N)return{...t?.providerSpecificData||{},region:N}},M=()=>({profile:j.profile.trim(),region:j.region.trim(),accessKeyId:j.accessKeyId.trim(),sessionToken:k?null:j.sessionToken.trim()}),K=async()=>{if(t?.provider){O(!0),W(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),a=await e.json();W(a.valid?"success":"failed")}catch{W("failed")}finally{O(!1)}}},V=async()=>{if(t?.provider&&p.apiKey){A(!0),P(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:p.apiKey,...z?{providerSpecificData:g}:{},...R?{providerSpecificData:b}:{},...D?{providerSpecificData:M()}:{},...U?{providerSpecificData:q()}:{}})}),a=await e.json();P(a.valid?"success":"failed")}catch{P("failed")}finally{A(!1)}}},J=async()=>{if(t){_(!0);try{let e={name:p.name,priority:p.priority};if(!$&&p.apiKey){e.apiKey=p.apiKey;let a="success"===E;if(!a)try{A(!0),P(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:p.apiKey,...z?{providerSpecificData:g}:{},...R?{providerSpecificData:b}:{},...D?{providerSpecificData:M()}:{},...U?{providerSpecificData:q()}:{}})});a=!!(await e.json()).valid,P(a?"success":"failed")}catch{P("failed")}finally{A(!1)}a&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}z&&(e.providerSpecificData={azureEndpoint:g.azureEndpoint,apiVersion:g.apiVersion,deployment:g.deployment,organization:g.organization}),R&&(e.providerSpecificData={accountId:b.accountId}),D&&(e.providerSpecificData=M()),U&&N&&(e.providerSpecificData=q()),await s(e)}finally{_(!1)}}};return t?(0,r.jsx)(l.default,{isOpen:e,title:"Edit Connection",onClose:i,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Name",value:p.name,onChange:e=>h({...p,name:e.target.value}),placeholder:$?"Account name":"Production Key"}),$&&t.email&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,r.jsx)("p",{className:"font-medium",children:t.email})]}),(0,r.jsx)(o.default,{label:"Priority",type:"number",value:p.priority,onChange:e=>h({...p,priority:Number.parseInt(e.target.value,10)||1})}),!$&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{label:"API Key",type:"password",value:p.apiKey,onChange:e=>h({...p,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(d.default,{onClick:V,disabled:!p.apiKey||I||T,variant:"secondary",children:I?"Checking...":"Check"})})]}),E&&(0,r.jsx)(c.default,{variant:"success"===E?"success":"error",children:"success"===E?"Valid":"Invalid"})]}),z&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,r.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(o.default,{label:"Azure Endpoint",value:g.azureEndpoint,onChange:e=>f({...g,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,r.jsx)(o.default,{label:"Deployment Name",value:g.deployment,onChange:e=>f({...g,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,r.jsx)(o.default,{label:"API Version",value:g.apiVersion,onChange:e=>f({...g,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,r.jsx)(o.default,{label:"Organization",value:g.organization,onChange:e=>f({...g,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),D&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,r.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(o.default,{label:"AWS Profile (SSO — recommended)",value:j.profile,onChange:e=>y({...j,profile:e.target.value}),placeholder:"my-sso-profile",hint:"Clear this to use static keys instead; a profile takes precedence."}),(0,r.jsx)(o.default,{label:"Region",value:j.region,onChange:e=>y({...j,region:e.target.value}),placeholder:"us-east-1"}),(0,r.jsx)(o.default,{label:"Access Key ID (only for static keys)",value:j.accessKeyId,onChange:e=>y({...j,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,r.jsx)(o.default,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:j.sessionToken,onChange:e=>y({...j,sessionToken:e.target.value}),placeholder:"FwoGZXIvYXdz...",hint:"Leave blank to keep the saved token. Enter a new token to replace it.",disabled:k}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("input",{type:"checkbox",checked:k,onChange:e=>{w(e.target.checked),e.target.checked&&y({...j,sessionToken:""})}}),"Remove saved session token"]})]})]}),U&&(0,r.jsx)(u.default,{label:"Region",value:N,onChange:e=>C(e.target.value),options:U.map(e=>({value:e.id,label:e.label}))}),!L&&!z&&!R&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.default,{onClick:K,variant:"secondary",disabled:S,children:S?"Testing...":"Test Connection"}),F&&(0,r.jsx)(c.default,{variant:"success"===F?"success":"error",children:"success"===F?"Valid":"Failed"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{onClick:J,fullWidth:!0,disabled:T,children:T?"Saving...":"Save"}),(0,r.jsx)(d.default,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}x.propTypes={isOpen:i().bool.isRequired,connection:i().shape({id:i().string,name:i().string,email:i().string,priority:i().number,authType:i().string,provider:i().string,providerSpecificData:i().object}),proxyPools:i().arrayOf(i().shape({id:i().string,name:i().string})),onSave:i().func.isRequired,onClose:i().func.isRequired}},80752:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(1620),o=a(40197),d=a(81127);function c({icon:e,label:t,onClick:a,trailing:n,danger:s}){return(0,r.jsxs)("button",{onClick:a,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${s?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[20px] ${s?"":"text-text-muted"}`,children:e}),(0,r.jsx)("span",{className:"flex-1 text-left",children:t}),n&&(0,r.jsx)("span",{className:"text-base",children:n})]})}function m({onLogout:e}){let[t,a]=(0,n.useState)(!1),[s,i]=(0,n.useState)(!1),[u,x]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1),{toggleTheme:g,isDark:f}=(0,l.D)(),b=(0,n.useRef)(null),v=async()=>{h(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}h(!1),x(!1)};return(0,n.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&a(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative",ref:b,children:[(0,r.jsx)("button",{onClick:()=>a(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,r.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,r.jsx)(c,{icon:"history",label:"Change Log",onClick:()=>{a(!1),i(!0)}}),(0,r.jsx)(c,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{a(!1),x(!0)}}),(0,r.jsx)(c,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{a(!1),e()}})]})]}),(0,r.jsx)(o.default,{isOpen:s,onClose:()=>i(!1)}),(0,r.jsx)(d.ConfirmModal,{isOpen:u,onClose:()=>x(!1),onConfirm:v,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:p})]})}c.propTypes={icon:i().string.isRequired,label:i().string.isRequired,onClick:i().func.isRequired,trailing:i().node,danger:i().bool},m.propTypes={onLogout:i().func.isRequired}},81127:(e,t,a)=>{a.d(t,{ConfirmModal:()=>d,default:()=>o});var r=a(95155),n=a(12115),s=a(31474),i=a(92542),l=a(97677);function o({isOpen:e,onClose:t,title:a,children:i,footer:d,size:c="md",closeOnOverlay:m=!0,showTrafficLights:u=!0,className:x}){return((0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,n.useEffect)(()=>{let a=a=>{"Escape"===a.key&&e&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0}),(0,r.jsxs)("div",{className:(0,s.cn)("relative w-full bg-surface","border border-border","rounded-none","fade-in",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[c],x),children:[(a||u)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[u&&(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,r.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,r.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,r.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),a&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:a})]}),(0,r.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:i}),d&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:d})]})]}):null}function d({isOpen:e,onClose:t,onConfirm:a,title:n="Confirm",message:s,confirmText:l="Confirm",cancelText:c="Cancel",variant:m="danger",loading:u=!1}){return(0,r.jsx)(o,{isOpen:e,onClose:t,title:n,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{variant:"ghost",onClick:t,disabled:u,children:c}),(0,r.jsx)(i.default,{variant:m,onClick:a,loading:u,children:l})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:s})})}},90882:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497),o=a(11059);let d=new Set(["trae","windsurf","zed"]),c={trae:{label:"Cloud-IDE-JWT",instructions:"Sign in at trae.ai (or solo.trae.ai), open DevTools → Network, copy the Cloud-IDE-JWT token from any request's Authorization header (~14-day lifetime).",placeholder:"Paste Cloud-IDE-JWT here...",ideName:"Trae",ideOptional:!0},windsurf:{label:"Windsurf API key",instructions:'In the Windsurf/VS Code IDE, run the "Windsurf: Provide Auth Token" command, then copy the displayed sk-ws-... key.',placeholder:"Paste sk-ws-... key here...",ideName:"Windsurf",ideOptional:!1}};function m({isOpen:e,provider:t,providerInfo:a,onSuccess:s,onClose:i,oauthMeta:u,idcConfig:x}){let[p,h]=(0,n.useState)("waiting"),[g,f]=(0,n.useState)(null),[b,v]=(0,n.useState)(""),[j,y]=(0,n.useState)(null),[k,w]=(0,n.useState)(!1),[N,C]=(0,n.useState)(null),[S,O]=(0,n.useState)(!1),[F,W]=(0,n.useState)("browser"),[I,A]=(0,n.useState)(""),[E,P]=(0,n.useState)(null),T=(0,n.useRef)(null),_=(0,n.useRef)(!1),$=(0,n.useRef)(!1),z=(0,n.useRef)({proxyStarted:!1,proxyProvider:null,stopSent:!1}),R=(0,n.useRef)(s),D=(0,n.useRef)(i),L=(0,n.useRef)(e),U=(0,n.useRef)(null),{copied:q,copy:M}=(0,o.C)(),[K,V]=(0,n.useState)(!1),[J,B]=(0,n.useState)("/callback?code=..."),G=(0,n.useRef)(!1);(0,n.useEffect)(()=>{V("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),B(`${window.location.origin}/callback?code=...`)},[]);let H=(0,n.useCallback)(async(e,a)=>{if(g)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:g.redirectUri,codeVerifier:g.codeVerifier,state:a,...g.systemId?{systemId:g.systemId}:{},...u?{meta:u}:{}})}),n=await r.json();if(!r.ok)throw Error(n.error);h("success"),R.current?.()}catch(e){y(e.message),h("error")}},[g,t,u]),Q=(0,n.useCallback)(async e=>{if(g?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:g.state})}),a=await t.json();if(!t.ok)throw Error(a.error);h("success"),R.current?.()}catch(e){y(e.message),h("error")}},[g]),Y=(0,n.useCallback)(async(e,a,r,n,s)=>{_.current=!1,O(!0);let i=Date.now()+(Number.isFinite(s)&&s>0?s:12e4);for(;Date.now()<i;){if(_.current){console.log("[OAuthModal] Polling aborted"),O(!1);return}if(await new Promise(e=>setTimeout(e,1e3*r)),_.current){console.log("[OAuthModal] Polling aborted after sleep"),O(!1);return}try{let s=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:a,extraData:n})}),i=await s.json();if(i.success){_.current=!0,h("success"),O(!1),R.current?.();return}if("expired_token"===i.error||"access_denied"===i.error||i.fatal)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){y(e.message),h("error"),O(!1);return}}y("Authorization timeout"),h("error"),O(!1)},[t]),Z=(0,n.useCallback)(()=>{let e=z.current;e.proxyStarted&&!e.stopSent&&e.proxyProvider&&(e.stopSent=!0,fetch(`/api/oauth/${e.proxyProvider}/stop-proxy`).catch(()=>{}))},[]),X=(0,n.useCallback)(async e=>{let t=await fetch(`/api/oauth/${e}/start-proxy`),a=await t.json();if(!t.ok||!a.success||!a.callbackUrl)throw Error(a.reason||a.error||`Failed to start ${e} callback server`);if(z.current.proxyStarted=!0,z.current.proxyProvider=e,z.current.stopSent=!1,!L.current)return void Z();let r=new URL(`/api/oauth/${e}/authorize`,window.location.origin);r.searchParams.set("redirect_uri",a.callbackUrl);let n=await fetch(r),s=await n.json();if(!n.ok)throw Z(),Error(s.error);if(!L.current)return void Z();let i={state:s.state};s.codeVerifier&&(i.codeVerifier=s.codeVerifier),s.systemId&&(i.systemId=s.systemId);let l=await fetch(`/api/oauth/${e}/register-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),o=null;try{o=await l.json()}catch{o=null}if(!l.ok||o?.success===!1)throw Z(),Error(o?.error||"Failed to register login session; please retry");L.current&&(f({...s,proxyProvider:e}),h("waiting"),T.current=window.open(s.authUrl,"oauth_popup","width=600,height=700"),T.current||h("input"))},[Z]),ee=async()=>{if(t)try{let e;if(y(null),d.has(t)&&"browser"===F)return void await X(t);if(["github","kiro","kimi","kimi-coding","kilocode","codebuddy-cn","codebuddy-intl","qoder","qoder-cn","grok-cli","muse","glm","minimax-code","minimax-code-global"].includes(t)){w(!0),h("waiting");let e=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&x?.startUrl&&(e.searchParams.set("start_url",x.startUrl),x.region&&e.searchParams.set("region",x.region),e.searchParams.set("auth_method","idc"));let a=await fetch(e.toString()),r=await a.json();if(!a.ok)throw Error(r.error);C(r);let n=r.verification_uri_complete||r.verification_uri;n&&window.open(n,"_blank","noopener,noreferrer");let s="kiro"===t?{_clientId:r._clientId,_clientSecret:r._clientSecret,_region:r._region,_authMethod:r._authMethod,_startUrl:r._startUrl}:"qoder"===t||"qoder-cn"===t?{_qoderNonce:r._qoderNonce,_qoderMachineId:r._qoderMachineId,_qoderVerifier:r.codeVerifier}:"kimi"===t||"kimi-coding"===t?{_kimiDeviceId:r._kimiDeviceId}:"glm"===t?{_zcodePollToken:r._zcodePollToken}:"minimax-code"===t||"minimax-code-global"===t?{_minimaxPollByUser:r._minimaxPollByUser}:null;Y(r.device_code||r.user_code,r.codeVerifier,r.interval||5,s,Number.isFinite(r.expires_in)&&r.expires_in>0?1e3*r.expires_in:void 0);return}let a=window.location.port||("https:"===window.location.protocol?"443":"80");e="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${a}/callback`;let r=new URL(`/api/oauth/${t}/authorize`,window.location.origin);r.searchParams.set("redirect_uri",e),u&&Object.entries(u).forEach(([e,t])=>{t&&r.searchParams.set(e,t)});let n=await fetch(r.toString()),s=await n.json();if(!n.ok)throw Error(s.error);let i=!1,l=!1;if("codex"===t)try{let t=new URL("/api/oauth/codex/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",s.state),t.searchParams.set("code_verifier",s.codeVerifier),t.searchParams.set("redirect_uri",e);let r=await fetch(t.toString()),n=await r.json();i=n.success,l=!!n.serverSide}catch{i=!1}let o=!1,c=!1;if("xai"===t)try{let t=new URL("/api/oauth/xai/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",s.state),t.searchParams.set("code_verifier",s.codeVerifier),t.searchParams.set("redirect_uri",e);let r=await fetch(t.toString()),n=await r.json();if(o=n.success,c=!!n.serverSide,!o&&"port_busy"===n.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;o=!1}if(f({...s,redirectUri:e,codexServerSide:l,xaiServerSide:c}),("codex"===t&&i||"xai"===t&&o)&&(z.current.proxyStarted=!0,z.current.proxyProvider=t,z.current.stopSent=!1),!s.authUrl){if("device_code"===s.flowType)throw Error(`Provider ${t} uses device-code login but is not wired in the OAuth modal device-code list`);throw Error("No authorization URL returned from OAuth provider")}"codex"===t&&i||"xai"===t&&o||K&&"codex"!==t&&"xai"!==t?(h("waiting"),T.current=window.open(s.authUrl,"oauth_popup","width=600,height=700"),T.current||h("input")):(h("input"),window.open(s.authUrl,"_blank"))}catch(e){y(e.message),h("error")}};(0,n.useEffect)(()=>{R.current=s,D.current=i,L.current=e,U.current=ee}),(0,n.useEffect)(()=>{e&&t&&($.current||($.current=!0,f(null),v(""),y(null),w(!1),C(null),O(!1),W("browser"),A(""),P(null),_.current=!1,z.current={proxyStarted:!1,proxyProvider:null,stopSent:!1},c[t]&&fetch(`/api/oauth/${t}/ide-status`).then(e=>e.json()).then(e=>P(e)).catch(()=>P({installed:!1,path:null})),U.current()))},[e,t]),(0,n.useEffect)(()=>{e||(_.current=!0,$.current=!1,Z(),z.current={proxyStarted:!1,proxyProvider:null,stopSent:!1})},[e,t,Z]),(0,n.useEffect)(()=>{let e=g?.codexServerSide?"codex":g?.xaiServerSide?"xai":g?.proxyProvider?g.proxyProvider:null;if(!e||!g?.state||G.current)return;let t=!1,a=0,r=async()=>{if(!t&&!G.current){a+=1;try{let a=await fetch(`/api/oauth/${e}/poll-status?state=${encodeURIComponent(g.state)}`),r=await a.json();if(t||G.current)return;if("done"===r.status){G.current=!0,h("success"),R.current?.();return}if("error"===r.status){G.current=!0,y(r.error||"Authentication failed"),h("error");return}}catch{}if(a>=200){G.current=!0,y("Authentication timeout"),h("error");return}setTimeout(r,1500)}};return setTimeout(r,1500),()=>{t=!0}},[g]),(0,n.useEffect)(()=>{let e;if(!g)return;G.current=!1;let t=async e=>{if(G.current)return;let{code:t,token:a,state:r,error:n,errorDescription:s}=e;if(n){G.current=!0,y(s||n),h("error");return}(a||t)&&(G.current=!0,await H(a||t,r))},a=e=>{let a=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),r=e.origin===window.location.origin;(a||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",a);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let a=JSON.parse(e.newValue);t(a),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let a=JSON.parse(e);a.timestamp&&Date.now()-a.timestamp<3e4&&t(a),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",a),window.removeEventListener("storage",r),e&&e.close()}},[g,H]);let et=async()=>{try{if(y(null),"paste-token"===F&&c[t]){let e=I.trim();if(!e)throw Error("Missing token");let a=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})}),r=await a.json();if(!a.ok)throw Error(r.error);h("success"),R.current?.();return}let e=b.trim();if(d.has(t)&&e){let a=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:g?.state,...g?.redirectUri?{redirectUri:g.redirectUri}:{},...g?.codeVerifier?{codeVerifier:g.codeVerifier}:{},...g?.systemId?{systemId:g.systemId}:{}})}),r=await a.json();if(!a.ok)throw Error(r.error);h("success"),R.current?.();return}if(e.startsWith("eyJ")&&e.includes("."))return void await H(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await Q(e);if("kimchi"===t&&e&&!e.includes("://")&&!e.includes("?"))return void await H(e,null);let a=new URL(e),r=a.searchParams.get("code"),n=a.searchParams.get("token"),s=a.searchParams.get("state"),i=a.searchParams.get("error");if(i)throw Error(a.searchParams.get("error_description")||i);if(!r&&!n)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"kimchi"===t?"No Kimchi token found in URL":"No authorization code found in URL");await H(n||r,s)}catch(e){y(e.message),h("error")}},ea=(0,n.useCallback)(()=>{Z(),D.current()},[Z]);if(!t||!a)return null;let er="xai"===t,en="kimchi"===t,es=N?.verification_uri_complete||N?.verification_uri||"",ei=er?"Connect Grok Build OAuth":`Connect ${a.name}`,el=er?"http://127.0.0.1:56121/callback?code=... or copied code":en?`${J.replace("code=...","token=...")} or copied token`:J;return(0,r.jsx)(l.aF,{isOpen:e,title:ei,onClose:ea,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[d.has(t)&&("waiting"===p||"input"===p||"error"===p)&&(0,r.jsxs)(r.Fragment,{children:[c[t]&&(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{W("browser"),y(null),h("waiting"),ee()},className:`flex-1 rounded-lg border px-3 py-2 text-sm transition-colors ${"browser"===F?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:"\uD83C\uDF10 Sign in with browser"}),(0,r.jsx)("button",{type:"button",onClick:()=>{W("paste-token"),y(null),h("input")},className:`flex-1 rounded-lg border px-3 py-2 text-sm transition-colors ${"paste-token"===F?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:"\uD83D\uDD11 Paste token"})]}),"browser"===F&&(0,r.jsxs)(r.Fragment,{children:["waiting"===p&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:"Waiting for browser authorization…"})]}),"input"===p&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Popup was blocked. After authorizing in the browser, paste the full callback URL here:"}),(0,r.jsx)(l.pd,{value:b,onChange:e=>v(e.target.value),placeholder:"http://127.0.0.1:.../callback?...",className:"font-mono text-xs"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:et,fullWidth:!0,disabled:!b,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]}),"paste-token"===F&&c[t]&&(0,r.jsxs)("div",{className:"space-y-3",children:[E&&!E.installed&&(0,r.jsxs)("div",{className:`px-3 py-2 rounded-lg text-sm ${c[t].ideOptional?"bg-blue-500/10 text-blue-700 dark:text-blue-300":"bg-yellow-500/10 text-yellow-700 dark:text-yellow-300"}`,children:[c[t].ideName," IDE not detected.",c[t].ideOptional?" You can still grab the token from DevTools.":` Install ${c[t].ideName} IDE to get the token, or use "Sign in with browser".`]}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:c[t].instructions}),(0,r.jsx)(l.pd,{value:I,onChange:e=>A(e.target.value),placeholder:c[t].placeholder,className:"font-mono text-xs"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:et,fullWidth:!0,disabled:!I,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]}),("waiting"===p||"input"===p)&&!k&&!d.has(t)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:er?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,r.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,r.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",er?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.pd,{value:g?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===q?"check":"content_copy",onClick:()=>M(g?.authUrl,"auth_url"),disabled:!g?.authUrl,children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":en?"callback URL or copied token":"callback URL"," here"]}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":en?"After authorization, copy the full callback URL or token from your browser.":"After authorization, copy the full URL from your browser."}),(0,r.jsx)(l.pd,{value:b,onChange:e=>v(e.target.value),placeholder:el,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:et,fullWidth:!0,disabled:!b,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===p&&k&&N&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:es}),(0,r.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"login_url"===q?"check":"content_copy",onClick:()=>M(es,"login_url"),disabled:!es}),(0,r.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(es,"_blank","noopener,noreferrer"),disabled:!es,children:"Open"})]})]}),N.user_code&&(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:N.user_code}),(0,r.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"user_code"===q?"check":"content_copy",onClick:()=>M(N.user_code,"user_code")})]})]})]}),S&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===p&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",a.name," account has been connected."]}),(0,r.jsx)(l.$n,{onClick:ea,fullWidth:!0,children:"Done"})]}),"error"===p&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:j}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:ee,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}m.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired,oauthMeta:i().object,idcConfig:i().shape({startUrl:i().string,region:i().string})}},91450:(e,t,a)=>{a.d(t,{default:()=>s});var r=a(95155),n=a(14051);function s({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}s.propTypes={children:(a.n(n))().node.isRequired}},92173:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),n=a(98500),s=a.n(n),i=a(90620);let l=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:l.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(s(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(s(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(95155),n=a(31474);let s={primary:"bg-[#E5C378] hover:bg-[#C5A880] text-[#080808] font-semibold border border-transparent disabled:opacity-50",secondary:"bg-[#141416] hover:bg-[#1C1C1F] text-[#F5F5F7] border border-[#2E2E33] hover:border-[#C5A880] disabled:opacity-50",outline:"bg-transparent border border-[#222226] text-[#F5F5F7] hover:bg-[#141416] hover:border-[#C5A880]",ghost:"bg-transparent text-[#A1A1A6] hover:bg-[#141416] hover:text-[#F5F5F7]",danger:"bg-red-600 hover:bg-red-700 text-white disabled:opacity-50",success:"bg-emerald-600 hover:bg-emerald-700 text-white disabled:opacity-50"},i={sm:"h-7 px-2.5 text-xs rounded-none",md:"h-8.5 px-3.5 text-xs rounded-none",lg:"h-10 px-4 text-sm rounded-none"};function l({children:e,variant:t="primary",size:a="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:u=!1,className:x,...p}){return(0,r.jsxs)("button",{className:(0,n.cn)("inline-flex items-center justify-center gap-2 font-medium transition-colors duration-150 cursor-pointer rounded-none","disabled:opacity-50 disabled:cursor-not-allowed",s[t],i[a],u&&"w-full",x),disabled:c||m,...p,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},92622:(e,t,a)=>{a.d(t,{default:()=>v});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(98500),o=a.n(l),d=a(73321),c=a(31474),m=a(90620),u=a(88105),x=a(11059),p=a(72767);let h=["embedding","image","video","tts","stt","systemone"],g="/dashboard/media-providers/web",f=[{href:"/dashboard/endpoint",label:"Endpoint & Key",icon:"key"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combo & Vision",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/token-saver",label:"Token Saver",icon:"savings"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],b=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/console-log",label:"Console Log",icon:"monitor"},{href:"/dashboard/translator",label:"Translator",icon:"translate"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function v({onClose:e}){let t=(0,d.usePathname)(),[a,s]=(0,n.useState)(!1),[i,l]=(0,n.useState)(null),[j,y]=(0,n.useState)(!1),{copied:k,copy:w}=(0,x.C)(2e3),N=m.h0.installCmdLatest;(0,n.useEffect)(()=>{p.A.getState().fetchSettings().then(e=>{e?.enableTranslator&&y(!0)})},[]),(0,n.useEffect)(()=>{let e=setTimeout(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&l(e)}).catch(()=>{})},2500);return()=>clearTimeout(e)},[]);let C=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e);return(0,r.jsxs)("aside",{className:"flex w-68 flex-col border-r border-[#222226] bg-[#09090A] text-[#F5F5F7] min-h-full select-none",children:[(0,r.jsxs)("div",{className:"px-6 py-6 border-b border-[#222226]",children:[(0,r.jsxs)(o(),{href:"/dashboard",className:"flex items-center gap-3 group",children:[(0,r.jsx)("img",{src:"/logo.png",alt:"67Router",className:"w-8 h-8 rounded-md object-cover border border-[#2E2E33] group-hover:border-[#C5A880] transition-colors"}),(0,r.jsx)("span",{className:"font-display font-bold text-xl tracking-tight text-[#F5F5F7] group-hover:text-[#E5C378] transition-colors",children:"67Router"})]}),i&&(0,r.jsxs)("div",{className:"mt-4 p-2.5 border border-[#2E2E33] bg-[#141416] flex flex-col gap-1.5",children:[(0,r.jsxs)("span",{className:"text-[11px] text-[#E5C378]",children:["↑ Update Available: v",i.latestVersion]}),(0,r.jsx)("button",{onClick:()=>w(N),className:"text-left text-[10px] text-[#A1A1A6] hover:text-[#F5F5F7] truncate cursor-pointer font-mono",children:k?"✓ Copied command":N})]})]}),(0,r.jsxs)("nav",{className:"flex-1 px-4 py-6 space-y-7 overflow-y-auto custom-scrollbar",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"px-3 mb-3 text-[11px] tracking-wider text-[#68686E] uppercase font-mono",children:"Gateway"}),(0,r.jsx)("div",{className:"space-y-1",children:f.map(t=>{let a=C(t.href);return(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-2.5 transition-colors group",a?"bg-[#141416] text-[#E5C378] border-l-2 border-[#C5A880] font-medium":"text-[#A1A1A6] hover:text-[#F5F5F7] hover:bg-[#141416]/50"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[19px] shrink-0 transition-colors",a?"text-[#E5C378]":"text-[#68686E] group-hover:text-[#A1A1A6]"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm tracking-wide",children:t.label})]},t.href)})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"px-3 mb-3 text-[11px] tracking-wider text-[#68686E] uppercase font-mono",children:"System"}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("button",{onClick:()=>s(e=>!e),className:(0,c.cn)("w-full flex items-center justify-between px-3 py-2.5 transition-colors group cursor-pointer",t.startsWith("/dashboard/media-providers")?"bg-[#141416] text-[#E5C378] border-l-2 border-[#C5A880] font-medium":"text-[#A1A1A6] hover:text-[#F5F5F7] hover:bg-[#141416]/50"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[19px] shrink-0 transition-colors",t.startsWith("/dashboard/media-providers")?"text-[#E5C378]":"text-[#68686E] group-hover:text-[#A1A1A6]"),children:"perm_media"}),(0,r.jsx)("span",{className:"text-sm tracking-wide",children:"Media Fabric"})]}),(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-[#68686E] transition-transform duration-200",style:{transform:a?"rotate(180deg)":"rotate(0deg)"},children:"expand_more"})]}),a&&(0,r.jsxs)("div",{className:"pl-9 pr-2 py-1 space-y-1 border-l border-[#222226] ml-5 my-1",children:[u.rj.filter(e=>h.includes(e.id)).map(a=>(0,r.jsxs)(o(),{href:`/dashboard/media-providers/${a.id}`,onClick:e,className:(0,c.cn)("flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",t.startsWith(`/dashboard/media-providers/${a.id}`)?"text-[#E5C378] bg-[#141416]":"text-[#A1A1A6] hover:text-[#F5F5F7]"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-[#68686E]",children:a.icon||"radio_button_checked"}),(0,r.jsx)("span",{children:a.label})]},a.id)),(0,r.jsxs)(o(),{href:g,onClick:e,className:(0,c.cn)("flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",t.startsWith(g)?"text-[#E5C378] bg-[#141416]":"text-[#A1A1A6] hover:text-[#F5F5F7]"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-[#68686E]",children:"travel_explore"}),(0,r.jsx)("span",{children:"Web Fetch & Search"})]},"web")]}),b.map(t=>{if("/dashboard/translator"===t.href&&!j)return null;let a=C(t.href);return(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-2.5 transition-colors group",a?"bg-[#141416] text-[#E5C378] border-l-2 border-[#C5A880] font-medium":"text-[#A1A1A6] hover:text-[#F5F5F7] hover:bg-[#141416]/50"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[19px] shrink-0 transition-colors",a?"text-[#E5C378]":"text-[#68686E] group-hover:text-[#A1A1A6]"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm tracking-wide",children:t.label})]},t.href)})]})]})]})]})}v.propTypes={onClose:i().func}},94230:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497),o=a(11059);function d({isOpen:e,provider:t,onSuccess:a,onClose:s}){let[i,c]=(0,n.useState)("loading"),[m,u]=(0,n.useState)(""),[x,p]=(0,n.useState)(null),[h,g]=(0,n.useState)(""),[f,b]=(0,n.useState)(null),{copied:v,copy:j}=(0,o.C)(),y=(0,n.useRef)(!1);(0,n.useEffect)(()=>{e||(y.current=!1)},[e]),(0,n.useEffect)(()=>{e&&t&&(async()=>{try{b(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),a=await e.json();if(!e.ok)throw Error(a.error);p(a),u(a.authUrl),c("input"),y.current||(y.current=!0,window.open(a.authUrl,"_blank"))}catch(e){b(e.message),c("error")}})()},[e,t]);let k=async()=>{try{let e;b(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let n=e.searchParams.get("error");if(n)throw Error(e.searchParams.get("error_description")||n);if(!r)throw Error("No authorization code found in URL");let s=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:x.codeVerifier,provider:t})}),i=await s.json();if(!s.ok)throw Error(i.error);c("success"),a?.()}catch(e){b(e.message),c("error")}},w="google"===t?"Google":"GitHub";return(0,r.jsx)(l.aF,{isOpen:e,title:`Connect Kiro via ${w}`,onClose:s,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===v?"check":"content_copy",onClick:()=>j(m,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(l.pd,{value:h,onChange:e=>g(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:k,fullWidth:!0,disabled:!h,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,r.jsx)(l.$n,{onClick:s,fullWidth:!0,children:"Done"})]}),"error"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:f}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:i().bool.isRequired,provider:i().oneOf(["google","github"]).isRequired,onSuccess:i().func,onClose:i().func.isRequired}},95088:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497);let o="https://gitlab.com";function d({isOpen:e,providerInfo:t,onSuccess:a,onClose:s}){let i,[c,m]=(0,n.useState)(null),[u,x]=(0,n.useState)(o),[p,h]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[b,v]=(0,n.useState)(""),[j,y]=(0,n.useState)(!1),[k,w]=(0,n.useState)(null),[N,C]=(0,n.useState)(!1),[S,O]=(0,n.useState)(null),F=()=>{m(null),x(o),h(""),f(""),v(""),w(null),y(!1),C(!1),O(null),s()},W=async()=>{if(!b.trim())return void w("Personal Access Token is required");y(!0),w(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b.trim(),baseUrl:u.trim()||o})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");a?.(),F()}catch(e){w(e.message)}finally{y(!1)}};return e?N&&S?(0,r.jsx)(l.LF,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:S,onSuccess:()=>{a?.(),F()},onClose:()=>{C(!1),O(null)}}):(0,r.jsx)(l.aF,{isOpen:e,title:"Connect GitLab Duo",onClose:F,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("button",{onClick:()=>m("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,r.jsxs)("button",{onClick:()=>m("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,r.jsx)("a",{href:`${u.trim()||o}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(i=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${i}/callback`)})]}),(0,r.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,r.jsx)(l.pd,{label:"Client ID",value:p,onChange:e=>h(e.target.value),placeholder:"Your OAuth application client ID"}),(0,r.jsx)(l.pd,{label:"Client Secret (optional for PKCE)",value:g,onChange:e=>f(e.target.value),placeholder:"Leave empty for public PKCE app"}),k&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>{p.trim()?(w(null),O({baseUrl:u.trim()||o,clientId:p.trim(),clientSecret:g.trim()}),C(!0)):w("Client ID is required")},fullWidth:!0,disabled:!p.trim(),children:"Authorize"}),(0,r.jsx)(l.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,r.jsx)("a",{href:`${u.trim()||o}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,r.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,r.jsx)(l.pd,{label:"Personal Access Token",value:b,onChange:e=>v(e.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),k&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:W,fullWidth:!0,disabled:!b.trim()||j,loading:j,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}d.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},96748:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497);let o="https://api.openai.com/v1";function d({isOpen:e,onClose:t,onCreated:a,onSaved:s,node:i}){let c=!!i,[m,u]=(0,n.useState)({name:"",prefix:"",baseUrl:o}),[x,p]=(0,n.useState)(!1),[h,g]=(0,n.useState)(""),[f,b]=(0,n.useState)(""),[v,j]=(0,n.useState)(!1),[y,k]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(k(null),g(""),b(""),c?u({name:i.name||"",prefix:i.prefix||"",baseUrl:i.baseUrl||o}):u({name:"",prefix:"",baseUrl:o}))},[e,c,i]);let w=async()=>{if(m.name.trim()&&m.prefix.trim()&&m.baseUrl.trim()){p(!0);try{let e=c?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=c?"PUT":"POST",r={name:m.name,prefix:m.prefix,baseUrl:m.baseUrl};c||(r.type="custom-embedding");let n=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),l=await n.json();n.ok&&(c?s?.(l.node):a?.(l.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{p(!1)}}},N=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:m.baseUrl,apiKey:h,type:"custom-embedding",modelId:f.trim()||void 0})}),t=await e.json();k(t)}catch{k({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,r.jsx)(l.aF,{isOpen:e,title:c?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(l.pd,{label:"Name",value:m.name,onChange:e=>u({...m,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,r.jsx)(l.pd,{label:"Prefix",value:m.prefix,onChange:e=>u({...m,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,r.jsx)(l.pd,{label:"Base URL",value:m.baseUrl,onChange:e=>u({...m,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,r.jsx)(l.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>g(e.target.value)}),(0,r.jsx)(l.pd,{label:"Model ID (for Check)",value:f,onChange:e=>b(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(l.$n,{onClick:N,disabled:!h||!f.trim()||v||!m.baseUrl.trim(),variant:"secondary",children:v?"Checking...":"Check"}),(()=>{if(!y)return null;let{valid:e,error:t,dimensions:a}=y;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Ex,{variant:"success",children:"Valid"}),a&&(0,r.jsxs)("span",{className:"text-sm text-text-muted",children:[a," dims"]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(l.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:w,fullWidth:!0,disabled:!m.name.trim()||!m.prefix.trim()||!m.baseUrl.trim()||x,children:x?c?"Saving...":"Creating...":c?"Save":"Create"}),(0,r.jsx)(l.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}d.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97677:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155);function n({text:e,children:t,position:a="top",color:s}){let i=s?"":"bg-gray-900";return(0,r.jsxs)("div",{className:"relative inline-flex group/tt",children:[t,(0,r.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[a]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${i} text-white opacity-0 group-hover/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:s?{backgroundColor:s}:{},children:e})]})}},98542:(e,t,a)=>{a.d(t,{default:()=>s});var r=a(95155),n=a(31474);function s({checked:e=!1,onChange:t,label:a,description:i,disabled:l=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,n.cn)("flex items-center gap-3",l&&"opacity-50 cursor-not-allowed",d),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:l,onClick:()=>{!l&&t&&t(!e)},className:(0,n.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",c[o].track,l&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,n.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(a||i)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[a&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:a}),i&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}}}]);
|
|
7
|
+
`,children:(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[w.includes(e.value)&&!a&&(0,r.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),e.name]}):e.isCustom?(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,r.jsx)(d.default,{caps:S(e.value)})]}):(0,r.jsxs)(r.Fragment,{children:[e.name,(0,r.jsx)(d.default,{caps:S(e.value)})]})]})},e.value)})})]},e)),0===Object.keys(X).length&&0===Z.length&&(0,r.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,r.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}f.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onSelect:i().func.isRequired,onDeselect:i().func,selectedModel:i().string,activeProviders:i().arrayOf(i().shape({provider:i().string.isRequired})),title:i().string,modelAliases:i().object,kindFilter:i().string,addedModelValues:i().arrayOf(i().string),closeOnSelect:i().bool}},73579:(e,t,a)=>{a.d(t,{default:()=>x});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(81127),o=a(11910),d=a(92542),c=a(56061),m=a(88105),u=a(98);function x({isOpen:e,connection:t,proxyPools:a,onSave:s,onClose:i}){let[p,h]=(0,n.useState)({name:"",priority:1,apiKey:""}),[g,f]=(0,n.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[b,v]=(0,n.useState)({accountId:""}),[j,y]=(0,n.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[k,w]=(0,n.useState)(!1),[N,C]=(0,n.useState)(""),[S,O]=(0,n.useState)(!1),[F,W]=(0,n.useState)(null),[I,A]=(0,n.useState)(!1),[E,P]=(0,n.useState)(null),[T,_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(t){if(h({name:t.name||"",priority:t.priority||1,apiKey:""}),"azure"===t.provider&&t.providerSpecificData&&f({azureEndpoint:t.providerSpecificData.azureEndpoint||"",apiVersion:t.providerSpecificData.apiVersion||"2024-10-01-preview",deployment:t.providerSpecificData.deployment||"",organization:t.providerSpecificData.organization||""}),"cloudflare-ai"===t.provider&&t.providerSpecificData&&v({accountId:t.providerSpecificData.accountId||""}),m.Q2?.[t.provider]?.credentialForm==="aws"){let e=t.providerSpecificData||{};y({profile:e.profile||"",region:e.region||"",accessKeyId:e.accessKeyId||"",sessionToken:""}),w(!1)}let e=m.Q2?.[t.provider];e?.regions&&C(t.providerSpecificData?.region||e.defaultRegion||e.regions[0]?.id||""),W(null),P(null)}},[t,e]);let $=t?.authType==="oauth",z=t?.provider==="azure",R=t?.provider==="cloudflare-ai",D=m.Q2?.[t?.provider]?.credentialForm==="aws",L=!!t&&((0,m.mq)(t.provider)||(0,m.gb)(t.provider)),U=t&&m.Q2?.[t.provider]?.regions||null,q=()=>{if(U&&N)return{...t?.providerSpecificData||{},region:N}},M=()=>({profile:j.profile.trim(),region:j.region.trim(),accessKeyId:j.accessKeyId.trim(),sessionToken:k?null:j.sessionToken.trim()}),K=async()=>{if(t?.provider){O(!0),W(null);try{let e=await fetch(`/api/providers/${t.id}/test`,{method:"POST"}),a=await e.json();W(a.valid?"success":"failed")}catch{W("failed")}finally{O(!1)}}},V=async()=>{if(t?.provider&&p.apiKey){A(!0),P(null);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:p.apiKey,...z?{providerSpecificData:g}:{},...R?{providerSpecificData:b}:{},...D?{providerSpecificData:M()}:{},...U?{providerSpecificData:q()}:{}})}),a=await e.json();P(a.valid?"success":"failed")}catch{P("failed")}finally{A(!1)}}},J=async()=>{if(t){_(!0);try{let e={name:p.name,priority:p.priority};if(!$&&p.apiKey){e.apiKey=p.apiKey;let a="success"===E;if(!a)try{A(!0),P(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.provider,apiKey:p.apiKey,...z?{providerSpecificData:g}:{},...R?{providerSpecificData:b}:{},...D?{providerSpecificData:M()}:{},...U?{providerSpecificData:q()}:{}})});a=!!(await e.json()).valid,P(a?"success":"failed")}catch{P("failed")}finally{A(!1)}a&&(e.testStatus="active",e.lastError=null,e.lastErrorAt=null)}z&&(e.providerSpecificData={azureEndpoint:g.azureEndpoint,apiVersion:g.apiVersion,deployment:g.deployment,organization:g.organization}),R&&(e.providerSpecificData={accountId:b.accountId}),D&&(e.providerSpecificData=M()),U&&N&&(e.providerSpecificData=q()),await s(e)}finally{_(!1)}}};return t?(0,r.jsx)(l.default,{isOpen:e,title:"Edit Connection",onClose:i,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.default,{label:"Name",value:p.name,onChange:e=>h({...p,name:e.target.value}),placeholder:$?"Account name":"Production Key"}),$&&t.email&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-3 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-1",children:"Email"}),(0,r.jsx)("p",{className:"font-medium",children:t.email})]}),(0,r.jsx)(o.default,{label:"Priority",type:"number",value:p.priority,onChange:e=>h({...p,priority:Number.parseInt(e.target.value,10)||1})}),!$&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.default,{label:"API Key",type:"password",value:p.apiKey,onChange:e=>h({...p,apiKey:e.target.value}),placeholder:"Enter new API key",hint:"Leave blank to keep the current API key.",className:"flex-1"}),(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(d.default,{onClick:V,disabled:!p.apiKey||I||T,variant:"secondary",children:I?"Checking...":"Check"})})]}),E&&(0,r.jsx)(c.default,{variant:"success"===E?"success":"error",children:"success"===E?"Valid":"Invalid"})]}),z&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,r.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(o.default,{label:"Azure Endpoint",value:g.azureEndpoint,onChange:e=>f({...g,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com",hint:"Your Azure OpenAI resource endpoint URL"}),(0,r.jsx)(o.default,{label:"Deployment Name",value:g.deployment,onChange:e=>f({...g,deployment:e.target.value}),placeholder:"gpt-4",hint:"The deployment name in your Azure resource"}),(0,r.jsx)(o.default,{label:"API Version",value:g.apiVersion,onChange:e=>f({...g,apiVersion:e.target.value}),placeholder:"2024-10-01-preview",hint:"Azure OpenAI API version to use"}),(0,r.jsx)(o.default,{label:"Organization",value:g.organization,onChange:e=>f({...g,organization:e.target.value}),placeholder:"Organization ID",hint:"Required for billing"})]})]}),D&&(0,r.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,r.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"AWS Bedrock Credentials"}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(o.default,{label:"AWS Profile (SSO — recommended)",value:j.profile,onChange:e=>y({...j,profile:e.target.value}),placeholder:"my-sso-profile",hint:"Clear this to use static keys instead; a profile takes precedence."}),(0,r.jsx)(o.default,{label:"Region",value:j.region,onChange:e=>y({...j,region:e.target.value}),placeholder:"us-east-1"}),(0,r.jsx)(o.default,{label:"Access Key ID (only for static keys)",value:j.accessKeyId,onChange:e=>y({...j,accessKeyId:e.target.value}),placeholder:"AKIA..."}),(0,r.jsx)(o.default,{label:"Session Token (only for temporary ASIA… keys)",type:"password",value:j.sessionToken,onChange:e=>y({...j,sessionToken:e.target.value}),placeholder:"FwoGZXIvYXdz...",hint:"Leave blank to keep the saved token. Enter a new token to replace it.",disabled:k}),(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("input",{type:"checkbox",checked:k,onChange:e=>{w(e.target.checked),e.target.checked&&y({...j,sessionToken:""})}}),"Remove saved session token"]})]})]}),U&&(0,r.jsx)(u.default,{label:"Region",value:N,onChange:e=>C(e.target.value),options:U.map(e=>({value:e.id,label:e.label}))}),!L&&!z&&!R&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(d.default,{onClick:K,variant:"secondary",disabled:S,children:S?"Testing...":"Test Connection"}),F&&(0,r.jsx)(c.default,{variant:"success"===F?"success":"error",children:"success"===F?"Valid":"Failed"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(d.default,{onClick:J,fullWidth:!0,disabled:T,children:T?"Saving...":"Save"}),(0,r.jsx)(d.default,{onClick:i,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}x.propTypes={isOpen:i().bool.isRequired,connection:i().shape({id:i().string,name:i().string,email:i().string,priority:i().number,authType:i().string,provider:i().string,providerSpecificData:i().object}),proxyPools:i().arrayOf(i().shape({id:i().string,name:i().string})),onSave:i().func.isRequired,onClose:i().func.isRequired}},80752:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(1620),o=a(40197),d=a(81127);function c({icon:e,label:t,onClick:a,trailing:n,danger:s}){return(0,r.jsxs)("button",{onClick:a,className:`flex items-center gap-3 w-full px-4 py-2.5 text-sm transition-colors ${s?"text-red-500 hover:bg-red-500/10":"text-text-main hover:bg-black/5 dark:hover:bg-white/5"}`,children:[(0,r.jsx)("span",{className:`material-symbols-outlined text-[20px] ${s?"":"text-text-muted"}`,children:e}),(0,r.jsx)("span",{className:"flex-1 text-left",children:t}),n&&(0,r.jsx)("span",{className:"text-base",children:n})]})}function m({onLogout:e}){let[t,a]=(0,n.useState)(!1),[s,i]=(0,n.useState)(!1),[u,x]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1),{toggleTheme:g,isDark:f}=(0,l.D)(),b=(0,n.useRef)(null),v=async()=>{h(!0);try{await fetch("/api/version/shutdown",{method:"POST"})}catch(e){}h(!1),x(!1)};return(0,n.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&a(!1)};if(t)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative",ref:b,children:[(0,r.jsx)("button",{onClick:()=>a(e=>!e),className:"flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all",title:"Menu",children:(0,r.jsx)("span",{className:"material-symbols-outlined",children:"grid_view"})}),t&&(0,r.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-60 bg-surface border border-black/10 dark:border-white/10 rounded-xl shadow-2xl z-50 animate-in fade-in zoom-in-95 duration-150 overflow-hidden py-1",children:[(0,r.jsx)(c,{icon:"history",label:"Change Log",onClick:()=>{a(!1),i(!0)}}),(0,r.jsx)(c,{icon:"power_settings_new",label:"Shutdown",danger:!0,onClick:()=>{a(!1),x(!0)}}),(0,r.jsx)(c,{icon:"logout",label:"Logout",danger:!0,onClick:()=>{a(!1),e()}})]})]}),(0,r.jsx)(o.default,{isOpen:s,onClose:()=>i(!1)}),(0,r.jsx)(d.ConfirmModal,{isOpen:u,onClose:()=>x(!1),onConfirm:v,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:p})]})}c.propTypes={icon:i().string.isRequired,label:i().string.isRequired,onClick:i().func.isRequired,trailing:i().node,danger:i().bool},m.propTypes={onLogout:i().func.isRequired}},81127:(e,t,a)=>{a.d(t,{ConfirmModal:()=>d,default:()=>o});var r=a(95155),n=a(12115),s=a(31474),i=a(92542),l=a(97677);function o({isOpen:e,onClose:t,title:a,children:i,footer:d,size:c="md",closeOnOverlay:m=!0,showTrafficLights:u=!0,className:x}){return((0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,n.useEffect)(()=>{let a=a=>{"Escape"===a.key&&e&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),e)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in",onClick:m?t:void 0}),(0,r.jsxs)("div",{className:(0,s.cn)("relative w-full bg-surface","border border-border","rounded-none","fade-in",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[c],x),children:[(a||u)&&(0,r.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[u&&(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-2 mr-4 ml-2",children:[(0,r.jsx)(l.default,{text:"Close",position:"top",color:"#FF5F56",children:(0,r.jsx)("button",{onClick:t,"aria-label":"Close",title:"Close",className:"w-4 h-4 rounded-full bg-[#FF5F56] hover:brightness-90 transition-all cursor-pointer flex items-center justify-center group/dot",children:(0,r.jsx)("span",{className:"text-[9px] font-bold text-white opacity-0 group-hover/dot:opacity-100 transition-opacity leading-none",children:"✕"})})}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"}),(0,r.jsx)("div",{className:"w-4 h-4 rounded-full bg-[#3a3a3a]/20 dark:bg-white/15 cursor-not-allowed"})]}),a&&(0,r.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:a})]}),(0,r.jsx)("button",{onClick:t,"aria-label":"Close",className:"md:hidden p-1.5 rounded-[10px] text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,r.jsx)("div",{className:"p-6 max-h-[calc(85vh-100px)] overflow-y-auto custom-scrollbar",children:i}),d&&(0,r.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-border-subtle",children:d})]})]}):null}function d({isOpen:e,onClose:t,onConfirm:a,title:n="Confirm",message:s,confirmText:l="Confirm",cancelText:c="Cancel",variant:m="danger",loading:u=!1}){return(0,r.jsx)(o,{isOpen:e,onClose:t,title:n,size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.default,{variant:"ghost",onClick:t,disabled:u,children:c}),(0,r.jsx)(i.default,{variant:m,onClick:a,loading:u,children:l})]}),children:(0,r.jsx)("p",{className:"text-text-muted",children:s})})}},90882:(e,t,a)=>{a.d(t,{default:()=>m});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497),o=a(11059);let d=new Set(["trae","windsurf","zed"]),c={trae:{label:"Cloud-IDE-JWT",instructions:"Sign in at trae.ai (or solo.trae.ai), open DevTools → Network, copy the Cloud-IDE-JWT token from any request's Authorization header (~14-day lifetime).",placeholder:"Paste Cloud-IDE-JWT here...",ideName:"Trae",ideOptional:!0},windsurf:{label:"Windsurf API key",instructions:'In the Windsurf/VS Code IDE, run the "Windsurf: Provide Auth Token" command, then copy the displayed sk-ws-... key.',placeholder:"Paste sk-ws-... key here...",ideName:"Windsurf",ideOptional:!1}};function m({isOpen:e,provider:t,providerInfo:a,onSuccess:s,onClose:i,oauthMeta:u,idcConfig:x}){let[p,h]=(0,n.useState)("waiting"),[g,f]=(0,n.useState)(null),[b,v]=(0,n.useState)(""),[j,y]=(0,n.useState)(null),[k,w]=(0,n.useState)(!1),[N,C]=(0,n.useState)(null),[S,O]=(0,n.useState)(!1),[F,W]=(0,n.useState)("browser"),[I,A]=(0,n.useState)(""),[E,P]=(0,n.useState)(null),T=(0,n.useRef)(null),_=(0,n.useRef)(!1),$=(0,n.useRef)(!1),z=(0,n.useRef)({proxyStarted:!1,proxyProvider:null,stopSent:!1}),R=(0,n.useRef)(s),D=(0,n.useRef)(i),L=(0,n.useRef)(e),U=(0,n.useRef)(null),{copied:q,copy:M}=(0,o.C)(),[K,V]=(0,n.useState)(!1),[J,B]=(0,n.useState)("/callback?code=..."),G=(0,n.useRef)(!1);(0,n.useEffect)(()=>{V("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),B(`${window.location.origin}/callback?code=...`)},[]);let H=(0,n.useCallback)(async(e,a)=>{if(g)try{let r=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:g.redirectUri,codeVerifier:g.codeVerifier,state:a,...g.systemId?{systemId:g.systemId}:{},...u?{meta:u}:{}})}),n=await r.json();if(!r.ok)throw Error(n.error);h("success"),R.current?.()}catch(e){y(e.message),h("error")}},[g,t,u]),Q=(0,n.useCallback)(async e=>{if(g?.state)try{let t=await fetch("/api/oauth/xai/manual-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:g.state})}),a=await t.json();if(!t.ok)throw Error(a.error);h("success"),R.current?.()}catch(e){y(e.message),h("error")}},[g]),Y=(0,n.useCallback)(async(e,a,r,n,s)=>{_.current=!1,O(!0);let i=Date.now()+(Number.isFinite(s)&&s>0?s:12e4);for(;Date.now()<i;){if(_.current){console.log("[OAuthModal] Polling aborted"),O(!1);return}if(await new Promise(e=>setTimeout(e,1e3*r)),_.current){console.log("[OAuthModal] Polling aborted after sleep"),O(!1);return}try{let s=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:a,extraData:n})}),i=await s.json();if(i.success){_.current=!0,h("success"),O(!1),R.current?.();return}if("expired_token"===i.error||"access_denied"===i.error||i.fatal)throw Error(i.errorDescription||i.error);"slow_down"===i.error&&(r=Math.min(r+5,30))}catch(e){y(e.message),h("error"),O(!1);return}}y("Authorization timeout"),h("error"),O(!1)},[t]),Z=(0,n.useCallback)(()=>{let e=z.current;e.proxyStarted&&!e.stopSent&&e.proxyProvider&&(e.stopSent=!0,fetch(`/api/oauth/${e.proxyProvider}/stop-proxy`).catch(()=>{}))},[]),X=(0,n.useCallback)(async e=>{let t=await fetch(`/api/oauth/${e}/start-proxy`),a=await t.json();if(!t.ok||!a.success||!a.callbackUrl)throw Error(a.reason||a.error||`Failed to start ${e} callback server`);if(z.current.proxyStarted=!0,z.current.proxyProvider=e,z.current.stopSent=!1,!L.current)return void Z();let r=new URL(`/api/oauth/${e}/authorize`,window.location.origin);r.searchParams.set("redirect_uri",a.callbackUrl);let n=await fetch(r),s=await n.json();if(!n.ok)throw Z(),Error(s.error);if(!L.current)return void Z();let i={state:s.state};s.codeVerifier&&(i.codeVerifier=s.codeVerifier),s.systemId&&(i.systemId=s.systemId);let l=await fetch(`/api/oauth/${e}/register-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),o=null;try{o=await l.json()}catch{o=null}if(!l.ok||o?.success===!1)throw Z(),Error(o?.error||"Failed to register login session; please retry");L.current&&(f({...s,proxyProvider:e}),h("waiting"),T.current=window.open(s.authUrl,"oauth_popup","width=600,height=700"),T.current||h("input"))},[Z]),ee=async()=>{if(t)try{let e;if(y(null),d.has(t)&&"browser"===F)return void await X(t);if(["github","kiro","kimi","kimi-coding","kilocode","codebuddy-cn","codebuddy-intl","qoder","qoder-cn","grok-cli","muse","glm","minimax-code","minimax-code-global"].includes(t)){w(!0),h("waiting");let e=new URL(`/api/oauth/${t}/device-code`,window.location.origin);"kiro"===t&&x?.startUrl&&(e.searchParams.set("start_url",x.startUrl),x.region&&e.searchParams.set("region",x.region),e.searchParams.set("auth_method","idc"));let a=await fetch(e.toString()),r=await a.json();if(!a.ok)throw Error(r.error);C(r);let n=r.verification_uri_complete||r.verification_uri;n&&window.open(n,"_blank","noopener,noreferrer");let s="kiro"===t?{_clientId:r._clientId,_clientSecret:r._clientSecret,_region:r._region,_authMethod:r._authMethod,_startUrl:r._startUrl}:"qoder"===t||"qoder-cn"===t?{_qoderNonce:r._qoderNonce,_qoderMachineId:r._qoderMachineId,_qoderVerifier:r.codeVerifier}:"kimi"===t||"kimi-coding"===t?{_kimiDeviceId:r._kimiDeviceId}:"glm"===t?{_zcodePollToken:r._zcodePollToken}:"minimax-code"===t||"minimax-code-global"===t?{_minimaxPollByUser:r._minimaxPollByUser}:null;Y(r.device_code||r.user_code,r.codeVerifier,r.interval||5,s,Number.isFinite(r.expires_in)&&r.expires_in>0?1e3*r.expires_in:void 0);return}let a=window.location.port||("https:"===window.location.protocol?"443":"80");e="codex"===t?"http://localhost:1455/auth/callback":"xai"===t?"http://127.0.0.1:56121/callback":`http://localhost:${a}/callback`;let r=new URL(`/api/oauth/${t}/authorize`,window.location.origin);r.searchParams.set("redirect_uri",e),u&&Object.entries(u).forEach(([e,t])=>{t&&r.searchParams.set(e,t)});let n=await fetch(r.toString()),s=await n.json();if(!n.ok)throw Error(s.error);let i=!1,l=!1;if("codex"===t)try{let t=new URL("/api/oauth/codex/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",s.state),t.searchParams.set("code_verifier",s.codeVerifier),t.searchParams.set("redirect_uri",e);let r=await fetch(t.toString()),n=await r.json();i=n.success,l=!!n.serverSide}catch{i=!1}let o=!1,c=!1;if("xai"===t)try{let t=new URL("/api/oauth/xai/start-proxy",window.location.origin);t.searchParams.set("app_port",a),t.searchParams.set("state",s.state),t.searchParams.set("code_verifier",s.codeVerifier),t.searchParams.set("redirect_uri",e);let r=await fetch(t.toString()),n=await r.json();if(o=n.success,c=!!n.serverSide,!o&&"port_busy"===n.reason)throw Error("Port 56121 in use; close the conflicting process and retry")}catch(e){if(e?.message)throw e;o=!1}if(f({...s,redirectUri:e,codexServerSide:l,xaiServerSide:c}),("codex"===t&&i||"xai"===t&&o)&&(z.current.proxyStarted=!0,z.current.proxyProvider=t,z.current.stopSent=!1),!s.authUrl){if("device_code"===s.flowType)throw Error(`Provider ${t} uses device-code login but is not wired in the OAuth modal device-code list`);throw Error("No authorization URL returned from OAuth provider")}"codex"===t&&i||"xai"===t&&o||K&&"codex"!==t&&"xai"!==t?(h("waiting"),T.current=window.open(s.authUrl,"oauth_popup","width=600,height=700"),T.current||h("input")):(h("input"),window.open(s.authUrl,"_blank"))}catch(e){y(e.message),h("error")}};(0,n.useEffect)(()=>{R.current=s,D.current=i,L.current=e,U.current=ee}),(0,n.useEffect)(()=>{e&&t&&($.current||($.current=!0,f(null),v(""),y(null),w(!1),C(null),O(!1),W("browser"),A(""),P(null),_.current=!1,z.current={proxyStarted:!1,proxyProvider:null,stopSent:!1},c[t]&&fetch(`/api/oauth/${t}/ide-status`).then(e=>e.json()).then(e=>P(e)).catch(()=>P({installed:!1,path:null})),U.current()))},[e,t]),(0,n.useEffect)(()=>{e||(_.current=!0,$.current=!1,Z(),z.current={proxyStarted:!1,proxyProvider:null,stopSent:!1})},[e,t,Z]),(0,n.useEffect)(()=>{let e=g?.codexServerSide?"codex":g?.xaiServerSide?"xai":g?.proxyProvider?g.proxyProvider:null;if(!e||!g?.state||G.current)return;let t=!1,a=0,r=async()=>{if(!t&&!G.current){a+=1;try{let a=await fetch(`/api/oauth/${e}/poll-status?state=${encodeURIComponent(g.state)}`),r=await a.json();if(t||G.current)return;if("done"===r.status){G.current=!0,h("success"),R.current?.();return}if("error"===r.status){G.current=!0,y(r.error||"Authentication failed"),h("error");return}}catch{}if(a>=200){G.current=!0,y("Authentication timeout"),h("error");return}setTimeout(r,1500)}};return setTimeout(r,1500),()=>{t=!0}},[g]),(0,n.useEffect)(()=>{let e;if(!g)return;G.current=!1;let t=async e=>{if(G.current)return;let{code:t,token:a,state:r,error:n,errorDescription:s}=e;if(n){G.current=!0,y(s||n),h("error");return}(a||t)&&(G.current=!0,await H(a||t,r))},a=e=>{let a=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),r=e.origin===window.location.origin;(a||r)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",a);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let r=e=>{if("oauth_callback"===e.key&&e.newValue)try{let a=JSON.parse(e.newValue);t(a),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",r);try{let e=localStorage.getItem("oauth_callback");if(e){let a=JSON.parse(e);a.timestamp&&Date.now()-a.timestamp<3e4&&t(a),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",a),window.removeEventListener("storage",r),e&&e.close()}},[g,H]);let et=async()=>{try{if(y(null),"paste-token"===F&&c[t]){let e=I.trim();if(!e)throw Error("Missing token");let a=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})}),r=await a.json();if(!a.ok)throw Error(r.error);h("success"),R.current?.();return}let e=b.trim();if(d.has(t)&&e){let a=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,state:g?.state,...g?.redirectUri?{redirectUri:g.redirectUri}:{},...g?.codeVerifier?{codeVerifier:g.codeVerifier}:{},...g?.systemId?{systemId:g.systemId}:{}})}),r=await a.json();if(!a.ok)throw Error(r.error);h("success"),R.current?.();return}if(e.startsWith("eyJ")&&e.includes("."))return void await H(e,null);if("xai"===t&&e&&!e.includes("://")&&!e.includes("?")&&!e.includes("code="))return void await Q(e);if("kimchi"===t&&e&&!e.includes("://")&&!e.includes("?"))return void await H(e,null);let a=new URL(e),r=a.searchParams.get("code"),n=a.searchParams.get("token"),s=a.searchParams.get("state"),i=a.searchParams.get("error");if(i)throw Error(a.searchParams.get("error_description")||i);if(!r&&!n)throw Error("xai"===t?"Paste the callback URL or copied xAI code":"kimchi"===t?"No Kimchi token found in URL":"No authorization code found in URL");await H(n||r,s)}catch(e){y(e.message),h("error")}},ea=(0,n.useCallback)(()=>{Z(),D.current()},[Z]);if(!t||!a)return null;let er="xai"===t,en="kimchi"===t,es=N?.verification_uri_complete||N?.verification_uri||"",ei=er?"Connect Grok Build OAuth":`Connect ${a.name}`,el=er?"http://127.0.0.1:56121/callback?code=... or copied code":en?`${J.replace("code=...","token=...")} or copied token`:J;return(0,r.jsx)(l.aF,{isOpen:e,title:ei,onClose:ea,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[d.has(t)&&("waiting"===p||"input"===p||"error"===p)&&(0,r.jsxs)(r.Fragment,{children:[c[t]&&(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>{W("browser"),y(null),h("waiting"),ee()},className:`flex-1 rounded-lg border px-3 py-2 text-sm transition-colors ${"browser"===F?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:"\uD83C\uDF10 Sign in with browser"}),(0,r.jsx)("button",{type:"button",onClick:()=>{W("paste-token"),y(null),h("input")},className:`flex-1 rounded-lg border px-3 py-2 text-sm transition-colors ${"paste-token"===F?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:"\uD83D\uDD11 Paste token"})]}),"browser"===F&&(0,r.jsxs)(r.Fragment,{children:["waiting"===p&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:"Waiting for browser authorization…"})]}),"input"===p&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Popup was blocked. After authorizing in the browser, paste the full callback URL here:"}),(0,r.jsx)(l.pd,{value:b,onChange:e=>v(e.target.value),placeholder:"http://127.0.0.1:.../callback?...",className:"font-mono text-xs"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:et,fullWidth:!0,disabled:!b,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]}),"paste-token"===F&&c[t]&&(0,r.jsxs)("div",{className:"space-y-3",children:[E&&!E.installed&&(0,r.jsxs)("div",{className:`px-3 py-2 rounded-lg text-sm ${c[t].ideOptional?"bg-blue-500/10 text-blue-700 dark:text-blue-300":"bg-yellow-500/10 text-yellow-700 dark:text-yellow-300"}`,children:[c[t].ideName," IDE not detected.",c[t].ideOptional?" You can still grab the token from DevTools.":` Install ${c[t].ideName} IDE to get the token, or use "Sign in with browser".`]}),(0,r.jsx)("p",{className:"text-sm text-text-muted",children:c[t].instructions}),(0,r.jsx)(l.pd,{value:I,onChange:e=>A(e.target.value),placeholder:c[t].placeholder,className:"font-mono text-xs"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:et,fullWidth:!0,disabled:!I,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]}),("waiting"===p||"input"===p)&&!k&&!d.has(t)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border border-border rounded-lg bg-sidebar/50",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-base text-primary animate-spin",children:"progress_activity"}),(0,r.jsx)("span",{className:"text-sm",children:er?"Waiting for Grok Build OAuth…":"Waiting for popup authorization…"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 my-1",children:[(0,r.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,r.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wider",children:"Or paste callback URL manually"}),(0,r.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 1: Open this ",er?"Grok Build OAuth URL":"URL"," in your browser"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.pd,{value:g?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===q?"check":"content_copy",onClick:()=>M(g?.authUrl,"auth_url"),disabled:!g?.authUrl,children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{className:"text-sm font-medium mb-2",children:["Step 2: Paste the ","xai"===t?"callback URL or copied code":en?"callback URL or copied token":"callback URL"," here"]}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"xai"===t?"If xAI shows a code instead of redirecting, paste that code here.":en?"After authorization, copy the full callback URL or token from your browser.":"After authorization, copy the full URL from your browser."}),(0,r.jsx)(l.pd,{value:b,onChange:e=>v(e.target.value),placeholder:el,className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:et,fullWidth:!0,disabled:!b,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"waiting"===p&&k&&N&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the login URL below and authorize:"}),(0,r.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Login URL"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("code",{className:"flex-1 text-sm break-all",children:es}),(0,r.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"login_url"===q?"check":"content_copy",onClick:()=>M(es,"login_url"),disabled:!es}),(0,r.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"open_in_new",onClick:()=>window.open(es,"_blank","noopener,noreferrer"),disabled:!es,children:"Open"})]})]}),N.user_code&&(0,r.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,r.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:N.user_code}),(0,r.jsx)(l.$n,{size:"sm",variant:"ghost",icon:"user_code"===q?"check":"content_copy",onClick:()=>M(N.user_code,"user_code")})]})]})]}),S&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"success"===p&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",a.name," account has been connected."]}),(0,r.jsx)(l.$n,{onClick:ea,fullWidth:!0,children:"Done"})]}),"error"===p&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:j}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:ee,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(l.$n,{onClick:ea,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}m.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired,oauthMeta:i().object,idcConfig:i().shape({startUrl:i().string,region:i().string})}},91450:(e,t,a)=>{a.d(t,{default:()=>s});var r=a(95155),n=a(14051);function s({children:e}){return(0,r.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,r.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,r.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,r.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}s.propTypes={children:(a.n(n))().node.isRequired}},92173:(e,t,a)=>{a.d(t,{default:()=>c});var r=a(95155),n=a(98500),s=a.n(n),i=a(90620);let l=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],d=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function c(){return(0,r.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,r.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,r.jsx)("div",{className:"size-6 text-primary",children:(0,r.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,r.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,r.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,r.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,r.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:l.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,r.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:d.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,r.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,r.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,r.jsx)(s(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,r.jsx)(s(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},92542:(e,t,a)=>{a.d(t,{default:()=>l});var r=a(95155),n=a(31474);let s={primary:"bg-[#E5C378] hover:bg-[#C5A880] text-[#080808] font-semibold border border-transparent disabled:opacity-50",secondary:"bg-[#141416] hover:bg-[#1C1C1F] text-[#F5F5F7] border border-[#2E2E33] hover:border-[#C5A880] disabled:opacity-50",outline:"bg-transparent border border-[#222226] text-[#F5F5F7] hover:bg-[#141416] hover:border-[#C5A880]",ghost:"bg-transparent text-[#A1A1A6] hover:bg-[#141416] hover:text-[#F5F5F7]",danger:"bg-red-600 hover:bg-red-700 text-white disabled:opacity-50",success:"bg-emerald-600 hover:bg-emerald-700 text-white disabled:opacity-50"},i={sm:"h-7 px-2.5 text-xs rounded-none",md:"h-8.5 px-3.5 text-xs rounded-none",lg:"h-10 px-4 text-sm rounded-none"};function l({children:e,variant:t="primary",size:a="md",icon:o,iconRight:d,disabled:c=!1,loading:m=!1,fullWidth:u=!1,className:x,...p}){return(0,r.jsxs)("button",{className:(0,n.cn)("inline-flex items-center justify-center gap-2 font-medium transition-colors duration-150 cursor-pointer rounded-none","disabled:opacity-50 disabled:cursor-not-allowed",s[t],i[a],u&&"w-full",x),disabled:c||m,...p,children:[m?(0,r.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):o?(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o}):null,e,d&&!m&&(0,r.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d})]})}},92622:(e,t,a)=>{a.d(t,{default:()=>v});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(98500),o=a.n(l),d=a(73321),c=a(31474),m=a(90620),u=a(88105),x=a(11059),p=a(72767);let h=["embedding","image","video","tts","stt","systemone"],g="/dashboard/media-providers/web",f=[{href:"/dashboard/endpoint",label:"Endpoint & Key",icon:"key"},{href:"/dashboard/providers",label:"Providers",icon:"dns"},{href:"/dashboard/combos",label:"Combo & Vision",icon:"layers"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/token-saver",label:"Agent Skills",icon:"smart_toy"},{href:"/dashboard/cli-tools",label:"CLI Tools",icon:"terminal"}],b=[{href:"/dashboard/proxy-pools",label:"Proxy Pools",icon:"lan"},{href:"/dashboard/skills",label:"Skills",icon:"extension"},{href:"/dashboard/console-log",label:"Console Log",icon:"monitor"},{href:"/dashboard/translator",label:"Translator",icon:"translate"},{href:"/dashboard/profile",label:"Settings",icon:"settings"}];function v({onClose:e}){let t=(0,d.usePathname)(),[a,s]=(0,n.useState)(!1),[i,l]=(0,n.useState)(null),[j,y]=(0,n.useState)(!1),{copied:k,copy:w}=(0,x.C)(2e3),N=m.h0.installCmdLatest;(0,n.useEffect)(()=>{p.A.getState().fetchSettings().then(e=>{e?.enableTranslator&&y(!0)})},[]),(0,n.useEffect)(()=>{let e=setTimeout(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&l(e)}).catch(()=>{})},2500);return()=>clearTimeout(e)},[]);let C=e=>"/dashboard/endpoint"===e?"/dashboard"===t||t.startsWith("/dashboard/endpoint"):t.startsWith(e);return(0,r.jsxs)("aside",{className:"flex w-68 flex-col border-r border-[#222226] bg-[#09090A] text-[#F5F5F7] min-h-full select-none",children:[(0,r.jsxs)("div",{className:"px-6 py-6 border-b border-[#222226]",children:[(0,r.jsxs)(o(),{href:"/dashboard",className:"flex items-center gap-3 group",children:[(0,r.jsx)("img",{src:"/logo.png",alt:"67Router",className:"w-8 h-8 rounded-md object-cover border border-[#2E2E33] group-hover:border-[#C5A880] transition-colors"}),(0,r.jsx)("span",{className:"font-display font-bold text-xl tracking-tight text-[#F5F5F7] group-hover:text-[#E5C378] transition-colors",children:"67Router"})]}),i&&(0,r.jsxs)("div",{className:"mt-4 p-2.5 border border-[#2E2E33] bg-[#141416] flex flex-col gap-1.5",children:[(0,r.jsxs)("span",{className:"text-[11px] text-[#E5C378]",children:["↑ Update Available: v",i.latestVersion]}),(0,r.jsx)("button",{onClick:()=>w(N),className:"text-left text-[10px] text-[#A1A1A6] hover:text-[#F5F5F7] truncate cursor-pointer font-mono",children:k?"✓ Copied command":N})]})]}),(0,r.jsxs)("nav",{className:"flex-1 px-4 py-6 space-y-7 overflow-y-auto custom-scrollbar",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"px-3 mb-3 text-[11px] tracking-wider text-[#68686E] uppercase font-mono",children:"Gateway"}),(0,r.jsx)("div",{className:"space-y-1",children:f.map(t=>{let a=C(t.href);return(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-2.5 transition-colors group",a?"bg-[#141416] text-[#E5C378] border-l-2 border-[#C5A880] font-medium":"text-[#A1A1A6] hover:text-[#F5F5F7] hover:bg-[#141416]/50"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[19px] shrink-0 transition-colors",a?"text-[#E5C378]":"text-[#68686E] group-hover:text-[#A1A1A6]"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm tracking-wide",children:t.label})]},t.href)})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"px-3 mb-3 text-[11px] tracking-wider text-[#68686E] uppercase font-mono",children:"System"}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("button",{onClick:()=>s(e=>!e),className:(0,c.cn)("w-full flex items-center justify-between px-3 py-2.5 transition-colors group cursor-pointer",t.startsWith("/dashboard/media-providers")?"bg-[#141416] text-[#E5C378] border-l-2 border-[#C5A880] font-medium":"text-[#A1A1A6] hover:text-[#F5F5F7] hover:bg-[#141416]/50"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[19px] shrink-0 transition-colors",t.startsWith("/dashboard/media-providers")?"text-[#E5C378]":"text-[#68686E] group-hover:text-[#A1A1A6]"),children:"perm_media"}),(0,r.jsx)("span",{className:"text-sm tracking-wide",children:"Media Fabric"})]}),(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-[#68686E] transition-transform duration-200",style:{transform:a?"rotate(180deg)":"rotate(0deg)"},children:"expand_more"})]}),a&&(0,r.jsxs)("div",{className:"pl-9 pr-2 py-1 space-y-1 border-l border-[#222226] ml-5 my-1",children:[u.rj.filter(e=>h.includes(e.id)).map(a=>(0,r.jsxs)(o(),{href:`/dashboard/media-providers/${a.id}`,onClick:e,className:(0,c.cn)("flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",t.startsWith(`/dashboard/media-providers/${a.id}`)?"text-[#E5C378] bg-[#141416]":"text-[#A1A1A6] hover:text-[#F5F5F7]"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-[#68686E]",children:a.icon||"radio_button_checked"}),(0,r.jsx)("span",{children:a.label})]},a.id)),(0,r.jsxs)(o(),{href:g,onClick:e,className:(0,c.cn)("flex items-center gap-2.5 px-3 py-2 text-xs transition-colors",t.startsWith(g)?"text-[#E5C378] bg-[#141416]":"text-[#A1A1A6] hover:text-[#F5F5F7]"),children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-[16px] text-[#68686E]",children:"travel_explore"}),(0,r.jsx)("span",{children:"Web Fetch & Search"})]},"web")]}),b.map(t=>{if("/dashboard/translator"===t.href&&!j)return null;let a=C(t.href);return(0,r.jsxs)(o(),{href:t.href,onClick:e,className:(0,c.cn)("flex items-center gap-3 px-3 py-2.5 transition-colors group",a?"bg-[#141416] text-[#E5C378] border-l-2 border-[#C5A880] font-medium":"text-[#A1A1A6] hover:text-[#F5F5F7] hover:bg-[#141416]/50"),children:[(0,r.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[19px] shrink-0 transition-colors",a?"text-[#E5C378]":"text-[#68686E] group-hover:text-[#A1A1A6]"),children:t.icon}),(0,r.jsx)("span",{className:"text-sm tracking-wide",children:t.label})]},t.href)})]})]})]})]})}v.propTypes={onClose:i().func}},94230:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497),o=a(11059);function d({isOpen:e,provider:t,onSuccess:a,onClose:s}){let[i,c]=(0,n.useState)("loading"),[m,u]=(0,n.useState)(""),[x,p]=(0,n.useState)(null),[h,g]=(0,n.useState)(""),[f,b]=(0,n.useState)(null),{copied:v,copy:j}=(0,o.C)(),y=(0,n.useRef)(!1);(0,n.useEffect)(()=>{e||(y.current=!1)},[e]),(0,n.useEffect)(()=>{e&&t&&(async()=>{try{b(null),c("loading");let e=await fetch(`/api/oauth/kiro/social-authorize?provider=${t}`),a=await e.json();if(!e.ok)throw Error(a.error);p(a),u(a.authUrl),c("input"),y.current||(y.current=!0,window.open(a.authUrl,"_blank"))}catch(e){b(e.message),c("error")}})()},[e,t]);let k=async()=>{try{let e;b(null);try{e=new URL(h)}catch(e){throw Error("Invalid callback URL format")}let r=e.searchParams.get("code");e.searchParams.get("state");let n=e.searchParams.get("error");if(n)throw Error(e.searchParams.get("error_description")||n);if(!r)throw Error("No authorization code found in URL");let s=await fetch("/api/oauth/kiro/social-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:r,codeVerifier:x.codeVerifier,provider:t})}),i=await s.json();if(!s.ok)throw Error(i.error);c("success"),a?.()}catch(e){b(e.message),c("error")}},w="google"===t?"Google":"GitHub";return(0,r.jsx)(l.aF,{isOpen:e,title:`Connect Kiro via ${w}`,onClose:s,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:["loading"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Initializing..."}),(0,r.jsxs)("p",{className:"text-sm text-text-muted",children:["Setting up ",w," authentication"]})]}),"input"===i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.pd,{value:m,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,r.jsx)(l.$n,{variant:"secondary",icon:"auth_url"===v?"check":"content_copy",onClick:()=>j(m,"auth_url"),children:"Copy"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,r.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser address bar."}),(0,r.jsx)(l.pd,{value:h,onChange:e=>g(e.target.value),placeholder:"kiro://kiro.kiroAgent/authenticate-success?code=...",className:"font-mono text-xs"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:k,fullWidth:!0,disabled:!h,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,r.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your Kiro account via ",w," has been connected."]}),(0,r.jsx)(l.$n,{onClick:s,fullWidth:!0,children:"Done"})]}),"error"===i&&(0,r.jsxs)("div",{className:"text-center py-6",children:[(0,r.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,r.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,r.jsx)("p",{className:"text-sm text-red-600 mb-4",children:f}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>c("input"),variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,r.jsx)(l.$n,{onClick:s,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}d.propTypes={isOpen:i().bool.isRequired,provider:i().oneOf(["google","github"]).isRequired,onSuccess:i().func,onClose:i().func.isRequired}},95088:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497);let o="https://gitlab.com";function d({isOpen:e,providerInfo:t,onSuccess:a,onClose:s}){let i,[c,m]=(0,n.useState)(null),[u,x]=(0,n.useState)(o),[p,h]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[b,v]=(0,n.useState)(""),[j,y]=(0,n.useState)(!1),[k,w]=(0,n.useState)(null),[N,C]=(0,n.useState)(!1),[S,O]=(0,n.useState)(null),F=()=>{m(null),x(o),h(""),f(""),v(""),w(null),y(!1),C(!1),O(null),s()},W=async()=>{if(!b.trim())return void w("Personal Access Token is required");y(!0),w(null);try{let e=await fetch("/api/oauth/gitlab/pat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:b.trim(),baseUrl:u.trim()||o})}),t=await e.json();if(!e.ok)throw Error(t.error||"Authentication failed");a?.(),F()}catch(e){w(e.message)}finally{y(!1)}};return e?N&&S?(0,r.jsx)(l.LF,{isOpen:!0,provider:"gitlab",providerInfo:t,oauthMeta:S,onSuccess:()=>{a?.(),F()},onClose:()=>{C(!1),O(null)}}):(0,r.jsx)(l.aF,{isOpen:e,title:"Connect GitLab Duo",onClose:F,size:"lg",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"text-sm text-text-muted",children:"Choose how to authenticate with GitLab Duo:"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("button",{onClick:()=>m("oauth"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"lock_open"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"OAuth App"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab OAuth application"})]})]}),(0,r.jsxs)("button",{onClick:()=>m("pat"),className:"flex flex-col items-center gap-2 p-4 rounded-lg border border-border hover:border-primary hover:bg-primary/5 transition-colors text-left",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-2xl text-primary",children:"key"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"Personal Access Token"}),(0,r.jsx)("p",{className:"text-xs text-text-muted",children:"Use a GitLab PAT with api scope"})]})]})]})]}),"oauth"===c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create an OAuth app at"," ",(0,r.jsx)("a",{href:`${u.trim()||o}/-/profile/applications`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Applications"})," ","with redirect URI"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:(i=window.location.port||("https:"===window.location.protocol?"443":"80"),`http://localhost:${i}/callback`)})]}),(0,r.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,r.jsx)(l.pd,{label:"Client ID",value:p,onChange:e=>h(e.target.value),placeholder:"Your OAuth application client ID"}),(0,r.jsx)(l.pd,{label:"Client Secret (optional for PKCE)",value:g,onChange:e=>f(e.target.value),placeholder:"Leave empty for public PKCE app"}),k&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:()=>{p.trim()?(w(null),O({baseUrl:u.trim()||o,clientId:p.trim(),clientSecret:g.trim()}),C(!0)):w("Client ID is required")},fullWidth:!0,disabled:!p.trim(),children:"Authorize"}),(0,r.jsx)(l.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"pat"===c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-xs text-text-muted",children:["Create a PAT at"," ",(0,r.jsx)("a",{href:`${u.trim()||o}/-/user_settings/personal_access_tokens`,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"GitLab Access Tokens"})," ","with scopes: ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"api"}),","," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"read_user"}),", and"," ",(0,r.jsx)("code",{className:"bg-sidebar px-1 rounded text-xs",children:"ai_features"}),"."]}),(0,r.jsx)(l.pd,{label:"GitLab Base URL",value:u,onChange:e=>x(e.target.value),placeholder:o}),(0,r.jsx)(l.pd,{label:"Personal Access Token",value:b,onChange:e=>v(e.target.value),placeholder:"glpat-xxxxxxxxxxxxxxxxxxxx",type:"password"}),k&&(0,r.jsx)("p",{className:"text-sm text-red-500",children:k}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:W,fullWidth:!0,disabled:!b.trim()||j,loading:j,children:"Connect"}),(0,r.jsx)(l.$n,{onClick:()=>{m(null),w(null)},variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})}):null}d.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},96748:(e,t,a)=>{a.d(t,{default:()=>d});var r=a(95155),n=a(12115),s=a(14051),i=a.n(s),l=a(35497);let o="https://api.openai.com/v1";function d({isOpen:e,onClose:t,onCreated:a,onSaved:s,node:i}){let c=!!i,[m,u]=(0,n.useState)({name:"",prefix:"",baseUrl:o}),[x,p]=(0,n.useState)(!1),[h,g]=(0,n.useState)(""),[f,b]=(0,n.useState)(""),[v,j]=(0,n.useState)(!1),[y,k]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(k(null),g(""),b(""),c?u({name:i.name||"",prefix:i.prefix||"",baseUrl:i.baseUrl||o}):u({name:"",prefix:"",baseUrl:o}))},[e,c,i]);let w=async()=>{if(m.name.trim()&&m.prefix.trim()&&m.baseUrl.trim()){p(!0);try{let e=c?`/api/provider-nodes/${i.id}`:"/api/provider-nodes",t=c?"PUT":"POST",r={name:m.name,prefix:m.prefix,baseUrl:m.baseUrl};c||(r.type="custom-embedding");let n=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),l=await n.json();n.ok&&(c?s?.(l.node):a?.(l.node))}catch(e){console.log("Error saving custom embedding node:",e)}finally{p(!1)}}},N=async()=>{j(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:m.baseUrl,apiKey:h,type:"custom-embedding",modelId:f.trim()||void 0})}),t=await e.json();k(t)}catch{k({valid:!1,error:"Network error"})}finally{j(!1)}};return(0,r.jsx)(l.aF,{isOpen:e,title:c?"Edit Custom Embedding":"Add Custom Embedding",onClose:t,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(l.pd,{label:"Name",value:m.name,onChange:e=>u({...m,name:e.target.value}),placeholder:"Voyage AI",hint:"Required. A friendly label for this embedding provider."}),(0,r.jsx)(l.pd,{label:"Prefix",value:m.prefix,onChange:e=>u({...m,prefix:e.target.value}),placeholder:"voyage",hint:"Required. Used as the provider prefix for model IDs (e.g. voyage/voyage-3)."}),(0,r.jsx)(l.pd,{label:"Base URL",value:m.baseUrl,onChange:e=>u({...m,baseUrl:e.target.value}),placeholder:"https://api.voyageai.com/v1",hint:"Most embedding APIs are OpenAI-compatible: Voyage, Cohere, Jina, Mistral, Together..."}),(0,r.jsx)(l.pd,{label:"API Key (for Check)",type:"password",value:h,onChange:e=>g(e.target.value)}),(0,r.jsx)(l.pd,{label:"Model ID (for Check)",value:f,onChange:e=>b(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",hint:"Required for validation. Will send a test embeddings request."}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(l.$n,{onClick:N,disabled:!h||!f.trim()||v||!m.baseUrl.trim(),variant:"secondary",children:v?"Checking...":"Check"}),(()=>{if(!y)return null;let{valid:e,error:t,dimensions:a}=y;return e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Ex,{variant:"success",children:"Valid"}),a&&(0,r.jsxs)("span",{className:"text-sm text-text-muted",children:[a," dims"]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(l.Ex,{variant:"error",children:"Invalid"}),t&&(0,r.jsx)("span",{className:"text-sm text-red-500",children:t})]})})()]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{onClick:w,fullWidth:!0,disabled:!m.name.trim()||!m.prefix.trim()||!m.baseUrl.trim()||x,children:x?c?"Saving...":"Creating...":c?"Save":"Create"}),(0,r.jsx)(l.$n,{onClick:t,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}d.propTypes={isOpen:i().bool.isRequired,onClose:i().func.isRequired,onCreated:i().func,onSaved:i().func,node:i().shape({id:i().string,name:i().string,prefix:i().string,baseUrl:i().string})}},97677:(e,t,a)=>{a.d(t,{default:()=>n});var r=a(95155);function n({text:e,children:t,position:a="top",color:s}){let i=s?"":"bg-gray-900";return(0,r.jsxs)("div",{className:"relative inline-flex group/tt",children:[t,(0,r.jsx)("div",{className:`pointer-events-none absolute ${{top:"bottom-full left-1/2 -translate-x-1/2 mb-1.5",bottom:"top-full left-1/2 -translate-x-1/2 mt-1.5",left:"right-full top-1/2 -translate-y-1/2 mr-1.5",right:"left-full top-1/2 -translate-y-1/2 ml-1.5"}[a]} z-50 w-max max-w-56 rounded px-2 py-1 text-[11px] leading-snug ${i} text-white opacity-0 group-hover/tt:opacity-100 transition-opacity duration-150 whitespace-normal`,style:s?{backgroundColor:s}:{},children:e})]})}},98542:(e,t,a)=>{a.d(t,{default:()=>s});var r=a(95155),n=a(31474);function s({checked:e=!1,onChange:t,label:a,description:i,disabled:l=!1,size:o="md",className:d}){let c={sm:{track:"w-8 h-4",thumb:"size-3",translate:"translate-x-4"},md:{track:"w-11 h-6",thumb:"size-5",translate:"translate-x-5"},lg:{track:"w-14 h-7",thumb:"size-6",translate:"translate-x-7"}};return(0,r.jsxs)("div",{className:(0,n.cn)("flex items-center gap-3",l&&"opacity-50 cursor-not-allowed",d),children:[(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:l,onClick:()=>{!l&&t&&t(!e)},className:(0,n.cn)("relative inline-flex shrink-0 cursor-pointer rounded-full","transition-colors duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-brand-500/30",e?"bg-brand-500":"bg-surface-3",c[o].track,l&&"cursor-not-allowed"),children:(0,r.jsx)("span",{className:(0,n.cn)("pointer-events-none inline-block rounded-full bg-white shadow-sm","transform transition duration-200 ease-in-out",e?c[o].translate:"translate-x-0.5",c[o].thumb,"mt-0.5")})}),(a||i)&&(0,r.jsxs)("div",{className:"flex flex-col",children:[a&&(0,r.jsx)("span",{className:"text-sm font-medium text-text-main",children:a}),i&&(0,r.jsx)("span",{className:"text-xs text-text-muted",children:i})]})]})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{9912:(e,t,a)=>{Promise.resolve().then(a.bind(a,70323))},70323:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var s=a(95155),l=a(12115),r=a(35497),n=a(11059),i=a(73006);let o=["zh-CN","zh-TW"],c=[{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}],d=[{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"}];function m(){let[e,t]=(0,l.useState)(!0),[a,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)("http://localhost:8787"),[p,u]=(0,l.useState)(3e3),[f,g]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[b,j]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(""),[k,C]=(0,l.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[S,E]=(0,l.useState)([]),[P,T]=(0,l.useState)(!1),[$,I]=(0,l.useState)(""),[R,M]=(0,l.useState)(null),[O,L]=(0,l.useState)(""),[U,_]=(0,l.useState)(null),[H,A]=(0,l.useState)(!1),[F,D]=(0,l.useState)(!0),[B,J]=(0,l.useState)(!1),W=(0,l.useRef)(null),[z,G]=(0,l.useState)(!1),[q,K]=(0,l.useState)("full"),[X,Y]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)("full"),[V,ee]=(0,l.useState)(!1),[et,ea]=(0,l.useState)(!1),[es,el]=(0,l.useState)(25e3),[er,en]=(0,l.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[ei,eo]=(0,l.useState)(null),[ec,ed]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(!1),[eh,ep]=(0,l.useState)(""),[eu,ef]=(0,l.useState)("en"),{copied:eg,copy:eb}=(0,n.C)();(0,l.useEffect)(()=>(ef((0,i.kk)()),(0,i.oQ)(()=>ef((0,i.kk)()))),[]);let ej=o.includes(eu),ey=ej?c:c.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=c.find(e=>e.id===q);e?.wenyan&&!ej&&(K("ultra"),ev({cavemanLevel:"ultra"}))},[ej,q]);let ev=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},eN=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},ew=async()=>{let e=x.trim()||"http://localhost:8787";h(e),await ev({headroomUrl:e}),ek()},ek=(0,l.useCallback)(async()=>{g(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(g({...t,loading:!1}),!t?.installed){C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();C(e=>({...e,version:t.version??null,extras:t.extras||{code:!1,ml:!1},available:t.available||["code","ml"],loading:!1})),E([])}catch{C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}}catch{g({installed:!1,running:!1,python:null,loading:!1}),C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}},[]),eC=(0,l.useCallback)(async()=>{w(""),v(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await ek()}catch(e){w(e.message)}finally{v(!1)}},[ek]),eS=(0,l.useCallback)(async()=>{v(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await ek()}finally{v(!1)}},[ek]),eE=(0,l.useCallback)(()=>{L(""),W.current&&clearInterval(W.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&L(t.log)}catch{}};e(),W.current=setInterval(e,1500)},[]),eP=(0,l.useCallback)(()=>{W.current&&(clearInterval(W.current),W.current=null)},[]);(0,l.useEffect)(()=>()=>eP(),[eP]);let eT=(0,l.useCallback)(async()=>{if(0!==S.length){T(!0),I(""),eE();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:S})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");C(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),E([])}catch(e){I(e.message)}finally{eP(),T(!1)}}},[S,eE,eP]),e$=(0,l.useCallback)(async e=>{M(e),I(""),eE();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");C(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){I(e.message)}finally{eP(),M(null)}},[eE,eP]),eI=(0,l.useCallback)(()=>{if(0!==S.length){if(S.includes("ml"))return void _({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:eT});eT()}},[S,eT]),eR=(0,l.useCallback)(e=>{_({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>e$(e)})},[e$]),eM=(0,l.useCallback)(async(e,t)=>{if(I(""),"code"===e&&A(t),"ml"===e&&D(t),await ev({["code"===e?"headroomCodeAware":"headroomKompress"]:t}),f.running){J(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await ek()}catch(e){I(e.message)}finally{J(!1)}}},[f.running,ek]),eO=(0,l.useCallback)(async()=>{en(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();en({...t,loading:!1}),"number"==typeof t.minChars&&el(t.minChars)}catch{en({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),eL=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});eo(await e.json())}catch(e){eo({healthy:!1,checks:[],error:e.message})}},[]),eU=(0,l.useCallback)(async e=>{ep(""),ex(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await eO(),await eL()}catch(e){ep(e.message)}finally{ex(!1)}},[eO,eL]);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),m(!!a.headroomEnabled),h(a.headroomUrl||"http://localhost:8787"),"number"==typeof a.headroomTimeoutMs&&u(a.headroomTimeoutMs),A(!0===a.headroomCodeAware),D(!1!==a.headroomKompress),G(!!a.cavemanEnabled),K(a.cavemanLevel||"full"),Y(!!a.ponytailEnabled),Z(a.ponytailLevel||"full"),ee(!!a.antislopCodeEnabled),ea(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&el(a.pxpipeMinChars),ek(),eO().then(eL)}}catch{}})()},[ek,eO,eL]);let e_=!!f.running,eH=f.loading?"Checking…":e_?"Running":!1===f.localUrl||f.installed?!1!==f.localUrl?"Stopped":"External":"Not installed",eA=!1!==f.localUrl,eF=!!f.canStart,eD=eA&&!!f.managedPid,eB=ei?.healthy===!0,eJ=er.loading?"Checking…":er.installing?"Installing…":er.installed?eB?"Healthy":er.running?"Running":"Stopped":"Not installed";return eB||er.running,(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(r.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"smart_toy"}),"Agent Skills"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(r.lM,{checked:e,onChange:()=>eN(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${e_?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:eH}),(0,s.jsx)("button",{type:"button",onClick:()=>j(!0),className:"text-xs text-primary underline hover:opacity-80",children:e_?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(r.lM,{checked:a,onChange:()=>{var e;let t;return e=!a,void(h(t=x.trim()||"http://localhost:8787"),m(e),ev({headroomEnabled:e,headroomUrl:t}))}})]}),f.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",k.version?` \xb7 v${k.version}`:"",":"]}),k.available.map(e=>{let t=!!k.extras[e],a=S.includes(e),l="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?H:F;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 rounded border border-success/40 bg-success/5 text-text",title:l,children:[(0,s.jsx)(r.lM,{size:"sm",checked:t,disabled:B,onChange:()=>eM(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>eR(e),disabled:R===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:R===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:l,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),S.length>0&&(0,s.jsx)("button",{onClick:eI,disabled:P,className:"text-xs px-2.5 py-1 rounded bg-primary text-white hover:opacity-90 disabled:opacity-50",children:P?"Installing…":`Install [proxy,${S.join(",")}]`})]}),$&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:$}),B&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(P||R)&&O&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:O}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:ey.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;K(t=e.id),ev({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:c.find(e=>e.id===q)?.desc})]}),(0,s.jsx)(r.lM,{checked:z,onChange:()=>{var e;G(e=!z),ev({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[X&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:d.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;Z(t=e.id),ev({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${Q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:d.find(e=>e.id===Q)?.desc})]}),(0,s.jsx)(r.lM,{checked:X,onChange:()=>{var e;Y(e=!X),ev({ponytailEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Code comment hygiene"," ",(0,s.jsx)("span",{className:"text-xs font-mono font-semibold text-primary",children:"(@antislop-code)"})]}),(0,s.jsxs)("a",{href:"https://github.com/miqdadbadjuber/anti-slop",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80 inline-flex items-center gap-0.5",children:["Powered by miqdadbadjuber/anti-slop",(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:"Filter generic AI-slop comments, keep valuable ones, never touch code logic"})]}),(0,s.jsx)("div",{className:"flex items-center gap-3 shrink-0",children:(0,s.jsx)(r.lM,{checked:V,onChange:()=>{var e;ee(e=!V),ev({antislopCodeEnabled:e})}})})]}),!1]}),(0,s.jsx)(r.aF,{isOpen:b,title:e_?"Headroom":"Setup Headroom",onClose:()=>j(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:e_?"text-success":"text-warning",children:eH})]}),e_&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(r.pd,{value:x,onChange:e=>h(e.target.value),onBlur:ew,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Timeout (ms)"}),(0,s.jsx)(r.pd,{value:String(p),onChange:e=>u(e.target.value),onBlur:()=>{let e=Math.round(Number(p)),t=Number.isFinite(e)&&e>0?e:3e3;u(t),ev({headroomTimeoutMs:t})},placeholder:"3000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Request timeout in milliseconds. Defaults to 3000 ms."})]}),eD?(0,s.jsx)(r.$n,{onClick:eS,variant:"ghost",fullWidth:!0,disabled:y,children:y?"Stopping…":"Stop Headroom"}):e_?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):eF?(0,s.jsx)(r.$n,{onClick:eC,fullWidth:!0,disabled:y,children:y?"Starting…":"Start Headroom"}):eA?f.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(r.$n,{size:"sm",variant:"ghost",onClick:()=>eb('pip install "headroom-ai[proxy]"'),children:eg?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),N&&(0,s.jsx)("p",{className:"text-sm text-warning",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>ek(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>j(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.aF,{isOpen:!1,title:er.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>ed(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eB||er.running?"text-success":"text-warning",children:[eJ,er.version?` \xb7 v${er.version}`:""]})]}),ei?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),ei.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),ei.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:ei.error})]}),er.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[er.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{onClick:()=>eU("restart"),variant:"ghost",disabled:em,children:"Restart"}),(0,s.jsx)(r.$n,{onClick:()=>eU("stop"),variant:"ghost",disabled:em,children:"Stop"})]}):(0,s.jsx)(r.$n,{onClick:()=>eU("start"),disabled:em,children:em?"Starting…":"Start"}),(0,s.jsx)(r.$n,{onClick:()=>eU("install"),variant:"ghost",disabled:em,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(r.$n,{onClick:()=>eU("install"),fullWidth:!0,disabled:em||er.installing,children:em||er.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 9Router data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(r.pd,{value:String(es),onChange:e=>el(e.target.value),onBlur:()=>{let e=Math.max(0,Number(es)||25e3);el(e),ev({pxpipeMinChars:e})},placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),eh&&(0,s.jsx)("p",{className:"text-sm text-warning",children:eh}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eO().then(eL),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>ed(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.uo,{isOpen:!!U,onClose:()=>_(null),onConfirm:()=>{let e=U?.onConfirm;_(null),e?.()},title:U?.title,message:U?.message,confirmText:U?.confirmText,variant:U?.variant})]})}}},e=>{e.O(0,[763,1321,705,5497,8441,3794,7358],()=>e(e.s=9912)),_N_E=e.O()}]);
|
|
Binary file
|
|
Binary file
|
package/app/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{9912:(e,t,a)=>{Promise.resolve().then(a.bind(a,70323))},70323:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var s=a(95155),l=a(12115),r=a(35497),n=a(11059),i=a(73006);let o=["zh-CN","zh-TW"],c=[{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}],d=[{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"}];function m(){let[e,t]=(0,l.useState)(!0),[a,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)("http://localhost:8787"),[p,u]=(0,l.useState)(3e3),[f,g]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[b,j]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(""),[k,C]=(0,l.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[S,E]=(0,l.useState)([]),[P,T]=(0,l.useState)(!1),[$,I]=(0,l.useState)(""),[R,O]=(0,l.useState)(null),[M,L]=(0,l.useState)(""),[U,H]=(0,l.useState)(null),[_,A]=(0,l.useState)(!1),[D,F]=(0,l.useState)(!0),[B,J]=(0,l.useState)(!1),W=(0,l.useRef)(null),[z,G]=(0,l.useState)(!1),[K,X]=(0,l.useState)("full"),[q,Y]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)("full"),[V,ee]=(0,l.useState)(!1),[et,ea]=(0,l.useState)(25e3),[es,el]=(0,l.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[er,en]=(0,l.useState)(null),[ei,eo]=(0,l.useState)(!1),[ec,ed]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(""),[eh,ep]=(0,l.useState)("en"),{copied:eu,copy:ef}=(0,n.C)();(0,l.useEffect)(()=>(ep((0,i.kk)()),(0,i.oQ)(()=>ep((0,i.kk)()))),[]);let eg=o.includes(eh),eb=eg?c:c.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=c.find(e=>e.id===K);e?.wenyan&&!eg&&(X("ultra"),ej({cavemanLevel:"ultra"}))},[eg,K]);let ej=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},ey=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},ev=async()=>{let e=x.trim()||"http://localhost:8787";h(e),await ej({headroomUrl:e}),eN()},eN=(0,l.useCallback)(async()=>{g(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(g({...t,loading:!1}),!t?.installed){C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();C(e=>({...e,version:t.version??null,extras:t.extras||{code:!1,ml:!1},available:t.available||["code","ml"],loading:!1})),E([])}catch{C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}}catch{g({installed:!1,running:!1,python:null,loading:!1}),C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}},[]),ew=(0,l.useCallback)(async()=>{w(""),v(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await eN()}catch(e){w(e.message)}finally{v(!1)}},[eN]),ek=(0,l.useCallback)(async()=>{v(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await eN()}finally{v(!1)}},[eN]),eC=(0,l.useCallback)(()=>{L(""),W.current&&clearInterval(W.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&L(t.log)}catch{}};e(),W.current=setInterval(e,1500)},[]),eS=(0,l.useCallback)(()=>{W.current&&(clearInterval(W.current),W.current=null)},[]);(0,l.useEffect)(()=>()=>eS(),[eS]);let eE=(0,l.useCallback)(async()=>{if(0!==S.length){T(!0),I(""),eC();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:S})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");C(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),E([])}catch(e){I(e.message)}finally{eS(),T(!1)}}},[S,eC,eS]),eP=(0,l.useCallback)(async e=>{O(e),I(""),eC();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");C(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){I(e.message)}finally{eS(),O(null)}},[eC,eS]),eT=(0,l.useCallback)(()=>{if(0!==S.length){if(S.includes("ml"))return void H({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:eE});eE()}},[S,eE]),e$=(0,l.useCallback)(e=>{H({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>eP(e)})},[eP]),eI=(0,l.useCallback)(async(e,t)=>{if(I(""),"code"===e&&A(t),"ml"===e&&F(t),await ej({["code"===e?"headroomCodeAware":"headroomKompress"]:t}),f.running){J(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await eN()}catch(e){I(e.message)}finally{J(!1)}}},[f.running,eN]),eR=(0,l.useCallback)(async()=>{el(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();el({...t,loading:!1}),"number"==typeof t.minChars&&ea(t.minChars)}catch{el({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),eO=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});en(await e.json())}catch(e){en({healthy:!1,checks:[],error:e.message})}},[]),eM=(0,l.useCallback)(async e=>{ex(""),ed(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await eR(),await eO()}catch(e){ex(e.message)}finally{ed(!1)}},[eR,eO]);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),m(!!a.headroomEnabled),h(a.headroomUrl||"http://localhost:8787"),"number"==typeof a.headroomTimeoutMs&&u(a.headroomTimeoutMs),A(!0===a.headroomCodeAware),F(!1!==a.headroomKompress),G(!!a.cavemanEnabled),X(a.cavemanLevel||"full"),Y(!!a.ponytailEnabled),Z(a.ponytailLevel||"full"),ee(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&ea(a.pxpipeMinChars),eN(),eR().then(eO)}}catch{}})()},[eN,eR,eO]);let eL=!!f.running,eU=f.loading?"Checking…":eL?"Running":!1===f.localUrl||f.installed?!1!==f.localUrl?"Stopped":"External":"Not installed",eH=!1!==f.localUrl,e_=!!f.canStart,eA=eH&&!!f.managedPid,eD=er?.healthy===!0,eF=es.loading?"Checking…":es.installing?"Installing…":es.installed?eD?"Healthy":es.running?"Running":"Stopped":"Not installed";return eD||es.running,(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(r.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(r.lM,{checked:e,onChange:()=>ey(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${eL?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:eU}),(0,s.jsx)("button",{type:"button",onClick:()=>j(!0),className:"text-xs text-primary underline hover:opacity-80",children:eL?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(r.lM,{checked:a,onChange:()=>{var e;let t;return e=!a,void(h(t=x.trim()||"http://localhost:8787"),m(e),ej({headroomEnabled:e,headroomUrl:t}))}})]}),f.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",k.version?` \xb7 v${k.version}`:"",":"]}),k.available.map(e=>{let t=!!k.extras[e],a=S.includes(e),l="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?_:D;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 rounded border border-success/40 bg-success/5 text-text",title:l,children:[(0,s.jsx)(r.lM,{size:"sm",checked:t,disabled:B,onChange:()=>eI(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>e$(e),disabled:R===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:R===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:l,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),S.length>0&&(0,s.jsx)("button",{onClick:eT,disabled:P,className:"text-xs px-2.5 py-1 rounded bg-primary text-white hover:opacity-90 disabled:opacity-50",children:P?"Installing…":`Install [proxy,${S.join(",")}]`})]}),$&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:$}),B&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(P||R)&&M&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:M}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:eb.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;X(t=e.id),ej({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${K===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:c.find(e=>e.id===K)?.desc})]}),(0,s.jsx)(r.lM,{checked:z,onChange:()=>{var e;G(e=!z),ej({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[q&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:d.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;Z(t=e.id),ej({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${Q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:d.find(e=>e.id===Q)?.desc})]}),(0,s.jsx)(r.lM,{checked:q,onChange:()=>{var e;Y(e=!q),ej({ponytailEnabled:e})}})]})]}),!1]}),(0,s.jsx)(r.aF,{isOpen:b,title:eL?"Headroom":"Setup Headroom",onClose:()=>j(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:eL?"text-success":"text-warning",children:eU})]}),eL&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(r.pd,{value:x,onChange:e=>h(e.target.value),onBlur:ev,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Timeout (ms)"}),(0,s.jsx)(r.pd,{value:String(p),onChange:e=>u(e.target.value),onBlur:()=>{let e=Math.round(Number(p)),t=Number.isFinite(e)&&e>0?e:3e3;u(t),ej({headroomTimeoutMs:t})},placeholder:"3000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Request timeout in milliseconds. Defaults to 3000 ms."})]}),eA?(0,s.jsx)(r.$n,{onClick:ek,variant:"ghost",fullWidth:!0,disabled:y,children:y?"Stopping…":"Stop Headroom"}):eL?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):e_?(0,s.jsx)(r.$n,{onClick:ew,fullWidth:!0,disabled:y,children:y?"Starting…":"Start Headroom"}):eH?f.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(r.$n,{size:"sm",variant:"ghost",onClick:()=>ef('pip install "headroom-ai[proxy]"'),children:eu?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),N&&(0,s.jsx)("p",{className:"text-sm text-warning",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eN(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>j(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.aF,{isOpen:!1,title:es.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>eo(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eD||es.running?"text-success":"text-warning",children:[eF,es.version?` \xb7 v${es.version}`:""]})]}),er?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),er.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),er.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:er.error})]}),es.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[es.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{onClick:()=>eM("restart"),variant:"ghost",disabled:ec,children:"Restart"}),(0,s.jsx)(r.$n,{onClick:()=>eM("stop"),variant:"ghost",disabled:ec,children:"Stop"})]}):(0,s.jsx)(r.$n,{onClick:()=>eM("start"),disabled:ec,children:ec?"Starting…":"Start"}),(0,s.jsx)(r.$n,{onClick:()=>eM("install"),variant:"ghost",disabled:ec,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(r.$n,{onClick:()=>eM("install"),fullWidth:!0,disabled:ec||es.installing,children:ec||es.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 9Router data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(r.pd,{value:String(et),onChange:e=>ea(e.target.value),onBlur:()=>{let e=Math.max(0,Number(et)||25e3);ea(e),ej({pxpipeMinChars:e})},placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),em&&(0,s.jsx)("p",{className:"text-sm text-warning",children:em}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eR().then(eO),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>eo(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.uo,{isOpen:!!U,onClose:()=>H(null),onConfirm:()=>{let e=U?.onConfirm;H(null),e?.()},title:U?.title,message:U?.message,confirmText:U?.confirmText,variant:U?.variant})]})}}},e=>{e.O(0,[763,1321,705,5497,8441,3794,7358],()=>e(e.s=9912)),_N_E=e.O()}]);
|
|
File without changes
|
/package/app/.next-cli-build/static/{dsHxdInmFi9NHH3ULl21u → eXoiEKu5yWZkk7npUXFrc}/_ssgManifest.js
RENAMED
|
File without changes
|