export interface CompanionPairingResult {
    readonly token: string;
    readonly peerId: string;
    readonly createdAt: number;
}
export interface CompanionConnectionInfo {
    readonly url: string;
    readonly token: string;
    readonly username: string;
    readonly version: string;
    readonly surface: string;
    /** Bootstrap password for companion authentication (omitted if not applicable). */
    readonly password?: string | undefined;
}
export interface CompanionTokenRecord {
    readonly token: string;
    readonly peerId: string;
    readonly createdAt: number;
}
export interface CompanionTokenOptions {
    readonly daemonHomeDir: string;
    readonly regenerate?: boolean | undefined;
}
export interface PruneStaleOperatorTokensOptions {
    readonly daemonHomeDir: string;
    readonly candidatePaths?: readonly string[] | undefined;
}
export interface PruneStaleOperatorTokensResult {
    readonly canonicalPath: string;
    readonly prunedPaths: readonly string[];
    readonly failedPaths: readonly string[];
    readonly skippedPaths: readonly string[];
}
/**
 * Load the stored companion token, or generate and persist a new one.
 * Token is always written to <daemonHomeDir>/operator-tokens.json at mode 0600.
 */
export declare function getOrCreateCompanionToken(options: CompanionTokenOptions): CompanionPairingResult;
export declare function getOrCreateCompanionToken(surface: string, options: CompanionTokenOptions): CompanionPairingResult;
/**
 * Regenerate the companion token, replacing any existing token.
 * Written to <daemonHomeDir>/operator-tokens.json at mode 0600.
 */
export declare function regenerateCompanionToken(options: CompanionTokenOptions): CompanionPairingResult;
export declare function pruneStaleOperatorTokens(options: PruneStaleOperatorTokensOptions): PruneStaleOperatorTokensResult;
/**
 * Build a CompanionConnectionInfo object from raw parameters.
 */
export declare function buildCompanionConnectionInfo(options: {
    daemonUrl: string;
    token: string;
    username?: string | undefined;
    password?: string | undefined;
    version?: string | undefined;
    surface?: string | undefined;
}): CompanionConnectionInfo;
/**
 * Encode a CompanionConnectionInfo as a JSON string suitable for QR encoding.
 */
export declare function encodeConnectionPayload(info: CompanionConnectionInfo): string;
//# sourceMappingURL=companion-token.d.ts.map