/** * Managed ripgrep provisioning for `grep --files` / content search. * * harnery can install a pinned, checksum-verified ripgrep into its own tools * directory (`$XDG_DATA_HOME/harnery/tools`, default `~/.local/share/harnery/ * tools`) so `harn grep` gets the fast engine even on machines where nobody * ever installed rg. The download is version-pinned and every artifact's * sha256 is baked in below (cross-checked against the official release * checksums), so the install is reproducible, never "whatever is latest." * * Consent model: the installer only runs automatically when the host project * opts in via `.harnery/config.jsonc` `{ "tools": { "ripgrep": { "autoInstall": * true } } }` — a repo commits that once and every clone self-heals. Without * the opt-in, a missing rg produces a rate-limited stderr hint naming * `harn doctor --fix` (explicit install). Environments that forbid downloads * lose nothing: every failure path falls back to GNU grep. */ export declare const RG_VERSION = "14.1.1"; /** True when a pinned artifact exists for this OS/arch (Windows: not yet). */ export declare function rgInstallSupported(): boolean; /** Machine-level harnery tools dir (NOT the per-project .harnery/ state dir). */ export declare function toolsDir(): string; /** Path the managed rg binary lives at once installed. */ export declare function managedRgPath(): string; /** * Locate a usable ripgrep. Precedence: * 1. HARNERY_RG_PATH (explicit override) * 2. the managed tools-dir install (works even when PATH doesn't carry it) * 3. `rg` on PATH * Returns the spawnable path/name, or null when none respond to --version. */ export declare function findRg(): string | null; /** * Download + verify + install the pinned ripgrep into the tools dir. * Atomic: extracts to a temp dir and renames the binary into place. * Throws on unsupported platform, network failure, or checksum mismatch — * callers are expected to fall back to grep and say why. */ export declare function installRg(log?: (line: string) => void): Promise; export type SearchEngine = "rg" | "grep"; /** * Shared engine resolver for the ripgrep-backed search commands (`grep`, * `callers`). Returns the engine plus the spawnable rg path. * * `HARNERY_GREP_ENGINE=rg|grep` forces one; otherwise findRg() probes * HARNERY_RG_PATH → the managed tools-dir install → PATH. On a miss, the * host's `.harnery/config.jsonc` `tools.ripgrep.autoInstall` consent triggers * a pinned, checksum-verified install into the harnery tools dir (any failure * falls back to grep with a stderr note); without consent, a rate-limited * stderr hint (keyed per `hintKey`) names the explicit install command. */ export declare function resolveSearchEngine(hintKey?: string): Promise<{ engine: SearchEngine; rgBin: string; }>; /** * Emit `line` to stderr at most once per 24h (stamp file in the tools dir). * Keeps the "rg missing" nudge from nagging on every single grep invocation. */ export declare function hintOncePerDay(line: string): void; //# sourceMappingURL=ripgrep.d.ts.map