export declare function normalizeRoutineNames(names: Iterable<string>): string[];
/** null means this device has not materialized activation state yet. */
export declare function enabledRoutineNames(): string[] | null;
export declare function routineEnabledOnThisDevice(name: string): boolean | null;
export declare function replaceEnabledRoutines(names: Iterable<string>): string[];
/**
 * Add or remove one routine on this machine. `legacyEnabledNames` seeds the
 * manifest the first time an upgraded host changes activation, preserving every
 * other routine that was effectively enabled under the old definition fields.
 */
export declare function setRoutineEnabledOnThisDevice(name: string, enabled: boolean, legacyEnabledNames?: Iterable<string>): string[];
/** Read-only fleet view from synced device documents. Never writes a peer file. */
export declare function devicesWithRoutineEnabled(name: string): string[];
/** Which devices enable which routines, read in one pass. */
export interface RoutineDeviceIndex {
    /** Routine name → the devices whose allowlist names it, sorted. */
    byRoutine: Map<string, string[]>;
    /**
     * True when at least one device document declares a `routines:` list. Until
     * then no routine is "dark" — the fleet simply has not materialized its
     * activation state yet, and saying "will not fire" would be wrong.
     */
    materialized: boolean;
    /** Device files that could not be read, reported instead of thrown. */
    errors: string[];
}
/**
 * Build the whole fleet's activation map in one pass over `devices/`.
 *
 * `devicesWithRoutineEnabled` answers this for a single routine and throws on a
 * corrupt peer file — the right contract for a command acting on one routine,
 * the wrong one for a listing, where a single unreadable device document would
 * blank out every row (and re-walking `devices/` per routine is quadratic).
 */
export declare function routineDeviceIndex(): RoutineDeviceIndex;
export declare function currentRoutineDevice(): string;
