switchboard-router 0.9.9 → 0.9.10
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/static/chunks/1321-a73f95036c368bd4.js +1 -0
- package/app/.next/static/chunks/1330-846d6a9e1497295e.js +7 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/agent-library/page-65e302b698beee56.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-337881fe6c0cc77a.js +16 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/loading-c80ac975cf0f4842.js +1 -0
- package/app/{.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-78d098f14f8cff05.js → .next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-efb20dd903e0dc94.js} +10 -10
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-03290d1edb08623a.js +4 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-9bcd63bfeeac87c6.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-97e0f7067cab0724.js → page-ca71683d9d850162.js} +3 -3
- package/app/.next/static/chunks/app/(dashboard)/dashboard/pxpipe/page-c5c37fbce431369b.js +1 -0
- package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-b582299fa61407d9.js +1 -0
- package/app/.next/static/css/92ffae29025c5847.css +1 -0
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +8 -8
- package/app/.next-cli-build/build-manifest.json +2 -2
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/routing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +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 +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +10 -10
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/aider-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-full-catalog/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-full-catalog/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/gemini-cli-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +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/picker-labels/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/picker-labels/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/[id]/strategy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js +2 -2
- package/app/.next-cli-build/server/app/api/mgmt/v1/metrics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/routing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/usage/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mgmt/v1/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/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 +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/cache/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/prepare/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/remove-unavailable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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 +2 -2
- 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 +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/feedback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/insights/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/learn/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/promote/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/routing/versions/rollback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -6
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +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 +8 -8
- package/app/.next-cli-build/server/chunks/1158.js +1 -0
- package/app/.next-cli-build/server/chunks/1274.js +1 -0
- package/app/.next-cli-build/server/chunks/1351.js +1 -0
- package/app/.next-cli-build/server/chunks/1792.js +2 -0
- package/app/.next-cli-build/server/chunks/{159.js → 1837.js} +1 -1
- package/app/.next-cli-build/server/chunks/1937.js +1 -1
- package/app/.next-cli-build/server/chunks/1998.js +1 -1
- package/app/.next-cli-build/server/chunks/{3986.js → 2142.js} +2 -2
- package/app/.next-cli-build/server/chunks/{9508.js → 27.js} +5 -42
- package/app/.next-cli-build/server/chunks/3423.js +1 -0
- package/app/.next-cli-build/server/chunks/3446.js +1 -1
- package/app/.next-cli-build/server/chunks/3593.js +1 -1
- package/app/.next-cli-build/server/chunks/369.js +10 -10
- package/app/.next-cli-build/server/chunks/3735.js +2 -2
- package/app/.next-cli-build/server/chunks/403.js +1 -0
- package/app/.next-cli-build/server/chunks/4330.js +7 -0
- package/app/.next-cli-build/server/chunks/{940.js → 4675.js} +2 -2
- package/app/.next-cli-build/server/chunks/4739.js +1 -1
- package/app/.next-cli-build/server/chunks/4780.js +1 -1
- package/app/.next-cli-build/server/chunks/4803.js +1 -1
- package/app/.next-cli-build/server/chunks/507.js +1 -1
- package/app/.next-cli-build/server/chunks/5115.js +1 -0
- package/app/.next-cli-build/server/chunks/519.js +1 -0
- package/app/.next-cli-build/server/chunks/5195.js +1 -0
- package/app/.next-cli-build/server/chunks/5258.js +1 -1
- package/app/.next-cli-build/server/chunks/5717.js +9 -14
- package/app/.next-cli-build/server/chunks/5774.js +1 -0
- package/app/.next-cli-build/server/chunks/5781.js +2 -2
- package/app/.next-cli-build/server/chunks/5888.js +1 -1
- package/app/.next-cli-build/server/chunks/5920.js +2 -2
- package/app/.next-cli-build/server/chunks/6194.js +1 -0
- package/app/.next-cli-build/server/chunks/6252.js +1 -1
- package/app/.next-cli-build/server/chunks/6305.js +2 -0
- package/app/.next-cli-build/server/chunks/6328.js +1 -1
- package/app/.next-cli-build/server/chunks/6406.js +1 -1
- package/app/.next-cli-build/server/chunks/6492.js +1 -1
- package/app/.next-cli-build/server/chunks/{5913.js → 6757.js} +38 -1
- package/app/.next-cli-build/server/chunks/698.js +1 -1
- package/app/.next-cli-build/server/chunks/7133.js +1 -0
- package/app/.next-cli-build/server/chunks/7454.js +1 -1
- package/app/.next-cli-build/server/chunks/{3072.js → 7880.js} +2 -2
- package/app/.next-cli-build/server/chunks/7965.js +1 -1
- package/app/.next-cli-build/server/chunks/8027.js +63 -0
- package/app/.next-cli-build/server/chunks/8062.js +1 -1
- package/app/.next-cli-build/server/chunks/8400.js +11 -11
- package/app/.next-cli-build/server/chunks/8469.js +1 -1
- package/app/.next-cli-build/server/chunks/8520.js +1 -1
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8775.js +1 -1
- package/app/.next-cli-build/server/chunks/8789.js +1 -1
- package/app/.next-cli-build/server/chunks/8942.js +2 -2
- package/app/.next-cli-build/server/chunks/8976.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +32 -37
- package/app/.next-cli-build/server/chunks/9059.js +1 -0
- package/app/.next-cli-build/server/chunks/9091.js +3 -3
- package/app/.next-cli-build/server/chunks/9261.js +2 -2
- package/app/.next-cli-build/server/chunks/9264.js +2 -2
- package/app/.next-cli-build/server/chunks/9421.js +2 -2
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +11 -16
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/1321-a73f95036c368bd4.js +1 -0
- package/app/.next-cli-build/static/chunks/1330-846d6a9e1497295e.js +7 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-65e302b698beee56.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-337881fe6c0cc77a.js +16 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/loading-c80ac975cf0f4842.js +1 -0
- package/app/{.next/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-78d098f14f8cff05.js → .next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-efb20dd903e0dc94.js} +10 -10
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-03290d1edb08623a.js +4 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-9bcd63bfeeac87c6.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-97e0f7067cab0724.js → page-ca71683d9d850162.js} +3 -3
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-c5c37fbce431369b.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-b582299fa61407d9.js +1 -0
- package/app/.next-cli-build/static/css/92ffae29025c5847.css +1 -0
- package/app/open-sse/identity/tls/bin/darwin/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/darwin/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/arm64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/linux/x64/switchboard-claude-tls +0 -0
- package/app/open-sse/identity/tls/bin/win32/arm64/switchboard-claude-tls.exe +0 -0
- package/app/open-sse/identity/tls/bin/win32/x64/switchboard-claude-tls.exe +0 -0
- package/app/package.json +1 -1
- package/app/public/i18n/literals/zh-CN.json +17 -1
- package/app/src/lib/updater/updater.js +7 -2
- package/cli.js +62 -21
- package/hooks/trayRuntime.js +72 -17
- package/package.json +1 -1
- package/src/cli/api/client.js +9 -3
- package/src/cli/cliOptions.js +1 -1
- package/src/cli/processManager.js +47 -1
- package/src/cli/serverStatus.js +32 -9
- package/src/cli/terminalUI.js +5 -2
- package/src/cli/tray/autostart.js +20 -4
- package/src/cli/tray/tray.js +4 -1
- package/src/cli/utils/display.js +20 -0
- package/app/.next/static/chunks/1321-f49cd2f61cbf7361.js +0 -1
- package/app/.next/static/chunks/1330-56405eca78b12fee.js +0 -7
- package/app/.next/static/chunks/app/(dashboard)/dashboard/agent-library/page-40f3ca16440f8e17.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/endpoint/page-ca47b09e6ed6ae7b.js +0 -16
- package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-ff13a39fb7744f5e.js +0 -4
- package/app/.next/static/chunks/app/(dashboard)/dashboard/page-86cd6523dcd61f1b.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/pxpipe/page-1805f993834a1adb.js +0 -1
- package/app/.next/static/chunks/app/(dashboard)/dashboard/skills/page-645e7c5ec034fe8c.js +0 -1
- package/app/.next/static/css/196a6347b9104610.css +0 -1
- package/app/.next-cli-build/server/chunks/1350.js +0 -1
- package/app/.next-cli-build/server/chunks/1656.js +0 -2
- package/app/.next-cli-build/server/chunks/194.js +0 -1
- package/app/.next-cli-build/server/chunks/3026.js +0 -1
- package/app/.next-cli-build/server/chunks/5616.js +0 -1
- package/app/.next-cli-build/server/chunks/6052.js +0 -2
- package/app/.next-cli-build/server/chunks/6182.js +0 -63
- package/app/.next-cli-build/server/chunks/6274.js +0 -1
- package/app/.next-cli-build/server/chunks/6347.js +0 -1
- package/app/.next-cli-build/server/chunks/849.js +0 -1
- package/app/.next-cli-build/server/chunks/8658.js +0 -1
- package/app/.next-cli-build/server/chunks/8834.js +0 -7
- package/app/.next-cli-build/server/chunks/9617.js +0 -1
- package/app/.next-cli-build/static/chunks/1321-f49cd2f61cbf7361.js +0 -1
- package/app/.next-cli-build/static/chunks/1330-56405eca78b12fee.js +0 -7
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/agent-library/page-40f3ca16440f8e17.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-ca47b09e6ed6ae7b.js +0 -16
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-ff13a39fb7744f5e.js +0 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-86cd6523dcd61f1b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-1805f993834a1adb.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-645e7c5ec034fe8c.js +0 -1
- package/app/.next-cli-build/static/css/196a6347b9104610.css +0 -1
- /package/app/.next/static/{GP6N1FvEOE4uYUrdrCir5 → pVi5nGAVrNaYdEp0c24Nk}/_buildManifest.js +0 -0
- /package/app/.next/static/{GP6N1FvEOE4uYUrdrCir5 → pVi5nGAVrNaYdEp0c24Nk}/_ssgManifest.js +0 -0
- /package/app/.next-cli-build/static/{GP6N1FvEOE4uYUrdrCir5 → pVi5nGAVrNaYdEp0c24Nk}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{GP6N1FvEOE4uYUrdrCir5 → pVi5nGAVrNaYdEp0c24Nk}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{17845:(e,t,a)=>{Promise.resolve().then(a.bind(a,41095))},35497:(e,t,a)=>{"use strict";a.d(t,{x0:()=>N.default,Ex:()=>d.default,$n:()=>s.default,nh:()=>F.default,Zp:()=>o.default,Qv:()=>n.CardSkeleton,CK:()=>x.default,uo:()=>i.ConfirmModal,G9:()=>y.default,wI:()=>w.default,vj:()=>j.default,vE:()=>v.default,pd:()=>r.default,Mh:()=>g.default,uR:()=>p.default,Nf:()=>h.default,aF:()=>i.default,rq:()=>u.default,gw:()=>k.default,LF:()=>m.default,Wx:()=>$.default,gM:()=>f.default,Iz:()=>C.default,l6:()=>l.default,lM:()=>c.default,m_:()=>S.default,jK:()=>b.default});var s=a(92542),r=a(11910),l=a(98),o=a(84588),i=a(81127),n=a(25086);a(56319);var d=a(56061),c=a(98542);a(38587),a(21110),a(92622),a(8823),a(92173);var m=a(90882),u=a(72908),p=a(28815),x=a(45455),h=a(28058),b=a(4809);a(21931),a(80752),a(40197);var f=a(23615);a(44736);var g=a(62899);a(94230);var y=a(30815),v=a(23936),j=a(95088),w=a(73579),N=a(96748),k=a(4823),C=a(28067),S=a(97677),$=a(51825),F=a(29366);a(76361),a(91450)},41095:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>D});var s=a(95155),r=a(73321),l=a(98500),o=a.n(l),i=a(12115),n=a(35497),d=a(57250),c=a(88105),m=a(70217),u=a(14051),p=a.n(u),x=a(65921),h=a(53578);function b({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function f({connection:e,isOAuth:t,isFirst:a,isLast:r,onMoveUp:l,onMoveDown:o,onToggleActive:d,onEdit:c,onDelete:u}){let[p,x]=(0,i.useState)(!1),h=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,g=h?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",y="",v=e.providerSpecificData?.connectionProxyUrl;if(v)try{let e=new URL(v);y=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{y=v}let j=e.providerSpecificData?.connectionNoProxy||"",w=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{x(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let a=w?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[e,w]);let N="unavailable"!==e.testStatus||p?e.testStatus:"active",k=t?e.name||e.email||e.displayName||"OAuth Account":e.name;return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,disabled:a,className:`p-0.5 rounded ${a?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:t?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:k}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(n.Ex,{variant:(0,m.g)(e.isActive,N),size:"sm",dot:!0,children:!1===e.isActive?"disabled":N||"Unknown"}),h&&(0,s.jsx)(n.Ex,{variant:"success",size:"sm",children:"Proxy"}),p&&!1!==e.isActive&&(0,s.jsx)(b,{until:w}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),h&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:g,children:g}),y&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:y}),j&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:j,children:["no_proxy: ",j]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,s.jsxs)("button",{onClick:c,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:u,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(n.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable":"Enable"})]})]})}function g({isOpen:e,provider:t,providerName:a,onSave:r,onClose:l}){let[o,d]=(0,i.useState)({name:"",apiKey:"",priority:1}),[c,m]=(0,i.useState)(!1),[u,p]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),b=o.name.trim().length>0,f=o.apiKey.trim().length>0,y=async()=>{let e=o.apiKey.trim();if(e){m(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e})}),s=await a.json();p(s.valid?"success":"failed")}catch{p("failed")}finally{m(!1)}}},v=async()=>{let e=o.name.trim(),a=o.apiKey.trim();if(t&&e&&a){h(!0);try{let s=!1;try{m(!0),p(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:a})});s=!!(await e.json()).valid,p(s?"success":"failed")}catch{p("failed")}finally{m(!1)}await r({name:e,apiKey:a,priority:o.priority,testStatus:s?"active":"unknown"})}finally{h(!1)}}};return t?(0,s.jsx)(n.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:o.name,onChange:e=>d({...o,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",autoComplete:"off",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:o.apiKey,onChange:e=>d({...o,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(n.$n,{onClick:y,disabled:!f||c||x,variant:"secondary",children:c?"Checking...":"Check"})})]}),u&&(0,s.jsx)(n.Ex,{variant:"success"===u?"success":"error",children:"success"===u?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",min:1,className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:o.priority,onChange:e=>d({...o,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:v,fullWidth:!0,disabled:!b||!f||x,children:x?"Saving...":"Save"}),(0,s.jsx)(n.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function y({providerId:e,isOAuth:t}){let[a,r]=(0,i.useState)([]),[l,o]=(0,i.useState)(!0),[d,c]=(0,i.useState)(!1),[m,u]=(0,i.useState)(!1),[p,b]=(0,i.useState)(null),[v,j]=(0,i.useState)(null),[w,N]=(0,i.useState)("1"),[k,C]=(0,i.useState)(!1),[S,$]=(0,i.useState)("30"),[F,E]=(0,i.useState)(null),A=(0,x.i)(e=>e.error),T=(0,i.useCallback)(async()=>{try{let[t,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]);if(!t.ok||!a.ok)throw Error("Failed to load connections");let s=await t.json(),l=await a.json();r((s.connections||[]).filter(t=>t.provider===e));let o=(l.providerStrategies||{})[e]||{};j(o.fallbackStrategy||null),N(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let i=o.accountScheduler||{};C(!0===i.enabled),$(String(Math.max(1,Math.round((i.sessionAffinityTtlSeconds||1800)/60))))}catch(e){A(e?.message||"Failed to load connections")}finally{o(!1)}},[A,e]);(0,i.useEffect)(()=>{T()},[T]);let R=async(t,a)=>{try{return await (0,h.T)(e,e=>{let s={...e};return t?s.fallbackStrategy=t:delete s.fallbackStrategy,"round-robin"===t&&""!==a?s.stickyRoundRobinLimit=Number(a)||3:t||delete s.stickyRoundRobinLimit,s}),!0}catch(e){return A(e?.message||"Failed to save provider strategy"),!1}},P=async(t,a)=>{let s=Math.min(1440,Math.max(1,Number.parseInt(a,10)||30));try{return await (0,h.T)(e,e=>({...e,accountScheduler:{...e.accountScheduler||{},enabled:t,sessionAffinityTtlSeconds:60*s}})),!0}catch(e){return A(e?.message||"Failed to save balanced scheduler"),!1}},I=async e=>{await P(k,e)&&$(e)},_=async e=>{await R("round-robin",e)&&N(e)},M=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(s);try{if((await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])).some(e=>!e.ok))throw Error("Failed to reorder connections")}catch(e){A(e?.message||"Failed to reorder connections"),await T()}},O=async e=>{let t=a.find(t=>t.id===e),s=t?.name?.trim()||t?.email?.trim()||e;E({title:"Delete Connection",message:`Delete connection “${s}”?`,onConfirm:async()=>{E(null);try{let t=await fetch(`/api/providers/${e}`,{method:"DELETE"});if(!t.ok)throw Error(`Failed to delete connection (${t.status})`);r(t=>t.filter(t=>t.id!==e))}catch(e){A("Failed to delete connection")}}})},L=async(e,t)=>{try{let a=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(!a.ok)throw Error(`Failed to toggle connection (${a.status})`);r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){A("Failed to toggle connection")}},K=async t=>{try{let a=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})});if(!a.ok)throw Error(`Failed to save API key (${a.status})`);await T(),c(!1)}catch(e){A("Failed to save API key")}},B=async e=>{try{let t=await fetch(`/api/providers/${p.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(`Failed to update connection (${t.status})`);await T(),u(!1)}catch(e){A("Failed to update connection")}};if(l)return(0,s.jsx)(n.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})});let D=k?"balanced":"round-robin"===v?"round-robin":"fill-first",U=async e=>{"balanced"===e?await P(!0,S)&&C(!0):"round-robin"===e?(k&&(await P(!1,S),C(!1)),await R("round-robin",w||"1")&&j("round-robin")):(k&&(await P(!1,S),C(!1)),await R("fill-first","")&&j("fill-first"))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-0.5",children:["Manage accounts and selection strategy for ",e]})]}),a.length>1&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border/40 bg-surface-2/40 p-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-semibold text-text-main",children:"Account Strategy"}),(0,s.jsxs)("div",{className:"inline-flex rounded-lg border border-border/60 bg-background/60 p-0.5",children:[(0,s.jsx)("button",{type:"button",onClick:()=>U("fill-first"),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-all ${"fill-first"===D?"bg-primary text-black font-semibold shadow-xs":"text-text-muted hover:text-text-main"}`,children:"Fill-First"}),(0,s.jsx)("button",{type:"button",onClick:()=>U("round-robin"),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-all ${"round-robin"===D?"bg-primary text-black font-semibold shadow-xs":"text-text-muted hover:text-text-main"}`,children:"Round Robin"}),(0,s.jsx)("button",{type:"button",onClick:()=>U("balanced"),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-all ${"balanced"===D?"bg-primary text-black font-semibold shadow-xs":"text-text-muted hover:text-text-main"}`,children:"Balanced"})]})]}),"fill-first"===D&&(0,s.jsx)("p",{className:"max-w-md text-[11px] text-text-muted",children:"Routes all requests to top-priority connection first. Spills over to subsequent accounts on rate limit (429) or quota exhaustion."}),"round-robin"===D&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{children:"Cycles evenly across accounts."}),(0,s.jsxs)("label",{className:"inline-flex items-center gap-1",children:["Sticky limit:",(0,s.jsx)("input",{type:"number",min:1,max:100,value:w,onChange:e=>_(e.target.value),className:"w-12 px-1.5 py-0.5 text-[11px] border border-border rounded bg-background focus:outline-none focus:border-primary"})]})]}),"balanced"===D&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{children:"Least in-flight concurrency with session affinity."}),(0,s.jsxs)("label",{className:"inline-flex items-center gap-1",children:["Affinity:",(0,s.jsx)("input",{"aria-label":"Session affinity minutes",type:"number",min:1,max:1440,value:S,onChange:e=>I(e.target.value),className:"w-14 px-1.5 py-0.5 text-[11px] border border-border rounded bg-background focus:outline-none focus:border-primary"}),"min"]})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>c(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:a.map((e,r)=>(0,s.jsx)(f,{connection:e,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>M(r,r-1),onMoveDown:()=>M(r,r+1),onToggleActive:t=>L(e.id,t),onEdit:()=>{b(e),u(!0)},onDelete:()=>O(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>c(!0),children:"Add"})})]})]}),(0,s.jsx)(g,{isOpen:d,provider:e,onSave:K,onClose:()=>c(!1)}),(0,s.jsx)(n.wI,{isOpen:m,connection:p,onSave:B,onClose:()=>u(!1)}),(0,s.jsx)(n.uo,{isOpen:!!F,onClose:()=>E(null),onConfirm:F?.onConfirm,title:F?.title||"Confirm",message:F?.message,variant:"danger"})]})}b.propTypes={until:p().string.isRequired},f.propTypes={connection:p().shape({id:p().string,name:p().string,email:p().string,displayName:p().string,testStatus:p().string,isActive:p().bool,lastError:p().string,priority:p().number}).isRequired,isOAuth:p().bool.isRequired,isFirst:p().bool.isRequired,isLast:p().bool.isRequired,onMoveUp:p().func.isRequired,onMoveDown:p().func.isRequired,onToggleActive:p().func.isRequired,onEdit:p().func.isRequired,onDelete:p().func.isRequired},g.propTypes={isOpen:p().bool.isRequired,provider:p().string,providerName:p().string,onSave:p().func.isRequired,onClose:p().func.isRequired},y.propTypes={providerId:p().string.isRequired,isOAuth:p().bool};var v=a(28777),j=a(11059),w=a(78559);function N({model:e,fullModel:t,copied:a,onCopy:r,testStatus:l,isCustom:o,isFree:i,onDeleteAlias:n,onTest:d,isTesting:c}){let m="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),i&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,s.jsx)("button",{onClick:n,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function k({isOpen:e,onSave:t,onClose:a}){let[r,l]=(0,i.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(n.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function C({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:l}=(0,j.C)(),[o,d]=(0,i.useState)({}),[m,u]=(0,i.useState)([]),[p,x]=(0,i.useState)({}),[h,b]=(0,i.useState)(null),[f,g]=(0,i.useState)(""),[y,S]=(0,i.useState)(!1),[$,F]=(0,i.useState)([]),E=a||(0,c.wG)(e),A=t||"llm",T=(0,i.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/models/alias"),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"})]),r=await t.json(),l=await a.json(),o=await s.json();t.ok&&d(r.aliases||{}),a.ok&&F((l.connections||[]).filter(t=>t.provider===e)),s.ok&&u(o.models||[])}catch(e){(0,w.s)("ModelsCard fetch error:",e)}},[e]);(0,i.useEffect)(()=>{T()},[T]);let R=async(e,t)=>{let a=`${E}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await T()}catch(e){(0,w.s)("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await T()}catch(e){(0,w.s)("delete alias error:",e)}},I=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:E,id:e,type:A})})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){(0,w.s)("add custom model error:",e)}},_=async e=>{try{let t=new URLSearchParams({providerAlias:E,id:e,type:A});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await T(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){(0,w.s)("delete custom model error:",e)}},M=async e=>{if(!h){b(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${E}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),g(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),g("Network error")}finally{b(null)}}},O=(0,v.KC)(e),L=t?O.filter(e=>e.kinds?e.kinds.includes(t):(0,v.CP)(e,"llm")===t):O,K=m.filter(e=>e.providerAlias===E&&(0,v.CP)(e,"llm")===A&&!L.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),f&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:f}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[L.map(e=>{let t=`${E}/${e.id}`,a=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,s.jsx)(N,{model:e,fullModel:`${E}/${e.id}`,alias:a,copied:r,onCopy:l,onSetAlias:t=>R(e.id,t),onDeleteAlias:()=>P(a),testStatus:p[e.id],onTest:$.length>0?()=>M(e.id):void 0,isTesting:h===e.id,isFree:e.isFree},e.id)}),K.map(e=>(0,s.jsx)(N,{model:{id:e.id,name:e.name},fullModel:`${E}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>_(e.id),testStatus:p[e.id],onTest:$.length>0?()=>M(e.id):void 0,isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>S(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(k,{isOpen:y,onSave:async e=>{await I(e),S(!1)},onClose:()=>S(!1)})]})}function S({label:e,htmlFor:t,children:a}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)(t?"label":"span",{htmlFor:t,className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:a})]})}N.propTypes={model:p().shape({id:p().string.isRequired}).isRequired,fullModel:p().string.isRequired,copied:p().string,onCopy:p().func.isRequired,testStatus:p().oneOf(["ok","error"]),isCustom:p().bool,isFree:p().bool,onDeleteAlias:p().func,onTest:p().func,isTesting:p().bool},k.propTypes={isOpen:p().bool.isRequired,onSave:p().func.isRequired,onClose:p().func.isRequired},C.propTypes={providerId:p().string.isRequired,kindFilter:p().string,providerAliasOverride:p().string};let $={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{17845:(e,t,a)=>{Promise.resolve().then(a.bind(a,41095))},35497:(e,t,a)=>{"use strict";a.d(t,{x0:()=>N.default,Ex:()=>d.default,$n:()=>s.default,nh:()=>F.default,Zp:()=>o.default,Qv:()=>n.CardSkeleton,CK:()=>x.default,uo:()=>i.ConfirmModal,G9:()=>y.default,wI:()=>w.default,vj:()=>j.default,vE:()=>v.default,pd:()=>r.default,Mh:()=>g.default,uR:()=>p.default,Nf:()=>h.default,aF:()=>i.default,rq:()=>u.default,gw:()=>k.default,LF:()=>m.default,Wx:()=>$.default,gM:()=>f.default,Iz:()=>C.default,l6:()=>l.default,lM:()=>c.default,m_:()=>S.default,jK:()=>b.default});var s=a(92542),r=a(11910),l=a(98),o=a(84588),i=a(81127),n=a(25086);a(56319);var d=a(56061),c=a(98542);a(38587),a(21110),a(92622),a(8823),a(92173);var m=a(90882),u=a(72908),p=a(28815),x=a(45455),h=a(28058),b=a(4809);a(21931),a(80752),a(40197);var f=a(23615);a(44736);var g=a(62899);a(94230);var y=a(30815),v=a(23936),j=a(95088),w=a(73579),N=a(96748),k=a(4823),C=a(28067),S=a(97677),$=a(51825),F=a(29366);a(76361),a(91450)},41095:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>U});var s=a(95155),r=a(73321),l=a(98500),o=a.n(l),i=a(12115),n=a(35497),d=a(57250),c=a(88105),m=a(70217),u=a(14051),p=a.n(u),x=a(65921),h=a(53578);function b({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function f({connection:e,isOAuth:t,isFirst:a,isLast:r,onMoveUp:l,onMoveDown:o,onToggleActive:d,onEdit:c,onDelete:u}){let[p,x]=(0,i.useState)(!1),h=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,g=h?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",y="",v=e.providerSpecificData?.connectionProxyUrl;if(v)try{let e=new URL(v);y=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{y=v}let j=e.providerSpecificData?.connectionNoProxy||"",w=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{x(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let a=w?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[e,w]);let N="unavailable"!==e.testStatus||p?e.testStatus:"active",k=t?e.name||e.email||e.displayName||"OAuth Account":e.name;return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,disabled:a,className:`p-0.5 rounded ${a?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:t?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:k}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(n.Ex,{variant:(0,m.g)(e.isActive,N),size:"sm",dot:!0,children:!1===e.isActive?"disabled":N||"Unknown"}),h&&(0,s.jsx)(n.Ex,{variant:"success",size:"sm",children:"Proxy"}),p&&!1!==e.isActive&&(0,s.jsx)(b,{until:w}),e.lastError&&!1!==e.isActive&&(0,s.jsx)("span",{className:"text-xs text-red-500 truncate max-w-[300px]",title:e.lastError,children:e.lastError}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),h&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:g,children:g}),y&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:y}),j&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:j,children:["no_proxy: ",j]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(0,s.jsxs)("button",{onClick:c,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:u,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(n.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable":"Enable"})]})]})}function g({isOpen:e,provider:t,providerName:a,onSave:r,onClose:l}){let[o,d]=(0,i.useState)({name:"",apiKey:"",priority:1}),[c,m]=(0,i.useState)(!1),[u,p]=(0,i.useState)(null),[x,h]=(0,i.useState)(!1),b=o.name.trim().length>0,f=o.apiKey.trim().length>0,y=async()=>{let e=o.apiKey.trim();if(e){m(!0);try{let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:e})}),s=await a.json();p(s.valid?"success":"failed")}catch{p("failed")}finally{m(!1)}}},v=async()=>{let e=o.name.trim(),a=o.apiKey.trim();if(t&&e&&a){h(!0);try{let s=!1;try{m(!0),p(null);let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:a})});s=!!(await e.json()).valid,p(s?"success":"failed")}catch{p("failed")}finally{m(!1)}await r({name:e,apiKey:a,priority:o.priority,testStatus:s?"active":"unknown"})}finally{h(!1)}}};return t?(0,s.jsx)(n.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:o.name,onChange:e=>d({...o,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",autoComplete:"off",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:o.apiKey,onChange:e=>d({...o,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(n.$n,{onClick:y,disabled:!f||c||x,variant:"secondary",children:c?"Checking...":"Check"})})]}),u&&(0,s.jsx)(n.Ex,{variant:"success"===u?"success":"error",children:"success"===u?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",min:1,className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:o.priority,onChange:e=>d({...o,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:v,fullWidth:!0,disabled:!b||!f||x,children:x?"Saving...":"Save"}),(0,s.jsx)(n.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function y({providerId:e,isOAuth:t}){let[a,r]=(0,i.useState)([]),[l,o]=(0,i.useState)(!0),[d,c]=(0,i.useState)(!1),[m,u]=(0,i.useState)(!1),[p,b]=(0,i.useState)(null),[v,j]=(0,i.useState)(null),[w,N]=(0,i.useState)("1"),[k,C]=(0,i.useState)(!1),[S,$]=(0,i.useState)("30"),[F,E]=(0,i.useState)(null),R=(0,x.i)(e=>e.error),T=(0,i.useCallback)(async()=>{try{let[t,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]);if(!t.ok||!a.ok)throw Error("Failed to load connections");let s=await t.json(),l=await a.json();r((s.connections||[]).filter(t=>t.provider===e));let o=(l.providerStrategies||{})[e]||{};j(o.fallbackStrategy||null),N(null!=o.stickyRoundRobinLimit?String(o.stickyRoundRobinLimit):"1");let i=o.accountScheduler||{};C(!0===i.enabled),$(String(Math.max(1,Math.round((i.sessionAffinityTtlSeconds||1800)/60))))}catch(e){R(e?.message||"Failed to load connections")}finally{o(!1)}},[R,e]);(0,i.useEffect)(()=>{T()},[T]);let A=async(t,a)=>{try{return await (0,h.T)(e,e=>{let s={...e};return t?s.fallbackStrategy=t:delete s.fallbackStrategy,"round-robin"===t&&""!==a?s.stickyRoundRobinLimit=Number(a)||3:t||delete s.stickyRoundRobinLimit,s}),!0}catch(e){return R(e?.message||"Failed to save provider strategy"),!1}},P=async(t,a)=>{let s=Math.min(1440,Math.max(1,Number.parseInt(a,10)||30));try{return await (0,h.T)(e,e=>({...e,accountScheduler:{...e.accountScheduler||{},enabled:t,sessionAffinityTtlSeconds:60*s}})),!0}catch(e){return R(e?.message||"Failed to save balanced scheduler"),!1}},I=async e=>{await P(k,e)&&$(e)},_=async e=>{await A("round-robin",e)&&N(e)},M=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(s);try{if((await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])).some(e=>!e.ok))throw Error("Failed to reorder connections")}catch(e){R(e?.message||"Failed to reorder connections"),await T()}},O=async e=>{let t=a.find(t=>t.id===e),s=t?.name?.trim()||t?.email?.trim()||e;E({title:"Delete Connection",message:`Delete connection “${s}”?`,onConfirm:async()=>{E(null);try{let t=await fetch(`/api/providers/${e}`,{method:"DELETE"});if(!t.ok)throw Error(`Failed to delete connection (${t.status})`);r(t=>t.filter(t=>t.id!==e))}catch(e){R("Failed to delete connection")}}})},L=async(e,t)=>{try{let a=await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(!a.ok)throw Error(`Failed to toggle connection (${a.status})`);r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){R("Failed to toggle connection")}},K=async t=>{try{let a=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})});if(!a.ok)throw Error(`Failed to save API key (${a.status})`);await T(),c(!1)}catch(e){R("Failed to save API key")}},B=async e=>{try{let t=await fetch(`/api/providers/${p.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error(`Failed to update connection (${t.status})`);await T(),u(!1)}catch(e){R("Failed to update connection")}};if(l)return(0,s.jsx)(n.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})});let D=k?"balanced":"round-robin"===v?"round-robin":"fill-first",U=async e=>{"balanced"===e?await P(!0,S)&&C(!0):"round-robin"===e?(k&&(await P(!1,S),C(!1)),await A("round-robin",w||"1")&&j("round-robin")):(k&&(await P(!1,S),C(!1)),await A("fill-first","")&&j("fill-first"))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-0.5",children:["Manage accounts and selection strategy for ",e]})]}),a.length>1&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border/40 bg-surface-2/40 p-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:"font-semibold text-text-main",children:"Account Strategy"}),(0,s.jsxs)("div",{className:"inline-flex rounded-lg border border-border/60 bg-background/60 p-0.5",children:[(0,s.jsx)("button",{type:"button",onClick:()=>U("fill-first"),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-all ${"fill-first"===D?"bg-primary text-black font-semibold shadow-xs":"text-text-muted hover:text-text-main"}`,children:"Fill-First"}),(0,s.jsx)("button",{type:"button",onClick:()=>U("round-robin"),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-all ${"round-robin"===D?"bg-primary text-black font-semibold shadow-xs":"text-text-muted hover:text-text-main"}`,children:"Round Robin"}),(0,s.jsx)("button",{type:"button",onClick:()=>U("balanced"),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-all ${"balanced"===D?"bg-primary text-black font-semibold shadow-xs":"text-text-muted hover:text-text-main"}`,children:"Balanced"})]})]}),"fill-first"===D&&(0,s.jsx)("p",{className:"max-w-md text-[11px] text-text-muted",children:"Routes all requests to top-priority connection first. Spills over to subsequent accounts on rate limit (429) or quota exhaustion."}),"round-robin"===D&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{children:"Cycles evenly across accounts."}),(0,s.jsxs)("label",{className:"inline-flex items-center gap-1",children:["Sticky limit:",(0,s.jsx)("input",{type:"number",min:1,max:100,value:w,onChange:e=>_(e.target.value),className:"w-12 px-1.5 py-0.5 text-[11px] border border-border rounded bg-background focus:outline-none focus:border-primary"})]})]}),"balanced"===D&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-text-muted",children:[(0,s.jsx)("span",{children:"Least in-flight concurrency with session affinity."}),(0,s.jsxs)("label",{className:"inline-flex items-center gap-1",children:["Affinity:",(0,s.jsx)("input",{"aria-label":"Session affinity minutes",type:"number",min:1,max:1440,value:S,onChange:e=>I(e.target.value),className:"w-14 px-1.5 py-0.5 text-[11px] border border-border rounded bg-background focus:outline-none focus:border-primary"}),"min"]})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>c(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:a.map((e,r)=>(0,s.jsx)(f,{connection:e,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>M(r,r-1),onMoveDown:()=>M(r,r+1),onToggleActive:t=>L(e.id,t),onEdit:()=>{b(e),u(!0)},onDelete:()=>O(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(n.$n,{size:"sm",icon:"add",onClick:()=>c(!0),children:"Add"})})]})]}),(0,s.jsx)(g,{isOpen:d,provider:e,onSave:K,onClose:()=>c(!1)}),(0,s.jsx)(n.wI,{isOpen:m,connection:p,onSave:B,onClose:()=>u(!1)}),(0,s.jsx)(n.uo,{isOpen:!!F,onClose:()=>E(null),onConfirm:F?.onConfirm,title:F?.title||"Confirm",message:F?.message,variant:"danger"})]})}b.propTypes={until:p().string.isRequired},f.propTypes={connection:p().shape({id:p().string,name:p().string,email:p().string,displayName:p().string,testStatus:p().string,isActive:p().bool,lastError:p().string,priority:p().number}).isRequired,isOAuth:p().bool.isRequired,isFirst:p().bool.isRequired,isLast:p().bool.isRequired,onMoveUp:p().func.isRequired,onMoveDown:p().func.isRequired,onToggleActive:p().func.isRequired,onEdit:p().func.isRequired,onDelete:p().func.isRequired},g.propTypes={isOpen:p().bool.isRequired,provider:p().string,providerName:p().string,onSave:p().func.isRequired,onClose:p().func.isRequired},y.propTypes={providerId:p().string.isRequired,isOAuth:p().bool};var v=a(28777),j=a(11059),w=a(78559),N=a(48874);function k({model:e,fullModel:t,copied:a,onCopy:r,testStatus:l,isCustom:o,isFree:i,onDeleteAlias:n,onTest:d,isTesting:c}){let m="ok"===l?"#22c55e":"error"===l?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===l?"border-green-500/40":"error"===l?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===l?"check_circle":"error"===l?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:a===`model-${e.id}`?"Copied!":"Copy"})]}),i&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),o&&(0,s.jsx)("button",{onClick:n,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function C({isOpen:e,onSave:t,onClose:a}){let[r,l]=(0,i.useState)(""),o=()=>{r.trim()&&(t(r.trim()),l(""))};return(0,s.jsx)(n.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>l(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:o,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(n.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function S({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:l}=(0,j.C)(),[o,d]=(0,i.useState)({}),[m,u]=(0,i.useState)([]),[p,x]=(0,i.useState)({}),[h,b]=(0,i.useState)(null),[f,g]=(0,i.useState)(""),[y,$]=(0,i.useState)(!1),[F,E]=(0,i.useState)([]),R=a||(0,c.wG)(e),T=t||"llm",A=(0,i.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/models/alias"),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/custom",{cache:"no-store"})]),r=await t.json(),l=await a.json(),o=await s.json();t.ok&&d(r.aliases||{}),a.ok&&E((l.connections||[]).filter(t=>t.provider===e)),s.ok&&u(o.models||[])}catch(e){(0,w.s)("ModelsCard fetch error:",e)}},[e]);(0,i.useEffect)(()=>{A()},[A]);let P=async(e,t)=>{let a=`${R}/${e}`;try{await (0,N.x)("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})}),await A()}catch(e){(0,w.s)("set alias error:",e)}},I=async e=>{try{await (0,N.x)(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"}),await A()}catch(e){(0,w.s)("delete alias error:",e)}},_=async e=>{try{await (0,N.x)("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:R,id:e,type:T})}),await A(),window.dispatchEvent(new CustomEvent("customModelChanged"))}catch(e){(0,w.s)("add custom model error:",e)}},M=async e=>{try{let t=new URLSearchParams({providerAlias:R,id:e,type:T});await (0,N.x)(`/api/models/custom?${t}`,{method:"DELETE"}),await A(),window.dispatchEvent(new CustomEvent("customModelChanged"))}catch(e){(0,w.s)("delete custom model error:",e)}},O=async e=>{if(!h){b(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${R}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),g(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),g("Network error")}finally{b(null)}}},L=(0,v.KC)(e),K=t?L.filter(e=>e.kinds?e.kinds.includes(t):(0,v.CP)(e,"llm")===t):L,B=m.filter(e=>e.providerAlias===R&&(0,v.CP)(e,"llm")===T&&!K.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),f&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:f}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[K.map(e=>{let t=`${R}/${e.id}`,a=Object.entries(o).find(([,e])=>e===t)?.[0];return(0,s.jsx)(k,{model:e,fullModel:`${R}/${e.id}`,alias:a,copied:r,onCopy:l,onSetAlias:t=>P(e.id,t),onDeleteAlias:()=>I(a),testStatus:p[e.id],onTest:F.length>0?()=>O(e.id):void 0,isTesting:h===e.id,isFree:e.isFree},e.id)}),B.map(e=>(0,s.jsx)(k,{model:{id:e.id,name:e.name},fullModel:`${R}/${e.id}`,copied:r,onCopy:l,onSetAlias:()=>{},onDeleteAlias:()=>M(e.id),testStatus:p[e.id],onTest:F.length>0?()=>O(e.id):void 0,isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>$(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(C,{isOpen:y,onSave:async e=>{await _(e),$(!1)},onClose:()=>$(!1)})]})}function $({label:e,htmlFor:t,children:a}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)(t?"label":"span",{htmlFor:t,className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:a})]})}k.propTypes={model:p().shape({id:p().string.isRequired}).isRequired,fullModel:p().string.isRequired,copied:p().string,onCopy:p().func.isRequired,testStatus:p().oneOf(["ok","error"]),isCustom:p().bool,isFree:p().bool,onDeleteAlias:p().func,onTest:p().func,isTesting:p().bool},C.propTypes={isOpen:p().bool.isRequired,onSave:p().func.isRequired,onClose:p().func.isRequired},S.propTypes={providerId:p().string.isRequired,kindFilter:p().string,providerAliasOverride:p().string};let F={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
|
|
2
2
|
"results": [
|
|
3
3
|
{ "title": "...", "url": "...", "snippet": "..." }
|
|
4
4
|
]
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"data": [
|
|
22
22
|
{ "url": "...", "format": "mp3" }
|
|
23
23
|
]
|
|
24
|
-
}`}},
|
|
24
|
+
}`}},E=`{
|
|
25
25
|
"object": "list",
|
|
26
26
|
"data": [{
|
|
27
27
|
"object": "embedding",
|
|
@@ -30,30 +30,30 @@
|
|
|
30
30
|
}],
|
|
31
31
|
"model": "...",
|
|
32
32
|
"usage": { "prompt_tokens": 9, "total_tokens": 9 }
|
|
33
|
-
}`;function
|
|
33
|
+
}`;function R({providerId:e,customAlias:t}){let a=(0,c.gC)(e),r=a?t||e:(0,c.wG)(e),l=a?[]:(0,v.KC)(e).filter(e=>"embedding"===(0,v.CP)(e)),[o,d]=(0,i.useState)(l[0]?.id??""),[m,u]=(0,i.useState)("The quick brown fox jumps over the lazy dog"),[p,x]=(0,i.useState)(""),[h,b]=(0,i.useState)(""),[f,g]=(0,i.useState)(""),[y,w]=(0,i.useState)(null),[N,k]=(0,i.useState)(!1),[C,S]=(0,i.useState)(""),{copied:F,copy:T}=(0,j.C)(),{copied:A,copy:P}=(0,j.C)();(0,i.useEffect)(()=>{g(window.location.origin)},[]);let I=o?`${r}/${o}`:"",_=()=>{let e={model:I,input:m.trim()},t=Number(p);return p&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},M=`curl -X POST ${f}/v1/embeddings \\
|
|
34
34
|
-H "Content-Type: application/json" \\
|
|
35
35
|
-H "Authorization: Bearer ${h||"YOUR_KEY"}" \\
|
|
36
|
-
-d '${JSON.stringify(_())}'`,O=async()=>{if(!m.trim()||!I||!h.trim())return;k(!0)
|
|
36
|
+
-d '${JSON.stringify(_())}'`,O=async()=>{if(!m.trim()||!I||!h.trim())return;k(!0),S(""),w(null);let e=Date.now();try{let t={"Content-Type":"application/json"};h&&(t.Authorization=`Bearer ${h}`);let a=await fetch("/api/v1/embeddings",{method:"POST",headers:t,body:JSON.stringify(_())}),s=Date.now()-e,r=await a.json();if(!a.ok)return void S(r?.error?.message||r?.error||`HTTP ${a.status}`);w({data:r,latencyMs:s})}catch(e){S(e.message||"Network error")}finally{k(!1)}},L=y?JSON.stringify(y.data,null,2):"";return(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)($,{label:"Model",htmlFor:"embedding-example-model",children:a?(0,s.jsx)("input",{id:"embedding-example-model",value:o,onChange:e=>d(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}):(0,s.jsx)("select",{id:"embedding-example-model",value:o,onChange:e=>d(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:l.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)($,{label:"Endpoint",htmlFor:"embedding-example-endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsx)("input",{id:"embedding-example-endpoint",value:f,onChange:e=>g(e.target.value),className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono",placeholder:"http://localhost:3000"})})}),(0,s.jsx)($,{label:"API Key",htmlFor:"embedding-example-key",children:(0,s.jsx)("input",{id:"embedding-example-key",type:"password",autoComplete:"off",value:h,onChange:e=>b(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)($,{label:"Input",htmlFor:"embedding-example-input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"embedding-example-input",value:m,onChange:e=>u(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),m&&(0,s.jsx)("button",{type:"button",onClick:()=>u(""),"aria-label":"Clear input",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})}),(0,s.jsx)($,{label:"Dimensions",htmlFor:"embedding-example-dimensions",children:(0,s.jsx)("input",{id:"embedding-example-dimensions",type:"number",min:"1",value:p,onChange:e=>x(e.target.value),placeholder:"optional, e.g. 512, 1024 (leave empty for default)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>T(M),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:F?"check":"content_copy"}),F?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:O,disabled:N||!m.trim()||!I||!h.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:N?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),N?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:M})]}),C&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:C}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",y&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",y.latencyMs,"ms"]})]}),y&&(0,s.jsxs)("button",{onClick:()=>P(L),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:A?"check":"content_copy"}),A?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:(e=>{if(!e)return E;let t=JSON.parse(JSON.stringify(e));return(t.data||[]).forEach(e=>{Array.isArray(e.embedding)&&e.embedding.length>4&&(e.embedding=[...e.embedding.slice(0,4).map(e=>parseFloat(e.toFixed(6))),`... (${e.embedding.length} dims)`])}),JSON.stringify(t,null,2)})(y?.data)})]})]})]})}let T={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0}};var A=a(63935),P=a(14683);let I=`// Audio will appear here after running.
|
|
37
37
|
// Example JSON response (response_format=json):
|
|
38
38
|
{
|
|
39
39
|
"format": "mp3",
|
|
40
40
|
"audio": "//NExAANaAIIAUAAANNNNNNNN..." // base64 encoded MP3
|
|
41
|
-
}`;function
|
|
41
|
+
}`;function _({providerId:e}){let t,a,r=(0,c.wG)(e),l=T[e]||T["edge-tts"],[o,d]=(0,i.useState)(l.defaultVoiceId||""),[m,u]=(0,i.useState)(""),[p,x]=(0,i.useState)(l.defaultVoiceId||""),[h,b]=(0,i.useState)([]),[f,g]=(0,i.useState)(""),[y,w]=(0,i.useState)(()=>{let t=c.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(l.hasModelSelector&&l.modelKey){let e=(0,v.KC)(l.modelKey);return e?.[0]?.id||""}return""}),[N,k]=(0,i.useState)("Hello, this is a text to speech test."),[C,S]=(0,i.useState)(""),[F,E]=(0,i.useState)(""),[R,M]=(0,i.useState)("mp3"),[O,L]=(0,i.useState)(""),[K,B]=(0,i.useState)(null),[D,U]=(0,i.useState)(!1),[q,z]=(0,i.useState)(""),[J,V]=(0,i.useState)(null),{copied:H,copy:W}=(0,j.C)(),[G,Y]=(0,i.useState)(!1),[Z,Q]=(0,i.useState)([]),[X,ee]=(0,i.useState)(!1),[et,ea]=(0,i.useState)(""),[es,er]=(0,i.useState)(""),[el,eo]=(0,i.useState)({}),[ei,en]=(0,i.useState)("");(0,i.useEffect)(()=>{if(E(window.location.origin),"hardcoded"===l.voiceSource){let t=l.hasModelSelector&&l.modelKey&&(0,v.KC)(l.modelKey)?.[0]?.id||"",a=l.voicesPerModel&&t?(0,A.jY)(e,t)||[]:(0,v.KC)(l.voiceKey||e).filter(e=>"tts"===(0,v.CP)(e));if(a.length)if(l.hasBrowseButton){let e=a.find(e=>"en"===e.id)||a[0];g(e.id),d(e.id),u(e.name),b([{id:e.id,name:e.name}])}else b(a),d(a[0].id),u(a[0].name||a[0].id)}},[l.hasBrowseButton,l.hasModelSelector,l.modelKey,l.voiceKey,l.voiceSource,l.voicesPerModel,e]),(0,i.useEffect)(()=>{if(!l.voicesPerModel||!y)return;let t=(0,A.jY)(e,y)||[];b(t),t.length&&(d(t[0].id),u(t[0].name||t[0].id))},[l.voicesPerModel,e,y]);let ed=async()=>{if(Y(!0),ea(""),er(""),!Z.length){ee(!0);try{if("hardcoded"===l.voiceSource){let t=l.voiceKey||e,a=(0,v.KC)(t).filter(e=>"tts"===(0,v.CP)(e)),s={};for(let e of a)s[e.id]||(s[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});eo(s),Q(Object.values(s).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=l.apiEndpoint?l.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,a=await fetch(t),s=await a.json();if(s.error)return void er(s.error);Q(s.languages||[]),eo(s.byLang||{})}}catch(e){er(e.message)}finally{ee(!1)}}},ec=et?Z.filter(e=>e.name.toLowerCase().includes(et.toLowerCase())||e.code.toLowerCase().includes(et.toLowerCase())):Z,em=l.hasVoiceIdInput&&p||o,eu=l.hasModelSelector&&y&&em?`${r}/${y}/${em}`:l.hasModelSelector&&y?`${r}/${y}`:em?`${r}/${em}`:"",ep=(t={model:eu,input:N},l.hasLanguageHint&&ei&&(t.language=ei),t),ex=`curl -X POST ${F}/v1/audio/speech${"json"===R?"?response_format=json":""} \\
|
|
42
42
|
-H "Content-Type: application/json" \\
|
|
43
43
|
-H "Authorization: Bearer ${C||"YOUR_KEY"}" \\
|
|
44
44
|
-d '${JSON.stringify(ep)}' \\
|
|
45
|
-
${"json"===_?"":"--output speech.mp3"}`,eh=async()=>{if(!N.trim()||!eu||!C.trim())return;U(!0),z(""),L(""),B(null);let e=Date.now();try{let t={"Content-Type":"application/json"};C&&(t.Authorization=`Bearer ${C}`);let a=`/api/v1/audio/speech${"json"===_?"?response_format=json":""}`,s=await fetch(a,{method:"POST",headers:t,body:JSON.stringify({...ep,input:N.trim()})});if(V(Date.now()-e),!s.ok){let e=await s.json().catch(()=>({}));z(e?.error?.message||e?.error||`HTTP ${s.status}`);return}if("json"===_){let e=await s.json();B(e);let t=await fetch(`data:audio/mp3;base64,${e.audio}`).then(e=>e.blob());L(URL.createObjectURL(t))}else{let e=await s.blob();L(URL.createObjectURL(e))}}catch(e){z(e.message||"Network error")}finally{U(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(S,{label:"Endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[F,"/v1/audio/speech"]})})}),(0,s.jsx)(S,{label:"API Key",htmlFor:"tts-example-key",children:(0,s.jsx)("input",{id:"tts-example-key",type:"password",autoComplete:"off",value:C,onChange:e=>$(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),l.hasModelSelector&&(l.modelKey||(0,v.KC)(e).some(e=>"tts"===(0,v.CP)(e)))&&(0,s.jsx)(S,{label:"Model",htmlFor:"tts-example-model",children:(0,s.jsx)("select",{id:"tts-example-model",value:y,onChange:e=>w(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((a=(0,v.KC)(e).filter(e=>"tts"===(0,v.CP)(e))).length?a:(0,v.KC)(l.modelKey)||[]).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),l.hasLanguageHint&&(0,s.jsx)(S,{label:"Language",htmlFor:"tts-example-language-hint",children:(0,s.jsxs)("select",{id:"tts-example-language-hint",value:ei,onChange:e=>en(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto-detect"}),R.I.map(e=>(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})}),l.hasBrowseButton&&(0,s.jsx)(S,{label:"Language",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("button",{onClick:ed,"aria-haspopup":"dialog","aria-expanded":G,"aria-label":f?`Language: ${Z.find(e=>e.code===f)?.name||f}. Change language`:"Select language",className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:f?(0,s.jsx)("span",{className:"text-text-main",children:Z.find(e=>e.code===f)?.name||f}):(0,s.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,s.jsxs)("button",{onClick:ed,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),h.length>0&&(0,s.jsx)(S,{label:"Voice",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("button",{onClick:()=>{d(e.id),u(e.name),l.hasVoiceIdInput&&x(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${o===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),l.hasVoiceIdInput&&(0,s.jsx)(S,{label:"Voice ID",htmlFor:"tts-example-voice-id",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"tts-example-voice-id",value:p,onChange:e=>{x(e.target.value),d(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),p&&(0,s.jsx)("button",{type:"button",onClick:()=>{x(""),d("")},"aria-label":"Clear voice ID",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})})}),l.hasLanguageDropdown&&(0,s.jsx)(S,{label:"Language",htmlFor:"tts-example-language",children:(0,s.jsx)("select",{id:"tts-example-language",value:o,onChange:t=>{let a=(0,v.KC)(e).filter(e=>"tts"===(0,v.CP)(e)).find(e=>e.id===t.target.value);d(t.target.value),u(a?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,v.KC)(e).filter(e=>"tts"===(0,v.CP)(e)).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(S,{label:"Input",htmlFor:"tts-example-input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"tts-example-input",value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),N&&(0,s.jsx)("button",{type:"button",onClick:()=>k(""),"aria-label":"Clear input",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})}),(0,s.jsx)(S,{label:"Output Format",htmlFor:"tts-example-format",children:(0,s.jsxs)("select",{id:"tts-example-format",value:_,onChange:e=>M(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>W(ex),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:H?"check":"content_copy"}),H?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:eh,disabled:D||!N.trim()||!eu||!C.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:D?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),D?"Generating...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ex})]}),q&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:q}),O?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",J&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",J,"ms"]})]}),(0,s.jsxs)("a",{href:O,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,s.jsx)("audio",{controls:!0,src:O,className:"w-full"}),K&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:K.format,audio:K.audio?`${K.audio.substring(0,100)}...`:""},null,2)})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,s.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:P})]})]})]}),G&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>Y(!1),onKeyDown:e=>{"Escape"===e.key&&Y(!1)},children:(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"tts-language-modal-title",className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,s.jsx)("h3",{id:"tts-language-modal-title",className:"text-sm font-semibold","data-i18n":"Select Language",children:"Select Language"}),(0,s.jsx)("button",{onClick:()=>Y(!1),"aria-label":"Close language picker",className:"text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"close"})})]}),(0,s.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,s.jsx)("input",{autoFocus:!0,type:"text","aria-label":"Search language",value:et,onChange:e=>ea(e.target.value),placeholder:"Search language...","data-i18n-placeholder":"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[es&&(0,s.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:es}),X?(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[ec.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t;return Y(!1),g(e.code),void(b(t=el[e.code]?.voices||[]),t.length&&(d(t[0].id),u(t[0].name),l.hasVoiceIdInput&&x(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${f===e.code?"bg-primary/10 text-primary":""}`,children:[(0,s.jsx)("span",{className:"text-sm",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),f===e.code&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===ec.length&&(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}var _=a(5772);let M="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png";function O(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function L({providerId:e,kind:t}){let a=(0,c.wG)(e),r=(0,c.rs)(a)===e?a:e,l=c.rj.find(e=>e.id===t),o=$[t],d=o||{},m=(0,v.KC)(e).filter(e=>(0,v.CP)(e)===t),u=new Set(["image","video","music","imageToText"]).has(t),p=u&&0===m.length,[x,h]=(0,i.useState)(m[0]?.id??""),b=m.find(e=>e.id===x),f=!!b?.capabilities?.includes("edit"),g=!!b?.capabilities?.includes("mask"),[y,w]=(0,i.useState)(d.defaultInput||""),[N,k]=(0,i.useState)(""),[C,F]=(0,i.useState)(""),[E,A]=(0,i.useState)(()=>(d.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[T,R]=(0,i.useState)(""),[P,I]=(0,i.useState)(""),[K,B]=(0,i.useState)(null),[D,U]=(0,i.useState)(null),[q,z]=(0,i.useState)(null),[J,V]=(0,i.useState)("json"),[H,W]=(0,i.useState)(""),[G,Y]=(0,i.useState)(!1),[Z,Q]=(0,i.useState)(""),[X,ee]=(0,i.useState)([]),[et,ea]=(0,i.useState)(""),{copied:es,copy:er}=(0,j.C)(),{copied:el,copy:eo}=(0,j.C)();if((0,i.useEffect)(()=>{I(window.location.origin),fetch("/api/providers/client").then(e=>e.json()).then(t=>{ee((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!l||!o)return null;let ei=l.endpoint.path,en=u?x?`${r}/${x}`:p?"":r:r,ed="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===x?{image:M}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===x?{image:M,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ec=N.trim()||ed.image||"",em=C.trim()||ed.mask_image||"",eu=O(ec),ep=O(em),ex=Object.entries(E).reduce((e,[t,a])=>(""===a||null==a||"number"==typeof a&&Number.isNaN(a)||(e[t]=a),e),{}),eh={model:en,[o.bodyKey]:y,...o.extraBody,...ex,...f&&ec?{image:ec}:{},...g&&em?{mask_image:em}:{}},eb="image"===t&&"binary"===J,ef="image"===t&&"codex"===e&&!eb,eg=`${ei}${eb?"?response_format=binary":""}`,ey=`-H "Content-Type: application/json" \\
|
|
45
|
+
${"json"===R?"":"--output speech.mp3"}`,eh=async()=>{if(!N.trim()||!eu||!C.trim())return;U(!0),z(""),L(""),B(null);let e=Date.now();try{let t={"Content-Type":"application/json"};C&&(t.Authorization=`Bearer ${C}`);let a=`/api/v1/audio/speech${"json"===R?"?response_format=json":""}`,s=await fetch(a,{method:"POST",headers:t,body:JSON.stringify({...ep,input:N.trim()})});if(V(Date.now()-e),!s.ok){let e=await s.json().catch(()=>({}));z(e?.error?.message||e?.error||`HTTP ${s.status}`);return}if("json"===R){let e=await s.json();B(e);let t=await fetch(`data:audio/mp3;base64,${e.audio}`).then(e=>e.blob());L(URL.createObjectURL(t))}else{let e=await s.blob();L(URL.createObjectURL(e))}}catch(e){z(e.message||"Network error")}finally{U(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[F,"/v1/audio/speech"]})})}),(0,s.jsx)($,{label:"API Key",htmlFor:"tts-example-key",children:(0,s.jsx)("input",{id:"tts-example-key",type:"password",autoComplete:"off",value:C,onChange:e=>S(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),l.hasModelSelector&&(l.modelKey||(0,v.KC)(e).some(e=>"tts"===(0,v.CP)(e)))&&(0,s.jsx)($,{label:"Model",htmlFor:"tts-example-model",children:(0,s.jsx)("select",{id:"tts-example-model",value:y,onChange:e=>w(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((a=(0,v.KC)(e).filter(e=>"tts"===(0,v.CP)(e))).length?a:(0,v.KC)(l.modelKey)||[]).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),l.hasLanguageHint&&(0,s.jsx)($,{label:"Language",htmlFor:"tts-example-language-hint",children:(0,s.jsxs)("select",{id:"tts-example-language-hint",value:ei,onChange:e=>en(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto-detect"}),P.I.map(e=>(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})}),l.hasBrowseButton&&(0,s.jsx)($,{label:"Language",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("button",{onClick:ed,"aria-haspopup":"dialog","aria-expanded":G,"aria-label":f?`Language: ${Z.find(e=>e.code===f)?.name||f}. Change language`:"Select language",className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:f?(0,s.jsx)("span",{className:"text-text-main",children:Z.find(e=>e.code===f)?.name||f}):(0,s.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,s.jsxs)("button",{onClick:ed,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),h.length>0&&(0,s.jsx)($,{label:"Voice",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("button",{onClick:()=>{d(e.id),u(e.name),l.hasVoiceIdInput&&x(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${o===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),l.hasVoiceIdInput&&(0,s.jsx)($,{label:"Voice ID",htmlFor:"tts-example-voice-id",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"tts-example-voice-id",value:p,onChange:e=>{x(e.target.value),d(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),p&&(0,s.jsx)("button",{type:"button",onClick:()=>{x(""),d("")},"aria-label":"Clear voice ID",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})})}),l.hasLanguageDropdown&&(0,s.jsx)($,{label:"Language",htmlFor:"tts-example-language",children:(0,s.jsx)("select",{id:"tts-example-language",value:o,onChange:t=>{let a=(0,v.KC)(e).filter(e=>"tts"===(0,v.CP)(e)).find(e=>e.id===t.target.value);d(t.target.value),u(a?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,v.KC)(e).filter(e=>"tts"===(0,v.CP)(e)).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)($,{label:"Input",htmlFor:"tts-example-input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"tts-example-input",value:N,onChange:e=>k(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),N&&(0,s.jsx)("button",{type:"button",onClick:()=>k(""),"aria-label":"Clear input",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})}),(0,s.jsx)($,{label:"Output Format",htmlFor:"tts-example-format",children:(0,s.jsxs)("select",{id:"tts-example-format",value:R,onChange:e=>M(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>W(ex),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:H?"check":"content_copy"}),H?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:eh,disabled:D||!N.trim()||!eu||!C.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:D?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),D?"Generating...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ex})]}),q&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:q}),O?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",J&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",J,"ms"]})]}),(0,s.jsxs)("a",{href:O,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,s.jsx)("audio",{controls:!0,src:O,className:"w-full"}),K&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:K.format,audio:K.audio?`${K.audio.substring(0,100)}...`:""},null,2)})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,s.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:I})]})]})]}),G&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>Y(!1),onKeyDown:e=>{"Escape"===e.key&&Y(!1)},children:(0,s.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"tts-language-modal-title",className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,s.jsx)("h3",{id:"tts-language-modal-title",className:"text-sm font-semibold","data-i18n":"Select Language",children:"Select Language"}),(0,s.jsx)("button",{onClick:()=>Y(!1),"aria-label":"Close language picker",className:"text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]","aria-hidden":"true",children:"close"})})]}),(0,s.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,s.jsx)("input",{autoFocus:!0,type:"text","aria-label":"Search language",value:et,onChange:e=>ea(e.target.value),placeholder:"Search language...","data-i18n-placeholder":"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[es&&(0,s.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:es}),X?(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[ec.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t;return Y(!1),g(e.code),void(b(t=el[e.code]?.voices||[]),t.length&&(d(t[0].id),u(t[0].name),l.hasVoiceIdInput&&x(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${f===e.code?"bg-primary/10 text-primary":""}`,children:[(0,s.jsx)("span",{className:"text-sm",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),f===e.code&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===ec.length&&(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}var M=a(5772);let O="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png";function L(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function K({providerId:e,kind:t}){let a=(0,c.wG)(e),r=(0,c.rs)(a)===e?a:e,l=c.rj.find(e=>e.id===t),o=F[t],d=o||{},m=(0,v.KC)(e).filter(e=>(0,v.CP)(e)===t),u=new Set(["image","video","music","imageToText"]).has(t),p=u&&0===m.length,[x,h]=(0,i.useState)(m[0]?.id??""),b=m.find(e=>e.id===x),f=!!b?.capabilities?.includes("edit"),g=!!b?.capabilities?.includes("mask"),[y,w]=(0,i.useState)(d.defaultInput||""),[N,k]=(0,i.useState)(""),[C,S]=(0,i.useState)(""),[E,R]=(0,i.useState)(()=>(d.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[T,A]=(0,i.useState)(""),[P,I]=(0,i.useState)(""),[_,B]=(0,i.useState)(null),[D,U]=(0,i.useState)(null),[q,z]=(0,i.useState)(null),[J,V]=(0,i.useState)("json"),[H,W]=(0,i.useState)(""),[G,Y]=(0,i.useState)(!1),[Z,Q]=(0,i.useState)(""),[X,ee]=(0,i.useState)([]),[et,ea]=(0,i.useState)(""),{copied:es,copy:er}=(0,j.C)(),{copied:el,copy:eo}=(0,j.C)();if((0,i.useEffect)(()=>{I(window.location.origin),fetch("/api/providers/client").then(e=>e.json()).then(t=>{ee((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!l||!o)return null;let ei=l.endpoint.path,en=u?x?`${r}/${x}`:p?"":r:r,ed="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===x?{image:O}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===x?{image:O,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ec=N.trim()||ed.image||"",em=C.trim()||ed.mask_image||"",eu=L(ec),ep=L(em),ex=Object.entries(E).reduce((e,[t,a])=>(""===a||null==a||"number"==typeof a&&Number.isNaN(a)||(e[t]=a),e),{}),eh={model:en,[o.bodyKey]:y,...o.extraBody,...ex,...f&&ec?{image:ec}:{},...g&&em?{mask_image:em}:{}},eb="image"===t&&"binary"===J,ef="image"===t&&"codex"===e&&!eb,eg=`${ei}${eb?"?response_format=binary":""}`,ey=`-H "Content-Type: application/json" \\
|
|
46
46
|
-H "Authorization: Bearer ${T||"YOUR_KEY"}"${et?` \\
|
|
47
47
|
-H "x-connection-id: ${et}"`:""}${ef?` \\
|
|
48
48
|
-H "Accept: text/event-stream"`:""}`,ev=`curl -X ${l.endpoint.method} ${P}${eg} \\
|
|
49
49
|
${ey.replace(/\\\n /g,"\\\n ")} \\
|
|
50
|
-
-d '${JSON.stringify(eh)}'${eb?" \\\n --output image.png":""}`,ej=async()=>{if(!y.trim()||!en||!T.trim())return;if(Y(!0),Q(""),B(null),U(null),z(null),H){try{URL.revokeObjectURL(H)}catch{}W("")}let e=Date.now();try{let t={"Content-Type":"application/json"};T&&(t.Authorization=`Bearer ${T}`),et&&(t["x-connection-id"]=et),ef&&(t.Accept="text/event-stream");let a={...eh,model:en},s=await fetch(`/api${eg}`,{method:l.endpoint.method,headers:t,body:JSON.stringify(a)});if(!s.ok){let e=await s.json().catch(()=>({}));Q(e?.error?.message||e?.error||`HTTP ${s.status}`);return}let r=s.headers.get("content-type")||"";if(r.startsWith("image/")){let t=await s.blob(),a=URL.createObjectURL(t);W(a),B({data:{binary:!0,mime:r,size:t.size},latencyMs:Date.now()-e});return}if(r.includes("text/event-stream")&&s.body){let t=s.body.getReader(),a=new TextDecoder,r="",l=null,o=null;for(;;){let e,{done:s,value:i}=await t.read();if(s)break;for(r+=a.decode(i,{stream:!0});-1!==(e=r.indexOf("\n\n"));){let t=r.slice(0,e);r=r.slice(e+2);let a=null,s="";for(let e of t.split("\n"))e.startsWith("event:")?a=e.slice(6).trim():e.startsWith("data:")&&(s+=e.slice(5).trim());if(a)try{let e=s?JSON.parse(s):{};"progress"===a?U(e):"partial_image"===a?z(e):"done"===a?l=e:"error"===a&&(o=e?.message||"Stream error")}catch{}}}let i=Date.now()-e;if(o)return void Q(o);l&&B({data:l,latencyMs:i})}else{let t=await s.json(),a=Date.now()-e;B({data:t,latencyMs:a})}}catch(e){Q(e.message||"Network error")}finally{Y(!1)}},ew=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ew);let t={};for(let[a,s]of Object.entries(e))t[a]="b64_json"===a&&"string"==typeof s&&s.length>100?`<${s.length} chars base64>`:ew(s);return t},eN=K?JSON.stringify(ew(K.data),null,2):"";return(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[m.length>0?(0,s.jsx)(S,{label:"Model",htmlFor:"generic-example-model",children:(0,s.jsx)("select",{id:"generic-example-model",value:x,onChange:e=>h(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:m.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):p?(0,s.jsx)(S,{label:"Model",htmlFor:"generic-example-model",children:(0,s.jsx)("input",{id:"generic-example-model",value:x,onChange:e=>h(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,s.jsx)(S,{label:"Endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[P,ei]})})}),(0,s.jsx)(S,{label:"API Key",htmlFor:"generic-example-key",children:(0,s.jsx)("input",{id:"generic-example-key",type:"password",autoComplete:"off",value:T,onChange:e=>R(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),X.length>0&&(0,s.jsx)(S,{label:"Connection",htmlFor:"generic-example-connection",children:(0,s.jsxs)("select",{id:"generic-example-connection",value:et,onChange:e=>ea(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto (by priority)"}),X.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,a=e.email||e.name||e.id.slice(0,8);return(0,s.jsxs)("option",{value:e.id,children:[a,t?` [${t}]`:""]},e.id)})]})}),(0,s.jsx)(S,{label:o.inputLabel,htmlFor:"generic-example-input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"generic-example-input",value:y,onChange:e=>w(e.target.value),placeholder:o.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),y&&(0,s.jsx)("button",{type:"button",onClick:()=>w(""),"aria-label":`Clear ${o.inputLabel.toLowerCase()}`,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})}),f&&(0,s.jsx)(S,{label:"Ref Image (URL)",htmlFor:"generic-example-ref-image",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"generic-example-ref-image",value:N,onChange:e=>k(e.target.value),placeholder:ed.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),N&&(0,s.jsx)("button",{type:"button",onClick:()=>k(""),"aria-label":"Clear reference image URL",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]}),eu&&(0,s.jsx)(_.default,{src:eu,alt:"Reference",width:640,height:320,unoptimized:!0,className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),g&&(0,s.jsx)(S,{label:"Mask (URL)",htmlFor:"generic-example-mask",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"generic-example-mask",value:C,onChange:e=>F(e.target.value),placeholder:ed.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>F(""),"aria-label":"Clear mask image URL",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]}),ep&&(0,s.jsx)(_.default,{src:ep,alt:"Mask",width:640,height:320,unoptimized:!0,className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),(o.extraFields||[]).filter(e=>0===m.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,s.jsx)(S,{label:e.label,htmlFor:`generic-example-${e.key}`,children:"select"===e.type?(0,s.jsx)("select",{id:`generic-example-${e.key}`,value:E[e.key]??"",onChange:t=>A(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,s.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,s.jsx)("input",{id:`generic-example-${e.key}`,type:"text",value:E[e.key]??"",placeholder:e.placeholder,onChange:t=>A(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,s.jsx)("input",{id:`generic-example-${e.key}`,type:"number",value:E[e.key]??"",min:e.min,max:e.max,onChange:t=>A(a=>({...a,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,s.jsx)(S,{label:"Output Format",htmlFor:"generic-example-output-format",children:(0,s.jsxs)("select",{id:"generic-example-output-format",value:J,onChange:e=>V(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,s.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>er(ev),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:es?"check":"content_copy"}),es?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:ej,disabled:G||!y.trim()||!en||!T.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:G?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),G?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ev})]}),(G||D)&&ef&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:G?{animation:"spin 1s linear infinite"}:void 0,children:G?"progress_activity":"check_circle"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[D?.stage||"starting",!G&&D?.bytesReceived?` \xb7 ${(D.bytesReceived/1024).toFixed(1)} KB`:""]})]}),q?.b64_json&&!K&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,s.jsx)(_.default,{src:`data:image/png;base64,${q.b64_json}`,alt:"Partial",width:1024,height:1024,unoptimized:!0,className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80"})]}),Z&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:Z}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",K&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",K.latencyMs,"ms"]})]}),K&&(0,s.jsxs)("button",{onClick:()=>eo(eN),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:el?"check":"content_copy"}),el?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:K?eN:o.defaultResponse}),"image"===t&&(H||K?.data?.data?.[0])&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:H||(K?.data?.data?.[0]?.b64_json?`data:image/png;base64,${K.data.data[0].b64_json}`:K?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)(_.default,{src:H||(K?.data?.data?.[0]?.b64_json?`data:image/png;base64,${K.data.data[0].b64_json}`:K?.data?.data?.[0]?.url),alt:"Generated",width:1024,height:1024,unoptimized:!0,className:"max-w-full rounded-lg border border-border"})]})]})]})]})}function K({providerId:e}){let t=(0,c.wG)(e),a=(0,v.KC)(e).filter(e=>"stt"===(0,v.CP)(e)),[r,l]=(0,i.useState)([]),o=[...a,...r],[d,m]=(0,i.useState)(a[0]?.id??""),u=o.find(e=>e.id===d),p=Array.isArray(u?.params)?u.params:[],[x,h]=(0,i.useState)(null),[b,f]=(0,i.useState)(""),[g,y]=(0,i.useState)(""),[w,N]=(0,i.useState)("json"),[k,C]=(0,i.useState)(""),[$,F]=(0,i.useState)(""),[E,A]=(0,i.useState)(""),[T,R]=(0,i.useState)(null),[P,I]=(0,i.useState)(null),[_,M]=(0,i.useState)(!1),[O,L]=(0,i.useState)(""),{copied:B,copy:D}=(0,j.C)(),{copied:U,copy:q}=(0,j.C)();(0,i.useEffect)(()=>{A(window.location.origin);let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{l((e.models||[]).filter(e=>"stt"===(0,v.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let z=d?`${t}/${d}`:"",J=`curl -X POST ${E}/v1/audio/transcriptions \\
|
|
51
|
-
-H "Authorization: Bearer ${
|
|
50
|
+
-d '${JSON.stringify(eh)}'${eb?" \\\n --output image.png":""}`,ej=async()=>{if(!y.trim()||!en||!T.trim())return;if(Y(!0),Q(""),B(null),U(null),z(null),H){try{URL.revokeObjectURL(H)}catch{}W("")}let e=Date.now();try{let t={"Content-Type":"application/json"};T&&(t.Authorization=`Bearer ${T}`),et&&(t["x-connection-id"]=et),ef&&(t.Accept="text/event-stream");let a={...eh,model:en},s=await fetch(`/api${eg}`,{method:l.endpoint.method,headers:t,body:JSON.stringify(a)});if(!s.ok){let e=await s.json().catch(()=>({}));Q(e?.error?.message||e?.error||`HTTP ${s.status}`);return}let r=s.headers.get("content-type")||"";if(r.startsWith("image/")){let t=await s.blob(),a=URL.createObjectURL(t);W(a),B({data:{binary:!0,mime:r,size:t.size},latencyMs:Date.now()-e});return}if(r.includes("text/event-stream")&&s.body){let t=s.body.getReader(),a=new TextDecoder,r="",l=null,o=null;for(;;){let e,{done:s,value:i}=await t.read();if(s)break;for(r+=a.decode(i,{stream:!0});-1!==(e=r.indexOf("\n\n"));){let t=r.slice(0,e);r=r.slice(e+2);let a=null,s="";for(let e of t.split("\n"))e.startsWith("event:")?a=e.slice(6).trim():e.startsWith("data:")&&(s+=e.slice(5).trim());if(a)try{let e=s?JSON.parse(s):{};"progress"===a?U(e):"partial_image"===a?z(e):"done"===a?l=e:"error"===a&&(o=e?.message||"Stream error")}catch{}}}let i=Date.now()-e;if(o)return void Q(o);l&&B({data:l,latencyMs:i})}else{let t=await s.json(),a=Date.now()-e;B({data:t,latencyMs:a})}}catch(e){Q(e.message||"Network error")}finally{Y(!1)}},ew=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ew);let t={};for(let[a,s]of Object.entries(e))t[a]="b64_json"===a&&"string"==typeof s&&s.length>100?`<${s.length} chars base64>`:ew(s);return t},eN=_?JSON.stringify(ew(_.data),null,2):"";return(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[m.length>0?(0,s.jsx)($,{label:"Model",htmlFor:"generic-example-model",children:(0,s.jsx)("select",{id:"generic-example-model",value:x,onChange:e=>h(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:m.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):p?(0,s.jsx)($,{label:"Model",htmlFor:"generic-example-model",children:(0,s.jsx)("input",{id:"generic-example-model",value:x,onChange:e=>h(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[P,ei]})})}),(0,s.jsx)($,{label:"API Key",htmlFor:"generic-example-key",children:(0,s.jsx)("input",{id:"generic-example-key",type:"password",autoComplete:"off",value:T,onChange:e=>A(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),X.length>0&&(0,s.jsx)($,{label:"Connection",htmlFor:"generic-example-connection",children:(0,s.jsxs)("select",{id:"generic-example-connection",value:et,onChange:e=>ea(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto (by priority)"}),X.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,a=e.email||e.name||e.id.slice(0,8);return(0,s.jsxs)("option",{value:e.id,children:[a,t?` [${t}]`:""]},e.id)})]})}),(0,s.jsx)($,{label:o.inputLabel,htmlFor:"generic-example-input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"generic-example-input",value:y,onChange:e=>w(e.target.value),placeholder:o.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),y&&(0,s.jsx)("button",{type:"button",onClick:()=>w(""),"aria-label":`Clear ${o.inputLabel.toLowerCase()}`,className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]})}),f&&(0,s.jsx)($,{label:"Ref Image (URL)",htmlFor:"generic-example-ref-image",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"generic-example-ref-image",value:N,onChange:e=>k(e.target.value),placeholder:ed.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),N&&(0,s.jsx)("button",{type:"button",onClick:()=>k(""),"aria-label":"Clear reference image URL",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]}),eu&&(0,s.jsx)(M.default,{src:eu,alt:"Reference",width:640,height:320,unoptimized:!0,className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),g&&(0,s.jsx)($,{label:"Mask (URL)",htmlFor:"generic-example-mask",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{id:"generic-example-mask",value:C,onChange:e=>S(e.target.value),placeholder:ed.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>S(""),"aria-label":"Clear mask image URL",className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]","aria-hidden":"true",children:"close"})})]}),ep&&(0,s.jsx)(M.default,{src:ep,alt:"Mask",width:640,height:320,unoptimized:!0,className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"}})]})}),(o.extraFields||[]).filter(e=>0===m.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,s.jsx)($,{label:e.label,htmlFor:`generic-example-${e.key}`,children:"select"===e.type?(0,s.jsx)("select",{id:`generic-example-${e.key}`,value:E[e.key]??"",onChange:t=>R(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,s.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,s.jsx)("input",{id:`generic-example-${e.key}`,type:"text",value:E[e.key]??"",placeholder:e.placeholder,onChange:t=>R(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,s.jsx)("input",{id:`generic-example-${e.key}`,type:"number",value:E[e.key]??"",min:e.min,max:e.max,onChange:t=>R(a=>({...a,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,s.jsx)($,{label:"Output Format",htmlFor:"generic-example-output-format",children:(0,s.jsxs)("select",{id:"generic-example-output-format",value:J,onChange:e=>V(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,s.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>er(ev),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:es?"check":"content_copy"}),es?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:ej,disabled:G||!y.trim()||!en||!T.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:G?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),G?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:ev})]}),(G||D)&&ef&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:G?{animation:"spin 1s linear infinite"}:void 0,children:G?"progress_activity":"check_circle"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[D?.stage||"starting",!G&&D?.bytesReceived?` \xb7 ${(D.bytesReceived/1024).toFixed(1)} KB`:""]})]}),q?.b64_json&&!_&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,s.jsx)(M.default,{src:`data:image/png;base64,${q.b64_json}`,alt:"Partial",width:1024,height:1024,unoptimized:!0,className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80"})]}),Z&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:Z}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",_&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",_.latencyMs,"ms"]})]}),_&&(0,s.jsxs)("button",{onClick:()=>eo(eN),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:el?"check":"content_copy"}),el?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:_?eN:o.defaultResponse}),"image"===t&&(H||_?.data?.data?.[0])&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:H||(_?.data?.data?.[0]?.b64_json?`data:image/png;base64,${_.data.data[0].b64_json}`:_?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)(M.default,{src:H||(_?.data?.data?.[0]?.b64_json?`data:image/png;base64,${_.data.data[0].b64_json}`:_?.data?.data?.[0]?.url),alt:"Generated",width:1024,height:1024,unoptimized:!0,className:"max-w-full rounded-lg border border-border"})]})]})]})]})}function B({providerId:e}){let t=(0,c.wG)(e),a=(0,v.KC)(e).filter(e=>"stt"===(0,v.CP)(e)),[r,l]=(0,i.useState)([]),o=[...a,...r],[d,m]=(0,i.useState)(a[0]?.id??""),u=o.find(e=>e.id===d),p=Array.isArray(u?.params)?u.params:[],[x,h]=(0,i.useState)(null),[b,f]=(0,i.useState)(""),[g,y]=(0,i.useState)(""),[w,N]=(0,i.useState)("json"),[k,C]=(0,i.useState)(""),[S,F]=(0,i.useState)(""),[E,R]=(0,i.useState)(""),[T,A]=(0,i.useState)(null),[P,I]=(0,i.useState)(null),[_,M]=(0,i.useState)(!1),[O,L]=(0,i.useState)(""),{copied:K,copy:D}=(0,j.C)(),{copied:U,copy:q}=(0,j.C)();(0,i.useEffect)(()=>{R(window.location.origin);let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{l((e.models||[]).filter(e=>"stt"===(0,v.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let z=d?`${t}/${d}`:"",J=`curl -X POST ${E}/v1/audio/transcriptions \\
|
|
51
|
+
-H "Authorization: Bearer ${S||"YOUR_KEY"}" \\
|
|
52
52
|
-F "file=@${x?.name||"audio.mp3"}" \\
|
|
53
53
|
-F "model=${z}"${p.includes("language")&&b?` \\
|
|
54
54
|
-F "language=${b}"`:""}${p.includes("response_format")?` \\
|
|
55
55
|
-F "response_format=${w}"`:""}${p.includes("temperature")&&k?` \\
|
|
56
56
|
-F "temperature=${k}"`:""}${p.includes("prompt")&&g?` \\
|
|
57
|
-
-F "prompt=${g}"`:""}`,V=async()=>{if(!x||!z
|
|
57
|
+
-F "prompt=${g}"`:""}`,V=async()=>{if(!x||!z||!S.trim())return;M(!0),L(""),A(null);let e=Date.now();try{let t=new FormData;t.append("file",x),t.append("model",z),p.includes("language")&&b&&t.append("language",b),p.includes("response_format")&&t.append("response_format",w),p.includes("temperature")&&k&&t.append("temperature",k),p.includes("prompt")&&g&&t.append("prompt",g);let a={};S&&(a.Authorization=`Bearer ${S}`);let s=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:a,body:t});I(Date.now()-e);let r=(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text();if(!s.ok)return void L(r?.error?.message||r?.error||r||`HTTP ${s.status}`);A(r)}catch(e){L(e.message||"Network error")}finally{M(!1)}},H="string"==typeof T?T:T?JSON.stringify(T,null,2):`{
|
|
58
58
|
"text": "Hello world..."
|
|
59
|
-
}`;return(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[o.length>0?(0,s.jsx)(S,{label:"Model",htmlFor:"stt-example-model",children:(0,s.jsx)("select",{id:"stt-example-model",value:d,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:o.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,s.jsx)(S,{label:"Model",htmlFor:"stt-example-model",children:(0,s.jsx)("input",{id:"stt-example-model",value:d,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(S,{label:"Endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[E,"/v1/audio/transcriptions"]})})}),(0,s.jsx)(S,{label:"API Key",htmlFor:"stt-example-key",children:(0,s.jsx)("input",{id:"stt-example-key",type:"password",autoComplete:"off",value:$,onChange:e=>F(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(S,{label:"Audio File",htmlFor:"stt-example-audio",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("input",{id:"stt-example-audio",type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,s.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,s.jsx)(S,{label:"Language",htmlFor:"stt-example-language",children:(0,s.jsx)("input",{id:"stt-example-language",value:b,onChange:e=>f(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,s.jsx)(S,{label:"Prompt",htmlFor:"stt-example-prompt",children:(0,s.jsx)("input",{id:"stt-example-prompt",value:g,onChange:e=>y(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,s.jsx)(S,{label:"Temperature",htmlFor:"stt-example-temperature",children:(0,s.jsx)("input",{id:"stt-example-temperature",type:"number",step:"0.1",min:"0",max:"1",value:k,onChange:e=>C(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,s.jsx)(S,{label:"Response Format",htmlFor:"stt-example-format",children:(0,s.jsxs)("select",{id:"stt-example-format",value:w,onChange:e=>N(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"json"}),(0,s.jsx)("option",{value:"text",children:"text"}),(0,s.jsx)("option",{value:"srt",children:"srt"}),(0,s.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,s.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>D(J),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:B?"check":"content_copy"}),B?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:V,disabled:_||!x||!z||!$.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:_?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),_?"Transcribing...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:J})]}),O&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:O}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",T&&P&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",P,"ms"]})]}),T&&(0,s.jsxs)("button",{onClick:()=>q(H),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:U?"check":"content_copy"}),U?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:H})]})]})]})}var B=a(77251);function D(){let{kind:e,id:t}=(0,r.useParams)(),a=(0,r.useRouter)(),l=c.rj.find(t=>t.id===e),m=(0,c.gC)(t)&&"embedding"===e,u=async()=>{if(await (0,B.l)({message:"Delete this Custom Embedding node?",confirmText:"Continue"}))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&a.push(`/dashboard/media-providers/${e}`)}catch(e){(0,w.s)("Error deleting custom embedding node:",e)}},[p,x]=(0,i.useState)(null),[h,b]=(0,i.useState)(m),[f,g]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(a=>{e||(x((a.nodes||[]).find(e=>e.id===t)||null),b(!1))}).catch(()=>{e||b(!1)}),()=>{e=!0}},[t,m]),!l)return(0,r.notFound)();let v=c.Q2[t],j=m?p?{id:t,name:p.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:v;if(!m&&!v||m&&!h&&!p)return(0,r.notFound)();if(m&&h)return(0,s.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let N=m?["embedding"]:j.serviceKinds??["llm"];return m||N.includes(e)?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(o(),{href:`/dashboard/media-providers/${e}`,className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),l.label]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${j.color}15`},children:(0,s.jsx)(d.A,{src:`/providers/${j.id}.png`,alt:j.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:j.textIcon||j.id.slice(0,2).toUpperCase(),fallbackColor:j.color})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:j.name}),!m&&j.notice?.apiKeyUrl&&(0,s.jsxs)("a",{href:j.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[m&&(0,s.jsxs)(n.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",p?.prefix]}),N.map(t=>(0,s.jsx)(n.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]})]}),m&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>g(!0),children:"Edit"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})]}),!m&&j.kindNotice?.[e]&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,s.jsx)("p",{className:"text-sm",children:j.kindNotice[e]})]}),!m&&j.notice?.text&&!j.deprecated&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:j.notice.text}),j.notice.apiKeyUrl&&(0,s.jsx)("a",{href:j.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),!m&&j.noAuth?(0,s.jsx)(n.gw,{providerId:t}):(0,s.jsx)(y,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,s.jsx)(C,{providerId:t,kindFilter:e,providerAliasOverride:m?p?.prefix:void 0}),!m&&(j.searchConfig||j.fetchConfig||j.ttsConfig||j.sttConfig||j.embeddingConfig||j.searchViaChat)&&(0,s.jsx)(n.Wx,{config:"webFetch"===e?j.fetchConfig:"tts"===e?j.ttsConfig:"stt"===e?j.sttConfig:"embedding"===e?j.embeddingConfig:j.searchConfig||{mode:"chat-completions",defaultModel:j.searchViaChat?.defaultModel,pricingUrl:j.searchViaChat?.pricingUrl,freeTier:j.searchViaChat?.freeTier},provider:j,title:`${l.label} Config`}),"embedding"===e&&(0,s.jsx)(E,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,s.jsx)(I,{providerId:t}),"stt"===e&&!m&&(0,s.jsx)(K,{providerId:t}),!m&&$[e]&&(0,s.jsx)(L,{providerId:t,kind:e}),m&&(0,s.jsx)(n.x0,{isOpen:f,node:p,onClose:()=>g(!1),onSaved:e=>{x(e),g(!1)}})]}):(0,r.notFound)()}},53578:(e,t,a)=>{"use strict";async function s(e,t,a=fetch){let r=await a("/api/settings",{cache:"no-store"});if(!r.ok)throw Error(`Failed to load settings (${r.status})`);let l=(await r.json()).providerStrategies||{},o=t(l[e]||{}),i={...l};o&&Object.keys(o).length>0?i[e]=o:delete i[e];let n=await a("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})});if(!n.ok)throw Error(`Failed to save settings (${n.status})`);return o}a.d(t,{T:()=>s})},70217:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})}},e=>{e.O(0,[2574,3862,782,8500,594,1321,4707,1330,8441,3794,7358],()=>e(e.s=17845)),_N_E=e.O()}]);
|
|
59
|
+
}`;return(0,s.jsxs)(n.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[o.length>0?(0,s.jsx)($,{label:"Model",htmlFor:"stt-example-model",children:(0,s.jsx)("select",{id:"stt-example-model",value:d,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:o.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,s.jsx)($,{label:"Model",htmlFor:"stt-example-model",children:(0,s.jsx)("input",{id:"stt-example-model",value:d,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[E,"/v1/audio/transcriptions"]})})}),(0,s.jsx)($,{label:"API Key",htmlFor:"stt-example-key",children:(0,s.jsx)("input",{id:"stt-example-key",type:"password",autoComplete:"off",value:S,onChange:e=>F(e.target.value),placeholder:"Paste a Switchboard client key secret (sk-...)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)($,{label:"Audio File",htmlFor:"stt-example-audio",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("input",{id:"stt-example-audio",type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,s.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,s.jsx)($,{label:"Language",htmlFor:"stt-example-language",children:(0,s.jsx)("input",{id:"stt-example-language",value:b,onChange:e=>f(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,s.jsx)($,{label:"Prompt",htmlFor:"stt-example-prompt",children:(0,s.jsx)("input",{id:"stt-example-prompt",value:g,onChange:e=>y(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,s.jsx)($,{label:"Temperature",htmlFor:"stt-example-temperature",children:(0,s.jsx)("input",{id:"stt-example-temperature",type:"number",step:"0.1",min:"0",max:"1",value:k,onChange:e=>C(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,s.jsx)($,{label:"Response Format",htmlFor:"stt-example-format",children:(0,s.jsxs)("select",{id:"stt-example-format",value:w,onChange:e=>N(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"json"}),(0,s.jsx)("option",{value:"text",children:"text"}),(0,s.jsx)("option",{value:"srt",children:"srt"}),(0,s.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,s.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>D(J),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:K?"check":"content_copy"}),K?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:V,disabled:_||!x||!z||!S.trim(),className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-on-primary text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:_?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),_?"Transcribing...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:J})]}),O&&(0,s.jsx)("p",{role:"alert",className:"text-xs text-red-500 break-words",children:O}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",T&&P&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",P,"ms"]})]}),T&&(0,s.jsxs)("button",{onClick:()=>q(H),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:U?"check":"content_copy"}),U?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:H})]})]})]})}var D=a(77251);function U(){let{kind:e,id:t}=(0,r.useParams)(),a=(0,r.useRouter)(),l=c.rj.find(t=>t.id===e),m=(0,c.gC)(t)&&"embedding"===e,u=async()=>{if(await (0,D.l)({message:"Delete this Custom Embedding node?",confirmText:"Continue"}))try{await (0,N.x)(`/api/provider-nodes/${t}`,{method:"DELETE"}),a.push(`/dashboard/media-providers/${e}`)}catch(e){(0,w.s)("Error deleting custom embedding node:",e)}},[p,x]=(0,i.useState)(null),[h,b]=(0,i.useState)(m),[f,g]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{if(!m)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(a=>{e||(x((a.nodes||[]).find(e=>e.id===t)||null),b(!1))}).catch(()=>{e||b(!1)}),()=>{e=!0}},[t,m]),!l)return(0,r.notFound)();let v=c.Q2[t],j=m?p?{id:t,name:p.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"}:null:v;if(!m&&!v||m&&!h&&!p)return(0,r.notFound)();if(m&&h)return(0,s.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let k=m?["embedding"]:j.serviceKinds??["llm"];return m||k.includes(e)?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(o(),{href:`/dashboard/media-providers/${e}`,className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),l.label]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${j.color}15`},children:(0,s.jsx)(d.A,{src:`/providers/${j.id}.png`,alt:j.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:j.textIcon||j.id.slice(0,2).toUpperCase(),fallbackColor:j.color})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:j.name}),!m&&j.notice?.apiKeyUrl&&(0,s.jsxs)("a",{href:j.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[m&&(0,s.jsxs)(n.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",p?.prefix]}),k.map(t=>(0,s.jsx)(n.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]})]}),m&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>g(!0),children:"Edit"}),(0,s.jsx)(n.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:u,children:"Delete"})]})]})]}),!m&&j.kindNotice?.[e]&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,s.jsx)("p",{className:"text-sm",children:j.kindNotice[e]})]}),!m&&j.notice?.text&&!j.deprecated&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:j.notice.text}),j.notice.apiKeyUrl&&(0,s.jsx)("a",{href:j.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),!m&&j.noAuth?(0,s.jsx)(n.gw,{providerId:t}):(0,s.jsx)(y,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,s.jsx)(S,{providerId:t,kindFilter:e,providerAliasOverride:m?p?.prefix:void 0}),!m&&(j.searchConfig||j.fetchConfig||j.ttsConfig||j.sttConfig||j.embeddingConfig||j.searchViaChat)&&(0,s.jsx)(n.Wx,{config:"webFetch"===e?j.fetchConfig:"tts"===e?j.ttsConfig:"stt"===e?j.sttConfig:"embedding"===e?j.embeddingConfig:j.searchConfig||{mode:"chat-completions",defaultModel:j.searchViaChat?.defaultModel,pricingUrl:j.searchViaChat?.pricingUrl,freeTier:j.searchViaChat?.freeTier},provider:j,title:`${l.label} Config`}),"embedding"===e&&(0,s.jsx)(R,{providerId:t,customAlias:p?.prefix}),"tts"===e&&(0,s.jsx)(_,{providerId:t}),"stt"===e&&!m&&(0,s.jsx)(B,{providerId:t}),!m&&F[e]&&(0,s.jsx)(K,{providerId:t,kind:e}),m&&(0,s.jsx)(n.x0,{isOpen:f,node:p,onClose:()=>g(!1),onSaved:e=>{x(e),g(!1)}})]}):(0,r.notFound)()}},48874:(e,t,a)=>{"use strict";async function s(e,t){let a=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers||{}},credentials:"same-origin"}),s=null;try{s=await a.json()}catch{s=null}if(!a.ok){let e=s&&(s.error||s.message)||`Request failed (${a.status})`,t=Error("string"==typeof e?e:"Request failed");throw t.status=a.status,t.data=s,t}return s}a.d(t,{x:()=>s})},53578:(e,t,a)=>{"use strict";async function s(e,t,a=fetch){let r=await a("/api/settings",{cache:"no-store"});if(!r.ok)throw Error(`Failed to load settings (${r.status})`);let l=(await r.json()).providerStrategies||{},o=t(l[e]||{}),i={...l};o&&Object.keys(o).length>0?i[e]=o:delete i[e];let n=await a("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:i})});if(!n.ok)throw Error(`Failed to save settings (${n.status})`);return o}a.d(t,{T:()=>s})},70217:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})}},e=>{e.O(0,[2574,3862,782,8500,594,1321,4707,1330,8441,3794,7358],()=>e(e.s=17845)),_N_E=e.O()}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8334],{22662:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>w});var s=a(95155),l=a(73321),r=a(12115),i=a(98500),n=a.n(i),o=a(35497),d=a(57250),c=a(88105),m=a(78559),x=a(48874),u=a(77251),h=a(5772);let p=/^[a-zA-Z0-9_.\-]+$/,f={webSearch:"Web Search",webFetch:"Web Fetch",image:"Text to Image",tts:"Text To Speech"},b={webSearch:"/v1/search",webFetch:"/v1/web/fetch",image:"/v1/images/generations",tts:"/v1/audio/speech"},j={webSearch:e=>({model:e,query:"What is the latest news about AI?",search_type:"web",max_results:5}),webFetch:e=>({model:e,url:"https://example.com",format:"markdown"}),image:e=>({model:e,prompt:"A cute cat playing piano",n:1,size:"1024x1024"}),tts:e=>({model:e,input:"Hello, this is a test.",voice:"alloy"})};function g(e){return"webSearch"===e||"webFetch"===e?"/dashboard/media-providers/web":`/dashboard/media-providers/${e}`}function w(){let{id:e}=(0,l.useParams)(),t=(0,l.useRouter)(),[a,i]=(0,r.useState)(null),[w,v]=(0,r.useState)(!0),[y,N]=(0,r.useState)(""),[k,S]=(0,r.useState)(""),[C,$]=(0,r.useState)([]),[U,O]=(0,r.useState)(!1),[R,_]=(0,r.useState)(!1),[T,A]=(0,r.useState)([]),[E,M]=(0,r.useState)(!1),[P,L]=(0,r.useState)(null),[z,F]=(0,r.useState)(""),[D,I]=(0,r.useState)(""),[q,W]=(0,r.useState)([]),[J,Z]=(0,r.useState)({}),H=async()=>{try{let[t,a,s,l,r]=await Promise.all([fetch(`/api/combos/${e}`,{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"}),fetch("/api/usage/logs",{cache:"no-store"}),fetch("/api/providers",{cache:"no-store"}),fetch("/api/models/alias",{cache:"no-store"})]);if(r.ok&&Z((await r.json()).aliases||{}),l.ok&&W((await l.json()).connections||[]),!t.ok){i(null),v(!1);return}let n=await t.json();i(n),N(n.name),$(n.models||[]);let o=a.ok?await a.json():{};O(o.comboStrategies?.[n.name]?.fallbackStrategy==="round-robin");let d=s.ok?await s.json():[];A(d.filter(e=>"string"==typeof e&&e.includes(n.name)).slice(0,50))}catch{}v(!1)};(0,r.useEffect)(()=>{H()},[e]);let K=e=>e.trim()?p.test(e)?(S(""),!0):(S("Only letters, numbers, -, _ and ."),!1):(S("Name is required"),!1),B=async t=>{let a=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();return(0,m.s)(e.error||"Failed to save"),!1}return!0},G=async()=>{!K(y)||y===a.name||await B({name:y})&&await H()},Q=async e=>{let t=e?.value||e;if(!t||C.includes(t))return;let a=[...C,t];$(a),await B({models:a})},Y=async e=>{let t=e?.value||e;if(!t||!C.includes(t))return;let a=C.filter(e=>e!==t);$(a),await B({models:a})},V=async e=>{let t=C.filter((t,a)=>a!==e);$(t),await B({models:t})},X=async(e,t)=>{let a=[...C],s=e+t;s<0||s>=a.length||([a[e],a[s]]=[a[s],a[e]],$(a),await B({models:a}))},ee=async e=>{O(e);let t=await fetch("/api/settings",{cache:"no-store"}),s={...(t.ok?await t.json():{}).comboStrategies||{}};e?s[a.name]={fallbackStrategy:"round-robin"}:delete s[a.name],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:s})})},et=async()=>{if(await (0,u.l)({message:`Delete combo "${a.name?.trim()||e}"?`,confirmText:"Continue"}))try{await (0,x.x)(`/api/combos/${e}`,{method:"DELETE"}),t.push(g(a.kind))}catch(e){(0,m.s)("Error deleting combo:",e)}},ea=async()=>{if(!D.trim())return void F("Paste a client key secret before running this example.");if(M(!0),L(null),F(""),P?.audioUrl)try{URL.revokeObjectURL(P.audioUrl)}catch{}if(P?.imageUrl?.startsWith("blob:"))try{URL.revokeObjectURL(P.imageUrl)}catch{}let e=Date.now();try{let t=b[a.kind],s=j[a.kind](a.name),l={"Content-Type":"application/json"};D&&(l.Authorization=`Bearer ${D}`);let r=await fetch(`/api${t}`,{method:"POST",headers:l,body:JSON.stringify(s)}),i=Date.now()-e;if(!r.ok){let e=await r.json().catch(()=>({}));F(e?.error?.message||e?.error||`HTTP ${r.status}`),L({json:JSON.stringify(e,null,2),latencyMs:i});return}let n=r.headers.get("content-type")||"";if(n.startsWith("image/")){let e=await r.blob();L({imageUrl:URL.createObjectURL(e),latencyMs:i});return}if(n.startsWith("audio/")||"application/octet-stream"===n){let e=await r.blob();L({audioUrl:URL.createObjectURL(e),latencyMs:i});return}let o=await r.json(),d=o?.data?.[0],c=d?.b64_json?`data:image/png;base64,${d.b64_json}`:d?.url||"";L({json:JSON.stringify(function e(t){if(!t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);let a={};for(let[s,l]of Object.entries(t))a[s]="b64_json"===s&&"string"==typeof l&&l.length>100?`<${l.length} chars base64>`:e(l);return a}(o),null,2),imageUrl:c,latencyMs:i})}catch(e){F(e.message||"Network error")}M(!1)};if(w)return(0,s.jsx)("div",{className:"text-text-muted text-sm",children:"Loading..."});if(!a)return(0,l.notFound)();let es=f[a.kind]||c.rj.find(e=>e.id===a.kind)?.label||"Combo",el=b[a.kind],er=a.kind&&j[a.kind]?j[a.kind](a.name):null,ei=el?`curl -X POST http://localhost:20128${el} \\
|
|
2
|
+
-H "Content-Type: application/json" \\
|
|
3
|
+
-H "Authorization: Bearer ${D||"YOUR_KEY"}" \\
|
|
4
|
+
-d '${JSON.stringify(er)}'`:"",en=g(a.kind);return(0,s.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)(n(),{href:en,className:"text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined",children:"arrow_back"})}),(0,s.jsx)("div",{className:"size-10 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:[es," Combo"]}),(0,s.jsx)("code",{className:"text-lg font-semibold font-mono",children:a.name})]})]}),(0,s.jsx)(o.$n,{variant:"outline",icon:"delete",onClick:et,className:"text-red-500 border-red-200 hover:bg-red-50",children:"Delete"})]}),(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Settings"}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.pd,{label:"Combo Name",value:y,onChange:e=>{N(e.target.value),K(e.target.value)},onBlur:G,error:k}),(0,s.jsx)("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and ."})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Round Robin"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Rotate providers across requests instead of strict fallback order."})]}),(0,s.jsx)(o.lM,{checked:U,onChange:ee})]})]})]}),(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Providers"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Tried in order (top-down) or rotated when round-robin is on."})]}),(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>_(!0),children:"Add Provider"})]}),0===C.length?(0,s.jsx)("div",{className:"text-center py-6 border border-dashed border-border rounded-lg text-text-muted text-sm",children:"No providers yet."}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:C.map((e,t)=>{let{providerId:a,model:l}=function(e){if("string"!=typeof e)return{providerId:"",model:""};let t=e.indexOf("/");return t<0?{providerId:e,model:""}:{providerId:e.slice(0,t),model:e.slice(t+1)}}(e),r=c.Q2[a];return(0,s.jsxs)("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-black/[0.02] dark:bg-white/[0.02]",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted w-5 text-center",children:t+1}),(0,s.jsx)(d.A,{src:`/providers/${a}.png`,alt:r?.name||a,size:24,className:"object-contain rounded shrink-0",fallbackText:r?.textIcon||a.slice(0,2).toUpperCase(),fallbackColor:r?.color}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-sm font-medium truncate",children:r?.name||a}),l&&(0,s.jsx)("code",{className:"text-[10px] text-text-muted font-mono truncate block",children:l})]}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("button",{onClick:()=>X(t,-1),disabled:0===t,className:`p-1 rounded ${0===t?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,"aria-label":`Move ${r?.name||a} up`,title:"Move up",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"arrow_upward"})}),(0,s.jsx)("button",{onClick:()=>X(t,1),disabled:t===C.length-1,className:`p-1 rounded ${t===C.length-1?"text-text-muted/20":"text-text-muted hover:text-primary hover:bg-black/5"}`,"aria-label":`Move ${r?.name||a} down`,title:"Move down",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"arrow_downward"})}),(0,s.jsx)("button",{onClick:()=>V(t),className:"p-1 rounded text-text-muted hover:text-red-500 hover:bg-red-500/10","aria-label":`Remove ${r?.name||a}`,title:"Remove",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]","aria-hidden":"true",children:"close"})})]})]},`${e}-${t}`)})})]}),a.kind&&el&&(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-3",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Test Example"}),(0,s.jsx)(o.$n,{size:"sm",icon:"play_arrow",onClick:ea,disabled:E||0===C.length||!D.trim(),children:E?"Running...":"Run"})]}),(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsx)(o.pd,{id:"combo-example-key",label:"Client Key Secret",type:"password",autoComplete:"off",placeholder:"Paste a Switchboard client key secret (sk-...)",value:D,onChange:e=>I(e.target.value),hint:"Run uses this key as the Authorization bearer for the local gateway endpoint."})}),(0,s.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-x-auto whitespace-pre-wrap break-all",children:ei}),z&&(0,s.jsx)("p",{role:"alert",className:"mt-3 text-xs text-red-500 break-words",children:z}),P&&(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-3",children:[null!=P.latencyMs&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:["⚡ ",P.latencyMs,"ms"]}),P.imageUrl&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:P.imageUrl,download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)(h.default,{src:P.imageUrl,alt:"Generated",width:1024,height:1024,unoptimized:!0,className:"max-w-full rounded-lg border border-border"})]}),P.audioUrl&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:P.audioUrl,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("audio",{controls:!0,src:P.audioUrl,className:"w-full"})]}),P.json&&(0,s.jsx)("pre",{className:"text-xs font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[300px] whitespace-pre-wrap break-all",children:P.json})]})]}),(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-3",children:"Usage Logs"}),0===T.length?(0,s.jsx)("p",{className:"text-xs text-text-muted italic",children:"No usage yet."}):(0,s.jsx)("pre",{className:"text-[11px] font-mono bg-black/[0.03] dark:bg-white/[0.03] p-3 rounded-lg overflow-auto max-h-[400px] whitespace-pre-wrap",children:T.join("\n")})]}),(0,s.jsx)(o.rq,{isOpen:R,onClose:()=>_(!1),onSelect:Q,onDeselect:Y,activeProviders:q,modelAliases:J,title:`Add ${es} Model`,kindFilter:a.kind,addedModelValues:C,closeOnSelect:!1})]})}},35497:(e,t,a)=>{"use strict";a.d(t,{x0:()=>N.default,Ex:()=>d.default,$n:()=>s.default,nh:()=>U.default,Zp:()=>i.default,Qv:()=>o.CardSkeleton,CK:()=>h.default,uo:()=>n.ConfirmModal,G9:()=>g.default,wI:()=>y.default,vj:()=>v.default,vE:()=>w.default,pd:()=>l.default,Mh:()=>j.default,uR:()=>u.default,Nf:()=>p.default,aF:()=>n.default,rq:()=>x.default,gw:()=>k.default,LF:()=>m.default,Wx:()=>$.default,gM:()=>b.default,Iz:()=>S.default,l6:()=>r.default,lM:()=>c.default,m_:()=>C.default,jK:()=>f.default});var s=a(92542),l=a(11910),r=a(98),i=a(84588),n=a(81127),o=a(25086);a(56319);var d=a(56061),c=a(98542);a(38587),a(21110),a(92622),a(8823),a(92173);var m=a(90882),x=a(72908),u=a(28815),h=a(45455),p=a(28058),f=a(4809);a(21931),a(80752),a(40197);var b=a(23615);a(44736);var j=a(62899);a(94230);var g=a(30815),w=a(23936),v=a(95088),y=a(73579),N=a(96748),k=a(4823),S=a(28067),C=a(97677),$=a(51825),U=a(29366);a(76361),a(91450)},48874:(e,t,a)=>{"use strict";async function s(e,t){let a=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers||{}},credentials:"same-origin"}),s=null;try{s=await a.json()}catch{s=null}if(!a.ok){let e=s&&(s.error||s.message)||`Request failed (${a.status})`,t=Error("string"==typeof e?e:"Request failed");throw t.status=a.status,t.data=s,t}return s}a.d(t,{x:()=>s})},69701:(e,t,a)=>{Promise.resolve().then(a.bind(a,22662))}},e=>{e.O(0,[2574,3862,782,8500,594,1321,4707,1330,8441,3794,7358],()=>e(e.s=69701)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{11059:(e,o,t)=>{"use strict";t.d(o,{C:()=>r});var n=t(12115);function r(e=2e3){let[o,t]=(0,n.useState)(null),s=(0,n.useRef)(null),a=(0,n.useCallback)(async(o,n="default")=>{let r=async()=>{if(navigator?.clipboard?.writeText)await navigator.clipboard.writeText(o);else{let e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e);try{if(e.select(),!document.execCommand("copy"))throw Error("Clipboard copy was rejected")}finally{document.body.removeChild(e)}}};try{await r(),t(n),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{t(null)},e)}catch{}},[e]);return(0,n.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),{copied:o,copy:a}}},14051:(e,o,t)=>{e.exports=t(34701)()},21172:(e,o,t)=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0}),Object.defineProperty(o,"useMergedRef",{enumerable:!0,get:function(){return r}});let n=t(12115);function r(e,o){let t=(0,n.useRef)(null),r=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=t.current;e&&(t.current=null,e());let o=r.current;o&&(r.current=null,o())}else e&&(t.current=s(e,n)),o&&(r.current=s(o,n))},[e,o])}function s(e,o){if("function"!=typeof e)return e.current=o,()=>{e.current=null};{let t=e(o);return"function"==typeof t?t:()=>e(null)}}("function"==typeof o.default||"object"==typeof o.default&&null!==o.default)&&void 0===o.default.__esModule&&(Object.defineProperty(o.default,"__esModule",{value:!0}),Object.assign(o.default,o),e.exports=o.default)},34701:(e,o,t)=>{"use strict";var n=t(82114);function r(){}function s(){}s.resetWarningCache=r,e.exports=function(){function e(e,o,t,r,s,a){if(a!==n){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:o,element:e,elementType:e,instanceOf:o,node:e,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:s,resetWarningCache:r};return t.PropTypes=t,t}},48420:(e,o,t)=>{Promise.resolve().then(t.bind(t,55084))},55084:(e,o,t)=>{"use strict";t.d(o,{default:()=>p});var n=t(95155),r=t(12115),s=t(98500),a=t.n(s),l=t(73321),i=t(14051),d=t.n(i),c=t(11059);let u={fallback:"fallback","round-robin":"round-robin",fusion:"fusion",auto:"auto"};function p({initialData:e}){let o=(0,l.useRouter)(),[t,s]=(0,r.useState)(e?.endpointHost||"127.0.0.1:20128"),[i,d]=(0,r.useState)(null),[m,x]=(0,r.useState)(!1),{copied:b,copy:g}=(0,c.C)(),h=e?.providerCount??0,y=(e?.readyProviderCount??0)>0,v=e?.keyCount??0,j=e?.comboCount??0,E=e?.defaultCombo||null,S=e?.learningSummary||null,C=e?.loadError||null,k=!!E?.isAuto,w=E?.strategy||"fallback";(0,r.useEffect)(()=>{s(window.location.host||"127.0.0.1:20128")},[]),(0,r.useEffect)(()=>{let e=!1;return fetch("/api/usage/stats?period=24h").then(e=>{if(!e.ok)throw Error(`stats request failed: ${e.status}`);return e.json()}).then(o=>{e||d(o)}).catch(()=>{e||x(!0)}),()=>{e=!0}},[]);let B=`http://${t}/v1`,P=(0,r.useMemo)(()=>{if(m)return[{label:"Requests \xb7 24h",value:"—"},{label:"Tokens in",value:"—"},{label:"Tokens out",value:"—"},{label:"Est. cost",value:"—"}];let e=i?.totalRequests??i?.requests??0,o=i?.totalPromptTokens??0,t=i?.totalCompletionTokens??0,n=i?.totalCost??0;return[{label:"Requests \xb7 24h",value:f(e)},{label:"Tokens in",value:f(o)},{label:"Tokens out",value:f(t)},{label:"Est. cost",value:n?`$${Number(n).toFixed(2)}`:"$0.00"}]},[i,m]),M=(0,r.useMemo)(()=>E?k?[["Router",E.routerModel||"not configured"],["Worker pool",`${E.workerCount||0} workers`],["Objective",E.objective||"balanced"],["Exploration",E.exploration||"5%"]]:"fusion"===w?[["Panel",`${E.workerCount||0} models`],["Judge",E.judgeModel||"first model"],["Calls / request","N+1 (panel + judge)"],["Capacity switch",E.capacityAutoSwitch?"on":"off"]]:"round-robin"===w?[["Pool",`${E.workerCount||0} models`],["Rotation","spread load across models"],["Capacity switch",E.capacityAutoSwitch?"on":"off"],["On failure","try next in rotation"]]:[["Pool",`${E.workerCount||0} models`],["Order","try in listed order"],["Capacity switch",!1!==E.capacityAutoSwitch?"on":"off"],["On failure","next model"]]:[["Combos","none configured"],["Strategy","—"],["Models","—"],["Tip","Create a combo to group models"]],[E,k,w]);return(0,n.jsxs)("div",{className:"flex flex-col w-full",style:{gap:16,maxWidth:1120},children:[(0,n.jsxs)("div",{className:"flex flex-col",style:{gap:4},children:[(0,n.jsx)("span",{style:{fontSize:17,fontWeight:600,color:"#ECE4D2"},children:"Overview"}),(0,n.jsx)("span",{style:{fontSize:12,color:"var(--color-text-subtle)",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace"},children:"everything routing through your endpoint, at a glance"})]}),C&&(0,n.jsxs)("div",{role:"alert",className:"border-[#E5B454]",style:{background:"#1E1A13",borderStyle:"solid",borderWidth:1,borderRadius:12,padding:18},children:[(0,n.jsxs)("div",{className:"flex items-center",style:{gap:8,marginBottom:8},children:[(0,n.jsx)("span",{className:"material-symbols-outlined","aria-hidden":"true",style:{fontSize:18,color:"#E5B454"},children:"warning"}),(0,n.jsxs)("div",{style:{fontSize:14,fontWeight:600,color:"#E5B454"},children:["Couldn't read dashboard data: ",C]})]}),(0,n.jsx)("div",{className:"text-text-subtle",style:{fontSize:12,marginBottom:12},children:"The numbers below may be incomplete. Check the server logs and try again."}),(0,n.jsx)("button",{type:"button",onClick:()=>o.refresh(),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 14px",borderRadius:8,background:"#E5B454",color:"#1E1A13",fontSize:12,fontWeight:600,border:"none",cursor:"pointer"},children:"Retry"})]}),0===h&&!C&&(0,n.jsxs)("div",{style:{background:"#1E1A13",border:"1px solid #E5B454",borderRadius:12,padding:18},children:[(0,n.jsx)("div",{style:{fontSize:14,fontWeight:600,color:"#E5B454",marginBottom:8},children:"Connect your first provider to get started"}),(0,n.jsx)("div",{style:{fontSize:12,color:"#8A7F66",marginBottom:12},children:"Add an API key for any provider to start routing requests through Switchboard."}),(0,n.jsx)(a(),{href:"/dashboard/providers",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 14px",borderRadius:8,background:"#E5B454",color:"#1E1A13",fontSize:12,fontWeight:600,textDecoration:"none"},children:"Connect Provider"})]}),(0,n.jsxs)("div",{className:"grid gap-4 grid-cols-1 md:grid-cols-2",children:[(0,n.jsxs)("div",{className:"flex flex-col justify-between",style:{background:"#1E1A13",border:"1px solid #332C1E",borderRadius:12,padding:18},children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",style:{marginBottom:12},children:[(0,n.jsx)("span",{style:{fontSize:10.5,letterSpacing:"1.2px",color:"#8A7F66",textTransform:"uppercase",fontWeight:600},children:"Endpoint"}),(0,n.jsxs)("span",{className:"flex items-center gap-[7px]",style:{fontSize:11.5,color:y?"#74C08A":"#8A7F66",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace"},children:[(0,n.jsx)("span",{className:"console-online-dot",style:y?void 0:{background:"#6F6653",boxShadow:"none"}}),y?"online":h>0?"providers unavailable":"no providers"]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{style:{fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",fontSize:16,color:"#E5B454",wordBreak:"break-all"},children:B}),(0,n.jsx)("button",{type:"button",onClick:()=>g(B,"overview_endpoint"),className:"p-1.5 rounded hover:bg-white/10 text-[#8A7F66] hover:text-[#E5B454] transition-colors shrink-0",title:"Copy endpoint URL","aria-label":"Copy endpoint URL",children:(0,n.jsx)("span",{className:"material-symbols-outlined text-[16px] leading-none",children:"overview_endpoint"===b?"check":"content_copy"})})]})]}),(0,n.jsxs)("div",{style:{fontSize:11.5,color:"#6F6653",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",marginTop:14},children:[v," API key",1===v?"":"s"," \xb7 ",h," provider",1===h?"":"s"," connected"]})]}),(0,n.jsxs)("div",{style:{background:"#1E1A13",border:"1px solid #332C1E",borderRadius:12,padding:18},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",style:{marginBottom:12},children:[(0,n.jsx)("span",{style:{fontSize:10.5,letterSpacing:"1.2px",color:"#8A7F66",textTransform:"uppercase",fontWeight:600},children:k?"Learning":"Combos"}),(0,n.jsx)("span",{style:{fontSize:10,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",padding:"2px 8px",borderRadius:999,textTransform:"uppercase",letterSpacing:"0.5px",background:"rgba(229,180,84,.15)",color:"#E5B454",border:"1px solid rgba(229,180,84,.4)"},children:k?S?.freezeLearning?"frozen":S?.version?`v${S.version}`:"no version yet":j?`${j} configured`:"none"})]}),(0,n.jsxs)("div",{className:"flex items-end gap-2.5",style:{marginBottom:3},children:[(0,n.jsx)("span",{style:{fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",fontSize:32,fontWeight:600,lineHeight:1,color:"#ECE4D2"},children:k?S?.evalScore!=null?Number(S.evalScore).toFixed(0):"—":String(j)}),(0,n.jsx)("span",{style:{fontSize:11,color:k?"#74C08A":"#A99E86",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",paddingBottom:3},children:k?"eval score":"combos"})]}),(0,n.jsx)("div",{style:{fontSize:11,color:"#6F6653",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",marginBottom:14},children:k?"Auto strategy \xb7 relearn from Combos → Insights":"Group models \xb7 fallback / round-robin / fusion / auto"}),(0,n.jsxs)("div",{className:"flex gap-2 items-center flex-wrap",children:[(0,n.jsx)(a(),{href:"/dashboard/combos",style:{display:"inline-flex",alignItems:"center",gap:7,background:"rgba(229,180,84,.15)",border:"1px solid rgba(229,180,84,.4)",borderRadius:7,padding:"7px 12px",fontSize:12,color:"#E5B454",fontFamily:"inherit"},children:j?"Manage combos":"Create combo"}),k&&E?.name&&(0,n.jsx)(a(),{href:`/dashboard/combos/routing?combo=${encodeURIComponent(E.name)}`,style:{display:"inline-flex",alignItems:"center",gap:7,background:"transparent",border:"1px solid #3A3221",borderRadius:7,padding:"7px 10px",fontSize:12,color:"#A99E86"},children:"Routing insights"})]})]})]}),(0,n.jsx)("div",{className:"grid gap-3 grid-cols-2 lg:grid-cols-4",children:P.map(e=>(0,n.jsxs)("div",{style:{background:"#1E1A13",border:"1px solid #332C1E",borderRadius:11,padding:15},children:[(0,n.jsx)("div",{style:{fontSize:10,letterSpacing:"0.6px",color:"#6F6653",textTransform:"uppercase",marginBottom:8},children:e.label}),(0,n.jsx)("div",{style:{fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",fontSize:21,fontWeight:600,color:"#ECE4D2"},children:e.value})]},e.label))}),m&&(0,n.jsx)("div",{role:"status",className:"text-text-subtle",style:{fontSize:11.5,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace"},children:"stats unavailable"}),(0,n.jsxs)("div",{className:"grid gap-4 items-start grid-cols-1 md:grid-cols-2",children:[(0,n.jsxs)("div",{style:{background:"#1E1A13",border:"1px solid #332C1E",borderRadius:12,padding:18},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",style:{marginBottom:14},children:[(0,n.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#ECE4D2"},children:"Active routing"}),(0,n.jsx)(a(),{href:k&&E?.name?`/dashboard/combos/routing?combo=${encodeURIComponent(E.name)}`:"/dashboard/combos",style:{padding:"6px 12px",borderRadius:7,fontSize:11.5,border:"1px solid #3A3221",background:"transparent",color:"#A99E86"},children:k?"View insights":"Open combos"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2.5",style:{marginBottom:14},children:[(0,n.jsx)("span",{style:{fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",fontSize:14,fontWeight:600,color:"#ECE4D2"},children:E?.name||"—"}),(0,n.jsx)("span",{style:{fontSize:10,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",padding:"2px 8px",borderRadius:999,textTransform:"uppercase",letterSpacing:"0.5px",background:"rgba(229,180,84,.15)",color:"#E5B454",border:"1px solid rgba(229,180,84,.4)"},children:u[w]||w||"fallback"})]}),(0,n.jsx)("div",{className:"flex flex-col",children:M.map(([e,o],t,r)=>(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",style:{padding:"9px 0",borderBottom:t<r.length-1?"1px solid #241F16":"none"},children:[(0,n.jsx)("span",{style:{fontSize:12,color:"#8A7F66"},children:e}),(0,n.jsx)("span",{className:"truncate text-right",style:{fontSize:12,color:"#A99E86",fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace",maxWidth:"60%"},title:String(o),children:o})]},e))})]}),(0,n.jsxs)("div",{style:{background:"#1E1A13",border:"1px solid #332C1E",borderRadius:12,padding:18},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",style:{marginBottom:16},children:[(0,n.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#ECE4D2"},children:"Quota"}),(0,n.jsxs)("span",{className:"text-text-subtle",style:{fontSize:11,fontFamily:"var(--font-mono), 'IBM Plex Mono', monospace"},children:[h," connections"]})]}),(0,n.jsx)(a(),{href:"/dashboard/quota",style:{display:"inline-flex",alignItems:"center",gap:7,background:"transparent",border:"1px solid #3A3221",borderRadius:7,padding:"7px 12px",fontSize:12,color:"#A99E86",textDecoration:"none"},children:"Open quota dashboard →"}),(0,n.jsx)("div",{className:"text-text-subtle",style:{fontSize:11.5,marginTop:12},children:"Per-account limits and reset timers live on the Quota page."})]})]})]})}function f(e){let o=Number(e)||0;return o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}k`:String(Math.round(o))}p.propTypes={initialData:d().object}},73321:(e,o,t)=>{"use strict";var n=t(74645);t.o(n,"notFound")&&t.d(o,{notFound:function(){return n.notFound}}),t.o(n,"useParams")&&t.d(o,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(o,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(o,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(o,{useSearchParams:function(){return n.useSearchParams}})},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},e=>{e.O(0,[8500,8441,3794,7358],()=>e(e.s=48420)),_N_E=e.O()}]);
|