interface ParsedIdleTimeout

Result of parseIdleTimeout: the resolved idle window plus an optional human-readable warning the caller should surface to the user.

const parsed: ParsedIdleTimeout = parseIdleTimeout('45s');
parsed.ms; // 45_000
parsed.warning; // null

Properties

ms: number

Milliseconds. Infinity when the user opts out of auto-shutdown via "false".

warning: string | null

Human-readable explanation, set when the env value was malformed. The caller is expected to print this on the spawning CLI's stderr so the user sees it — the daemon process detaches with stdio: 'ignore', so a warning emitted from inside the daemon would be invisible.

Usage

import { type ParsedIdleTimeout } from "lib/commands/daemon/parse-idle-timeout.ts";