import type { BrowserProfileConfig } from '../types.js';
export interface ProfileDeclaration {
    device: string;
    config: BrowserProfileConfig;
}
/**
 * The leftover central `browser:` tombstone from before per-device declarations.
 * Empty when none remain — and `agents sync` now drains it automatically via
 * {@link autoEvictCentralBrowserProfiles}, so on a synced box this is empty and
 * {@link profileRegistry} is the single source of truth. It survives only to
 * fold in migration and to explain an as-yet-unclaimed profile in a resolve
 * error (a profile hostable on a peer that has not synced yet), never as a
 * parallel store callers read for resolution.
 */
export declare function centralBrowserProfiles(): Record<string, BrowserProfileConfig>;
export interface CentralClaimResult {
    claimed: string[];
    skipped: string[];
}
/**
 * Fold leftover central `browser:` entries into THIS device's declaration file.
 *
 * The EXPLICIT operator action (`agents browser profiles claim`), run on the
 * machine that actually owns the browser. It is never called implicitly from a
 * read, and that is the point: every device can read the central map, so an
 * implicit claim races — whichever box reads first claims the name, {@link
 * profileKind} then reports it `identity`, and the daemon tunnels to that box,
 * which for a fleet-wide `cdp://localhost:*` profile is a logged-out headless
 * browser wearing a credentialed browser's name. {@link autoEvictCentralBrowserProfiles}
 * closes that race for the automatic path (host-gated + non-throwing on sync);
 * this one is the manual, throw-on-conflict counterpart.
 *
 * `canHostHere` is supplied by the command layer so this module stays a leaf —
 * it must not import `isProfileLaunchableHere` (that would cycle through
 * chrome.ts → profiles.ts). Only profiles this machine can host are claimed; the
 * rest stay central, undeclared, and fail loudly on resolve.
 */
export declare function migrateCentralBrowserProfiles(canHostHere: (config: BrowserProfileConfig) => boolean, name?: string): CentralClaimResult;
/**
 * Automatic, self-draining counterpart to {@link migrateCentralBrowserProfiles}:
 * fold every lingering central `browser:` profile THIS machine can host into its
 * device doc and clear it from central, so the tombstone drains itself on
 * `agents sync` with no manual `agents browser profiles claim`.
 *
 * Safe to call implicitly, unlike a claim at registry-read time (which races —
 * see the `profileRegistry does not claim central declarations` guard), but the
 * CALLER owns one ordering invariant: invoke it AFTER the sync's repo pull. Two
 * boxes can both host the same profile (`canHostHere` is launchability, not
 * ownership), so a box acting on a PRE-pull view of central could re-claim a
 * profile a peer already drained and pushed — both writes land in different
 * device files with no git conflict, and the profile flips identity->fungible.
 * Running post-pull means central already reflects peers' drains, so the tombstone
 * is gone locally before this box looks. The selection is also computed INSIDE
 * the meta lock, and the path never throws — an unhostable profile or one that
 * conflicts with an existing local declaration is left central for an explicit
 * claim rather than wedging the sync. After it runs, {@link profileRegistry} is
 * the single source of truth: a claimed profile lives in the device doc alone,
 * never double-counted across the two stores.
 */
export declare function autoEvictCentralBrowserProfiles(canHostHere: (config: BrowserProfileConfig) => boolean): CentralClaimResult;
/**
 * Every profile any device declares, keyed by name to all declaring devices.
 * Reads every `devices/<name>/agents.yaml`; declarations never overwrite.
 */
export declare function profileRegistry(): Map<string, ProfileDeclaration[]>;
/** Devices declaring `name`, empty when nobody does. */
export declare function declaringDevices(name: string): string[];
/** Exactly one declaring device is identity-bearing; several are fungible. */
export declare function profileKind(name: string): 'identity' | 'fungible' | null;
