import type { TControllerTerminalAgentKind } from '../dist_ts_interfaces/index.js'; export declare const isControllerTerminalAgentSessionId: (valueArg: unknown) => valueArg is string; export declare const newControllerTerminalAgentSessionId: () => string; /** A live Claude Code session as reported by `claude agents --json`. */ export interface IControllerTerminalAgentSession { sessionId: string; kind: 'interactive' | 'background'; cwd: string; /** Present for interactive sessions; background sessions are daemon-owned. */ pid?: number; /** Short daemon id, present for background sessions. */ id?: string; name?: string; } export interface IControllerTerminalAgentLaunch { command: string; args: string[]; /** Which upstream flag was chosen, for surfacing in the terminal header. */ mode: 'resume' | 'new'; } export declare const resolveControllerTerminalAgentExecutable: (kindArg: TControllerTerminalAgentKind, environmentArg?: NodeJS.ProcessEnv) => Promise; /** * Answers "has this conversation ever had a turn", which decides `--resume` versus `--session-id`. * It never opens the transcript, so the unstable JSONL schema is irrelevant here. */ export declare const controllerTerminalAgentTranscriptExists: (sessionIdArg: string, cwdArg: string, environmentArg?: NodeJS.ProcessEnv) => Promise; /** * Lists the conversations Claude Code currently considers live. `claude agents --json` is the * supported scripting interface for this and explicitly does not require a TTY. */ export declare const listControllerTerminalAgentSessions: (executableArg: string, environmentArg?: NodeJS.ProcessEnv) => Promise; /** * Fails closed. A conversation that is already open somewhere else must not be resumed: concurrent * resumes of one session id both succeed, branch the transcript into a DAG, and a later resume * follows a single leaf — silently discarding the other branch. An unreadable listing is treated * as unproven rather than free, matching how OpenCode orphan recovery refuses an occupant it * cannot positively verify. */ export declare const assertControllerTerminalAgentSessionIsFree: (executableArg: string, sessionIdArg: string, environmentArg?: NodeJS.ProcessEnv) => Promise; /** * Resolves the argv for one start. Callers must have proven the session free first. */ export declare const resolveControllerTerminalAgentLaunch: (kindArg: TControllerTerminalAgentKind, sessionIdArg: string, cwdArg: string, environmentArg?: NodeJS.ProcessEnv) => Promise;