@jheavenknows/bluerouter 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/.next-cli-build/BUILD_ID +1 -1
- package/app/.next-cli-build/app-path-routes-manifest.json +5 -5
- package/app/.next-cli-build/build-manifest.json +3 -3
- package/app/.next-cli-build/prerender-manifest.json +3 -3
- package/app/.next-cli-build/required-server-files.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js +5 -4
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/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 +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/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/translator/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
- package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js +1 -1
- package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
- 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.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/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 +4 -4
- package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js +162 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +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/hermes-settings/route.js +3 -3
- 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 +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
- package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js +23 -23
- package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/combos/route.js +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js +162 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js +162 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js +162 -1
- package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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 +2 -1
- package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/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/social-authorize/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
- package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
- package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/provider-health/route.js +1 -1
- package/app/.next-cli-build/server/app/api/provider-health/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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
- package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/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.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/tunnel/tailscale-login/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js +1 -1
- package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
- package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/v1/models/info/route.js.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/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/restart/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page.js +1 -1
- package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/callback.html +1 -1
- package/app/.next-cli-build/server/app/callback.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
- 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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
- 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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
- 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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
- 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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
- 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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
- 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 +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +5 -5
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/provider-health.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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
- 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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
- 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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/proxy-pools.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 +7 -7
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
- 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 +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/dashboard/skills.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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
- 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 +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
- 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 +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
- package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
- 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.nft.json +1 -1
- package/app/.next-cli-build/server/app/index.html +1 -1
- package/app/.next-cli-build/server/app/index.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing/page.js +1 -1
- package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/landing.html +1 -1
- package/app/.next-cli-build/server/app/landing.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login/page.js +1 -1
- package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
- package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/app/login.html +1 -1
- package/app/.next-cli-build/server/app/login.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
- package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
- package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.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 +5 -5
- package/app/.next-cli-build/server/chunks/1336.js +1 -1
- package/app/.next-cli-build/server/chunks/3104.js +1 -1
- package/app/.next-cli-build/server/chunks/3110.js +1 -1
- package/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/app/.next-cli-build/server/chunks/4803.js +1 -1
- package/app/.next-cli-build/server/chunks/5087.js +2 -7
- package/app/.next-cli-build/server/chunks/5901.js +324 -0
- package/app/.next-cli-build/server/chunks/6663.js +81 -0
- package/app/.next-cli-build/server/chunks/7130.js +1 -1
- package/app/.next-cli-build/server/chunks/7153.js +1 -1
- package/app/.next-cli-build/server/chunks/7774.js +2 -2
- package/app/.next-cli-build/server/chunks/7795.js +3 -3
- package/app/.next-cli-build/server/chunks/7965.js +1 -1
- package/app/.next-cli-build/server/chunks/8520.js +1 -1
- package/app/.next-cli-build/server/chunks/8895.js +2 -2
- package/app/.next-cli-build/server/chunks/9489.js +1 -1
- package/app/.next-cli-build/server/instrumentation.js +1 -1
- package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/app/.next-cli-build/server/middleware.js +3 -3
- package/app/.next-cli-build/server/pages/404.html +1 -1
- package/app/.next-cli-build/server/pages/500.html +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
- package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
- package/app/.next-cli-build/static/chunks/{1321-564f99250d5a1d60.js → 1321-f73e2c097d3f4ccd.js} +1 -1
- package/app/.next-cli-build/static/chunks/{3794-e569667691edc8f7.js → 3794-cef5038dc7aa126a.js} +1 -1
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/page-934d379227a4f904.js +5 -0
- package/app/.next-cli-build/static/chunks/{main-eb1b86e4183e86c5.js → main-80a34745801ef1a2.js} +1 -1
- package/app/.next-cli-build/static/css/bc846ce9f2e39ab3.css +1 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-1.0.130-to-1.0.132-1.0.132-20260610-073234/data.sqlite +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-1.0.132-to-2.0.3-2.0.3-20260610-214911/data.sqlite +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
- package/app/cli/.build-home/AppData/Roaming/bluerouter/jwt-secret +1 -1
- package/app/cli/.build-home/AppData/Roaming/bluerouter/machine-id +1 -1
- package/app/cli/.build-home/AppData/Roaming/nextjs-nodejs/Config/config.json +3 -3
- package/app/node_modules/@next/env/package.json +2 -2
- package/app/node_modules/baseline-browser-mapping/dist/index.cjs +1 -1
- package/app/node_modules/baseline-browser-mapping/package.json +1 -1
- package/app/node_modules/next/dist/build/swc/index.js +1 -1
- package/app/node_modules/next/dist/build/webpack-config.js +3 -3
- package/app/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/app/node_modules/next/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/app/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/app/node_modules/next/dist/server/config.js +1 -1
- package/app/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/app/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/app/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/app/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/app/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/app/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/app/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/app/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/app/node_modules/next/package.json +15 -15
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/package.json +1 -1
- package/app/.next-cli-build/server/chunks/7197.js +0 -162
- package/app/.next-cli-build/server/chunks/7242.js +0 -81
- package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/page-e8c135fbc0946eab.js +0 -4
- package/app/.next-cli-build/static/css/61fb9d1cb80a8d71.css +0 -1
- /package/app/.next-cli-build/static/{sROuCBBQq9L0b6sYTF2E5 → uVtAwUcxEGxatUurE5gNz}/_buildManifest.js +0 -0
- /package/app/.next-cli-build/static/{sROuCBBQq9L0b6sYTF2E5 → uVtAwUcxEGxatUurE5gNz}/_ssgManifest.js +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.133-to-1.0.134-1.0.134-20260610-122326 → upgrade-1.0.127-to-1.0.128-1.0.128-20260610-004736}/data.sqlite +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.134-to-1.0.135-1.0.135-20260610-122700 → upgrade-1.0.128-to-1.0.129-1.0.129-20260610-072001}/data.sqlite +0 -0
- /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.135-to-2.0.1-2.0.1-20260610-123810 → upgrade-1.0.129-to-1.0.130-1.0.130-20260610-072327}/data.sqlite +0 -0
|
@@ -6,4 +6,4 @@ PRAGMA mmap_size = 30000000;
|
|
|
6
6
|
PRAGMA cache_size = -64000;
|
|
7
7
|
PRAGMA foreign_keys = ON;
|
|
8
8
|
PRAGMA busy_timeout = 5000;
|
|
9
|
-
`,e={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",allowedModels:"TEXT DEFAULT '[]'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)","CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)","CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyId:"TEXT",apiKeyFingerprint:"TEXT",apiKeyName:"TEXT",apiKeyOwner:"TEXT",endpoint:"TEXT",requestId:"TEXT",sessionId:"TEXT",clientIp:"TEXT",clientIpNormalized:"TEXT",clientHost:"TEXT",clientUserAgent:"TEXT",sourceTool:"TEXT",sourceToolLabel:"TEXT",sourceHost:"TEXT",latencyMs:"INTEGER DEFAULT 0",ttftMs:"INTEGER DEFAULT 0",statusCode:"INTEGER",errorCode:"TEXT",errorType:"TEXT",errorMessageShort:"TEXT",isStreaming:"INTEGER DEFAULT 0",isCombo:"INTEGER DEFAULT 0",comboName:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_status ON usageHistory(timestamp DESC, status)","CREATE INDEX IF NOT EXISTS idx_uh_ts_provider ON usageHistory(timestamp DESC, provider)","CREATE INDEX IF NOT EXISTS idx_uh_ts_model ON usageHistory(timestamp DESC, model)","CREATE INDEX IF NOT EXISTS idx_uh_ts_conn ON usageHistory(timestamp DESC, connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_endpoint ON usageHistory(timestamp DESC, endpoint)","CREATE INDEX IF NOT EXISTS idx_uh_ts_apikey ON usageHistory(timestamp DESC, apiKey)","CREATE INDEX IF NOT EXISTS idx_uh_provider_model_ts ON usageHistory(provider, model, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_ts ON usageHistory(status, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_endpoint_ts ON usageHistory(endpoint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_ts ON usageHistory(apiKey, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_conn_ts ON usageHistory(connectionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_request_id ON usageHistory(requestId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_id_ts ON usageHistory(apiKeyId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_fp_ts ON usageHistory(apiKeyFingerprint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_ip_ts ON usageHistory(clientIpNormalized, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_tool_ts ON usageHistory(sourceTool, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_session_ts ON usageHistory(sessionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_code_ts ON usageHistory(statusCode, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_error_type_ts ON usageHistory(errorType, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_latency_ts ON usageHistory(timestamp DESC, latencyMs)","CREATE INDEX IF NOT EXISTS idx_uh_combo_ts ON usageHistory(isCombo, comboName, timestamp DESC)"]},usageHourlyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_uhr_dim_bucket ON usageHourlyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_uhr_bucket ON usageHourlyRollup(bucket DESC)"]},usageDailyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_udr_dim_bucket ON usageDailyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_udr_bucket ON usageDailyRollup(bucket DESC)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function f(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},54803:(a,b,c)=>{c.d(b,{createNodeSqliteAdapter:()=>e});var d=c(34050);async function e(a){let b=process.emit;process.emit=function(a,c,...d){return!("warning"===a&&c?.name==="ExperimentalWarning"&&/SQLite/i.test(c.message||""))&&b.call(process,a,c,...d)};let e=new(await Promise.resolve().then(c.t.bind(c,
|
|
9
|
+
`,e={_meta:{columns:{key:"TEXT PRIMARY KEY",value:"TEXT NOT NULL"}},settings:{columns:{id:"INTEGER PRIMARY KEY CHECK (id = 1)",data:"TEXT NOT NULL"}},providerConnections:{columns:{id:"TEXT PRIMARY KEY",provider:"TEXT NOT NULL",authType:"TEXT NOT NULL",name:"TEXT",email:"TEXT",priority:"INTEGER",isActive:"INTEGER DEFAULT 1",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pc_provider ON providerConnections(provider)","CREATE INDEX IF NOT EXISTS idx_pc_provider_active ON providerConnections(provider, isActive)","CREATE INDEX IF NOT EXISTS idx_pc_priority ON providerConnections(provider, priority)"]},providerNodes:{columns:{id:"TEXT PRIMARY KEY",type:"TEXT",name:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pn_type ON providerNodes(type)"]},proxyPools:{columns:{id:"TEXT PRIMARY KEY",isActive:"INTEGER DEFAULT 1",testStatus:"TEXT",data:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_pp_active ON proxyPools(isActive)","CREATE INDEX IF NOT EXISTS idx_pp_status ON proxyPools(testStatus)"]},apiKeys:{columns:{id:"TEXT PRIMARY KEY",key:"TEXT UNIQUE NOT NULL",name:"TEXT",machineId:"TEXT",isActive:"INTEGER DEFAULT 1",allowedModels:"TEXT DEFAULT '[]'",ownerUser:"TEXT DEFAULT ''",createdByUser:"TEXT DEFAULT ''",createdAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_ak_key ON apiKeys(key)","CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)","CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)"]},combos:{columns:{id:"TEXT PRIMARY KEY",name:"TEXT UNIQUE NOT NULL",kind:"TEXT",models:"TEXT NOT NULL",createdAt:"TEXT NOT NULL",updatedAt:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_combo_name ON combos(name)"]},kv:{columns:{scope:"TEXT NOT NULL",key:"TEXT NOT NULL",value:"TEXT NOT NULL"},primaryKey:"PRIMARY KEY (scope, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_kv_scope ON kv(scope)"]},usageHistory:{columns:{id:"INTEGER PRIMARY KEY AUTOINCREMENT",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",apiKey:"TEXT",apiKeyId:"TEXT",apiKeyFingerprint:"TEXT",apiKeyName:"TEXT",apiKeyOwner:"TEXT",endpoint:"TEXT",requestId:"TEXT",sessionId:"TEXT",clientIp:"TEXT",clientIpNormalized:"TEXT",clientHost:"TEXT",clientUserAgent:"TEXT",sourceTool:"TEXT",sourceToolLabel:"TEXT",sourceHost:"TEXT",latencyMs:"INTEGER DEFAULT 0",ttftMs:"INTEGER DEFAULT 0",statusCode:"INTEGER",errorCode:"TEXT",errorType:"TEXT",errorMessageShort:"TEXT",isStreaming:"INTEGER DEFAULT 0",isCombo:"INTEGER DEFAULT 0",comboName:"TEXT",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",status:"TEXT",tokens:"TEXT",meta:"TEXT"},indexes:["CREATE INDEX IF NOT EXISTS idx_uh_ts ON usageHistory(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_provider ON usageHistory(provider)","CREATE INDEX IF NOT EXISTS idx_uh_model ON usageHistory(model)","CREATE INDEX IF NOT EXISTS idx_uh_conn ON usageHistory(connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_status ON usageHistory(timestamp DESC, status)","CREATE INDEX IF NOT EXISTS idx_uh_ts_provider ON usageHistory(timestamp DESC, provider)","CREATE INDEX IF NOT EXISTS idx_uh_ts_model ON usageHistory(timestamp DESC, model)","CREATE INDEX IF NOT EXISTS idx_uh_ts_conn ON usageHistory(timestamp DESC, connectionId)","CREATE INDEX IF NOT EXISTS idx_uh_ts_endpoint ON usageHistory(timestamp DESC, endpoint)","CREATE INDEX IF NOT EXISTS idx_uh_ts_apikey ON usageHistory(timestamp DESC, apiKey)","CREATE INDEX IF NOT EXISTS idx_uh_provider_model_ts ON usageHistory(provider, model, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_ts ON usageHistory(status, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_endpoint_ts ON usageHistory(endpoint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_ts ON usageHistory(apiKey, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_conn_ts ON usageHistory(connectionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_request_id ON usageHistory(requestId)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_id_ts ON usageHistory(apiKeyId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_apikey_fp_ts ON usageHistory(apiKeyFingerprint, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_ip_ts ON usageHistory(clientIpNormalized, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_tool_ts ON usageHistory(sourceTool, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_session_ts ON usageHistory(sessionId, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_status_code_ts ON usageHistory(statusCode, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_error_type_ts ON usageHistory(errorType, timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_uh_latency_ts ON usageHistory(timestamp DESC, latencyMs)","CREATE INDEX IF NOT EXISTS idx_uh_combo_ts ON usageHistory(isCombo, comboName, timestamp DESC)"]},usageHourlyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_uhr_dim_bucket ON usageHourlyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_uhr_bucket ON usageHourlyRollup(bucket DESC)"]},usageDailyRollup:{columns:{bucket:"TEXT NOT NULL",dimension:"TEXT NOT NULL",key:"TEXT NOT NULL",requests:"INTEGER DEFAULT 0",success:"INTEGER DEFAULT 0",errors:"INTEGER DEFAULT 0",promptTokens:"INTEGER DEFAULT 0",completionTokens:"INTEGER DEFAULT 0",totalTokens:"INTEGER DEFAULT 0",cachedTokens:"INTEGER DEFAULT 0",reasoningTokens:"INTEGER DEFAULT 0",cost:"REAL DEFAULT 0",lastSeen:"TEXT"},primaryKey:"PRIMARY KEY (bucket, dimension, key)",indexes:["CREATE INDEX IF NOT EXISTS idx_udr_dim_bucket ON usageDailyRollup(dimension, bucket DESC)","CREATE INDEX IF NOT EXISTS idx_udr_bucket ON usageDailyRollup(bucket DESC)"]},usageDaily:{columns:{dateKey:"TEXT PRIMARY KEY",data:"TEXT NOT NULL"}},requestDetails:{columns:{id:"TEXT PRIMARY KEY",timestamp:"TEXT NOT NULL",provider:"TEXT",model:"TEXT",connectionId:"TEXT",status:"TEXT",data:"TEXT NOT NULL"},indexes:["CREATE INDEX IF NOT EXISTS idx_rd_ts ON requestDetails(timestamp DESC)","CREATE INDEX IF NOT EXISTS idx_rd_provider ON requestDetails(provider)","CREATE INDEX IF NOT EXISTS idx_rd_model ON requestDetails(model)","CREATE INDEX IF NOT EXISTS idx_rd_conn ON requestDetails(connectionId)"]}};function f(a,b){let c=Object.entries(b.columns).map(([a,b])=>`${a} ${b}`);return b.primaryKey&&c.push(b.primaryKey),`CREATE TABLE IF NOT EXISTS ${a} (${c.join(", ")})`}},54803:(a,b,c)=>{c.d(b,{createNodeSqliteAdapter:()=>e});var d=c(34050);async function e(a){let b=process.emit;process.emit=function(a,c,...d){return!("warning"===a&&c?.name==="ExperimentalWarning"&&/SQLite/i.test(c.message||""))&&b.call(process,a,c,...d)};let e=new(await Promise.resolve().then(c.t.bind(c,80099,23))).DatabaseSync(a);e.exec(d.oG);let f=new Map;function g(a){let b=f.get(a);return b||(b=e.prepare(a),f.set(a,b)),b}let h=setInterval(()=>{try{e.exec("PRAGMA wal_checkpoint(TRUNCATE)")}catch{}},6e4);function i(){try{e.exec("PRAGMA wal_checkpoint(TRUNCATE)")}catch{}try{f.clear()}catch{}try{e.close()}catch{}}"function"==typeof h.unref&&h.unref();let j=()=>i();return process.once("beforeExit",j),process.once("SIGINT",()=>{j(),process.exit(0)}),process.once("SIGTERM",()=>{j(),process.exit(0)}),{driver:"node:sqlite",run(a,b=[]){let c=g(a).run(...b);return{changes:Number(c.changes??0),lastInsertRowid:Number(c.lastInsertRowid??0)}},get:(a,b=[])=>g(a).get(...b),all:(a,b=[])=>g(a).all(...b),exec:a=>e.exec(a),transaction(a){let b=`sp_${Math.random().toString(36).slice(2)}`;e.exec(`SAVEPOINT ${b}`);try{let c=a();return e.exec(`RELEASE ${b}`),c}catch(a){try{e.exec(`ROLLBACK TO ${b}`),e.exec(`RELEASE ${b}`)}catch{}throw a}},checkpoint(){try{e.exec("PRAGMA wal_checkpoint(TRUNCATE)")}catch{}},close(){clearInterval(h),i()},raw:e}}}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=5087,exports.ids=[5087],exports.modules={644:(a,b,c)=>{"use strict";function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},5781:(a,b,c)=>{"use strict";c.d(b,{Mc:()=>k,fK:()=>o,getProviderConnections:()=>j,iE:()=>m,op:()=>p,rj:()=>n});var d=c(94755),e=c(36366),f=c(644);let g=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","errorCode","consecutiveUseCount","schedule","healthCheck","healthStatus","healthConsecutiveFailures","healthConsecutiveSuccesses","healthLastCheckedAt","healthLastOkAt","healthLastError","healthLastLatencyMs","healthLastRecoveredAt"];function h(a){return a?{...(0,f.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||!0===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function i(a,b){let c=function(a){let{id:b,provider:c,authType:d,name:e,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=a;return{id:b,provider:c,authType:d,name:e??null,email:g??null,priority:h??null,isActive:+(!1!==i),data:(0,f.s)(l),createdAt:j,updatedAt:k}}(b);a.run(`INSERT INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt)
|
|
1
|
+
exports.id=5087,exports.ids=[5087],exports.modules={490:(a,b,c)=>{"use strict";c.d(b,{KS:()=>q,Tr:()=>m,bh:()=>s,eC:()=>r,jQ:()=>k});let d=new Map,e=Object.freeze({enabled:!0,requestsPerMinute:60,requestsPerHour:0,requestsPerDay:0,promptCharsMax:12e4,maxCompletionTokens:4096,allowTools:!0,maxTools:16,allowedEndpoints:["/v1/chat/completions"],allowedIpCidrs:[],expiresAt:""}),f=new Set(Object.keys(e));function g(a,b=0){let c=Number(a);return Number.isFinite(c)?Math.max(0,Math.floor(c)):b}function h(a,b=!0){if(null==a||""===a)return b;if("boolean"==typeof a)return a;if("number"==typeof a)return 0!==a;let c=String(a).trim().toLowerCase();return!["false","0","no","off"].includes(c)&&(!!["true","1","yes","on"].includes(c)||b)}function i(a){return Array.isArray(a)?[...new Set(a.map(a=>String(a||"").trim()).filter(Boolean))]:[]}function j(a){return!(!a||"object"!=typeof a||Array.isArray(a))&&Object.keys(a).some(a=>f.has(a))}function k(a={}){if(!j(a))return{};let b=a&&"object"==typeof a&&!Array.isArray(a)?a:{};return{enabled:h(b.enabled,e.enabled),requestsPerMinute:g(b.requestsPerMinute,0),requestsPerHour:g(b.requestsPerHour,0),requestsPerDay:g(b.requestsPerDay,0),promptCharsMax:g(b.promptCharsMax,0),maxCompletionTokens:g(b.maxCompletionTokens,0),allowTools:h(b.allowTools,e.allowTools),maxTools:g(b.maxTools,0),allowedEndpoints:i(b.allowedEndpoints),allowedIpCidrs:i(b.allowedIpCidrs),expiresAt:String(b.expiresAt||"").trim()}}function l(a){let b=k(a?.limits||{});return j(b)&&!1!==b.enabled?b:null}function m(a){let b=a?.headers?.get?.("Authorization")||"";return b.startsWith("Bearer ")?b.slice(7).trim():a?.headers?.get?.("x-api-key")?.trim()||null}function n(a,b){return a?.headers?.get?.(b)||a?.headers?.get?.(b.toLowerCase())||""}function o(a){let b=String(a||"").trim().split(".");if(4!==b.length)return null;let c=0;for(let a of b){if(!/^\d+$/.test(a))return null;let b=Number(a);if(b<0||b>255)return null;c=(c<<8)+b}return c>>>0}function p(a){if(null==a)return 0;if("string"==typeof a)return a.length;if("number"==typeof a||"boolean"==typeof a)return String(a).length;if(Array.isArray(a))return a.reduce((a,b)=>a+p(b),0);if("object"==typeof a){let b=0;for(let[c,d]of Object.entries(a))b+=String(c).length,b+=p(d);return b}return String(a).length}function q({request:a,keyRecord:b,body:c,endpoint:e}){let f=l(b);if(!f)return{ok:!0,applied:!1};if(!function(a){let b=String(a||"").trim();if(!b)return!0;let c=Date.parse(b);return!Number.isFinite(c)||Date.now()<=c}(f.expiresAt))return{ok:!1,status:403,message:"API key đ\xe3 hết hạn theo policy."};if(!function(a,b){let c=i(b);if(0===c.length)return!0;let d=String(a||"").trim()||"/";return c.some(a=>{let b=String(a||"").trim();return!!b&&("*"===b||d===b||d.startsWith(b.endsWith("/")?b:`${b}/`))})}(e,f.allowedEndpoints))return{ok:!1,status:403,message:"API key kh\xf4ng được ph\xe9p gọi endpoint n\xe0y."};if(!function(a,b){let c,d=i(b);if(0===d.length)return!0;let e=(c=n(a,"x-forwarded-for"))?c.split(",")[0].trim():(n(a,"x-real-ip")||n(a,"cf-connecting-ip")||n(a,"x-client-ip")||"").trim();return!!e&&d.some(a=>(function(a,b){let c=String(b||"").trim();if(!c)return!1;if(!c.includes("/"))return a===c;let[d,e]=c.split("/"),f=Number(e);if(!Number.isInteger(f)||f<0||f>32)return!1;let g=o(a),h=o(d);if(null===g||null===h)return!1;let i=0===f?0:0xffffffff<<32-f>>>0;return(g&i)==(h&i)})(e,a))}(a,f.allowedIpCidrs))return{ok:!1,status:403,message:"API key kh\xf4ng được ph\xe9p gọi từ IP hiện tại."};let h=g(f.promptCharsMax,0);if(h>0){let a=function(a={}){return p(a.messages||[])+p(a.prompt||"")+p(a.input||"")}(c);if(a>h)return{ok:!1,status:413,message:`Prompt qu\xe1 d\xe0i: ${a} chars, giới hạn của API key l\xe0 ${h} chars.`}}let j=function(a={}){return(Array.isArray(a.tools)?a.tools.length:0)+(Array.isArray(a.functions)?a.functions.length:0)}(c);if(j>0&&!1===f.allowTools)return{ok:!1,status:403,message:"API key n\xe0y kh\xf4ng được ph\xe9p d\xf9ng tools/functions."};let k=g(f.maxTools,0);if(k>0&&j>k)return{ok:!1,status:413,message:`Request c\xf3 ${j} tools/functions, vượt giới hạn ${k} của API key.`};let m=function({keyId:a,policy:b,now:c=Date.now()}){for(let[e,f,h]of[["minute",b.requestsPerMinute,6e4],["hour",b.requestsPerHour,36e5],["day",b.requestsPerDay,864e5]]){let b=g(f,0);if(b<=0)continue;let i=Math.floor(c/h)*h,j=`${a}:${e}:${i}`,k=d.get(j)||0;if(k>=b){let a=Math.max(1,Math.ceil((i+h-c)/1e3));return{ok:!1,status:429,message:`API key vượt giới hạn ${b} request/${e}. Thử lại sau ${a}s.`,headers:{"Retry-After":String(a)}}}d.set(j,k+1)}if(d.size>2e4){let a=c-1728e5;for(let b of d.keys()){let c=Number(b.split(":").pop());Number.isFinite(c)&&c<a&&d.delete(b)}}return{ok:!0}}({keyId:b?.id||b?.key||"unknown",policy:f});return m.ok?{ok:!0,applied:!0}:m}function r(a={},b){let c=l(b);if(!c)return a;let d=g(c.maxCompletionTokens,0);if(d>0){let b=a.max_tokens??a.max_completion_tokens,c=Math.min((null==b?d:g(b,d))||d,d);a.max_tokens=c,Object.prototype.hasOwnProperty.call(a,"max_completion_tokens")&&(a.max_completion_tokens=c)}return a}function s(a){let b={"Access-Control-Allow-Origin":"*","Content-Type":"application/json",...a?.headers||{}};return new Response(JSON.stringify({error:{message:a?.message||"API key policy rejected this request.",type:"api_key_policy_error"}}),{status:a?.status||403,headers:b})}},644:(a,b,c)=>{"use strict";function d(a,b=null){if(null==a)return b;if("string"!=typeof a)return a;try{return JSON.parse(a)}catch{return b}}function e(a){return JSON.stringify(a??null)}c.d(b,{q:()=>d,s:()=>e})},5781:(a,b,c)=>{"use strict";c.d(b,{Mc:()=>k,fK:()=>o,getProviderConnections:()=>j,iE:()=>m,op:()=>p,rj:()=>n});var d=c(94755),e=c(36366),f=c(644);let g=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","errorCode","consecutiveUseCount","schedule","healthCheck","healthStatus","healthConsecutiveFailures","healthConsecutiveSuccesses","healthLastCheckedAt","healthLastOkAt","healthLastError","healthLastLatencyMs","healthLastRecoveredAt"];function h(a){return a?{...(0,f.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||!0===a.isActive,createdAt:a.createdAt,updatedAt:a.updatedAt}:null}function i(a,b){let c=function(a){let{id:b,provider:c,authType:d,name:e,email:g,priority:h,isActive:i,createdAt:j,updatedAt:k,...l}=a;return{id:b,provider:c,authType:d,name:e??null,email:g??null,priority:h??null,isActive:+(!1!==i),data:(0,f.s)(l),createdAt:j,updatedAt:k}}(b);a.run(`INSERT INTO providerConnections(id, provider, authType, name, email, priority, isActive, data, createdAt, updatedAt)
|
|
2
2
|
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
3
3
|
ON CONFLICT(id) DO UPDATE SET
|
|
4
4
|
provider=excluded.provider, authType=excluded.authType, name=excluded.name,
|
|
@@ -16,12 +16,7 @@ exports.id=5087,exports.ids=[5087],exports.modules={644:(a,b,c)=>{"use strict";f
|
|
|
16
16
|
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)
|
|
17
17
|
VALUES(?, ?, ?, ?, ?, ?)`,[a,+(!1!==d),f||"unknown",(0,e.s)(i),g||new Date().toISOString(),h||new Date().toISOString()])}for(let c of a.apiKeys||[])b.run(`INSERT OR REPLACE INTO apiKeys(id, key, name, machineId, isActive, createdAt, allowedModels)
|
|
18
18
|
VALUES(?, ?, ?, ?, ?, ?, ?)`,[c.id,c.key,c.name||null,c.machineId||null,+(!1!==c.isActive),c.createdAt||new Date().toISOString(),(0,e.s)(Array.isArray(c.allowedModels)?c.allowedModels:[])]);for(let c of a.combos||[])b.run(`INSERT OR REPLACE INTO combos(id, name, kind, models, createdAt, updatedAt)
|
|
19
|
-
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||{})])}),await W()}process.off("beforeExit",V),process.off("SIGINT",V),process.off("SIGTERM",V),process.off("exit",V),process.on("beforeExit",V),process.on("SIGINT",V),process.on("SIGTERM",V),process.on("exit",V)},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.d(b,{Iq:()=>
|
|
20
|
-
WHERE lower(coalesce(ownerUser, '')) = ? OR lower(coalesce(createdByUser, '')) = ?
|
|
21
|
-
ORDER BY createdAt ASC`,[c,c]).map(j):b.all("SELECT * FROM apiKeys ORDER BY createdAt ASC").map(j)}async function l(a){let b=await (0,e.c)();return await i(b),j(b.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}async function m(a){if(!a)return null;let b=await (0,e.c)();return await i(b),j(b.get("SELECT * FROM apiKeys WHERE key = ?",[a]))}async function n(a,b,j={}){if(!b)throw Error("machineId is required");let k=await (0,e.c)();await i(k);let{generateApiKeyWithMachine:l}=await c.e(6844).then(c.bind(c,86844)),m=l(b),o=h(j.ownerUser||j.createdByUser),p=h(j.createdByUser||o),q={id:(0,d.A)(),name:a,key:m.key,machineId:b,isActive:!0,allowedModels:g(j.allowedModels),ownerUser:o,createdByUser:p,createdAt:new Date().toISOString()};return k.run(`INSERT INTO apiKeys(id, key, name, machineId, isActive, allowedModels, ownerUser, createdByUser, createdAt)
|
|
22
|
-
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)`,[q.id,q.key,q.name,q.machineId,1,(0,f.s)(q.allowedModels),q.ownerUser,q.createdByUser,q.createdAt]),q}async function o(a,b={}){let c=await (0,e.c)();await i(c);let d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let i={...j(e),...b};Object.prototype.hasOwnProperty.call(b,"allowedModels")&&(i.allowedModels=g(b.allowedModels)),Object.prototype.hasOwnProperty.call(b,"ownerUser")&&(i.ownerUser=h(b.ownerUser)),Object.prototype.hasOwnProperty.call(b,"createdByUser")&&(i.createdByUser=h(b.createdByUser)),c.run(`UPDATE apiKeys
|
|
23
|
-
SET key = ?, name = ?, machineId = ?, isActive = ?, allowedModels = ?, ownerUser = ?, createdByUser = ?
|
|
24
|
-
WHERE id = ?`,[i.key,i.name,i.machineId,+!!i.isActive,(0,f.s)(i.allowedModels||[]),i.ownerUser||"",i.createdByUser||"",a]),d=i}),d}async function p(a){let b=await (0,e.c)();await i(b);let c=b.run("DELETE FROM apiKeys WHERE id = ?",[a]);return(c?.changes??0)>0}async function q(a){let b=await (0,e.c)();await i(b);let c=b.get("SELECT isActive FROM apiKeys WHERE key = ?",[a]);return!!c&&(1===c.isActive||!0===c.isActive)}},78335:()=>{},95658:(a,b,c)=>{"use strict";c.d(b,{AL:()=>j,HG:()=>i,Jh:()=>m,KQ:()=>k,Or:()=>l});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(49120);let i=e().join(h.DATA_DIR,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.DATA_DIR,"db.json"),usage:e().join(h.DATA_DIR,"usage.json"),disabled:e().join(h.DATA_DIR,"disabledModels.json"),details:e().join(h.DATA_DIR,"request-details.json")};function m(){for(let a of[h.DATA_DIR,i,k])g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},96487:()=>{},97914:(a,b,c)=>{"use strict";c.d(b,{KJ:()=>l,VT:()=>n,getPricingForModel:()=>k,r4:()=>j,yF:()=>m});var d=c(36366),e=c(644);let f=(0,c(22846).U)("pricing"),g={value:null,expiresAt:0};function h(){g={value:null,expiresAt:0}}async function i(){return await f.getAll()}async function j(){let a=Date.now();if(g.value&&g.expiresAt>a)return g.value;let b=await i(),{PROVIDER_PRICING:d}=await c.e(7341).then(c.bind(c,57341)),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}async function k(a,b){if(!b)return null;let d=await i();if(a&&d[a]?.[b])return d[a][b];let{getPricingForModel:e}=await c.e(7341).then(c.bind(c,57341));return e(a,b)}async function l(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)])}}),h(),await i()}async function m(a,b){if(!a)return await i();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)])}),h(),await i()}async function n(){return await f.clear(),h(),{}}},99703:(a,b,c)=>{"use strict";c.d(b,{BY:()=>C,E5:()=>E,Py:()=>A,Zx:()=>F,_V:()=>l,j$:()=>D,rg:()=>z,sZ:()=>B,uw:()=>y});var d=c(94735),e=c(36366),f=c(644);c(62674);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0});let g=global._pendingRequests,h=global._lastErrorProvider,i=global._pendingTimers,j=global._recentRing,k=global._connectionMapCache,l=global._statsEmitter;function m(a){return String(a||"").trim()}function n(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function o(a){let b=m(a);return b?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key"}function p(a,b){let c=m(a).toLowerCase(),d=Number(b);return c||(Number.isFinite(d)&&d>=200&&d<300?"ok":Number.isFinite(d)&&d>=400?"error":"ok")}function q(a,b){let c=Number(b);if(Number.isFinite(c))return c>=200&&c<300;let d=p(a);return!!["ok","success","succeeded","complete","completed","done","200"].includes(d)||/^2\d\d$/.test(d)}function r(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 s(a,b,c){b&&(a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta))}async function t(){if(Date.now()-k.ts<3e4)return k.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;k.map=d,k.ts=Date.now()}catch{}return k.map}async function u(){if(!j.initialized){j.initialized=!0;try{j.items=(await (0,e.c)()).all(`SELECT timestamp, provider, model, connectionId, apiKey, apiKeyFingerprint, endpoint, cost, status, statusCode, tokens
|
|
19
|
+
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||{})])}),await W()}process.off("beforeExit",V),process.off("SIGINT",V),process.off("SIGTERM",V),process.off("exit",V),process.on("beforeExit",V),process.on("SIGINT",V),process.on("SIGTERM",V),process.on("exit",V)},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.d(b,{Iq:()=>o,Lh:()=>q,PX:()=>l,XW:()=>p,ek:()=>r,getApiKeyByKey:()=>n,yg:()=>m});var d=c(94755),e=c(36366),f=c(644),g=c(490);function h(a){return Array.isArray(a)?[...new Set(a.map(a=>String(a||"").trim()).filter(Boolean))]:[]}function i(a){return String(a||"").trim().toLowerCase()}async function j(a){try{let b=a.all("PRAGMA table_info(apiKeys)"),c=new Set(b.map(a=>a.name));c.has("allowedModels")||a.run("ALTER TABLE apiKeys ADD COLUMN allowedModels TEXT DEFAULT '[]'"),c.has("limits")||a.run("ALTER TABLE apiKeys ADD COLUMN limits TEXT DEFAULT '{}'"),c.has("ownerUser")||a.run("ALTER TABLE apiKeys ADD COLUMN ownerUser TEXT DEFAULT ''"),c.has("createdByUser")||a.run("ALTER TABLE apiKeys ADD COLUMN createdByUser TEXT DEFAULT ''");try{a.run("CREATE INDEX IF NOT EXISTS idx_ak_owner ON apiKeys(ownerUser)"),a.run("CREATE INDEX IF NOT EXISTS idx_ak_created_by ON apiKeys(createdByUser)")}catch{}}catch(a){console.log("Could not ensure apiKeys columns:",a?.message||a)}}function k(a){return a?{id:a.id,key:a.key,name:a.name,machineId:a.machineId,isActive:1===a.isActive||!0===a.isActive,allowedModels:h((0,f.q)(a.allowedModels,[])),limits:(0,g.jQ)((0,f.q)(a.limits,{})),ownerUser:i(a.ownerUser),createdByUser:i(a.createdByUser),createdAt:a.createdAt}:null}async function l(a={}){let b=await (0,e.c)();await j(b);let c=i(a.ownerUser);return c?b.all("SELECT * FROM apiKeys WHERE lower(coalesce(ownerUser, '')) = ? OR lower(coalesce(createdByUser, '')) = ? ORDER BY createdAt ASC",[c,c]).map(k):b.all("SELECT * FROM apiKeys ORDER BY createdAt ASC").map(k)}async function m(a){let b=await (0,e.c)();return await j(b),k(b.get("SELECT * FROM apiKeys WHERE id = ?",[a]))}async function n(a){if(!a)return null;let b=await (0,e.c)();return await j(b),k(b.get("SELECT * FROM apiKeys WHERE key = ?",[a]))}async function o(a,b,k={}){if(!b)throw Error("machineId is required");let l=await (0,e.c)();await j(l);let{generateApiKeyWithMachine:m}=await c.e(6844).then(c.bind(c,86844)),n=m(b),p=i(k.ownerUser||k.createdByUser),q=i(k.createdByUser||p),r={id:(0,d.A)(),name:a,key:n.key,machineId:b,isActive:!0,allowedModels:h(k.allowedModels),limits:(0,g.jQ)(k.limits||{}),ownerUser:p,createdByUser:q,createdAt:new Date().toISOString()};return l.run("INSERT INTO apiKeys(id, key, name, machineId, isActive, allowedModels, limits, ownerUser, createdByUser, createdAt) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",[r.id,r.key,r.name,r.machineId,1,(0,f.s)(r.allowedModels),(0,f.s)(r.limits),r.ownerUser,r.createdByUser,r.createdAt]),r}async function p(a,b={}){let c=await (0,e.c)();await j(c);let d=null;return c.transaction(()=>{let e=c.get("SELECT * FROM apiKeys WHERE id = ?",[a]);if(!e)return;let j={...k(e),...b};Object.prototype.hasOwnProperty.call(b,"allowedModels")&&(j.allowedModels=h(b.allowedModels)),Object.prototype.hasOwnProperty.call(b,"limits")&&(j.limits=(0,g.jQ)(b.limits||{})),Object.prototype.hasOwnProperty.call(b,"ownerUser")&&(j.ownerUser=i(b.ownerUser)),Object.prototype.hasOwnProperty.call(b,"createdByUser")&&(j.createdByUser=i(b.createdByUser)),c.run("UPDATE apiKeys SET key = ?, name = ?, machineId = ?, isActive = ?, allowedModels = ?, limits = ?, ownerUser = ?, createdByUser = ? WHERE id = ?",[j.key,j.name,j.machineId,+!!j.isActive,(0,f.s)(j.allowedModels||[]),(0,f.s)(j.limits||{}),j.ownerUser||"",j.createdByUser||"",a]),d=j}),d}async function q(a){let b=await (0,e.c)();await j(b);let c=b.run("DELETE FROM apiKeys WHERE id = ?",[a]);return(c?.changes??0)>0}async function r(a){let b=await (0,e.c)();await j(b);let c=b.get("SELECT isActive FROM apiKeys WHERE key = ?",[a]);return!!c&&(1===c.isActive||!0===c.isActive)}},78335:()=>{},95658:(a,b,c)=>{"use strict";c.d(b,{AL:()=>j,HG:()=>i,Jh:()=>m,KQ:()=>k,Or:()=>l});var d=c(76760),e=c.n(d),f=c(73024),g=c.n(f),h=c(49120);let i=e().join(h.DATA_DIR,"db"),j=e().join(i,"data.sqlite"),k=e().join(i,"backups"),l={main:e().join(h.DATA_DIR,"db.json"),usage:e().join(h.DATA_DIR,"usage.json"),disabled:e().join(h.DATA_DIR,"disabledModels.json"),details:e().join(h.DATA_DIR,"request-details.json")};function m(){for(let a of[h.DATA_DIR,i,k])g().existsSync(a)||g().mkdirSync(a,{recursive:!0})}},96487:()=>{},97914:(a,b,c)=>{"use strict";c.d(b,{KJ:()=>l,VT:()=>n,getPricingForModel:()=>k,r4:()=>j,yF:()=>m});var d=c(36366),e=c(644);let f=(0,c(22846).U)("pricing"),g={value:null,expiresAt:0};function h(){g={value:null,expiresAt:0}}async function i(){return await f.getAll()}async function j(){let a=Date.now();if(g.value&&g.expiresAt>a)return g.value;let b=await i(),{PROVIDER_PRICING:d}=await c.e(7341).then(c.bind(c,57341)),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}async function k(a,b){if(!b)return null;let d=await i();if(a&&d[a]?.[b])return d[a][b];let{getPricingForModel:e}=await c.e(7341).then(c.bind(c,57341));return e(a,b)}async function l(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)])}}),h(),await i()}async function m(a,b){if(!a)return await i();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)])}),h(),await i()}async function n(){return await f.clear(),h(),{}}},99703:(a,b,c)=>{"use strict";c.d(b,{BY:()=>C,E5:()=>E,Py:()=>A,Zx:()=>F,_V:()=>l,j$:()=>D,rg:()=>z,sZ:()=>B,uw:()=>y});var d=c(94735),e=c(36366),f=c(644);c(62674);global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new d.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0});let g=global._pendingRequests,h=global._lastErrorProvider,i=global._pendingTimers,j=global._recentRing,k=global._connectionMapCache,l=global._statsEmitter;function m(a){return String(a||"").trim()}function n(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function o(a){let b=m(a);return b?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key"}function p(a,b){let c=m(a).toLowerCase(),d=Number(b);return c||(Number.isFinite(d)&&d>=200&&d<300?"ok":Number.isFinite(d)&&d>=400?"error":"ok")}function q(a,b){let c=Number(b);if(Number.isFinite(c))return c>=200&&c<300;let d=p(a);return!!["ok","success","succeeded","complete","completed","done","200"].includes(d)||/^2\d\d$/.test(d)}function r(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 s(a,b,c){b&&(a[b]||(a[b]={requests:0,promptTokens:0,completionTokens:0,cost:0}),a[b].requests+=c.requests||1,a[b].promptTokens+=c.promptTokens||0,a[b].completionTokens+=c.completionTokens||0,a[b].cost+=c.cost||0,c.meta&&Object.assign(a[b],c.meta))}async function t(){if(Date.now()-k.ts<3e4)return k.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;k.map=d,k.ts=Date.now()}catch{}return k.map}async function u(){if(!j.initialized){j.initialized=!0;try{j.items=(await (0,e.c)()).all(`SELECT timestamp, provider, model, connectionId, apiKey, apiKeyFingerprint, endpoint, cost, status, statusCode, tokens
|
|
25
20
|
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.apiKeyFingerprint||a.apiKey,endpoint:a.endpoint,cost:a.cost,status:a.status,statusCode:a.statusCode,tokens:(0,f.q)(a.tokens,{})}))}catch{}}}async function v(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 g=0,h=d.prompt_tokens||d.input_tokens||0,i=d.cached_tokens||d.cache_read_input_tokens||0,j=Math.max(0,h-i);g+=j*(f.input/1e6),i>0&&(g+=i*((f.cached||f.input)/1e6));let k=d.completion_tokens||d.output_tokens||0;g+=k*(f.output/1e6);let l=d.reasoning_tokens||0;l>0&&(g+=l*((f.reasoning||f.output)/1e6));let m=d.cache_creation_input_tokens||0;return m>0&&(g+=m*((f.cache_creation||f.input)/1e6)),g}catch(a){return console.error("Error calculating cost:",a),0}}async function w(a){let b=m(a);if(!b)return{apiKeyId:"",apiKeyFingerprint:"local-no-key",apiKeyName:"Local / kh\xf4ng d\xf9ng API key",apiKeyOwner:""};let d=o(b);try{let{getApiKeyByKey:a}=await Promise.resolve().then(c.bind(c,74452)),e=await a(b);if(e)return{apiKeyId:e.id||"",apiKeyFingerprint:d,apiKeyName:e.name||d,apiKeyOwner:e.ownerUser||e.createdByUser||""}}catch{}return{apiKeyId:"",apiKeyFingerprint:d,apiKeyName:d,apiKeyOwner:""}}function x(a,b,c,d,e,f,g){a.run(`INSERT INTO ${b}(
|
|
26
21
|
bucket, dimension, key, requests, success, errors, promptTokens, completionTokens,
|
|
27
22
|
totalTokens, cachedTokens, reasoningTokens, cost, lastSeen
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"use strict";exports.id=5901,exports.ids=[5901],exports.modules={35901:(a,b,c)=>{c.d(b,{Wl:()=>z,jk:()=>v});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(45903);let i=Number(process.env.REQUEST_ERROR_BODY_SNIPPET_CHARS||4096);function j(a){return String(a??"").trim()}function k(a){return j(a).toLowerCase()}function l(a,b=null){let c=Number(a);return Number.isFinite(c)?c:b}function m(a,b=1e3){let c=j(a).replace(/\s+/g," ");return c?c.length>b?`${c.slice(0,Math.max(0,b-1))}…`:c:""}function n(){return g().join(process.env.DATA_DIR||"/var/lib/bluerouter","logs","promptLogs.sqlite")}async function o(){let a=(0,h.I6)(await (0,h.L7)());return a.sqlitePath||(a.sqlitePath=n()),a}async function p(a){e().mkdirSync(g().dirname(a),{recursive:!0});try{let b=await Promise.resolve().then(c.t.bind(c,87550,23)),d=new(b.default||b)(a);return d.pragma("journal_mode = WAL"),d.pragma("busy_timeout = 5000"),{type:"sqlite",all:(a,b=[])=>d.prepare(a).all(...b),get:(a,b=[])=>d.prepare(a).get(...b),run:(a,b=[])=>d.prepare(a).run(...b),exec:a=>d.exec(a),close:()=>d.close()}}catch{let b=new(await Promise.resolve().then(c.t.bind(c,80099,23))).DatabaseSync(a);return b.exec("PRAGMA journal_mode = WAL"),b.exec("PRAGMA busy_timeout = 5000"),{type:"sqlite",all:(a,c=[])=>b.prepare(a).all(...c),get:(a,c=[])=>b.prepare(a).get(...c),run:(a,c=[])=>b.prepare(a).run(...c),exec:a=>b.exec(a),close:()=>b.close()}}}async function q(a){let b=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await b.connect(),{type:"postgres",query:async(a,c=[])=>(await b.query(a,c)).rows,queryOne:async(a,c=[])=>(await b.query(a,c)).rows[0]||null,exec:async a=>{await b.query(a)},close:async()=>{await b.end()}}}async function r(a){let b=await c.e(8491).then(c.t.bind(c,38491,19)),d=await b.createConnection({host:a.host,port:Number(a.port||3306),database:a.database,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,multipleStatements:!0,dateStrings:!0});return{type:"mysql",query:async(a,b=[])=>(await d.query(a,b))[0],queryOne:async(a,b=[])=>((await d.query(a,b))[0]||[])[0]||null,exec:async a=>{await d.query(a)},close:async()=>{await d.end()}}}async function s(a){if("sqlite"===a.type)return p(a.sqlitePath||n());if("postgres"===a.type)return q(a);if("mysql"===a.type)return r(a);throw Error(`Unsupported prompt log database type: ${a.type}`)}async function t(a){"sqlite"===a.type?a.exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS request_error_events (
|
|
3
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
|
+
created_at TEXT NOT NULL,
|
|
5
|
+
request_id TEXT,
|
|
6
|
+
attempt_index INTEGER DEFAULT 0,
|
|
7
|
+
provider TEXT,
|
|
8
|
+
model TEXT,
|
|
9
|
+
connection_id TEXT,
|
|
10
|
+
account_name TEXT,
|
|
11
|
+
endpoint TEXT,
|
|
12
|
+
gateway_status_code INTEGER,
|
|
13
|
+
upstream_status_code INTEGER,
|
|
14
|
+
status_class TEXT,
|
|
15
|
+
error_source TEXT,
|
|
16
|
+
error_type TEXT,
|
|
17
|
+
error_code TEXT,
|
|
18
|
+
error_message_short TEXT,
|
|
19
|
+
upstream_error_body_snippet TEXT,
|
|
20
|
+
upstream_request_id TEXT,
|
|
21
|
+
latency_ms INTEGER DEFAULT 0,
|
|
22
|
+
api_key_id TEXT,
|
|
23
|
+
api_key_fingerprint TEXT,
|
|
24
|
+
client_ip TEXT,
|
|
25
|
+
client_ip_normalized TEXT,
|
|
26
|
+
source_tool TEXT,
|
|
27
|
+
source_tool_label TEXT,
|
|
28
|
+
session_id TEXT,
|
|
29
|
+
meta_json TEXT
|
|
30
|
+
);
|
|
31
|
+
CREATE INDEX IF NOT EXISTS idx_ree_created_at ON request_error_events(created_at DESC);
|
|
32
|
+
CREATE INDEX IF NOT EXISTS idx_ree_request_id ON request_error_events(request_id);
|
|
33
|
+
CREATE INDEX IF NOT EXISTS idx_ree_gateway_status ON request_error_events(gateway_status_code, created_at DESC);
|
|
34
|
+
CREATE INDEX IF NOT EXISTS idx_ree_upstream_status ON request_error_events(upstream_status_code, created_at DESC);
|
|
35
|
+
CREATE INDEX IF NOT EXISTS idx_ree_error_type ON request_error_events(error_type, created_at DESC);
|
|
36
|
+
CREATE INDEX IF NOT EXISTS idx_ree_error_code ON request_error_events(error_code, created_at DESC);
|
|
37
|
+
CREATE INDEX IF NOT EXISTS idx_ree_error_source ON request_error_events(error_source, created_at DESC);
|
|
38
|
+
CREATE INDEX IF NOT EXISTS idx_ree_provider_model ON request_error_events(provider, model, created_at DESC);
|
|
39
|
+
CREATE INDEX IF NOT EXISTS idx_ree_connection ON request_error_events(connection_id, created_at DESC);
|
|
40
|
+
CREATE INDEX IF NOT EXISTS idx_ree_api_key ON request_error_events(api_key_id, created_at DESC);
|
|
41
|
+
CREATE INDEX IF NOT EXISTS idx_ree_api_fp ON request_error_events(api_key_fingerprint, created_at DESC);
|
|
42
|
+
CREATE INDEX IF NOT EXISTS idx_ree_client_ip ON request_error_events(client_ip_normalized, created_at DESC);
|
|
43
|
+
CREATE INDEX IF NOT EXISTS idx_ree_source_tool ON request_error_events(source_tool, created_at DESC);
|
|
44
|
+
CREATE INDEX IF NOT EXISTS idx_ree_session ON request_error_events(session_id, created_at DESC);
|
|
45
|
+
`):"postgres"===a.type?await a.exec(`
|
|
46
|
+
CREATE TABLE IF NOT EXISTS request_error_events (
|
|
47
|
+
id BIGSERIAL PRIMARY KEY,
|
|
48
|
+
created_at TIMESTAMPTZ NOT NULL,
|
|
49
|
+
request_id TEXT,
|
|
50
|
+
attempt_index INTEGER DEFAULT 0,
|
|
51
|
+
provider TEXT,
|
|
52
|
+
model TEXT,
|
|
53
|
+
connection_id TEXT,
|
|
54
|
+
account_name TEXT,
|
|
55
|
+
endpoint TEXT,
|
|
56
|
+
gateway_status_code INTEGER,
|
|
57
|
+
upstream_status_code INTEGER,
|
|
58
|
+
status_class TEXT,
|
|
59
|
+
error_source TEXT,
|
|
60
|
+
error_type TEXT,
|
|
61
|
+
error_code TEXT,
|
|
62
|
+
error_message_short TEXT,
|
|
63
|
+
upstream_error_body_snippet TEXT,
|
|
64
|
+
upstream_request_id TEXT,
|
|
65
|
+
latency_ms INTEGER DEFAULT 0,
|
|
66
|
+
api_key_id TEXT,
|
|
67
|
+
api_key_fingerprint TEXT,
|
|
68
|
+
client_ip TEXT,
|
|
69
|
+
client_ip_normalized TEXT,
|
|
70
|
+
source_tool TEXT,
|
|
71
|
+
source_tool_label TEXT,
|
|
72
|
+
session_id TEXT,
|
|
73
|
+
meta_json JSONB
|
|
74
|
+
);
|
|
75
|
+
CREATE INDEX IF NOT EXISTS idx_ree_created_at ON request_error_events(created_at DESC);
|
|
76
|
+
CREATE INDEX IF NOT EXISTS idx_ree_request_id ON request_error_events(request_id);
|
|
77
|
+
CREATE INDEX IF NOT EXISTS idx_ree_gateway_status ON request_error_events(gateway_status_code, created_at DESC);
|
|
78
|
+
CREATE INDEX IF NOT EXISTS idx_ree_upstream_status ON request_error_events(upstream_status_code, created_at DESC);
|
|
79
|
+
CREATE INDEX IF NOT EXISTS idx_ree_error_type ON request_error_events(error_type, created_at DESC);
|
|
80
|
+
CREATE INDEX IF NOT EXISTS idx_ree_error_code ON request_error_events(error_code, created_at DESC);
|
|
81
|
+
CREATE INDEX IF NOT EXISTS idx_ree_error_source ON request_error_events(error_source, created_at DESC);
|
|
82
|
+
CREATE INDEX IF NOT EXISTS idx_ree_provider_model ON request_error_events(provider, model, created_at DESC);
|
|
83
|
+
CREATE INDEX IF NOT EXISTS idx_ree_connection ON request_error_events(connection_id, created_at DESC);
|
|
84
|
+
CREATE INDEX IF NOT EXISTS idx_ree_api_key ON request_error_events(api_key_id, created_at DESC);
|
|
85
|
+
CREATE INDEX IF NOT EXISTS idx_ree_api_fp ON request_error_events(api_key_fingerprint, created_at DESC);
|
|
86
|
+
CREATE INDEX IF NOT EXISTS idx_ree_client_ip ON request_error_events(client_ip_normalized, created_at DESC);
|
|
87
|
+
CREATE INDEX IF NOT EXISTS idx_ree_source_tool ON request_error_events(source_tool, created_at DESC);
|
|
88
|
+
CREATE INDEX IF NOT EXISTS idx_ree_session ON request_error_events(session_id, created_at DESC);
|
|
89
|
+
`):"mysql"===a.type&&await a.exec(`
|
|
90
|
+
CREATE TABLE IF NOT EXISTS request_error_events (
|
|
91
|
+
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
92
|
+
created_at DATETIME(3) NOT NULL,
|
|
93
|
+
request_id VARCHAR(80),
|
|
94
|
+
attempt_index INT DEFAULT 0,
|
|
95
|
+
provider VARCHAR(120),
|
|
96
|
+
model VARCHAR(255),
|
|
97
|
+
connection_id VARCHAR(120),
|
|
98
|
+
account_name VARCHAR(255),
|
|
99
|
+
endpoint TEXT,
|
|
100
|
+
gateway_status_code INT,
|
|
101
|
+
upstream_status_code INT,
|
|
102
|
+
status_class VARCHAR(32),
|
|
103
|
+
error_source VARCHAR(80),
|
|
104
|
+
error_type VARCHAR(120),
|
|
105
|
+
error_code VARCHAR(160),
|
|
106
|
+
error_message_short TEXT,
|
|
107
|
+
upstream_error_body_snippet TEXT,
|
|
108
|
+
upstream_request_id VARCHAR(255),
|
|
109
|
+
latency_ms INT DEFAULT 0,
|
|
110
|
+
api_key_id VARCHAR(120),
|
|
111
|
+
api_key_fingerprint VARCHAR(120),
|
|
112
|
+
client_ip VARCHAR(64),
|
|
113
|
+
client_ip_normalized VARCHAR(64),
|
|
114
|
+
source_tool VARCHAR(80),
|
|
115
|
+
source_tool_label VARCHAR(120),
|
|
116
|
+
session_id VARCHAR(255),
|
|
117
|
+
meta_json JSON,
|
|
118
|
+
INDEX idx_ree_created_at (created_at),
|
|
119
|
+
INDEX idx_ree_request_id (request_id),
|
|
120
|
+
INDEX idx_ree_gateway_status (gateway_status_code, created_at),
|
|
121
|
+
INDEX idx_ree_upstream_status (upstream_status_code, created_at),
|
|
122
|
+
INDEX idx_ree_error_type (error_type, created_at),
|
|
123
|
+
INDEX idx_ree_error_code (error_code, created_at),
|
|
124
|
+
INDEX idx_ree_error_source (error_source, created_at),
|
|
125
|
+
INDEX idx_ree_provider_model (provider, model, created_at),
|
|
126
|
+
INDEX idx_ree_connection (connection_id, created_at),
|
|
127
|
+
INDEX idx_ree_api_key (api_key_id, created_at),
|
|
128
|
+
INDEX idx_ree_api_fp (api_key_fingerprint, created_at),
|
|
129
|
+
INDEX idx_ree_client_ip (client_ip_normalized, created_at),
|
|
130
|
+
INDEX idx_ree_source_tool (source_tool, created_at),
|
|
131
|
+
INDEX idx_ree_session (session_id, created_at)
|
|
132
|
+
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
|
133
|
+
`)}function u({statusCode:a,errorSource:b,errorCode:c,message:d}){let e=k(`${c} ${d}`),f=Number(a);return e.includes("context")||e.includes("maximum")||e.includes("token")||e.includes("too long")||413===f?"context_length_exceeded":401===f||e.includes("unauthorized")||e.includes("invalid api key")?"auth_error":403===f||e.includes("forbidden")||e.includes("not allowed")?"forbidden":429===f||e.includes("rate limit")?"rate_limit":e.includes("quota")?"quota_exceeded":e.includes("model_not_found")||e.includes("model not found")||e.includes("invalid model")?"model_not_found":e.includes("timeout")||k(b).includes("timeout")?"timeout":e.includes("abort")||499===f?"client_abort":e.includes("invalid json")?"invalid_json":e.includes("invalid sse")?"invalid_sse":f>=500?"provider_unavailable":f>=400?"invalid_request":j(c)||"unknown_error"}async function v(a={}){let b;try{if(!(b=await o()).enabled||!1===b.logErrors)return{skipped:!0,reason:"prompt_log_db_disabled"};let d=await s(b);try{var c;let b;await t(d);let e=function(a={}){let b,c,d=l(a.gatewayStatusCode??a.statusCode,null),e=l(a.upstreamStatusCode,null),f=m(a.errorMessageShort||a.errorMessage||a.message||a.error?.message||a.error||""),g=j(a.errorCode)||j(a.code)||u({statusCode:e||d,errorSource:a.errorSource,message:f}),h=j(a.errorType)||u({statusCode:e||d,errorSource:a.errorSource,errorCode:g,message:f}),n=j(a.clientIp||a.sourceIp),o=a.meta&&"object"==typeof a.meta?a.meta:{};return{createdAt:a.createdAt||a.timestamp||new Date().toISOString(),requestId:j(a.requestId||o.requestId),attemptIndex:l(a.attemptIndex,0)||0,provider:j(a.provider)||"unknown",model:j(a.model)||"unknown",connectionId:j(a.connectionId),accountName:j(a.accountName||a.connectionName),endpoint:j(a.endpoint),gatewayStatusCode:d,upstreamStatusCode:e,statusClass:j(a.statusClass)||function(a,b,c){let d=l(b,l(a,null)),e=k(c);if(e.includes("timeout"))return"timeout";if(e.includes("network"))return"network";if(Number.isFinite(d)){if(d>=500)return"5xx";if(d>=400)return"4xx";if(d>=300)return"3xx";if(d>=200)return"2xx"}return e||"error"}(d,e,a.errorSource),errorSource:j(a.errorSource)||"unknown_error_source",errorType:h,errorCode:g,errorMessageShort:f,upstreamErrorBodySnippet:function(a,b=i){if(null==a)return"";let c="";if("string"==typeof a)c=a;else try{c=JSON.stringify(a)}catch{c=String(a)}return m(c,b)}(a.upstreamErrorBodySnippet??a.upstreamBody??a.responseBody??a.providerResponseBody),upstreamRequestId:j(a.upstreamRequestId),latencyMs:l(a.latencyMs,0)||0,apiKeyId:j(a.apiKeyId),apiKeyFingerprint:j(a.apiKeyFingerprint)||((b=j(a.apiKey))?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key"),clientIp:n,clientIpNormalized:j(a.clientIpNormalized)||((c=j(n))?c.split(",")[0].trim().replace(/^::ffff:/,""):""),sourceTool:j(a.sourceTool||o.sourceTool),sourceToolLabel:j(a.sourceToolLabel||o.sourceToolLabel),sessionId:j(a.sessionId||o.sessionId),metaJson:JSON.stringify({...o,storedBy:"request_error_events"})}}(a),f=(c=d.type,b=["created_at","request_id","attempt_index","provider","model","connection_id","account_name","endpoint","gateway_status_code","upstream_status_code","status_class","error_source","error_type","error_code","error_message_short","upstream_error_body_snippet","upstream_request_id","latency_ms","api_key_id","api_key_fingerprint","client_ip","client_ip_normalized","source_tool","source_tool_label","session_id","meta_json"],"postgres"===c?`INSERT INTO request_error_events (${b.join(", ")}) VALUES (${b.map((a,b)=>`$${b+1}`).join(", ")})`:`INSERT INTO request_error_events (${b.join(", ")}) VALUES (${b.map(()=>"?").join(", ")})`),g=[e.createdAt,e.requestId,e.attemptIndex,e.provider,e.model,e.connectionId,e.accountName,e.endpoint,e.gatewayStatusCode,e.upstreamStatusCode,e.statusClass,e.errorSource,e.errorType,e.errorCode,e.errorMessageShort,e.upstreamErrorBodySnippet,e.upstreamRequestId,e.latencyMs,e.apiKeyId,e.apiKeyFingerprint,e.clientIp,e.clientIpNormalized,e.sourceTool,e.sourceToolLabel,e.sessionId,e.metaJson];return"sqlite"===d.type?d.run(f,g):await d.query(f,g),{ok:!0,event:e}}finally{await d.close()}}catch(a){return console.warn(`[RequestErrorEvents] save failed: ${a?.message||a}`),{ok:!1,error:a?.message||String(a)}}}function w(a={},b={}){let c=l(a.requests,0)||0;return{key:j(a.key)||"unknown",label:j(a.label||a.key)||"unknown",requests:c,success:0,errors:c,errorRate:+!!c,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,lastSeen:a.lastSeen||a.last_seen||"",...b}}async function x(a,b,c=[]){return"sqlite"===a.type?a.all(b,c):a.query(b,c)}async function y(a,b,c=[]){return"sqlite"===a.type?a.get(b,c):a.queryOne(b,c)}async function z(a={}){let b=await o();if(!b.enabled)return{disabled:!0,total:0,topErrors:[],byStatusCode:[],byStatusClass:[],byErrorType:[],byErrorSource:[],recent:[]};let c=await s(b);try{var d;let b;await t(c);let e=function(a={},b="sqlite"){let c=[],d=[],e=a=>(d.push(a),"postgres"===b)?`$${d.length}`:"?",f="postgres"===b?"ILIKE":"LIKE";if(a.dateFrom&&c.push(`created_at >= ${e(a.dateFrom)}`),a.dateTo&&c.push(`created_at <= ${e(a.dateTo)}`),a.provider&&c.push(`provider = ${e(a.provider)}`),a.model&&c.push(`model = ${e(a.model)}`),a.connectionId&&c.push(`connection_id = ${e(a.connectionId)}`),a.clientIp&&c.push(`client_ip_normalized ${f} ${e(`%${a.clientIp}%`)}`),a.sourceTool&&c.push(`(source_tool ${f} ${e(`%${a.sourceTool}%`)} OR source_tool_label ${f} ${e(`%${a.sourceTool}%`)})`),a.sessionId&&c.push(`session_id = ${e(a.sessionId)}`),a.endpoint&&c.push(`endpoint ${f} ${e(`%${a.endpoint}%`)}`),a.statusCode&&c.push(`(gateway_status_code = ${e(Number(a.statusCode))} OR upstream_status_code = ${e(Number(a.statusCode))})`),a.status){let b=j(a.status);/^\d+$/.test(b)?c.push(`(gateway_status_code = ${e(Number(b))} OR upstream_status_code = ${e(Number(b))})`):c.push(`(status_class = ${e(b)} OR error_type = ${e(b)} OR error_code = ${e(b)})`)}if(a.errorType&&c.push(`error_type = ${e(a.errorType)}`),a.errorCode&&c.push(`error_code = ${e(a.errorCode)}`),a.errorSource&&c.push(`error_source = ${e(a.errorSource)}`),a.apiKey){let b=`%${a.apiKey}%`;c.push(`(api_key_id ${f} ${e(b)} OR api_key_fingerprint ${f} ${e(b)})`)}if(a.keyword){let b=`%${a.keyword}%`;c.push(`(error_message_short ${f} ${e(b)} OR upstream_error_body_snippet ${f} ${e(b)} OR request_id ${f} ${e(b)} OR error_code ${f} ${e(b)})`)}return{clause:c.length?`WHERE ${c.join(" AND ")}`:"",params:d}}(a,c.type),f=await y(c,`SELECT COUNT(*) AS total FROM request_error_events ${e.clause}`,e.params),g=l(f?.total,0)||0,h="postgres"===c.type?`$${e.params.length+1}`:"?",i=[...e.params,100],k=(d=c.type,b="mysql"===d?"CHAR":"TEXT",`COALESCE(CAST(upstream_status_code AS ${b}), CAST(gateway_status_code AS ${b}), status_class, 'error')`),m="mysql"===c.type?`CONCAT(${k}, '|', COALESCE(NULLIF(error_type, ''), 'unknown_error'), '|', COALESCE(NULLIF(provider, ''), 'unknown'), '|', COALESCE(NULLIF(model, ''), 'unknown'), '|', COALESCE(NULLIF(endpoint, ''), 'unknown'))`:`${k} || '|' || COALESCE(NULLIF(error_type, ''), 'unknown_error') || '|' || COALESCE(NULLIF(provider, ''), 'unknown') || '|' || COALESCE(NULLIF(model, ''), 'unknown') || '|' || COALESCE(NULLIF(endpoint, ''), 'unknown')`,n=await x(c,`SELECT
|
|
134
|
+
${m} AS key,
|
|
135
|
+
${k} AS status,
|
|
136
|
+
COALESCE(NULLIF(error_type, ''), 'unknown_error') AS errorType,
|
|
137
|
+
COALESCE(NULLIF(error_code, ''), 'unknown_error') AS errorCode,
|
|
138
|
+
COALESCE(NULLIF(error_source, ''), 'unknown') AS errorSource,
|
|
139
|
+
COALESCE(NULLIF(provider, ''), 'unknown') AS provider,
|
|
140
|
+
COALESCE(NULLIF(model, ''), 'unknown') AS model,
|
|
141
|
+
COALESCE(NULLIF(endpoint, ''), 'unknown') AS endpoint,
|
|
142
|
+
COALESCE(NULLIF(api_key_fingerprint, ''), 'local-no-key') AS apiKey,
|
|
143
|
+
COUNT(*) AS requests,
|
|
144
|
+
MAX(created_at) AS lastSeen,
|
|
145
|
+
MAX(error_message_short) AS sampleMessage
|
|
146
|
+
FROM request_error_events
|
|
147
|
+
${e.clause}
|
|
148
|
+
GROUP BY ${k}, COALESCE(NULLIF(error_type, ''), 'unknown_error'), COALESCE(NULLIF(error_code, ''), 'unknown_error'), COALESCE(NULLIF(error_source, ''), 'unknown'), COALESCE(NULLIF(provider, ''), 'unknown'), COALESCE(NULLIF(model, ''), 'unknown'), COALESCE(NULLIF(endpoint, ''), 'unknown'), COALESCE(NULLIF(api_key_fingerprint, ''), 'local-no-key')
|
|
149
|
+
ORDER BY requests DESC, lastSeen DESC
|
|
150
|
+
LIMIT ${h}`,i),o=async(a,b=a)=>(await x(c,`SELECT COALESCE(NULLIF(${a}, ''), 'unknown') AS key, COALESCE(NULLIF(${a}, ''), 'unknown') AS label, COUNT(*) AS requests, MAX(created_at) AS lastSeen
|
|
151
|
+
FROM request_error_events
|
|
152
|
+
${e.clause}
|
|
153
|
+
GROUP BY COALESCE(NULLIF(${a}, ''), 'unknown')
|
|
154
|
+
ORDER BY requests DESC, lastSeen DESC
|
|
155
|
+
LIMIT ${h}`,i)).map(a=>w(a,{[b]:a.key})),p="postgres"===c.type?`$${e.params.length+1}`:"?",q=await x(c,`SELECT id, created_at AS createdAt, request_id AS requestId, provider, model, connection_id AS connectionId, endpoint,
|
|
156
|
+
gateway_status_code AS gatewayStatusCode, upstream_status_code AS upstreamStatusCode, status_class AS statusClass,
|
|
157
|
+
error_source AS errorSource, error_type AS errorType, error_code AS errorCode,
|
|
158
|
+
error_message_short AS errorMessageShort, api_key_fingerprint AS apiKeyFingerprint,
|
|
159
|
+
client_ip_normalized AS clientIp, source_tool AS sourceTool, session_id AS sessionId, latency_ms AS latencyMs
|
|
160
|
+
FROM request_error_events
|
|
161
|
+
${e.clause}
|
|
162
|
+
ORDER BY created_at DESC
|
|
163
|
+
LIMIT ${p}`,[...e.params,50]);return{disabled:!1,total:g,topErrors:n.map(a=>w(a,{label:`${a.status||"error"} \xb7 ${a.errorType||a.errorCode||"unknown_error"}`,status:a.status||"error",errorType:a.errorType||"",errorCode:a.errorCode||"",errorSource:a.errorSource||"",provider:a.provider||"unknown",model:a.model||"unknown",endpoint:a.endpoint||"unknown",apiKey:a.apiKey||"",sampleMessage:a.sampleMessage||""})),byStatusCode:await o(k,"status"),byStatusClass:await o("status_class","statusClass"),byErrorType:await o("error_type","errorType"),byErrorSource:await o("error_source","errorSource"),byProvider:await o("provider","provider"),byModel:await o("model","model"),byClientIp:await o("client_ip_normalized","clientIp"),bySourceTool:await o("source_tool","sourceTool"),recent:q}}catch(a){return{disabled:!0,total:0,error:a?.message||String(a),topErrors:[],byStatusCode:[],byStatusClass:[],byErrorType:[],byErrorSource:[],recent:[]}}finally{await c.close()}}},45903:(a,b,c)=>{c.d(b,{AP:()=>m,BY:()=>w,I6:()=>k,L7:()=>l,dX:()=>v,r:()=>j});var d=c(89718),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g);let i={enabled:!1,type:"sqlite",sqlitePath:"",host:"",port:"",database:"",username:"",password:"",ssl:!1,createDatabase:!1,logClientRequest:!0,logSourceRequest:!0,logTargetRequest:!0,logProviderResponse:!1,logErrors:!0,retentionDays:30};function j(a){let b={...a||{}};return b.password&&(b.password="********"),b}function k(a={},b={}){let c={...i,...b||{},...a||{}};c.enabled=!!c.enabled,c.type=["sqlite","postgres","mysql"].includes(c.type)?c.type:"sqlite",c.ssl=!!c.ssl,c.createDatabase=!!c.createDatabase,c.logClientRequest=!1!==c.logClientRequest,c.logSourceRequest=!1!==c.logSourceRequest,c.logTargetRequest=!1!==c.logTargetRequest,c.logProviderResponse=!0===c.logProviderResponse,c.logErrors=!1!==c.logErrors;let d=Number(c.retentionDays);return c.retentionDays=Number.isFinite(d)&&d>0?Math.floor(d):30,"********"===c.password&&(c.password=b?.password||""),c.host=String(c.host||"").trim(),c.port=String(c.port||"").trim(),c.database=String(c.database||"").trim(),c.username=String(c.username||"").trim(),c.password=String(c.password||""),c.sqlitePath=String(c.sqlitePath||"").trim(),c}async function l(){let a=await (0,d.mt)();return{...i,...a?.promptLogDb||{}}}async function m(a){let b=await (0,d.mt)(),c=k(a,b?.promptLogDb||{});return await (0,d.Xx)({promptLogDb:c}),c}async function n(a){let b,d=a.sqlitePath||(b=process.env.DATA_DIR||"/var/lib/bluerouter",f().join(b,"logs","promptLogs.sqlite"));h().mkdirSync(f().dirname(d),{recursive:!0});try{let a=await Promise.resolve().then(c.t.bind(c,87550,23)),b=new(a.default||a)(d);return b.pragma("journal_mode = WAL"),b.pragma("busy_timeout = 5000"),{type:"sqlite",sqlitePath:d,exec(a){b.exec(a)},all:(a,c=[])=>b.prepare(a).all(...c),close(){b.close()}}}catch{let a=new(await Promise.resolve().then(c.t.bind(c,80099,23))).DatabaseSync(d);return a.exec("PRAGMA journal_mode = WAL"),a.exec("PRAGMA busy_timeout = 5000"),{type:"sqlite",sqlitePath:d,exec(b){a.exec(b)},all:(b,c=[])=>a.prepare(b).all(...c),close(){a.close()}}}}async function o(a,b=null){let d=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:b||a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await d.connect(),{type:"postgres",client:d,async exec(a){await d.query(a)},async close(){await d.end()}}}async function p(a,b=!0){let d=await c.e(8491).then(c.t.bind(c,38491,19)),e=await d.createConnection({host:a.host,port:Number(a.port||3306),database:b?a.database:void 0,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,multipleStatements:!0});return{type:"mysql",conn:e,async exec(a){await e.query(a)},async close(){await e.end()}}}async function q(a){let b=new Set(a.all("PRAGMA table_info(prompt_logs)").map(a=>a.name)),c=(c,d)=>{b.has(c)||a.exec(`ALTER TABLE prompt_logs ADD COLUMN ${c} ${d};`)};c("client_ip","TEXT"),c("client_port","TEXT"),c("client_user_agent","TEXT"),c("client_host","TEXT"),c("source_tool","TEXT"),c("source_tool_label","TEXT"),c("source_host","TEXT"),c("provider","TEXT"),c("account_name","TEXT"),c("connection_id","TEXT"),c("display_model","TEXT"),a.exec("CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip ON prompt_logs(client_ip);"),a.exec("CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool ON prompt_logs(source_tool);")}async function r(a){await a.exec(`
|
|
164
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_ip TEXT;
|
|
165
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_port TEXT;
|
|
166
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_user_agent TEXT;
|
|
167
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS client_host TEXT;
|
|
168
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS source_tool TEXT;
|
|
169
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS source_tool_label TEXT;
|
|
170
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS source_host TEXT;
|
|
171
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS provider TEXT;
|
|
172
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS account_name TEXT;
|
|
173
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS connection_id TEXT;
|
|
174
|
+
ALTER TABLE prompt_logs ADD COLUMN IF NOT EXISTS display_model TEXT;
|
|
175
|
+
|
|
176
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip
|
|
177
|
+
ON prompt_logs(client_ip);
|
|
178
|
+
|
|
179
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool
|
|
180
|
+
ON prompt_logs(source_tool);
|
|
181
|
+
`)}async function s(a,b,c,d){let[e]=await a.query(`
|
|
182
|
+
SELECT 1 AS found
|
|
183
|
+
FROM INFORMATION_SCHEMA.COLUMNS
|
|
184
|
+
WHERE TABLE_SCHEMA = ?
|
|
185
|
+
AND TABLE_NAME = ?
|
|
186
|
+
AND COLUMN_NAME = ?
|
|
187
|
+
LIMIT 1
|
|
188
|
+
`,[b,c,d]);return e.length>0}async function t(a,b,c,d){let[e]=await a.query(`
|
|
189
|
+
SELECT 1 AS found
|
|
190
|
+
FROM INFORMATION_SCHEMA.STATISTICS
|
|
191
|
+
WHERE TABLE_SCHEMA = ?
|
|
192
|
+
AND TABLE_NAME = ?
|
|
193
|
+
AND INDEX_NAME = ?
|
|
194
|
+
LIMIT 1
|
|
195
|
+
`,[b,c,d]);return e.length>0}async function u(a,b){let c=async(c,d)=>{await s(a.conn,b.database,"prompt_logs",c)||await a.conn.query(`ALTER TABLE prompt_logs ADD COLUMN ${c} ${d}`)};await c("client_ip","VARCHAR(64)"),await c("client_port","VARCHAR(32)"),await c("client_user_agent","TEXT"),await c("client_host","TEXT"),await c("source_tool","VARCHAR(80)"),await c("source_tool_label","VARCHAR(120)"),await c("source_host","VARCHAR(255)"),await c("provider","VARCHAR(120)"),await c("account_name","VARCHAR(255)"),await c("connection_id","VARCHAR(120)"),await c("display_model","VARCHAR(512)"),await t(a.conn,b.database,"prompt_logs","idx_prompt_logs_client_ip")||await a.conn.query("CREATE INDEX idx_prompt_logs_client_ip ON prompt_logs(client_ip)"),await t(a.conn,b.database,"prompt_logs","idx_prompt_logs_source_tool")||await a.conn.query("CREATE INDEX idx_prompt_logs_source_tool ON prompt_logs(source_tool)")}async function v(a=null){let b=k(a||await l());if("sqlite"===b.type){let a=await n(b);try{return a.exec(`
|
|
196
|
+
CREATE TABLE IF NOT EXISTS prompt_logs (
|
|
197
|
+
id TEXT PRIMARY KEY,
|
|
198
|
+
created_at TEXT NOT NULL,
|
|
199
|
+
session_id TEXT,
|
|
200
|
+
source_format TEXT,
|
|
201
|
+
target_format TEXT,
|
|
202
|
+
model TEXT,
|
|
203
|
+
endpoint TEXT,
|
|
204
|
+
stage TEXT,
|
|
205
|
+
provider_url TEXT,
|
|
206
|
+
provider TEXT,
|
|
207
|
+
account_name TEXT,
|
|
208
|
+
connection_id TEXT,
|
|
209
|
+
display_model TEXT,
|
|
210
|
+
client_ip TEXT,
|
|
211
|
+
client_port TEXT,
|
|
212
|
+
client_user_agent TEXT,
|
|
213
|
+
client_host TEXT,
|
|
214
|
+
source_tool TEXT,
|
|
215
|
+
source_tool_label TEXT,
|
|
216
|
+
source_host TEXT,
|
|
217
|
+
prompt_text TEXT,
|
|
218
|
+
full_request_json TEXT,
|
|
219
|
+
response_text TEXT,
|
|
220
|
+
status_code INTEGER,
|
|
221
|
+
error_text TEXT,
|
|
222
|
+
meta_json TEXT
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_created_at
|
|
226
|
+
ON prompt_logs(created_at DESC);
|
|
227
|
+
|
|
228
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_model
|
|
229
|
+
ON prompt_logs(model);
|
|
230
|
+
|
|
231
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_stage
|
|
232
|
+
ON prompt_logs(stage);
|
|
233
|
+
|
|
234
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_session
|
|
235
|
+
ON prompt_logs(session_id);
|
|
236
|
+
|
|
237
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip
|
|
238
|
+
ON prompt_logs(client_ip);
|
|
239
|
+
|
|
240
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool
|
|
241
|
+
ON prompt_logs(source_tool);
|
|
242
|
+
`),await q(a),{ok:!0,type:"sqlite",message:"SQLite prompt log schema is ready",sqlitePath:a.sqlitePath}}finally{a.close()}}if("postgres"===b.type){if(!b.host||!b.database||!b.username)throw Error("PostgreSQL host, database, and username are required");if(b.createDatabase){let a=await o(b,"postgres");try{let c=await a.client.query("SELECT 1 FROM pg_database WHERE datname = $1",[b.database]);if(0===c.rowCount){let c=b.database.replace(/"/g,'""');await a.client.query(`CREATE DATABASE "${c}"`)}}finally{await a.close()}}let a=await o(b);try{return await a.exec(`
|
|
243
|
+
CREATE TABLE IF NOT EXISTS prompt_logs (
|
|
244
|
+
id TEXT PRIMARY KEY,
|
|
245
|
+
created_at TIMESTAMPTZ NOT NULL,
|
|
246
|
+
session_id TEXT,
|
|
247
|
+
source_format TEXT,
|
|
248
|
+
target_format TEXT,
|
|
249
|
+
model TEXT,
|
|
250
|
+
endpoint TEXT,
|
|
251
|
+
stage TEXT,
|
|
252
|
+
provider_url TEXT,
|
|
253
|
+
provider TEXT,
|
|
254
|
+
account_name TEXT,
|
|
255
|
+
connection_id TEXT,
|
|
256
|
+
display_model TEXT,
|
|
257
|
+
client_ip TEXT,
|
|
258
|
+
client_port TEXT,
|
|
259
|
+
client_user_agent TEXT,
|
|
260
|
+
client_host TEXT,
|
|
261
|
+
source_tool TEXT,
|
|
262
|
+
source_tool_label TEXT,
|
|
263
|
+
source_host TEXT,
|
|
264
|
+
prompt_text TEXT,
|
|
265
|
+
full_request_json JSONB,
|
|
266
|
+
response_text TEXT,
|
|
267
|
+
status_code INTEGER,
|
|
268
|
+
error_text TEXT,
|
|
269
|
+
meta_json JSONB
|
|
270
|
+
);
|
|
271
|
+
|
|
272
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_created_at
|
|
273
|
+
ON prompt_logs(created_at DESC);
|
|
274
|
+
|
|
275
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_model
|
|
276
|
+
ON prompt_logs(model);
|
|
277
|
+
|
|
278
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_stage
|
|
279
|
+
ON prompt_logs(stage);
|
|
280
|
+
|
|
281
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_session
|
|
282
|
+
ON prompt_logs(session_id);
|
|
283
|
+
|
|
284
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip
|
|
285
|
+
ON prompt_logs(client_ip);
|
|
286
|
+
|
|
287
|
+
CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool
|
|
288
|
+
ON prompt_logs(source_tool);
|
|
289
|
+
`),await r(a),{ok:!0,type:"postgres",message:"PostgreSQL prompt log schema is ready"}}finally{await a.close()}}if("mysql"===b.type){if(!b.host||!b.database||!b.username)throw Error("MySQL host, database, and username are required");if(b.createDatabase){let a=await p(b,!1);try{let c=b.database.replace(/`/g,"``");await a.exec(`CREATE DATABASE IF NOT EXISTS \`${c}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci`)}finally{await a.close()}}let a=await p(b,!0);try{return await a.exec(`
|
|
290
|
+
CREATE TABLE IF NOT EXISTS prompt_logs (
|
|
291
|
+
id VARCHAR(80) PRIMARY KEY,
|
|
292
|
+
created_at DATETIME(3) NOT NULL,
|
|
293
|
+
session_id VARCHAR(255),
|
|
294
|
+
source_format VARCHAR(80),
|
|
295
|
+
target_format VARCHAR(80),
|
|
296
|
+
model VARCHAR(255),
|
|
297
|
+
endpoint TEXT,
|
|
298
|
+
stage VARCHAR(80),
|
|
299
|
+
provider_url TEXT,
|
|
300
|
+
provider VARCHAR(120),
|
|
301
|
+
account_name VARCHAR(255),
|
|
302
|
+
connection_id VARCHAR(120),
|
|
303
|
+
display_model VARCHAR(512),
|
|
304
|
+
client_ip VARCHAR(64),
|
|
305
|
+
client_port VARCHAR(32),
|
|
306
|
+
client_user_agent TEXT,
|
|
307
|
+
client_host TEXT,
|
|
308
|
+
source_tool VARCHAR(80),
|
|
309
|
+
source_tool_label VARCHAR(120),
|
|
310
|
+
source_host VARCHAR(255),
|
|
311
|
+
prompt_text LONGTEXT,
|
|
312
|
+
full_request_json JSON,
|
|
313
|
+
response_text LONGTEXT,
|
|
314
|
+
status_code INT,
|
|
315
|
+
error_text TEXT,
|
|
316
|
+
meta_json JSON,
|
|
317
|
+
INDEX idx_prompt_logs_created_at (created_at),
|
|
318
|
+
INDEX idx_prompt_logs_model (model),
|
|
319
|
+
INDEX idx_prompt_logs_stage (stage),
|
|
320
|
+
INDEX idx_prompt_logs_session (session_id),
|
|
321
|
+
INDEX idx_prompt_logs_client_ip (client_ip),
|
|
322
|
+
INDEX idx_prompt_logs_source_tool (source_tool)
|
|
323
|
+
);
|
|
324
|
+
`),await u(a,b),{ok:!0,type:"mysql",message:"MySQL prompt log schema is ready"}}finally{await a.close()}}throw Error(`Unsupported database type: ${b.type}`)}async function w(a=null){let b=k(a||await l());if("sqlite"===b.type){let a=await n(b);try{return a.exec("SELECT 1;"),{ok:!0,type:"sqlite",message:"SQLite connection OK",sqlitePath:a.sqlitePath}}finally{a.close()}}if("postgres"===b.type){let a=await o(b);try{return await a.exec("SELECT 1;"),{ok:!0,type:"postgres",message:"PostgreSQL connection OK"}}finally{await a.close()}}if("mysql"===b.type){let a=await p(b,!0);try{return await a.exec("SELECT 1;"),{ok:!0,type:"mysql",message:"MySQL connection OK"}}finally{await a.close()}}throw Error(`Unsupported database type: ${b.type}`)}}};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";exports.id=6663,exports.ids=[6663],exports.modules={50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},89718:(a,b,c)=>{c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,OM:()=>d.OM,PX:()=>d.PX,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,ek:()=>d.ek,fK:()=>d.fK,fv:()=>d.fv,getProviderConnections:()=>d.P,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mY:()=>d.mY,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,r4:()=>d.r4,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yg:()=>d.yg,zP:()=>d.zP});var d=c(56403)},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}},97242:(a,b,c)=>{c.d(b,{DU:()=>y,Ws:()=>z,_3:()=>B,nv:()=>A});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(45903);let i=new Set;function j(a,b,c=null){let d=Number(a);if(!Number.isFinite(d)||d<0)return b;let e=Math.floor(d);return c?Math.min(e,c):e}function k(a){return String(a||"").trim()}async function l(){let a=(0,h.I6)(await (0,h.L7)());return a.sqlitePath||(a.sqlitePath=g().join(process.env.DATA_DIR||"/var/lib/bluerouter","logs","promptLogs.sqlite")),a}async function m(a){try{let b=await Promise.resolve().then(c.t.bind(c,87550,23)),d=new(b.default||b)(a);return d.pragma("busy_timeout = 5000"),{all:(a,b={})=>d.prepare(a).all(b),get:(a,b={})=>d.prepare(a).get(b),run:(a,b={})=>d.prepare(a).run(b),close:()=>d.close()}}catch{let b=new(await Promise.resolve().then(c.t.bind(c,80099,23))).DatabaseSync(a);return b.exec("PRAGMA busy_timeout = 5000"),{all:(a,c={})=>b.prepare(a).all(c),get:(a,c={})=>b.prepare(a).get(c),run:(a,c={})=>b.prepare(a).run(c),close:()=>b.close()}}}async function n(a){let b=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await b.connect(),{query:async(a,c=[])=>(await b.query(a,c)).rows,queryOne:async(a,c=[])=>(await b.query(a,c)).rows[0]||null,async exec(a,c=[]){await b.query(a,c)},async close(){await b.end()}}}async function o(a){let b=await c.e(8491).then(c.t.bind(c,38491,19)),d=await b.createConnection({host:a.host,port:Number(a.port||3306),database:a.database,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,dateStrings:!0});return{async query(a,b=[]){let[c]=await d.query(a,b);return c},async queryOne(a,b=[]){let[c]=await d.query(a,b);return c[0]||null},async exec(a,b=[]){await d.query(a,b)},async close(){await d.end()}}}async function p(a){if(!e().existsSync(a.sqlitePath))return;let b=await m(a.sqlitePath);try{if(!b.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'prompt_logs'"))return;for(let a of["CREATE INDEX IF NOT EXISTS idx_prompt_logs_created_id ON prompt_logs(created_at DESC, id)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_stage_created_at ON prompt_logs(stage, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_model_created_at ON prompt_logs(model, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_display_model_created_at ON prompt_logs(display_model, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_session_created_at ON prompt_logs(session_id, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip_created_at ON prompt_logs(client_ip, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool_created_at ON prompt_logs(source_tool, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_connection_created_at ON prompt_logs(connection_id, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_account_created_at ON prompt_logs(account_name, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_provider_created_at ON prompt_logs(provider, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_status_created_at ON prompt_logs(status_code, created_at DESC)"])b.run(a)}finally{b.close()}}async function q(a){let b=await n(a);try{for(let a of["CREATE INDEX IF NOT EXISTS idx_prompt_logs_created_id ON prompt_logs (created_at DESC, id)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_stage_created_at ON prompt_logs (stage, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_model_created_at ON prompt_logs (model, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_display_model_created_at ON prompt_logs (display_model, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_session_created_at ON prompt_logs (session_id, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_client_ip_created_at ON prompt_logs (client_ip, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_source_tool_created_at ON prompt_logs (source_tool, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_connection_created_at ON prompt_logs (connection_id, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_account_created_at ON prompt_logs (account_name, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_provider_created_at ON prompt_logs (provider, created_at DESC)","CREATE INDEX IF NOT EXISTS idx_prompt_logs_status_created_at ON prompt_logs (status_code, created_at DESC)"])await b.exec(a)}finally{await b.close()}}async function r(a,b,c){let d=await a.queryOne("SELECT COUNT(1) AS count FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'prompt_logs' AND INDEX_NAME = ?",[b]);0===Number(d?.count||0)&&await a.exec(c)}async function s(a){let b=await o(a);try{let a=await b.queryOne("SELECT COUNT(1) AS count FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'prompt_logs'");if(0===Number(a?.count||0))return;for(let[a,c]of[["idx_prompt_logs_created_id","CREATE INDEX idx_prompt_logs_created_id ON prompt_logs (created_at DESC, id)"],["idx_prompt_logs_stage_created_at","CREATE INDEX idx_prompt_logs_stage_created_at ON prompt_logs (stage, created_at DESC)"],["idx_prompt_logs_model_created_at","CREATE INDEX idx_prompt_logs_model_created_at ON prompt_logs (model, created_at DESC)"],["idx_prompt_logs_display_model_created_at","CREATE INDEX idx_prompt_logs_display_model_created_at ON prompt_logs (display_model, created_at DESC)"],["idx_prompt_logs_session_created_at","CREATE INDEX idx_prompt_logs_session_created_at ON prompt_logs (session_id, created_at DESC)"],["idx_prompt_logs_client_ip_created_at","CREATE INDEX idx_prompt_logs_client_ip_created_at ON prompt_logs (client_ip, created_at DESC)"],["idx_prompt_logs_source_tool_created_at","CREATE INDEX idx_prompt_logs_source_tool_created_at ON prompt_logs (source_tool, created_at DESC)"],["idx_prompt_logs_connection_created_at","CREATE INDEX idx_prompt_logs_connection_created_at ON prompt_logs (connection_id, created_at DESC)"],["idx_prompt_logs_account_created_at","CREATE INDEX idx_prompt_logs_account_created_at ON prompt_logs (account_name, created_at DESC)"],["idx_prompt_logs_provider_created_at","CREATE INDEX idx_prompt_logs_provider_created_at ON prompt_logs (provider, created_at DESC)"],["idx_prompt_logs_status_created_at","CREATE INDEX idx_prompt_logs_status_created_at ON prompt_logs (status_code, created_at DESC)"]])await r(b,a,c)}finally{await b.close()}}async function t(a){if(!a.enabled)return;let b="sqlite"===a.type?`sqlite:${a.sqlitePath}`:`${a.type}:${a.host||""}:${a.port||""}:${a.database||""}`;if(!i.has(b))try{"sqlite"===a.type?await p(a):"postgres"===a.type?await q(a):"mysql"===a.type&&await s(a),i.add(b)}catch(a){console.warn("[prompt-logs] Unable to ensure query indexes:",a.message)}}async function u(a){if(!e().existsSync(a.sqlitePath))return{models:[],stages:[],missing:!0,dbInfo:{type:"sqlite",sqlitePath:a.sqlitePath}};let b=await m(a.sqlitePath);try{if(!b.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'prompt_logs'"))return{models:[],stages:[],missing:!0,dbInfo:{type:"sqlite",sqlitePath:a.sqlitePath}};let c=b.all("SELECT DISTINCT COALESCE(NULLIF(display_model, ''), model) AS model FROM prompt_logs WHERE model IS NOT NULL AND model <> '' ORDER BY model LIMIT 300").map(a=>a.model),d=b.all("SELECT DISTINCT stage FROM prompt_logs WHERE stage IS NOT NULL AND stage <> '' ORDER BY stage LIMIT 100").map(a=>a.stage);return{models:c,stages:d,dbInfo:{type:"sqlite",sqlitePath:a.sqlitePath}}}finally{b.close()}}async function v(a){let b="postgres"===a.type?await n(a):await o(a);try{let c=(await b.query("SELECT DISTINCT COALESCE(NULLIF(display_model, ''), model) AS model FROM prompt_logs WHERE model IS NOT NULL AND model <> '' ORDER BY model LIMIT 300")).map(a=>a.model),d=(await b.query("SELECT DISTINCT stage FROM prompt_logs WHERE stage IS NOT NULL AND stage <> '' ORDER BY stage LIMIT 100")).map(a=>a.stage);return{models:c,stages:d,dbInfo:{type:a.type,host:a.host,database:a.database}}}finally{await b.close()}}async function w(a,b){if(!e().existsSync(a.sqlitePath))return{rows:[],total:0,models:[],stages:[],missing:!0,dbInfo:{type:"sqlite",sqlitePath:a.sqlitePath}};let c=await m(a.sqlitePath);try{let d,e;if(!c.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'prompt_logs'"))return{rows:[],total:0,models:[],stages:[],missing:!0,dbInfo:{type:"sqlite",sqlitePath:a.sqlitePath}};let{clause:f,params:g}=(d=[],e={limit:b.limit,offset:b.offset},b.keyword&&(d.push(`(
|
|
2
|
+
prompt_text LIKE @keyword OR
|
|
3
|
+
response_text LIKE @keyword OR
|
|
4
|
+
error_text LIKE @keyword OR
|
|
5
|
+
model LIKE @keyword OR
|
|
6
|
+
endpoint LIKE @keyword OR
|
|
7
|
+
provider_url LIKE @keyword OR
|
|
8
|
+
provider LIKE @keyword OR
|
|
9
|
+
account_name LIKE @keyword OR
|
|
10
|
+
connection_id LIKE @keyword OR
|
|
11
|
+
display_model LIKE @keyword OR
|
|
12
|
+
session_id LIKE @keyword OR
|
|
13
|
+
client_ip LIKE @keyword OR
|
|
14
|
+
client_host LIKE @keyword OR
|
|
15
|
+
client_user_agent LIKE @keyword OR
|
|
16
|
+
source_tool LIKE @keyword OR
|
|
17
|
+
source_tool_label LIKE @keyword OR
|
|
18
|
+
source_host LIKE @keyword
|
|
19
|
+
)`),e.keyword=`%${b.keyword}%`),b.model&&(d.push("(model = @model OR display_model = @model)"),e.model=b.model),b.stage&&(d.push("stage = @stage"),e.stage=b.stage),b.sessionId&&(d.push("session_id = @sessionId"),e.sessionId=b.sessionId),b.clientIp&&(d.push("client_ip LIKE @clientIp"),e.clientIp=`%${b.clientIp}%`),b.sourceTool&&(d.push("(source_tool LIKE @sourceTool OR source_tool_label LIKE @sourceTool OR source_host LIKE @sourceTool)"),e.sourceTool=`%${b.sourceTool}%`),b.dateFrom&&(d.push("created_at >= @dateFrom"),e.dateFrom=b.dateFrom),b.dateTo&&(d.push("created_at <= @dateTo"),e.dateTo=b.dateTo),{clause:d.length?`WHERE ${d.join(" AND ")}`:"",params:e}),h=c.get(`SELECT COUNT(*) AS count FROM prompt_logs ${f}`,g)?.count||0,i=c.all(`
|
|
20
|
+
SELECT
|
|
21
|
+
id,
|
|
22
|
+
created_at,
|
|
23
|
+
session_id,
|
|
24
|
+
source_format,
|
|
25
|
+
target_format,
|
|
26
|
+
model,
|
|
27
|
+
endpoint,
|
|
28
|
+
stage,
|
|
29
|
+
provider_url,
|
|
30
|
+
provider,
|
|
31
|
+
account_name,
|
|
32
|
+
connection_id,
|
|
33
|
+
display_model,
|
|
34
|
+
client_ip,
|
|
35
|
+
client_port,
|
|
36
|
+
client_user_agent,
|
|
37
|
+
client_host,
|
|
38
|
+
source_tool,
|
|
39
|
+
source_tool_label,
|
|
40
|
+
source_host,
|
|
41
|
+
substr(coalesce(prompt_text,''), 1, 900) AS prompt_preview,
|
|
42
|
+
length(coalesce(prompt_text,'')) AS prompt_length,
|
|
43
|
+
substr(coalesce(response_text,''), 1, 400) AS response_preview,
|
|
44
|
+
status_code,
|
|
45
|
+
error_text
|
|
46
|
+
FROM prompt_logs
|
|
47
|
+
${f}
|
|
48
|
+
ORDER BY created_at DESC
|
|
49
|
+
LIMIT @limit OFFSET @offset
|
|
50
|
+
`,g),j=[],k=[];if(b.includeOptions){let b=await u(a);j=b.models,k=b.stages}return{rows:i,total:h,models:j,stages:k,dbInfo:{type:"sqlite",sqlitePath:a.sqlitePath}}}finally{c.close()}}async function x(a,b){let c=a.type,d="postgres"===c?await n(a):await o(a);try{let e=function(a,b){let c=[],d=[],e=a=>(d.push(a),"postgres"===b)?`$${d.length}`:"?",f="postgres"===b?"ILIKE":"LIKE";if(a.keyword){let b=`%${a.keyword}%`;c.push(`(${["prompt_text","response_text","error_text","model","endpoint","provider_url","provider","account_name","connection_id","display_model","session_id","client_ip","client_host","client_user_agent","source_tool","source_tool_label","source_host"].map(a=>`${a} ${f} ${e(b)}`).join(" OR ")})`)}if(a.model&&c.push(`(model = ${e(a.model)} OR display_model = ${e(a.model)})`),a.stage&&c.push(`stage = ${e(a.stage)}`),a.sessionId&&c.push(`session_id = ${e(a.sessionId)}`),a.clientIp&&c.push(`client_ip ${f} ${e(`%${a.clientIp}%`)}`),a.sourceTool){let b=`%${a.sourceTool}%`;c.push(`(source_tool ${f} ${e(b)} OR source_tool_label ${f} ${e(b)} OR source_host ${f} ${e(b)})`)}return a.dateFrom&&c.push(`created_at >= ${e(a.dateFrom)}`),a.dateTo&&c.push(`created_at <= ${e(a.dateTo)}`),{clause:c.length?`WHERE ${c.join(" AND ")}`:"",params:d,add:e}}(b,c),f=[...e.params],g=await d.queryOne(`SELECT COUNT(*) AS count FROM prompt_logs ${e.clause}`,f),h=e.add(b.limit),i=e.add(b.offset),j="postgres"===c?"LEFT(coalesce(prompt_text,''), 900)":"SUBSTRING(coalesce(prompt_text,''), 1, 900)",k="postgres"===c?"char_length(coalesce(prompt_text,''))":"CHAR_LENGTH(coalesce(prompt_text,''))",l="postgres"===c?"LEFT(coalesce(response_text,''), 400)":"SUBSTRING(coalesce(response_text,''), 1, 400)",m=await d.query(`
|
|
51
|
+
SELECT
|
|
52
|
+
id,
|
|
53
|
+
created_at,
|
|
54
|
+
session_id,
|
|
55
|
+
source_format,
|
|
56
|
+
target_format,
|
|
57
|
+
model,
|
|
58
|
+
endpoint,
|
|
59
|
+
stage,
|
|
60
|
+
provider_url,
|
|
61
|
+
provider,
|
|
62
|
+
account_name,
|
|
63
|
+
connection_id,
|
|
64
|
+
display_model,
|
|
65
|
+
client_ip,
|
|
66
|
+
client_port,
|
|
67
|
+
client_user_agent,
|
|
68
|
+
client_host,
|
|
69
|
+
source_tool,
|
|
70
|
+
source_tool_label,
|
|
71
|
+
source_host,
|
|
72
|
+
${j} AS prompt_preview,
|
|
73
|
+
${k} AS prompt_length,
|
|
74
|
+
${l} AS response_preview,
|
|
75
|
+
status_code,
|
|
76
|
+
error_text
|
|
77
|
+
FROM prompt_logs
|
|
78
|
+
${e.clause}
|
|
79
|
+
ORDER BY created_at DESC
|
|
80
|
+
LIMIT ${h} OFFSET ${i}
|
|
81
|
+
`,e.params),n=[],o=[];if(b.includeOptions){let b=await v(a);n=b.models,o=b.stages}return{rows:m,total:Number(g?.count||0),models:n,stages:o,dbInfo:{type:a.type,host:a.host,database:a.database}}}finally{await d.close()}}async function y(){let a=await l();if(!a.enabled)return{disabled:!0,models:[],stages:[],dbInfo:{type:a.type}};if(await t(a),"sqlite"===a.type)return u(a);if("postgres"===a.type||"mysql"===a.type)return v(a);throw Error(`Unsupported prompt log database type: ${a.type}`)}async function z(a={}){let b=await l(),c=function(a={}){return{keyword:k(a.keyword),model:k(a.model),stage:k(a.stage),sessionId:k(a.sessionId),clientIp:k(a.clientIp),sourceTool:k(a.sourceTool),dateFrom:k(a.dateFrom),dateTo:k(a.dateTo),limit:j(a.limit,50,200),offset:j(a.offset,0),includeOptions:!0===a.includeOptions}}(a);if(!b.enabled)return{disabled:!0,rows:[],total:0,models:[],stages:[],dbInfo:{type:b.type}};if(await t(b),"sqlite"===b.type)return w(b,c);if("postgres"===b.type||"mysql"===b.type)return x(b,c);throw Error(`Unsupported prompt log database type: ${b.type}`)}async function A(a){let b=await l();if("sqlite"===b.type){if(!e().existsSync(b.sqlitePath))return null;let c=await m(b.sqlitePath);try{return c.get("SELECT * FROM prompt_logs WHERE id = @id",{id:a})||null}finally{c.close()}}if("postgres"===b.type){let c=await n(b);try{return await c.queryOne("SELECT * FROM prompt_logs WHERE id = $1",[a])}finally{await c.close()}}if("mysql"===b.type){let c=await o(b);try{return await c.queryOne("SELECT * FROM prompt_logs WHERE id = ?",[a])}finally{await c.close()}}throw Error(`Unsupported prompt log database type: ${b.type}`)}async function B(a){let b=await l();if("sqlite"===b.type){if(!e().existsSync(b.sqlitePath))return{changed:0};let c=await m(b.sqlitePath);try{return{changed:c.run("DELETE FROM prompt_logs WHERE id = @id",{id:a}).changes||0}}finally{c.close()}}if("postgres"===b.type){let c=await n(b);try{let b=await c.queryOne("SELECT COUNT(*) AS count FROM prompt_logs WHERE id = $1",[a]);return await c.exec("DELETE FROM prompt_logs WHERE id = $1",[a]),{changed:Number(b?.count||0)}}finally{await c.close()}}if("mysql"===b.type){let c=await o(b);try{return await c.exec("DELETE FROM prompt_logs WHERE id = ?",[a]),{changed:1}}finally{await c.close()}}throw Error(`Unsupported prompt log database type: ${b.type}`)}}};
|