/**
 * Read the ShortcutXL session file written by the XLL's HTTP server.
 *
 * The XLL generates a random bearer token on startup and writes it
 * (along with the port) to %APPDATA%\ShortcutXL\session.json.
 * The agent reads this file to authenticate requests to the XLL.
 *
 * Important boundary: this is one global session file, not a per-process or
 * per-workbook registry. The runtime assumes one Excel/XLL process owns the
 * published session at a time. If multiple Excel processes load the XLL
 * concurrently, last-writer-wins session publication can point the runtime at
 * the wrong port/token pair.
 *
 * Format: { "port": 8080, "token": "hex..." }
 */
export interface XllSession {
    port: number;
    token: string;
    /** Set by the XLL when a component fails to initialize (e.g. Python DLL not found). */
    error?: string;
}
export declare function readXllSessionFromDisk(): XllSession | null;
/**
 * Clear the cached session so the next readXllSession() re-reads from disk.
 * Useful after Excel restarts.
 */
export declare function clearXllSessionCache(): void;
/**
 * Check if the XLL reported an initialization error in session.json.
 * Returns the error string, or undefined if no error.
 */
export declare function readXllSessionError(): string | undefined;
/**
 * Authenticated fetch to the XLL HTTP server.
 *
 * Injects the bearer token from the session file and retries once on 403
 * (handles stale cached token after Excel restart).
 */
export declare function xllFetch(url: string, init?: RequestInit): Promise<Response>;
//# sourceMappingURL=session.d.ts.map