switchboard-router 0.6.9 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +12 -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/routes-manifest.json +32 -0
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/agent-library/page.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
- 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 +2 -2
- 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/quota/page.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
- 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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/agent-library/catalog/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/doctor/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/export/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/mcp/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/skills/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/sync/route.js +1 -1
- package/app/.next-cli-build/server/app/api/agent-library/updates/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +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/all-statuses/route.js +4 -4
- 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/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- 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/codex-settings/route.js +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-tools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
- 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/droid-settings/route.js +2 -2
- 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/grok-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
- 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/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +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/start/route.js +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/stop/route.js +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js +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/route.js +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +5 -5
- 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/elevenlabs/voices/route.js +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/minimax/voices/route.js +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/mgmt/v1/combos/[id]/route.js +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/route.js +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/providers/route.js +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/usage/route.js +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/models/alias/route.js +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/custom/route.js +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/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +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/codex/bulk-import/route.js +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/cursor/auto-import/route.js +2 -2
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +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/iflow/cookie/route.js +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/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +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-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +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/route.js +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/providers/[id]/model-probes/batch/route.js +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/prepare/route.js +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/route.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/route_client-reference-manifest.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/cancel/route_client-reference-manifest.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/start/route_client-reference-manifest.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/api/providers/[id]/model-probes/verify/status/route_client-reference-manifest.js +1 -0
- 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]/route.js +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-models/route.js +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/kilo/free-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +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/insights/route.js +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/stats/route.js +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/rollback/route.js +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/proxy-test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/skills/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
- package/app/.next-cli-build/server/app/api/token-saver/vault-stats/route.js +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/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js +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/translate/route.js +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]/route.js +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/history/route.js +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/providers/route.js +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-logs/route.js +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/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +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/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +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/images/generations/route.js +2 -2
- 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/route.js +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/info/route.js +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/responses/compact/route.js +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/route.js +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/web/fetch/route.js +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/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +2 -2
- 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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.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 +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
- 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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.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 +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js +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 +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +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 +2 -2
- 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/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.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 +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +2 -2
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +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 +1 -1
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
- package/app/.next-cli-build/server/app/page.js +2 -2
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +12 -8
- package/app/.next-cli-build/server/chunks/159.js +1 -1
- package/app/.next-cli-build/server/chunks/194.js +1 -1
- package/app/.next-cli-build/server/chunks/3535.js +1 -1
- package/app/.next-cli-build/server/chunks/369.js +2 -2
- package/app/.next-cli-build/server/chunks/4126.js +1 -1
- package/app/.next-cli-build/server/chunks/4194.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/5615.js +1 -1
- package/app/.next-cli-build/server/chunks/5821.js +1 -1
- package/app/.next-cli-build/server/chunks/6492.js +1 -1
- package/app/.next-cli-build/server/chunks/8129.js +1 -1
- package/app/.next-cli-build/server/chunks/8400.js +2 -2
- package/app/.next-cli-build/server/chunks/869.js +1 -1
- package/app/.next-cli-build/server/chunks/8998.js +4 -4
- package/app/.next-cli-build/server/chunks/9046.js +1 -1
- package/app/.next-cli-build/server/chunks/9508.js +1 -1
- package/app/.next-cli-build/server/chunks/9696.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{1321-5dd77b27a73a9869.js → 1321-3452b6d48b71f4a2.js} +1 -1
- package/app/.next-cli-build/static/chunks/{5497-aa5f62602eba33e9.js → 5497-d866b97bf9a716ba.js} +2 -2
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-c6f3cad64d4ef25a.js +10 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-b06b9aec5dcdf486.js → layout-acc24d6e7d8eb782.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/_global-error/page-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/catalog/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/doctor/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/export/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/mcp/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/skills/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/sync/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/agent-library/updates/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/status/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/aider-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/gemini-cli-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/health/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/keys/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/locale/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/[id]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/[id]/strategy/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/health/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/providers/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/routing/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/usage/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/version/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/alias/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/availability/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/custom/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/test/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pricing/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/batch/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/cache/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/prepare/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/remove-unavailable/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/verify/cancel/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/verify/start/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/verify/status/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/client/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/routing/feedback/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/routing/insights/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/routing/learn/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/routing/stats/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/routing/versions/promote/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/routing/versions/rollback/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/database/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/shutdown/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/skills/[id]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tags/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/token-saver/vault-stats/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/load/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/save/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/send/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/history/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/search/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/update/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/login/page-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/app/page-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-53acebeeeaf77697.js +1 -0
- package/app/.next-cli-build/static/css/d8a6e361b97914f9.css +1 -0
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-9e18805fc7c23ae3.js +0 -10
- package/app/.next-cli-build/static/chunks/app/_global-error/page-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/catalog/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/doctor/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/export/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/mcp/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/skills/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/sync/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/agent-library/updates/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/status/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/aider-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/gemini-cli-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/health/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/keys/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/locale/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/[id]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/[id]/strategy/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/combos/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/health/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/providers/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/routing/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/usage/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mgmt/v1/version/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/alias/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/availability/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/custom/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/test/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pricing/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/batch/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/cache/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/prepare/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/model-probes/remove-unavailable/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/client/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/routing/feedback/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/routing/insights/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/routing/learn/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/routing/stats/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/routing/versions/promote/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/routing/versions/rollback/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/database/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/shutdown/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/skills/[id]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tags/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/token-saver/vault-stats/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/load/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/save/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/send/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/history/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/[kind]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/search/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/update/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/login/page-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/app/page-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-554d472d679429b3.js +0 -1
- package/app/.next-cli-build/static/css/41299500fd9e7906.css +0 -1
- /package/app/.next-cli-build/static/{K2S61aF16PYJqaFGlO_Wc → cirxzk63Mj76HYSOHUdGc}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{K2S61aF16PYJqaFGlO_Wc → cirxzk63Mj76HYSOHUdGc}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=8835,a.ids=[1998,8080,8835],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},18080:(a,b,c)=>{c.r(b),c.d(b,{buildExternalIdpRefreshParams:()=>j,decodeJwtPayload:()=>h,normalizeKiroExternalIdpAuth:()=>i,normalizeScope:()=>g,validateMicrosoftTokenEndpoint:()=>f});let d=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function e(a){return"string"==typeof a?a.trim():""}function f(a){let b,c=e(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");let f=b.hostname.toLowerCase();if(!d.has(f))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}function g(a){return Array.isArray(a)?a.map(e).filter(Boolean).join(" "):e(a)}function h(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4;return JSON.parse(Buffer.from(`${c}${"=".repeat(d)}`,"base64").toString("utf8"))}catch{return null}}function i(a){let b=a;if("string"==typeof b)try{b=JSON.parse(b)}catch{throw Error("CLIProxyAPI auth JSON is invalid")}if(!b||"object"!=typeof b)throw Error("CLIProxyAPI auth JSON is required");let c=e(b.auth_method||b.authMethod);if(c&&"external_idp"!==c)throw Error("Only external_idp Kiro auth is supported by this importer");let d=e(b.access_token||b.accessToken),i=e(b.refresh_token||b.refreshToken),j=e(b.client_id||b.clientId),k=f(b.token_endpoint||b.tokenEndpoint),l=e(b.profile_arn||b.profileArn),m=e(b.region)||"us-east-1",n=g(b.scopes||b.scope);if(!d)throw Error("access_token is required");if(!i)throw Error("refresh_token is required");if(!j)throw Error("client_id is required");if(!n)throw Error("scopes is required");if(!l)throw Error("profile_arn is required");let o=h(d),p=b.email||o?.email||o?.preferred_username||o?.upn||o?.sub||null;return{accessToken:d,refreshToken:i,expiresAt:function(a){let b=a.expired||a.expires_at||a.expiresAt;if(b){let a=new Date(b).getTime();if(Number.isFinite(a))return new Date(a).toISOString()}let c=Number(a.expires_in||a.expiresIn||0);if(Number.isFinite(c)&&c>0)return new Date(Date.now()+1e3*c).toISOString();let d=h(a.access_token||a.accessToken);return d?.exp?new Date(1e3*d.exp).toISOString():new Date(Date.now()+36e5).toISOString()}(b),email:p,providerSpecificData:{profileArn:l,region:m,authMethod:"external_idp",provider:"CLIProxyAPI",clientId:j,tokenEndpoint:k,scope:n}}}function j(a,b={}){let c=e(b.clientId||b.client_id),d=f(b.tokenEndpoint||b.token_endpoint),h=g(b.scope||b.scopes);if(!a)throw Error("refresh token is required");if(!c)throw Error("clientId is required for external_idp refresh");if(!h)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:d,body:new URLSearchParams({grant_type:"refresh_token",client_id:c,refresh_token:a,scope:h}),providerSpecificData:{...b,authMethod:"external_idp",clientId:c,tokenEndpoint:d,scope:h}}}},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},54946:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998),x=c(18080);async function y(a){try{let b=await a.json(),c=b?.cliProxyAuth??b?.auth??b?.json??b,d=(0,x.normalizeKiroExternalIdpAuth)(c),e=await (0,w.createProviderConnection)({provider:"kiro",authType:"oauth",accessToken:d.accessToken,refreshToken:d.refreshToken,expiresAt:d.expiresAt,email:d.email||null,providerSpecificData:d.providerSpecificData,testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:e.id,provider:e.provider,email:e.email}})}catch(a){return v.NextResponse.json({error:a?.message||"CLIProxyAPI import failed"},{status:400})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/import-cli-proxy/route",pathname:"/api/oauth/kiro/import-cli-proxy",filename:"route",bundlePath:"app/api/oauth/kiro/import-cli-proxy/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/oauth/kiro/import-cli-proxy/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/import-cli-proxy/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=54946));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=8835,a.ids=[1998,8080,8835],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8708:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998),x=c(18080);async function y(a){try{let b=await a.json(),c=b?.cliProxyAuth??b?.auth??b?.json??b,d=(0,x.normalizeKiroExternalIdpAuth)(c),e=await (0,w.createProviderConnection)({provider:"kiro",authType:"oauth",accessToken:d.accessToken,refreshToken:d.refreshToken,expiresAt:d.expiresAt,email:d.email||null,providerSpecificData:d.providerSpecificData,testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:e.id,provider:e.provider,email:e.email}})}catch(a){return v.NextResponse.json({error:a?.message||"CLIProxyAPI import failed"},{status:400})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/import-cli-proxy/route",pathname:"/api/oauth/kiro/import-cli-proxy",filename:"route",bundlePath:"app/api/oauth/kiro/import-cli-proxy/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/oauth/kiro/import-cli-proxy/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/import-cli-proxy/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},18080:(a,b,c)=>{c.r(b),c.d(b,{buildExternalIdpRefreshParams:()=>j,decodeJwtPayload:()=>h,normalizeKiroExternalIdpAuth:()=>i,normalizeScope:()=>g,validateMicrosoftTokenEndpoint:()=>f});let d=new Set(["login.microsoftonline.com","login.microsoft.com","login.windows.net"]);function e(a){return"string"==typeof a?a.trim():""}function f(a){let b,c=e(a);if(!c)throw Error("token_endpoint is required");try{b=new URL(c)}catch{throw Error("token_endpoint must be a valid URL")}if("https:"!==b.protocol)throw Error("token_endpoint must use https");let f=b.hostname.toLowerCase();if(!d.has(f))throw Error("token_endpoint must be a Microsoft login endpoint");return b.toString()}function g(a){return Array.isArray(a)?a.map(e).filter(Boolean).join(" "):e(a)}function h(a){try{if(!a||"string"!=typeof a)return null;let b=a.split(".");if(3!==b.length)return null;let c=b[1].replace(/-/g,"+").replace(/_/g,"/"),d=(4-c.length%4)%4;return JSON.parse(Buffer.from(`${c}${"=".repeat(d)}`,"base64").toString("utf8"))}catch{return null}}function i(a){let b=a;if("string"==typeof b)try{b=JSON.parse(b)}catch{throw Error("CLIProxyAPI auth JSON is invalid")}if(!b||"object"!=typeof b)throw Error("CLIProxyAPI auth JSON is required");let c=e(b.auth_method||b.authMethod);if(c&&"external_idp"!==c)throw Error("Only external_idp Kiro auth is supported by this importer");let d=e(b.access_token||b.accessToken),i=e(b.refresh_token||b.refreshToken),j=e(b.client_id||b.clientId),k=f(b.token_endpoint||b.tokenEndpoint),l=e(b.profile_arn||b.profileArn),m=e(b.region)||"us-east-1",n=g(b.scopes||b.scope);if(!d)throw Error("access_token is required");if(!i)throw Error("refresh_token is required");if(!j)throw Error("client_id is required");if(!n)throw Error("scopes is required");if(!l)throw Error("profile_arn is required");let o=h(d),p=b.email||o?.email||o?.preferred_username||o?.upn||o?.sub||null;return{accessToken:d,refreshToken:i,expiresAt:function(a){let b=a.expired||a.expires_at||a.expiresAt;if(b){let a=new Date(b).getTime();if(Number.isFinite(a))return new Date(a).toISOString()}let c=Number(a.expires_in||a.expiresIn||0);if(Number.isFinite(c)&&c>0)return new Date(Date.now()+1e3*c).toISOString();let d=h(a.access_token||a.accessToken);return d?.exp?new Date(1e3*d.exp).toISOString():new Date(Date.now()+36e5).toISOString()}(b),email:p,providerSpecificData:{profileArn:l,region:m,authMethod:"external_idp",provider:"CLIProxyAPI",clientId:j,tokenEndpoint:k,scope:n}}}function j(a,b={}){let c=e(b.clientId||b.client_id),d=f(b.tokenEndpoint||b.token_endpoint),h=g(b.scope||b.scopes);if(!a)throw Error("refresh token is required");if(!c)throw Error("clientId is required for external_idp refresh");if(!h)throw Error("scope is required for external_idp refresh");return{tokenEndpoint:d,body:new URLSearchParams({grant_type:"refresh_token",client_id:c,refresh_token:a,scope:h}),providerSpecificData:{...b,authMethod:"external_idp",clientId:c,tokenEndpoint:d,scope:h}}}},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=8708));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var a={};a.id=9069,a.ids=[9069],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3094:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(13808),x=c(62409);async function y(a){try{let{searchParams:b}=new URL(a.url),c=b.get("provider");if(!c||!["google","github"].includes(c))return v.NextResponse.json({error:"Invalid provider. Use 'google' or 'github'"},{status:400});let{codeVerifier:d,codeChallenge:e,state:f}=(0,w.lz)(),g=new x.v().buildSocialLoginUrl(c,e,f);return v.NextResponse.json({authUrl:g,state:f,codeVerifier:d,codeChallenge:e,provider:c})}catch(a){return console.log("Kiro social authorize error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-authorize/route",pathname:"/api/oauth/kiro/social-authorize",filename:"route",bundlePath:"app/api/oauth/kiro/social-authorize/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/oauth/kiro/social-authorize/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-authorize/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13808:(a,b,c)=>{"use strict";c.d(b,{$N:()=>f,OK:()=>g,Zl:()=>h,lz:()=>i});var d=c(55511),e=c.n(d);function f(a=32){return e().randomBytes(a).toString("base64url")}function g(a){return e().createHash("sha256").update(a).digest("base64url")}function h(){return e().randomBytes(32).toString("base64url")}function i(a=32){let b=f(a),c=g(b);return{codeVerifier:b,codeChallenge:c,state:h()}}},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},62409:(a,b,c)=>{"use strict";c.d(b,{v:()=>f});var d=c(92990);let e="https://prod.us-east-1.auth.desktop.kiro.dev";class f{async registerClient(a="us-east-1"){(0,d.S6)(a);let b=`https://oidc.${a}.amazonaws.com/client/register`,c=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientName:d.Tx.clientName,clientType:d.Tx.clientType,scopes:d.Tx.scopes,grantTypes:d.Tx.grantTypes,issuerUrl:d.Tx.issuerUrl})});if(!c.ok){let a=await c.text();throw Error(`Failed to register client: ${a}`)}let e=await c.json();return{clientId:e.clientId,clientSecret:e.clientSecret,clientSecretExpiresAt:e.clientSecretExpiresAt}}async startDeviceAuthorization(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/device_authorization`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,startUrl:c})});if(!g.ok){let a=await g.text();throw Error(`Failed to start device authorization: ${a}`)}let h=await g.json();return{deviceCode:h.deviceCode,userCode:h.userCode,verificationUri:h.verificationUri,verificationUriComplete:h.verificationUriComplete,expiresIn:h.expiresIn,interval:h.interval||5}}async pollDeviceToken(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/token`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,deviceCode:c,grantType:"urn:ietf:params:oauth:grant-type:device_code"})}),h=await g.json();return!g.ok||h.error?{success:!1,error:h.error,errorDescription:h.error_description,pending:"authorization_pending"===h.error||"slow_down"===h.error}:{success:!0,tokens:{accessToken:h.accessToken,refreshToken:h.refreshToken,expiresIn:h.expiresIn,tokenType:h.tokenType}}}buildSocialLoginUrl(a,b,c){return`${e}/login?idp=${"google"===a?"Google":"Github"}&redirect_uri=${encodeURIComponent("kiro://kiro.kiroAgent/authenticate-success")}&code_challenge=${b}&code_challenge_method=S256&state=${c}&prompt=select_account`}async exchangeSocialCode(a,b){let c=await fetch(`${e}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,code_verifier:b,redirect_uri:"kiro://kiro.kiroAgent/authenticate-success"})});if(!c.ok){let a=await c.text();throw Error(`Token exchange failed: ${a}`)}let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken,profileArn:d.profileArn,expiresIn:d.expiresIn||3600}}async refreshToken(a,b={}){let{authMethod:c,clientId:f,clientSecret:g,region:h}=b;if(f&&g){let b=h||"us-east-1";(0,d.S6)(b);let c=`https://oidc.${b}.amazonaws.com/token`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!e.ok){let a=await e.text();throw Error(`Token refresh failed: ${a}`)}let i=await e.json();return{accessToken:i.accessToken,refreshToken:i.refreshToken||a,profileArn:i.profileArn,expiresIn:i.expiresIn}}let i=await fetch(`${e}/refreshToken`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();throw Error(`Token refresh failed: ${a}`)}let j=await i.json();return{accessToken:j.accessToken,refreshToken:j.refreshToken||a,profileArn:j.profileArn,expiresIn:j.expiresIn||3600}}async validateImportToken(a){if(!a.startsWith("aorAAAAAG"))throw Error("Invalid token format. Token should start with aorAAAAAG...");try{let b=await this.refreshToken(a);return{accessToken:b.accessToken,refreshToken:b.refreshToken||a,profileArn:b.profileArn,expiresIn:b.expiresIn,authMethod:"imported"}}catch(a){throw Error(`Token validation failed: ${a.message}`)}}async listAvailableProfiles(a,b="us-east-1"){(0,d.S6)(b);let c=`https://codewhisperer.${b}.amazonaws.com`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableProfiles",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({maxResults:10})});if(!e.ok){let a=await e.text();throw Error(`Failed to list profiles: ${a}`)}let f=await e.json(),g=Array.isArray(f?.profiles)?f.profiles:[],h=a=>a?.arn||a?.profileArn||null,i=g.find(a=>h(a)?.split(":")[3]===b)||g[0];return h(i)}async validateApiKey(a,b="us-east-1"){if(!a||"string"!=typeof a||!a.trim())throw Error("API key is required");let c=a.trim(),d=null;try{d=await this.listAvailableProfiles(c,b)}catch(a){throw Error(`API key validation failed: ${a.message}`)}return{accessToken:c,refreshToken:null,profileArn:d,region:b,authMethod:"api_key"}}async listAvailableModels(a,b){let c=await fetch("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableModels",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({origin:"AI_EDITOR",profileArn:b})});if(!c.ok){let a=await c.text();throw Error(`Failed to list models: ${a}`)}return((await c.json()).models||[]).map(a=>({id:a.modelId,name:a.modelName||a.modelId,description:a.description,rateMultiplier:a.rateMultiplier,rateUnit:a.rateUnit,maxInputTokens:a.tokenLimits?.maxInputTokens||0}))}extractEmailFromJWT(a){try{let b=a.split(".");if(3!==b.length)return null;let c=b[1];for(;c.length%4;)c+="=";let d=JSON.parse(atob(c.replace(/-/g,"+").replace(/_/g,"/")));return d.email||d.preferred_username||d.sub}catch{return null}}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92990:(a,b,c)=>{"use strict";c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,S6:()=>s,Td:()=>A,Tx:()=>q,WN:()=>t,Ww:()=>B,YT:()=>n,ZL:()=>m,cD:()=>o,f7:()=>y,hF:()=>l,lB:()=>w,t:()=>u,w1:()=>x});var d=c(21820),e=c(92675),f=c(45350);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.w3,...f.sr["gemini-cli"]},k={...f.sr.qwen},l={...f.sr.qoder},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr["kimi-coding"],clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||f.xq["kimi-coding"]?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.kimchi},B=3e5},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350],()=>b(b.s=3094));module.exports=c})();
|
|
1
|
+
(()=>{var a={};a.id=9069,a.ids=[9069],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10458:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{GET:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(13808),x=c(62409);async function y(a){try{let{searchParams:b}=new URL(a.url),c=b.get("provider");if(!c||!["google","github"].includes(c))return v.NextResponse.json({error:"Invalid provider. Use 'google' or 'github'"},{status:400});let{codeVerifier:d,codeChallenge:e,state:f}=(0,w.lz)(),g=new x.v().buildSocialLoginUrl(c,e,f);return v.NextResponse.json({authUrl:g,state:f,codeVerifier:d,codeChallenge:e,provider:c})}catch(a){return console.log("Kiro social authorize error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-authorize/route",pathname:"/api/oauth/kiro/social-authorize",filename:"route",bundlePath:"app/api/oauth/kiro/social-authorize/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/oauth/kiro/social-authorize/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-authorize/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},13808:(a,b,c)=>{"use strict";c.d(b,{$N:()=>f,OK:()=>g,Zl:()=>h,lz:()=>i});var d=c(55511),e=c.n(d);function f(a=32){return e().randomBytes(a).toString("base64url")}function g(a){return e().createHash("sha256").update(a).digest("base64url")}function h(){return e().randomBytes(32).toString("base64url")}function i(a=32){let b=f(a),c=g(b);return{codeVerifier:b,codeChallenge:c,state:h()}}},21820:a=>{"use strict";a.exports=require("os")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:a=>{"use strict";a.exports=require("crypto")},62409:(a,b,c)=>{"use strict";c.d(b,{v:()=>f});var d=c(92990);let e="https://prod.us-east-1.auth.desktop.kiro.dev";class f{async registerClient(a="us-east-1"){(0,d.S6)(a);let b=`https://oidc.${a}.amazonaws.com/client/register`,c=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientName:d.Tx.clientName,clientType:d.Tx.clientType,scopes:d.Tx.scopes,grantTypes:d.Tx.grantTypes,issuerUrl:d.Tx.issuerUrl})});if(!c.ok){let a=await c.text();throw Error(`Failed to register client: ${a}`)}let e=await c.json();return{clientId:e.clientId,clientSecret:e.clientSecret,clientSecretExpiresAt:e.clientSecretExpiresAt}}async startDeviceAuthorization(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/device_authorization`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,startUrl:c})});if(!g.ok){let a=await g.text();throw Error(`Failed to start device authorization: ${a}`)}let h=await g.json();return{deviceCode:h.deviceCode,userCode:h.userCode,verificationUri:h.verificationUri,verificationUriComplete:h.verificationUriComplete,expiresIn:h.expiresIn,interval:h.interval||5}}async pollDeviceToken(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/token`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,deviceCode:c,grantType:"urn:ietf:params:oauth:grant-type:device_code"})}),h=await g.json();return!g.ok||h.error?{success:!1,error:h.error,errorDescription:h.error_description,pending:"authorization_pending"===h.error||"slow_down"===h.error}:{success:!0,tokens:{accessToken:h.accessToken,refreshToken:h.refreshToken,expiresIn:h.expiresIn,tokenType:h.tokenType}}}buildSocialLoginUrl(a,b,c){return`${e}/login?idp=${"google"===a?"Google":"Github"}&redirect_uri=${encodeURIComponent("kiro://kiro.kiroAgent/authenticate-success")}&code_challenge=${b}&code_challenge_method=S256&state=${c}&prompt=select_account`}async exchangeSocialCode(a,b){let c=await fetch(`${e}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,code_verifier:b,redirect_uri:"kiro://kiro.kiroAgent/authenticate-success"})});if(!c.ok){let a=await c.text();throw Error(`Token exchange failed: ${a}`)}let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken,profileArn:d.profileArn,expiresIn:d.expiresIn||3600}}async refreshToken(a,b={}){let{authMethod:c,clientId:f,clientSecret:g,region:h}=b;if(f&&g){let b=h||"us-east-1";(0,d.S6)(b);let c=`https://oidc.${b}.amazonaws.com/token`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!e.ok){let a=await e.text();throw Error(`Token refresh failed: ${a}`)}let i=await e.json();return{accessToken:i.accessToken,refreshToken:i.refreshToken||a,profileArn:i.profileArn,expiresIn:i.expiresIn}}let i=await fetch(`${e}/refreshToken`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();throw Error(`Token refresh failed: ${a}`)}let j=await i.json();return{accessToken:j.accessToken,refreshToken:j.refreshToken||a,profileArn:j.profileArn,expiresIn:j.expiresIn||3600}}async validateImportToken(a){if(!a.startsWith("aorAAAAAG"))throw Error("Invalid token format. Token should start with aorAAAAAG...");try{let b=await this.refreshToken(a);return{accessToken:b.accessToken,refreshToken:b.refreshToken||a,profileArn:b.profileArn,expiresIn:b.expiresIn,authMethod:"imported"}}catch(a){throw Error(`Token validation failed: ${a.message}`)}}async listAvailableProfiles(a,b="us-east-1"){(0,d.S6)(b);let c=`https://codewhisperer.${b}.amazonaws.com`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableProfiles",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({maxResults:10})});if(!e.ok){let a=await e.text();throw Error(`Failed to list profiles: ${a}`)}let f=await e.json(),g=Array.isArray(f?.profiles)?f.profiles:[],h=a=>a?.arn||a?.profileArn||null,i=g.find(a=>h(a)?.split(":")[3]===b)||g[0];return h(i)}async validateApiKey(a,b="us-east-1"){if(!a||"string"!=typeof a||!a.trim())throw Error("API key is required");let c=a.trim(),d=null;try{d=await this.listAvailableProfiles(c,b)}catch(a){throw Error(`API key validation failed: ${a.message}`)}return{accessToken:c,refreshToken:null,profileArn:d,region:b,authMethod:"api_key"}}async listAvailableModels(a,b){let c=await fetch("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableModels",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({origin:"AI_EDITOR",profileArn:b})});if(!c.ok){let a=await c.text();throw Error(`Failed to list models: ${a}`)}return((await c.json()).models||[]).map(a=>({id:a.modelId,name:a.modelName||a.modelId,description:a.description,rateMultiplier:a.rateMultiplier,rateUnit:a.rateUnit,maxInputTokens:a.tokenLimits?.maxInputTokens||0}))}extractEmailFromJWT(a){try{let b=a.split(".");if(3!==b.length)return null;let c=b[1];for(;c.length%4;)c+="=";let d=JSON.parse(atob(c.replace(/-/g,"+").replace(/_/g,"/")));return d.email||d.preferred_username||d.sub}catch{return null}}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},92990:(a,b,c)=>{"use strict";c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,S6:()=>s,Td:()=>A,Tx:()=>q,WN:()=>t,Ww:()=>B,YT:()=>n,ZL:()=>m,cD:()=>o,f7:()=>y,hF:()=>l,lB:()=>w,t:()=>u,w1:()=>x});var d=c(21820),e=c(92675),f=c(45350);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.w3,...f.sr["gemini-cli"]},k={...f.sr.qwen},l={...f.sr.qoder},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}(?:-[a-z0-9]+)+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr["kimi-coding"],clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||f.xq["kimi-coding"]?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.kimchi},B=3e5},96487:()=>{}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350],()=>b(b.s=10458));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=1451,a.ids=[1451,1998],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},62409:(a,b,c)=>{c.d(b,{v:()=>f});var d=c(92990);let e="https://prod.us-east-1.auth.desktop.kiro.dev";class f{async registerClient(a="us-east-1"){(0,d.S6)(a);let b=`https://oidc.${a}.amazonaws.com/client/register`,c=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientName:d.Tx.clientName,clientType:d.Tx.clientType,scopes:d.Tx.scopes,grantTypes:d.Tx.grantTypes,issuerUrl:d.Tx.issuerUrl})});if(!c.ok){let a=await c.text();throw Error(`Failed to register client: ${a}`)}let e=await c.json();return{clientId:e.clientId,clientSecret:e.clientSecret,clientSecretExpiresAt:e.clientSecretExpiresAt}}async startDeviceAuthorization(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/device_authorization`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,startUrl:c})});if(!g.ok){let a=await g.text();throw Error(`Failed to start device authorization: ${a}`)}let h=await g.json();return{deviceCode:h.deviceCode,userCode:h.userCode,verificationUri:h.verificationUri,verificationUriComplete:h.verificationUriComplete,expiresIn:h.expiresIn,interval:h.interval||5}}async pollDeviceToken(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/token`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,deviceCode:c,grantType:"urn:ietf:params:oauth:grant-type:device_code"})}),h=await g.json();return!g.ok||h.error?{success:!1,error:h.error,errorDescription:h.error_description,pending:"authorization_pending"===h.error||"slow_down"===h.error}:{success:!0,tokens:{accessToken:h.accessToken,refreshToken:h.refreshToken,expiresIn:h.expiresIn,tokenType:h.tokenType}}}buildSocialLoginUrl(a,b,c){return`${e}/login?idp=${"google"===a?"Google":"Github"}&redirect_uri=${encodeURIComponent("kiro://kiro.kiroAgent/authenticate-success")}&code_challenge=${b}&code_challenge_method=S256&state=${c}&prompt=select_account`}async exchangeSocialCode(a,b){let c=await fetch(`${e}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,code_verifier:b,redirect_uri:"kiro://kiro.kiroAgent/authenticate-success"})});if(!c.ok){let a=await c.text();throw Error(`Token exchange failed: ${a}`)}let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken,profileArn:d.profileArn,expiresIn:d.expiresIn||3600}}async refreshToken(a,b={}){let{authMethod:c,clientId:f,clientSecret:g,region:h}=b;if(f&&g){let b=h||"us-east-1";(0,d.S6)(b);let c=`https://oidc.${b}.amazonaws.com/token`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!e.ok){let a=await e.text();throw Error(`Token refresh failed: ${a}`)}let i=await e.json();return{accessToken:i.accessToken,refreshToken:i.refreshToken||a,profileArn:i.profileArn,expiresIn:i.expiresIn}}let i=await fetch(`${e}/refreshToken`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();throw Error(`Token refresh failed: ${a}`)}let j=await i.json();return{accessToken:j.accessToken,refreshToken:j.refreshToken||a,profileArn:j.profileArn,expiresIn:j.expiresIn||3600}}async validateImportToken(a){if(!a.startsWith("aorAAAAAG"))throw Error("Invalid token format. Token should start with aorAAAAAG...");try{let b=await this.refreshToken(a);return{accessToken:b.accessToken,refreshToken:b.refreshToken||a,profileArn:b.profileArn,expiresIn:b.expiresIn,authMethod:"imported"}}catch(a){throw Error(`Token validation failed: ${a.message}`)}}async listAvailableProfiles(a,b="us-east-1"){(0,d.S6)(b);let c=`https://codewhisperer.${b}.amazonaws.com`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableProfiles",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({maxResults:10})});if(!e.ok){let a=await e.text();throw Error(`Failed to list profiles: ${a}`)}let f=await e.json(),g=Array.isArray(f?.profiles)?f.profiles:[],h=a=>a?.arn||a?.profileArn||null,i=g.find(a=>h(a)?.split(":")[3]===b)||g[0];return h(i)}async validateApiKey(a,b="us-east-1"){if(!a||"string"!=typeof a||!a.trim())throw Error("API key is required");let c=a.trim(),d=null;try{d=await this.listAvailableProfiles(c,b)}catch(a){throw Error(`API key validation failed: ${a.message}`)}return{accessToken:c,refreshToken:null,profileArn:d,region:b,authMethod:"api_key"}}async listAvailableModels(a,b){let c=await fetch("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableModels",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({origin:"AI_EDITOR",profileArn:b})});if(!c.ok){let a=await c.text();throw Error(`Failed to list models: ${a}`)}return((await c.json()).models||[]).map(a=>({id:a.modelId,name:a.modelName||a.modelId,description:a.description,rateMultiplier:a.rateMultiplier,rateUnit:a.rateUnit,maxInputTokens:a.tokenLimits?.maxInputTokens||0}))}extractEmailFromJWT(a){try{let b=a.split(".");if(3!==b.length)return null;let c=b[1];for(;c.length%4;)c+="=";let d=JSON.parse(atob(c.replace(/-/g,"+").replace(/_/g,"/")));return d.email||d.preferred_username||d.sub}catch{return null}}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87111:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(62409),x=c(71998);async function y(a){try{let{code:b,codeVerifier:c,provider:d}=await a.json();if(!b||!c)return v.NextResponse.json({error:"Missing required fields"},{status:400});if(!d||!["google","github"].includes(d))return v.NextResponse.json({error:"Invalid provider"},{status:400});let e=new w.v,f=await e.exchangeSocialCode(b,c),g=e.extractEmailFromJWT(f.accessToken),h=await (0,x.createProviderConnection)({provider:"kiro",authType:"oauth",accessToken:f.accessToken,refreshToken:f.refreshToken,expiresAt:new Date(Date.now()+1e3*f.expiresIn).toISOString(),email:g||null,providerSpecificData:{profileArn:f.profileArn,authMethod:d,provider:d.charAt(0).toUpperCase()+d.slice(1)},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:h.id,provider:h.provider,email:h.email}})}catch(a){return console.log("Kiro social exchange error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-exchange/route",pathname:"/api/oauth/kiro/social-exchange",filename:"route",bundlePath:"app/api/oauth/kiro/social-exchange/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/oauth/kiro/social-exchange/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-exchange/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},87550:a=>{a.exports=require("better-sqlite3")},92990:(a,b,c)=>{c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,S6:()=>s,Td:()=>A,Tx:()=>q,WN:()=>t,Ww:()=>B,YT:()=>n,ZL:()=>m,cD:()=>o,f7:()=>y,hF:()=>l,lB:()=>w,t:()=>u,w1:()=>x});var d=c(21820),e=c(92675),f=c(45350);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.w3,...f.sr["gemini-cli"]},k={...f.sr.qwen},l={...f.sr.qoder},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr["kimi-coding"],clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||f.xq["kimi-coding"]?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.kimchi},B=3e5},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=87111));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=1451,a.ids=[1451,1998],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44681:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{POST:()=>y});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(62409),x=c(71998);async function y(a){try{let{code:b,codeVerifier:c,provider:d}=await a.json();if(!b||!c)return v.NextResponse.json({error:"Missing required fields"},{status:400});if(!d||!["google","github"].includes(d))return v.NextResponse.json({error:"Invalid provider"},{status:400});let e=new w.v,f=await e.exchangeSocialCode(b,c),g=e.extractEmailFromJWT(f.accessToken),h=await (0,x.createProviderConnection)({provider:"kiro",authType:"oauth",accessToken:f.accessToken,refreshToken:f.refreshToken,expiresAt:new Date(Date.now()+1e3*f.expiresIn).toISOString(),email:g||null,providerSpecificData:{profileArn:f.profileArn,authMethod:d,provider:d.charAt(0).toUpperCase()+d.slice(1)},testStatus:"active"});return v.NextResponse.json({success:!0,connection:{id:h.id,provider:h.provider,email:h.email}})}catch(a){return console.log("Kiro social exchange error:",a),v.NextResponse.json({error:a.message},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/oauth/kiro/social-exchange/route",pathname:"/api/oauth/kiro/social-exchange",filename:"route",bundlePath:"app/api/oauth/kiro/social-exchange/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/oauth/kiro/social-exchange/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/oauth/kiro/social-exchange/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},62409:(a,b,c)=>{c.d(b,{v:()=>f});var d=c(92990);let e="https://prod.us-east-1.auth.desktop.kiro.dev";class f{async registerClient(a="us-east-1"){(0,d.S6)(a);let b=`https://oidc.${a}.amazonaws.com/client/register`,c=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientName:d.Tx.clientName,clientType:d.Tx.clientType,scopes:d.Tx.scopes,grantTypes:d.Tx.grantTypes,issuerUrl:d.Tx.issuerUrl})});if(!c.ok){let a=await c.text();throw Error(`Failed to register client: ${a}`)}let e=await c.json();return{clientId:e.clientId,clientSecret:e.clientSecret,clientSecretExpiresAt:e.clientSecretExpiresAt}}async startDeviceAuthorization(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/device_authorization`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,startUrl:c})});if(!g.ok){let a=await g.text();throw Error(`Failed to start device authorization: ${a}`)}let h=await g.json();return{deviceCode:h.deviceCode,userCode:h.userCode,verificationUri:h.verificationUri,verificationUriComplete:h.verificationUriComplete,expiresIn:h.expiresIn,interval:h.interval||5}}async pollDeviceToken(a,b,c,e="us-east-1"){(0,d.S6)(e);let f=`https://oidc.${e}.amazonaws.com/token`,g=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:a,clientSecret:b,deviceCode:c,grantType:"urn:ietf:params:oauth:grant-type:device_code"})}),h=await g.json();return!g.ok||h.error?{success:!1,error:h.error,errorDescription:h.error_description,pending:"authorization_pending"===h.error||"slow_down"===h.error}:{success:!0,tokens:{accessToken:h.accessToken,refreshToken:h.refreshToken,expiresIn:h.expiresIn,tokenType:h.tokenType}}}buildSocialLoginUrl(a,b,c){return`${e}/login?idp=${"google"===a?"Google":"Github"}&redirect_uri=${encodeURIComponent("kiro://kiro.kiroAgent/authenticate-success")}&code_challenge=${b}&code_challenge_method=S256&state=${c}&prompt=select_account`}async exchangeSocialCode(a,b){let c=await fetch(`${e}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:a,code_verifier:b,redirect_uri:"kiro://kiro.kiroAgent/authenticate-success"})});if(!c.ok){let a=await c.text();throw Error(`Token exchange failed: ${a}`)}let d=await c.json();return{accessToken:d.accessToken,refreshToken:d.refreshToken,profileArn:d.profileArn,expiresIn:d.expiresIn||3600}}async refreshToken(a,b={}){let{authMethod:c,clientId:f,clientSecret:g,region:h}=b;if(f&&g){let b=h||"us-east-1";(0,d.S6)(b);let c=`https://oidc.${b}.amazonaws.com/token`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:f,clientSecret:g,refreshToken:a,grantType:"refresh_token"})});if(!e.ok){let a=await e.text();throw Error(`Token refresh failed: ${a}`)}let i=await e.json();return{accessToken:i.accessToken,refreshToken:i.refreshToken||a,profileArn:i.profileArn,expiresIn:i.expiresIn}}let i=await fetch(`${e}/refreshToken`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:a})});if(!i.ok){let a=await i.text();throw Error(`Token refresh failed: ${a}`)}let j=await i.json();return{accessToken:j.accessToken,refreshToken:j.refreshToken||a,profileArn:j.profileArn,expiresIn:j.expiresIn||3600}}async validateImportToken(a){if(!a.startsWith("aorAAAAAG"))throw Error("Invalid token format. Token should start with aorAAAAAG...");try{let b=await this.refreshToken(a);return{accessToken:b.accessToken,refreshToken:b.refreshToken||a,profileArn:b.profileArn,expiresIn:b.expiresIn,authMethod:"imported"}}catch(a){throw Error(`Token validation failed: ${a.message}`)}}async listAvailableProfiles(a,b="us-east-1"){(0,d.S6)(b);let c=`https://codewhisperer.${b}.amazonaws.com`,e=await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableProfiles",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({maxResults:10})});if(!e.ok){let a=await e.text();throw Error(`Failed to list profiles: ${a}`)}let f=await e.json(),g=Array.isArray(f?.profiles)?f.profiles:[],h=a=>a?.arn||a?.profileArn||null,i=g.find(a=>h(a)?.split(":")[3]===b)||g[0];return h(i)}async validateApiKey(a,b="us-east-1"){if(!a||"string"!=typeof a||!a.trim())throw Error("API key is required");let c=a.trim(),d=null;try{d=await this.listAvailableProfiles(c,b)}catch(a){throw Error(`API key validation failed: ${a.message}`)}return{accessToken:c,refreshToken:null,profileArn:d,region:b,authMethod:"api_key"}}async listAvailableModels(a,b){let c=await fetch("https://codewhisperer.us-east-1.amazonaws.com",{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.0","x-amz-target":"AmazonCodeWhispererService.ListAvailableModels",Authorization:`Bearer ${a}`,Accept:"application/json"},body:JSON.stringify({origin:"AI_EDITOR",profileArn:b})});if(!c.ok){let a=await c.text();throw Error(`Failed to list models: ${a}`)}return((await c.json()).models||[]).map(a=>({id:a.modelId,name:a.modelName||a.modelId,description:a.description,rateMultiplier:a.rateMultiplier,rateUnit:a.rateUnit,maxInputTokens:a.tokenLimits?.maxInputTokens||0}))}extractEmailFromJWT(a){try{let b=a.split(".");if(3!==b.length)return null;let c=b[1];for(;c.length%4;)c+="=";let d=JSON.parse(atob(c.replace(/-/g,"+").replace(/_/g,"/")));return d.email||d.preferred_username||d.sub}catch{return null}}}},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},92990:(a,b,c)=>{c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,S6:()=>s,Td:()=>A,Tx:()=>q,WN:()=>t,Ww:()=>B,YT:()=>n,ZL:()=>m,cD:()=>o,f7:()=>y,hF:()=>l,lB:()=>w,t:()=>u,w1:()=>x});var d=c(21820),e=c(92675),f=c(45350);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.w3,...f.sr["gemini-cli"]},k={...f.sr.qwen},l={...f.sr.qoder},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}(?:-[a-z0-9]+)+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr["kimi-coding"],clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||f.xq["kimi-coding"]?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.kimchi},B=3e5},94735:a=>{a.exports=require("events")}};var b=require("../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=44681));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=8948,a.ids=[8948],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41625:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{DELETE:()=>A,GET:()=>y,GET_DEFAULTS:()=>B,PATCH:()=>z});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(44776),x=c(84646);async function y(){try{let a=await (0,w.r4)();return v.NextResponse.json(a)}catch(a){return console.error("Error fetching pricing:",a),v.NextResponse.json({error:"Failed to fetch pricing"},{status:500})}}async function z(a){try{let b=await a.json();if("object"!=typeof b||null===b)return v.NextResponse.json({error:"Invalid pricing data format"},{status:400});for(let[a,c]of Object.entries(b)){if("object"!=typeof c||null===c)return v.NextResponse.json({error:`Invalid pricing for provider: ${a}`},{status:400});for(let[b,d]of Object.entries(c)){if("object"!=typeof d||null===d)return v.NextResponse.json({error:`Invalid pricing for model: ${a}/${b}`},{status:400});let c=["input","output","cached","reasoning","cache_creation"];for(let[e,f]of Object.entries(d)){if(!c.includes(e))return v.NextResponse.json({error:`Invalid pricing field: ${e} for ${a}/${b}`},{status:400});if("number"!=typeof f||isNaN(f)||f<0)return v.NextResponse.json({error:`Invalid pricing value for ${e} in ${a}/${b}: must be non-negative number`},{status:400})}}}let c=await (0,w.KJ)(b);return v.NextResponse.json(c)}catch(a){return console.error("Error updating pricing:",a),v.NextResponse.json({error:"Failed to update pricing"},{status:500})}}async function A(a){try{let{searchParams:b}=new URL(a.url),c=b.get("provider"),d=b.get("model");c&&d?await (0,w.yF)(c,d):c?await (0,w.yF)(c):await (0,w.VT)();let e=await (0,w.r4)();return v.NextResponse.json(e)}catch(a){return console.error("Error resetting pricing:",a),v.NextResponse.json({error:"Failed to reset pricing"},{status:500})}}async function B(){try{let a=(0,x.ad)();return v.NextResponse.json(a)}catch(a){return console.error("Error fetching default pricing:",a),v.NextResponse.json({error:"Failed to fetch default pricing"},{status:500})}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/pricing/route",pathname:"/api/pricing",filename:"route",bundlePath:"app/api/pricing/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/pricing/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/pricing/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||C.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===C.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),b}},k=await C.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776,4646],()=>b(b.s=41625));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=8948,a.ids=[8948],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87326:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{DELETE:()=>A,GET:()=>y,GET_DEFAULTS:()=>B,PATCH:()=>z});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(44776),x=c(84646);async function y(){try{let a=await (0,w.r4)();return v.NextResponse.json(a)}catch(a){return console.error("Error fetching pricing:",a),v.NextResponse.json({error:"Failed to fetch pricing"},{status:500})}}async function z(a){try{let b=await a.json();if("object"!=typeof b||null===b)return v.NextResponse.json({error:"Invalid pricing data format"},{status:400});for(let[a,c]of Object.entries(b)){if("object"!=typeof c||null===c)return v.NextResponse.json({error:`Invalid pricing for provider: ${a}`},{status:400});for(let[b,d]of Object.entries(c)){if("object"!=typeof d||null===d)return v.NextResponse.json({error:`Invalid pricing for model: ${a}/${b}`},{status:400});let c=["input","output","cached","reasoning","cache_creation"];for(let[e,f]of Object.entries(d)){if(!c.includes(e))return v.NextResponse.json({error:`Invalid pricing field: ${e} for ${a}/${b}`},{status:400});if("number"!=typeof f||isNaN(f)||f<0)return v.NextResponse.json({error:`Invalid pricing value for ${e} in ${a}/${b}: must be non-negative number`},{status:400})}}}let c=await (0,w.KJ)(b);return v.NextResponse.json(c)}catch(a){return console.error("Error updating pricing:",a),v.NextResponse.json({error:"Failed to update pricing"},{status:500})}}async function A(a){try{let{searchParams:b}=new URL(a.url),c=b.get("provider"),d=b.get("model");c&&d?await (0,w.yF)(c,d):c?await (0,w.yF)(c):await (0,w.VT)();let e=await (0,w.r4)();return v.NextResponse.json(e)}catch(a){return console.error("Error resetting pricing:",a),v.NextResponse.json({error:"Failed to reset pricing"},{status:500})}}async function B(){try{let a=(0,x.ad)();return v.NextResponse.json(a)}catch(a){return console.error("Error fetching default pricing:",a),v.NextResponse.json({error:"Failed to fetch default pricing"},{status:500})}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/pricing/route",pathname:"/api/pricing",filename:"route",bundlePath:"app/api/pricing/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/pricing/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/pricing/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||C.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===C.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),b}},k=await C.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776,4646],()=>b(b.s=87326));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=5745,a.ids=[1998,5745],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},73130:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{DELETE:()=>y,PUT:()=>x});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998);async function x(a,{params:b}){try{let{id:c}=await b,{name:d,apiType:e,baseUrl:f}=await a.json(),g=await (0,w.Qu)(c);if(!g)return v.NextResponse.json({error:"Provider node not found"},{status:404});if(!d?.trim())return v.NextResponse.json({error:"Name is required"},{status:400});if("openai-compatible"===g.type&&(!e||!["chat","responses"].includes(e)))return v.NextResponse.json({error:"Invalid OpenAI compatible API type"},{status:400});if(!f?.trim())return v.NextResponse.json({error:"Base URL is required"},{status:400});let h=f.trim();"anthropic-compatible"===g.type&&(h=h.replace(/\/$/,"")).endsWith("/messages")&&(h=h.slice(0,-9)),"custom-embedding"===g.type&&(h=h.replace(/\/$/,"")).endsWith("/embeddings")&&(h=h.slice(0,-11));let i=(g.prefix||"").trim()||d.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-"),j={name:d.trim(),prefix:i,baseUrl:h};"openai-compatible"===g.type&&(j.apiType=e);let k=await (0,w.ho)(c,j),l=await (0,w.P)({provider:c});return await Promise.all(l.map(a=>(0,w.rj)(a.id,{providerSpecificData:{...a.providerSpecificData||{},prefix:i,apiType:"openai-compatible"===g.type?e:void 0,baseUrl:h,nodeName:k.name}}))),v.NextResponse.json({node:k})}catch(a){return console.log("Error updating provider node:",a),v.NextResponse.json({error:"Failed to update provider node"},{status:500})}}async function y(a,{params:b}){try{let{id:a}=await b;if(!await (0,w.Qu)(a))return v.NextResponse.json({error:"Provider node not found"},{status:404});return await (0,w.op)(a),await (0,w.Pc)(a),v.NextResponse.json({success:!0})}catch(a){return console.log("Error deleting provider node:",a),v.NextResponse.json({error:"Failed to delete provider node"},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/provider-nodes/[id]/route",pathname:"/api/provider-nodes/[id]",filename:"route",bundlePath:"app/api/provider-nodes/[id]/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/provider-nodes/[id]/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-nodes/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=73130));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=5745,a.ids=[1998,5745],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")},99808:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>E,patchFetch:()=>D,routeModule:()=>z,serverHooks:()=>C,workAsyncStorage:()=>A,workUnitAsyncStorage:()=>B});var d={};c.r(d),c.d(d,{DELETE:()=>y,PUT:()=>x});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998);async function x(a,{params:b}){try{let{id:c}=await b,{name:d,apiType:e,baseUrl:f}=await a.json(),g=await (0,w.Qu)(c);if(!g)return v.NextResponse.json({error:"Provider node not found"},{status:404});if(!d?.trim())return v.NextResponse.json({error:"Name is required"},{status:400});if("openai-compatible"===g.type&&(!e||!["chat","responses"].includes(e)))return v.NextResponse.json({error:"Invalid OpenAI compatible API type"},{status:400});if(!f?.trim())return v.NextResponse.json({error:"Base URL is required"},{status:400});let h=f.trim();"anthropic-compatible"===g.type&&(h=h.replace(/\/$/,"")).endsWith("/messages")&&(h=h.slice(0,-9)),"custom-embedding"===g.type&&(h=h.replace(/\/$/,"")).endsWith("/embeddings")&&(h=h.slice(0,-11));let i=(g.prefix||"").trim()||d.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-"),j={name:d.trim(),prefix:i,baseUrl:h};"openai-compatible"===g.type&&(j.apiType=e);let k=await (0,w.ho)(c,j),l=await (0,w.P)({provider:c});return await Promise.all(l.map(a=>(0,w.rj)(a.id,{providerSpecificData:{...a.providerSpecificData||{},prefix:i,apiType:"openai-compatible"===g.type?e:void 0,baseUrl:h,nodeName:k.name}}))),v.NextResponse.json({node:k})}catch(a){return console.log("Error updating provider node:",a),v.NextResponse.json({error:"Failed to update provider node"},{status:500})}}async function y(a,{params:b}){try{let{id:a}=await b;if(!await (0,w.Qu)(a))return v.NextResponse.json({error:"Provider node not found"},{status:404});return await (0,w.op)(a),await (0,w.Pc)(a),v.NextResponse.json({success:!0})}catch(a){return console.log("Error deleting provider node:",a),v.NextResponse.json({error:"Failed to delete provider node"},{status:500})}}let z=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/provider-nodes/[id]/route",pathname:"/api/provider-nodes/[id]",filename:"route",bundlePath:"app/api/provider-nodes/[id]/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/provider-nodes/[id]/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:B,serverHooks:C}=z;function D(){return(0,g.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:B})}async function E(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),z.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-nodes/[id]/route";"/index"===d&&(d="/");let e=await z.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:A,prerenderManifest:B,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(B.dynamicRoutes[I]||B.routes[F]),K=async()=>((null==C?void 0:C.render404)?await C.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!A){let a=!!B.routes[F],b=B.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||z.isDev||A||(L="/index"===(L=F)?"/":L);let M=!0===z.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==C?void 0:C.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await z.getIncrementalCache(a,x,B,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:B.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>z.onRequestError(a,b,d,e,C)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>z.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await z.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),b}},k=await z.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:B,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),A&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await z.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,C),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=99808));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=2121,a.ids=[1998,2121],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81681:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,POST:()=>B,dynamic:()=>z});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998),x=c(40615);let y=c(47293).A,z="force-dynamic";async function A(){try{let a=await (0,w.Fh)();return v.NextResponse.json({nodes:a})}catch(a){return console.log("Error fetching provider nodes:",a),v.NextResponse.json({error:"Failed to fetch provider nodes"},{status:500})}}async function B(a){try{let{name:b,apiType:c,baseUrl:d,type:e}=await a.json();if(!b?.trim())return v.NextResponse.json({error:"Name is required"},{status:400});let f=await (0,w.Fh)(),g=function(a,b=[],c=[],d=""){let e=c instanceof Set?c:new Set(c||[]),f=new Set((b||[]).map(a=>(a?.prefix||"").trim()).filter(Boolean));if(d&&!e.has(d)&&!f.has(d)||d&&((b||[]).some(a=>a?.prefix===d&&a?.id!==void 0),d&&!e.has(d))&&0===(b||[]).filter(a=>a?.prefix===d).length)return d;let g=String(a||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"custom";if(!e.has(g)&&!f.has(g))return g;for(let a=2;a<1e3;a++){let b=`${g}-${a}`.slice(0,48);if(!e.has(b)&&!f.has(b))return b}return`${g}-${Date.now().toString(36)}`.slice(0,48)}(b.trim(),f),h=e||"openai-compatible";if("openai-compatible"===h){if(!c||!["chat","responses"].includes(c))return v.NextResponse.json({error:"Invalid OpenAI compatible API type"},{status:400});let a=await (0,w.i0)({id:`${x.JH}${c}-${y()}`,type:"openai-compatible",prefix:g,apiType:c,baseUrl:(d||"https://api.openai.com/v1").trim(),name:b.trim()});return v.NextResponse.json({node:a},{status:201})}if("custom-embedding"===h){let a=(d||"https://api.openai.com/v1").trim().replace(/\/$/,"");a.endsWith("/embeddings")&&(a=a.slice(0,-11));let c=await (0,w.i0)({id:`${x.Pd}${y()}`,type:"custom-embedding",prefix:g,baseUrl:a,name:b.trim()});return v.NextResponse.json({node:c},{status:201})}if("anthropic-compatible"===h){let a=(d||"https://api.anthropic.com/v1").trim().replace(/\/$/,"");a.endsWith("/messages")&&(a=a.slice(0,-9));let c=await (0,w.i0)({id:`${x.DI}${y()}`,type:"anthropic-compatible",prefix:g,baseUrl:a,name:b.trim()});return v.NextResponse.json({node:c},{status:201})}return v.NextResponse.json({error:"Invalid provider node type"},{status:400})}catch(a){return console.log("Error creating provider node:",a),v.NextResponse.json({error:"Failed to create provider node"},{status:500})}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/provider-nodes/route",pathname:"/api/provider-nodes",filename:"route",bundlePath:"app/api/provider-nodes/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/provider-nodes/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-nodes/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||C.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===C.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),b}},k=await C.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=81681));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=2121,a.ids=[1998,2121],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},47293:(a,b,c)=>{c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},71998:(a,b,c)=>{c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.OM,P:()=>d.getProviderConnections,Pc:()=>d.Pc,Qu:()=>d.Qu,S8:()=>d.S8,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fp:()=>d.fp,fv:()=>d.fv,ho:()=>d.ho,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,py:()=>d.py,rj:()=>d.updateProviderConnection,uL:()=>d.uL,uv:()=>d.uv});var d=c(44776)},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79868:a=>{a.exports=require("node:sqlite")},81240:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{GET:()=>A,POST:()=>B,dynamic:()=>z});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(71998),x=c(40615);let y=c(47293).A,z="force-dynamic";async function A(){try{let a=await (0,w.Fh)();return v.NextResponse.json({nodes:a})}catch(a){return console.log("Error fetching provider nodes:",a),v.NextResponse.json({error:"Failed to fetch provider nodes"},{status:500})}}async function B(a){try{let{name:b,apiType:c,baseUrl:d,type:e}=await a.json();if(!b?.trim())return v.NextResponse.json({error:"Name is required"},{status:400});let f=await (0,w.Fh)(),g=function(a,b=[],c=[],d=""){let e=c instanceof Set?c:new Set(c||[]),f=new Set((b||[]).map(a=>(a?.prefix||"").trim()).filter(Boolean));if(d&&!e.has(d)&&!f.has(d)||d&&((b||[]).some(a=>a?.prefix===d&&a?.id!==void 0),d&&!e.has(d))&&0===(b||[]).filter(a=>a?.prefix===d).length)return d;let g=String(a||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"custom";if(!e.has(g)&&!f.has(g))return g;for(let a=2;a<1e3;a++){let b=`${g}-${a}`.slice(0,48);if(!e.has(b)&&!f.has(b))return b}return`${g}-${Date.now().toString(36)}`.slice(0,48)}(b.trim(),f),h=e||"openai-compatible";if("openai-compatible"===h){if(!c||!["chat","responses"].includes(c))return v.NextResponse.json({error:"Invalid OpenAI compatible API type"},{status:400});let a=await (0,w.i0)({id:`${x.JH}${c}-${y()}`,type:"openai-compatible",prefix:g,apiType:c,baseUrl:(d||"https://api.openai.com/v1").trim(),name:b.trim()});return v.NextResponse.json({node:a},{status:201})}if("custom-embedding"===h){let a=(d||"https://api.openai.com/v1").trim().replace(/\/$/,"");a.endsWith("/embeddings")&&(a=a.slice(0,-11));let c=await (0,w.i0)({id:`${x.Pd}${y()}`,type:"custom-embedding",prefix:g,baseUrl:a,name:b.trim()});return v.NextResponse.json({node:c},{status:201})}if("anthropic-compatible"===h){let a=(d||"https://api.anthropic.com/v1").trim().replace(/\/$/,"");a.endsWith("/messages")&&(a=a.slice(0,-9));let c=await (0,w.i0)({id:`${x.DI}${y()}`,type:"anthropic-compatible",prefix:g,baseUrl:a,name:b.trim()});return v.NextResponse.json({node:c},{status:201})}return v.NextResponse.json({error:"Invalid provider node type"},{status:400})}catch(a){return console.log("Error creating provider node:",a),v.NextResponse.json({error:"Failed to create provider node"},{status:500})}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/provider-nodes/route",pathname:"/api/provider-nodes",filename:"route",bundlePath:"app/api/provider-nodes/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/provider-nodes/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-nodes/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||C.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===C.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),b}},k=await C.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,7141,5350,869,3986,4776],()=>b(b.s=81240));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=8814,a.ids=[8814],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28792:(a,b,c)=>{c.d(b,{p:()=>f});var d=c(77598),e=c.n(d);function f(a){let b=(process.env.MANAGEMENT_TOKEN||"").trim();if(!b)return!1;let c=a?.headers?.get?.("authorization")||"";if(!c.startsWith("Bearer "))return!1;let d=c.slice(7).trim();if(!d)return!1;let f=e().createHash("sha256").update(d).digest(),g=e().createHash("sha256").update(b).digest();return e().timingSafeEqual(f,g)}},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41460:(a,b,c)=>{c.d(b,{cb:()=>h,gN:()=>i,nF:()=>f});var d=c(54603),e=c(38044);let f="x-switchboard-cli-token",g=null;async function h(){return g||(g=await (0,d.Xj)("switchboard-cli-auth")),g}async function i(a){let b=a?.headers?.get?.(f);return!!b&&(0,e.lO)(b,await h())}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},52430:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{POST:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(88556),x=c(68658);let y=(a,b,c=1e4)=>fetch(a,{...b,signal:AbortSignal.timeout(c),redirect:"error"}),z=a=>401===a||403===a?"API key unauthorized":404===a?"/models endpoint not found - try chat validation with model ID":a>=500?"Server error - try again later":`Unexpected response (${a})`,A=a=>401===a||403===a?"API key unauthorized":400===a?"Invalid model or bad request":404===a?"Chat endpoint not found":a>=500?"Server error - try again later":`Chat request failed (${a})`;async function B(a){try{let{baseUrl:b,apiKey:c,type:d,modelId:e}=await a.json();if(!b||!c)return v.NextResponse.json({error:"Base URL and API key required"},{status:400});if(!(a=>{try{return new URL(a),!0}catch{return!1}})(b))return v.NextResponse.json({error:"Invalid URL format"},{status:400});if(!(0,x.v5)(a))try{await (0,w.h)(b)}catch{return v.NextResponse.json({error:"URL not allowed"},{status:400})}if("custom-embedding"===d){let a=b.trim().replace(/\/$/,"");if(!e?.trim())return v.NextResponse.json({valid:!1,error:"Model ID required for embedding validation"});let d=await y(`${a}/embeddings`,{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json"},body:JSON.stringify({model:e.trim(),input:"ping"})});if(d.ok){let a=await d.json().catch(()=>null),b=Array.isArray(a?.data?.[0]?.embedding)?a.data[0].embedding.length:null;return v.NextResponse.json({valid:!0,method:"embeddings",dimensions:b})}if(401===d.status||403===d.status)return v.NextResponse.json({valid:!1,error:"API key unauthorized"});let f=await d.text().catch(()=>"");return v.NextResponse.json({valid:!1,error:`Embeddings request failed (${d.status})${f?`: ${f.slice(0,200)}`:""}`,method:"embeddings"})}if("anthropic-compatible"===d){let a=b.trim().replace(/\/$/,"");a.endsWith("/messages")&&(a=a.slice(0,-9));let d=`${a}/models`,f=await y(d,{method:"GET",headers:{"x-api-key":c,"anthropic-version":"2023-06-01",Authorization:`Bearer ${c}`}});if(f.ok)return v.NextResponse.json({valid:!0});if(401===f.status||403===f.status)return v.NextResponse.json({valid:!1,error:"API key unauthorized"});if(e){let b=await y(`${a}/chat/completions`,{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json","x-api-key":c,"anthropic-version":"2023-06-01"},body:JSON.stringify({model:e,messages:[{role:"user",content:"ping"}],max_tokens:1})});if(b.ok)return v.NextResponse.json({valid:!0,method:"chat"});return v.NextResponse.json({valid:!1,error:A(b.status),method:"chat"})}return v.NextResponse.json({valid:!1,error:z(f.status)})}let f=`${b.replace(/\/$/,"")}/models`,g=await y(f,{headers:{Authorization:`Bearer ${c}`}});if(g.ok)return v.NextResponse.json({valid:!0});if(401===g.status||403===g.status)return v.NextResponse.json({valid:!1,error:"API key unauthorized"});if(e){let a=await y(`${b.replace(/\/$/,"")}/chat/completions`,{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json"},body:JSON.stringify({model:e,messages:[{role:"user",content:"ping"}],max_tokens:1})});if(a.ok)return v.NextResponse.json({valid:!0,method:"chat"});return v.NextResponse.json({valid:!1,error:A(a.status),method:"chat"})}return v.NextResponse.json({valid:!1,error:z(g.status)})}catch(b){let a=b.cause?.code==="ECONNREFUSED"?"Connection refused - provider node offline or unreachable":b.cause?.code==="ENOTFOUND"?"DNS lookup failed - invalid domain or network issue":b.cause?.code==="ETIMEDOUT"?"Connection timeout - provider node too slow":b.message.includes("timeout")?"Request timeout (>10s) - provider node not responding":b.cause?.code==="CERT_HAS_EXPIRED"?"SSL certificate expired":b.cause?.code==="UNABLE_TO_VERIFY_LEAF_SIGNATURE"?"SSL certificate verification failed":b.cause?.code?`Network error: ${b.cause.code}`:"Network connection failed - check URL and network connectivity";return console.error("Error validating provider node:",{message:b.message,cause:b.cause,code:b.cause?.code,userMessage:a}),v.NextResponse.json({valid:!1,error:a},{status:500})}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/provider-nodes/validate/route",pathname:"/api/provider-nodes/validate",filename:"route",bundlePath:"app/api/provider-nodes/validate/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/provider-nodes/validate/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-nodes/validate/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||C.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===C.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),b}},k=await C.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.nJ,"machine-id"),m=h().join(k.nJ,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||function(){if(process.env.MACHINE_ID_SALT)return process.env.MACHINE_ID_SALT;let a=h().join(m,"machine-id-salt");try{let b=f().readFileSync(a,"utf8").trim();if(b)return b}catch{}let b=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0,mode:448}),f().writeFileSync(a,b,{mode:384})}catch{}return b}(),c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.nJ,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="switchboard-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68658:(a,b,c)=>{c.d(b,{v5:()=>j}),c(23211);var d=c(44776),e=(c(41460),c(28792));let f=new Set(["localhost","127.0.0.1","::1"]);function g(a){if(!a)return"";let b=String(a).trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");if(-1===a)return"";b=b.slice(1,a)}else 2===b.split(":").length&&(b=b.slice(0,b.indexOf(":")));return b.startsWith("::ffff:")&&(b=b.slice(7)),b}function h(a){let b=g(a);return!!b&&(f.has(b)||/^127\.\d+\.\d+\.\d+$/.test(b))}function i(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){let b=Number(a);if(!/^\d{1,3}$/.test(a)||b>255)return null;c=256*c+b}return c}function j(a){let b;if(a.headers.get("x-switchboard-via-proxy")||!("1"===process.env.SWITCHBOARD_TRUST_REAL_IP?!!(b=g(a.headers.get("x-switchboard-real-ip")))&&(h(b)||function(a){let b=process.env.SWITCHBOARD_LOCAL_PEERS;if(!b)return!1;let c=i(a);for(let d of b.split(",")){let b=d.trim();if(!b)continue;let[e,f]=b.split("/");if(void 0===f){if(b.toLowerCase()===a)return!0;continue}let g=i(e),h=Number(f);if(null===c||null===g||!Number.isInteger(h)||h<0||h>32)continue;let j=0===h?0:-1<<32-h>>>0;if((c&j)>>>0==(g&j)>>>0)return!0}return!1}(b)):h(process.env.HOSTNAME))||!h(a.headers.get("host")))return!1;let c=a.headers.get("origin");if(c)try{if(!h(new URL(c).hostname))return!1}catch{return!1}return!0}e.p},71553:a=>{a.exports=require("node:dns/promises")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},83204:(a,b,c)=>{c.d(b,{P:()=>p,h:()=>q});var d=c(71553),e=c(77030);let f=new Set(["localhost","ip6-localhost","ip6-loopback","metadata.google.internal"]),g=[".internal",".local",".localhost"];function h(a){return String(a).toLowerCase().replace(/^\[|\]$/g,"")}function i(a){if(!a)return null;let b=new Set((Array.isArray(a)?a:[a]).map(h).filter(Boolean));return b.size?b:null}function j(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){if(!/^\d{1,3}$/.test(a))return null;let b=Number(a);if(b>255)return null;c=256*c+b}return c>>>0}let k=[[j("0.0.0.0"),8],[j("10.0.0.0"),8],[j("127.0.0.0"),8],[j("169.254.0.0"),16],[j("172.16.0.0"),12],[j("192.168.0.0"),16],[j("100.64.0.0"),10]];function l(a){return k.some(([b,c])=>{let d=0===c?0:0xffffffff<<32-c>>>0;return(a&d)==(b&d)})}function m(a){let b=j(a);return null!==b&&l(b)}function n(a){let b=a.replace(/^\[|\]$/g,"").toLowerCase(),c=b.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/),d=c?.[1]||function(a){let b=a.split("::");if(b.length>2)return null;let c=b[0]?b[0].split(":").filter(Boolean):[],d=2===b.length&&b[1]?b[1].split(":").filter(Boolean):[],e=8-c.length-d.length;if(e<0||1===b.length&&0!==e)return null;let f=[...c,...Array(e).fill("0"),...d];if(8!==f.length||f.slice(0,5).some(a=>"0"!==a)||"ffff"!==f[5])return null;let g=Number.parseInt(f[6],16),h=Number.parseInt(f[7],16);return[g,h].every(a=>Number.isInteger(a)&&a>=0&&a<=65535)?`${g>>>8}.${255&g}.${h>>>8}.${255&h}`:null}(b);return d?m(d):"::1"===b||"::"===b||b.startsWith("fe80:")||b.startsWith("fc")||b.startsWith("fd")}function o(a,b=null){let c=h(a);if(b?.has(c))return;if(f.has(c)||g.some(a=>c.endsWith(a)))throw Error("Blocked URL: internal host");let d=function(a){if(/^\d+$/.test(a)){let b=Number(a);if(Number.isSafeInteger(b)&&b>=0&&b<=0xffffffff)return b>>>0}if(/^0x[0-9a-f]+$/i.test(a)){let b=parseInt(a,16);if(Number.isFinite(b)&&b>=0&&b<=0xffffffff)return b>>>0}let b=a.split(".");if(4===b.length&&b.every(a=>/^(0x[0-9a-f]+|0[0-7]*|[1-9]\d*)$/i.test(a))){let a=0;for(let c of b){let b;if(!Number.isFinite(b=/^0x/i.test(c)?parseInt(c,16):c.startsWith("0")&&c.length>1?parseInt(c,8):parseInt(c,10))||b<0||b>255)return null;a=256*a+b}return a>>>0}return null}(c);if(null!==d&&l(d)||m(c)||c.includes(":")&&n(c)||4===(0,e.isIP)(c)&&m(c)||6===(0,e.isIP)(c)&&n(c))throw Error("Blocked URL: private IP")}function p(a,b=null){let c;try{c=new URL(a)}catch{throw Error("Blocked URL: invalid URL")}if("http:"!==c.protocol&&"https:"!==c.protocol)throw Error("Blocked URL: unsupported scheme");o(c.hostname,i(b))}async function q(a,b=null){let c,f=i(b);p(a,b);let g=h(new URL(a).hostname);if(!f?.has(g)&&!(0,e.isIP)(g)){try{c=await (0,d.lookup)(g,{all:!0,verbatim:!0})}catch{throw Error("Blocked URL: DNS resolution failed")}if(!c?.length)throw Error("Blocked URL: DNS resolution failed");for(let a of c)o(a.address,f)}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},88556:(a,b,c)=>{c.d(b,{P:()=>d.P,h:()=>d.h});var d=c(83204)},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9613,7141,5350,869,3986,4776],()=>b(b.s=52430));module.exports=c})();
|
|
1
|
+
"use strict";(()=>{var a={};a.id=8814,a.ids=[8814],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},28792:(a,b,c)=>{c.d(b,{p:()=>f});var d=c(77598),e=c.n(d);function f(a){let b=(process.env.MANAGEMENT_TOKEN||"").trim();if(!b)return!1;let c=a?.headers?.get?.("authorization")||"";if(!c.startsWith("Bearer "))return!1;let d=c.slice(7).trim();if(!d)return!1;let f=e().createHash("sha256").update(d).digest(),g=e().createHash("sha256").update(b).digest();return e().timingSafeEqual(f,g)}},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},41460:(a,b,c)=>{c.d(b,{cb:()=>h,gN:()=>i,nF:()=>f});var d=c(54603),e=c(38044);let f="x-switchboard-cli-token",g=null;async function h(){return g||(g=await (0,d.Xj)("switchboard-cli-auth")),g}async function i(a){let b=a?.headers?.get?.(f);return!!b&&(0,e.lO)(b,await h())}},43504:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>H,patchFetch:()=>G,routeModule:()=>C,serverHooks:()=>F,workAsyncStorage:()=>D,workUnitAsyncStorage:()=>E});var d={};c.r(d),c.d(d,{POST:()=>B});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(88556),x=c(68658);let y=(a,b,c=1e4)=>fetch(a,{...b,signal:AbortSignal.timeout(c),redirect:"error"}),z=a=>401===a||403===a?"API key unauthorized":404===a?"/models endpoint not found - try chat validation with model ID":a>=500?"Server error - try again later":`Unexpected response (${a})`,A=a=>401===a||403===a?"API key unauthorized":400===a?"Invalid model or bad request":404===a?"Chat endpoint not found":a>=500?"Server error - try again later":`Chat request failed (${a})`;async function B(a){try{let{baseUrl:b,apiKey:c,type:d,modelId:e}=await a.json();if(!b||!c)return v.NextResponse.json({error:"Base URL and API key required"},{status:400});if(!(a=>{try{return new URL(a),!0}catch{return!1}})(b))return v.NextResponse.json({error:"Invalid URL format"},{status:400});if(!(0,x.v5)(a))try{await (0,w.h)(b)}catch{return v.NextResponse.json({error:"URL not allowed"},{status:400})}if("custom-embedding"===d){let a=b.trim().replace(/\/$/,"");if(!e?.trim())return v.NextResponse.json({valid:!1,error:"Model ID required for embedding validation"});let d=await y(`${a}/embeddings`,{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json"},body:JSON.stringify({model:e.trim(),input:"ping"})});if(d.ok){let a=await d.json().catch(()=>null),b=Array.isArray(a?.data?.[0]?.embedding)?a.data[0].embedding.length:null;return v.NextResponse.json({valid:!0,method:"embeddings",dimensions:b})}if(401===d.status||403===d.status)return v.NextResponse.json({valid:!1,error:"API key unauthorized"});let f=await d.text().catch(()=>"");return v.NextResponse.json({valid:!1,error:`Embeddings request failed (${d.status})${f?`: ${f.slice(0,200)}`:""}`,method:"embeddings"})}if("anthropic-compatible"===d){let a=b.trim().replace(/\/$/,"");a.endsWith("/messages")&&(a=a.slice(0,-9));let d=`${a}/models`,f=await y(d,{method:"GET",headers:{"x-api-key":c,"anthropic-version":"2023-06-01",Authorization:`Bearer ${c}`}});if(f.ok)return v.NextResponse.json({valid:!0});if(401===f.status||403===f.status)return v.NextResponse.json({valid:!1,error:"API key unauthorized"});if(e){let b=await y(`${a}/chat/completions`,{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json","x-api-key":c,"anthropic-version":"2023-06-01"},body:JSON.stringify({model:e,messages:[{role:"user",content:"ping"}],max_tokens:1})});if(b.ok)return v.NextResponse.json({valid:!0,method:"chat"});return v.NextResponse.json({valid:!1,error:A(b.status),method:"chat"})}return v.NextResponse.json({valid:!1,error:z(f.status)})}let f=`${b.replace(/\/$/,"")}/models`,g=await y(f,{headers:{Authorization:`Bearer ${c}`}});if(g.ok)return v.NextResponse.json({valid:!0});if(401===g.status||403===g.status)return v.NextResponse.json({valid:!1,error:"API key unauthorized"});if(e){let a=await y(`${b.replace(/\/$/,"")}/chat/completions`,{method:"POST",headers:{Authorization:`Bearer ${c}`,"Content-Type":"application/json"},body:JSON.stringify({model:e,messages:[{role:"user",content:"ping"}],max_tokens:1})});if(a.ok)return v.NextResponse.json({valid:!0,method:"chat"});return v.NextResponse.json({valid:!1,error:A(a.status),method:"chat"})}return v.NextResponse.json({valid:!1,error:z(g.status)})}catch(b){let a=b.cause?.code==="ECONNREFUSED"?"Connection refused - provider node offline or unreachable":b.cause?.code==="ENOTFOUND"?"DNS lookup failed - invalid domain or network issue":b.cause?.code==="ETIMEDOUT"?"Connection timeout - provider node too slow":b.message.includes("timeout")?"Request timeout (>10s) - provider node not responding":b.cause?.code==="CERT_HAS_EXPIRED"?"SSL certificate expired":b.cause?.code==="UNABLE_TO_VERIFY_LEAF_SIGNATURE"?"SSL certificate verification failed":b.cause?.code?`Network error: ${b.cause.code}`:"Network connection failed - check URL and network connectivity";return console.error("Error validating provider node:",{message:b.message,cause:b.cause,code:b.cause?.code,userMessage:a}),v.NextResponse.json({valid:!1,error:a},{status:500})}}let C=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/provider-nodes/validate/route",pathname:"/api/provider-nodes/validate",filename:"route",bundlePath:"app/api/provider-nodes/validate/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/provider-nodes/validate/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:D,workUnitAsyncStorage:E,serverHooks:F}=C;function G(){return(0,g.patchFetch)({workAsyncStorage:D,workUnitAsyncStorage:E})}async function H(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),C.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/provider-nodes/validate/route";"/index"===d&&(d="/");let e=await C.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||C.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===C.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await C.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>C.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>C.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&D&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await C.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),b}},k=await C.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",D?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await C.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:D})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},54603:(a,b,c)=>{c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.nJ,"machine-id"),m=h().join(k.nJ,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||function(){if(process.env.MACHINE_ID_SALT)return process.env.MACHINE_ID_SALT;let a=h().join(m,"machine-id-salt");try{let b=f().readFileSync(a,"utf8").trim();if(b)return b}catch{}let b=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0,mode:448}),f().writeFileSync(a,b,{mode:384})}catch{}return b}(),c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.nJ,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="switchboard-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68658:(a,b,c)=>{c.d(b,{v5:()=>j}),c(23211);var d=c(44776),e=(c(41460),c(28792));let f=new Set(["localhost","127.0.0.1","::1"]);function g(a){if(!a)return"";let b=String(a).trim().toLowerCase();if(b.startsWith("[")){let a=b.indexOf("]");if(-1===a)return"";b=b.slice(1,a)}else 2===b.split(":").length&&(b=b.slice(0,b.indexOf(":")));return b.startsWith("::ffff:")&&(b=b.slice(7)),b}function h(a){let b=g(a);return!!b&&(f.has(b)||/^127\.\d+\.\d+\.\d+$/.test(b))}function i(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){let b=Number(a);if(!/^\d{1,3}$/.test(a)||b>255)return null;c=256*c+b}return c}function j(a){let b;if(a.headers.get("x-switchboard-via-proxy")||!("1"===process.env.SWITCHBOARD_TRUST_REAL_IP?!!(b=g(a.headers.get("x-switchboard-real-ip")))&&(h(b)||function(a){let b=process.env.SWITCHBOARD_LOCAL_PEERS;if(!b)return!1;let c=i(a);for(let d of b.split(",")){let b=d.trim();if(!b)continue;let[e,f]=b.split("/");if(void 0===f){if(b.toLowerCase()===a)return!0;continue}let g=i(e),h=Number(f);if(null===c||null===g||!Number.isInteger(h)||h<0||h>32)continue;let j=0===h?0:-1<<32-h>>>0;if((c&j)>>>0==(g&j)>>>0)return!0}return!1}(b)):h(process.env.HOSTNAME))||!h(a.headers.get("host")))return!1;let c=a.headers.get("origin");if(c)try{if(!h(new URL(c).hostname))return!1}catch{return!1}return!0}e.p},71553:a=>{a.exports=require("node:dns/promises")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77030:a=>{a.exports=require("node:net")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},83204:(a,b,c)=>{c.d(b,{P:()=>p,h:()=>q});var d=c(71553),e=c(77030);let f=new Set(["localhost","ip6-localhost","ip6-loopback","metadata.google.internal"]),g=[".internal",".local",".localhost"];function h(a){return String(a).toLowerCase().replace(/^\[|\]$/g,"")}function i(a){if(!a)return null;let b=new Set((Array.isArray(a)?a:[a]).map(h).filter(Boolean));return b.size?b:null}function j(a){let b=a.split(".");if(4!==b.length)return null;let c=0;for(let a of b){if(!/^\d{1,3}$/.test(a))return null;let b=Number(a);if(b>255)return null;c=256*c+b}return c>>>0}let k=[[j("0.0.0.0"),8],[j("10.0.0.0"),8],[j("127.0.0.0"),8],[j("169.254.0.0"),16],[j("172.16.0.0"),12],[j("192.168.0.0"),16],[j("100.64.0.0"),10]];function l(a){return k.some(([b,c])=>{let d=0===c?0:0xffffffff<<32-c>>>0;return(a&d)==(b&d)})}function m(a){let b=j(a);return null!==b&&l(b)}function n(a){let b=a.replace(/^\[|\]$/g,"").toLowerCase(),c=b.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/),d=c?.[1]||function(a){let b=a.split("::");if(b.length>2)return null;let c=b[0]?b[0].split(":").filter(Boolean):[],d=2===b.length&&b[1]?b[1].split(":").filter(Boolean):[],e=8-c.length-d.length;if(e<0||1===b.length&&0!==e)return null;let f=[...c,...Array(e).fill("0"),...d];if(8!==f.length||f.slice(0,5).some(a=>"0"!==a)||"ffff"!==f[5])return null;let g=Number.parseInt(f[6],16),h=Number.parseInt(f[7],16);return[g,h].every(a=>Number.isInteger(a)&&a>=0&&a<=65535)?`${g>>>8}.${255&g}.${h>>>8}.${255&h}`:null}(b);return d?m(d):"::1"===b||"::"===b||b.startsWith("fe80:")||b.startsWith("fc")||b.startsWith("fd")}function o(a,b=null){let c=h(a);if(b?.has(c))return;if(f.has(c)||g.some(a=>c.endsWith(a)))throw Error("Blocked URL: internal host");let d=function(a){if(/^\d+$/.test(a)){let b=Number(a);if(Number.isSafeInteger(b)&&b>=0&&b<=0xffffffff)return b>>>0}if(/^0x[0-9a-f]+$/i.test(a)){let b=parseInt(a,16);if(Number.isFinite(b)&&b>=0&&b<=0xffffffff)return b>>>0}let b=a.split(".");if(4===b.length&&b.every(a=>/^(0x[0-9a-f]+|0[0-7]*|[1-9]\d*)$/i.test(a))){let a=0;for(let c of b){let b;if(!Number.isFinite(b=/^0x/i.test(c)?parseInt(c,16):c.startsWith("0")&&c.length>1?parseInt(c,8):parseInt(c,10))||b<0||b>255)return null;a=256*a+b}return a>>>0}return null}(c);if(null!==d&&l(d)||m(c)||c.includes(":")&&n(c)||4===(0,e.isIP)(c)&&m(c)||6===(0,e.isIP)(c)&&n(c))throw Error("Blocked URL: private IP")}function p(a,b=null){let c;try{c=new URL(a)}catch{throw Error("Blocked URL: invalid URL")}if("http:"!==c.protocol&&"https:"!==c.protocol)throw Error("Blocked URL: unsupported scheme");o(c.hostname,i(b))}async function q(a,b=null){let c,f=i(b);p(a,b);let g=h(new URL(a).hostname);if(!f?.has(g)&&!(0,e.isIP)(g)){try{c=await (0,d.lookup)(g,{all:!0,verbatim:!0})}catch{throw Error("Blocked URL: DNS resolution failed")}if(!c?.length)throw Error("Blocked URL: DNS resolution failed");for(let a of c)o(a.address,f)}}},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},88556:(a,b,c)=>{c.d(b,{P:()=>d.P,h:()=>d.h});var d=c(83204)},94735:a=>{a.exports=require("events")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9613,7141,5350,869,3986,4776],()=>b(b.s=43504));module.exports=c})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var a={};a.id=3701,a.ids=[3701],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},
|
|
1
|
+
"use strict";(()=>{var a={};a.id=3701,a.ids=[3701],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},21820:a=>{a.exports=require("os")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},36093:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>I,patchFetch:()=>H,routeModule:()=>D,serverHooks:()=>G,workAsyncStorage:()=>E,workUnitAsyncStorage:()=>F});var d={};c.r(d),c.d(d,{POST:()=>C,dynamic:()=>A});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(44776),x=c(25821),y=c(30869),z=c(27335);let A="force-dynamic";function B(a,b){return a.filter(a=>a.probeStatus===b).length}async function C(a,{params:b}){try{let{id:c}=await b,d=await (0,w.Mc)(c);if(!d)return v.NextResponse.json({error:"Connection not found"},{status:404});let e=await a.json().catch(()=>({})),f=(0,x.CM)(e),g=e.providerAlias||z.Xg[d.provider]||d.provider,h=`http://127.0.0.1:${process.env.PORT||y.h0.appPort}`,i=(0,x.rn)(d),{results:j,caps:k}=await (0,x.a7)({models:e.models||[],providerAlias:g,concurrency:f.concurrency,batchSize:f.batchSize,timeoutMs:f.timeoutMs,warmup:!0===e.warmup,baseUrl:h});if(j.length>0&&j.every(a=>"auth"===a.failureClass))return v.NextResponse.json({provider:d.provider,connectionId:d.id,scopeKey:i,providerAlias:g,providerError:!0,error:"Provider authentication failed for every probed model. Check this connection before retrying.",results:j,caps:k},{status:401});for(let a of j)await (0,w.Fq)({providerId:d.provider,scopeKey:i,modelId:a.canonicalId,kind:a.kind,status:a.probeStatus,latencyMs:a.latencyMs,failureClass:a.failureClass,failureMessage:a.failureMessage,checkedAt:a.checkedAt});return v.NextResponse.json({provider:d.provider,connectionId:d.id,scopeKey:i,providerAlias:g,results:j,summary:{total:j.length,ok:B(j,"ok"),dead:B(j,"dead"),retryable:B(j,"retryable")},caps:k})}catch(a){return console.log("Error running model probe batch:",a),v.NextResponse.json({error:"Failed to run model probe batch"},{status:500})}}let D=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/providers/[id]/model-probes/batch/route",pathname:"/api/providers/[id]/model-probes/batch",filename:"route",bundlePath:"app/api/providers/[id]/model-probes/batch/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"/home/runner/work/switchboard-router/switchboard-router/src/app/api/providers/[id]/model-probes/batch/route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:E,workUnitAsyncStorage:F,serverHooks:G}=D;function H(){return(0,g.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:F})}async function I(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),D.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/providers/[id]/model-probes/batch/route";"/index"===d&&(d="/");let e=await D.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:E,resolvedPathname:F,clientReferenceManifest:G,serverActionsManifest:H}=e,I=(0,k.normalizeAppPath)(d),J=!!(A.dynamicRoutes[I]||A.routes[F]),K=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(J&&!z){let a=!!A.routes[F],b=A.dynamicRoutes[I];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await K();throw new t.NoFallbackError}}let L=null;!J||D.isDev||z||(L="/index"===(L=F)?"/":L);let M=!0===D.isDev||!J,N=J&&!M;H&&G&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:G,serverActionsManifest:H});let O=a.method||"GET",P=(0,i.getTracer)(),Q=P.getActiveScopeSpan(),R=!!(null==B?void 0:B.isWrappedByNextServer),S=!!(0,h.getRequestMeta)(a,"minimalMode"),T=(0,h.getRequestMeta)(a,"incrementalCache")||await D.getIncrementalCache(a,x,A,S);null==T||T.resetRequestCache(),globalThis.__incrementalCache=T;let U={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:M,incrementalCache:T,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>D.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},V=new l.NodeNextRequest(a),W=new l.NodeNextResponse(b),X=m.NextRequestAdapter.fromNodeNextRequest(V,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>D.handle(X,U).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=P.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${O} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${O} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!S&&C&&E&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=U.renderOpts.fetchMetrics;let h=U.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=U.renderOpts.collectedTags;if(!J)return await (0,p.I)(V,W,d,U.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==U.renderOpts.collectedRevalidate&&!(U.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&U.renderOpts.collectedRevalidate,e=void 0===U.renderOpts.collectedExpire||U.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:U.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await D.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),b}},k=await D.handleResponse({req:a,nextConfig:x,cacheKey:L,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:E,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:S});if(!J)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});S||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return S&&J||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(V,W,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};R&&Q?await h(Q):(e=P.getActiveScopeSpan(),await P.withPropagatedContext(a.headers,()=>P.trace(n.BaseServerSpan.handleRequest,{spanName:`${O} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":O,"http.target":a.url}},h),void 0,!R))}catch(b){if(b instanceof t.NoFallbackError||await D.onRequestError(a,b,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:N,isOnDemandRevalidate:C})},!1,B),J)throw b;return await (0,p.I)(V,W,new Response(null,{status:500})),null}}},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},73024:a=>{a.exports=require("node:fs")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79646:a=>{a.exports=require("child_process")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},94735:a=>{a.exports=require("events")}};var b=require("../../../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,1813,9613,7141,5350,869,3986,4776,5821],()=>b(b.s=36093));module.exports=c})();
|