/** * Small utilities shared across daemon and term modules. */ /** * Ensure the parent directory of a file path exists. Used by every * caller that's about to write to disk and is fine with a no-op if the * path is already at the cwd. */ export declare function ensureDir(filePath: string): void; /** * Register the same handler for SIGTERM and SIGINT. Both signals route * to graceful shutdown across the daemon and CLI entry points; doing it * once here keeps the three call sites in lockstep. */ export declare function registerGracefulShutdown(handler: () => void): void; /** * Read git branch + short SHA from `cwd` (defaults to process.cwd()). * Returns nulls when not in a git repo or git is missing — never throws. * The 3s timeout prevents a stuck git process (e.g. an interactive * credential prompt) from hanging the caller. */ export declare function detectGit(cwd?: string): { branch: string | null; commit: string | null; }; /** * Escape HTML text content. Note we escape `'` too — single quotes can sit * inside attributes and a half-escaped string is a real source of subtle * injection bugs. Earlier copies of this function disagreed on whether to * escape `'`; consolidating here picks the safer behavior for everyone. */ export declare function escapeHtml(s: string): string; /** Alias kept for callers that use the term `escapeAttr`. */ export declare const escapeAttr: typeof escapeHtml; //# sourceMappingURL=utils.d.ts.map