import { type TmuxApi } from "../team/tmux.js"; /** * Regex matching a Copilot session name produced by the launch scheme * (`omp-${Date.now()}`). Naturally excludes `omp-team-*` and any other * non-digit suffixes. */ export declare const COPILOT_SESSION_RE: RegExp; export type ResolveSessionSuccess = { ok: true; session: string; source: "flag" | "env" | "discovery"; }; export type ResolveSessionFailure = { ok: false; error: string; candidates?: string[]; }; export type ResolveSessionResult = ResolveSessionSuccess | ResolveSessionFailure; export interface ResolveSessionOpts { /** Value of the --session CLI flag, if provided. */ flag?: string; /** Value of the COPILOT_TMUX_SESSION env var, if set. */ env?: string; /** Injected tmux API (defaults to the real one). */ tmux?: TmuxApi; } /** * Resolve the target Copilot tmux session via three-tier precedence: * 1. Explicit --session flag * 2. COPILOT_TMUX_SESSION env var * 3. Auto-discovery: scan tmux for exactly one session matching COPILOT_SESSION_RE * * Returns a structured result — never throws. */ export declare function resolveSession(opts?: ResolveSessionOpts): ResolveSessionResult;