import type { HostEntry } from '../types.js';
import type { IgnoredDeviceEntry } from '../fleet/types.js';
/** One parsed device doc under `~/.agents/devices/`. */
export interface DeviceDoc {
    device: string;
    doc: Record<string, unknown>;
}
/**
 * Every device doc, sorted by device name so the union is order-independent. A
 * corrupt or non-map doc throws (loud), never silently skipped — a dropped doc
 * would let the next writer clobber that peer's slice.
 */
export declare function readAllDeviceDocs(): DeviceDoc[];
/**
 * Union the per-box `fleet.discovery` maps. Precedence for a name declared by
 * more than one box is deterministic and order-independent: `ignored` beats
 * `approved` (a dismissal on any box wins), so every box computes the identical
 * effective policy regardless of walk order.
 */
export declare function unionDeviceDiscovery(docs?: DeviceDoc[]): Record<string, 'approved' | 'ignored'>;
/**
 * Union the per-box `fleet.ignored` dismissal lists by node name. When two boxes
 * dismissed the same node, the entry with the newest `ignoredAt` wins (ties
 * broken by `ignoredOn`), so the attribution is deterministic and
 * order-independent. Sorted by name to match the central writer's ordering.
 */
export declare function unionDeviceIgnored(docs?: DeviceDoc[]): IgnoredDeviceEntry[];
/** Insert/replace a dismissal, newest ignoredAt (then ignoredOn) winning. */
export declare function addIgnoredEntry(byName: Map<string, IgnoredDeviceEntry>, entry: IgnoredDeviceEntry): void;
/**
 * Union the per-box `hosts:` registries by host name. When two boxes registered
 * the same name, the newest `addedAt` wins (ties broken by device name), so the
 * merged directory is deterministic. Entries missing `addedAt` sort oldest.
 */
export declare function unionDeviceHosts(docs?: DeviceDoc[]): Record<string, HostEntry>;
