(env: string)
| 35 | |
| 36 | /** One-key guidance block: where to get it + the three ways to set it. PURE. */ |
| 37 | export function keyGuidance(env: string): string { |
| 38 | const k = findServiceKey(env); |
| 39 | const from = k ? `Get a key at ${k.url}${k.freeTier ? ' (free tier available)' : ''} — it unlocks ${k.unlocks}.` : `This needs the ${env} environment variable.`; |
| 40 | return [ |
| 41 | from, |
| 42 | 'Then any of:', |
| 43 | ` • paste the key here in chat — I'll store it safely (~/.qodex/.env, chmod 600) and continue your task`, |
| 44 | ` • add \`${env}=<key>\` to ~/.qodex/.env yourself`, |
| 45 | ` • or \`export ${env}=<key>\` in your shell`, |
| 46 | ].join('\n'); |
| 47 | } |
| 48 | |
| 49 | /** Which web keys are set / missing, given an env-like map. PURE. */ |
| 50 | export function webKeyStatus(env: Record<string, string | undefined>): { set: ServiceKey[]; missing: ServiceKey[] } { |
no test coverage detected