/** * Version detection for `agent scan` (doc/agent-exec-protocol.md ยง6, rev 11) * that does not run the runtime unless it has to (issue #337). * * Many agent CLIs change the machine on `--version`. Measured 2026-09-25 in * an empty HOME: grok 1.0.41 downloads its ~159MB native binary into * ~/.grok; hermes 0.19.0 writes ~/.hermes/logs and ~/.hermes/.update_check; * codex 0.156.1 writes ~/.codex/tmp; opencode 1.18.32 creates its XDG * config/data/cache/state dirs; copilot 1.0.88 unpacks into ~/.cache/copilot; * a mise shim (crush) writes mise caches and may install the tool. * * So the version comes from install metadata first โ€” the package.json that * owns the binary, or a mise/asdf `installs///` directory โ€” * and the binary is only run when its runtime is in SIDE_EFFECT_FREE_VERSION * or the caller opts in (`agent scan --probe`). Every run happens in a * scratch HOME/XDG/TMPDIR and cwd that is removed afterwards. */ /** Where a scan entry's `version` came from; `not-probed` = the binary was not run. */ export type VersionSource = 'package.json' | 'install-path' | 'exec' | 'not-probed'; /** * Runtimes whose `--version` wrote nothing in an empty HOME (measured * 2026-09-25), so scan may run it by default when metadata has no version. */ export declare const SIDE_EFFECT_FREE_VERSION: Readonly>; /** The installed version, read from files only โ€” the binary is never run. */ export declare function versionFromInstall(binPath: string): { version: string; source: VersionSource; } | null; /** Run `bin --version` in a scratch HOME/cwd with a hard timeout (default 5s). */ export declare function execVersion(binPath: string, timeoutMs?: number): Promise; export interface DetectOptions { /** Run `--version` for any runtime whose metadata has no version. */ probe?: boolean; /** Per-binary `--version` timeout (default 5s). */ versionTimeoutMs?: number; } /** Version of an installed runtime: metadata, then an allowed or opted-in run. */ export declare function detectVersion(id: string, binPath: string, opts: DetectOptions): Promise<{ version: string | null; source: VersionSource; }>; //# sourceMappingURL=version-probe.d.ts.map