/** * Harness discovery module. * * Two distinct detection mechanisms: * * 1. **Installed discovery** (`discoverHarnesses`) — probes the local system * for known AI coding agent CLIs via `which`/`where`, checks for config * directories, and reports capabilities. Pure PATH + filesystem detection, * no environment variable checks. * * 2. **Caller detection** (`detectCallerHarness`) — inspects environment * variables to determine which harness (if any) spawned the current * process. This answers "are we running *inside* a Claude Code session?" * rather than "is the `claude` binary installed?". */ import type { CallerHarnessResult, HarnessDiscoveryResult, HarnessCapability } from "./types"; export { KNOWN_HARNESSES } from "./registry"; export interface HooksMuxCallerHarnessResult { /** Normalized babysitter harness identifier. */ name: string; /** Original hooks-adapter adapter identifier. */ sourceAdapter: string; /** Environment variable names that matched the hooks-adapter rule. */ matchedEnvVars: string[]; /** Capabilities advertised by the normalized harness. */ capabilities: HarnessCapability[]; /** Detection confidence from hooks-adapter rules. */ confidence: "high" | "medium" | "low"; } /** * Checks whether a single CLI command is available on the system. * * Uses `which` on Unix and `where` on Windows to locate the binary, then * attempts ` --version` to extract a version string. * * @returns An object indicating availability and, when found, the resolved * path and version string. */ export declare function checkCliAvailable(command: string): Promise<{ available: boolean; path?: string; version?: string; }>; /** * Probes the local environment for all known harness CLIs in parallel. * * Checks only whether each CLI binary is installed on PATH, whether config * directories exist, and what capabilities the harness advertises. * * Does **not** inspect environment variables — use `detectCallerHarness()` * for that. * * Each harness is checked independently via `Promise.allSettled` so that a * single failing/timing-out probe does not block the rest. * * @returns An array of discovery results sorted alphabetically by harness name. */ export declare function discoverHarnesses(): Promise; /** * Detects which harness (if any) spawned the current process by inspecting * environment variables. * * This answers the question "are we running inside a Claude Code / Codex / * Gemini CLI / etc. session right now?" — completely independent of whether * those CLIs are installed on PATH. * * @returns The detected caller harness, or `null` if no caller is detected. * When multiple harnesses match (e.g. pi and oh-my-pi share some * env vars), the first match in `KNOWN_HARNESSES` order wins. */ export declare function detectCallerHarness(): CallerHarnessResult | null; /** * Detect the active caller harness using hooks-adapter style discovery rules. * * This mirrors hooks-adapter environment-based detection, but normalizes the * adapter name back to babysitter's harness identifiers so SDK command * surfaces can reuse the result without depending on hooks-adapter packages. */ export declare function detectCallerHarnessViaHooksMux(env?: Record): HooksMuxCallerHarnessResult | null; //# sourceMappingURL=discovery.d.ts.map