interface SandboxTerminalConnection {
    runtimeUrl: string | null;
    sidecarUrl: string | null;
    token: string | null;
    expiresAt: string | null;
    status: string;
    error: string | null;
    loading: boolean;
    sandboxId?: string;
}
interface SandboxTerminalConnectionResponse {
    runtimeUrl?: string;
    sidecarUrl?: string;
    token?: string;
    expiresAt?: string;
    status?: string;
    error?: string;
    sandboxId?: string;
}
interface UseSandboxTerminalConnectionOptions {
    workspaceId: string;
    connectionUrl?: string | ((workspaceId: string) => string);
    fetcher?: typeof fetch;
    provisionPollIntervalMs?: number;
    provisionPollTimeoutMs?: number;
    tokenRefreshSkewMs?: number;
}
interface UseSandboxTerminalConnectionResult extends SandboxTerminalConnection {
    connect: () => Promise<void>;
}
declare function useSandboxTerminalConnection(opts: UseSandboxTerminalConnectionOptions): UseSandboxTerminalConnectionResult;
/**
 * Stable-per-tab, unique-per-client terminal connection id.
 *
 * Persists in `sessionStorage` so a reload in the same tab reuses the id (the
 * sidecar restores the same PTY session via `TerminalView.connectionId`), while
 * separate tabs/windows each get a distinct id. Pass the result as
 * `TerminalView`'s `connectionId`. Without it (e.g. gtm-agent today) every tab
 * shares one connection id and their reconnects evict each other.
 *
 * Falls back to an ephemeral id when `sessionStorage` is unavailable (SSR,
 * privacy mode) — still unique per call, just not reload-stable.
 */
declare function tabTerminalConnectionId(storageKey?: string): string;

export { type SandboxTerminalConnection as S, type UseSandboxTerminalConnectionOptions as U, type SandboxTerminalConnectionResponse as a, type UseSandboxTerminalConnectionResult as b, tabTerminalConnectionId as t, useSandboxTerminalConnection as u };
