export interface OrcaWorktree { id: string; path: string; displayName?: string; } export interface OrcaTerminal { handle: string; ptyId?: string; title?: string; connected?: boolean; writable?: boolean; } interface OrcaEnvelope { ok?: boolean; result?: T; error?: { code?: string; message?: string; }; } interface TerminalResult { terminal?: OrcaTerminal; handle?: string; } export declare class OrcaCliError extends Error { readonly code: string; constructor(code: string, message: string); } /** Orca terminals are a local runtime boundary. Never let ambient remote-runtime selectors * redirect manager lifecycle calls to another Orca environment. */ export declare function localCliEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; /** True when an Orca runtime is reachable through the public CLI. */ export declare function available(): boolean; /** Resolve the Orca worktree that encloses `cwd`. Uses `current` first because it is the documented * cwd-aware selector, then falls back to exact `path:` checks up the parent chain. */ export declare function resolveWorktree(cwd: string): OrcaWorktree; export declare function createTerminal(opts: { worktreeId: string; title: string; command: string; }): OrcaTerminal; export declare function showTerminal(handle: string): OrcaEnvelope; /** Resolve the current handle for a terminal. Orca handles are runtime-scoped, while ptyId stays * stable across handle rotation. */ export declare function currentTerminal(terminal: Pick): OrcaTerminal | undefined; export declare function terminalAlive(terminal: Pick): boolean; /** Await Orca's provider-native terminal exit condition, following one or more handle rotations by * stable ptyId. The native wait is bounded so it cannot outlive the manager's preservation cut. */ export declare function waitManagedTerminalExit(terminal: Pick, timeoutMs?: number): Promise; export declare function sendTerminal(handle: string, opts?: { text?: string; enter?: boolean; interrupt?: boolean; }): void; export declare function closeTerminal(handle: string): boolean; /** Close by stable identity. If the handle rotates between resolution and close, refresh by ptyId * and retry once instead of treating a stale handle as a successful stop. */ export declare function closeManagedTerminal(terminal: Pick): void; export declare function terminals(): OrcaTerminal[]; export {}; //# sourceMappingURL=driver.d.ts.map