import { CDPClient } from '../cdp.js';
import type { BrowserProfile, ConnectionKey } from '../types.js';
export interface LocalConnection {
    cdp: CDPClient;
    port: number;
    pid: number;
}
/**
 * Arc is single-instance: relaunching the Arc binary with a fresh
 * `--user-data-dir` does not create a second debuggable process — macOS routes
 * the launch to the running Arc, which was started with no debug port, so the
 * spawn produces a stray window and no CDP endpoint (issue #2779). agents
 * browser therefore ATTACHES to the user's running Arc and never launches its
 * own. When the running Arc exposes no CDP endpoint on the profile's port, we
 * fail loud with the one relaunch that fixes it rather than silently spawning a
 * duplicate. Exported so the contract is unit-testable without a real Arc.
 */
export declare function arcAttachRequiredError(profileName: string, port: number): Error;
/**
 * The loud error an ATTACH-ONLY profile raises when nothing debuggable is on its
 * port (PHNX-3967). Same contract as {@link arcAttachRequiredError}, generalized
 * to any browser: agents attach to a browser the user already started and NEVER
 * spawn a rival window, so instead of falling through to `launchBrowser` (which
 * would produce the second, logged-out dock tile this ticket set out to end) we
 * fail loud with the exact relaunch that makes the canonical instance
 * attachable — pinned to the profile's DURABLE `--user-data-dir` so the one-time
 * sign-in persists. Exported so the contract is unit-testable without a browser.
 */
export declare function attachOnlyRequiredError(profile: Pick<BrowserProfile, 'name' | 'browser' | 'userDataDir'>, port: number): Error;
/**
 * The loud error an attach-only profile raises when a browser IS serving CDP on
 * its port but is a FOREIGN instance — its `--user-data-dir` is not the profile's
 * durable dir (PHNX-3967). This closes the port-squat: a logged-out `/tmp/...`
 * Comet answering CDP on the canonical port passes the browser-FAMILY identity
 * check, so without an ownership check agents would drive it as if it were the
 * credentialed browser. Rather than adopt the squatter we reject it and name the
 * fix. Exported for unit testing.
 */
export declare function foreignInstanceError(profile: Pick<BrowserProfile, 'name' | 'browser' | 'userDataDir'>, port: number, runningDataDir: string, pid: number): Error;
export declare function connectLocal(endpoint: string, profile: BrowserProfile, 
/**
 * Runtime key (`<profile>@<endpoint>`) the launched browser's user-data-dir,
 * pid, and port files are stored under. Separate from `profile.name`, which
 * stays the bare user-facing name and appears only in messages (RUSH-2709).
 */
key: ConnectionKey): Promise<LocalConnection>;
