fix(auth): remove fallback gemini oauth client secret

Stop shipping a default Gemini OAuth client secret and require it to
come from the environment instead.

Also tighten proxy fetch typing to avoid any-based undici calls and
move db setup utilities under scripts while removing generated debug
and scratch artifacts.
This commit is contained in:
diegosouzapw
2026-04-08 17:29:28 -03:00
parent d9f4166418
commit 7bd8ace1a2
18 changed files with 31 additions and 5419 deletions

View File

@@ -1 +0,0 @@
[ 32698ms] [ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:20130/dashboard/usage?_rsc=18t7j:0

View File

@@ -1,158 +0,0 @@
- generic [active] [ref=e1]:
- link "Skip to content" [ref=e2] [cursor=pointer]:
- /url: "#main-content"
- generic [ref=e3]:
- complementary [ref=e5]:
- link "Skip to content" [ref=e6] [cursor=pointer]:
- /url: "#main-content"
- link "OmniRoute v3.5.0" [ref=e12] [cursor=pointer]:
- /url: /dashboard
- img [ref=e14]
- generic [ref=e26]:
- heading "OmniRoute" [level=1] [ref=e27]
- generic [ref=e28]: v3.5.0
- navigation "Main navigation" [ref=e29]:
- generic [ref=e30]:
- link "home Home" [ref=e31] [cursor=pointer]:
- /url: /dashboard
- generic [ref=e32]: home
- generic [ref=e33]: Home
- link "api Endpoints" [ref=e34] [cursor=pointer]:
- /url: /dashboard/endpoint
- generic [ref=e35]: api
- generic [ref=e36]: Endpoints
- link "vpn_key API Manager" [ref=e37] [cursor=pointer]:
- /url: /dashboard/api-manager
- generic [ref=e38]: vpn_key
- generic [ref=e39]: API Manager
- link "dns Providers" [ref=e40] [cursor=pointer]:
- /url: /dashboard/providers
- generic [ref=e41]: dns
- generic [ref=e42]: Providers
- link "layers Combos" [ref=e43] [cursor=pointer]:
- /url: /dashboard/combos
- generic [ref=e44]: layers
- generic [ref=e45]: Combos
- link "auto_awesome Auto Combo" [ref=e46] [cursor=pointer]:
- /url: /dashboard/auto-combo
- generic [ref=e47]: auto_awesome
- generic [ref=e48]: Auto Combo
- link "account_balance_wallet Costs" [ref=e49] [cursor=pointer]:
- /url: /dashboard/costs
- generic [ref=e50]: account_balance_wallet
- generic [ref=e51]: Costs
- link "analytics Analytics" [ref=e52] [cursor=pointer]:
- /url: /dashboard/analytics
- generic [ref=e53]: analytics
- generic [ref=e54]: Analytics
- link "tune Limits & Quotas" [ref=e55] [cursor=pointer]:
- /url: /dashboard/limits
- generic [ref=e56]: tune
- generic [ref=e57]: Limits & Quotas
- link "cached Cache" [ref=e58] [cursor=pointer]:
- /url: /dashboard/cache
- generic [ref=e59]: cached
- generic [ref=e60]: Cache
- link "perm_media Media" [ref=e61] [cursor=pointer]:
- /url: /dashboard/cache/media
- generic [ref=e62]: perm_media
- generic [ref=e63]: Media
- generic [ref=e64]:
- paragraph [ref=e65]: CLI
- link "terminal Tools" [ref=e66] [cursor=pointer]:
- /url: /dashboard/cli-tools
- generic [ref=e67]: terminal
- generic [ref=e68]: Tools
- link "smart_toy Agents" [ref=e69] [cursor=pointer]:
- /url: /dashboard/agents
- generic [ref=e70]: smart_toy
- generic [ref=e71]: Agents
- link "psychology Memory" [ref=e72] [cursor=pointer]:
- /url: /dashboard/memory
- generic [ref=e73]: psychology
- generic [ref=e74]: Memory
- link "auto_fix_high Skills" [ref=e75] [cursor=pointer]:
- /url: /dashboard/skills
- generic [ref=e76]: auto_fix_high
- generic [ref=e77]: Skills
- generic [ref=e78]:
- paragraph [ref=e79]: System
- link "health_and_safety Health" [ref=e80] [cursor=pointer]:
- /url: /dashboard/health
- generic [ref=e81]: health_and_safety
- generic [ref=e82]: Health
- link "description Logs" [ref=e83] [cursor=pointer]:
- /url: /dashboard/logs
- generic [ref=e84]: description
- generic [ref=e85]: Logs
- link "history Audit Log" [ref=e86] [cursor=pointer]:
- /url: /dashboard/audit
- generic [ref=e87]: history
- generic [ref=e88]: Audit Log
- link "settings Settings" [ref=e89] [cursor=pointer]:
- /url: /dashboard/settings
- generic [ref=e90]: settings
- generic [ref=e91]: Settings
- generic [ref=e92]:
- paragraph [ref=e93]: Help
- link "menu_book Docs" [ref=e94] [cursor=pointer]:
- /url: /docs
- generic [ref=e95]: menu_book
- generic [ref=e96]: Docs
- link "bug_report Issues" [ref=e97] [cursor=pointer]:
- /url: https://github.com/diegosouzapw/OmniRoute/issues
- generic [ref=e98]: bug_report
- generic [ref=e99]: Issues
- generic [ref=e100]:
- button "restart_alt Restart" [ref=e101]:
- generic: restart_alt
- text: Restart
- button "power_settings_new Shutdown" [ref=e102]:
- generic: power_settings_new
- text: Shutdown
- main [ref=e103]:
- generic [ref=e104]:
- button "menu" [ref=e106]:
- generic: menu
- generic [ref=e107]:
- button "🇺🇸 EN expand_more" [ref=e109]:
- generic [ref=e110]: 🇺🇸
- generic [ref=e111]: EN
- generic: expand_more
- button "Switch to dark mode" [ref=e112]:
- generic: dark_mode
- button "logout" [ref=e113]:
- generic: logout
- generic [ref=e115]:
- navigation "Breadcrumb" [ref=e116]:
- link "Dashboard" [ref=e118] [cursor=pointer]:
- /url: /dashboard
- generic [ref=e119]:
- generic [ref=e120]:
- generic [ref=e121]: Onboarding
- generic [ref=e123]:
- generic [ref=e124]:
- generic [ref=e126]: "1"
- generic [ref=e129]: "2"
- generic [ref=e132]: "3"
- generic [ref=e135]: "4"
- generic [ref=e138]: "5"
- generic [ref=e139]:
- generic [ref=e140]:
- generic [ref=e141]: waving_hand
- heading "Welcome" [level=2] [ref=e142]
- generic [ref=e144]:
- paragraph [ref=e145]: OmniRoute is your local AI API proxy. It routes requests to multiple AI providers with load balancing, failover, and usage tracking.
- generic [ref=e146]:
- generic [ref=e147]:
- generic [ref=e148]: swap_horiz
- text: Multi-Provider
- generic [ref=e149]:
- generic [ref=e150]: monitoring
- text: Usage Tracking
- generic [ref=e151]:
- generic [ref=e152]: shield
- text: API Key Mgmt
- button "Get Started" [ref=e155] [cursor=pointer]
- button "Skip wizard entirely" [ref=e157] [cursor=pointer]
- alert [ref=e158]

File diff suppressed because it is too large Load Diff

View File

@@ -1,132 +0,0 @@
- generic [active] [ref=e1]:
- link "Skip to content" [ref=e2] [cursor=pointer]:
- /url: "#main-content"
- generic [ref=e3]:
- complementary [ref=e5]:
- link "Skip to content" [ref=e6] [cursor=pointer]:
- /url: "#main-content"
- link "OmniRoute v3.5.0" [ref=e12] [cursor=pointer]:
- /url: /dashboard
- img [ref=e14]
- generic [ref=e26]:
- heading "OmniRoute" [level=1] [ref=e27]
- generic [ref=e28]: v3.5.0
- navigation "Main navigation" [ref=e29]:
- generic [ref=e30]:
- link "home Home" [ref=e31] [cursor=pointer]:
- /url: /dashboard
- generic [ref=e32]: home
- generic [ref=e33]: Home
- link "api Endpoints" [ref=e34] [cursor=pointer]:
- /url: /dashboard/endpoint
- generic [ref=e35]: api
- generic [ref=e36]: Endpoints
- link "vpn_key API Manager" [ref=e37] [cursor=pointer]:
- /url: /dashboard/api-manager
- generic [ref=e38]: vpn_key
- generic [ref=e39]: API Manager
- link "dns Providers" [ref=e40] [cursor=pointer]:
- /url: /dashboard/providers
- generic [ref=e41]: dns
- generic [ref=e42]: Providers
- link "layers Combos" [ref=e43] [cursor=pointer]:
- /url: /dashboard/combos
- generic [ref=e44]: layers
- generic [ref=e45]: Combos
- link "auto_awesome Auto Combo" [ref=e46] [cursor=pointer]:
- /url: /dashboard/auto-combo
- generic [ref=e47]: auto_awesome
- generic [ref=e48]: Auto Combo
- link "account_balance_wallet Costs" [ref=e49] [cursor=pointer]:
- /url: /dashboard/costs
- generic [ref=e50]: account_balance_wallet
- generic [ref=e51]: Costs
- link "analytics Analytics" [ref=e52] [cursor=pointer]:
- /url: /dashboard/analytics
- generic [ref=e53]: analytics
- generic [ref=e54]: Analytics
- link "tune Limits & Quotas" [ref=e55] [cursor=pointer]:
- /url: /dashboard/limits
- generic [ref=e56]: tune
- generic [ref=e57]: Limits & Quotas
- link "cached Cache" [ref=e58] [cursor=pointer]:
- /url: /dashboard/cache
- generic [ref=e59]: cached
- generic [ref=e60]: Cache
- link "perm_media Media" [ref=e61] [cursor=pointer]:
- /url: /dashboard/cache/media
- generic [ref=e62]: perm_media
- generic [ref=e63]: Media
- generic [ref=e64]:
- paragraph [ref=e65]: CLI
- link "terminal Tools" [ref=e66] [cursor=pointer]:
- /url: /dashboard/cli-tools
- generic [ref=e67]: terminal
- generic [ref=e68]: Tools
- link "smart_toy Agents" [ref=e69] [cursor=pointer]:
- /url: /dashboard/agents
- generic [ref=e70]: smart_toy
- generic [ref=e71]: Agents
- link "psychology Memory" [ref=e72] [cursor=pointer]:
- /url: /dashboard/memory
- generic [ref=e73]: psychology
- generic [ref=e74]: Memory
- link "auto_fix_high Skills" [ref=e75] [cursor=pointer]:
- /url: /dashboard/skills
- generic [ref=e76]: auto_fix_high
- generic [ref=e77]: Skills
- generic [ref=e78]:
- paragraph [ref=e79]: System
- link "health_and_safety Health" [ref=e80] [cursor=pointer]:
- /url: /dashboard/health
- generic [ref=e81]: health_and_safety
- generic [ref=e82]: Health
- link "description Logs" [ref=e83] [cursor=pointer]:
- /url: /dashboard/logs
- generic [ref=e84]: description
- generic [ref=e85]: Logs
- link "history Audit Log" [ref=e86] [cursor=pointer]:
- /url: /dashboard/audit
- generic [ref=e87]: history
- generic [ref=e88]: Audit Log
- link "settings Settings" [ref=e89] [cursor=pointer]:
- /url: /dashboard/settings
- generic [ref=e90]: settings
- generic [ref=e91]: Settings
- generic [ref=e92]:
- paragraph [ref=e93]: Help
- link "menu_book Docs" [ref=e94] [cursor=pointer]:
- /url: /docs
- generic [ref=e95]: menu_book
- generic [ref=e96]: Docs
- link "bug_report Issues" [ref=e97] [cursor=pointer]:
- /url: https://github.com/diegosouzapw/OmniRoute/issues
- generic [ref=e98]: bug_report
- generic [ref=e99]: Issues
- generic [ref=e100]:
- button "restart_alt Restart" [ref=e101]:
- generic: restart_alt
- text: Restart
- button "power_settings_new Shutdown" [ref=e102]:
- generic: power_settings_new
- text: Shutdown
- main [ref=e103]:
- generic [ref=e104]:
- button "menu" [ref=e106]:
- generic: menu
- generic [ref=e107]:
- button "🇺🇸 EN expand_more" [ref=e109]:
- generic [ref=e110]: 🇺🇸
- generic [ref=e111]: EN
- generic: expand_more
- button "Switch to dark mode" [ref=e112]:
- generic: dark_mode
- button "logout" [ref=e113]:
- generic: logout
- navigation "Breadcrumb" [ref=e116]:
- link "Dashboard" [ref=e118] [cursor=pointer]:
- /url: /dashboard
- generic [ref=e119]:
- generic [ref=e120]:
- generic [ref=e121]: Providers
- alert [ref=e135]

View File

@@ -1,203 +0,0 @@
{
"auditReportVersion": 2,
"vulnerabilities": {
"next": {
"name": "next",
"severity": "high",
"isDirect": true,
"via": [
{
"source": 1112592,
"name": "next",
"dependency": "next",
"title": "Next.js self-hosted applications vulnerable to DoS via Image Optimizer remotePatterns configuration",
"url": "https://github.com/advisories/GHSA-9g9p-9gw9-jx7f",
"severity": "moderate",
"cwe": ["CWE-400", "CWE-770"],
"cvss": {
"score": 5.9,
"vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
"range": ">=15.6.0-canary.0 <16.1.5"
},
{
"source": 1112646,
"name": "next",
"dependency": "next",
"title": "Next.js HTTP request deserialization can lead to DoS when using insecure React Server Components",
"url": "https://github.com/advisories/GHSA-h25m-26qc-wcjf",
"severity": "high",
"cwe": ["CWE-400", "CWE-502"],
"cvss": {
"score": 7.5,
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
"range": ">=16.0.0-beta.0 <16.0.11"
},
{
"source": 1112990,
"name": "next",
"dependency": "next",
"title": "Next.js has Unbounded Memory Consumption via PPR Resume Endpoint ",
"url": "https://github.com/advisories/GHSA-5f7q-jpqc-wp7h",
"severity": "moderate",
"cwe": ["CWE-400", "CWE-409", "CWE-770"],
"cvss": {
"score": 5.9,
"vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
"range": ">=16.0.0-beta.0 <16.1.5"
},
{
"source": 1114898,
"name": "next",
"dependency": "next",
"title": "Next.js: HTTP request smuggling in rewrites",
"url": "https://github.com/advisories/GHSA-ggv3-7p47-pfv8",
"severity": "moderate",
"cwe": ["CWE-444"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=16.0.0-beta.0 <16.1.7"
},
{
"source": 1114941,
"name": "next",
"dependency": "next",
"title": "Next.js: Unbounded next/image disk cache growth can exhaust storage",
"url": "https://github.com/advisories/GHSA-3x4c-7xq6-9pq8",
"severity": "moderate",
"cwe": ["CWE-400"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=16.0.0-beta.0 <16.1.7"
},
{
"source": 1114942,
"name": "next",
"dependency": "next",
"title": "Next.js: Unbounded postponed resume buffering can lead to DoS",
"url": "https://github.com/advisories/GHSA-h27x-g6w4-24gq",
"severity": "moderate",
"cwe": ["CWE-770"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=16.0.1 <16.1.7"
},
{
"source": 1114943,
"name": "next",
"dependency": "next",
"title": "Next.js: null origin can bypass Server Actions CSRF checks",
"url": "https://github.com/advisories/GHSA-mq59-m269-xvcx",
"severity": "moderate",
"cwe": ["CWE-352"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=16.0.1 <16.1.7"
},
{
"source": 1115360,
"name": "next",
"dependency": "next",
"title": "Next.js: null origin can bypass dev HMR websocket CSRF checks",
"url": "https://github.com/advisories/GHSA-jcc7-9wpm-mj36",
"severity": "low",
"cwe": ["CWE-1385"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=16.0.1 <16.1.7"
}
],
"effects": [],
"range": "15.6.0-canary.0 - 16.1.6",
"nodes": ["node_modules/next"],
"fixAvailable": {
"name": "next",
"version": "16.2.2",
"isSemVerMajor": false
}
},
"vite": {
"name": "vite",
"severity": "high",
"isDirect": false,
"via": [
{
"source": 1116007,
"name": "vite",
"dependency": "vite",
"title": "Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling",
"url": "https://github.com/advisories/GHSA-4w7w-66w2-5vf9",
"severity": "moderate",
"cwe": ["CWE-22", "CWE-200"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=8.0.0 <=8.0.4"
},
{
"source": 1116009,
"name": "vite",
"dependency": "vite",
"title": "Vite: `server.fs.deny` bypassed with queries",
"url": "https://github.com/advisories/GHSA-v2wj-q39q-566r",
"severity": "high",
"cwe": ["CWE-180", "CWE-284"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=8.0.0 <=8.0.4"
},
{
"source": 1116012,
"name": "vite",
"dependency": "vite",
"title": "Vite Vulnerable to Arbitrary File Read via Vite Dev Server WebSocket",
"url": "https://github.com/advisories/GHSA-p9ff-h696-f583",
"severity": "high",
"cwe": ["CWE-200", "CWE-306"],
"cvss": {
"score": 0,
"vectorString": null
},
"range": ">=8.0.0 <=8.0.4"
}
],
"effects": [],
"range": "8.0.0 - 8.0.4",
"nodes": ["node_modules/vite"],
"fixAvailable": true
}
},
"metadata": {
"vulnerabilities": {
"info": 0,
"low": 0,
"moderate": 0,
"high": 2,
"critical": 0,
"total": 2
},
"dependencies": {
"prod": 407,
"dev": 485,
"optional": 154,
"peer": 480,
"peerOptional": 0,
"total": 1455
}
}
}

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env node
import { spawn } from 'node:child_process'
const env = { ...process.env }
await exec('npx next build --experimental-build-mode generate')
// launch application
await exec(process.argv.slice(2).join(' '))
function exec(command) {
const child = spawn(command, { shell: true, stdio: 'inherit', env })
return new Promise((resolve, reject) => {
child.on('exit', code => {
if (code === 0) {
resolve()
} else {
reject(new Error(`${command} failed rc=${code}`))
}
})
})
}

1775
debug.log

File diff suppressed because it is too large Load Diff

View File

@@ -1,339 +0,0 @@
TAP version 13
# Subtest: Chat Pipeline — handleSingleModelChat decomposition
# Subtest: should define resolveModelOrError helper
ok 1 - should define resolveModelOrError helper
---
duration_ms: 2.870676
type: 'test'
...
# Subtest: should define checkPipelineGates helper
ok 2 - should define checkPipelineGates helper
---
duration_ms: 0.539959
type: 'test'
...
# Subtest: should define executeChatWithBreaker helper
ok 3 - should define executeChatWithBreaker helper
---
duration_ms: 0.540611
type: 'test'
...
# Subtest: should keep cost accounting in the core chat pipeline
ok 4 - should keep cost accounting in the core chat pipeline
---
duration_ms: 0.583888
type: 'test'
...
# Subtest: handleSingleModelChat should use resolveModelOrError
ok 5 - handleSingleModelChat should use resolveModelOrError
---
duration_ms: 0.395358
type: 'test'
...
# Subtest: handleSingleModelChat should use checkPipelineGates
ok 6 - handleSingleModelChat should use checkPipelineGates
---
duration_ms: 0.725771
type: 'test'
...
# Subtest: handleSingleModelChat should use executeChatWithBreaker
ok 7 - handleSingleModelChat should use executeChatWithBreaker
---
duration_ms: 0.384009
type: 'test'
...
# Subtest: chatCore should record cost for both non-streaming and streaming responses
ok 8 - chatCore should record cost for both non-streaming and streaming responses
---
duration_ms: 0.717301
type: 'test'
...
1..8
ok 1 - Chat Pipeline — handleSingleModelChat decomposition
---
duration_ms: 12.510313
type: 'suite'
...
# Subtest: Chat Pipeline — combo fallback support
# Subtest: should import handleComboChat
ok 1 - should import handleComboChat
---
duration_ms: 0.683569
type: 'test'
...
# Subtest: should delegate to handleSingleModelChat for each combo model
ok 2 - should delegate to handleSingleModelChat for each combo model
---
duration_ms: 0.903143
type: 'test'
...
# Subtest: should check model availability before attempting combo models
ok 3 - should check model availability before attempting combo models
---
duration_ms: 0.37494
type: 'test'
...
1..3
ok 2 - Chat Pipeline — combo fallback support
---
duration_ms: 2.526966
type: 'suite'
...
# Subtest: Chat Pipeline — circuit breaker integration
# Subtest: should import CircuitBreakerOpenError
ok 1 - should import CircuitBreakerOpenError
---
duration_ms: 0.500942
type: 'test'
...
# Subtest: should handle CircuitBreakerOpenError with retry-after
ok 2 - should handle CircuitBreakerOpenError with retry-after
---
duration_ms: 0.262275
type: 'test'
...
# Subtest: should reject requests when circuit is open
ok 3 - should reject requests when circuit is open
---
duration_ms: 0.399071
type: 'test'
...
1..3
ok 3 - Chat Pipeline — circuit breaker integration
---
duration_ms: 1.532005
type: 'suite'
...
# Subtest: DI Container — container.ts
# Subtest: should export a container singleton
ok 1 - should export a container singleton
---
duration_ms: 293.16418
type: 'test'
...
# Subtest: should register and resolve a custom service
ok 2 - should register and resolve a custom service
---
duration_ms: 9.047061
type: 'test'
...
# Subtest: should return cached singleton on repeated resolve
ok 3 - should return cached singleton on repeated resolve
---
duration_ms: 2.700355
type: 'test'
...
# Subtest: should throw on resolving unregistered service
ok 4 - should throw on resolving unregistered service
---
duration_ms: 3.280776
type: 'test'
...
# Subtest: should have default registrations
ok 5 - should have default registrations
---
duration_ms: 2.960963
type: 'test'
...
# Subtest: should support re-registration (overwrite)
ok 6 - should support re-registration (overwrite)
---
duration_ms: 2.683065
type: 'test'
...
1..6
ok 4 - DI Container — container.ts
---
duration_ms: 314.82733
type: 'suite'
...
# [Plugins] Registered "test-logger" (priority: 10, enabled: true)
# Subtest: Plugin Architecture — plugins/index.ts
# Subtest: should register and list plugins
ok 1 - should register and list plugins
---
duration_ms: 7.470741
type: 'test'
...
# [Plugins] Registered "low" (priority: 200, enabled: true)
# [Plugins] Registered "high" (priority: 1, enabled: true)
# [Plugins] Registered "mid" (priority: 50, enabled: true)
# Subtest: should sort plugins by priority
ok 2 - should sort plugins by priority
---
duration_ms: 3.51882
type: 'test'
...
# [Plugins] Registered "first" (priority: 1, enabled: true)
# [Plugins] Registered "second" (priority: 2, enabled: true)
# Subtest: should run onRequest hooks in order
ok 3 - should run onRequest hooks in order
---
duration_ms: 2.940782
type: 'test'
...
# [Plugins] Registered "blocker" (priority: 1, enabled: true)
# [Plugins] Registered "never-runs" (priority: 2, enabled: true)
# [Plugins] Request blocked by "blocker"
# Subtest: should support request blocking
ok 4 - should support request blocking
---
duration_ms: 3.293988
type: 'test'
...
# [Plugins] Registered "toggle-me" (priority: 100, enabled: true)
# Subtest: should enable/disable plugins at runtime
ok 5 - should enable/disable plugins at runtime
---
duration_ms: 2.784824
type: 'test'
...
# [Plugins] Registered "removable" (priority: 100, enabled: true)
# Subtest: should unregister plugins
ok 6 - should unregister plugins
---
duration_ms: 2.608295
type: 'test'
...
# [Plugins] Registered "response-modifier" (priority: 100, enabled: true)
# Subtest: should run onResponse hooks
ok 7 - should run onResponse hooks
---
duration_ms: 2.746361
type: 'test'
...
# [Plugins] Registered "error-handler" (priority: 100, enabled: true)
# [Plugins] Error recovered by "error-handler"
# Subtest: should run onError hooks and allow recovery
ok 8 - should run onError hooks and allow recovery
---
duration_ms: 2.899465
type: 'test'
...
# Subtest: should return null from onError if no recovery
ok 9 - should return null from onError if no recovery
---
duration_ms: 2.313171
type: 'test'
...
1..9
ok 5 - Plugin Architecture — plugins/index.ts
---
duration_ms: 31.770504
type: 'suite'
...
# Subtest: Prompt Template Versioning — prompts.ts module existence
# Subtest: prompts.ts should exist
ok 1 - prompts.ts should exist
---
duration_ms: 0.369635
type: 'test'
...
# Subtest: should export CRUD functions
ok 2 - should export CRUD functions
---
duration_ms: 0.391134
type: 'test'
...
# Subtest: should define PromptTemplate interface
ok 3 - should define PromptTemplate interface
---
duration_ms: 0.333598
type: 'test'
...
# Subtest: should use content hashing for deduplication
ok 4 - should use content hashing for deduplication
---
duration_ms: 0.31716
type: 'test'
...
1..4
ok 6 - Prompt Template Versioning — prompts.ts module existence
---
duration_ms: 1.752975
type: 'suite'
...
# Subtest: Eval Scheduler — scheduler.ts module existence
# Subtest: scheduler.ts should exist
ok 1 - scheduler.ts should exist
---
duration_ms: 0.347059
type: 'test'
...
# Subtest: should export scheduling functions
ok 2 - should export scheduling functions
---
duration_ms: 0.582836
type: 'test'
...
# Subtest: should define ScheduledEval and EvalRunResult types
ok 3 - should define ScheduledEval and EvalRunResult types
---
duration_ms: 0.459196
type: 'test'
...
# Subtest: should have pluggable output provider
ok 4 - should have pluggable output provider
---
duration_ms: 0.310267
type: 'test'
...
1..4
ok 7 - Eval Scheduler — scheduler.ts module existence
---
duration_ms: 1.961338
type: 'suite'
...
# Subtest: Migration System — files exist
# Subtest: migrationRunner.ts should exist
ok 1 - migrationRunner.ts should exist
---
duration_ms: 0.381312
type: 'test'
...
# Subtest: 001_initial_schema.sql should exist
ok 2 - 001_initial_schema.sql should exist
---
duration_ms: 0.248336
type: 'test'
...
# Subtest: core.ts should reference migration runner
ok 3 - core.ts should reference migration runner
---
duration_ms: 0.542947
type: 'test'
...
1..3
ok 8 - Migration System — files exist
---
duration_ms: 1.448447
type: 'suite'
...
# Subtest: CORS — centralized configuration
# Subtest: shared/utils/cors.ts should exist
ok 1 - shared/utils/cors.ts should exist
---
duration_ms: 0.374376
type: 'test'
...
# Subtest: should export CORS_HEADERS and CORS_ORIGIN
ok 2 - should export CORS_HEADERS and CORS_ORIGIN
---
duration_ms: 0.390035
type: 'test'
...
1..2
ok 9 - CORS — centralized configuration
---
duration_ms: 0.962465
type: 'suite'
...
1..9
# tests 42
# suites 9
# pass 42
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 869.387894

1772
debug3.log

File diff suppressed because it is too large Load Diff

View File

@@ -165,7 +165,7 @@ export async function runWithProxyContext(proxyConfig, fn) {
async function patchedFetch(input: RequestInfo | URL, options: FetchWithDispatcherOptions = {}) {
if (options?.dispatcher) {
return (undiciFetch as any)(input, options);
return (undiciFetch as unknown as (...args: unknown[]) => Promise<Response>)(input, options);
}
const targetUrl = getTargetUrl(input);
@@ -198,7 +198,7 @@ async function patchedFetch(input: RequestInfo | URL, options: FetchWithDispatch
if (store) store.used = false;
}
}
return (undiciFetch as any)(input, {
return (undiciFetch as unknown as (...args: unknown[]) => Promise<Response>)(input, {
...options,
dispatcher: getDefaultDispatcher(),
});
@@ -206,7 +206,10 @@ async function patchedFetch(input: RequestInfo | URL, options: FetchWithDispatch
try {
const dispatcher = createProxyDispatcher(proxyUrl);
return await (undiciFetch as any)(input, { ...options, dispatcher });
return await (undiciFetch as unknown as (...args: unknown[]) => Promise<Response>)(input, {
...options,
dispatcher,
});
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
console.error(`[ProxyFetch] Proxy request failed (${source}, fail-closed): ${message}`);

View File

23
scripts/dbsetup.js Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env node
import { spawn } from "node:child_process";
const env = { ...process.env };
await exec("npx next build --experimental-build-mode generate");
// launch application
await exec(process.argv.slice(2).join(" "));
function exec(command) {
const child = spawn(command, { shell: true, stdio: "inherit", env });
return new Promise((resolve, reject) => {
child.on("exit", (code) => {
if (code === 0) {
resolve();
} else {
reject(new Error(`${command} failed rc=${code}`));
}
});
});
}

View File

@@ -0,0 +1,2 @@
const { convertOpenAIContentToParts } = require("./open-sse/translator/helpers/geminiHelper.ts");
// since it's typescript/ESM, we might need a ts-node or vitest

View File

@@ -1,2 +0,0 @@
const { convertOpenAIContentToParts } = require('./open-sse/translator/helpers/geminiHelper.ts');
// since it's typescript/ESM, we might need a ts-node or vitest