import { type CallbackRouteV1 } from "./callback-transport.js"; import type { ClaudeAgentRow } from "./claude-terminal-agent-adapter.js"; import type { ExecutorKind } from "./executors.js"; import { type TerminalAgentBridge } from "./terminal-agent-bridge.js"; import { type Conversation } from "./protocol.js"; import { type TerminalDispatchOwnership } from "./terminal-action-projection.js"; import type { TerminalControlEvidence, TerminalControlRef } from "./terminal-control-ref.js"; import { type TerminalWatchCallbackCliAdapter } from "./terminal-watch-callback-cli-adapter.js"; import { type TerminalWatchTerminalIdentity, type UserExplicitFallbackWatchAnchor } from "./terminal-watch-store.js"; export interface TerminalWatchCliOptions { callbackRoute?: CallbackRouteV1; /** Private Host-adapter authority describing how a route template is bound. */ callbackRouteControllerScope?: "startup_v1" | "route_bound_v1"; claudeHome?: string; hardTimeoutMinutes?: number | string; openclawBin?: string; openclawSession?: string; storeDir?: string; terminal?: string; watch?: string; [option: string]: unknown; } export interface UserExplicitFallbackWatchTarget { conversationId: string; agent: ExecutorKind; pid: number; terminalControl: TerminalControlRef; } export interface PreparedUserExplicitFallbackWatch { watchId: string; terminalId: string; agent: ExecutorKind; pid: number; terminalEndpoint: TerminalControlEvidence; terminalIdentity: TerminalWatchTerminalIdentity; physicalToken: string; requestHash: string; callbackRoute: CallbackRouteV1; openclawSession: string; openclawBin: string; timeoutMs: number; anchor: UserExplicitFallbackWatchAnchor; } export interface UserExplicitFallbackWatchReceipt { callback_expected: true; callback_mode: "terminal_watch"; watch_id: string; } type ExactTerminalWatchObservation = { state: "available"; rawTerminal: Record; terminal: Record; summary: Record; } | { state: "absent"; reason?: string; summary: Record; } | { state: "unavailable"; reason?: string; summary: Record; }; export interface TerminalWatchCliDependencies { acquireFileLock(lockPath: string): () => void; acquireTerminalLock(storeDir: string, terminalControl: TerminalControlRef): () => void; createBridge?(options: TerminalWatchCliOptions): TerminalAgentBridge; withStoreWriterLeaseAsync?(storeDir: string, operation: () => Promise): Promise; observeExactTerminal(request: { options: TerminalWatchCliOptions; terminalId: string; }): Promise; loadClaudeAgentRows(options: TerminalWatchCliOptions, observation?: { required?: boolean; }): readonly ClaudeAgentRow[]; now(): Date; randomUUID(): string; storeDirFromOptions(options: TerminalWatchCliOptions): string; terminalDispatchOwnership(terminalControl: TerminalControlRef): TerminalDispatchOwnership>; terminalIncarnationBlockingTurns(storeDir: string, terminalControl: TerminalControlRef): Conversation[]; printJson(value: unknown): void; callback?: TerminalWatchCallbackCliAdapter; } export interface TerminalWatchCliFacade { prepareUserExplicitFallbackWatch(input: { options: TerminalWatchCliOptions; terminal: UserExplicitFallbackWatchTarget; requestHash: string; messageId: string; physicalToken: string; }): Promise; attachUserExplicitFallbackWatch(input: { options: TerminalWatchCliOptions; prepared: PreparedUserExplicitFallbackWatch; }): Promise; userExplicitFallbackWatchReceipt(input: { options: TerminalWatchCliOptions; watchId: string; }): UserExplicitFallbackWatchReceipt | undefined; runWatch(options: TerminalWatchCliOptions): Promise; runUnwatch(options: TerminalWatchCliOptions): Promise; runWatchStatus(options: TerminalWatchCliOptions): Promise; runRespondInteraction(options: TerminalWatchCliOptions): Promise; runReconcileWatches(options: TerminalWatchCliOptions): Promise; listPublicWatches(storeDir: string, options?: { includeAll?: boolean; }): Array>; scanPublicWatchesForExactObservation(storeDir: string, options?: { includeAll?: boolean; }): { watches: Array>; activeOverlayTrusted: boolean; }; } export declare function createTerminalWatchCliAdapter(dependencies: TerminalWatchCliDependencies): TerminalWatchCliFacade; export {};