import { type CommandResult, type TerminalDiscoveryDiagnosticLog, type TerminalControlProvider, type TerminalViewport } from "./terminal-control-provider.js"; import { type TerminalControlCapability, type TerminalControlRef, type TerminalEndpointRef, type TerminalProviderCapability } from "./terminal-control-ref.js"; import type { TerminalProcessSnapshot } from "./terminal-agent-adapter.js"; import { type HerdrRequestFunction, type HerdrSocketIdentity } from "./herdr-socket-transport.js"; export { HerdrApiError, HerdrTransportError, readHerdrSocketIdentity, requestHerdrUnixSocket, type HerdrRequestFunction, type HerdrRequestOptions, type HerdrSocketIdentity, type HerdrWireRequest } from "./herdr-socket-transport.js"; export declare const HERDR_EXACT_VERSION = "0.8.0"; export declare const HERDR_EXACT_PROTOCOL = 19; export interface HerdrTtyDeviceIdentity { device: string; inode: string; rdev: string; ctimeNs: string; ownerUid: number; symbolicLink: boolean; characterDevice: boolean; } export interface HerdrTtyViewportInspectionOptions { platform?: NodeJS.Platform; runCommand?: (command: string, args: string[]) => CommandResult; statTty?: (ttyPath: string) => HerdrTtyDeviceIdentity; currentUid?: number; } export type HerdrTtyViewportInspector = (shellPid: number) => TerminalViewport | undefined | Promise; export interface HerdrSessionInfo { name: string; default: boolean; running: boolean; socketPath: string; sessionDir: string; } export interface HerdrTerminalControlDiagnostics { commands: string[]; selectedCommand?: string; expectedVersion: string; expectedProtocol: number; sessions: HerdrSessionInfo[]; attempts: Array<{ session: string; socketPath: string; status: "ok" | "error"; paneCount?: number; skippedWithoutShellPid?: string[]; error?: string; }>; terminalCount: number; } export declare class HerdrTerminalControlProvider implements TerminalControlProvider { readonly kind = "herdr"; readonly supportedCapabilities: readonly TerminalControlCapability[]; readonly providerCapabilities: readonly TerminalProviderCapability[]; private readonly commands; private selectedCommand?; private readonly runCommand; private readonly request; private readonly statSocket; private readonly inspectTtyViewport; private readonly diagnosticLog?; private readonly endpointSocketIdentities; private requestSequence; constructor(options?: { command?: string; runCommand?: (command: string, args: string[]) => CommandResult; request?: HerdrRequestFunction; requestTimeoutMs?: number; statSocket?: (socketPath: string) => HerdrSocketIdentity; inspectTtyViewport?: HerdrTtyViewportInspector; diagnosticLog?: TerminalDiscoveryDiagnosticLog; }); diagnostics(): Promise>; listTerminals(): Promise; endpoint(terminalControl: TerminalControlRef): TerminalEndpointRef; toControlRef(terminal: TerminalEndpointRef, capabilities?: readonly TerminalControlCapability[]): TerminalControlRef; resolve(terminal: TerminalEndpointRef): Promise; containsProcess(terminal: TerminalEndpointRef, process: Pick, processes: readonly Pick[]): boolean; inspectViewport(terminal: TerminalEndpointRef): Promise; capture(terminal: TerminalEndpointRef, options?: { scrollbackLines?: number; preserveEscapes?: boolean; }): Promise; sendText(terminal: TerminalEndpointRef, text: string): Promise; sendKeys(terminal: TerminalEndpointRef, keys: readonly string[]): Promise; private logDiagnostic; private discoverSessions; private probeCommand; private inspectSession; private assertCompatibleServer; private invoke; private resolveForInput; private sendInput; private requireEndpointSocketIdentity; } export declare function parseHerdrSessionList(output: string): HerdrSessionInfo[]; /** Translate the tmux-oriented bridge key vocabulary to Herdr key combos. */ export declare function translateHerdrKey(value: string): string; /** * Read the exact inner PTY viewport owned by a verified Herdr shell process. * Herdr layout geometry is deliberately not used here: direct attaches may * resize the PTY without updating the layout rectangle that owns the pane. */ export declare function inspectHerdrTtyViewport(shellPid: number, options?: HerdrTtyViewportInspectionOptions): TerminalViewport | undefined;