(value)
| 229 | // Future-proofing: when Claude or Codex adds new common keys, prefer |
| 230 | // extending CLAUDE_TO_CODEX_MAP. When Codex adds new Codex-only knobs, |
| 231 | // users can pass them through `_codex` immediately; we tighten the |
| 232 | // generator on the next pass. |
| 233 | |
| 234 | const CLAUDE_TO_CODEX_MAP = { |
| 235 | command: 'command', |
| 236 | args: 'args', |
| 237 | url: 'url', |
| 238 | cwd: 'cwd', |
| 239 | env: 'env', |
| 240 | headers: 'http_headers', |
| 241 | }; |
| 242 | |
| 243 | function tomlEscape(str) { |
| 244 | return String(str).replace(/\\/g, '\\\\').replace(/"/g, '\\"'); |
| 245 | } |
| 246 | |
| 247 | function tomlValue(value) { |
| 248 | if (value === null || value === undefined) return null; |
| 249 | if (typeof value === 'string') return `"${tomlEscape(value)}"`; |
| 250 | if (typeof value === 'number' || typeof value === 'boolean') return String(value); |
no test coverage detected