import type { CliAdapter, CliId } from '../adapters/cli/types.js'; import type { DaemonSession } from '../core/types.js'; import { type LocalCliOpenMode } from '../global-config.js'; export declare const LOCAL_CLI_IDS: readonly ["claude-code", "seed", "relay", "aiden", "coco", "codex", "cursor", "genius", "opencode", "opencode2", "antigravity", "mtr", "hermes", "traex", "pi", "copilot", "oh-my-pi", "kimi", "grok"]; export type LocalCliId = typeof LOCAL_CLI_IDS[number]; export type LocalCliOpenError = 'unsupported_cli' | 'unsupported_platform' | 'terminal_unavailable' | 'missing_working_dir' | 'missing_resume_id' | 'unsupported_backend' | 'missing_attach_target'; export type LocalCliOpenResult = { ok: true; command: string; } | { ok: false; error: LocalCliOpenError; message: string; }; export type LocalCliPreflightResult = LocalCliOpenResult; export interface LocalCliOpenerDeps { platform?: NodeJS.Platform; mode?: LocalCliOpenMode; adapterFactory?: (cliId: LocalCliId) => Pick; runOsascript?: (args: string[]) => Promise<{ ok: boolean; stderr?: string; }>; /** Launch-Services fallback: opens a .command file with a terminal app. * Used when AppleScript is blocked by missing Automation permission * (e.g. the daemon runs under PM2/launchd, so TCC never prompts). */ runOpenCommand?: (args: string[]) => Promise<{ ok: boolean; stderr?: string; }>; } export declare function supportsLocalCliOpen(cliId: string | undefined): cliId is LocalCliId; /** The iTerm-first opener is intentionally macOS-only. Keep the generic host * capability check as well so the policy stays aligned with native-terminal * availability if that check becomes stricter later. */ export declare function isLocalCliOpenCapable(): boolean; export declare function isLocalCliOpenConfigured(): boolean; export declare function localCliOpenMode(): LocalCliOpenMode; export declare function isLocalCliOpenEnabled(): boolean; export declare function shellQuote(value: string): string; export declare function appleScriptQuote(value: string): string; export declare function buildItermAppleScript(command: string, tellTarget?: string): string; export declare function buildTerminalAppleScript(command: string, tellTarget?: string): string; export declare function buildLocalCliOpenCommand(ds: DaemonSession, opts?: { cliId?: CliId; mode?: LocalCliOpenMode; adapterFactory?: LocalCliOpenerDeps['adapterFactory']; }): LocalCliOpenResult; export declare function buildLocalCliAttachCommand(ds: DaemonSession): LocalCliOpenResult; /** Pure preflight for local CLI opening. It performs the same attach/resume * target resolution as the real opener, but never launches AppleScript. */ export declare function preflightLocalCliOpen(ds: DaemonSession, opts?: { cliId?: CliId; mode?: LocalCliOpenMode; adapterFactory?: LocalCliOpenerDeps['adapterFactory']; }): LocalCliPreflightResult; export declare function isLocalCliOpenReady(ds: DaemonSession, opts?: { cliId?: CliId; mode?: LocalCliOpenMode; adapterFactory?: LocalCliOpenerDeps['adapterFactory']; }): boolean; export declare function openLocalCliInIterm(ds: DaemonSession, deps?: LocalCliOpenerDeps & { cliId?: CliId; }): Promise; //# sourceMappingURL=local-cli-opener.d.ts.map