import type { AgentState } from "@pk-nerdsaver-ai/pi-agent-core";
import { DEFAULT_SHARE_URL } from "@pk-nerdsaver-ai/pi-wire";
import type { SecretObfuscator } from "../secrets/obfuscator";
import type { SessionManager } from "../session/session-manager";
import { type SessionData } from "./html";
export { DEFAULT_SHARE_URL };
/** Hard cap for blobs accepted by the share server (mirrors relay shareMaxBytes). */
export declare const SERVER_MAX_SEALED_BYTES = 1000000;
export interface ShareSessionOptions {
    /** Share server/viewer base URL; defaults to {@link DEFAULT_SHARE_URL}. */
    serverUrl?: string;
    /** Agent state for system prompt + tool descriptions in the snapshot. */
    state?: AgentState;
    /**
     * Redacts the snapshot before sealing: deep-walks every string (entries,
     * header, system prompt, tool descriptions) through the obfuscator, so
     * secrets that landed in persisted entries (tool outputs reading .env,
     * etc.) never leave the machine. Pass undefined to skip.
     */
    obfuscator?: SecretObfuscator;
}
export interface ShareSessionResult {
    /** Viewer link: `<serverUrl>/<id>#<key>`. */
    url: string;
    method: "gist" | "server";
    /** Underlying gist URL (gist method only). */
    gistUrl?: string;
    /** True when content was trimmed to fit the upload budget. */
    truncated: boolean;
    sealedBytes: number;
}
/** Build the snapshot that gets sealed and uploaded, redacted when an obfuscator is provided. */
export declare function buildShareSnapshot(sm: SessionManager, options?: ShareSessionOptions): SessionData;
/** Share the session; tries a secret gist first, then the share server. */
export declare function shareSession(sm: SessionManager, options?: ShareSessionOptions): Promise<ShareSessionResult>;
/** Strip trailing slashes so `<base>/<id>` composes cleanly. */
export declare function normalizeShareServerUrl(serverUrl?: string): string;
interface SealedSession {
    sealed: Uint8Array<ArrayBuffer>;
    truncated: boolean;
}
/** Seal `data`, trimming content until the sealed blob fits `maxBytes`. Exported for tests. */
export declare function sealToFit(key: CryptoKey, data: SessionData, maxBytes: number): Promise<SealedSession>;
