@hilbras/omnihilbras 2.9.0 → 2.9.2
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 +25 -30
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/prerender-manifest.json +23 -23
- package/app/.next-cli-build/react-loadable-manifest.json +2 -2
- package/app/.next-cli-build/routes-manifest.json +6 -36
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +16 -16
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +5 -5
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js +2 -2
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +9 -9
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
- package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test-batch/route.js +2 -2
- package/app/.next-cli-build/server/app/api/models/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +2 -2
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js +2 -2
- package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/web-session/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/web-session/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
- package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/rate-limit/route.js +1 -0
- package/app/.next-cli-build/server/app/api/usage/rate-limit/route.js.nft.json +1 -0
- package/app/.next-cli-build/server/app/api/usage/rate-limit/route_client-reference-manifest.js +1 -0
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -6
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +3 -3
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +9 -9
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +9 -9
- 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 +9 -9
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +27 -28
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +16 -16
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +27 -28
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +27 -28
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +16 -16
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +27 -28
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +9 -9
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +9 -9
- 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 +9 -9
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +14 -14
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/app/.next-cli-build/server/app/dashboard.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +15 -15
- package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
- package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +9 -9
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +9 -9
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +9 -9
- 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.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +10 -10
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +10 -10
- 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 +10 -10
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +11 -11
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +11 -11
- 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 +11 -11
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page.js +1 -1
- package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app-paths-manifest.json +25 -30
- package/app/.next-cli-build/server/chunks/1159.js +1 -1
- package/app/.next-cli-build/server/chunks/1329.js +1 -1
- package/app/.next-cli-build/server/chunks/1640.js +1 -1
- package/app/.next-cli-build/server/chunks/2132.js +1 -1
- package/app/.next-cli-build/server/chunks/238.js +1 -0
- package/app/.next-cli-build/server/chunks/24.js +1 -1
- package/app/.next-cli-build/server/chunks/2617.js +1 -1
- package/app/.next-cli-build/server/chunks/2881.js +1 -1
- package/app/.next-cli-build/server/chunks/3118.js +1 -1
- package/app/.next-cli-build/server/chunks/32.js +1 -1
- package/app/.next-cli-build/server/chunks/3817.js +1 -1
- package/app/.next-cli-build/server/chunks/3845.js +1 -1
- package/app/.next-cli-build/server/chunks/3943.js +1 -1
- package/app/.next-cli-build/server/chunks/3966.js +1 -1
- package/app/.next-cli-build/server/chunks/412.js +1 -1
- package/app/.next-cli-build/server/chunks/4123.js +1 -1
- package/app/.next-cli-build/server/chunks/4199.js +1 -1
- package/app/.next-cli-build/server/chunks/4217.js +1 -1
- package/app/.next-cli-build/server/chunks/436.js +1 -1
- package/app/.next-cli-build/server/chunks/4693.js +132 -0
- package/app/.next-cli-build/server/chunks/4785.js +4 -4
- package/app/.next-cli-build/server/chunks/5232.js +1 -0
- package/app/.next-cli-build/server/chunks/5330.js +1 -1
- package/app/.next-cli-build/server/chunks/5615.js +1 -1
- package/app/.next-cli-build/server/chunks/5908.js +1 -1
- package/app/.next-cli-build/server/chunks/5961.js +2 -2
- package/app/.next-cli-build/server/chunks/6070.js +1 -1
- package/app/.next-cli-build/server/chunks/615.js +1 -1
- package/app/.next-cli-build/server/chunks/6503.js +1 -0
- package/app/.next-cli-build/server/chunks/6723.js +1 -0
- package/app/.next-cli-build/server/chunks/6922.js +1 -1
- package/app/.next-cli-build/server/chunks/7068.js +1 -1
- package/app/.next-cli-build/server/chunks/7073.js +1 -1
- package/app/.next-cli-build/server/chunks/7121.js +1 -1
- package/app/.next-cli-build/server/chunks/7211.js +1 -1
- package/app/.next-cli-build/server/chunks/7247.js +1 -1
- package/app/.next-cli-build/server/chunks/{6249.js → 7373.js} +1 -1
- package/app/.next-cli-build/server/chunks/7431.js +5 -0
- package/app/.next-cli-build/server/chunks/7911.js +1 -1
- package/app/.next-cli-build/server/chunks/7914.js +1 -0
- package/app/.next-cli-build/server/chunks/7955.js +1 -1
- package/app/.next-cli-build/server/chunks/7971.js +1 -1
- package/app/.next-cli-build/server/chunks/8251.js +1 -1
- package/app/.next-cli-build/server/chunks/8287.js +1 -1
- package/app/.next-cli-build/server/chunks/8401.js +1 -0
- package/app/.next-cli-build/server/chunks/8499.js +4 -4
- package/app/.next-cli-build/server/chunks/8525.js +1 -1
- package/app/.next-cli-build/server/chunks/8895.js +1 -1
- package/app/.next-cli-build/server/chunks/8910.js +1 -1
- package/app/.next-cli-build/server/chunks/915.js +1 -1
- package/app/.next-cli-build/server/chunks/9609.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +4 -4
- package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/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/Ho-j0vBK5JnrPc1xmt713/_buildManifest.js +1 -0
- package/app/.next-cli-build/static/chunks/2723-dabad94522f22ee4.js +1 -0
- package/app/.next-cli-build/static/chunks/4864-87ba59d0ded310b4.js +132 -0
- package/app/.next-cli-build/static/chunks/5497-ed5ffabb85a19716.js +7 -0
- package/app/.next-cli-build/static/chunks/{6.a39be827fd6d332c.js → 6.14774bfbac824225.js} +1 -1
- package/app/.next-cli-build/static/chunks/7958-316473a002b2e084.js +5 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-be58ffbf710a5dec.js +2 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-2ee3f149ace63801.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-8159f7d4c09ab7cb.js → page-033b10da013937e4.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-90317ba3e66b73c8.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-82a7e01a2e463ba2.js → page-4773b0af283b77f7.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-22bd9a3196952cf5.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/{error-c23142e5f5729b5c.js → error-abf20f892d461b85.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-4431f9b1cc053b18.js +69 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-1fa0d89500a5ec38.js → page-509dda0d0869b182.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-1015ef8b964c4dd3.js → page-40f87ec4dfb87552.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-c837efcd1edb9841.js → page-a4ab01f328185628.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-268b6a5d47d71042.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-631c216c13c7bd3d.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-b345ebe088e2e3d7.js → page-7b0e605f98432f1c.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-7f56fcd67de5a4df.js +27 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-4284719a1858706e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-9c31829dd643cc3e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-f4cd8f5657152167.js +4 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-1e8ce4fa24e2def5.js → page-fbd06481ffdbb573.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-2f6a4a085c8dd9a3.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-6d6e4ef9ef854866.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-277d1751a4a9a74b.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-7f602deed988a26d.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-219ebab18ab5b82b.js +1 -0
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-c10319f075f1df9e.js +1 -0
- package/app/.next-cli-build/static/chunks/app/_global-error/page-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/login/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/auth/status/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/combos/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/health/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/init/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/keys/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/locale/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/alias/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/chat/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/custom/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/test/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/models/test-batch/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pricing/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/client/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/providers/web-session/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/database/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/settings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/shutdown/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/load/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/save/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/send/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/rate-limit/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/search/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/api/version/update/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/landing/page-3cec872ac0a7df86.js +20 -0
- package/app/.next-cli-build/static/chunks/app/{layout-9a382aa3bca368d1.js → layout-d239786c2792c351.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/login/{page-f1d11179aeb87a7b.js → page-244f9db6beda1f45.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/app/page-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-706c2ea1969b3c65.js +1 -0
- package/app/.next-cli-build/static/chunks/webpack-acff973e5c36dbee.js +1 -0
- package/app/.next-cli-build/static/css/4bc6d8008cb75218.css +1 -0
- package/app/node_modules/sql.js/dist/sql-wasm.js +92 -93
- package/app/node_modules/sql.js/dist/sql-wasm.wasm +0 -0
- package/app/node_modules/sql.js/package.json +14 -14
- package/app/package.json +6 -2
- package/app/src/mitm/server.js +24 -24
- package/package.json +2 -3
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +0 -2
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +0 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +0 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +0 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +0 -1
- package/app/.next-cli-build/server/app/api/models/availability/route_client-reference-manifest.js +0 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +0 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +0 -1
- package/app/.next-cli-build/server/app/api/models/catalog-sync/route_client-reference-manifest.js +0 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +0 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +0 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route_client-reference-manifest.js +0 -1
- package/app/.next-cli-build/server/app/api/tags/route.js +0 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +0 -1
- package/app/.next-cli-build/server/app/api/tags/route_client-reference-manifest.js +0 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +0 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +0 -1
- package/app/.next-cli-build/server/app/api/usage/history/route_client-reference-manifest.js +0 -1
- package/app/.next-cli-build/server/chunks/1004.js +0 -1
- package/app/.next-cli-build/server/chunks/199.js +0 -1
- package/app/.next-cli-build/server/chunks/3099.js +0 -1
- package/app/.next-cli-build/server/chunks/3276.js +0 -5
- package/app/.next-cli-build/server/chunks/3390.js +0 -1
- package/app/.next-cli-build/server/chunks/3946.js +0 -1
- package/app/.next-cli-build/server/chunks/5299.js +0 -132
- package/app/.next-cli-build/server/chunks/8310.js +0 -1
- package/app/.next-cli-build/static/Bc_4pI0TTRTxAuRjbtM9m/_buildManifest.js +0 -1
- package/app/.next-cli-build/static/chunks/5497-b25ea0870709c4a3.js +0 -7
- package/app/.next-cli-build/static/chunks/761-7590878484e89ed1.js +0 -132
- package/app/.next-cli-build/static/chunks/7958-2d1c84171a8399d8.js +0 -5
- package/app/.next-cli-build/static/chunks/85-23bf3a4cff99dadd.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-4cf42b10bafdba52.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/page-1c0b229abad77799.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-030895183c4a1b17.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-760cfc8d9a00b49d.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page-de738056c6c3f5e2.js +0 -69
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/page-7127308e5eea216f.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-0ce06644f7408c8e.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-5830aae99fea0caa.js +0 -27
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/page-99fd3aed621a28fc.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-33bd2ae28949bf4c.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-59307c2c6aa6807f.js +0 -4
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-826990e074e94349.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-e478c2c7c2491d20.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-d599af5870c7cbbe.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/page-f5fe96d6a397c739.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-5bc45ce6d914f906.js +0 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-3276d4952049b42b.js +0 -1
- package/app/.next-cli-build/static/chunks/app/_global-error/page-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/login/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/auth/status/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codewhale-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-profiles/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/crush-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/forge-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-profiles/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/omp-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/cli-tools/smelt-settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/presets/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/combos/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/health/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/init/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/keys/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/locale/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/alias/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/availability/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/chat/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/custom/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/test/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/models/test-batch/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/start/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/login/status/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/zed/auto-import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/oauth/zed/import/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pricing/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/overrides/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/client/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/providers/web-session/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/netlify-deploy/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/database/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/settings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/shutdown/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tags/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/load/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/save/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/send/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/claude-reset/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/history/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/search/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/systemone/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/api/version/update/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/landing/page-0a57d1766f9a201d.js +0 -20
- package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/app/page-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-87381f52e86f81d4.js +0 -1
- package/app/.next-cli-build/static/chunks/webpack-e231561434c0967e.js +0 -1
- package/app/.next-cli-build/static/css/5a593dc4b7a052d4.css +0 -1
- package/app/cli/.build-home/.config/nextjs-nodejs/config.json +0 -7
- package/app/cli/.build-home/.omnihilbras/db/data.sqlite +0 -0
- package/app/cli/.build-home/.omnihilbras/jwt-secret +0 -1
- package/app/cli/.build-home/.omnihilbras/machine-id +0 -1
- /package/app/.next-cli-build/static/{Bc_4pI0TTRTxAuRjbtM9m → Ho-j0vBK5JnrPc1xmt713}/_ssgManifest.js +0 -0
|
@@ -6,15 +6,15 @@ exports.id=4785,exports.ids=[4785],exports.modules={644:(a,b,c)=>{"use strict";f
|
|
|
6
6
|
ON CONFLICT(id) DO UPDATE SET
|
|
7
7
|
provider=excluded.provider, authType=excluded.authType, name=excluded.name,
|
|
8
8
|
email=excluded.email, priority=excluded.priority, isActive=excluded.isActive,
|
|
9
|
-
data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}async function l(a={}){var b,c;let d,f=a.provider||null,h=(0,g.XL)(f);if(!h){let a;b=await (0,e.c)(),(a=(f?b.all("SELECT * FROM providerConnections WHERE provider = ?",[f]):b.all("SELECT * FROM providerConnections")).map(j)).sort((a,b)=>(a.priority||999)-(b.priority||999)),h=a,(0,g.TX)(f,h)}return void 0!==a.isActive&&(c=h,d=!!a.isActive,h=c.filter(a=>a.isActive===d)),h.map(g.sO)}async function m(a){return j((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function n(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(j);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{let d=c+1;(b.priority||0)!==d&&a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[d,b.id])})}async function o(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{var e;let g="apikey"===a.authType&&!!a.name,l=g?c.all("SELECT * FROM providerConnections WHERE provider = ? AND authType = ? AND name = ?",[a.provider,"apikey",a.name]).map(j):c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(j),m=g?c.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a.provider])?.n??l.length:l.length,n=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.username,c=a.providerSpecificData?.chatgptAccountId;n=l.find(d=>{if("oauth"!==d.authType||d.email!==a.email)return!1;if("codex"===a.provider){let a=d.providerSpecificData?.chatgptAccountId;return!!c&&!!a&&c===a}let e=d.providerSpecificData?.chatgptAccountId;if(c&&e)return c===e;if(c&&!e||!c&&e)return!1;let f=d.providerSpecificData?.username;return b&&f?b===f:!b&&!f})}else"apikey"===a.authType&&a.name&&(n=l.find(b=>"apikey"===b.authType&&b.name===a.name));if(n){if(!1===a.allowOverwrite){let b=Error(`A connection named "${n.name}" already exists for provider "${a.provider}". Pass allowOverwrite: true to replace it.`);throw b.code="PROVIDER_NAME_CONFLICT",b.existingId=n.id,b.existingName=n.name,b}let d=i(n,a),e={...n,...d,updatedAt:f};k(c,e),b=e;return}let o=a.name||null;o||"oauth"!==a.authType&&"access_token"!==a.authType||(e=a.email||`Account ${m+1}`,o="github"===a.provider&&(a.providerSpecificData?.githubLogin||a.providerSpecificData?.githubEmail||a.email||a.providerSpecificData?.githubName)||e);let p=a.priority;if(!p){let b=c.get("SELECT MAX(priority) AS m FROM providerConnections WHERE provider = ?",[a.provider]);p=(b?.m||0)+1}let q={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:o,priority:p,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of h)void 0!==a[b]&&null!==a[b]&&(q[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(q.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(q.email=a.email),k(c,q),b=q}),(0,g.km)(b?.provider||a.provider),b}async function p(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=j(e),g=i(f,b),h={...f,...g,updatedAt:new Date().toISOString()};k(d,h),void 0!==b.priority&&n(d,f.provider),c=h}),c&&(void 0!==b.priority?(0,g.km)(c.provider):(0,g.gG)(c)),c}async function q(a){let b=await (0,e.c)(),c=!1,d=null;return b.transaction(()=>{let e=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);e&&(d=e.provider,b.run("DELETE FROM providerConnections WHERE id = ?",[a]),n(b,e.provider),c=!0)}),c&&(0,g.km)(d),c}async function r(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),(0,g.km)(a),c?.n||0}async function s(a){let b=await (0,e.c)();b.transaction(()=>n(b,a)),(0,g.km)(a)}async function t(){let a=await (0,e.c)(),b=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","consecutiveUseCount"],c=0;return a.transaction(()=>{for(let d of a.all("SELECT * FROM providerConnections")){let e=j(d),f=!1;for(let a of b)(null===e[a]||void 0===e[a])&&a in e&&(delete e[a],c++,f=!0);e.providerSpecificData&&0===Object.keys(e.providerSpecificData).length&&(delete e.providerSpecificData,c++,f=!0),f&&k(a,e)}}),(0,g.hX)(),c}},9460:(a,b,c)=>{"use strict";c.d(b,{L9:()=>t,OM:()=>l,S8:()=>q,fv:()=>n,getMitmAlias:()=>s,o5:()=>m,uL:()=>r,uv:()=>p});var d=c(36366),e=c(644),f=c(22846),g=c(30653),h=c(3260);let i=(0,f.U)("modelAliases"),j=(0,f.U)("customModels"),k=(0,f.U)("mitmAlias");async function l(){return await i.getAll()}async function m(a,b){await i.set(a,b),(0,g.Ti)(),(0,h.vR)()}async function n(a){await i.remove(a),(0,g.Ti)(),(0,h.vR)()}function o(a,b,c){return`${a}|${b}|${c}`}async function p(){return Object.values(await j.getAll())}async function q({providerAlias:a,id:b,type:c="llm",name:f,caps:g,transport:h,origin:i}){let j=o(a,b,c),k=await (0,d.c)(),l=!1;return k.transaction(()=>{let d=k.get("SELECT value FROM kv WHERE scope = 'customModels' AND key = ?",[j]);if(d){let a={...(0,e.q)(d.value)||{},...f?{name:f}:{},...g?{caps:g}:{},...h?{transport:h}:{}};k.run("UPDATE kv SET value = ? WHERE scope = 'customModels' AND key = ?",[(0,e.s)(a),j]);return}let m=(0,e.s)({providerAlias:a,id:b,type:c,name:f||b,...i?{origin:i}:{},...g?{caps:g}:{},...h?{transport:h}:{}});k.run("INSERT INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[j,m]),l=!0}),l}async function r({providerAlias:a,id:b,type:c="llm"}){await j.remove(o(a,b,c))}async function s(a){return a?await k.get(a)||{}:await k.getAll()}async function t(a,b){await k.set(a,b||{})}},22846:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(36366),e=c(644);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},26856:(a,b,c)=>{"use strict";c.d(b,{CH:()=>g,CP:()=>f,Hs:()=>l,LZ:()=>j,fz:()=>k});var d=c(77598);let e=new Map;function f(a){let b=(0,d.createHash)("sha256").update(String(a)).digest("hex").slice(0,32);return`key:${b}`}function g(a){return`ip:${a||"unknown"}`}function h(a,b,c){let d=e.get(a);d||(d={requests:null,tokens:null},e.set(a,d));let f=d[b];if(!f)return d[b]={capacity:c,tokens:c,lastRefill:Date.now()},d[b];if(f.capacity!==c){let a=Math.max(0,f.capacity-f.tokens);f.capacity=c,f.tokens=Math.max(0,c-a),f.lastRefill=Date.now()}return f}function i(a,b){if(!a||!(a.capacity>0))return;let c=b-a.lastRefill;if(c<=0)return;let d=a.capacity/6e4;a.tokens=Math.min(a.capacity,a.tokens+c*d),a.lastRefill=b}function j(a,b,c=1){if(!(b>0))return{allowed:!0,retryAfterMs:0};let d=h(a,"requests",b);if(i(d,Date.now()),d.tokens<c){let a=d.capacity/6e4;return{allowed:!1,retryAfterMs:a>0?Math.ceil((c-d.tokens)/a):6e4}}return d.tokens-=c,{allowed:!0,retryAfterMs:0}}function k(a,b,c){if(!(b>0)||!(c>0))return{allowed:!0,retryAfterMs:0};let d=h(a,"tokens",b);if(i(d,Date.now()),d.tokens<c){let a=d.capacity/6e4;return{allowed:!1,retryAfterMs:a>0?Math.ceil((c-d.tokens)/a):6e4}}return d.tokens-=c,{allowed:!0,retryAfterMs:0}}function l(a,b){if(!(b>0))return;let c=e.get(a)?.tokens;c&&(i(c,Date.now()),c.tokens=Math.max(0,c.tokens-b))}},30653:(a,b,c)=>{"use strict";c.d(b,{Ex:()=>g,R0:()=>f,Ti:()=>k,Zo:()=>j,_l:()=>h,u6:()=>i});let d=null,e=new Map;function f(){if(d){if(d.expiresAt<=Date.now()){d=null;return}return d.names}}function g(a){d={names:a,expiresAt:Date.now()+3e3}}function h(){d=null}function i(a){let b=e.get(a);if(b)return b.expiresAt<=Date.now()?void e.delete(a):(e.delete(a),e.set(a,b),b.value)}function j(a,b){if(e.size>=512){let a=e.keys().next().value;void 0!==a&&e.delete(a)}e.delete(a),e.set(a,{value:b,expiresAt:Date.now()+3e3})}function k(){e.clear()}},33666:(a,b,c)=>{"use strict";c.d(b,{M7:()=>h,aB:()=>g,xE:()=>f});var d=c(38606);function e(a){if(!Array.isArray(a))return[];let b=new Set,c=[];for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e=a.toLowerCase();b.has(e)||(b.add(e),c.push(a))}return c}function f(a,b){if(1!==a&&!0!==a)return{restricted:!1,allow:[]};let c=[];if("string"==typeof b&&b)try{c=JSON.parse(b)}catch{c=[]}return{restricted:!0,allow:e(c)}}function g(a){let b=a||d.M0;return{accessRestricted:+!!b.restricted,accessAllow:JSON.stringify(b.restricted?e(b.allow):[])}}function h(a){if(!a||"object"!=typeof a||Array.isArray(a))return{ok:!1,error:"access must be an object { restricted, allow }"};let b=Object.keys(a).filter(a=>"restricted"!==a&&"allow"!==a);if(b.length)return{ok:!1,error:`access: unexpected field(s) ${b.join(", ")}`};if("boolean"!=typeof a.restricted)return{ok:!1,error:"access.restricted must be a boolean"};let c=void 0===a.allow?[]:a.allow;return!Array.isArray(c)||c.some(a=>"string"!=typeof a)?{ok:!1,error:"access.allow must be an array of strings"}:c.length>d.lO?{ok:!1,error:`access.allow has more than ${d.lO} entries`}:c.some(a=>a.trim().length>d.AM)?{ok:!1,error:`access.allow entries must be at most ${d.AM} characters`}:{ok:!0,value:{restricted:a.restricted,allow:e(c)}}}},36366:(a,b,c)=>{"use strict";c.d(b,{c:()=>l,r:()=>m});var d=c(95658),e=c(45193);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,logged:!1});let f=global._dbAdapter;async function g(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(4739).then(c.bind(c,24739));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;let[a]=process.versions.node.split(".").map(Number);if(a>=24)return null;try{let{createBetterSqliteAdapter:a}=await c.e(5258).then(c.bind(c,25258));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function i(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(8520).then(c.bind(c,88520));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function j(){try{let{createSqlJsAdapter:a}=await c.e(3593).then(c.bind(c,53593));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function k(){(0,d.Jh)(),(0,e.y)(d.AL),(0,e.y)(`${d.AL}-wal`),(0,e.y)(`${d.AL}-shm`);let a=await g();if(a||(a=await h()),a||(a=await i()),a||(a=await j()),!a)throw Error("[DB] No SQLite driver available (bun/better/node/sql.js all failed)");f.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),f.logged=!0);let{runMigrationOnce:b}=await c.e(3104).then(c.bind(c,33104));return await b(a),a}async function l(){return f.instance?f.instance:(f.initPromise||(f.initPromise=k().then(a=>(f.instance=a,a))),f.initPromise)}function m(){if(!f.instance)throw Error("[DB] adapter not initialized — await getAdapter() first");return f.instance}},38606:(a,b,c)=>{"use strict";c.d(b,{AM:()=>e,Cq:()=>i,M0:()=>f,WR:()=>h,YR:()=>g,lO:()=>d});let d=200,e=256,f=Object.freeze({restricted:!1,allow:Object.freeze([])}),g=Object.freeze(["webSearch","webFetch"]),h="combo";function i(a){return`This API key is not allowed to use model "${a}"`}},39393:(a,b,c)=>{"use strict";c.d(b,{TX:()=>g,XL:()=>f,gG:()=>j,hX:()=>i,km:()=>h,sO:()=>e}),global._providerConnectionCache||(global._providerConnectionCache={entries:new Map});let d=global._providerConnectionCache;function e(a){if(!a)return a;let b={...a};return b.providerSpecificData&&"object"==typeof b.providerSpecificData&&(b.providerSpecificData={...b.providerSpecificData}),b}function f(a){let b=a||"*",c=d.entries.get(b);return c?Date.now()>=c.expiresAt?(d.entries.delete(b),null):c.list:null}function g(a,b){d.entries.set(a||"*",{list:b,expiresAt:Date.now()+5e3})}function h(a){d.entries.delete(a||"*"),d.entries.delete("*")}function i(){d.entries.clear()}function j(a){for(let b of[a.provider||"*","*"]){let c=d.entries.get(b);if(!c)continue;let f=c.list.findIndex(b=>b.id===a.id);if(-1===f){d.entries.delete(b);continue}c.list[f]=e(a)}}},42655:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>m,a$:()=>f,exportSettings:()=>n,getSettings:()=>l});var d=c(36366),e=c(644);let f={cloudEnabled:!1,tunnelEnabled:!1,tunnelUrl:"",tunnelProvider:"cloudflare",tailscaleEnabled:!1,tailscaleUrl:"",stickyRoundRobinLimit:3,providerStrategies:{},quotaVisibility:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},capacityAdapter:{vision:{enabled:!0,roundRobin:!1,models:[]},pdf:{enabled:!1,roundRobin:!1,models:[]},audioInput:{enabled:!0,roundRobin:!1,models:[]},videoInput:{enabled:!1,roundRobin:!1,models:[]}},requireLogin:!0,requireApiKey:!0,tunnelDashboardAccess:!0,authMode:"password",ssoType:"oidc",oidcIssuerUrl:"",oidcClientId:"",oidcClientSecret:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC",samlEntryPoint:"",samlIssuer:"urn:omnihilbras:sp",samlCert:"",samlLoginLabel:"Sign in with SAML SSO",samlAttributeEmail:"email",samlAttributeName:"name",enableObservability:!1,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:20128",dnsToolEnabled:{},rtkEnabled:!0,headroomEnabled:!1,headroomUrl:process.env.HEADROOM_URL||"http://localhost:8787",headroomCompressUserMessages:!1,headroomTimeoutMs:3e3,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",pxpipeEnabled:!1,pxpipeAutoInstall:!0,pxpipeMinChars:25e3,pxpipeTimeoutMs:15e3,providerOverrides:{},rateLimit:{enabled:!0,requestsPerMinute:120,tokensPerMinute:5e6,maxInputTokensPerRequest:1e6,concurrency:{global:32,perKey:8},maxUpstreamCallsPerRequest:32,keyOverrides:{}},usageRetention:{enabled:!0,historyDays:90,dailyDays:400,intervalMs:36e5}},g=["rateLimit","usageRetention"];async function h(){let a=(await (0,d.c)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}function i(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c),g.includes(a)&&b[a]&&"object"==typeof b[a]&&!Array.isArray(b[a])&&(b[a]={...c,...b[a]},"rateLimit"===a&&b[a].concurrency&&"object"==typeof b[a].concurrency&&(b[a].concurrency={...c.concurrency,...b[a].concurrency}));if(b.capacityAdapter&&"object"==typeof b.capacityAdapter)for(let a of Object.keys(b.capacityAdapter)){let c=b.capacityAdapter[a];Array.isArray(c?.models)&&(c.models=c.models.map(a=>"oc/mimo-v2.5-free"===a?"oc/mimo-v2.6-flash-free":a))}return b}let j={value:null,expiresAt:0};function k(a){let b={...a};for(let a of g)b[a]&&"object"==typeof b[a]&&!Array.isArray(b[a])&&(b[a]={...b[a]});return b.rateLimit?.concurrency&&"object"==typeof b.rateLimit.concurrency&&(b.rateLimit.concurrency={...b.rateLimit.concurrency}),b}async function l(){let a=Date.now();if(j.value&&j.expiresAt>a)return k(j.value);let b=i(await h());return j={value:b,expiresAt:a+2e3},k(b)}async function m(a){let b;j={value:null,expiresAt:0};let c=await (0,d.c)();return c.transaction(function(){let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),i(b)}async function n(){return await h()}},45193:(a,b,c)=>{"use strict";c.d(b,{J:()=>h,y:()=>i});var d=c(73024),e=c.n(d);let f=!1;function g(a){f||(f=!0,console.warn(`[SecureFS] ${a}`))}function h(a,b=448){try{e().mkdirSync(a,{recursive:!0,mode:b})}catch(b){if(b?.code!=="EEXIST")return g(`could not create ${a}: ${b.message}`),a}try{e().chmodSync(a,b)}catch(c){g(`could not set ${b.toString(8)} on ${a}: ${c.message}`)}return a}function i(a,b=384){try{if(!e().existsSync(a))return!1;return e().chmodSync(a,b),!0}catch(c){return g(`could not set ${b.toString(8)} on ${a}: ${c.message}`),!1}}},45913:(a,b,c)=>{"use strict";function d(a){if(!a||"string"!=typeof a)return null;let b=a.trim();return b.length<=12?b.charAt(0)+"***":b.slice(0,8)+"***"+b.slice(-4)}c.d(b,{o:()=>d})},47765:(a,b,c)=>{"use strict";c.d(b,{S8:()=>A.S8,E5:()=>G.E5,bI:()=>o.cleanupProviderConnections,Iq:()=>y.createApiKey,jd:()=>z.jd,iE:()=>o.createProviderConnection,i0:()=>p.createProviderNode,ZO:()=>v,Lh:()=>y.deleteApiKey,CG:()=>z.CG,uL:()=>A.uL,fv:()=>A.fv,fK:()=>o.deleteProviderConnection,op:()=>o.deleteProviderConnectionsByProvider,Pc:()=>p.deleteProviderNode,Yd:()=>x,tm:()=>E,oF:()=>F,zP:()=>T,rg:()=>G.rg,yg:()=>y.getApiKeyById,PX:()=>y.getApiKeys,j$:()=>G.j$,Dv:()=>G.Dv,L:()=>z.L,Dj:()=>z.Dj,Uv:()=>z.Uv,uv:()=>A.uv,vF:()=>D,Lk:()=>R,c:()=>A.getMitmAlias,OM:()=>A.OM,r4:()=>B.r4,Mc:()=>o.getProviderConnectionById,P:()=>o.getProviderConnections,Qu:()=>p.getProviderNodeById,zw:()=>p.getProviderNodeByPrefix,Fh:()=>p.getProviderNodes,hr:()=>u,ui:()=>t,Zx:()=>G.Zx,SL:()=>Q,mt:()=>n.getSettings,BY:()=>G.BY,K1:()=>U,q3:()=>G.q3,VT:()=>B.VT,yF:()=>B.yF,ox:()=>P,sZ:()=>G.sZ,L9:()=>A.L9,o5:()=>A.o5,_V:()=>G._V,cx:()=>G.cx,uw:()=>G.uw,XW:()=>y.updateApiKey,oG:()=>z.oG,KJ:()=>B.KJ,rj:()=>o.updateProviderConnection,ho:()=>p.updateProviderNode,Q_:()=>w,Xx:()=>n.Xx,ek:()=>y.validateApiKey});var d=c(36366),e=c(644),f=c(39393),g=c(33666),h=c(38606),i=c(48753),j=c(47969),k=c(30653),l=c(3260),m=c(45913),n=c(42655),o=c(5781),p=c(1129),q=c(94755);function r(a){return a?{...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive||!0===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function s(a,b){let c=function(a){let{id:b,isActive:c,testStatus:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,isActive:+(!1!==c),testStatus:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt)
|
|
9
|
+
data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}async function l(a={}){var b,c;let d,f=a.provider||null,h=(0,g.XL)(f);if(!h){let a;b=await (0,e.c)(),(a=(f?b.all("SELECT * FROM providerConnections WHERE provider = ?",[f]):b.all("SELECT * FROM providerConnections")).map(j)).sort((a,b)=>(a.priority||999)-(b.priority||999)),h=a,(0,g.TX)(f,h)}return void 0!==a.isActive&&(c=h,d=!!a.isActive,h=c.filter(a=>a.isActive===d)),h.map(g.sO)}async function m(a){return j((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function n(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(j);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{let d=c+1;(b.priority||0)!==d&&a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[d,b.id])})}async function o(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{var e;let g="apikey"===a.authType&&!!a.name,l=g?c.all("SELECT * FROM providerConnections WHERE provider = ? AND authType = ? AND name = ?",[a.provider,"apikey",a.name]).map(j):c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(j),m=g?c.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a.provider])?.n??l.length:l.length,n=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.username,c=a.providerSpecificData?.chatgptAccountId;n=l.find(d=>{if("oauth"!==d.authType||d.email!==a.email)return!1;if("codex"===a.provider){let a=d.providerSpecificData?.chatgptAccountId;return!!c&&!!a&&c===a}let e=d.providerSpecificData?.chatgptAccountId;if(c&&e)return c===e;if(c&&!e||!c&&e)return!1;let f=d.providerSpecificData?.username;return b&&f?b===f:!b&&!f})}else"apikey"===a.authType&&a.name&&(n=l.find(b=>"apikey"===b.authType&&b.name===a.name));if(n){if(!1===a.allowOverwrite){let b=Error(`A connection named "${n.name}" already exists for provider "${a.provider}". Pass allowOverwrite: true to replace it.`);throw b.code="PROVIDER_NAME_CONFLICT",b.existingId=n.id,b.existingName=n.name,b}let d=i(n,a),e={...n,...d,updatedAt:f};k(c,e),b=e;return}let o=a.name||null;o||"oauth"!==a.authType&&"access_token"!==a.authType||(e=a.email||`Account ${m+1}`,o="github"===a.provider&&(a.providerSpecificData?.githubLogin||a.providerSpecificData?.githubEmail||a.email||a.providerSpecificData?.githubName)||e);let p=a.priority;if(!p){let b=c.get("SELECT MAX(priority) AS m FROM providerConnections WHERE provider = ?",[a.provider]);p=(b?.m||0)+1}let q={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:o,priority:p,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of h)void 0!==a[b]&&null!==a[b]&&(q[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(q.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(q.email=a.email),k(c,q),b=q}),(0,g.km)(b?.provider||a.provider),b}async function p(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=j(e),g=i(f,b),h={...f,...g,updatedAt:new Date().toISOString()};k(d,h),void 0!==b.priority&&n(d,f.provider),c=h}),c&&(void 0!==b.priority?(0,g.km)(c.provider):(0,g.gG)(c)),c}async function q(a){let b=await (0,e.c)(),c=!1,d=null;return b.transaction(()=>{let e=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);e&&(d=e.provider,b.run("DELETE FROM providerConnections WHERE id = ?",[a]),n(b,e.provider),c=!0)}),c&&(0,g.km)(d),c}async function r(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),(0,g.km)(a),c?.n||0}async function s(a){let b=await (0,e.c)();b.transaction(()=>n(b,a)),(0,g.km)(a)}async function t(){let a=await (0,e.c)(),b=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","consecutiveUseCount"],c=0;return a.transaction(()=>{for(let d of a.all("SELECT * FROM providerConnections")){let e=j(d),f=!1;for(let a of b)(null===e[a]||void 0===e[a])&&a in e&&(delete e[a],c++,f=!0);e.providerSpecificData&&0===Object.keys(e.providerSpecificData).length&&(delete e.providerSpecificData,c++,f=!0),f&&k(a,e)}}),(0,g.hX)(),c}},9460:(a,b,c)=>{"use strict";c.d(b,{L9:()=>t,OM:()=>l,S8:()=>q,fv:()=>n,getMitmAlias:()=>s,o5:()=>m,uL:()=>r,uv:()=>p});var d=c(36366),e=c(644),f=c(22846),g=c(30653),h=c(3260);let i=(0,f.U)("modelAliases"),j=(0,f.U)("customModels"),k=(0,f.U)("mitmAlias");async function l(){return await i.getAll()}async function m(a,b){await i.set(a,b),(0,g.Ti)(),(0,h.vR)()}async function n(a){await i.remove(a),(0,g.Ti)(),(0,h.vR)()}function o(a,b,c){return`${a}|${b}|${c}`}async function p(){return Object.values(await j.getAll())}async function q({providerAlias:a,id:b,type:c="llm",name:f,caps:g,transport:h,origin:i}){let j=o(a,b,c),k=await (0,d.c)(),l=!1;return k.transaction(()=>{let d=k.get("SELECT value FROM kv WHERE scope = 'customModels' AND key = ?",[j]);if(d){let a={...(0,e.q)(d.value)||{},...f?{name:f}:{},...g?{caps:g}:{},...h?{transport:h}:{}};k.run("UPDATE kv SET value = ? WHERE scope = 'customModels' AND key = ?",[(0,e.s)(a),j]);return}let m=(0,e.s)({providerAlias:a,id:b,type:c,name:f||b,...i?{origin:i}:{},...g?{caps:g}:{},...h?{transport:h}:{}});k.run("INSERT INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[j,m]),l=!0}),l}async function r({providerAlias:a,id:b,type:c="llm"}){await j.remove(o(a,b,c))}async function s(a){return a?await k.get(a)||{}:await k.getAll()}async function t(a,b){await k.set(a,b||{})}},22846:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(36366),e=c(644);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},26856:(a,b,c)=>{"use strict";c.d(b,{CH:()=>g,CP:()=>f,Hs:()=>l,LZ:()=>j,fz:()=>k});var d=c(77598);let e=new Map;function f(a){let b=(0,d.createHash)("sha256").update(String(a)).digest("hex").slice(0,32);return`key:${b}`}function g(a){return`ip:${a||"unknown"}`}function h(a,b,c){let d=e.get(a);d||(d={requests:null,tokens:null,lastSeen:Date.now()},e.set(a,d),function(){let a=Date.now();for(let[b,c]of e)a-(c.lastSeen||0)>9e5&&e.delete(b);for(;e.size>4096;){let a=null,b=1/0;for(let[c,d]of e)d.lastSeen<b&&(b=d.lastSeen,a=c);if(!a)break;e.delete(a)}}()),d.lastSeen=Date.now();let f=d[b];if(!f)return d[b]={capacity:c,tokens:c,lastRefill:Date.now()},d[b];if(f.capacity!==c){let a=Math.max(0,f.capacity-f.tokens);f.capacity=c,f.tokens=Math.max(0,c-a),f.lastRefill=Date.now()}return f}function i(a,b){if(!a||!(a.capacity>0))return;let c=b-a.lastRefill;if(c<=0)return;let d=a.capacity/6e4;a.tokens=Math.min(a.capacity,a.tokens+c*d),a.lastRefill=b}function j(a,b,c=1){if(!(b>0))return{allowed:!0,retryAfterMs:0};let d=h(a,"requests",b);if(i(d,Date.now()),d.tokens<c){let a=d.capacity/6e4;return{allowed:!1,retryAfterMs:a>0?Math.ceil((c-d.tokens)/a):6e4}}return d.tokens-=c,{allowed:!0,retryAfterMs:0}}function k(a,b,c){if(!(b>0)||!(c>0))return{allowed:!0,retryAfterMs:0};let d=h(a,"tokens",b);if(i(d,Date.now()),d.tokens<c){let a=d.capacity/6e4;return{allowed:!1,retryAfterMs:a>0?Math.ceil((c-d.tokens)/a):6e4}}return d.tokens-=c,{allowed:!0,retryAfterMs:0}}function l(a,b){if(!(b>0))return;let c=e.get(a)?.tokens;c&&(i(c,Date.now()),c.tokens=Math.max(0,c.tokens-b))}},30653:(a,b,c)=>{"use strict";c.d(b,{Ex:()=>g,R0:()=>f,Ti:()=>k,Zo:()=>j,_l:()=>h,u6:()=>i});let d=null,e=new Map;function f(){if(d){if(d.expiresAt<=Date.now()){d=null;return}return d.names}}function g(a){d={names:a,expiresAt:Date.now()+3e3}}function h(){d=null}function i(a){let b=e.get(a);if(b)return b.expiresAt<=Date.now()?void e.delete(a):(e.delete(a),e.set(a,b),b.value)}function j(a,b){if(e.size>=512){let a=e.keys().next().value;void 0!==a&&e.delete(a)}e.delete(a),e.set(a,{value:b,expiresAt:Date.now()+3e3})}function k(){e.clear()}},33666:(a,b,c)=>{"use strict";c.d(b,{M7:()=>h,aB:()=>g,xE:()=>f});var d=c(38606);function e(a){if(!Array.isArray(a))return[];let b=new Set,c=[];for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e=a.toLowerCase();b.has(e)||(b.add(e),c.push(a))}return c}function f(a,b){if(1!==a&&!0!==a)return{restricted:!1,allow:[]};let c=[];if("string"==typeof b&&b)try{c=JSON.parse(b)}catch{c=[]}return{restricted:!0,allow:e(c)}}function g(a){let b=a||d.M0;return{accessRestricted:+!!b.restricted,accessAllow:JSON.stringify(b.restricted?e(b.allow):[])}}function h(a){if(!a||"object"!=typeof a||Array.isArray(a))return{ok:!1,error:"access must be an object { restricted, allow }"};let b=Object.keys(a).filter(a=>"restricted"!==a&&"allow"!==a);if(b.length)return{ok:!1,error:`access: unexpected field(s) ${b.join(", ")}`};if("boolean"!=typeof a.restricted)return{ok:!1,error:"access.restricted must be a boolean"};let c=void 0===a.allow?[]:a.allow;return!Array.isArray(c)||c.some(a=>"string"!=typeof a)?{ok:!1,error:"access.allow must be an array of strings"}:c.length>d.lO?{ok:!1,error:`access.allow has more than ${d.lO} entries`}:c.some(a=>a.trim().length>d.AM)?{ok:!1,error:`access.allow entries must be at most ${d.AM} characters`}:{ok:!0,value:{restricted:a.restricted,allow:e(c)}}}},36366:(a,b,c)=>{"use strict";c.d(b,{c:()=>l,r:()=>m});var d=c(95658),e=c(45193);global._dbAdapter||(global._dbAdapter={instance:null,initPromise:null,logged:!1});let f=global._dbAdapter;async function g(){if(!process.versions.bun)return null;try{let{createBunSqliteAdapter:a}=await c.e(4739).then(c.bind(c,24739));return await a(d.AL)}catch(a){return console.warn(`[DB] bun:sqlite unavailable: ${a.message}`),null}}async function h(){if(process.versions.bun)return null;let[a]=process.versions.node.split(".").map(Number);if(a>=24)return null;try{let{createBetterSqliteAdapter:a}=await c.e(5258).then(c.bind(c,25258));return a(d.AL)}catch(a){return console.warn(`[DB] better-sqlite3 unavailable: ${a.message}`),null}}async function i(){if(process.versions.bun)return null;let[a,b]=process.versions.node.split(".").map(Number);if(a<22||22===a&&b<5)return null;try{let{createNodeSqliteAdapter:a}=await c.e(8520).then(c.bind(c,88520));return await a(d.AL)}catch(a){return console.warn(`[DB] node:sqlite unavailable: ${a.message}`),null}}async function j(){try{let{createSqlJsAdapter:a}=await c.e(3593).then(c.bind(c,53593));return await a(d.AL)}catch(a){return console.warn(`[DB] sql.js unavailable: ${a.message}`),null}}async function k(){(0,d.Jh)(),(0,e.y)(d.AL),(0,e.y)(`${d.AL}-wal`),(0,e.y)(`${d.AL}-shm`);let a=await g();if(a||(a=await h()),a||(a=await i()),a||(a=await j()),!a)throw Error("[DB] No SQLite driver available (bun/better/node/sql.js all failed)");f.logged||(console.log(`[DB] Driver: ${a.driver} | file: ${d.AL}`),f.logged=!0);let{runMigrationOnce:b}=await c.e(3104).then(c.bind(c,33104));await b(a);try{global._usageResetBuffers?.()}catch{}return a}async function l(){return f.instance?f.instance:(f.initPromise||(f.initPromise=k().then(a=>(f.instance=a,a))),f.initPromise)}function m(){if(!f.instance)throw Error("[DB] adapter not initialized — await getAdapter() first");return f.instance}},38606:(a,b,c)=>{"use strict";c.d(b,{AM:()=>e,Cq:()=>i,M0:()=>f,WR:()=>h,YR:()=>g,lO:()=>d});let d=200,e=256,f=Object.freeze({restricted:!1,allow:Object.freeze([])}),g=Object.freeze(["webSearch","webFetch"]),h="combo";function i(a){return`This API key is not allowed to use model "${a}"`}},39393:(a,b,c)=>{"use strict";c.d(b,{TX:()=>g,XL:()=>f,gG:()=>j,hX:()=>i,km:()=>h,sO:()=>e}),global._providerConnectionCache||(global._providerConnectionCache={entries:new Map});let d=global._providerConnectionCache;function e(a){if(!a)return a;let b={...a};return b.providerSpecificData&&"object"==typeof b.providerSpecificData&&(b.providerSpecificData={...b.providerSpecificData}),b}function f(a){let b=a||"*",c=d.entries.get(b);return c?Date.now()>=c.expiresAt?(d.entries.delete(b),null):c.list:null}function g(a,b){d.entries.set(a||"*",{list:b,expiresAt:Date.now()+5e3})}function h(a){d.entries.delete(a||"*"),d.entries.delete("*")}function i(){d.entries.clear()}function j(a){for(let b of[a.provider||"*","*"]){let c=d.entries.get(b);if(!c)continue;let f=c.list.findIndex(b=>b.id===a.id);if(-1===f){d.entries.delete(b);continue}c.list[f]=e(a)}}},42655:(a,b,c)=>{"use strict";c.d(b,{Xx:()=>m,a$:()=>f,exportSettings:()=>n,getSettings:()=>l});var d=c(36366),e=c(644);let f={cloudEnabled:!1,tunnelEnabled:!1,tunnelUrl:"",tunnelProvider:"cloudflare",tailscaleEnabled:!1,tailscaleUrl:"",stickyRoundRobinLimit:3,providerStrategies:{},quotaVisibility:{},comboStrategy:"fallback",comboStickyRoundRobinLimit:1,comboStrategies:{},capacityAdapter:{vision:{enabled:!0,roundRobin:!1,models:[]},pdf:{enabled:!1,roundRobin:!1,models:[]},audioInput:{enabled:!0,roundRobin:!1,models:[]},videoInput:{enabled:!1,roundRobin:!1,models:[]}},requireLogin:!0,requireApiKey:!0,tunnelDashboardAccess:!0,authMode:"password",ssoType:"oidc",oidcIssuerUrl:"",oidcClientId:"",oidcClientSecret:"",oidcScopes:"openid profile email",oidcLoginLabel:"Sign in with OIDC",samlEntryPoint:"",samlIssuer:"urn:omnihilbras:sp",samlCert:"",samlLoginLabel:"Sign in with SAML SSO",samlAttributeEmail:"email",samlAttributeName:"name",enableObservability:!1,observabilityMaxRecords:1e3,observabilityBatchSize:20,observabilityFlushIntervalMs:5e3,observabilityMaxJsonSize:5,outboundProxyEnabled:!1,outboundProxyUrl:"",outboundNoProxy:"",mitmRouterBaseUrl:"http://localhost:20128",dnsToolEnabled:{},rtkEnabled:!0,headroomEnabled:!1,headroomUrl:process.env.HEADROOM_URL||"http://localhost:8787",headroomCompressUserMessages:!1,headroomTimeoutMs:3e3,cavemanEnabled:!1,cavemanLevel:"full",ponytailEnabled:!1,ponytailLevel:"full",pxpipeEnabled:!1,pxpipeAutoInstall:!0,pxpipeMinChars:25e3,pxpipeTimeoutMs:15e3,providerOverrides:{},rateLimit:{enabled:!0,requestsPerMinute:120,tokensPerMinute:5e6,maxInputTokensPerRequest:1e6,concurrency:{global:32,perKey:8},maxUpstreamCallsPerRequest:32,keyOverrides:{}},usageRetention:{enabled:!0,historyDays:90,dailyDays:400,intervalMs:36e5}},g=["rateLimit","usageRetention"];async function h(){let a=(await (0,d.c)()).get("SELECT data FROM settings WHERE id = 1");return a?(0,e.q)(a.data,{}):{}}function i(a){let b={...f,...a||{}};for(let[a,c]of Object.entries(f))void 0===b[a]&&("outboundProxyEnabled"===a&&"string"==typeof b.outboundProxyUrl&&b.outboundProxyUrl.trim()?b[a]=!0:b[a]=c),g.includes(a)&&b[a]&&"object"==typeof b[a]&&!Array.isArray(b[a])&&(b[a]={...c,...b[a]},"rateLimit"===a&&b[a].concurrency&&"object"==typeof b[a].concurrency&&(b[a].concurrency={...c.concurrency,...b[a].concurrency}));if(b.capacityAdapter&&"object"==typeof b.capacityAdapter)for(let a of Object.keys(b.capacityAdapter)){let c=b.capacityAdapter[a];Array.isArray(c?.models)&&(c.models=c.models.map(a=>"oc/mimo-v2.5-free"===a?"oc/mimo-v2.6-flash-free":a))}return b}let j={value:null,expiresAt:0};function k(a){let b={...a};for(let a of g)b[a]&&"object"==typeof b[a]&&!Array.isArray(b[a])&&(b[a]={...b[a]});return b.rateLimit?.concurrency&&"object"==typeof b.rateLimit.concurrency&&(b.rateLimit.concurrency={...b.rateLimit.concurrency}),b}async function l(){let a=Date.now();if(j.value&&j.expiresAt>a)return k(j.value);let b=i(await h());return j={value:b,expiresAt:a+2e3},k(b)}async function m(a){let b;j={value:null,expiresAt:0};let c=await (0,d.c)();return c.transaction(function(){let d=c.get("SELECT data FROM settings WHERE id = 1");b={...d?(0,e.q)(d.data,{}):{},...a},c.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(b)])}),i(b)}async function n(){return await h()}},45193:(a,b,c)=>{"use strict";c.d(b,{J:()=>h,y:()=>i});var d=c(73024),e=c.n(d);let f=!1;function g(a){f||(f=!0,console.warn(`[SecureFS] ${a}`))}function h(a,b=448){try{e().mkdirSync(a,{recursive:!0,mode:b})}catch(b){if(b?.code!=="EEXIST")return g(`could not create ${a}: ${b.message}`),a}try{e().chmodSync(a,b)}catch(c){g(`could not set ${b.toString(8)} on ${a}: ${c.message}`)}return a}function i(a,b=384){try{if(!e().existsSync(a))return!1;return e().chmodSync(a,b),!0}catch(c){return g(`could not set ${b.toString(8)} on ${a}: ${c.message}`),!1}}},45913:(a,b,c)=>{"use strict";function d(a){if(!a||"string"!=typeof a)return null;let b=a.trim();return b.length<=12?b.charAt(0)+"***":b.slice(0,8)+"***"+b.slice(-4)}c.d(b,{o:()=>d})},47765:(a,b,c)=>{"use strict";c.d(b,{S8:()=>A.S8,E5:()=>G.E5,bI:()=>o.cleanupProviderConnections,Iq:()=>y.createApiKey,jd:()=>z.jd,iE:()=>o.createProviderConnection,i0:()=>p.createProviderNode,ZO:()=>v,Lh:()=>y.deleteApiKey,CG:()=>z.CG,uL:()=>A.uL,fv:()=>A.fv,fK:()=>o.deleteProviderConnection,op:()=>o.deleteProviderConnectionsByProvider,Pc:()=>p.deleteProviderNode,Yd:()=>x,tm:()=>E,oF:()=>F,zP:()=>T,rg:()=>G.rg,yg:()=>y.getApiKeyById,PX:()=>y.getApiKeys,j$:()=>G.j$,Dv:()=>G.Dv,L:()=>z.L,Dj:()=>z.Dj,Uv:()=>z.Uv,uv:()=>A.uv,vF:()=>D,Lk:()=>R,c:()=>A.getMitmAlias,OM:()=>A.OM,_w:()=>G._w,r4:()=>B.r4,Mc:()=>o.getProviderConnectionById,P:()=>o.getProviderConnections,Qu:()=>p.getProviderNodeById,zw:()=>p.getProviderNodeByPrefix,Fh:()=>p.getProviderNodes,hr:()=>u,ui:()=>t,Zx:()=>G.Zx,SL:()=>Q,mt:()=>n.getSettings,BY:()=>G.BY,K1:()=>U,q3:()=>G.q3,VT:()=>B.VT,yF:()=>B.yF,ox:()=>P,sZ:()=>G.sZ,L9:()=>A.L9,o5:()=>A.o5,_V:()=>G._V,cx:()=>G.cx,uw:()=>G.uw,XW:()=>y.updateApiKey,oG:()=>z.oG,KJ:()=>B.KJ,rj:()=>o.updateProviderConnection,ho:()=>p.updateProviderNode,Q_:()=>w,Xx:()=>n.Xx,ek:()=>y.validateApiKey});var d=c(36366),e=c(644),f=c(39393),g=c(33666),h=c(38606),i=c(48753),j=c(47969),k=c(30653),l=c(3260),m=c(45913),n=c(42655),o=c(5781),p=c(1129),q=c(94755);function r(a){return a?{...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive||!0===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function s(a,b){let c=function(a){let{id:b,isActive:c,testStatus:d,createdAt:f,updatedAt:g,...h}=a;return{id:b,isActive:+(!1!==c),testStatus:d??null,data:(0,e.s)(h),createdAt:f,updatedAt:g}}(b);a.run(`INSERT INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt)
|
|
10
10
|
VALUES(?, ?, ?, ?, ?, ?)
|
|
11
11
|
ON CONFLICT(id) DO UPDATE SET
|
|
12
12
|
isActive=excluded.isActive, testStatus=excluded.testStatus,
|
|
13
|
-
data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.isActive,c.testStatus,c.data,c.createdAt,c.updatedAt])}async function t(a={}){let b=await (0,d.c)(),c=[],e=[];void 0!==a.isActive&&(c.push("isActive = ?"),e.push(+!!a.isActive)),a.testStatus&&(c.push("testStatus = ?"),e.push(a.testStatus));let f=`SELECT * FROM proxyPools${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,e).map(r);return g.sort((a,b)=>new Date(b.updatedAt||0)-new Date(a.updatedAt||0)),g}async function u(a){return r((await (0,d.c)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))}async function v(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,q.A)(),name:a.name,proxyUrl:a.proxyUrl,noProxy:a.noProxy||"",type:a.type||"http",isActive:void 0===a.isActive||a.isActive,strictProxy:!0===a.strictProxy,testStatus:a.testStatus||"unknown",lastTestedAt:a.lastTestedAt||null,lastError:a.lastError||null,createdAt:c,updatedAt:c};return s(b,e),e}async function w(a,b){let c=await (0,d.c)(),e=null;return c.transaction(()=>{let d=c.get("SELECT * FROM proxyPools WHERE id = ?",[a]);if(!d)return;let f={...r(d),...b,updatedAt:new Date().toISOString()};s(c,f),e=f}),e}async function x(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM proxyPools WHERE id = ?",[a]);d&&(c=r(d),b.run("DELETE FROM proxyPools WHERE id = ?",[a]))}),c}var y=c(74452),z=c(1541),A=c(9460),B=c(97914);let C="disabledModels";async function D(){let a=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[C]),b={};for(let c of a)b[c.key]=(0,e.q)(c.value,[]);return b}async function E(a,b){if(!a||!Array.isArray(b))return;let c=await (0,d.c)();c.transaction(()=>{let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[C,a]),f=[...new Set([...d&&(0,e.q)(d.value,[])||[],...b])];c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[C,a,(0,e.s)(f)])})}async function F(a,b){if(!a)return;let c=await (0,d.c)();c.transaction(()=>{if(!Array.isArray(b)||0===b.length)return void c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[C,a]);let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[C,a]),f=d&&(0,e.q)(d.value,[])||[],g=new Set(b),h=f.filter(a=>!g.has(a));0===h.length?c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[C,a]):c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[C,a,(0,e.s)(h)])})}var G=c(99703);let H=null,I=0;async function J(){if(H&&Date.now()-I<5e3)return H;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,42655)),b=await a(),d=process.env.ENABLE_REQUEST_LOGS;if(void 0!==d)return H={enabled:"true"===d.toLowerCase(),maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))},I=Date.now(),H;let e="false"!==process.env.OBSERVABILITY_ENABLED;H={enabled:"boolean"==typeof b.enableObservability?b.enableObservability:e,maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))}}catch{H={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return I=Date.now(),H}let K=[],L=null,M=!1;function N(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}async function O(){if(!M&&0!==K.length){M=!0;try{for(;K.length>0;){let a=K.splice(0,K.length),b=await (0,d.c)(),c=await J();b.transaction(()=>{for(let d of a){d.id||(d.id=function(a){let b=new Date().toISOString(),c=Math.random().toString(36).substring(2,8),d=a?a.replace(/[^a-zA-Z0-9-]/g,"-"):"unknown";return`${b}-${c}-${d}`}(d.model)),d.timestamp||(d.timestamp=new Date().toISOString()),d.request?.headers&&(d.request.headers=function(a){if(!a||"object"!=typeof a)return{};let b=["authorization","x-api-key","cookie","token","api-key"],c={...a};for(let a of Object.keys(c))b.some(b=>a.toLowerCase().includes(b))&&delete c[a];return c}(d.request.headers));let a={id:d.id,provider:d.provider||null,model:d.model||null,connectionId:d.connectionId||null,timestamp:d.timestamp,status:d.status||null,latency:d.latency||{},tokens:d.tokens||{},request:N(d.request,c.maxJsonSize),providerRequest:N(d.providerRequest,c.maxJsonSize),providerResponse:N(d.providerResponse,c.maxJsonSize),response:N(d.response,c.maxJsonSize),pxpipe:d.pxpipe||void 0};b.run("INSERT INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET timestamp = excluded.timestamp, provider = excluded.provider, model = excluded.model, connectionId = excluded.connectionId, status = excluded.status, data = excluded.data",[a.id,a.timestamp,a.provider,a.model,a.connectionId,a.status,(0,e.s)(a)])}let d=b.get("SELECT COUNT(*) as c FROM requestDetails");d&&d.c>c.maxRecords&&b.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[d.c-c.maxRecords])})}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{M=!1}}}async function P(a){let b=await J();b.enabled&&(K.push(a),K.length>=b.batchSize?(L&&(clearTimeout(L),L=null),O().catch(a=>console.error("[requestDetailsRepo] flush err:",a))):L||(L=setTimeout(()=>{L=null,O().catch(()=>{})},b.flushIntervalMs)))}async function Q(a={}){let b=await (0,d.c)(),c=[],f=[];a.provider&&(c.push("provider = ?"),f.push(a.provider)),a.model&&(c.push("model = ?"),f.push(a.model)),a.connectionId&&(c.push("connectionId = ?"),f.push(a.connectionId)),a.status&&(c.push("status = ?"),f.push(a.status)),a.startDate&&(c.push("timestamp >= ?"),f.push(new Date(a.startDate).toISOString())),a.endDate&&(c.push("timestamp <= ?"),f.push(new Date(a.endDate).toISOString()));let g=c.length?`WHERE ${c.join(" AND ")}`:"",h=b.get(`SELECT COUNT(*) as c FROM requestDetails ${g}`,f),i=h?h.c:0,j=a.page||1,k=a.pageSize||50,l=Math.ceil(i/k);return{details:b.all(`SELECT data FROM requestDetails ${g} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...f,k,(j-1)*k]).map(a=>(0,e.q)(a.data,{})),pagination:{page:j,pageSize:k,totalItems:i,totalPages:l,hasNext:j<l,hasPrev:j>1}}}async function R(){return(await (0,d.c)()).all("SELECT DISTINCT provider FROM requestDetails WHERE provider IS NOT NULL ORDER BY provider ASC").map(a=>a.provider)}let S=async()=>{L&&(clearTimeout(L),L=null),K.length>0&&await O()};async function T(){let a=await (0,d.c)(),{exportSettings:b}=await Promise.resolve().then(c.bind(c,42655)),f={settings:await b(),providerConnections:a.all("SELECT * FROM providerConnections").map(a=>({...(0,e.q)(a.data,{}),id:a.id,provider:a.provider,authType:a.authType,name:a.name,email:a.email,priority:a.priority,isActive:1===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt})),providerNodes:a.all("SELECT * FROM providerNodes").map(a=>({...(0,e.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt})),proxyPools:a.all("SELECT * FROM proxyPools").map(a=>({...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt})),apiKeys:a.all("SELECT * FROM apiKeys").map(a=>({id:a.id,key:a.key,keyHash:a.keyHash,name:a.name,machineId:a.machineId,isActive:1===a.isActive,createdAt:a.createdAt,access:(0,g.xE)(a.accessRestricted,a.accessAllow)})),combos:a.all("SELECT * FROM combos").map(a=>({id:a.id,name:a.name,kind:a.kind,models:(0,e.q)(a.models,[]),createdAt:a.createdAt,updatedAt:a.updatedAt})),modelAliases:{},customModels:[],mitmAlias:{},pricing:{}};for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'modelAliases'"))f.modelAliases[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'customModels'"))f.customModels.push((0,e.q)(b.value));for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'mitmAlias'"))f.mitmAlias[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'pricing'"))f.pricing[b.key]=(0,e.q)(b.value);return f}async function U(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("Invalid database payload");let b=await (0,d.c)();return b.transaction(()=>{for(let c of(b.run("DELETE FROM settings"),b.run("DELETE FROM providerConnections"),b.run("DELETE FROM providerNodes"),b.run("DELETE FROM proxyPools"),b.run("DELETE FROM apiKeys"),b.run("DELETE FROM combos"),b.run("DELETE FROM kv WHERE scope IN ('modelAliases', 'customModels', 'mitmAlias', 'pricing')"),a.settings&&b.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(a.settings)]),a.providerConnections||[])){let{id:a,provider:d,authType:f,name:g,email:h,priority:i,isActive:j,createdAt:k,updatedAt:l,...m}=c;b.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[a,d,f||"oauth",g||null,h||null,i||null,+(!1!==j),(0,e.s)(m),k||new Date().toISOString(),l||new Date().toISOString()])}for(let c of a.providerNodes||[]){let{id:a,type:d,name:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,d||null,f||null,(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.proxyPools||[]){let{id:a,isActive:d,testStatus:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,+(!1!==d),f||"unknown",(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.apiKeys||[]){let a=h.M0;if(void 0!==c.access){let b=(0,g.M7)(c.access);if(!b.ok)throw Error(`apiKeys ${c.id}: ${b.error}`);a=b.value}let d=(0,g.aB)(a),e=c.keyHash||(0,i.k)(c.key),f=c.keyHash?c.key:(0,m.o)(c.key);b.run("INSERT OR REPLACE INTO apiKeys(id, key, keyHash, name, machineId, isActive, createdAt, accessRestricted, accessAllow) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",[c.id,f,e,c.name||null,c.machineId||null,+(!1!==c.isActive),c.createdAt||new Date().toISOString(),d.accessRestricted,d.accessAllow])}for(let c of a.combos||[])b.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c.id,c.name,c.kind||null,(0,e.s)(c.models||[]),c.createdAt||new Date().toISOString(),c.updatedAt||new Date().toISOString()]);for(let[c,d]of Object.entries(a.modelAliases||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[c,(0,e.s)(d)]);for(let c of a.customModels||[]){let a=`${c.providerAlias}|${c.id}|${c.type||"llm"}`;b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[a,(0,e.s)(c)])}for(let[c,d]of Object.entries(a.mitmAlias||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[c,(0,e.s)(d||{})]);for(let[c,d]of Object.entries(a.pricing||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[c,(0,e.s)(d||{})])}),(0,f.hX)(),(0,j.iz)(),(0,k._l)(),(0,k.Ti)(),(0,l.vR)(),await T()}process.off("beforeExit",S),process.off("SIGINT",S),process.off("SIGTERM",S),process.off("exit",S),process.on("beforeExit",S),process.on("SIGINT",S),process.on("SIGTERM",S),process.on("exit",S)},47969:(a,b,c)=>{"use strict";c.d(b,{Es:()=>e,TE:()=>f,iz:()=>g});let d=new Map;function e(a){let b=d.get(a);if(b)return b.expiresAt<=Date.now()?void d.delete(a):(d.delete(a),d.set(a,b),b.row)}function f(a,b){if(d.size>=512){let a=d.keys().next().value;void 0!==a&&d.delete(a)}d.delete(a),d.set(a,{row:b,expiresAt:Date.now()+(b?5e3:1e3)})}function g(){d.clear()}},48753:(a,b,c)=>{"use strict";c.d(b,{k:()=>p,u:()=>o});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(49120),k=c(45193);let l=i().join(j.n,"auth","key-pepper"),m=null;function n(){let a;try{a=g().readFileSync(l)}catch(a){if("ENOENT"===a.code)return null;throw a}if(a.length<16)throw Error(`[auth] key pepper at ${l} is too short — refusing to use it`);return a}function o(){return m||(m=n()||function(){(0,k.J)(i().dirname(l));let a=e().randomBytes(32);try{g().writeFileSync(l,a,{mode:384,flag:"wx"})}catch(b){if("EEXIST"!==b.code)throw b;let a=n();if(a)return a;throw b}return(0,k.y)(l,384),a}()),m}function p(a){return e().createHash("sha256").update(o()).update(String(a??"")).digest("hex")}},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="omnihilbras";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{e().mkdirSync(a,{recursive:!0,mode:448});try{e().chmodSync(a,448)}catch{}return a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},62674:(a,b,c)=>{"use strict";function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(36366)},74452:(a,b,c)=>{"use strict";c.r(b),c.d(b,{createApiKey:()=>q,deleteApiKey:()=>s,getApiKeyById:()=>o,getApiKeyByKey:()=>p,getApiKeys:()=>n,updateApiKey:()=>r,validateApiKey:()=>t});var d=c(94755),e=c(36366),f=c(33666),g=c(38606),h=c(48753),i=c(3506),j=c(47969),k=c(45913);function l(a){return a?{id:a.id,key:(0,k.o)(a.key),name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,createdAt:a.createdAt,access:(0,f.xE)(a.accessRestricted,a.accessAllow)}:null}async function m(a,b){let c,d=(0,h.k)(b),e=(0,j.Es)(d);if(void 0!==e)return e;let f=(c=function(a,b){let c=a.get("SELECT * FROM apiKeys WHERE keyHash = ?",[(0,h.k)(b)]);if(c)return{row:c,legacy:!1};let d=a.get("SELECT * FROM apiKeys WHERE key = ? AND keyHash IS NULL",[b]);return d?{row:d,legacy:!0}:null}(a,b))?c.legacy?function(a,b,c){let d=(0,h.k)(c),e=(0,k.o)(c);try{a.transaction(()=>{a.run("UPDATE apiKeys SET keyHash = ?, key = ? WHERE id = ?",[d,e,b.id]),a.run("INSERT INTO _meta(key, value) VALUES ('needsCompaction', '1') ON CONFLICT(key) DO UPDATE SET value = '1'")})}catch(a){return console.warn(`[apiKeys] could not hash key ${b.id}: ${a.message}`),b}return{...b,keyHash:d,key:e}}(a,c.row,b):c.row:null;return(0,j.TE)(d,f),f}async function n(){return(await (0,e.c)()).all("SELECT * FROM apiKeys ORDER BY createdAt ASC").map(l)}async function o(a){return l((await (0,e.c)()).get("SELECT * FROM apiKeys WHERE id = ?",[a]))}async function p(a){if(!a)return null;let b=await (0,e.c)();return l(await m(b,a))}async function q(a,b){if(!b)throw Error("machineId is required");let i=await (0,e.c)(),{generateApiKeyWithMachine:l}=await c.e(6844).then(c.bind(c,86844)),m=l(b),n={id:(0,d.A)(),name:a,key:m.key,keyHash:(0,h.k)(m.key),machineId:b,isActive:!0,createdAt:new Date().toISOString(),access:{restricted:!1,allow:[]}},o=(0,f.aB)(g.M0);return i.run("INSERT INTO apiKeys(id, key, keyHash, name, machineId, isActive, createdAt, accessRestricted, accessAllow) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",[n.id,(0,k.o)(m.key),n.keyHash,n.name,n.machineId,1,n.createdAt,o.accessRestricted,o.accessAllow]),(0,j.iz)(),n}async function r(a,b){let c=await (0,e.c)(),d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let g={...l(e),...b},h=(0,f.aB)(g.access);c.run("UPDATE apiKeys SET name = ?, machineId = ?, isActive = ?, accessRestricted = ?, accessAllow = ? WHERE id = ?",[g.name,g.machineId,+!!g.isActive,h.accessRestricted,h.accessAllow,a]),d=l(c.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}),(0,j.iz)(),d}async function s(a){let b=(await (0,e.c)()).run("DELETE FROM apiKeys WHERE id = ?",[a]);return(0,j.iz)(),(b?.changes??0)>0}async function t(a){if(!a)return!1;let b=await (0,e.c)(),c=await m(b,a);return c?1===c.isActive||!0===c.isActive:(0,i.b)(a)}},78335:()=>{},95658:(a,b,c)=>{"use strict";c.d(b,{AL:()=>i,HG:()=>h,Jh:()=>l,KQ:()=>j,Or:()=>k});var d=c(76760),e=c.n(d);c(73024);var f=c(49120),g=c(45193);let h=e().join(f.n,"db"),i=e().join(h,"data.sqlite"),j=e().join(h,"backups"),k={main:e().join(f.n,"db.json"),usage:e().join(f.n,"usage.json"),disabled:e().join(f.n,"disabledModels.json"),details:e().join(f.n,"request-details.json")};function l(){for(let a of[f.n,h,j])(0,g.J)(a)}},96487:()=>{},97914:(a,b,c)=>{"use strict";c.d(b,{KJ:()=>p,VT:()=>r,getPricingForModel:()=>o,r4:()=>k,yF:()=>q});var d=c(36366),e=c(644);let f=(0,c(22846).U)("pricing"),g={value:null,expiresAt:0},h={value:null,expiresAt:0};function i(){g={value:null,expiresAt:0},h={value:null,expiresAt:0},n.clear()}async function j(){let a=Date.now();if(h.value&&h.expiresAt>a)return h.value;let b=await f.getAll();return h={value:b,expiresAt:a+5e3},b}async function k(){let a=Date.now();if(g.value&&g.expiresAt>a)return g.value;let b=await j(),{PROVIDER_PRICING:d}=await c.e(8920).then(c.bind(c,58920)),e={};for(let[a,c]of Object.entries(d))if(e[a]={...c},b[a])for(let[c,d]of Object.entries(b[a]))e[a][c]=e[a][c]?{...e[a][c],...d}:d;for(let[a,c]of Object.entries(b))if(e[a])for(let[b,d]of Object.entries(c))e[a][b]||(e[a][b]=d);else e[a]={...c};return g={value:e,expiresAt:a+5e3},e}let l=null;async function m(a,b){if(!l){let{getPricingForModel:a}=await c.e(8920).then(c.bind(c,58920));l=a}return l(a,b)}let n=new Map;async function o(a,b){if(!b)return null;let c=`${a||""}\0${b}`,d=n.get(c);if(void 0!==d)return d;let e=await j(),f=a&&e[a]?.[b]?e[a][b]:await m(a,b);return n.size>=2e3&&n.clear(),n.set(c,f),f}async function p(a){let b=await (0,d.c)();return b.transaction(()=>{for(let[c,d]of Object.entries(a)){let a=b.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[c]),f={...a&&(0,e.q)(a.value,{})||{}};for(let[a,b]of Object.entries(d))f[a]=b;b.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[c,(0,e.s)(f)])}}),i(),await j()}async function q(a,b){if(!a)return await j();let c=await (0,d.c)();return c.transaction(()=>{if(!b)return void c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]);let d=c.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[a]),f=d&&(0,e.q)(d.value,{})||{};delete f[b],0===Object.keys(f).length?c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]):c.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,(0,e.s)(f)])}),i(),await j()}async function r(){return await f.clear(),i(),{}}},99703:(a,b,c)=>{"use strict";c.d(b,{BY:()=>U,Dv:()=>K,E5:()=>W,Zx:()=>X,_V:()=>u,cx:()=>J,getUsageTotalsForConnection:()=>H,j$:()=>V,q3:()=>R,rg:()=>L,sZ:()=>M,uw:()=>I});var d=c(94735),e=c(36366),f=c(644);c(62674);var g=c(26856),h=c(45913),i=c(3506);function j(a,b){let c=parseInt(process.env[a]||"",10);return Number.isFinite(c)&&c>0?c:b}let k=j("USAGE_FLUSH_INTERVAL_MS",250),l=j("USAGE_FLUSH_MAX_ROWS",200);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._pendingRequests.client||(global._pendingRequests.client={total:0,byScope:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._clientPendingTimers||(global._clientPendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null}),global._usageWriteBuffer||(global._usageWriteBuffer={items:[],timer:null,flushing:null});let m=global._pendingRequests,n=global._lastErrorProvider,o=global._pendingTimers,p=global._clientPendingTimers,q=global._recentRing,r=global._connectionMapCache,s=global._statsEmitTimers,t=global._usageWriteBuffer,u=global._statsEmitter;function v(a,b=150){let c="update"===a?"update":"pending";s[c]||(s[c]=setTimeout(()=>{s[c]=null,u.emit(a)},b),s[c]?.unref?.())}function w(a){let b=a?new Date(a):new Date;return`${b.getFullYear()}-${String(b.getMonth()+1).padStart(2,"0")}-${String(b.getDate()).padStart(2,"0")}`}function x(a,b,c){a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cachedTokens+=c.cachedTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta)}function y(a,b){let c=b.tokens?.prompt_tokens||b.tokens?.input_tokens||0,d=b.tokens?.completion_tokens||b.tokens?.output_tokens||0,e=b.tokens?.cached_tokens||b.tokens?.cache_read_input_tokens||0,f=b.cost||0,g={promptTokens:c,completionTokens:d,cachedTokens:e,cost:f};a.requests=(a.requests||0)+1,a.promptTokens=(a.promptTokens||0)+c,a.completionTokens=(a.completionTokens||0)+d,a.cachedTokens=(a.cachedTokens||0)+e,a.cost=(a.cost||0)+f,a.byProvider||={},a.byModel||={},a.byAccount||={},a.byApiKey||={},a.byEndpoint||={},b.provider&&x(a.byProvider,b.provider,g);let h=b.provider?`${b.model}|${b.provider}`:b.model;if(x(a.byModel,h,{...g,meta:{rawModel:b.model,provider:b.provider}}),b.connectionId){let c=`${b.connectionId}|${b.model}|${b.provider||"unknown"}`;x(a.byAccount,c,{...g,meta:{rawModel:b.model,provider:b.provider}})}let i=b.apiKey&&"string"==typeof b.apiKey?b.apiKey:"local-no-key",j=`${i}|${b.model}|${b.provider||"unknown"}`;x(a.byApiKey,j,{...g,meta:{rawModel:b.model,provider:b.provider,apiKey:b.apiKey||null}});let k=b.endpoint||"Unknown",l=`${k}|${b.model}|${b.provider||"unknown"}`;x(a.byEndpoint,l,{...g,meta:{endpoint:k,rawModel:b.model,provider:b.provider}})}function z(){return{requests:0,promptTokens:0,completionTokens:0,cost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{}}}function A(a,b){for(let[c,d]of b){let b=a[c];if(!b){a[c]=d;continue}b.requests=(b.requests||0)+(d.requests||0),b.promptTokens=(b.promptTokens||0)+(d.promptTokens||0),b.completionTokens=(b.completionTokens||0)+(d.completionTokens||0),b.cachedTokens=(b.cachedTokens||0)+(d.cachedTokens||0),b.cost=(b.cost||0)+(d.cost||0)}}function B(){return t.items.slice()}function C(a){return a.map(a=>{var b;let c;return c=(b=a.entry).tokens||{},{timestamp:b.timestamp,provider:b.provider||null,model:b.model||null,connectionId:b.connectionId||null,apiKey:b.apiKey||null,endpoint:b.endpoint||null,promptTokens:c.prompt_tokens||c.input_tokens||0,completionTokens:c.completion_tokens||c.output_tokens||0,cost:b.cost||0,status:b.status||"ok",tokens:c}})}function D(a){let b=new Map;for(let c of a){let a=c.entry,d=w(a.timestamp),e=b.get(d);e||(e=z(),b.set(d,e)),y(e,a)}return b}async function E(){if(Date.now()-r.ts<3e4)return r.map;try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781)),b=await a(),d={};for(let a of b)d[a.id]=a.name||a.email||a.id;r.map=d,r.ts=Date.now()}catch{}return r.map}async function F(){if(!q.initialized){q.initialized=!0;try{q.items=(await (0,e.c)()).all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, cost, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[50]).reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,tokens:(0,f.q)(a.tokens,{})}))}catch{}}}async function G(a,b,d){if(!d||!a||!b)return 0;try{let{getPricingForModel:e}=await Promise.resolve().then(c.bind(c,97914)),f=await e(a,b);if(!f)return 0;let{calculateCostFromTokens:g}=await c.e(8920).then(c.bind(c,58920));return g(d,f)}catch(a){return console.error("Error calculating cost:",a),0}}async function H(a,b=2592e6){if(!a)return null;try{let c=await (0,e.c)(),d=new Date(Date.now()-b).toISOString(),f=c.get(`SELECT COUNT(*) AS requests,
|
|
13
|
+
data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.isActive,c.testStatus,c.data,c.createdAt,c.updatedAt])}async function t(a={}){let b=await (0,d.c)(),c=[],e=[];void 0!==a.isActive&&(c.push("isActive = ?"),e.push(+!!a.isActive)),a.testStatus&&(c.push("testStatus = ?"),e.push(a.testStatus));let f=`SELECT * FROM proxyPools${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,e).map(r);return g.sort((a,b)=>new Date(b.updatedAt||0)-new Date(a.updatedAt||0)),g}async function u(a){return r((await (0,d.c)()).get("SELECT * FROM proxyPools WHERE id = ?",[a]))}async function v(a){let b=await (0,d.c)(),c=new Date().toISOString(),e={id:a.id||(0,q.A)(),name:a.name,proxyUrl:a.proxyUrl,noProxy:a.noProxy||"",type:a.type||"http",isActive:void 0===a.isActive||a.isActive,strictProxy:!0===a.strictProxy,testStatus:a.testStatus||"unknown",lastTestedAt:a.lastTestedAt||null,lastError:a.lastError||null,createdAt:c,updatedAt:c};return s(b,e),e}async function w(a,b){let c=await (0,d.c)(),e=null;return c.transaction(()=>{let d=c.get("SELECT * FROM proxyPools WHERE id = ?",[a]);if(!d)return;let f={...r(d),...b,updatedAt:new Date().toISOString()};s(c,f),e=f}),e}async function x(a){let b=await (0,d.c)(),c=null;return b.transaction(()=>{let d=b.get("SELECT * FROM proxyPools WHERE id = ?",[a]);d&&(c=r(d),b.run("DELETE FROM proxyPools WHERE id = ?",[a]))}),c}var y=c(74452),z=c(1541),A=c(9460),B=c(97914);let C="disabledModels";async function D(){let a=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[C]),b={};for(let c of a)b[c.key]=(0,e.q)(c.value,[]);return b}async function E(a,b){if(!a||!Array.isArray(b))return;let c=await (0,d.c)();c.transaction(()=>{let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[C,a]),f=[...new Set([...d&&(0,e.q)(d.value,[])||[],...b])];c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[C,a,(0,e.s)(f)])})}async function F(a,b){if(!a)return;let c=await (0,d.c)();c.transaction(()=>{if(!Array.isArray(b)||0===b.length)return void c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[C,a]);let d=c.get("SELECT value FROM kv WHERE scope = ? AND key = ?",[C,a]),f=d&&(0,e.q)(d.value,[])||[],g=new Set(b),h=f.filter(a=>!g.has(a));0===h.length?c.run("DELETE FROM kv WHERE scope = ? AND key = ?",[C,a]):c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[C,a,(0,e.s)(h)])})}var G=c(99703);let H=null,I=0;async function J(){if(H&&Date.now()-I<5e3)return H;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,42655)),b=await a(),d=process.env.ENABLE_REQUEST_LOGS;if(void 0!==d)return H={enabled:"true"===d.toLowerCase(),maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))},I=Date.now(),H;let e="false"!==process.env.OBSERVABILITY_ENABLED;H={enabled:"boolean"==typeof b.enableObservability?b.enableObservability:e,maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))}}catch{H={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return I=Date.now(),H}let K=[],L=null,M=!1;function N(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}async function O(){if(!M&&0!==K.length){M=!0;try{for(;K.length>0;){let a=K.splice(0,K.length),b=await (0,d.c)(),c=await J();b.transaction(()=>{for(let d of a){d.id||(d.id=function(a){let b=new Date().toISOString(),c=Math.random().toString(36).substring(2,8),d=a?a.replace(/[^a-zA-Z0-9-]/g,"-"):"unknown";return`${b}-${c}-${d}`}(d.model)),d.timestamp||(d.timestamp=new Date().toISOString()),d.request?.headers&&(d.request.headers=function(a){if(!a||"object"!=typeof a)return{};let b=["authorization","x-api-key","cookie","token","api-key"],c={...a};for(let a of Object.keys(c))b.some(b=>a.toLowerCase().includes(b))&&delete c[a];return c}(d.request.headers));let a={id:d.id,provider:d.provider||null,model:d.model||null,connectionId:d.connectionId||null,timestamp:d.timestamp,status:d.status||null,latency:d.latency||{},tokens:d.tokens||{},request:N(d.request,c.maxJsonSize),providerRequest:N(d.providerRequest,c.maxJsonSize),providerResponse:N(d.providerResponse,c.maxJsonSize),response:N(d.response,c.maxJsonSize),pxpipe:d.pxpipe||void 0};b.run("INSERT INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET timestamp = excluded.timestamp, provider = excluded.provider, model = excluded.model, connectionId = excluded.connectionId, status = excluded.status, data = excluded.data",[a.id,a.timestamp,a.provider,a.model,a.connectionId,a.status,(0,e.s)(a)])}let d=b.get("SELECT COUNT(*) as c FROM requestDetails");d&&d.c>c.maxRecords&&b.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[d.c-c.maxRecords])})}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{M=!1}}}async function P(a){let b=await J();b.enabled&&(K.push(a),K.length>=b.batchSize?(L&&(clearTimeout(L),L=null),O().catch(a=>console.error("[requestDetailsRepo] flush err:",a))):L||(L=setTimeout(()=>{L=null,O().catch(()=>{})},b.flushIntervalMs)))}async function Q(a={}){let b=await (0,d.c)(),c=[],f=[];a.provider&&(c.push("provider = ?"),f.push(a.provider)),a.model&&(c.push("model = ?"),f.push(a.model)),a.connectionId&&(c.push("connectionId = ?"),f.push(a.connectionId)),a.status&&(c.push("status = ?"),f.push(a.status)),a.startDate&&(c.push("timestamp >= ?"),f.push(new Date(a.startDate).toISOString())),a.endDate&&(c.push("timestamp <= ?"),f.push(new Date(a.endDate).toISOString()));let g=c.length?`WHERE ${c.join(" AND ")}`:"",h=b.get(`SELECT COUNT(*) as c FROM requestDetails ${g}`,f),i=h?h.c:0,j=a.page||1,k=a.pageSize||50,l=Math.ceil(i/k);return{details:b.all(`SELECT data FROM requestDetails ${g} ORDER BY timestamp DESC LIMIT ? OFFSET ?`,[...f,k,(j-1)*k]).map(a=>(0,e.q)(a.data,{})),pagination:{page:j,pageSize:k,totalItems:i,totalPages:l,hasNext:j<l,hasPrev:j>1}}}async function R(){return(await (0,d.c)()).all("SELECT DISTINCT provider FROM requestDetails WHERE provider IS NOT NULL ORDER BY provider ASC").map(a=>a.provider)}let S=async()=>{L&&(clearTimeout(L),L=null),K.length>0&&await O()};async function T(){let a=await (0,d.c)(),{exportSettings:b}=await Promise.resolve().then(c.bind(c,42655)),f={settings:await b(),providerConnections:a.all("SELECT * FROM providerConnections").map(a=>({...(0,e.q)(a.data,{}),id:a.id,provider:a.provider,authType:a.authType,name:a.name,email:a.email,priority:a.priority,isActive:1===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt})),providerNodes:a.all("SELECT * FROM providerNodes").map(a=>({...(0,e.q)(a.data,{}),id:a.id,type:a.type,name:a.name,createdAt:a.createdAt,updatedAt:a.updatedAt})),proxyPools:a.all("SELECT * FROM proxyPools").map(a=>({...(0,e.q)(a.data,{}),id:a.id,isActive:1===a.isActive,testStatus:a.testStatus,createdAt:a.createdAt,updatedAt:a.updatedAt})),apiKeys:a.all("SELECT * FROM apiKeys").map(a=>({id:a.id,key:a.key,keyHash:a.keyHash,name:a.name,machineId:a.machineId,isActive:1===a.isActive,createdAt:a.createdAt,access:(0,g.xE)(a.accessRestricted,a.accessAllow)})),combos:a.all("SELECT * FROM combos").map(a=>({id:a.id,name:a.name,kind:a.kind,models:(0,e.q)(a.models,[]),createdAt:a.createdAt,updatedAt:a.updatedAt})),modelAliases:{},customModels:[],mitmAlias:{},pricing:{}};for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'modelAliases'"))f.modelAliases[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'customModels'"))f.customModels.push((0,e.q)(b.value));for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'mitmAlias'"))f.mitmAlias[b.key]=(0,e.q)(b.value);for(let b of a.all("SELECT key, value FROM kv WHERE scope = 'pricing'"))f.pricing[b.key]=(0,e.q)(b.value);return f}async function U(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("Invalid database payload");let b=await (0,d.c)();return b.transaction(()=>{for(let c of(b.run("DELETE FROM settings"),b.run("DELETE FROM providerConnections"),b.run("DELETE FROM providerNodes"),b.run("DELETE FROM proxyPools"),b.run("DELETE FROM apiKeys"),b.run("DELETE FROM combos"),b.run("DELETE FROM kv WHERE scope IN ('modelAliases', 'customModels', 'mitmAlias', 'pricing')"),a.settings&&b.run("INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data",[(0,e.s)(a.settings)]),a.providerConnections||[])){let{id:a,provider:d,authType:f,name:g,email:h,priority:i,isActive:j,createdAt:k,updatedAt:l,...m}=c;b.run("INSERT OR REPLACE INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[a,d,f||"oauth",g||null,h||null,i||null,+(!1!==j),(0,e.s)(m),k||new Date().toISOString(),l||new Date().toISOString()])}for(let c of a.providerNodes||[]){let{id:a,type:d,name:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO providerNodes(id, type, name, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,d||null,f||null,(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.proxyPools||[]){let{id:a,isActive:d,testStatus:f,createdAt:g,updatedAt:h,...i}=c;b.run("INSERT OR REPLACE INTO proxyPools(id, isActive, testStatus, data, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[a,+(!1!==d),f||"unknown",(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.apiKeys||[]){let a=h.M0;if(void 0!==c.access){let b=(0,g.M7)(c.access);if(!b.ok)throw Error(`apiKeys ${c.id}: ${b.error}`);a=b.value}let d=(0,g.aB)(a),e=c.keyHash||(0,i.k)(c.key),f=c.keyHash?c.key:(0,m.o)(c.key);b.run("INSERT OR REPLACE INTO apiKeys(id, key, keyHash, name, machineId, isActive, createdAt, accessRestricted, accessAllow) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",[c.id,f,e,c.name||null,c.machineId||null,+(!1!==c.isActive),c.createdAt||new Date().toISOString(),d.accessRestricted,d.accessAllow])}for(let c of a.combos||[])b.run("INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt) VALUES(?, ?, ?, ?, ?, ?)",[c.id,c.name,c.kind||null,(0,e.s)(c.models||[]),c.createdAt||new Date().toISOString(),c.updatedAt||new Date().toISOString()]);for(let[c,d]of Object.entries(a.modelAliases||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('modelAliases', ?, ?)",[c,(0,e.s)(d)]);for(let c of a.customModels||[]){let a=`${c.providerAlias}|${c.id}|${c.type||"llm"}`;b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('customModels', ?, ?)",[a,(0,e.s)(c)])}for(let[c,d]of Object.entries(a.mitmAlias||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('mitmAlias', ?, ?)",[c,(0,e.s)(d||{})]);for(let[c,d]of Object.entries(a.pricing||{}))b.run("INSERT OR REPLACE INTO kv(scope, key, value) VALUES('pricing', ?, ?)",[c,(0,e.s)(d||{})])}),(0,f.hX)(),(0,j.iz)(),(0,k._l)(),(0,k.Ti)(),(0,l.vR)(),await T()}process.off("beforeExit",S),process.off("SIGINT",S),process.off("SIGTERM",S),process.off("exit",S),process.on("beforeExit",S),process.on("SIGINT",S),process.on("SIGTERM",S),process.on("exit",S)},47969:(a,b,c)=>{"use strict";c.d(b,{Es:()=>e,TE:()=>f,iz:()=>g});let d=new Map;function e(a){let b=d.get(a);if(b)return b.expiresAt<=Date.now()?void d.delete(a):(d.delete(a),d.set(a,b),b.row)}function f(a,b){if(d.size>=512){let a=d.keys().next().value;void 0!==a&&d.delete(a)}d.delete(a),d.set(a,{row:b,expiresAt:Date.now()+(b?5e3:1e3)})}function g(){d.clear()}},48753:(a,b,c)=>{"use strict";c.d(b,{k:()=>p,u:()=>o});var d=c(77598),e=c.n(d),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(49120),k=c(45193);let l=i().join(j.n,"auth","key-pepper"),m=null;function n(){let a;try{a=g().readFileSync(l)}catch(a){if("ENOENT"===a.code)return null;throw a}if(a.length<16)throw Error(`[auth] key pepper at ${l} is too short — refusing to use it`);return a}function o(){return m||(m=n()||function(){(0,k.J)(i().dirname(l));let a=e().randomBytes(32);try{g().writeFileSync(l,a,{mode:384,flag:"wx"})}catch(b){if("EEXIST"!==b.code)throw b;let a=n();if(a)return a;throw b}return(0,k.y)(l,384),a}()),m}function p(a){return e().createHash("sha256").update(o()).update(String(a??"")).digest("hex")}},49120:(a,b,c)=>{"use strict";c.d(b,{n:()=>l});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="omnihilbras";function k(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}let l=function(){let a=process.env.DATA_DIR;if(!a)return k();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),k();try{e().mkdirSync(a,{recursive:!0,mode:448});try{e().chmodSync(a,448)}catch{}return a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),k();throw b}}()},62674:(a,b,c)=>{"use strict";function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(36366)},74452:(a,b,c)=>{"use strict";c.r(b),c.d(b,{createApiKey:()=>q,deleteApiKey:()=>s,getApiKeyById:()=>o,getApiKeyByKey:()=>p,getApiKeys:()=>n,updateApiKey:()=>r,validateApiKey:()=>t});var d=c(94755),e=c(36366),f=c(33666),g=c(38606),h=c(48753),i=c(3506),j=c(47969),k=c(45913);function l(a){return a?{id:a.id,key:(0,k.o)(a.key),name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,createdAt:a.createdAt,access:(0,f.xE)(a.accessRestricted,a.accessAllow)}:null}async function m(a,b){let c,d=(0,h.k)(b),e=(0,j.Es)(d);if(void 0!==e)return e;let f=(c=function(a,b){let c=a.get("SELECT * FROM apiKeys WHERE keyHash = ?",[(0,h.k)(b)]);if(c)return{row:c,legacy:!1};let d=a.get("SELECT * FROM apiKeys WHERE key = ? AND keyHash IS NULL",[b]);return d?{row:d,legacy:!0}:null}(a,b))?c.legacy?function(a,b,c){let d=(0,h.k)(c),e=(0,k.o)(c);try{a.transaction(()=>{a.run("UPDATE apiKeys SET keyHash = ?, key = ? WHERE id = ?",[d,e,b.id]),a.run("INSERT INTO _meta(key, value) VALUES ('needsCompaction', '1') ON CONFLICT(key) DO UPDATE SET value = '1'")})}catch(a){return console.warn(`[apiKeys] could not hash key ${b.id}: ${a.message}`),b}return{...b,keyHash:d,key:e}}(a,c.row,b):c.row:null;return(0,j.TE)(d,f),f}async function n(){return(await (0,e.c)()).all("SELECT * FROM apiKeys ORDER BY createdAt ASC").map(l)}async function o(a){return l((await (0,e.c)()).get("SELECT * FROM apiKeys WHERE id = ?",[a]))}async function p(a){if(!a)return null;let b=await (0,e.c)();return l(await m(b,a))}async function q(a,b){if(!b)throw Error("machineId is required");let i=await (0,e.c)(),{generateApiKeyWithMachine:l}=await c.e(6844).then(c.bind(c,86844)),m=l(b),n={id:(0,d.A)(),name:a,key:m.key,keyHash:(0,h.k)(m.key),machineId:b,isActive:!0,createdAt:new Date().toISOString(),access:{restricted:!1,allow:[]}},o=(0,f.aB)(g.M0);return i.run("INSERT INTO apiKeys(id, key, keyHash, name, machineId, isActive, createdAt, accessRestricted, accessAllow) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",[n.id,(0,k.o)(m.key),n.keyHash,n.name,n.machineId,1,n.createdAt,o.accessRestricted,o.accessAllow]),(0,j.iz)(),n}async function r(a,b){let c=await (0,e.c)(),d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let g={...l(e),...b},h=(0,f.aB)(g.access);c.run("UPDATE apiKeys SET name = ?, machineId = ?, isActive = ?, accessRestricted = ?, accessAllow = ? WHERE id = ?",[g.name,g.machineId,+!!g.isActive,h.accessRestricted,h.accessAllow,a]),d=l(c.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}),(0,j.iz)(),d}async function s(a){let b=(await (0,e.c)()).run("DELETE FROM apiKeys WHERE id = ?",[a]);return(0,j.iz)(),(b?.changes??0)>0}async function t(a){if(!a)return!1;let b=await (0,e.c)(),c=await m(b,a);return c?1===c.isActive||!0===c.isActive:(0,i.b)(a)}},78335:()=>{},95658:(a,b,c)=>{"use strict";c.d(b,{AL:()=>i,HG:()=>h,Jh:()=>l,KQ:()=>j,Or:()=>k});var d=c(76760),e=c.n(d);c(73024);var f=c(49120),g=c(45193);let h=e().join(f.n,"db"),i=e().join(h,"data.sqlite"),j=e().join(h,"backups"),k={main:e().join(f.n,"db.json"),usage:e().join(f.n,"usage.json"),disabled:e().join(f.n,"disabledModels.json"),details:e().join(f.n,"request-details.json")};function l(){for(let a of[f.n,h,j])(0,g.J)(a)}},96487:()=>{},97914:(a,b,c)=>{"use strict";c.d(b,{KJ:()=>p,VT:()=>r,getPricingForModel:()=>o,r4:()=>k,yF:()=>q});var d=c(36366),e=c(644);let f=(0,c(22846).U)("pricing"),g={value:null,expiresAt:0},h={value:null,expiresAt:0};function i(){g={value:null,expiresAt:0},h={value:null,expiresAt:0},n.clear()}async function j(){let a=Date.now();if(h.value&&h.expiresAt>a)return h.value;let b=await f.getAll();return h={value:b,expiresAt:a+5e3},b}async function k(){let a=Date.now();if(g.value&&g.expiresAt>a)return g.value;let b=await j(),{PROVIDER_PRICING:d}=await c.e(8920).then(c.bind(c,58920)),e={};for(let[a,c]of Object.entries(d))if(e[a]={...c},b[a])for(let[c,d]of Object.entries(b[a]))e[a][c]=e[a][c]?{...e[a][c],...d}:d;for(let[a,c]of Object.entries(b))if(e[a])for(let[b,d]of Object.entries(c))e[a][b]||(e[a][b]=d);else e[a]={...c};return g={value:e,expiresAt:a+5e3},e}let l=null;async function m(a,b){if(!l){let{getPricingForModel:a}=await c.e(8920).then(c.bind(c,58920));l=a}return l(a,b)}let n=new Map;async function o(a,b){if(!b)return null;let c=`${a||""}\0${b}`,d=n.get(c);if(void 0!==d)return d;let e=await j(),f=a&&e[a]?.[b]?e[a][b]:await m(a,b);return n.size>=2e3&&n.clear(),n.set(c,f),f}async function p(a){let b=await (0,d.c)();return b.transaction(()=>{for(let[c,d]of Object.entries(a)){let a=b.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[c]),f={...a&&(0,e.q)(a.value,{})||{}};for(let[a,b]of Object.entries(d))f[a]=b;b.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[c,(0,e.s)(f)])}}),i(),await j()}async function q(a,b){if(!a)return await j();let c=await (0,d.c)();return c.transaction(()=>{if(!b)return void c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]);let d=c.get("SELECT value FROM kv WHERE scope = 'pricing' AND key = ?",[a]),f=d&&(0,e.q)(d.value,{})||{};delete f[b],0===Object.keys(f).length?c.run("DELETE FROM kv WHERE scope = 'pricing' AND key = ?",[a]):c.run("INSERT INTO kv(scope, key, value) VALUES('pricing', ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,(0,e.s)(f)])}),i(),await j()}async function r(){return await f.clear(),i(),{}}},99703:(a,b,c)=>{"use strict";c.d(b,{BY:()=>_,Dv:()=>N,E5:()=>ab,Zx:()=>ac,_V:()=>w,_w:()=>M,cx:()=>L,getUsageTotalsForConnection:()=>J,j$:()=>aa,q3:()=>Y,rg:()=>O,sZ:()=>P,uw:()=>K});var d=c(94735),e=c(36366),f=c(644);c(62674);var g=c(26856),h=c(45913),i=c(3506);function j(a,b){let c=parseInt(process.env[a]||"",10);return Number.isFinite(c)&&c>0?c:b}let k=j("USAGE_FLUSH_INTERVAL_MS",250),l=j("USAGE_FLUSH_MAX_ROWS",200),m=j("USAGE_ROLLUP_FLUSH_INTERVAL_MS",3e4);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._pendingRequests.client||(global._pendingRequests.client={total:0,byScope:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._clientPendingTimers||(global._clientPendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null}),global._usageWriteBuffer||(global._usageWriteBuffer={items:[],timer:null,flushing:null}),global._usageRollupBuffer||(global._usageRollupBuffer={days:new Map,timer:null,flushing:null});let n=global._pendingRequests,o=global._lastErrorProvider,p=global._pendingTimers,q=global._clientPendingTimers,r=global._recentRing,s=global._connectionMapCache,t=global._statsEmitTimers,u=global._usageWriteBuffer,v=global._usageRollupBuffer;global._usageResetBuffers=()=>{u.items=[],Q(),v.days=new Map,W()};let w=global._statsEmitter;function x(a,b=150){let c="update"===a?"update":"pending";t[c]||(t[c]=setTimeout(()=>{t[c]=null,w.emit(a)},b),t[c]?.unref?.())}function y(a){let b=a?new Date(a):new Date;return`${b.getFullYear()}-${String(b.getMonth()+1).padStart(2,"0")}-${String(b.getDate()).padStart(2,"0")}`}function z(a,b,c){a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cachedTokens+=c.cachedTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta)}function A(a,b){let c=b.tokens?.prompt_tokens||b.tokens?.input_tokens||0,d=b.tokens?.completion_tokens||b.tokens?.output_tokens||0,e=b.tokens?.cached_tokens||b.tokens?.cache_read_input_tokens||0,f=b.cost||0,g={promptTokens:c,completionTokens:d,cachedTokens:e,cost:f};a.requests=(a.requests||0)+1,a.promptTokens=(a.promptTokens||0)+c,a.completionTokens=(a.completionTokens||0)+d,a.cachedTokens=(a.cachedTokens||0)+e,a.cost=(a.cost||0)+f,a.byProvider||={},a.byModel||={},a.byAccount||={},a.byApiKey||={},a.byEndpoint||={},b.provider&&z(a.byProvider,b.provider,g);let h=b.provider?`${b.model}|${b.provider}`:b.model;if(z(a.byModel,h,{...g,meta:{rawModel:b.model,provider:b.provider}}),b.connectionId){let c=`${b.connectionId}|${b.model}|${b.provider||"unknown"}`;z(a.byAccount,c,{...g,meta:{rawModel:b.model,provider:b.provider}})}let i=b.apiKey&&"string"==typeof b.apiKey?b.apiKey:"local-no-key",j=`${i}|${b.model}|${b.provider||"unknown"}`;z(a.byApiKey,j,{...g,meta:{rawModel:b.model,provider:b.provider,apiKey:b.apiKey||null}});let k=b.endpoint||"Unknown",l=`${k}|${b.model}|${b.provider||"unknown"}`;z(a.byEndpoint,l,{...g,meta:{endpoint:k,rawModel:b.model,provider:b.provider}})}function B(){return{requests:0,promptTokens:0,completionTokens:0,cost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{}}}function C(a,b){for(let[c,d]of b){let b=a[c];if(!b){a[c]=d;continue}b.requests=(b.requests||0)+(d.requests||0),b.promptTokens=(b.promptTokens||0)+(d.promptTokens||0),b.completionTokens=(b.completionTokens||0)+(d.completionTokens||0),b.cachedTokens=(b.cachedTokens||0)+(d.cachedTokens||0),b.cost=(b.cost||0)+(d.cost||0)}}function D(){return u.items.slice()}function E(a){return a.map(a=>{var b;let c;return c=(b=a.entry).tokens||{},{timestamp:b.timestamp,provider:b.provider||null,model:b.model||null,connectionId:b.connectionId||null,apiKey:b.apiKey||null,endpoint:b.endpoint||null,promptTokens:c.prompt_tokens||c.input_tokens||0,completionTokens:c.completion_tokens||c.output_tokens||0,cost:b.cost||0,status:b.status||"ok",tokens:c}})}function F(a){let b=function(a){let b=new Map;for(let c of a){let a=c.entry,d=y(a.timestamp),e=b.get(d);e||(e=B(),b.set(d,e)),A(e,a)}return b}(a);for(let[a,c]of v.days){let d=b.get(a);if(!d){b.set(a,function(a){let b={...a};for(let c of["byProvider","byModel","byAccount","byApiKey","byEndpoint"])if(a[c])for(let[d,e]of(b[c]={},Object.entries(a[c])))b[c][d]={...e};return b}(c));continue}V(d,c)}return b}async function G(){if(Date.now()-s.ts<3e4)return s.map;try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781)),b=await a(),d={};for(let a of b)d[a.id]=a.name||a.email||a.id;s.map=d,s.ts=Date.now()}catch{}return s.map}async function H(){if(!r.initialized){r.initialized=!0;try{r.items=(await (0,e.c)()).all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, cost, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[50]).reverse().map(a=>({timestamp:a.timestamp,provider:a.provider,model:a.model,connectionId:a.connectionId,apiKey:a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,tokens:(0,f.q)(a.tokens,{})}))}catch{}}}async function I(a,b,d){if(!d||!a||!b)return 0;try{let{getPricingForModel:e}=await Promise.resolve().then(c.bind(c,97914)),f=await e(a,b);if(!f)return 0;let{calculateCostFromTokens:g}=await c.e(8920).then(c.bind(c,58920));return g(d,f)}catch(a){return console.error("Error calculating cost:",a),0}}async function J(a,b=2592e6){if(!a)return null;try{let c=await (0,e.c)(),d=new Date(Date.now()-b).toISOString(),f=c.get(`SELECT COUNT(*) AS requests,
|
|
14
14
|
COALESCE(SUM(promptTokens), 0) AS promptTokens,
|
|
15
15
|
COALESCE(SUM(completionTokens), 0) AS completionTokens,
|
|
16
16
|
COALESCE(SUM(cost), 0) AS cost
|
|
17
|
-
FROM usageHistory WHERE connectionId = ? AND timestamp >= ?`,[a,d]),g=f?.requests||0,h=(f?.promptTokens||0)+(f?.completionTokens||0),i=f?.cost||0;for(let b of
|
|
17
|
+
FROM usageHistory WHERE connectionId = ? AND timestamp >= ?`,[a,d]),g=f?.requests||0,h=(f?.promptTokens||0)+(f?.completionTokens||0),i=f?.cost||0;for(let b of E(D()))b.connectionId===a&&(b.timestamp<d||(g+=1,h+=(b.promptTokens||0)+(b.completionTokens||0),i+=b.cost||0));if(!(g>0))return null;return{windowMs:b,requests:g,tokens:h,cost:i}}catch(a){return console.error("getUsageTotalsForConnection failed:",a.message),null}}function K(a,b,c,d,e=!1){let f=b?`${a} (${b})`:a,g=`${c}|${f}`;n.byModel[f]||(n.byModel[f]=0),n.byModel[f]=Math.max(0,n.byModel[f]+(d?1:-1)),0===n.byModel[f]&&delete n.byModel[f],c&&(n.byAccount[c]||(n.byAccount[c]={}),n.byAccount[c][f]||(n.byAccount[c][f]=0),n.byAccount[c][f]=Math.max(0,n.byAccount[c][f]+(d?1:-1)),0===n.byAccount[c][f]&&(delete n.byAccount[c][f],0===Object.keys(n.byAccount[c]).length&&delete n.byAccount[c])),d?(clearTimeout(p[g]),p[g]=setTimeout(()=>{delete p[g],n.byModel[f]>0&&(n.byModel[f]=0),c&&n.byAccount[c]?.[f]>0&&(n.byAccount[c][f]=0),x("pending")},6e4)):(clearTimeout(p[g]),delete p[g]),!d&&e&&b&&(o.provider=b.toLowerCase(),o.ts=Date.now()),x("pending")}function L(a,b){let c=n.client,d=a||"unknown";b?(c.total+=1,c.byScope[d]=(c.byScope[d]||0)+1,clearTimeout(q[d]),q[d]=setTimeout(()=>{delete q[d];let a=c.byScope[d]||0;a>0&&(c.byScope[d]=0,c.total=Math.max(0,c.total-a)),x("pending")},21e5),q[d]?.unref?.()):(c.total=Math.max(0,c.total-1),c.byScope[d]=Math.max(0,(c.byScope[d]||0)-1),0===c.byScope[d]&&delete c.byScope[d],clearTimeout(q[d]),delete q[d]),x("pending")}function M(){return{byModel:{...n.byModel},byAccount:{...n.byAccount}}}function N(){let a=n.client;return{total:a.total,byScope:{...a.byScope}}}async function O(){let a=[],b=await G();for(let[c,d]of Object.entries(n.byAccount))for(let[e,f]of Object.entries(d))if(f>0){let d=b[c]||`Account ${c.slice(0,8)}...`,g=e.match(/^(.*) \((.*)\)$/);a.push({model:g?g[1]:e,provider:g?g[2]:"unknown",account:d,count:f})}await H();let c=new Set;return{activeRequests:a,recentRequests:[...r.items].sort((a,b)=>new Date(b.timestamp)-new Date(a.timestamp)).map(a=>{let b=a.tokens||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",d=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!c.has(d)&&(c.add(d),!0)}).slice(0,20),errorProvider:Date.now()-o.ts<1e4?o.provider:""}}async function P(a){try{a.timestamp||(a.timestamp=new Date().toISOString()),a.cost=await I(a.provider,a.model,a.tokens);let b=a.tokens||{},c=b.completion_tokens||b.output_tokens||0;if(a.apiKey&&c>0)try{(0,g.Hs)((0,g.CP)(a.apiKey),c)}catch{}a.apiKey&&(a.apiKey=(0,h.o)(a.apiKey)),u.items.push({entry:a,resolve:()=>{}}),r.items.push(a),r.items.length>50&&(r.items=r.items.slice(-50)),x("update",250),R(),u.items.length>=l&&(Q(),T().catch(a=>console.error("[usageRepo] usage flush failed:",a)))}catch(a){console.error("Failed to save usage stats:",a)}}function Q(){u.timer&&(clearTimeout(u.timer),u.timer=null)}function R(){u.timer||(u.timer=setTimeout(()=>{u.timer=null,T().catch(a=>console.error("[usageRepo] usage flush failed:",a))},k),u.timer.unref?.())}function S(a,b){let c=0,d=[];for(let e of(a.transaction(()=>{let e=new Map;for(let g of b){let b=g.tokens||{},h=b.prompt_tokens||b.input_tokens||0,i=b.completion_tokens||b.output_tokens||0,j=a.get(`SELECT id, endpoint FROM usageHistory
|
|
18
18
|
WHERE timestamp = ?
|
|
19
19
|
AND COALESCE(provider, '') = COALESCE(?, '')
|
|
20
20
|
AND COALESCE(model, '') = COALESCE(?, '')
|
|
@@ -22,4 +22,4 @@ exports.id=4785,exports.ids=[4785],exports.modules={644:(a,b,c)=>{"use strict";f
|
|
|
22
22
|
AND COALESCE(apiKey, '') = COALESCE(?, '')
|
|
23
23
|
AND promptTokens = ?
|
|
24
24
|
AND completionTokens = ?
|
|
25
|
-
ORDER BY id DESC LIMIT 1`,[g.timestamp,g.provider||null,g.model||null,g.connectionId||null,g.apiKey||null,h,i]);if(j){!j.endpoint&&g.endpoint&&a.run("UPDATE usageHistory SET endpoint = ? WHERE id = ?",[g.endpoint,j.id]),d.push(g);continue}a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[g.timestamp,g.provider||null,g.model||null,g.connectionId||null,g.apiKey||null,g.endpoint||null,h,i,g.cost||0,g.status||"ok",(0,f.s)(b),(0,f.s)({})]),c++;let k=w(g.timestamp),l=e.get(k);l?l.push(g):e.set(k,[g])}for(let[b,c]of e){let d=a.get("SELECT data FROM usageDaily WHERE dateKey = ?",[b]),e=d?(0,f.q)(d.data,{}):z();for(let a of c)y(e,a);a.run("INSERT INTO usageDaily(dateKey, data) VALUES(?, ?) ON CONFLICT(dateKey) DO UPDATE SET data = excluded.data",[b,(0,f.s)(e)])}if(c>0){let b=a.get("SELECT value FROM _meta WHERE key = 'totalRequestsLifetime'"),d=(b?parseInt(b.value,10):0)+c;a.run("INSERT INTO _meta(key, value) VALUES('totalRequestsLifetime', ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[String(d)])}}),d)){let a=q.items.indexOf(e);a>=0&&q.items.splice(a,1)}return c}async function Q(){t.flushing&&await t.flushing;let a=(async()=>{let a=[];try{if(!t.items.length)return 0;let b=await (0,e.c)();if(!(a=t.items.splice(0,t.items.length)).length)return 0;let c=P(b,a.map(a=>a.entry));for(let b of a)b.resolve(c);return a.length}catch(b){return console.error("[usageRepo] usage flush failed, retrying on the next tick:",b),t.items=a.concat(t.items),0}})();t.flushing=a;try{return await a}finally{t.flushing===a&&(t.flushing=null),t.items.length&&O()}}if(!global._usageFlushShutdownHook){let a=()=>{t.items.length&&function(){if(N(),!t.items.length)return;let a=t.items.splice(0,t.items.length);try{let b=(0,e.r)(),c=P(b,a.map(a=>a.entry));for(let b of a)b.resolve(c);a.length}catch(b){return console.error("[usageRepo] usage flush on shutdown failed:",b),t.items=a.concat(t.items),0}}()};global._usageFlushShutdownHook=a,process.prependListener("SIGINT",a),process.prependListener("SIGTERM",a),process.on("beforeExit",a),process.on("exit",a)}async function R(a=90,b=400){try{await Q();let c=await (0,e.c)(),d=new Date(Date.now()-864e5*a).toISOString(),f=w(new Date(Date.now()-864e5*b).toISOString()),g=c.run("DELETE FROM usageHistory WHERE timestamp < ?",[d]),h=c.run("DELETE FROM usageDaily WHERE dateKey < ?",[f]);return{history:g?.changes??0,daily:h?.changes??0}}catch(a){return console.error("pruneUsageHistory failed:",a),null}}function S(a,b){if(null==b)return a.all("SELECT dateKey, data FROM usageDaily ORDER BY dateKey ASC");let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()-b+1),e=`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`;return a.all("SELECT dateKey, data FROM usageDaily WHERE dateKey >= ? ORDER BY dateKey ASC",[e])}function T(a,b,c,d){let{connectionMap:e,providerNodeNameMap:f,apiKeyMap:g}=d;for(let[b,d]of(a.totalPromptTokens+=c.promptTokens||0,a.totalCompletionTokens+=c.completionTokens||0,a.totalCachedTokens+=c.cachedTokens||0,a.totalCost+=c.cost||0,Object.entries(c.byProvider||{})))a.byProvider[b]||(a.byProvider[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a.byProvider[b].requests+=d.requests||0,a.byProvider[b].promptTokens+=d.promptTokens||0,a.byProvider[b].completionTokens+=d.completionTokens||0,a.byProvider[b].cachedTokens+=d.cachedTokens||0,a.byProvider[b].cost+=d.cost||0;for(let[d,e]of Object.entries(c.byModel||{})){let c=e.rawModel||d.split("|")[0],g=e.provider||d.split("|")[1]||"",h=g?`${c} (${g})`:c,i=f[g]||g;a.byModel[h]||(a.byModel[h]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:i,lastUsed:b}),a.byModel[h].requests+=e.requests||0,a.byModel[h].promptTokens+=e.promptTokens||0,a.byModel[h].completionTokens+=e.completionTokens||0,a.byModel[h].cachedTokens+=e.cachedTokens||0,a.byModel[h].cost+=e.cost||0,b>(a.byModel[h].lastUsed||"")&&(a.byModel[h].lastUsed=b)}for(let[d,g]of Object.entries(c.byAccount||{})){let c=d,h=g.rawModel||"",i=g.provider||"";if(d.includes("|")){let a=d.split("|");c=a[0],h=a[1]??h,i=a[2]??i}let j=e[c]||`Account ${c.slice(0,8)}...`,k=f[i]||i,l=`${h} (${i} - ${j})`;a.byAccount[l]||(a.byAccount[l]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:h,provider:k,connectionId:c,accountName:j,lastUsed:b}),a.byAccount[l].requests+=g.requests||0,a.byAccount[l].promptTokens+=g.promptTokens||0,a.byAccount[l].completionTokens+=g.completionTokens||0,a.byAccount[l].cachedTokens+=g.cachedTokens||0,a.byAccount[l].cost+=g.cost||0,b>(a.byAccount[l].lastUsed||"")&&(a.byAccount[l].lastUsed=b)}for(let[d,e]of Object.entries(c.byApiKey||{})){let c=e.rawModel||"",i=e.provider||"",j=f[i]||i,k=e.apiKey?e.apiKey.trim():null,l=k?g[k]:null,m=(0,h.o)(k),n=l?.name||(k?m||k.slice(0,8)+"...":"Local (No API Key)"),o=m||"local-no-key";a.byApiKey[d]||(a.byApiKey[d]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:j,apiKeyMasked:m,keyName:n,apiKeyKey:o,lastUsed:b}),a.byApiKey[d].requests+=e.requests||0,a.byApiKey[d].promptTokens+=e.promptTokens||0,a.byApiKey[d].completionTokens+=e.completionTokens||0,a.byApiKey[d].cachedTokens+=e.cachedTokens||0,a.byApiKey[d].cost+=e.cost||0,b>(a.byApiKey[d].lastUsed||"")&&(a.byApiKey[d].lastUsed=b)}for(let[d,e]of Object.entries(c.byEndpoint||{})){let c=e.endpoint||d.split("|")[0]||"Unknown",g=e.rawModel||"",h=e.provider||"",i=f[h]||h;a.byEndpoint[d]||(a.byEndpoint[d]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:c,rawModel:g,provider:i,lastUsed:b}),a.byEndpoint[d].requests+=e.requests||0,a.byEndpoint[d].promptTokens+=e.promptTokens||0,a.byEndpoint[d].completionTokens+=e.completionTokens||0,a.byEndpoint[d].cachedTokens+=e.cachedTokens||0,a.byEndpoint[d].cost+=e.cost||0,b>(a.byEndpoint[d].lastUsed||"")&&(a.byEndpoint[d].lastUsed=b)}}async function U(a="all"){let b=await (0,e.c)(),[{getProviderConnections:d},{getApiKeys:g},{getProviderNodes:j}]=await Promise.all([Promise.resolve().then(c.bind(c,5781)),Promise.resolve().then(c.bind(c,74452)),Promise.resolve().then(c.bind(c,1129))]),k=[];try{k=await d()}catch{}let l={};for(let a of k)l[a.id]=a.name||a.email||a.id;let o={};try{for(let a of(await j()))a.id&&a.name&&(o[a.id]=a.name)}catch{}let p=[];try{p=await g()}catch{}let q={};for(let a of p){let b=(0,h.o)(a.key);b&&(q[b]={name:a.name,id:a.id,createdAt:a.createdAt})}let r=(0,h.o)((0,i.v)());r&&(q[r]={name:"Local (internal)",id:null,createdAt:null});let s=B(),t=C(s),u=D(s),v=[...t,...b.all("SELECT timestamp, provider, model, tokens, status FROM usageHistory ORDER BY id DESC LIMIT 100")],w=new Set,x={totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCachedTokens:0,totalCost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{},last10Minutes:[],pending:m,activeRequests:[],recentRequests:v.map(a=>{let b=(0,f.q)(a.tokens,{})||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,cachedTokens:b.cached_tokens||b.cache_read_input_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",c=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!w.has(c)&&(w.add(c),!0)}).slice(0,20),errorProvider:Date.now()-n.ts<1e4?n.provider:""};for(let[a,b]of Object.entries(m.byAccount))for(let[c,d]of Object.entries(b))if(d>0){let b=l[a]||`Account ${a.slice(0,8)}...`,e=c.match(/^(.*) \((.*)\)$/);x.activeRequests.push({model:e?e[1]:c,provider:e?e[2]:"unknown",account:b,count:d})}let y=new Date,z=new Date(6e4*Math.floor(y.getTime()/6e4)),A=new Date(z.getTime()-54e4),E={};for(let a=0;a<10;a++){let b=z.getTime()-(9-a)*6e4;E[b]={requests:0,promptTokens:0,completionTokens:0,cost:0},x.last10Minutes.push(E[b])}for(let a of[...t.filter(a=>a.timestamp>=A.toISOString()&&a.timestamp<=y.toISOString()),...b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ? AND timestamp <= ?",[A.toISOString(),y.toISOString()])]){let b=6e4*Math.floor(new Date(a.timestamp).getTime()/6e4);E[b]&&(E[b].requests++,E[b].promptTokens+=a.promptTokens||0,E[b].completionTokens+=a.completionTokens||0,E[b].cost+=a.cost||0)}if("24h"!==a&&"today"!==a){let c={"7d":7,"30d":30,"60d":60}[a]||null,d=S(b,c),e={connectionMap:l,providerNodeNameMap:o,apiKeyMap:q};for(let a of d)T(x,a.dateKey,(0,f.q)(a.data,{}),e);for(let[a,b]of u)T(x,a,b,e);let g=Math.max(c?Date.now()-864e5*c:0,Date.now()-1728e5);for(let a of[...t.filter(a=>a.timestamp>=new Date(g).toISOString()),...b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint FROM usageHistory WHERE timestamp >= ?",[new Date(g).toISOString()])]){let b=a.timestamp,c=a.provider?`${a.model} (${a.provider})`:a.model;if(x.byModel[c]&&new Date(b)>new Date(x.byModel[c].lastUsed)&&(x.byModel[c].lastUsed=b),a.connectionId){let c=l[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,d=`${a.model} (${a.provider} - ${c})`;x.byAccount[d]&&new Date(b)>new Date(x.byAccount[d].lastUsed)&&(x.byAccount[d].lastUsed=b)}let d=a.apiKey&&"string"==typeof a.apiKey?`${a.apiKey}|${a.model}|${a.provider||"unknown"}`:"local-no-key";x.byApiKey[d]&&new Date(b)>new Date(x.byApiKey[d].lastUsed)&&(x.byApiKey[d].lastUsed=b);let e=a.endpoint||"Unknown",f=`${e}|${a.model}|${a.provider||"unknown"}`;x.byEndpoint[f]&&new Date(b)>new Date(x.byEndpoint[f].lastUsed)&&(x.byEndpoint[f].lastUsed=b)}}else{let c;if("today"===a){let a=new Date;a.setHours(0,0,0,0),c=a.toISOString()}else c=new Date(Date.now()-864e5).toISOString();for(let a of[...t.filter(a=>a.timestamp>=c),...b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, tokens FROM usageHistory WHERE timestamp >= ?",[c])]){let b=(0,f.q)(a.tokens,{})||{},c=b.prompt_tokens||b.input_tokens||a.promptTokens||0,d=b.completion_tokens||b.output_tokens||a.completionTokens||0,e=b.cached_tokens||b.cache_read_input_tokens||0,g=a.cost||0,i=o[a.provider]||a.provider;x.totalPromptTokens+=c,x.totalCompletionTokens+=d,x.totalCachedTokens+=e,x.totalCost+=g,x.byProvider[a.provider]||(x.byProvider[a.provider]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),x.byProvider[a.provider].requests++,x.byProvider[a.provider].promptTokens+=c,x.byProvider[a.provider].completionTokens+=d,x.byProvider[a.provider].cachedTokens+=e,x.byProvider[a.provider].cost+=g;let j=a.provider?`${a.model} (${a.provider})`:a.model;if(x.byModel[j]||(x.byModel[j]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,lastUsed:a.timestamp}),x.byModel[j].requests++,x.byModel[j].promptTokens+=c,x.byModel[j].completionTokens+=d,x.byModel[j].cachedTokens+=e,x.byModel[j].cost+=g,new Date(a.timestamp)>new Date(x.byModel[j].lastUsed)&&(x.byModel[j].lastUsed=a.timestamp),a.connectionId){let b=l[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,f=`${a.model} (${a.provider} - ${b})`;x.byAccount[f]||(x.byAccount[f]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,connectionId:a.connectionId,accountName:b,lastUsed:a.timestamp}),x.byAccount[f].requests++,x.byAccount[f].promptTokens+=c,x.byAccount[f].completionTokens+=d,x.byAccount[f].cachedTokens+=e,x.byAccount[f].cost+=g,new Date(a.timestamp)>new Date(x.byAccount[f].lastUsed)&&(x.byAccount[f].lastUsed=a.timestamp)}if(a.apiKey&&"string"==typeof a.apiKey){let b=a.apiKey.trim(),f=q[b],j=(0,h.o)(b),k=f?.name||j||a.apiKey.slice(0,8)+"...",l=`${a.apiKey}|${a.model}|${a.provider||"unknown"}`;x.byApiKey[l]||(x.byApiKey[l]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,apiKeyMasked:j,keyName:k,apiKeyKey:j,lastUsed:a.timestamp});let m=x.byApiKey[l];m.requests++,m.promptTokens+=c,m.completionTokens+=d,m.cachedTokens+=e,m.cost+=g,new Date(a.timestamp)>new Date(m.lastUsed)&&(m.lastUsed=a.timestamp)}else{x.byApiKey["local-no-key"]||(x.byApiKey["local-no-key"]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,apiKeyMasked:null,keyName:"Local (No API Key)",apiKeyKey:"local-no-key",lastUsed:a.timestamp});let b=x.byApiKey["local-no-key"];b.requests++,b.promptTokens+=c,b.completionTokens+=d,b.cachedTokens+=e,b.cost+=g,new Date(a.timestamp)>new Date(b.lastUsed)&&(b.lastUsed=a.timestamp)}let k=a.endpoint||"Unknown",m=`${k}|${a.model}|${a.provider||"unknown"}`;x.byEndpoint[m]||(x.byEndpoint[m]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:k,rawModel:a.model,provider:i,lastUsed:a.timestamp});let n=x.byEndpoint[m];n.requests++,n.promptTokens+=c,n.completionTokens+=d,n.cachedTokens+=e,n.cost+=g,new Date(a.timestamp)>new Date(n.lastUsed)&&(n.lastUsed=a.timestamp)}}return x.totalRequests=Object.values(x.byProvider).reduce((a,b)=>a+(b.requests||0),0),x}async function V(a="7d"){let b=await (0,e.c)(),c=Date.now();if("today"===a){let a=new Date;a.setHours(0,0,0,0);let c=a.getTime(),d=c+864e5,e=Array.from({length:24},(a,b)=>({label:new Date(c+36e5*b).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let a of[...C(B()).filter(a=>{let b=new Date(a.timestamp).getTime();return b>=c&&b<d}),...b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(c).toISOString()])]){let b=new Date(a.timestamp).getTime();if(b<c||b>=d)continue;let f=Math.floor((b-c)/36e5);f>=0&&f<24&&(e[f].tokens+=(a.promptTokens||0)+(a.completionTokens||0),e[f].cost+=a.cost||0,e[f].requests+=1)}return e}if("24h"===a){let a=c-864e5,d=Array.from({length:24},(b,c)=>({label:new Date(a+36e5*c).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let e of[...C(B()).filter(b=>{let d=new Date(b.timestamp).getTime();return d>=a&&d<=c}),...b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(a).toISOString()])]){let b=new Date(e.timestamp).getTime();if(b<a||b>c)continue;let f=Math.min(Math.floor((b-a)/36e5),23);d[f].tokens+=(e.promptTokens||0)+(e.completionTokens||0),d[f].cost+=e.cost||0,d[f].requests+=1}return d}let d=a=>a.toLocaleDateString("en-US",{month:"short",day:"numeric"});if("all"===a){let a=S(b,null),c=D(B());if(!a.length&&!c.size)return[];let e={};for(let b of a)e[b.dateKey]=(0,f.q)(b.data,{});A(e,c);let g=new Date((a.length?a[0].dateKey:[...c.keys()].sort()[0])+"T00:00:00"),h=new Date;return h.setHours(0,0,0,0),Array.from({length:Math.max(1,Math.round((h-g)/864e5)+1)},(a,b)=>{let c=new Date(g);c.setDate(c.getDate()+b);let f=e[`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,"0")}-${String(c.getDate()).padStart(2,"0")}`];return{label:d(c),tokens:f?(f.promptTokens||0)+(f.completionTokens||0):0,cost:f&&f.cost||0,requests:f&&f.requests||0}})}let g="7d"===a?7:"30d"===a?30:60,h=new Date,i=S(b,g),j={};for(let a of i)j[a.dateKey]=(0,f.q)(a.data,{});return A(j,D(B())),Array.from({length:g},(a,b)=>{let c=new Date(h);c.setDate(c.getDate()-(g-1-b));let e=j[`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,"0")}-${String(c.getDate()).padStart(2,"0")}`];return{label:d(c),tokens:e?(e.promptTokens||0)+(e.completionTokens||0):0,cost:e&&e.cost||0,requests:e&&e.requests||0}})}async function W(){}async function X(a=200){try{let b=(await (0,e.c)()).all("SELECT timestamp, provider, model, connectionId, promptTokens, completionTokens, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[a]);if(!b.length&&!t.items.length)return[];let d={};try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781));for(let b of(await a()))d[b.id]=b.name||b.email||""}catch{}return[...C(B()),...b].map(a=>{let b=function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${b(a.getDate())}-${b(a.getMonth()+1)}-${a.getFullYear()} ${b(a.getHours())}:${b(a.getMinutes())}:${b(a.getSeconds())}`}(new Date(a.timestamp)),c=a.provider?.toUpperCase()||"-",e=a.model||"-",g=d[a.connectionId]||(a.connectionId?a.connectionId.slice(0,8):"-"),h=a.tokens?(0,f.q)(a.tokens,{}):{},i=a.promptTokens??h.prompt_tokens??"-",j=a.completionTokens??h.completion_tokens??"-";return`${b} | ${e} | ${c} | ${g} | ${i} | ${j} | ${a.status||"-"}`})}catch(a){return console.error("[usageRepo] getRecentLogs failed:",a.message),[]}}}};
|
|
25
|
+
ORDER BY id DESC LIMIT 1`,[g.timestamp,g.provider||null,g.model||null,g.connectionId||null,g.apiKey||null,h,i]);if(j){!j.endpoint&&g.endpoint&&a.run("UPDATE usageHistory SET endpoint = ? WHERE id = ?",[g.endpoint,j.id]),d.push(g);continue}a.run("INSERT INTO usageHistory(timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, status, tokens, meta) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[g.timestamp,g.provider||null,g.model||null,g.connectionId||null,g.apiKey||null,g.endpoint||null,h,i,g.cost||0,g.status||"ok",(0,f.s)(b),(0,f.s)({})]),c++;let k=y(g.timestamp),l=e.get(k);l?l.push(g):e.set(k,[g])}for(let[a,b]of e){let c=v.days.get(a);for(let d of(c||(c=B(),v.days.set(a,c)),b))A(c,d)}if(c>0){let b=a.get("SELECT value FROM _meta WHERE key = 'totalRequestsLifetime'"),d=(b?parseInt(b.value,10):0)+c;a.run("INSERT INTO _meta(key, value) VALUES('totalRequestsLifetime', ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[String(d)])}}),d)){let a=r.items.indexOf(e);a>=0&&r.items.splice(a,1)}return c}async function T(){u.flushing&&await u.flushing;let a=(async()=>{let a=[];try{if(!u.items.length)return 0;let b=await (0,e.c)();if(!(a=u.items.splice(0,u.items.length)).length)return 0;let c=S(b,a.map(a=>a.entry));for(let b of(v.days.size&&X(),a))b.resolve(c);return a.length}catch(b){return console.error("[usageRepo] usage flush failed, retrying on the next tick:",b),u.items=a.concat(u.items),0}})();u.flushing=a;try{return await a}finally{u.flushing===a&&(u.flushing=null),u.items.length&&R()}}async function U(){v.flushing&&await v.flushing;let a=(async()=>{if(!v.days.size)return 0;let a=await (0,e.c)(),b=v.days;v.days=new Map;try{return a.transaction(()=>{for(let[c,d]of b){let b=a.get("SELECT data FROM usageDaily WHERE dateKey = ?",[c]),e=b?(0,f.q)(b.data,{}):B();V(e,d),a.run("INSERT INTO usageDaily(dateKey, data) VALUES(?, ?) ON CONFLICT(dateKey) DO UPDATE SET data = excluded.data",[c,(0,f.s)(e)])}}),b.size}catch(a){for(let[c,d]of(console.error("[usageRepo] usage roll-up flush failed, retrying on the next tick:",a),b)){let a=v.days.get(c);a?V(a,d):v.days.set(c,d)}return 0}})();v.flushing=a;try{return await a}finally{v.flushing===a&&(v.flushing=null),v.days.size&&X()}}function V(a,b){for(let c of(a.requests=(a.requests||0)+(b.requests||0),a.promptTokens=(a.promptTokens||0)+(b.promptTokens||0),a.completionTokens=(a.completionTokens||0)+(b.completionTokens||0),a.cachedTokens=(a.cachedTokens||0)+(b.cachedTokens||0),a.cost=(a.cost||0)+(b.cost||0),["byProvider","byModel","byAccount","byApiKey","byEndpoint"])){let d=b[c];if(d)for(let[b,e]of(a[c]||(a[c]={}),Object.entries(d))){let d=a[c][b];if(!d){a[c][b]={...e};continue}d.requests=(d.requests||0)+(e.requests||0),d.promptTokens=(d.promptTokens||0)+(e.promptTokens||0),d.completionTokens=(d.completionTokens||0)+(e.completionTokens||0),d.cachedTokens=(d.cachedTokens||0)+(e.cachedTokens||0),d.cost=(d.cost||0)+(e.cost||0)}}}function W(){v.timer&&(clearTimeout(v.timer),v.timer=null)}function X(){v.timer||(v.timer=setTimeout(()=>{v.timer=null,U().catch(a=>console.error("[usageRepo] usage roll-up flush failed:",a))},m),v.timer.unref?.())}if(!global._usageFlushShutdownHook){let a=()=>{(u.items.length||v.days.size)&&(Q(),function(){if(!u.items.length)return;let a=u.items.splice(0,u.items.length);try{let b=(0,e.r)(),c=S(b,a.map(a=>a.entry));for(let b of(v.days.size&&X(),a))b.resolve(c);a.length}catch(b){return console.error("[usageRepo] usage flush on shutdown failed:",b),u.items=a.concat(u.items),0}}(),function(){if(W(),!v.days.size)return;let a=v.days;v.days=new Map;try{let b=(0,e.r)();b.transaction(()=>{for(let[c,d]of a){let a=b.get("SELECT data FROM usageDaily WHERE dateKey = ?",[c]),e=a?(0,f.q)(a.data,{}):B();V(e,d),b.run("INSERT INTO usageDaily(dateKey, data) VALUES(?, ?) ON CONFLICT(dateKey) DO UPDATE SET data = excluded.data",[c,(0,f.s)(e)])}}),a.size}catch(b){for(let[c,d]of(console.error("[usageRepo] usage roll-up flush on shutdown failed:",b),a)){let a=v.days.get(c);a?V(a,d):v.days.set(c,d)}return 0}}())};global._usageFlushShutdownHook=a,process.prependListener("SIGINT",a),process.prependListener("SIGTERM",a),process.on("beforeExit",a),process.on("exit",a)}async function Y(a=90,b=400){try{await T(),await U();let c=await (0,e.c)(),d=new Date(Date.now()-864e5*a).toISOString(),f=y(new Date(Date.now()-864e5*b).toISOString()),g=c.run("DELETE FROM usageHistory WHERE timestamp < ?",[d]),h=c.run("DELETE FROM usageDaily WHERE dateKey < ?",[f]);return{history:g?.changes??0,daily:h?.changes??0}}catch(a){return console.error("pruneUsageHistory failed:",a),null}}function Z(a,b){if(null==b)return a.all("SELECT dateKey, data FROM usageDaily ORDER BY dateKey ASC");let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()-b+1),e=`${d.getFullYear()}-${String(d.getMonth()+1).padStart(2,"0")}-${String(d.getDate()).padStart(2,"0")}`;return a.all("SELECT dateKey, data FROM usageDaily WHERE dateKey >= ? ORDER BY dateKey ASC",[e])}function $(a,b,c,d){let{connectionMap:e,providerNodeNameMap:f,apiKeyMap:g}=d;for(let[b,d]of(a.totalPromptTokens+=c.promptTokens||0,a.totalCompletionTokens+=c.completionTokens||0,a.totalCachedTokens+=c.cachedTokens||0,a.totalCost+=c.cost||0,Object.entries(c.byProvider||{})))a.byProvider[b]||(a.byProvider[b]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),a.byProvider[b].requests+=d.requests||0,a.byProvider[b].promptTokens+=d.promptTokens||0,a.byProvider[b].completionTokens+=d.completionTokens||0,a.byProvider[b].cachedTokens+=d.cachedTokens||0,a.byProvider[b].cost+=d.cost||0;for(let[d,e]of Object.entries(c.byModel||{})){let c=e.rawModel||d.split("|")[0],g=e.provider||d.split("|")[1]||"",h=g?`${c} (${g})`:c,i=f[g]||g;a.byModel[h]||(a.byModel[h]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:i,lastUsed:b}),a.byModel[h].requests+=e.requests||0,a.byModel[h].promptTokens+=e.promptTokens||0,a.byModel[h].completionTokens+=e.completionTokens||0,a.byModel[h].cachedTokens+=e.cachedTokens||0,a.byModel[h].cost+=e.cost||0,b>(a.byModel[h].lastUsed||"")&&(a.byModel[h].lastUsed=b)}for(let[d,g]of Object.entries(c.byAccount||{})){let c=d,h=g.rawModel||"",i=g.provider||"";if(d.includes("|")){let a=d.split("|");c=a[0],h=a[1]??h,i=a[2]??i}let j=e[c]||`Account ${c.slice(0,8)}...`,k=f[i]||i,l=`${h} (${i} - ${j})`;a.byAccount[l]||(a.byAccount[l]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:h,provider:k,connectionId:c,accountName:j,lastUsed:b}),a.byAccount[l].requests+=g.requests||0,a.byAccount[l].promptTokens+=g.promptTokens||0,a.byAccount[l].completionTokens+=g.completionTokens||0,a.byAccount[l].cachedTokens+=g.cachedTokens||0,a.byAccount[l].cost+=g.cost||0,b>(a.byAccount[l].lastUsed||"")&&(a.byAccount[l].lastUsed=b)}for(let[d,e]of Object.entries(c.byApiKey||{})){let c=e.rawModel||"",i=e.provider||"",j=f[i]||i,k=e.apiKey?e.apiKey.trim():null,l=k?g[k]:null,m=(0,h.o)(k),n=l?.name||(k?m||k.slice(0,8)+"...":"Local (No API Key)"),o=m||"local-no-key";a.byApiKey[d]||(a.byApiKey[d]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:c,provider:j,apiKeyMasked:m,keyName:n,apiKeyKey:o,lastUsed:b}),a.byApiKey[d].requests+=e.requests||0,a.byApiKey[d].promptTokens+=e.promptTokens||0,a.byApiKey[d].completionTokens+=e.completionTokens||0,a.byApiKey[d].cachedTokens+=e.cachedTokens||0,a.byApiKey[d].cost+=e.cost||0,b>(a.byApiKey[d].lastUsed||"")&&(a.byApiKey[d].lastUsed=b)}for(let[d,e]of Object.entries(c.byEndpoint||{})){let c=e.endpoint||d.split("|")[0]||"Unknown",g=e.rawModel||"",h=e.provider||"",i=f[h]||h;a.byEndpoint[d]||(a.byEndpoint[d]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:c,rawModel:g,provider:i,lastUsed:b}),a.byEndpoint[d].requests+=e.requests||0,a.byEndpoint[d].promptTokens+=e.promptTokens||0,a.byEndpoint[d].completionTokens+=e.completionTokens||0,a.byEndpoint[d].cachedTokens+=e.cachedTokens||0,a.byEndpoint[d].cost+=e.cost||0,b>(a.byEndpoint[d].lastUsed||"")&&(a.byEndpoint[d].lastUsed=b)}}async function _(a="all"){let b=await (0,e.c)(),[{getProviderConnections:d},{getApiKeys:g},{getProviderNodes:j}]=await Promise.all([Promise.resolve().then(c.bind(c,5781)),Promise.resolve().then(c.bind(c,74452)),Promise.resolve().then(c.bind(c,1129))]),k=[];try{k=await d()}catch{}let l={};for(let a of k)l[a.id]=a.name||a.email||a.id;let m={};try{for(let a of(await j()))a.id&&a.name&&(m[a.id]=a.name)}catch{}let p=[];try{p=await g()}catch{}let q={};for(let a of p){let b=(0,h.o)(a.key);b&&(q[b]={name:a.name,id:a.id,createdAt:a.createdAt})}let r=(0,h.o)((0,i.v)());r&&(q[r]={name:"Local (internal)",id:null,createdAt:null});let s=D(),t=E(s),u=F(s),v=[...t,...b.all("SELECT timestamp, provider, model, tokens, status FROM usageHistory ORDER BY id DESC LIMIT 100")],w=new Set,x={totalRequests:0,totalPromptTokens:0,totalCompletionTokens:0,totalCachedTokens:0,totalCost:0,byProvider:{},byModel:{},byAccount:{},byApiKey:{},byEndpoint:{},last10Minutes:[],pending:n,activeRequests:[],recentRequests:v.map(a=>{let b=(0,f.q)(a.tokens,{})||{};return{timestamp:a.timestamp,model:a.model,provider:a.provider||"",promptTokens:b.prompt_tokens||b.input_tokens||0,completionTokens:b.completion_tokens||b.output_tokens||0,cachedTokens:b.cached_tokens||b.cache_read_input_tokens||0,status:a.status||"ok"}}).filter(a=>{if(0===a.promptTokens&&0===a.completionTokens)return!1;let b=a.timestamp?a.timestamp.slice(0,16):"",c=`${a.model}|${a.provider}|${a.promptTokens}|${a.completionTokens}|${b}`;return!w.has(c)&&(w.add(c),!0)}).slice(0,20),errorProvider:Date.now()-o.ts<1e4?o.provider:""};for(let[a,b]of Object.entries(n.byAccount))for(let[c,d]of Object.entries(b))if(d>0){let b=l[a]||`Account ${a.slice(0,8)}...`,e=c.match(/^(.*) \((.*)\)$/);x.activeRequests.push({model:e?e[1]:c,provider:e?e[2]:"unknown",account:b,count:d})}let y=new Date,z=new Date(6e4*Math.floor(y.getTime()/6e4)),A=new Date(z.getTime()-54e4),B={};for(let a=0;a<10;a++){let b=z.getTime()-(9-a)*6e4;B[b]={requests:0,promptTokens:0,completionTokens:0,cost:0},x.last10Minutes.push(B[b])}for(let a of[...t.filter(a=>a.timestamp>=A.toISOString()&&a.timestamp<=y.toISOString()),...b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ? AND timestamp <= ?",[A.toISOString(),y.toISOString()])]){let b=6e4*Math.floor(new Date(a.timestamp).getTime()/6e4);B[b]&&(B[b].requests++,B[b].promptTokens+=a.promptTokens||0,B[b].completionTokens+=a.completionTokens||0,B[b].cost+=a.cost||0)}if("24h"!==a&&"today"!==a){let c={"7d":7,"30d":30,"60d":60}[a]||null,d=Z(b,c),e={connectionMap:l,providerNodeNameMap:m,apiKeyMap:q};for(let a of d)$(x,a.dateKey,(0,f.q)(a.data,{}),e);for(let[a,b]of u)$(x,a,b,e);let g=Math.max(c?Date.now()-864e5*c:0,Date.now()-1728e5);for(let a of[...t.filter(a=>a.timestamp>=new Date(g).toISOString()),...b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint FROM usageHistory WHERE timestamp >= ?",[new Date(g).toISOString()])]){let b=a.timestamp,c=a.provider?`${a.model} (${a.provider})`:a.model;if(x.byModel[c]&&new Date(b)>new Date(x.byModel[c].lastUsed)&&(x.byModel[c].lastUsed=b),a.connectionId){let c=l[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,d=`${a.model} (${a.provider} - ${c})`;x.byAccount[d]&&new Date(b)>new Date(x.byAccount[d].lastUsed)&&(x.byAccount[d].lastUsed=b)}let d=a.apiKey&&"string"==typeof a.apiKey?`${a.apiKey}|${a.model}|${a.provider||"unknown"}`:"local-no-key";x.byApiKey[d]&&new Date(b)>new Date(x.byApiKey[d].lastUsed)&&(x.byApiKey[d].lastUsed=b);let e=a.endpoint||"Unknown",f=`${e}|${a.model}|${a.provider||"unknown"}`;x.byEndpoint[f]&&new Date(b)>new Date(x.byEndpoint[f].lastUsed)&&(x.byEndpoint[f].lastUsed=b)}}else{let c;if("today"===a){let a=new Date;a.setHours(0,0,0,0),c=a.toISOString()}else c=new Date(Date.now()-864e5).toISOString();for(let a of[...t.filter(a=>a.timestamp>=c),...b.all("SELECT timestamp, provider, model, connectionId, apiKey, endpoint, promptTokens, completionTokens, cost, tokens FROM usageHistory WHERE timestamp >= ?",[c])]){let b=(0,f.q)(a.tokens,{})||{},c=b.prompt_tokens||b.input_tokens||a.promptTokens||0,d=b.completion_tokens||b.output_tokens||a.completionTokens||0,e=b.cached_tokens||b.cache_read_input_tokens||0,g=a.cost||0,i=m[a.provider]||a.provider;x.totalPromptTokens+=c,x.totalCompletionTokens+=d,x.totalCachedTokens+=e,x.totalCost+=g,x.byProvider[a.provider]||(x.byProvider[a.provider]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0}),x.byProvider[a.provider].requests++,x.byProvider[a.provider].promptTokens+=c,x.byProvider[a.provider].completionTokens+=d,x.byProvider[a.provider].cachedTokens+=e,x.byProvider[a.provider].cost+=g;let j=a.provider?`${a.model} (${a.provider})`:a.model;if(x.byModel[j]||(x.byModel[j]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,lastUsed:a.timestamp}),x.byModel[j].requests++,x.byModel[j].promptTokens+=c,x.byModel[j].completionTokens+=d,x.byModel[j].cachedTokens+=e,x.byModel[j].cost+=g,new Date(a.timestamp)>new Date(x.byModel[j].lastUsed)&&(x.byModel[j].lastUsed=a.timestamp),a.connectionId){let b=l[a.connectionId]||`Account ${a.connectionId.slice(0,8)}...`,f=`${a.model} (${a.provider} - ${b})`;x.byAccount[f]||(x.byAccount[f]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,connectionId:a.connectionId,accountName:b,lastUsed:a.timestamp}),x.byAccount[f].requests++,x.byAccount[f].promptTokens+=c,x.byAccount[f].completionTokens+=d,x.byAccount[f].cachedTokens+=e,x.byAccount[f].cost+=g,new Date(a.timestamp)>new Date(x.byAccount[f].lastUsed)&&(x.byAccount[f].lastUsed=a.timestamp)}if(a.apiKey&&"string"==typeof a.apiKey){let b=a.apiKey.trim(),f=q[b],j=(0,h.o)(b),k=f?.name||j||a.apiKey.slice(0,8)+"...",l=`${a.apiKey}|${a.model}|${a.provider||"unknown"}`;x.byApiKey[l]||(x.byApiKey[l]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,apiKeyMasked:j,keyName:k,apiKeyKey:j,lastUsed:a.timestamp});let m=x.byApiKey[l];m.requests++,m.promptTokens+=c,m.completionTokens+=d,m.cachedTokens+=e,m.cost+=g,new Date(a.timestamp)>new Date(m.lastUsed)&&(m.lastUsed=a.timestamp)}else{x.byApiKey["local-no-key"]||(x.byApiKey["local-no-key"]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,rawModel:a.model,provider:i,apiKeyMasked:null,keyName:"Local (No API Key)",apiKeyKey:"local-no-key",lastUsed:a.timestamp});let b=x.byApiKey["local-no-key"];b.requests++,b.promptTokens+=c,b.completionTokens+=d,b.cachedTokens+=e,b.cost+=g,new Date(a.timestamp)>new Date(b.lastUsed)&&(b.lastUsed=a.timestamp)}let k=a.endpoint||"Unknown",n=`${k}|${a.model}|${a.provider||"unknown"}`;x.byEndpoint[n]||(x.byEndpoint[n]={requests:0,promptTokens:0,completionTokens:0,cachedTokens:0,cost:0,endpoint:k,rawModel:a.model,provider:i,lastUsed:a.timestamp});let o=x.byEndpoint[n];o.requests++,o.promptTokens+=c,o.completionTokens+=d,o.cachedTokens+=e,o.cost+=g,new Date(a.timestamp)>new Date(o.lastUsed)&&(o.lastUsed=a.timestamp)}}return x.totalRequests=Object.values(x.byProvider).reduce((a,b)=>a+(b.requests||0),0),x}async function aa(a="7d"){let b=await (0,e.c)(),c=Date.now();if("today"===a){let a=new Date;a.setHours(0,0,0,0);let c=a.getTime(),d=c+864e5,e=Array.from({length:24},(a,b)=>({label:new Date(c+36e5*b).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let a of[...E(D()).filter(a=>{let b=new Date(a.timestamp).getTime();return b>=c&&b<d}),...b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(c).toISOString()])]){let b=new Date(a.timestamp).getTime();if(b<c||b>=d)continue;let f=Math.floor((b-c)/36e5);f>=0&&f<24&&(e[f].tokens+=(a.promptTokens||0)+(a.completionTokens||0),e[f].cost+=a.cost||0,e[f].requests+=1)}return e}if("24h"===a){let a=c-864e5,d=Array.from({length:24},(b,c)=>({label:new Date(a+36e5*c).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),tokens:0,cost:0,requests:0}));for(let e of[...E(D()).filter(b=>{let d=new Date(b.timestamp).getTime();return d>=a&&d<=c}),...b.all("SELECT timestamp, promptTokens, completionTokens, cost FROM usageHistory WHERE timestamp >= ?",[new Date(a).toISOString()])]){let b=new Date(e.timestamp).getTime();if(b<a||b>c)continue;let f=Math.min(Math.floor((b-a)/36e5),23);d[f].tokens+=(e.promptTokens||0)+(e.completionTokens||0),d[f].cost+=e.cost||0,d[f].requests+=1}return d}let d=a=>a.toLocaleDateString("en-US",{month:"short",day:"numeric"});if("all"===a){let a=Z(b,null),c=F(D());if(!a.length&&!c.size)return[];let e={};for(let b of a)e[b.dateKey]=(0,f.q)(b.data,{});C(e,c);let g=new Date((a.length?a[0].dateKey:[...c.keys()].sort()[0])+"T00:00:00"),h=new Date;return h.setHours(0,0,0,0),Array.from({length:Math.max(1,Math.round((h-g)/864e5)+1)},(a,b)=>{let c=new Date(g);c.setDate(c.getDate()+b);let f=e[`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,"0")}-${String(c.getDate()).padStart(2,"0")}`];return{label:d(c),tokens:f?(f.promptTokens||0)+(f.completionTokens||0):0,cost:f&&f.cost||0,requests:f&&f.requests||0}})}let g="7d"===a?7:"30d"===a?30:60,h=new Date,i=Z(b,g),j={};for(let a of i)j[a.dateKey]=(0,f.q)(a.data,{});return C(j,F(D())),Array.from({length:g},(a,b)=>{let c=new Date(h);c.setDate(c.getDate()-(g-1-b));let e=j[`${c.getFullYear()}-${String(c.getMonth()+1).padStart(2,"0")}-${String(c.getDate()).padStart(2,"0")}`];return{label:d(c),tokens:e?(e.promptTokens||0)+(e.completionTokens||0):0,cost:e&&e.cost||0,requests:e&&e.requests||0}})}async function ab(){}async function ac(a=200){try{let b=(await (0,e.c)()).all("SELECT timestamp, provider, model, connectionId, promptTokens, completionTokens, status, tokens FROM usageHistory ORDER BY id DESC LIMIT ?",[a]);if(!b.length&&!u.items.length)return[];let d={};try{let{getProviderConnections:a}=await Promise.resolve().then(c.bind(c,5781));for(let b of(await a()))d[b.id]=b.name||b.email||""}catch{}return[...E(D()),...b].map(a=>{let b=function(a=new Date){let b=a=>String(a).padStart(2,"0");return`${b(a.getDate())}-${b(a.getMonth()+1)}-${a.getFullYear()} ${b(a.getHours())}:${b(a.getMinutes())}:${b(a.getSeconds())}`}(new Date(a.timestamp)),c=a.provider?.toUpperCase()||"-",e=a.model||"-",g=d[a.connectionId]||(a.connectionId?a.connectionId.slice(0,8):"-"),h=a.tokens?(0,f.q)(a.tokens,{}):{},i=a.promptTokens??h.prompt_tokens??"-",j=a.completionTokens??h.completion_tokens??"-";return`${b} | ${e} | ${c} | ${g} | ${i} | ${j} | ${a.status||"-"}`})}catch(a){return console.error("[usageRepo] getRecentLogs failed:",a.message),[]}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.id=5232,exports.ids=[5232],exports.modules={962:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/McpMarketplaceModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/McpMarketplaceModal.js","default")},3080:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/OAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/OAuthModal.js","default")},4996:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/CapacityBadges.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/CapacityBadges.js","default")},5843:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/NoAuthProxyCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/NoAuthProxyCard.js","default")},7290:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Card.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Card.js","default")},7549:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/WebSessionConnectModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/WebSessionConnectModal.js","default")},10079:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Modal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Modal.js","ConfirmModal")},14285:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/KiroOAuthWrapper.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/KiroOAuthWrapper.js","default")},18060:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/XiaomiMimoAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/XiaomiMimoAuthModal.js","default")},18200:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/AddCustomEmbeddingModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/AddCustomEmbeddingModal.js","default")},18421:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Tooltip.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Tooltip.js","default")},19083:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/RequestLogger.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/RequestLogger.js","default")},20493:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ComboFormModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ComboFormModal.js","default")},26016:(a,b,c)=>{"use strict";c.d(b,{default:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call extractDelta() from the server but extractDelta is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ProviderMiniChat.js","extractDelta");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ProviderMiniChat.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ProviderMiniChat.js","default")},26866:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Sidebar.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Sidebar.js","default")},29354:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/HeaderMenu.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/HeaderMenu.js","default")},29502:(a,b,c)=>{Promise.resolve().then(c.bind(c,75828))},30508:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735);c(45512),c(71230),c(83784),c(7290),c(10079),c(92082),c(33893),c(70092),c(40515),c(89886),c(26866),c(92669),c(3080),c(94582),c(70603),c(20493),c(962),c(45205),c(29354),c(33811),c(19083),c(82448),c(14285),c(87228),c(40167),c(56966),c(18060),c(80342),c(7549),c(26016),c(64148),c(32846),c(70139),c(18200),c(5843),c(54065),c(18421),c(81923),c(4996);var e=c(61780);function f({children:a}){return(0,d.jsx)(e.default,{children:a})}c(64420)},32645:(a,b,c)=>{Promise.resolve().then(c.bind(c,18200)),Promise.resolve().then(c.bind(c,33893)),Promise.resolve().then(c.bind(c,45512)),Promise.resolve().then(c.bind(c,4996)),Promise.resolve().then(c.bind(c,7290)),Promise.resolve().then(c.bind(c,33811)),Promise.resolve().then(c.bind(c,20493)),Promise.resolve().then(c.bind(c,40167)),Promise.resolve().then(c.bind(c,70139)),Promise.resolve().then(c.bind(c,64148)),Promise.resolve().then(c.bind(c,92669)),Promise.resolve().then(c.bind(c,29354)),Promise.resolve().then(c.bind(c,80342)),Promise.resolve().then(c.bind(c,71230)),Promise.resolve().then(c.bind(c,82448)),Promise.resolve().then(c.bind(c,14285)),Promise.resolve().then(c.bind(c,87228)),Promise.resolve().then(c.bind(c,45205)),Promise.resolve().then(c.bind(c,64420)),Promise.resolve().then(c.bind(c,61780)),Promise.resolve().then(c.bind(c,92082)),Promise.resolve().then(c.bind(c,70603)),Promise.resolve().then(c.bind(c,962)),Promise.resolve().then(c.bind(c,10079)),Promise.resolve().then(c.bind(c,94582)),Promise.resolve().then(c.bind(c,5843)),Promise.resolve().then(c.bind(c,3080)),Promise.resolve().then(c.bind(c,81923)),Promise.resolve().then(c.bind(c,26016)),Promise.resolve().then(c.bind(c,19083)),Promise.resolve().then(c.bind(c,54065)),Promise.resolve().then(c.bind(c,83784)),Promise.resolve().then(c.bind(c,26866)),Promise.resolve().then(c.bind(c,89886)),Promise.resolve().then(c.bind(c,40515)),Promise.resolve().then(c.bind(c,70092)),Promise.resolve().then(c.bind(c,32846)),Promise.resolve().then(c.bind(c,18421)),Promise.resolve().then(c.bind(c,7549)),Promise.resolve().then(c.bind(c,18060)),Promise.resolve().then(c.bind(c,56966))},32846:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/TokenHarborAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/TokenHarborAuthModal.js","default")},33811:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ChangelogModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ChangelogModal.js","default")},33893:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Badge.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Badge.js","default")},40167:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/CursorAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/CursorAuthModal.js","default")},40515:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ThemeToggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ThemeToggle.js","default")},45205:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/LanguageSwitcher.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/LanguageSwitcher.js","default")},45512:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Button.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Button.js","default")},45797:(a,b,c)=>{Promise.resolve().then(c.bind(c,67738)),Promise.resolve().then(c.bind(c,75171)),Promise.resolve().then(c.bind(c,99070)),Promise.resolve().then(c.bind(c,38930)),Promise.resolve().then(c.bind(c,17660)),Promise.resolve().then(c.bind(c,11229)),Promise.resolve().then(c.bind(c,62727)),Promise.resolve().then(c.bind(c,51109)),Promise.resolve().then(c.bind(c,51585)),Promise.resolve().then(c.bind(c,43182)),Promise.resolve().then(c.bind(c,47036)),Promise.resolve().then(c.bind(c,3236)),Promise.resolve().then(c.bind(c,79488)),Promise.resolve().then(c.bind(c,83552)),Promise.resolve().then(c.bind(c,8590)),Promise.resolve().then(c.bind(c,5291)),Promise.resolve().then(c.bind(c,56110)),Promise.resolve().then(c.bind(c,267)),Promise.resolve().then(c.bind(c,53838)),Promise.resolve().then(c.bind(c,85306)),Promise.resolve().then(c.bind(c,74812)),Promise.resolve().then(c.bind(c,39645)),Promise.resolve().then(c.bind(c,20084)),Promise.resolve().then(c.bind(c,95145)),Promise.resolve().then(c.bind(c,4249)),Promise.resolve().then(c.bind(c,50585)),Promise.resolve().then(c.bind(c,79346)),Promise.resolve().then(c.bind(c,11633)),Promise.resolve().then(c.bind(c,51049)),Promise.resolve().then(c.bind(c,91809)),Promise.resolve().then(c.bind(c,91099)),Promise.resolve().then(c.bind(c,4770)),Promise.resolve().then(c.bind(c,42196)),Promise.resolve().then(c.bind(c,19308)),Promise.resolve().then(c.bind(c,53845)),Promise.resolve().then(c.bind(c,95514)),Promise.resolve().then(c.bind(c,18480)),Promise.resolve().then(c.bind(c,32971)),Promise.resolve().then(c.bind(c,34703)),Promise.resolve().then(c.bind(c,24622)),Promise.resolve().then(c.bind(c,24656))},54065:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/SegmentedControl.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/SegmentedControl.js","default")},56965:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/error.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/app/(dashboard)/dashboard/error.js","default")},56966:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ZedAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ZedAuthModal.js","default")},61780:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/layouts/DashboardLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/layouts/DashboardLayout.js","default")},64148:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/GitLabAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/GitLabAuthModal.js","default")},64420:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/layouts/AuthLayout.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/layouts/AuthLayout.js","default")},70092:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Toggle.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Toggle.js","default")},70139:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/EditConnectionModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/EditConnectionModal.js","default")},70603:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ManualConfigModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ManualConfigModal.js","default")},71230:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Input.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Input.js","default")},75828:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(48249),e=c(50412);function f({error:a,reset:b}){return(0,d.jsx)("div",{className:"flex min-h-[60vh] items-center justify-center px-4 py-10",children:(0,d.jsxs)("div",{className:"flex w-full max-w-md flex-col items-center gap-3 rounded-xl border border-border bg-surface p-6 text-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold mb-1",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-text-muted break-words",children:a?.message||"An unexpected error occurred."})]}),(0,d.jsx)(e.$n,{onClick:b,children:"Try again"})]})})}},80342:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/IFlowCookieModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/IFlowCookieModal.js","default")},81923:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ProviderInfoCard.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ProviderInfoCard.js","default")},82448:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/KiroAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/KiroAuthModal.js","default")},82646:(a,b,c)=>{Promise.resolve().then(c.bind(c,56965))},83784:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Select.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Select.js","default")},87228:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/KiroSocialOAuthModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/KiroSocialOAuthModal.js","default")},92082:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>f,Skeleton:()=>e});var d=c(77943);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Loading.js","Skeleton"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Loading.js","CardSkeleton")},92669:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Header.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/Header.js","default")},94582:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ModelSelectModal.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/gin/work/Hilbras/OmniHilbras/src/shared/components/ModelSelectModal.js","default")}};
|
|
@@ -150,7 +150,7 @@ data: [DONE]
|
|
|
150
150
|
|
|
151
151
|
`)}class N extends d.H{constructor(){super("kiro",e.xq.kiro)}buildHeaders(a,b=!0,c=""){let d={...this.config.headers,"Amz-Sdk-Request":"attempt=1; max=3","Amz-Sdk-Invocation-Id":(0,g.A)()};c.includes("://codewhisperer.")?d["X-Amz-Target"]=f.rx:delete d["X-Amz-Target"];let e=a?.providerSpecificData?.authMethod,h="api_key"===e,i=a?.apiKey||(h?a?.accessToken:null);h&&i?(d.Authorization=`Bearer ${i}`,d.TokenType="API_KEY"):a?.accessToken&&(d.Authorization=`Bearer ${a.accessToken}`,"external_idp"===e&&(d.TokenType="EXTERNAL_IDP")),a?.accessToken&&(d["x-amz-sso-bearer"]=a.accessToken),d["x-amzn-kiro-agent-mode"]="spec",d["x-amzn-codewhisperer-machine-id"]="kiro-desktop";let j=a?.providerSpecificData?.profileArn;return j&&(d["x-amzn-codewhisperer-profile-arn"]=j),d}getOrderedBaseUrls(a){let b=this.getBaseUrls();a?.providerSpecificData?.authMethod;let c=(a?.providerSpecificData?.region||"us-east-1").trim(),d=b.filter(a=>a.includes("amazonaws.com")).map(a=>c&&"us-east-1"!==c&&a.includes("amazonaws.com")?a.replace(/([a-z]+)\.[a-z0-9-]+\.amazonaws\.com/,`$1.${c}.amazonaws.com`):a),e=b.filter(a=>!a.includes("amazonaws.com")),f=d.filter(a=>a.includes("://q.")),g=d.filter(a=>!a.includes("://q."));return f.length>0?[...f,...g,...e]:[...d,...e]}buildUrl(a,b,c=0,d=null){let e=this.getOrderedBaseUrls(d);return e[c]||e[0]||this.config.baseUrl}shouldRetry(a,b){let c=b+1<this.getFallbackCount();return super.shouldRetry(a,b)||c&&f.QR.has(a)}transformRequest(a,b,c,d){return b}async execute(a){let b=await super.execute(a);return b?.response?.ok&&this.attachIntegrityGate(b,a),b}attachIntegrityGate(a,b){let c,d=new AbortController,e=C("KIRO_TOOL_CALL_REPAIR_BUFFER_MAX_BYTES",8388608),f=C("KIRO_TOOL_CALL_REPAIR_TIMEOUT_MS",k.Z1),g=C("KIRO_TOOL_CALL_REPAIR_TTFT_TIMEOUT_MS",f),h=C("KIRO_TOOL_CALL_REPAIR_STALL_TIMEOUT_MS",f),j=b.credentials?.providerSpecificData?.kiroToolCallRepair!==!1&&"false"!==process.env.KIRO_TOOL_CALL_REPAIR,l=()=>d.abort(b.signal?.reason);b.signal?.addEventListener("abort",l,{once:!0});let m=!0,n=new ReadableStream({start:async f=>{let i=()=>{if(m)try{f.enqueue(q.encode(": kiro-validation\n\n"))}catch{m=!1}};i(),c=setInterval(i,1e4);try{let c=await this.runIntegrityRecovery(a.response,b,{signal:d.signal,maxBytes:e,ttftTimeoutMs:g,stallTimeoutMs:h,repairEnabled:j});if(d.signal.aborted)throw E(d.signal.reason);f.enqueue(c),f.close()}catch(a){m&&"AbortError"===a.name?f.error(a):m&&"AbortError"!==a.name&&(f.enqueue(M("kiro_integrity_gate_failed",a.message||"Kiro integrity validation failed")),f.close())}finally{m=!1,clearInterval(c),b.signal?.removeEventListener?.("abort",l)}},cancel(a){m=!1,clearInterval(c),d.abort(a||"client cancelled")}});a.response=new Response(n,{status:a.response.status,statusText:a.response.statusText,headers:{...i.pb}})}async runIntegrityRecovery(a,b,c){let e=await this.readRecoverableIntegrityAttempt(a,b.model,c,"initial");if("complete"===e.kind)return e.bytes;if("terminal_stop"===e.kind||"upstream_error"===e.kind)return this.integrityFailureSSE(e);if("invalid_tool"===e.kind&&!c.repairEnabled)return M("invalid_kiro_tool_call",e.message,e.diagnostics);let f=["ellipsis","short_final","invalid_tool"].includes(e.kind)?e.kind:null,g=f?function(a,b){let c=structuredClone(a||{}),d=s[b]||"Retry the previous incomplete Kiro response.",e=c?.conversationState?.currentMessage?.userInputMessage;if(e){let a="string"==typeof e.content?e.content:"";e.content=a?`${a}
|
|
152
152
|
|
|
153
|
-
${d}`:d}return c}(b.body,"invalid_tool"===f?"tool":f):structuredClone(b.body||{}),h=await d.H.prototype.execute.call(this,{...b,body:g,signal:c.signal});if(!h?.response?.ok){let a="";try{a=await G(h?.response,c.signal,Math.min(c.maxBytes,4096),c.stallTimeoutMs)}catch(a){if("AbortError"===a.name)throw a}return M("kiro_integrity_retry_upstream_error",a||`Kiro integrity retry failed with HTTP ${h?.response?.status||502}`,{status:h?.response?.status||502})}let i=await this.readRecoverableIntegrityAttempt(h.response,b.model,c,"retry");return"complete"===i.kind?i.bytes:"terminal_stop"===i.kind||"upstream_error"===i.kind?this.integrityFailureSSE(i):M("ellipsis"===i.kind?"kiro_ellipsis_retry_failed":"short_final"===i.kind?"kiro_short_final_retry_failed":"invalid_tool"===i.kind?"kiro_tool_call_repair_retry_failed":"kiro_missing_terminal_retry_failed",`Kiro integrity validation failed after one bounded retry: ${i.message||i.kind}`,{attempts:[e.diagnostics,i.diagnostics].filter(Boolean)})}integrityFailureSSE(a){let b=a.diagnostics?.stop_disposition;return M(a.diagnostics?.terminal_provenance==="integrity_buffer_exceeded"?"kiro_integrity_buffer_exceeded":"upstream_error"===a.kind?"kiro_upstream_eventstream_error":"terminal_refusal"===b?"kiro_terminal_refusal":"terminal_incomplete"===b?"kiro_terminal_incomplete":"kiro_unknown_stop_reason",a.message||"Kiro stream ended with a terminal failure",a.diagnostics)}async readRecoverableIntegrityAttempt(a,b,c,d){try{return await this.readIntegrityAttempt(a,b,c,d)}catch(a){if("AbortError"===a.name)throw a;return{kind:"missing_terminal",message:a.message||"Kiro transport read failed",diagnostics:{attempt:d,terminal_provenance:"transport_read_error",transport_state:"upstream_error",stop_reason:null,stop_disposition:"terminal_incomplete",response_state:"no_semantic_output",event_counts:{},incomplete_frame_bytes:0}}}}async readIntegrityAttempt(a,b,c,d){let e,f=this.transformEventStreamToSSE(a,b,{maxToolBytes:Math.max(1,Math.floor(c.maxBytes/2)),onTerminalState:a=>{e=a}}).body.getReader(),g=[],h=0,i=!1,j={content:"",reasoning:"",hasToolCalls:!1,error:null};try{for(;;){let a=i?c.stallTimeoutMs:c.ttftTimeoutMs,b=i?"stalled":"timed out before first chunk",{done:d,value:e}=await F(f,c.signal,a,`Kiro integrity validation ${b}`);if(d)break;if(i=!0,(h+=e.byteLength)>c.maxBytes)return await f.cancel("kiro_integrity_buffer_exceeded").catch(()=>{}),{kind:"terminal_stop",message:`Kiro integrity buffer exceeded ${c.maxBytes} bytes`,diagnostics:{terminal_provenance:"integrity_buffer_exceeded"}};g.push(e);for(let a of r.decode(e).split("\n")){if(!a.startsWith("data: "))continue;let b=a.slice(6).trim();if(b&&"[DONE]"!==b)try{let a=JSON.parse(b);for(let b of(a.error&&(j.error=a.error),a.choices||[])){let a=b.delta||{};"string"==typeof a.content&&(j.content+=a.content),"string"==typeof a.reasoning_content&&(j.reasoning+=a.reasoning_content),a.tool_calls?.length&&(j.hasToolCalls=!0)}}catch{}}}}catch(a){throw await f.cancel(a.message).catch(()=>{}),a}let k={attempt:d,terminal_provenance:e?.terminal_provenance||"missing_terminal_diagnostics",transport_state:e?.transport_state||"unknown",stop_reason:e?.stop_reason||null,stop_disposition:e?.stop_disposition||"terminal_incomplete",response_state:e?.response_state||"no_semantic_output",event_counts:e?.event_counts||{},incomplete_frame_bytes:e?.incomplete_frame_bytes||0};if("retryable_protocol_failure"===k.stop_disposition)return{kind:"invalid_tool_call"===k.terminal_provenance?"invalid_tool":"retryable_stop",message:j.error?.message,diagnostics:k};if("terminal_incomplete"===k.stop_disposition||"terminal_refusal"===k.stop_disposition||"unknown_failure"===k.stop_disposition)return{kind:"upstream_eventstream_error"===k.terminal_provenance?"upstream_error":"integrity_buffer_exceeded"===k.terminal_provenance||["metadata_stop_reason","message_stop_event"].includes(k.terminal_provenance)?"terminal_stop":"missing_terminal",message:j.error?.message,diagnostics:k};if(j.error)return{kind:"missing_terminal",message:j.error.message,diagnostics:k};if(!j.hasToolCalls){let a;if(L(j.content)||!j.content.trim()&&L(j.reasoning))return{kind:"ellipsis",diagnostics:k};if(a=String(j.content||"").trim().replaceAll("’","'"),u.test(a)||!(v.test(a)&&w.test(a)||x.test(a)&&y.test(a))&&a.length>0&&a.length<=800&&t.test(a)&&!z.test(a)&&!A.test(a)&&!B.test(a))return{kind:"short_final",diagnostics:k}}return{kind:"complete",bytes:D(g,h),diagnostics:k}}transformEventStreamToSSE(a,b,c={}){let d=`chatcmpl-${Date.now()}`,e=Math.floor(Date.now()/1e3),g=(0,f.$D)(b).upstream,h=(0,j.
|
|
153
|
+
${d}`:d}return c}(b.body,"invalid_tool"===f?"tool":f):structuredClone(b.body||{}),h=await d.H.prototype.execute.call(this,{...b,body:g,signal:c.signal});if(!h?.response?.ok){let a="";try{a=await G(h?.response,c.signal,Math.min(c.maxBytes,4096),c.stallTimeoutMs)}catch(a){if("AbortError"===a.name)throw a}return M("kiro_integrity_retry_upstream_error",a||`Kiro integrity retry failed with HTTP ${h?.response?.status||502}`,{status:h?.response?.status||502})}let i=await this.readRecoverableIntegrityAttempt(h.response,b.model,c,"retry");return"complete"===i.kind?i.bytes:"terminal_stop"===i.kind||"upstream_error"===i.kind?this.integrityFailureSSE(i):M("ellipsis"===i.kind?"kiro_ellipsis_retry_failed":"short_final"===i.kind?"kiro_short_final_retry_failed":"invalid_tool"===i.kind?"kiro_tool_call_repair_retry_failed":"kiro_missing_terminal_retry_failed",`Kiro integrity validation failed after one bounded retry: ${i.message||i.kind}`,{attempts:[e.diagnostics,i.diagnostics].filter(Boolean)})}integrityFailureSSE(a){let b=a.diagnostics?.stop_disposition;return M(a.diagnostics?.terminal_provenance==="integrity_buffer_exceeded"?"kiro_integrity_buffer_exceeded":"upstream_error"===a.kind?"kiro_upstream_eventstream_error":"terminal_refusal"===b?"kiro_terminal_refusal":"terminal_incomplete"===b?"kiro_terminal_incomplete":"kiro_unknown_stop_reason",a.message||"Kiro stream ended with a terminal failure",a.diagnostics)}async readRecoverableIntegrityAttempt(a,b,c,d){try{return await this.readIntegrityAttempt(a,b,c,d)}catch(a){if("AbortError"===a.name)throw a;return{kind:"missing_terminal",message:a.message||"Kiro transport read failed",diagnostics:{attempt:d,terminal_provenance:"transport_read_error",transport_state:"upstream_error",stop_reason:null,stop_disposition:"terminal_incomplete",response_state:"no_semantic_output",event_counts:{},incomplete_frame_bytes:0}}}}async readIntegrityAttempt(a,b,c,d){let e,f=this.transformEventStreamToSSE(a,b,{maxToolBytes:Math.max(1,Math.floor(c.maxBytes/2)),onTerminalState:a=>{e=a}}).body.getReader(),g=[],h=0,i=!1,j={content:"",reasoning:"",hasToolCalls:!1,error:null};try{for(;;){let a=i?c.stallTimeoutMs:c.ttftTimeoutMs,b=i?"stalled":"timed out before first chunk",{done:d,value:e}=await F(f,c.signal,a,`Kiro integrity validation ${b}`);if(d)break;if(i=!0,(h+=e.byteLength)>c.maxBytes)return await f.cancel("kiro_integrity_buffer_exceeded").catch(()=>{}),{kind:"terminal_stop",message:`Kiro integrity buffer exceeded ${c.maxBytes} bytes`,diagnostics:{terminal_provenance:"integrity_buffer_exceeded"}};g.push(e);for(let a of r.decode(e).split("\n")){if(!a.startsWith("data: "))continue;let b=a.slice(6).trim();if(b&&"[DONE]"!==b)try{let a=JSON.parse(b);for(let b of(a.error&&(j.error=a.error),a.choices||[])){let a=b.delta||{};"string"==typeof a.content&&(j.content+=a.content),"string"==typeof a.reasoning_content&&(j.reasoning+=a.reasoning_content),a.tool_calls?.length&&(j.hasToolCalls=!0)}}catch{}}}}catch(a){throw await f.cancel(a.message).catch(()=>{}),a}let k={attempt:d,terminal_provenance:e?.terminal_provenance||"missing_terminal_diagnostics",transport_state:e?.transport_state||"unknown",stop_reason:e?.stop_reason||null,stop_disposition:e?.stop_disposition||"terminal_incomplete",response_state:e?.response_state||"no_semantic_output",event_counts:e?.event_counts||{},incomplete_frame_bytes:e?.incomplete_frame_bytes||0};if("retryable_protocol_failure"===k.stop_disposition)return{kind:"invalid_tool_call"===k.terminal_provenance?"invalid_tool":"retryable_stop",message:j.error?.message,diagnostics:k};if("terminal_incomplete"===k.stop_disposition||"terminal_refusal"===k.stop_disposition||"unknown_failure"===k.stop_disposition)return{kind:"upstream_eventstream_error"===k.terminal_provenance?"upstream_error":"integrity_buffer_exceeded"===k.terminal_provenance||["metadata_stop_reason","message_stop_event"].includes(k.terminal_provenance)?"terminal_stop":"missing_terminal",message:j.error?.message,diagnostics:k};if(j.error)return{kind:"missing_terminal",message:j.error.message,diagnostics:k};if(!j.hasToolCalls){let a;if(L(j.content)||!j.content.trim()&&L(j.reasoning))return{kind:"ellipsis",diagnostics:k};if(a=String(j.content||"").trim().replaceAll("’","'"),u.test(a)||!(v.test(a)&&w.test(a)||x.test(a)&&y.test(a))&&a.length>0&&a.length<=800&&t.test(a)&&!z.test(a)&&!A.test(a)&&!B.test(a))return{kind:"short_final",diagnostics:k}}return{kind:"complete",bytes:D(g,h),diagnostics:k}}transformEventStreamToSSE(a,b,c={}){let d=`chatcmpl-${Date.now()}`,e=Math.floor(Date.now()/1e3),g=(0,f.$D)(b).upstream,h=(0,j.nl)("kiro",g).contextWindow||2e5,k={},l={buffer:new Uint8Array(0),chunkIndex:0,toolCounter:0,tools:new Map,bufferedToolBytes:0,hasText:!1,hasReasoning:!1,hasCode:!1,hasToolCalls:!1,sawToolUse:!1,explicitStop:!1,stopReason:null,terminalProvenance:null,transportState:"consuming_response",totalContentLength:0,contextUsagePercentage:0,hasContextUsage:!1,hasMetering:!1,usage:null,inThinking:!1,toolValidationError:null,validatedFrames:0,finished:!1},r=(a={})=>({terminal_provenance:l.terminalProvenance||"clean_eventstream_eof",transport_state:l.transportState,stop_reason:l.stopReason,stop_disposition:J(l.stopReason,l.hasToolCalls),response_state:l.hasToolCalls?"valid_tool":l.hasText||l.hasReasoning||l.hasCode?"text_reasoning":l.explicitStop?"explicit_stop":"no_semantic_output",event_counts:{...k},incomplete_frame_bytes:l.buffer.byteLength,...a}),s=(a,c=null,f)=>q.encode(`data: ${JSON.stringify({id:d,object:"chat.completion.chunk",created:e,model:b,choices:[{index:0,delta:a,finish_reason:c}],...f?{usage:f}:{}})}
|
|
154
154
|
|
|
155
155
|
`),t=(a,b)=>{0===l.chunkIndex&&(b={role:"assistant",...b}),l.chunkIndex++,a.enqueue(s(b))},u=(a,b,d,e,f={})=>{l.finished=!0,l.terminalProvenance=b,l.transportState=f.transport_state||"corrupt_frame";let g=r({stop_disposition:f.stop_disposition||"terminal_incomplete",...f});c.onTerminalState?.(g),a.enqueue(M(d,e,g))},v=()=>{if(l.bufferedToolBytes<=(c.maxToolBytes||4194304))return;let a=Error("Kiro buffered tool input exceeded the integrity memory bound");throw a.code="KIRO_BUFFER_EXCEEDED",a},w=(a,b)=>{if(void 0!==b){if("string"==typeof b){if(a.inputKind&&"string"!==a.inputKind)throw Error("Kiro tool input changed fragment type");a.inputKind="string",a.inputChunks||=[],a.inputChunks.push(b),l.bufferedToolBytes+=q.encode(b).byteLength}else if(b&&"object"==typeof b&&!Array.isArray(b)){if(a.inputKind&&"object"!==a.inputKind)throw Error("Kiro tool input changed fragment type");a.inputKind="object",l.bufferedToolBytes-=a.inputBytes||0,a.inputObject=b,a.inputBytes=q.encode(JSON.stringify(b)).byteLength,l.bufferedToolBytes+=a.inputBytes}else throw Error("Kiro tool input must be a JSON object");v()}},x=a=>{if(!a.inputKind)throw Error("Kiro tool call is missing input");if("object"===a.inputKind)return a.inputObject;try{let b=JSON.parse(a.inputChunks.join(""));if(!b||"object"!=typeof b||Array.isArray(b))throw Error("not an object");return b}catch(a){throw Error(`Kiro tool input must be valid object JSON (${a.message})`)}},y=(a,b)=>{let c=a.headers[":message-type"];if("error"===c||"exception"===c)return u(b,"upstream_eventstream_error","kiro_upstream_eventstream_error",a.payload?.message||`Kiro upstream sent an EventStream ${c}`,{transport_state:"upstream_error"}),!1;let d=a.headers[":event-type"]||"",f=p.has(d)?d:"other";if(k[f]=(k[f]||0)+1,"assistantResponseEvent"===d&&"string"==typeof a.payload?.content){let c=a.payload.content;if(l.inThinking){let a=c.indexOf("</thinking>");a<0?c="":(l.inThinking=!1,c=c.slice(a+11).replace(/^\n/u,""))}else{let a=c.indexOf("<thinking>");if(a>=0){let b=c.indexOf("</thinking>",a+10);b<0?(l.inThinking=!0,c=c.slice(0,a)):c=c.slice(0,a)+c.slice(b+11).replace(/^\n/u,"")}}(c||!l.hasReasoning)&&(l.hasText||=c.length>0,l.totalContentLength+=c.length,t(b,{content:c}))}else if("reasoningContentEvent"===d){let c=a.payload?.reasoningContentEvent||a.payload||{},d="string"==typeof c?c:c.text||c.content||"";d&&(l.hasReasoning=!0,l.totalContentLength+=d.length,t(b,{reasoning_content:d}))}else if("codeEvent"===d&&"string"==typeof a.payload?.content)l.hasCode=!0,l.totalContentLength+=a.payload.content.length,t(b,{content:a.payload.content});else if("toolUseEvent"===d){l.sawToolUse=!0;let b=Array.isArray(a.payload)?a.payload:[a.payload];if(!b[0])throw Error("Kiro toolUseEvent is empty");for(let a of b){let b,c="string"==typeof a?.name?a.name.trim():"";if(!c)throw Error("Kiro toolUseEvent is missing a tool name");if(null==a.toolUseId)b=`call_${e}_${l.tools.size+1}`;else if("string"==typeof a.toolUseId&&a.toolUseId.trim())b=a.toolUseId;else throw Error("Kiro toolUseEvent has an invalid toolUseId");let d=l.tools.get(b);if(d){if(d.name!==c)throw Error("Kiro tool name changed between fragments")}else d={id:b,name:c},l.tools.set(b,d),l.bufferedToolBytes+=q.encode(b).byteLength+q.encode(c).byteLength+32,v();w(d,a.input)}}else if("messageStopEvent"===d){l.explicitStop=!0;let b=H(a.payload?.stopReason??a.payload?.stop_reason)||(l.sawToolUse?"tool_use":"end_turn"),c=K(l.stopReason,b);c!==l.stopReason&&(l.terminalProvenance="message_stop_event"),l.stopReason=c}else if("metadataEvent"===d||"MetadataEvent"===d){let b=a.payload?.metadataEvent||a.payload?.metadata||a.payload,c=H(b?.stopReason??b?.stop_reason);if(c){l.explicitStop=!0;let a=K(l.stopReason,c);a!==l.stopReason&&(l.terminalProvenance="metadata_stop_reason"),l.stopReason=a}}else if("contextUsageEvent"===d){let b=Number(a.payload?.contextUsagePercentage);Number.isFinite(b)&&(l.contextUsagePercentage=b,l.hasContextUsage=!0)}else if("meteringEvent"===d){l.hasMetering=!0;let b=a.payload?.meteringEvent||a.payload||{},c=Number(b.usage);Number.isFinite(c)&&(l.usage={...l.usage||{},kiro_credits:c,kiro_credit_unit:"string"==typeof b.unit?b.unit:"credit"})}else if("metricsEvent"===d){let b=a.payload?.metricsEvent||a.payload||{},c=Number(b.inputTokens)||0,d=Number(b.outputTokens)||0;if(c||d){l.usage={...l.usage||{},prompt_tokens:c,completion_tokens:d,total_tokens:c+d};let a=Number(b.cacheReadInputTokens||b.cache_read_input_tokens)||0,e=Number(b.cacheCreationInputTokens||b.cache_creation_input_tokens)||0;a&&(l.usage.cache_read_input_tokens=a),e&&(l.usage.cache_creation_input_tokens=e)}}return!0},z=(a,b)=>{let d=l.buffer.byteLength+a.byteLength;if(d>(c.maxRawBytes||n))return u(b,"corrupt_eventstream_frame","kiro_missing_terminal","Kiro EventStream buffered bytes exceed the protocol bound"),!1;if(0===l.buffer.byteLength)l.buffer=a;else{let b=new Uint8Array(d);b.set(l.buffer),b.set(a,l.buffer.byteLength),l.buffer=b}for(;l.buffer.byteLength>=12;){let a,c=new DataView(l.buffer.buffer,l.buffer.byteOffset);if(c.getUint32(8,!1)!==(0,m.QR)(l.buffer.subarray(0,8)))return u(b,"corrupt_eventstream_frame","kiro_missing_terminal","Kiro EventStream prelude CRC mismatch"),!1;let d=c.getUint32(0,!1),e=c.getUint32(4,!1);if(d<16||d>n||e>o||e>d-16)return u(b,"corrupt_eventstream_frame","kiro_missing_terminal","Kiro EventStream frame bounds are invalid"),!1;if(l.buffer.byteLength<d)break;let f=l.buffer.slice(0,d);l.buffer=l.buffer.slice(d);try{a=(0,m.xc)(f)}catch(a){return u(b,"corrupt_eventstream_frame","kiro_missing_terminal",a.message),!1}l.transportState="valid_complete_frame",l.validatedFrames++;try{if(!y(a,b))return!1}catch(a){if("KIRO_BUFFER_EXCEEDED"!==a.code){l.toolValidationError||=a.message,console.error(`[Kiro] tool fragment rejected, keeping ${l.tools.size} buffered tool(s): ${a.message}`);continue}return u(b,"integrity_buffer_exceeded","kiro_integrity_buffer_exceeded",a.message,{transport_state:l.transportState,stop_disposition:"terminal_incomplete"}),!1}}return!0};if(!a.body){let b=r({terminal_provenance:"missing_response_body",transport_state:"missing_body",stop_disposition:"terminal_incomplete"});return c.onTerminalState?.(b),new Response(M("kiro_missing_terminal","Kiro response did not include an EventStream body",b),{status:a.status,headers:{...i.pb}})}let A=a.body.getReader();return new Response(new ReadableStream({start:async a=>{try{for(;!l.finished;){let{done:b,value:c}=await A.read();if(b)break;let d=l.chunkIndex,e=l.validatedFrames;if(!z(c,a)){await A.cancel("invalid Kiro EventStream").catch(()=>{});break}l.validatedFrames>e&&l.chunkIndex===d&&a.enqueue(q.encode(": kiro-upstream\n\n"))}(a=>{if(l.finished)return;if(l.buffer.byteLength)return u(a,"incomplete_eventstream_frame","kiro_missing_terminal","Kiro EventStream ended with a truncated frame",{transport_state:"incomplete_frame"});l.transportState="clean_eof";let b=J(l.stopReason,l.sawToolUse),d="terminal_incomplete"===b&&I.has(l.stopReason)&&l.chunkIndex>0;if(d&&console.error(`[Kiro] truncated after ${l.chunkIndex} chunk(s) (stop_reason=${l.stopReason}); keeping output`),!d&&["retryable_protocol_failure","terminal_incomplete","terminal_refusal","unknown_failure"].includes(b))return u(a,l.terminalProvenance||"metadata_stop_reason","retryable_protocol_failure"===b?"kiro_retryable_protocol_failure":"terminal_refusal"===b?"kiro_terminal_refusal":"terminal_incomplete"===b?"kiro_terminal_incomplete":"kiro_unknown_stop_reason",`Kiro ended with non-success stop reason: ${l.stopReason}`,{transport_state:l.transportState,stop_disposition:b});try{for(let b of l.tools.values()){let c;try{if(c=x(b),"tool_call"===b.name){if("string"!=typeof c.name||!c.name.trim())throw Error("Invalid Kiro tool_call payload: missing nested MCP tool name");if(!Object.prototype.hasOwnProperty.call(c,"arguments"))throw Error("Invalid Kiro tool_call payload: missing nested MCP tool arguments")}}catch(a){l.droppedTools=(l.droppedTools||0)+1,l.toolValidationError||=a.message,console.error(`[Kiro] dropping unusable tool call ${b.id} (${b.name}): ${a.message}`);continue}let d=l.toolCounter++;t(a,{tool_calls:[{index:d,id:b.id,type:"function",function:{name:b.name,arguments:""}}]});let e=JSON.stringify(c);t(a,{tool_calls:[{index:d,function:{arguments:e}}]}),l.totalContentLength+=b.name.length+e.length,l.hasToolCalls=!0}if(l.tools.clear(),l.bufferedToolBytes=0,"tool_use"===l.stopReason&&!l.hasToolCalls&&!l.hasText&&!l.hasReasoning&&!l.hasCode)throw Error("Kiro tool_use stop reason did not include a complete tool call")}catch(b){u(a,"invalid_tool_call","invalid_kiro_tool_call",b.message,{transport_state:l.transportState,stop_disposition:"retryable_protocol_failure"});return}if(l.toolValidationError&&!l.hasToolCalls&&!l.hasText&&!l.hasReasoning&&!l.hasCode)return u(a,"invalid_tool_call","invalid_kiro_tool_call",l.toolValidationError,{transport_state:l.transportState,stop_disposition:"retryable_protocol_failure"});if(!(l.hasText||l.hasReasoning||l.hasCode||l.hasToolCalls)&&!l.explicitStop)return u(a,"empty_response_eof","kiro_missing_terminal","Kiro EventStream ended without model output",{transport_state:l.transportState});let e=J(l.stopReason,l.hasToolCalls),f="terminal_incomplete"===e&&I.has(l.stopReason)&&l.chunkIndex>0;if(f&&console.error(`[Kiro] truncated after ${l.chunkIndex} chunk(s) (stop_reason=${l.stopReason}); closing as length`),!f&&["retryable_protocol_failure","terminal_incomplete","terminal_refusal","unknown_failure"].includes(e)){let b="retryable_protocol_failure"===e?"kiro_retryable_protocol_failure":"terminal_refusal"===e?"kiro_terminal_refusal":"terminal_incomplete"===e?"kiro_terminal_incomplete":"kiro_unknown_stop_reason";u(a,l.terminalProvenance||"metadata_stop_reason",b,`Kiro ended with non-success stop reason: ${l.stopReason}`,{transport_state:l.transportState,stop_disposition:e});return}if(l.hasMetering&&l.hasContextUsage&&!l.usage?.total_tokens){let a=l.totalContentLength?Math.max(1,Math.floor(l.totalContentLength/4)):0,b=Math.floor(l.contextUsagePercentage*h/100);l.usage={...l.usage||{},prompt_tokens:b,completion_tokens:a,total_tokens:b+a}}let g=f?"length":l.hasToolCalls?"tool_calls":"length"===e?"length":"stop";a.enqueue(s({},g,l.usage)),a.enqueue(q.encode(i.$U)),l.finished=!0,c.onTerminalState?.(r({terminal_provenance:l.terminalProvenance||"clean_eventstream_eof",transport_state:l.transportState,stop_disposition:f?"length":e}))})(a),a.close()}catch(b){l.finished||u(a,"upstream_read_error","kiro_missing_terminal",b.message||"Kiro EventStream read failed",{transport_state:"upstream_error"}),a.close()}},cancel:a=>A.cancel(a)}),{status:a.status,statusText:a.statusText,headers:{...i.pb}})}async refreshCredentials(a,b,c=null){if(!a.refreshToken)return null;try{return await (0,h.Ql)(a.refreshToken,a.providerSpecificData,b,c)}catch(a){return b?.error?.("TOKEN",`Kiro refresh error: ${a.message}`),null}}}},77971:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DEEPSEEK_WEB:()=>i,DeepSeekWebError:()=>j,checkWebSession:()=>q,connectWebSession:()=>r,deepSeekFingerprintHeaders:()=>k,deepSeekModelIds:()=>p,deepSeekRefusal:()=>m,fetchDeepSeekAccessToken:()=>o,parseDeepSeekUserToken:()=>l,unwrapDeepSeekBizData:()=>n});var d=c(66583),e=c(54051),f=c(39609);let g=d.A.transport,h=new URL(g.baseUrl).origin,i={origin:h,apiBase:`${h}/api`,usersUrl:`${h}/api/v0/users/current`,sessionUrl:`${h}/api/v0/chat_session/create`,powChallengeUrl:`${h}/api/v0/chat/create_pow_challenge`,completionUrl:g.baseUrl,completionPath:"/api/v0/chat/completion",tokenStorageKey:"userToken"};class j extends Error{constructor(a,{status:b=502,type:c="upstream_error",code:d="upstream_error"}={}){super(a),this.name="DeepSeekWebError",this.status=b,this.type=c,this.code=d}}function k(a={}){return(0,e.browserFingerprintHeaders)({origin:i.origin,referer:`${i.origin}/`,accept:"*/*",extra:{"X-Client-Bundle-Id":"com.deepseek.chat","X-Client-Locale":"en-US","X-Client-Platform":"web","X-Client-Version":"2.0.0",...a}})}function l(a){let b=String(a??"").trim();if(!b)throw new j("Paste the userToken from chat.deepseek.com.",{status:400,type:"invalid_request",code:"invalid_request"});if(/^(GET|POST|PUT|HEAD|OPTIONS|DELETE|PATCH)\s+\//i.test(b))throw new j("That is a request line, not a userToken. Copy the value of localStorage's userToken only.",{status:400,type:"invalid_request",code:"invalid_request"});if(b.startsWith("{")){let a;try{a=JSON.parse(b)}catch{return b}if(!a||"object"!=typeof a)return b;if("string"==typeof a.value&&a.value.trim())return a.value.trim();if(!("value"in a))return b;throw new j("That userToken is empty, which is what chat.deepseek.com stores when you are not signed in. Open chat.deepseek.com, sign in, and copy it again.",{status:401,type:"authentication_error",code:"empty_user_token"})}return b}function m(a,b){return 401===a||403===a?new j(`DeepSeek refused this session while ${b} (${a}). Sign in to chat.deepseek.com again and export a fresh userToken.`,{status:a,type:"authentication_error",code:`HTTP_${a}`}):429===a?new j(`DeepSeek is rate limiting this session (${a}) while ${b}.`,{status:a,type:"rate_limit_error",code:`HTTP_${a}`}):new j(`DeepSeek answered ${a} while ${b}.`,{status:a,type:"upstream_error",code:`HTTP_${a}`})}function n(a,b){if(!a||"object"!=typeof a)throw new j(`DeepSeek returned no data for the ${b}.`,{status:502,code:"PROVIDER_REQUEST_FAILED"});let c=(0,e.readBodyRefusal)(a);if(c)throw new j(`DeepSeek refused the ${b}: ${c}`,{status:502,code:"PROVIDER_REQUEST_FAILED"});if("number"==typeof a.code&&0!==a.code){let c="string"==typeof a.msg&&a.msg||a.data?.biz_msg||`error code ${a.code}`;throw new j(`DeepSeek rejected the ${b}: ${c}`,{status:502,code:"PROVIDER_REQUEST_FAILED"})}let d=a.data?.biz_data;if(!d||"object"!=typeof d)throw new j(`DeepSeek returned no data for the ${b}.`,{status:502,code:"PROVIDER_REQUEST_FAILED"});return d}async function o(a,{signal:b,fetchImpl:c}={}){let d,e=c||f.proxyAwareFetch;try{d=await e(i.usersUrl,{method:"GET",headers:{...k(),Authorization:`Bearer ${a}`},...b?{signal:b}:{}})}catch(a){throw new j(`Could not reach chat.deepseek.com: ${a?.message||String(a)}`,{status:502,type:"upstream_error",code:"upstream_unreachable"})}if(!d.ok){if(401===d.status||403===d.status)throw new j("DeepSeek rejected that userToken. Sign in to chat.deepseek.com again and export a fresh one — a token from another account or a signed-out session looks exactly like this.",{status:401,type:"authentication_error",code:`HTTP_${d.status}`});throw m(d.status,"exchanging the userToken for an access token")}let g=n(await d.json().catch(()=>null),"sign-in").token;if("string"!=typeof g||!g)throw new j("DeepSeek accepted the request but returned no access token.",{status:401,type:"authentication_error",code:"no_access_token"});return g}function p(){return(d.A.models||[]).map(a=>a.id)}async function q(a){let b;try{b=l(a)}catch(b){let a=b?.message||"That is not a userToken.";return{ok:!1,detail:a,error:a,models:[]}}try{await o(b)}catch(b){let a=b?.message||"DeepSeek did not accept that userToken.";return{ok:!1,detail:a,error:a,models:[]}}return{ok:!0,detail:"DeepSeek accepted the userToken.",models:p()}}async function r(a){let b;try{b=l(a)}catch(b){let a=b?.message||"That is not a userToken.";return{ok:!1,error:a,detail:a}}try{await o(b)}catch(b){let a=b?.message||"DeepSeek did not accept that userToken.";return{ok:!1,error:a,detail:a}}return{ok:!0,credential:b,models:p(),name:"DeepSeek Web"}}},79881:(a,b,c)=>{"use strict";c.d(b,{id:()=>w});var d=c(74957),e=c(35024),f=c(78959),g=c(92536),h=c(39609),i=c(66583),j=c(77971);let k=new Map(Object.entries({"deepseek-v4-pro":{expert:!0,thinking:!1,search:!1},"deepseek-v4-pro-think":{expert:!0,thinking:!0,search:!1},"deepseek-v4-pro-search":{expert:!0,thinking:!1,search:!0},"deepseek-v4-pro-think-search":{expert:!0,thinking:!0,search:!0},"deepseek-v4-flash":{expert:!1,thinking:!1,search:!1},"deepseek-v4-flash-think":{expert:!1,thinking:!0,search:!1},"deepseek-v4-flash-search":{expert:!1,thinking:!1,search:!0},"deepseek-v4-flash-think-search":{expert:!1,thinking:!0,search:!0},"deepseek-chat":{expert:!1,thinking:!1,search:!1},"deepseek-reasoner":{expert:!1,thinking:!0,search:!1},"DeepSeek-R1":{expert:!1,thinking:!0,search:!1},"DeepSeek-R1-Search":{expert:!1,thinking:!0,search:!0},"DeepSeek-V3.2":{expert:!1,thinking:!1,search:!1},"DeepSeek-Search":{expert:!1,thinking:!1,search:!0}}).map(([a,b])=>[a.toLowerCase(),{id:a,...b}]));function l(a){let b=String(a??"").trim().toLowerCase();return b?k.get(b)??null:null}let m=[0,1,62,28,27,36,44,6,55,20,3,10,43,25,39,41,45,15,21,8,18,2,61,56,14],n=[1n,32898n,0x800000000000808an,0x8000000080008000n,32907n,2147483649n,0x8000000080008081n,0x8000000000008009n,138n,136n,2147516425n,2147483658n,2147516555n,0x800000000000008bn,0x8000000000008089n,0x8000000000008003n,0x8000000000008002n,0x8000000000000080n,32778n,0x800000008000000an,0x8000000080008081n,0x8000000000008080n,2147483649n,0x8000000080008008n],o=Uint32Array.from(n,a=>Number(4294967295n&a)),p=Uint32Array.from(n,a=>Number(a>>32n&4294967295n)),q=Uint8Array.from({length:25},(a,b)=>{let c=Math.floor(b/5);return 2*(c+(b%5*2+3*c)%5*5)}),r=Uint8Array.from({length:25},(a,b)=>{let c=b%5;return 2*(b-c+(c+1)%5)}),s=Uint8Array.from({length:25},(a,b)=>{let c=b%5;return 2*(b-c+(c+2)%5)});function t(a,b,c,d,e){let f=n.length-e;for(let e=f;e<n.length;e++){for(let b=0;b<5;b++){let d=2*b;c[d]=a[d]^a[d+10]^a[d+20]^a[d+30]^a[d+40],c[d+1]=a[d+1]^a[d+11]^a[d+21]^a[d+31]^a[d+41]}for(let a=0;a<5;a++){let b=(a+4)%5*2,e=(a+1)%5*2,f=c[e]<<1|c[e+1]>>>31,g=c[e+1]<<1|c[e]>>>31;d[2*a]=c[b]^f,d[2*a+1]=c[b+1]^g}for(let b=0;b<5;b++){let c=2*b,e=d[c],f=d[c+1];for(let b of[c,c+10,c+20,c+30,c+40])a[b]=a[b]^e,a[b+1]=a[b+1]^f}b[0]=a[0],b[1]=a[1];for(let c=1;c<25;c++){let d=2*c,e=q[c],f=m[c],g=a[d],h=a[d+1];if(f<32)b[e]=g<<f|h>>>32-f,b[e+1]=h<<f|g>>>32-f;else{let a=f-32;b[e]=h<<a|g>>>32-a,b[e+1]=g<<a|h>>>32-a}}for(let c=0;c<25;c++){let d=2*c,e=r[c],f=s[c];a[d]=b[d]^~b[e]&b[f],a[d+1]=b[d+1]^~b[e+1]&b[f+1]}a[0]=a[0]^o[e],a[1]=a[1]^p[e]}}async function u(a,b){let c=a.body;if(!c)return a.text();let d=c.getReader(),e=new TextDecoder,f=[],g=0;try{for(;;){if(b?.aborted)throw new DOMException("Aborted","AbortError");let{done:a,value:c}=await d.read();if(a)break;if(c){if((g+=c.byteLength)>8388608)throw await d.cancel().catch(()=>void 0),new j.DeepSeekWebError("DeepSeek’s answer grew past 8 MB and was cut off.",{status:502,code:"PROVIDER_REQUEST_FAILED"});f.push(e.decode(c,{stream:!0}))}}f.push(e.decode())}finally{try{d.releaseLock()}catch{}}return f.join("")}function v(a,b,c,d){return new Response(JSON.stringify({error:{message:b,type:c,code:d}}),{status:a,headers:{"Content-Type":"application/json"}})}class w extends d.H{constructor(){super("deepseek-web",e.xq["deepseek-web"]||i.A.transport),this.accessTokens=new Map}buildUrl(a,b,c=0,d=null){return j.DEEPSEEK_WEB.completionUrl}buildHeaders(a,b=!0){return(0,j.deepSeekFingerprintHeaders)()}transformRequest(a,b,c,d){let e=l(a),f=(b?.messages||[]).map(a=>{var b;return{role:String(a?.role||"user"),text:"string"==typeof(b=a?.content)?b:Array.isArray(b)?b.map(a=>"string"==typeof a?a:a&&"object"==typeof a&&"text"in a?String(a.text??""):"").join(""):""}});return{chat_session_id:null,parent_message_id:null,model_type:e?.expert?"expert":"default",prompt:function(a){let b=(a||[]).filter(a=>a.text?.trim()),c=b.filter(a=>"system"===a.role),d=b.filter(a=>"system"!==a.role),e=[];for(let a of(c.length>0&&e.push("Follow these instructions:",...c.map(a=>`- ${a.text.trim()}`),""),d))e.push(`${"assistant"===a.role?"Assistant":"User"}: ${a.text.trim()}`);return e.join("\n").trim()}(f),ref_file_ids:[],thinking_enabled:e?.thinking===!0,search_enabled:e?.search===!0,preempt:!1}}async accessToken(a,{signal:b,proxyOptions:c}={}){let d=this.accessTokens.get(a);if(d&&d.expiresAt>Date.now())return d.token;let e=await (0,j.fetchDeepSeekAccessToken)(a,{signal:b,fetchImpl:(a,b)=>(0,h.proxyAwareFetch)(a,b,c)});return this.accessTokens.set(a,{token:e,expiresAt:Date.now()+33e5}),e}async execute({model:a,body:b,stream:c,credentials:d,signal:e,log:i,proxyOptions:k=null}){let m,n=b?.messages;if(!n||!Array.isArray(n)||0===n.length)return{response:v(400,"Missing or empty messages array","invalid_request","invalid_request"),url:j.DEEPSEEK_WEB.completionUrl,headers:{},transformedBody:b};let o=l(a);if(!o)return{response:v(400,`DeepSeek Web does not offer a model called ${a}. The models it serves are the ones on this page.`,"invalid_request","not_supported"),url:j.DEEPSEEK_WEB.completionUrl,headers:{},transformedBody:b};try{m=(0,j.parseDeepSeekUserToken)(d?.apiKey||d?.accessToken||"")}catch(a){return{response:v(a?.status||401,a?.message||"This DeepSeek Web connection has no userToken.",a?.type||"authentication_error",a?.code||"invalid_request"),url:j.DEEPSEEK_WEB.completionUrl,headers:{},transformedBody:b}}let p=this.transformRequest(a,b,c,d),q=this.buildHeaders(d,c);try{let a=await this.accessToken(m,{signal:e,proxyOptions:k}),b=await this.createChatSession(a,{signal:e,proxyOptions:k}),d=await this.solveProofOfWork(a,{signal:e,proxyOptions:k});p.chat_session_id=b;let i=await (0,h.proxyAwareFetch)(j.DEEPSEEK_WEB.completionUrl,{method:"POST",headers:{...q,"Content-Type":"application/json",Authorization:`Bearer ${a}`,"X-Ds-Pow-Response":d,"X-Client-Timezone-Offset":String(-60*new Date().getTimezoneOffset())},body:JSON.stringify(p),...e?{signal:e}:{}},k);if(!i.ok)throw(0,j.deepSeekRefusal)(i.status,"answering the completion");let l=function(a){let b="",c="",d="content",e=!1,f=0,g=a=>{a&&("thinking"===d?c+=a:b+=a)},h=a=>{let b=String(a.type??"").toUpperCase();"THINK"===b?d="thinking":("ANSWER"===b||"RESPONSE"===b)&&(d="content")},i=(a,b)=>{a&&"object"==typeof a&&(b&&h(a),"string"==typeof a.content&&0!==a.content.length&&(b||h(a),g(a.content)))};for(let b of String(a??"").replace(/\r\n?/g,"\n").split("\n")){let a,c=b.trim();if(!c.startsWith("data:"))continue;let h=c.slice(5).trim();if(!h||"[DONE]"===h)continue;try{a=JSON.parse(h)}catch{continue}if("object"!=typeof a||null===a)continue;let j=a,k="string"==typeof j.p?j.p:"",l=j.v;if("response/status"===k&&"FINISHED"===l){e=!0;continue}if("response/search_status"!==k&&"response/search_results"!==k){if(l&&"object"==typeof l&&!Array.isArray(l)&&"response"in l){let a=l.response;if(!0===a.thinking_enabled?d="thinking":!1===a.thinking_enabled&&(d="content"),Array.isArray(a.fragments))for(let b of a.fragments)i(b,!1)}if("response/fragments"===k){if(Array.isArray(l))for(let a of l)i(a,!0);else i(l,!0);continue}if("response"===k&&Array.isArray(l)){for(let a of l)a?.p==="response"&&a.v?.thinking_enabled===!0&&(d="thinking"),a?.p==="accumulated_token_usage"&&"number"==typeof a.v&&(f=a.v);continue}"string"==typeof l&&g(l)}}return{content:b,reasoning:c,finished:e,usage:f}}(await u(i,e));if(!l.content)throw new j.DeepSeekWebError("DeepSeek answered, but the stream carried no text. Its response format may have changed.",{status:502,code:"PROVIDER_REQUEST_FAILED"});if(!l.finished)throw new j.DeepSeekWebError(`DeepSeek's stream ended before it finished generating — the answer was cut off after ${l.content.length} characters. This is usually a dropped connection or an expired session. Try again.`,{status:502,code:"PROVIDER_REQUEST_FAILED"});let n=`chatcmpl-deepseek-${crypto.randomUUID().slice(0,12)}`,s=Math.floor(Date.now()/1e3),t=Math.ceil((p.prompt?.length||0)/4),v=l.usage||Math.ceil(l.content.length/4);if(c){var r;let a,b;return{response:new Response((r=o.id,a=new TextEncoder,b=(a,b=null)=>(0,g.N)({id:n,object:"chat.completion.chunk",created:s,model:r,system_fingerprint:null,choices:[{index:0,delta:a,finish_reason:b,logprobs:null}]}),new ReadableStream({start(c){c.enqueue(a.encode(b({role:"assistant"}))),l.reasoning&&c.enqueue(a.encode(b({reasoning_content:l.reasoning}))),c.enqueue(a.encode(b({content:l.content}))),c.enqueue(a.encode(b({},"stop"))),c.enqueue(a.encode(f.$U)),c.close()}})),{status:200,headers:{...f.uB}}),url:j.DEEPSEEK_WEB.completionUrl,headers:q,transformedBody:p}}let w={role:"assistant",content:l.content};return l.reasoning&&(w.reasoning_content=l.reasoning),{response:new Response(JSON.stringify({id:n,object:"chat.completion",created:s,model:o.id,system_fingerprint:null,choices:[{index:0,message:w,finish_reason:"stop",logprobs:null}],usage:{prompt_tokens:t,completion_tokens:v,total_tokens:t+v}}),{status:200,headers:{"Content-Type":"application/json"}}),url:j.DEEPSEEK_WEB.completionUrl,headers:q,transformedBody:p}}catch(d){let a=Number.isInteger(d?.status)?d.status:502,b=d?.type||"upstream_error",c=d?.code||`HTTP_${a}`;return(401===a||403===a)&&this.accessTokens.delete(m),i?.warn?.("DS-WEB",d?.message||String(d)),{response:v(a,d?.message||"DeepSeek Web failed.",b,c),url:j.DEEPSEEK_WEB.completionUrl,headers:q,transformedBody:p}}}async createChatSession(a,{signal:b,proxyOptions:c}={}){let d=await (0,h.proxyAwareFetch)(j.DEEPSEEK_WEB.sessionUrl,{method:"POST",headers:{...(0,j.deepSeekFingerprintHeaders)(),"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({}),...b?{signal:b}:{}},c);if(!d.ok)throw(0,j.deepSeekRefusal)(d.status,"starting a chat session");let e=(0,j.unwrapDeepSeekBizData)(await d.json().catch(()=>null),"chat session").chat_session;if(!e?.id)throw new j.DeepSeekWebError("DeepSeek started no chat session.",{status:502,code:"PROVIDER_REQUEST_FAILED"});return e.id}async solveProofOfWork(a,{signal:b,proxyOptions:c}={}){let d=await (0,h.proxyAwareFetch)(j.DEEPSEEK_WEB.powChallengeUrl,{method:"POST",headers:{...(0,j.deepSeekFingerprintHeaders)(),"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({target_path:j.DEEPSEEK_WEB.completionPath}),...b?{signal:b}:{}},c);if(!d.ok)throw(0,j.deepSeekRefusal)(d.status,"issuing a proof of work");let e=(0,j.unwrapDeepSeekBizData)(await d.json().catch(()=>null),"proof of work").challenge;if(!e?.challenge||"string"!=typeof e.salt||"number"!=typeof e.difficulty)throw new j.DeepSeekWebError("DeepSeek returned a proof-of-work challenge with no answer in it.",{status:502,code:"PROVIDER_REQUEST_FAILED"});if(void 0!==e.algorithm&&"DeepSeekHashV1"!==e.algorithm)throw new j.DeepSeekWebError(`DeepSeek changed its proof-of-work algorithm to ${e.algorithm}; this version solves DeepSeekHashV1.`,{status:502,code:"PROVIDER_REQUEST_FAILED"});let f=function(a,b,c){if("string"!=typeof a)throw TypeError("DeepSeek PoW prefix must be a string");if(!/^[a-f0-9]{64}$/i.test(b))throw TypeError("DeepSeek PoW challenge must be a 64-character hex digest");if(!Number.isSafeInteger(c)||c<1||c>25e4)throw RangeError("DeepSeek PoW difficulty must be an integer from 1 to 250000");let d=new TextEncoder().encode(a),e=new Uint32Array(50),f=new Uint32Array(50),g=new Uint32Array(10),h=new Uint32Array(10),i=0;for(;i+136<=d.length;){var j=i;for(let a=0;a<136;a++)e[a>>>2]^=d[j+a]<<(3&a)*8;t(e,f,g,h,23),i+=136}let k=d.length-i,l=new Uint32Array(Math.ceil(k/4)+1);for(let a=0;a<k;a++)l[a>>>2]^=d[i+a]<<(3&a)*8;let m=function(a){let b=new Uint32Array(8);for(let c=0;c<32;c++){let d=Number.parseInt(a.slice(2*c,2*c+2),16);b[c>>>2]|=d<<(3&c)*8}return b}(b.toLowerCase()),n=new Uint32Array(50);a:for(let a=0;a<c;a++){n.set(e);for(let a=0;a<l.length;a++)n[a]^=l[a];let b=k,c=String(a);for(let a=0;a<c.length;a++)n[b>>>2]^=c.charCodeAt(a)<<(3&b)*8,136===(b+=1)&&(t(n,f,g,h,23),b=0);n[b>>>2]^=6<<(3&b)*8,n[33]^=-0x80000000,t(n,f,g,h,23);for(let a=0;a<m.length;a++)if(n[a]!==m[a])continue a;return a}return -1}(`${e.salt}_${e.expire_at??0}_`,e.challenge,Math.min(e.difficulty,25e4));if(f<0)throw new j.DeepSeekWebError(`DeepSeek's proof of work had no answer within the range it announced (${e.difficulty}). The challenge may have expired before it was solved.`,{status:502,code:"PROVIDER_REQUEST_FAILED"});return Buffer.from(JSON.stringify({algorithm:e.algorithm??"DeepSeekHashV1",challenge:e.challenge,salt:e.salt,answer:f,signature:e.signature,target_path:e.target_path??"/api/v2/chat/completion"})).toString("base64")}}},83243:(a,b,c)=>{"use strict";c.d(b,{M:()=>h});var d=c(96179),e=c(8521);let f=/insufficient|balance|credit|quota|exhaust|limit|余额|积分|额度|不足|用完|上限/i;async function g(a){let b=a?.status;if(!a||402!==b&&403!==b&&429!==b)return a;let c=await a.text().catch(()=>"");if(429===b||!f.test(c)){let d=new Headers(a.headers);return d.delete("content-length"),d.delete("content-encoding"),new Response(c,{status:b,statusText:a.statusText,headers:d})}let d=c.trim();try{let a=JSON.parse(c);d=a?.error?.message??a?.message??a?.msg??a?.base_resp?.status_msg??d}catch{}let e=new Headers(a.headers);return e.delete("content-length"),e.delete("content-encoding"),e.set("content-type","application/json"),new Response(JSON.stringify({type:"error",error:{type:"rate_limit_error",message:`usage limit reached: ${d}`}}),{status:429,statusText:"Too Many Requests",headers:e})}class h extends d.L{async execute(a){let b=await super.execute(a);return b?.response?{...b,response:await g(b.response)}:b}async refreshCredentials(a,b){return a?.refreshToken?(0,e.rE)(this.provider,a.refreshToken,b):null}}},85308:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(74957),e=c(39609),f=c(35024);let g=parseInt(process.env.TRAE_STREAM_TIMEOUT_MS||"300000",10);class h extends d.H{constructor(){super("trae",f.xq.trae)}base(){return(this.config.baseUrl||"https://core-normal.trae.ai/api/remote/v1").replace(/\/$/,"")}buildHeaders(a,b=!0){let c=a?.accessToken||"",d=a?.providerSpecificData||{};return{Authorization:`Cloud-IDE-JWT ${c}`,"Content-Type":"application/json","X-Trae-Client-Type":"web","X-Preferenced-Language":d.appLanguage||"en","x-user-region":d.userRegion||"US",Referer:"https://solo.trae.ai/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",Accept:b?"text/event-stream":"application/json"}}resolveMode(a){let b=(a||"").trim().toLowerCase();if("work"===b||"auto-work"===b||"solo-work"===b)return{mode:"work",strategy:"auto",modelName:""};let c=!b||"auto"===b;return{mode:"code",strategy:c?"auto":"manual",modelName:c?"":a}}commonParams(a,b,c){let d={language:"en-us",app_language:a.appLanguage||"en",quality:"stable",app_version:a.appVersion||"1.0.0.1229",web_id:a.webId||"",user_identity:a.userIdentity||"Free",is_freshman:"0",biz_user_id:a.bizUserId||"",user_unique_id:a.userUniqueId||"",scope:a.scope||"marscode-us",tenant:a.tenant||"marscode",region:a.region||"US-East",aiRegion:a.aiRegion||a.region||"US-East",is_privacy_mode:0,privacy_mode:"off",solo_chat_mode:b};return c&&(d.biz_session_id=c),JSON.stringify(d)}async createSession(a,b,c,d,f){let{mode:g,strategy:h,modelName:i}=this.resolveMode(c),j={mode:g,environment_id:"default",initial_message:{chat_session_id:"",content:[],query:b,model_name:i,agent_type:"solo_agent_remote",model_selection_strategy:h,common_params:this.commonParams(d,g)},env:"remote",auto_create_project:!1,origin:"web"},k=await (0,e.proxyAwareFetch)(`${this.base()}/chat_sessions`,{method:"POST",headers:a,body:JSON.stringify(j),signal:f},null),l=await k.text();if(!k.ok)throw Error(`[${k.status}] ${l}`);let m=JSON.parse(l);if(m?.code!==0)throw Error(`Trae create_session: ${JSON.stringify(m)}`);return{sessionId:m.data.chat_session_id,messageId:m.data.message_id}}async streamEvents(a,b,c,d,f){let h=`${this.base()}/chat_sessions/${b}/events?reply_to_message_id=${encodeURIComponent(c)}`,i=new AbortController;f?.aborted&&i.abort();let j=setTimeout(()=>i.abort(Error("trae stream timeout")),g),k=()=>i.abort();f&&f.addEventListener("abort",k,{once:!0});try{let b=await (0,e.proxyAwareFetch)(h,{method:"GET",headers:a,signal:i.signal},null);if(!b.ok||!b.body)throw Error(`[${b.status}] events stream failed`);let c=b.body.getReader(),f=new TextDecoder,g="",j=null;for(;;){let a,{done:b,value:e}=await c.read();if(b)break;for(g+=f.decode(e,{stream:!0});(a=g.indexOf("\n"))>=0;){let b=g.slice(0,a).replace(/\r$/,"");if(g=g.slice(a+1),b.startsWith("event:"))j=b.slice(6).trim();else if(b.startsWith("data:")){let a,e=b.slice(5).trim();try{a=JSON.parse(e)}catch{a={_raw:e}}if(d(j,a))return void await c.cancel().catch(()=>{})}else""===b&&(j=null)}}}finally{clearTimeout(j),f&&f.removeEventListener("abort",k)}}async execute({model:a,body:b,stream:c,credentials:d,signal:e}){let f,g=this.buildHeaders(d,!1!==c),h=d?.providerSpecificData||{},i=function(a){let b=[];for(let c of a){let a="";"string"==typeof c.content?a=c.content:Array.isArray(c.content)&&(a=c.content.map(a=>"string"==typeof a?a:a&&"object"==typeof a?String(a.text??""):"").join("")),"system"===c.role?b.push(`[System]
|
|
156
156
|
${a}`):"assistant"===c.role?b.push(`[Assistant]
|