/** * V3 CLI Daemon Command * Manages background worker daemon (Node.js-based, similar to shell helpers) */ import type { Command } from '../types.js'; /** * #1914: Resolve the `--workspace` flag to an absolute path, or return null * if it is absent / not a usable string. Rejects values with null bytes or * shell metacharacters (defence-in-depth — the value is later embedded in a * forked child's argv and compared against `ps`/`tasklist` output). */ export declare function resolveWorkspaceFlag(raw: unknown): string | null; /** * #1914: True when a process command line (from `ps -eo command` on POSIX or * the tasklist Window Title column on Windows) belongs to a daemon started * for `workspaceRoot`. The launcher (`startBackgroundDaemon`) always appends * `--workspace ` as the FINAL argv entry, so an exact trailing match * after stripping trailing whitespace/quotes is unambiguous — even for * workspace paths containing spaces — and never a bare path-prefix match, * so workspace `/a/proj` does not reap `/a/proj-other`'s daemon. A daemon * whose argv puts `--workspace` mid-list (only possible via a hand-rolled * invocation) simply won't be auto-reaped — `daemon stop` still handles it * via the PID file. */ export declare function daemonCommandLineBelongsToWorkspace(commandLine: string, workspaceRoot: string): boolean; /** * #2356: extract the workspace root from a daemon process command line for the * global `daemon status --all` view. The launcher always appends * `--workspace ` as the FINAL argv entry (see startBackgroundDaemon), so * we capture everything after it to end-of-line and strip trailing quotes. * Returns null for pre-#1914 daemons that never stamped a workspace. */ export declare function extractWorkspaceFromDaemonLine(commandLine: string): string | null; /** * #2661 root-fix — one-time upgrade migration warning. A user who had * `aiWorkersEnabled: true` configured BEFORE this fix landed (old config * file or RUFLO_DAEMON_AI_WORKERS=1) and already has multiple worktree * daemons running is exactly the P0 scenario the issue describes — surface * it plainly, ONCE ever (not on every `daemon start`, which would just be * noise once the user has seen and acted on it). The supervisor/lease * mechanism (task #9) already makes only one of those daemons actually * schedule AI workers going forward; this warning's job is purely to make * a pre-existing fleet VISIBLE the first time this code runs, not to take * any destructive action — nothing here stops or kills another daemon. * * `opts` exists for tests ONLY, mirroring the injectable-dependency pattern * used elsewhere in this codebase (e.g. helper-refresh.ts's * sourceDirOverride) — real callers always use the defaults. */ export declare function maybeShowMultiDaemonMigrationWarning(opts?: { markerFile?: string; fleetScanner?: () => Promise>; }): Promise; export declare const daemonCommand: Command; export default daemonCommand; //# sourceMappingURL=daemon.d.ts.map