import { type ExportedThreadSnapshot, type ThreadCaptureIdentity, type ThreadSnapshot } from './chatgpt-thread-snapshot-lib.mjs'; export { assistantSnapshotLooksIncomplete, assistantSnapshotLooksTerminal, completeThreadCaptureIdentity, extractAssistantArtifactLabels, hasThreadPayload, isCaptureIdentityDigest, normalizeThreadSnapshot, parseThreadCaptureIdentity, scopeThreadSnapshotToCaptureIdentity, snapshotBusyReason, snapshotHasAssistantArtifacts, snapshotHasPatchArtifacts, snapshotIndicatesBusy, threadStatusTextIndicatesComplete, threadStatusTextIndicatesBusy, } from './chatgpt-thread-snapshot-lib.mjs'; export type { ExportedThreadSnapshot, ThreadCaptureIdentity, ThreadAssistantSnapshot, ThreadAttachmentButton, ThreadSnapshot, } from './chatgpt-thread-snapshot-lib.mjs'; export declare const DEFAULT_BROWSER_ENDPOINT = "http://127.0.0.1:9222"; export type ExportThreadSnapshotOptions = { captureIdentity?: ThreadCaptureIdentity; forceReload?: boolean; onTargetLease?: (lease: CdpTargetLease) => void; targetLifecycle?: ThreadTargetLifecycle; }; export type CapturedThreadTarget = { snapshot: ThreadSnapshot; targetLease: CdpTargetLease; }; export type CaptureThreadTargetOptions = Pick & { timeoutMs?: number; }; type CdpEvaluateOptions = { awaitPromise?: boolean; returnByValue?: boolean; }; export type CdpEvent = { method?: string; params?: Record; }; export type CdpTarget = { id?: string; parentId?: string; title?: string; type?: string; url?: string; webSocketDebuggerUrl: string; }; export type ThreadTargetLifecycle = 'keep' | 'close-created'; export type CdpTargetLease = { created: boolean; rehydrated?: boolean; target: CdpTarget; }; export type ThreadContentState = { articleCount: number; attachmentButtonCount: number; bodyLength: number; href: string; messageCount: number; readyState: string; title: string; }; export type ThreadAttachmentDownloadSelector = { artifactIndex?: number; artifactIndexInAssistantTurn?: number; assistantTurnId?: string; assistantTurnIndex?: number; href?: string | null; }; export declare function conversationUrlsReferToSameThread(candidateUrl: string, chatUrl: string): boolean; export declare function pickBestThreadTarget(targets: CdpTarget[], chatUrl: string): CdpTarget | null; export declare function sleep(ms: number): Promise; export declare function fetchJson(url: string, options?: { timeoutMs?: number; }): Promise; export declare class CdpClient { private readonly eventListeners; private readonly closeListeners; private nextId; private readonly pending; private terminalError; readonly ready: Promise; private readonly ws; constructor(url: string); private failPending; private onTerminalError; close(): void; evaluate(expression: string, options?: CdpEvaluateOptions): Promise; send(method: string, params?: Record): Promise; waitForEvent(predicate: (event: CdpEvent) => boolean, timeoutMs?: number): Promise; } export declare function closeTarget(browserEndpoint: string, targetId: string): Promise; export declare function closeThreadTarget(browserEndpoint: string, chatUrl: string, exactTargetId?: string): Promise; export declare function verifyDownloadedArtifact(downloadedFile: string, expectedContentSha256?: string): Promise; export declare function ensureTargetLease(browserEndpoint: string, chatUrl: string, exactTargetId?: string, rehydrateMissingExactTarget?: boolean): Promise; export declare function ensureTarget(browserEndpoint: string, chatUrl: string): Promise; export declare function threadContentHasMeaningfulSignals(state: Pick): boolean; export declare function threadContentLooksReady(state: ThreadContentState, chatUrl: string): boolean; export declare function waitForTargetContent(client: CdpClient, chatUrl: string, timeoutMs?: number): Promise; export declare function captureThreadSnapshot(client: CdpClient): Promise; export declare function extractPatchAttachmentLabels(snapshot: Partial | Pick): string[]; export declare function extractAssistantDownloadTargets(snapshot: Partial | Pick): Array<{ artifactIndex: number; artifactIndexInAssistantTurn?: number; assistantTurnId?: string; assistantTurnIndex?: number; href?: string | null; label: string; }>; export declare function captureThreadTargetSnapshot(browserEndpoint: string, chatUrl: string, captureIdentity: ThreadCaptureIdentity, options?: CaptureThreadTargetOptions): Promise; export declare function exportThreadSnapshot(browserEndpoint: string, chatUrl: string, outputPath: string, options?: ExportThreadSnapshotOptions): Promise; export declare function downloadThreadAttachment(browserEndpoint: string, chatUrl: string, attachmentText: string, outputDir: string, timeoutMs?: number, selector?: ThreadAttachmentDownloadSelector, options?: { captureIdentity?: ThreadCaptureIdentity; onTargetLease?: (lease: CdpTargetLease) => void; targetLifecycle?: ThreadTargetLifecycle; }): Promise;