import type { SessionLease } from './lease.js'; /** * Which running session a switch should be aimed at. * * `ccx use` can move one specific session instead of broadcasting to all of * them. This resolves the operator's choice against the live sessions, and is * pure so the (fiddly) ambiguity rules are tested without real processes. */ export interface TargetQuery { /** An explicit ccx-run pid (`--session `). */ session?: number; /** Target the session running in `cwd` (`--here`). */ here?: boolean; /** The working directory to match for `--here`; defaults to the caller's cwd. */ cwd?: string; } export type TargetResolution = { kind: 'broadcast'; } | { kind: 'session'; pid: number; lease: SessionLease; } | { kind: 'error'; message: string; }; /** Describe a session compactly for a chooser message: "12345 (acct in C:/x)". */ export declare function describeLease(l: SessionLease): string; /** * Resolve a target from the live leases. No query -> broadcast (the historical * `ccx use` behaviour). `--session` must match a live session. `--here` matches * by working directory, and is an error when nothing (or more than one thing) * matches, so a switch never silently lands on the wrong session. */ export declare function resolveTarget(leases: SessionLease[], query: TargetQuery): TargetResolution;