export declare const DEFAULT_HOST = "https://cloud.docujoint.com"; export interface HostsDoc { host?: string; session?: string; user?: { id?: string; email?: string; }; org?: string; session_id?: string; expires_at?: number; } type Env = Record; /** Where hosts.json lives. Pure: computes a path, creates nothing. */ export declare function configDir(env?: Env): string; export declare function hostsPath(env?: Env): string; /** The stored document, or null when there is none / it is unreadable. */ export declare function readHosts(env?: Env): HostsDoc | null; /** Write the document, 0600 in a 0700 directory. Callers own the shape. */ export declare function writeHosts(doc: HostsDoc, env?: Env): string; /** Logged out: the file is gone. */ export declare function clearHosts(env?: Env): void; /** * A full origin ("http://127.0.0.1:8787") or a bare hostname * ("cloud.docujoint.com", https assumed) → an origin with no trailing slash. */ export declare function normalizeHost(value: unknown): string | null; /** * The origin a command talks to, most specific first: * --host flag > $DJ_HOST > $DJC_HOST (compat) > hosts.json > default. */ export declare function resolveHost({ flag, env, config }?: { flag?: string; env?: Env; config?: HostsDoc | null; }): string; /** The session token for `host`, or null when logged out of it. */ export declare function sessionFor(host: string | null, env?: Env): string | null; /** * Being logged out, as its own type: one sentence naming the fix, exit * non-zero, and NO network call — a CLI that "degrades" past a missing session * is pretending to have permission it does not have. */ export declare class LoggedOutError extends Error { host: string; constructor(host: string); } /** * The three things a cloud call needs: origin, session, stored document (for * defaults like the org). Purely local — decides logged-out without the network. */ export declare function requireSession({ flag, env }?: { flag?: string; env?: Env; }): { host: string; token: string; config: HostsDoc; }; export {};