/** * Internal detection probes for the agent-detection-map surface (spec 02 §5.1, §5.3). * * Two probes, both total and non-throwing: * - `probeConfigDir` — the PRIMARY detection signal: a single `fs.statSync`. Never mkdir, * never throws (REQ-DET-02/04, REQ-PERF-01). * - `cliOnPath` — SECONDARY, advisory only: is the agent's CLI on PATH? Never gates * `detected` (REQ-DET-02). `cursor` is intentionally omitted (IDE/GUI agent, no CLI). * * Zero runtime dependencies; only `node:` built-ins. */ import type { AgentId } from "./types.js"; /** * The primary detection signal (REQ-DET-02): is `configDir` an existing directory? * Uses a single synchronous `fs.statSync` — never an agent subprocess (detection stays * instant, REQ-PERF-01) and never creates the dir (REQ-DET-04). Any stat failure * (`ENOENT` not present, `EACCES` unreadable, or a non-directory at the path) ⇒ `false`. * * Synchronous by design: exactly one stat per agent, so async adds no * throughput and would complicate the pure-derivation surface. */ export declare function probeConfigDir(configDir: string): boolean; /** * The PATH-resolver seam: given a binary basename, return true iff it resolves on PATH. * Default uses the platform's real resolver executable (`where` on Windows, `which` on POSIX) — * NOT the shell builtin `command`, which is not an executable on PATH and so always throws * ENOENT under `execFileSync` (no shell). Injectable so tests can drive present/absent without * depending on the host PATH. */ export type PathResolver = (bin: string) => boolean; /** The real resolver: `which ` (POSIX) / `where ` (Windows). Any failure ⇒ false. */ export declare const realPathResolver: PathResolver; /** * Secondary, **advisory** info (REQ-DET-02): is the agent's CLI resolvable on PATH? This is * reported as `DetectionResult.cliOnPath` but **never** gates `detected`. Uses the platform's * resolver executable (`where` on Windows, `which` elsewhere — a real binary on PATH, not the * shell builtin `command`) once per agent. Any failure — no resolver, not found, spawn error — * yields `false`; it never throws and never blocks detection. * * Agents without a canonical CLI (cursor) always report `false` here without spawning. * * @param id - the agent whose CLI basename to probe. * @param resolve - the PATH resolver seam (default: {@link realPathResolver}); injectable for tests. */ export declare function cliOnPath(id: AgentId, resolve?: PathResolver): boolean;