import type { Channel } from "../../debugger/attach/channel.js"; import { type AttachRecord } from "../../debugger/attach/registry.js"; import { type CommandDeps, type SessionCommand } from "./commands.js"; import { type ProbedProgram } from "./target.js"; export type SessionCliCommand = SessionCommand | { name: "list"; } | { name: "attach"; pid: number; }; export type SessionCliOptions = { pid?: number; json: boolean; }; export type SessionCliDeps = { sessionsDir: string; cwd: string; commandDeps: CommandDeps; checked(dir: string, pid: number): AttachRecord | { refused: string; }; connect(pid: number, sock: string): Promise; probeTimeoutMs: number; writeStdout(text: string): void; writeStderr(text: string): void; }; export declare function defaultSessionCliDeps(): SessionCliDeps; /** Run one command. Resolves with the exit code. */ export declare function debugSession(command: SessionCliCommand, options: SessionCliOptions, deps?: SessionCliDeps): Promise; export declare function listText(probed: readonly ProbedProgram[], now: number, cwd: string): string; /** How long a command keeps trying to join while the run still counts * the command before it as connected. The run learns a visit is over * from its socket closing, which lands a moment after that process * exits, so a script running commands back to back can arrive first. */ export declare const VISIT_RETRY_MS = 1000;