import type { DeviceIdentity } from "./device.js"; export interface AdminEntry { userId: string; /** Already masked by the server — a full address never leaves the relay. */ maskedEmail: string; /** * The linked machine's hostname (e.g. "aic-studio"), NOT a label for the person. * Show it as secondary machine info only — use {@link maskedEmail} to identify * the account/operator. */ alias: string; linkedAt: string; lastSeenAt: string | null; /** True when the owner has blocked this account on this device. */ blocked: boolean; } export interface AdminsResult { /** True when the current code is still in its 1h no-account-needed window. */ codeFresh: boolean; admins: AdminEntry[]; } export interface BlockResult { ok: boolean; blocked?: number; unblocked?: number; /** Set on refusal/failure: "not_found" | other. */ error?: string; message?: string; } /** List the accounts linked to this device (masked emails). Throws on transport/auth/timeout failure. */ export declare function fetchAdmins(serverUrl: string, device: DeviceIdentity): Promise; /** * Block one account by userId. Never throws: returns a structured {@link BlockResult} * for ANY outcome, including a 4xx, a transport failure, or a request timeout. */ export declare function blockAdmin(serverUrl: string, device: DeviceIdentity, userId: string): Promise; /** * Unblock one account by userId, restoring its access. Never throws: returns a * structured {@link BlockResult} for ANY outcome, including a 4xx, a transport * failure, or a request timeout. */ export declare function unblockAdmin(serverUrl: string, device: DeviceIdentity, userId: string): Promise; /** * Stable display/resolution order: active accounts first, blocked ones last, * each group preserving the server's order. Used so a list index means the same * thing in `list-admins`, `block-admin`, and `unblock-admin`. */ export declare function orderAdmins(admins: AdminEntry[]): AdminEntry[]; export type ResolveResult = { kind: "ok"; admin: AdminEntry; } | { kind: "not_found"; } | { kind: "ambiguous"; matches: AdminEntry[]; }; /** * Resolve a user-typed identifier against a listing. Accepts (in order): a 1-based * list index, an exact userId, or an unambiguous userId prefix. Pure — unit tested. */ export declare function resolveAdminIdentifier(admins: AdminEntry[], identifier: string): ResolveResult;