import type { ActiveTerminalProcess, TerminalAgentAdapter, TerminalApprovalInspection, TerminalDurableCompletionRequest, TerminalNativeInspectionCapabilities, TerminalNativeInspectionObservation, TerminalNativeInspectionObservationRequest, TerminalNativeInspectionOperation, TerminalNativeInspectionPlan, TerminalProcessSnapshot, TerminalScreenInspection, TerminalScreenInspectionOptions, TerminalThreadLifecycleCapabilities, TerminalThreadLifecycleObservation, TerminalThreadLifecycleObservationRequest, TerminalThreadLifecycleOperation, TerminalThreadLifecyclePlan } from "./terminal-agent-adapter.js"; export type ClaudeProcessKind = "claude_cli"; /** A row returned by `claude agents --json --all`. Unknown fields are intentionally ignored. */ export interface ClaudeAgentRow { pid?: number; cwd?: string; kind?: string; sessionId?: string; startedAt?: number; status?: string; waitingFor?: string; } export interface CreateClaudeTerminalAgentAdapterOptions { /** * A point-in-time `claude agents --json --all` snapshot. Rows are joined only by an exact PID; * names, cwd values, and fuzzy command matches are never used as process identity. */ agentRows?: readonly ClaudeAgentRow[]; /** Read-only local transcript detector used for durable completion. */ detectDurableCompletion?: NonNullable["detectDurableCompletion"]>; /** * Local transcript evidence for the one pending Bash tool use in the current * managed turn. The adapter intersects it with the current strict permission * screen before exposing any executor-local policy authority. */ detectPendingApproval?: (request: TerminalDurableCompletionRequest) => ClaudePendingApprovalEvidence | undefined; } export interface ClaudePendingApprovalEvidence { source: "claude_transcript"; kind: "run_command"; command: string; cwd: string; toolName: "Bash"; toolUseId: string; promptUuid: string; assistantUuid: string; claudeVersion: string; transcriptFileId: string; commandSha256: string; evidenceFingerprint: string; observedEndOffsetBytes: number; } /** * On each verified Claude TUI profile, the exact `/status` composer and its * closed completion list remained byte-stable across an 80 ms capture interval * and one subsequent Enter opened the Status panel. This is a Claude-local * single-line boundary; it deliberately does not reuse Codex's 121 ms burst * paste boundary. */ export declare const CLAUDE_NATIVE_INSPECTION_COMPOSER_STABLE_MS = 80; export declare function createClaudeTerminalAgentAdapter(options?: CreateClaudeTerminalAgentAdapterOptions): TerminalAgentAdapter; export declare function probeClaudeNativeInspection(agentVersion: string | undefined): TerminalNativeInspectionCapabilities; export declare function planClaudeNativeInspection(operation: TerminalNativeInspectionOperation, capabilities: TerminalNativeInspectionCapabilities): TerminalNativeInspectionPlan; export declare function observeClaudeNativeInspection(request: TerminalNativeInspectionObservationRequest): TerminalNativeInspectionObservation; export declare function probeClaudeThreadLifecycle(agentVersion: string | undefined): TerminalThreadLifecycleCapabilities; export declare function planClaudeThreadLifecycle(operation: TerminalThreadLifecycleOperation, capabilities: TerminalThreadLifecycleCapabilities): TerminalThreadLifecyclePlan; export declare function observeClaudeThreadLifecycle(request: TerminalThreadLifecycleObservationRequest, legacyOperation?: undefined, fallbackAgentRows?: readonly ClaudeAgentRow[]): TerminalThreadLifecycleObservation; /** @deprecated Claude lifecycle identity requires a typed agents-row request. */ export declare function observeClaudeThreadLifecycle(screen: string, operation: TerminalThreadLifecycleOperation, fallbackAgentRows?: readonly ClaudeAgentRow[]): TerminalThreadLifecycleObservation; /** * Claude Code 2.1.251 through 2.1.267 can report an input-ready interactive composer as * `waiting` without a `waitingFor` reason. A non-empty wait reason remains a * real blocked state and must never be promoted to idle. */ export declare function isClaudeAgentIdleState(row: ClaudeAgentRow): boolean; export declare const claudeTerminalAgentAdapter: TerminalAgentAdapter<"claude_cli">; export declare function classifyClaudeProcess(snapshot: TerminalProcessSnapshot, agentRows?: readonly ClaudeAgentRow[]): ActiveTerminalProcess | undefined; export declare function extractClaudeSessionId(command: string): string | undefined; export declare function inspectClaudeScreen(options: TerminalScreenInspectionOptions): TerminalScreenInspection; export declare function claudePermissionCommandForApproval(command: string): { command?: string; display: string; }; export declare function detectClaudeApprovalPrompt(screen: string): TerminalApprovalInspection; export declare function detectClaudeActivityState(screen: string, approval?: TerminalApprovalInspection): { state: "awaiting_approval" | "working" | "idle" | "unknown"; reason: string; }; export declare function claudeScreenExcerpt(screen: string, maxLength?: number): string;