(overrides = {})
| 5 | import { fileURLToPath } from 'url' |
| 6 | |
| 7 | export function resolveGatewayConfig(overrides = {}) { |
| 8 | return { |
| 9 | host: overrides.host || process.env.GATEWAY_HOST || '127.0.0.1', |
| 10 | port: Number.parseInt( |
| 11 | String(overrides.port || process.env.GATEWAY_PORT || '8787'), |
| 12 | 10, |
| 13 | ), |
| 14 | upstreamBaseUrl: |
| 15 | overrides.upstreamBaseUrl || process.env.OPENAI_COMPAT_BASE_URL || '', |
| 16 | upstreamApiKey: |
| 17 | overrides.upstreamApiKey || process.env.OPENAI_COMPAT_API_KEY || '', |
| 18 | upstreamModel: overrides.upstreamModel || process.env.OPENAI_COMPAT_MODEL || '', |
| 19 | upstreamChatPath: |
| 20 | overrides.upstreamChatPath || |
| 21 | process.env.OPENAI_COMPAT_CHAT_PATH || |
| 22 | '/chat/completions', |
| 23 | textMode: |
| 24 | overrides.textMode || process.env.UPSTREAM_TEXT_MODE || 'openai', |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | // ── Soul injection ────────────────────────────────────── |
| 29 | // Reads .claw/bootstrap/*.md from the workspace directory and caches the result. |
no outgoing calls
no test coverage detected