(env: Record<string, string | undefined>)
| 58 | * the keyless engine) while content-grade backends sit unused for lack of a key. PURE. |
| 59 | */ |
| 60 | export function missingWebKeysGuidance(env: Record<string, string | undefined>): string | null { |
| 61 | const { set, missing } = webKeyStatus(env); |
| 62 | if (set.length > 0 || missing.length === 0) return null; // at least one content-grade backend works |
| 63 | const lines = [ |
| 64 | 'Web search/extract is limited right now: no search API key is set, so only the keyless fallback is available.', |
| 65 | 'To unlock a content-grade backend (pick ONE — all have free tiers):', |
| 66 | ...missing.map(k => ` • ${k.service}: ${k.url} → ${k.env} (${k.unlocks})`), |
| 67 | 'You can paste a key here in chat and I will store it safely (~/.qodex/.env) and retry — or add it to ~/.qodex/.env yourself.', |
| 68 | ]; |
| 69 | return lines.join('\n'); |
| 70 | } |
no test coverage detected