/**
 * Machine-level configuration for Proletariat headquarters.
 *
 * This module manages the ~/.proletariat/config.json registry that tracks
 * all known headquarters on the machine, solving the HQ discovery
 * chicken-and-egg problem.
 *
 * Registry schema:
 * {
 *   "version": "1.0.0",
 *   "headquarters": [
 *     { "name": "hq-name", "path": "/absolute/path", "registeredAt": "ISO8601" }
 *   ],
 *   "activeHeadquarters": "/absolute/path" | null
 * }
 */
export interface Organization {
    name: string;
    createdAt: string;
}
export interface RegisteredHeadquarters {
    name: string;
    path: string;
    registeredAt: string;
    orgName?: string;
}
/** @deprecated Use RegisteredHeadquarters instead */
export type RegisteredWorkspace = RegisteredHeadquarters;
export interface MachineConfig {
    type: 'machine';
    version: string;
    organizations: Organization[];
    headquarters: RegisteredHeadquarters[];
    activeHeadquarters: string | null;
    activeOrganization: string | null;
    /** @deprecated Use headquarters instead */
    workspaces?: RegisteredHeadquarters[];
    /** @deprecated Use activeHeadquarters instead */
    activeWorkspace?: string | null;
}
/**
 * Get the path to the machine-level config directory (~/.proletariat/).
 * Uses process.env.HOME when set (for testability), falling back to os.homedir().
 */
export declare function getMachineConfigDir(): string;
/**
 * Get the path to the machine-level config file (~/.proletariat/config.json).
 */
export declare function getMachineConfigPath(): string;
/**
 * Ensure the machine config directory exists.
 * Creates ~/.proletariat/ if it doesn't exist.
 */
export declare function ensureMachineConfigDir(): void;
/**
 * Normalize a workspace path for consistent storage.
 * - Resolves symlinks
 * - Makes path absolute
 * - Removes trailing slashes
 */
export declare function normalizePath(inputPath: string): string;
/**
 * Read the machine config file.
 * Returns a default empty config if file doesn't exist or is invalid.
 * Handles migration from old 'workspaces' format to new 'headquarters' format.
 */
export declare function readMachineConfig(): MachineConfig;
/**
 * Write the machine config file atomically.
 * Uses write-to-temp-then-rename pattern for safety.
 */
export declare function writeMachineConfig(config: MachineConfig): void;
/**
 * Register a headquarters in the machine config.
 *
 * @param hqPath Absolute path to the headquarters (will be normalized)
 * @param name Optional HQ name (defaults to directory basename)
 * @param setActive If true, set as active HQ when no active HQ exists
 * @param orgName Optional organization name to associate this HQ with
 * @returns The registered headquarters entry
 */
export declare function registerHeadquarters(hqPath: string, name?: string, setActive?: boolean, orgName?: string): RegisteredHeadquarters;
/** @deprecated Use registerHeadquarters instead */
export declare const registerWorkspace: typeof registerHeadquarters;
/**
 * Unregister a headquarters from the machine config.
 *
 * @param pathOrName HQ path or name to unregister
 * @returns true if HQ was found and removed, false otherwise
 */
export declare function unregisterHeadquarters(pathOrName: string): boolean;
/** @deprecated Use unregisterHeadquarters instead */
export declare const unregisterWorkspace: typeof unregisterHeadquarters;
/**
 * Get all registered headquarters.
 */
export declare function getRegisteredHeadquarters(): RegisteredHeadquarters[];
/** @deprecated Use getRegisteredHeadquarters instead */
export declare const getRegisteredWorkspaces: typeof getRegisteredHeadquarters;
/**
 * Get the active headquarters path.
 * Returns null if no active HQ is set.
 */
export declare function getActiveHeadquarters(): string | null;
/** @deprecated Use getActiveHeadquarters instead */
export declare const getActiveWorkspace: typeof getActiveHeadquarters;
/**
 * Set the active headquarters.
 *
 * @param pathOrName HQ path or name
 * @returns The path of the HQ that was set as active
 * @throws Error if HQ not found or not valid
 */
export declare function setActiveHeadquarters(pathOrName: string): string;
/** @deprecated Use setActiveHeadquarters instead */
export declare const setActiveWorkspace: typeof setActiveHeadquarters;
/**
 * Find headquarters by name.
 * Returns array of matches (may be multiple if names are not unique).
 */
export declare function findHeadquartersByName(name: string): RegisteredHeadquarters[];
/** @deprecated Use findHeadquartersByName instead */
export declare const findWorkspacesByName: typeof findHeadquartersByName;
/**
 * Find headquarters by path.
 */
export declare function findHeadquartersByPath(hqPath: string): RegisteredHeadquarters | null;
/** @deprecated Use findHeadquartersByPath instead */
export declare const findWorkspaceByPath: typeof findHeadquartersByPath;
/**
 * Check if a headquarters path is registered.
 */
export declare function isHeadquartersRegistered(hqPath: string): boolean;
/** @deprecated Use isHeadquartersRegistered instead */
export declare const isWorkspaceRegistered: typeof isHeadquartersRegistered;
/**
 * Get headquarters name from path (for existing HQ).
 * Reads the HQ config to get the name, or falls back to directory basename.
 */
export declare function getHeadquartersNameFromPath(hqPath: string): string;
/** @deprecated Use getHeadquartersNameFromPath instead */
export declare const getWorkspaceNameFromPath: typeof getHeadquartersNameFromPath;
/**
 * Check if there are duplicate headquarters names in the registry.
 */
export declare function hasDuplicateNames(): {
    name: string;
    paths: string[];
}[];
/**
 * Get all organizations.
 */
export declare function getOrganizations(): Organization[];
/**
 * Get the active organization name.
 */
export declare function getActiveOrganization(): string | null;
/**
 * Create a new organization.
 */
export declare function createOrganization(name: string): Organization;
/**
 * Set the active organization.
 */
export declare function setActiveOrganization(name: string): void;
/**
 * Get headquarters belonging to a specific organization.
 */
export declare function getOrganizationHeadquarters(orgName: string): RegisteredHeadquarters[];
/** @deprecated Use getOrganizationHeadquarters instead */
export declare const getOrganizationWorkspaces: typeof getOrganizationHeadquarters;
