MCPcopy Create free account
hub / github.com/SethGammon/Citadel / tomlValue

Function tomlValue

scripts/codex-compat.js:231–247  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

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
234const 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
243function tomlEscape(str) {
244 return String(str).replace(/\\/g, '\\\\').replace(/"/g, '\\"');
245}
246
247function 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);

Callers 1

mcpServerToTomlFunction · 0.85

Calls 1

tomlEscapeFunction · 0.85

Tested by

no test coverage detected