/** * pgrep `-f` pattern used by `isHermesChatRunning`. * * Exported separately so callers — and tests — can introspect the exact * string we hand to `pgrep` and confirm we have not silently regressed * back to a literal substring match. */ export declare const HERMES_CHAT_PROCESS_PATTERN = "hermes([[:space:]]+[^[:space:]]+)*[[:space:]]+chat([[:space:]]|$)"; /** * JS-side equivalent of `pgrep -f HERMES_CHAT_PROCESS_PATTERN`. * * Used by unit tests to verify the regex matches every documented * Hermes invocation shape and rejects unrelated command lines. Kept * deliberately stateless — callers should pass the full * `/proc//cmdline`-style command-line string. */ export declare function matchesHermesChatCommandLine(commandLine: string): boolean; /** * Shape of the `execFileSync`-compatible helper that * `isHermesChatRunning` shells out through. Carved out as a named type * so tests can pass a `vi.fn()` without depending on Node's overloaded * `ExecFileSyncOptions` union. */ export type ExecFileSyncLike = (file: string, args: readonly string[], options: { encoding: "utf8"; timeout: number; }) => string; /** * Returns `true` when `pgrep -f` finds at least one process whose full * command line matches `HERMES_CHAT_PROCESS_PATTERN`. * * `pgrep` exits non-zero when there is no match, when it cannot be * found, or on permission errors — all of which we collapse into * `false` because the caller only uses the boolean to decide whether * to upgrade `"disconnected"` to `"reconnecting"`. Surfacing the * difference would just turn a UI hint into a noisy crash path. * * `execFile` is overridable so the unit test can inject a stub instead * of mocking `node:child_process` globally — a Node ESM namespace is * frozen at import time, so spy-based mocking is brittle. Injection is * the same dependency pattern the rest of the bridge uses (see * `startStdioServer`'s `stdin` / `stdout` options). */ export declare function isHermesChatRunning(execFile?: ExecFileSyncLike): boolean; //# sourceMappingURL=hermes-process.d.ts.map