MCPcopy
hub / github.com/afar1/fieldtheory-cli / redactSecrets

Function redactSecrets

src/engine.ts:312–317  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

310 * `~/.fieldtheory/library/log.md` forever.
311 */
312export function redactSecrets(s: string): string {
313 return s
314 .replace(/\bsk-[A-Za-z0-9_-]{16,}/g, 'sk-***REDACTED***')
315 .replace(/\b(ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{16,}/g, '$1_***REDACTED***')
316 .replace(/\bBearer\s+[A-Za-z0-9._-]{16,}/gi, 'Bearer ***REDACTED***');
317}
318
319/** Build a user-facing failure message. Deliberately does NOT inline the
320 * prompt — see EngineInvocationError for why. */

Callers 3

invokeEngineFunction · 0.85
stderrTailFunction · 0.85
engine.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected