import type { Command } from 'commander'; /** * Parse a human-readable size literal (`5MB`, `1024`, `5KB`) into bytes. * Accepts the suffix-less form too (interpreted as bytes). Returns null * when the input cannot be parsed so the caller can issue a clear error. */ export declare function parseSize(value: string): number | null; interface RotateOptions { maxSize?: string; maxFiles?: string; tee?: boolean; } export interface ResolvedRotateOptions { maxBytes: number; maxFiles: number; teeEnabled: boolean; } /** * Pure-function validator extracted so unit tests can exercise the * --max-size / --max-files / --no-tee parsing without spawning a real * stdin pipe. Returns either the resolved numeric options or an * already-localized error message the caller can `logger.error` on. */ export declare function resolveRotateOptions(opts: RotateOptions): { ok: true; value: ResolvedRotateOptions; } | { ok: false; error: string; }; /** * Stream stdin → a `RotatingFileWriter`, optionally tee-ing each chunk * back to stdout so an outer pipeline (e.g. the wrapper script's docker * subprocess) can still observe the agent's output. Default: tee enabled * so the existing systemd / launchd `StandardOutput` redirection (the * fallback container of last resort) keeps receiving everything. * * Designed for the per-project wrapper script: * * docker run ... 2>&1 | ai-support-agent log-rotate * * Lives outside the normal agent process tree so a crash in the agent * never strands the writer (it just sees EOF on stdin and exits). */ /** * Sink the tee writes its chunks to. Defaults to the real stdout but is * injectable so tests can observe tee behaviour without spying on * `process.stdout.write` — spying on / replacing `process.stdout.write` inside * a test interferes with Jest's own reporter and hangs the Jest worker on CI. */ export interface TeeSink { write(chunk: Buffer): void; } export declare function registerLogRotateCommand(program: Command, teeSink?: TeeSink): void; export {}; //# sourceMappingURL=log-rotate-command.d.ts.map