/** * Keeps agent shells out of the user's shell history. * * Crewly used to type `export GEMINI_API_KEY=…` into agent shells, and bash * wrote those lines to ~/.bash_history hundreds of times. Secrets now travel * only in the spawn env (utils/secret-env), and on top of that agent shells * never write a history file at all: * * - historyOffSpawnEnv() goes into every PTY's spawn environment; * - shellHistoryDisableLine() is typed first by the runtime init sequence, * after the rc files ran (they may set HISTFILE themselves); * - quietShellLine() prefixes every other typed line with a space, which * bash (HISTCONTROL=ignorespace) and zsh (HIST_IGNORE_SPACE) skip. * * See SHELL_HISTORY_CONSTANTS for why HISTSIZE/HISTFILESIZE are not touched. * * @module utils/shell-history */ /** * Env vars that keep a freshly spawned bash/zsh from writing history. * * @returns A fresh copy (callers may spread or mutate it) */ export declare function historyOffSpawnEnv(): Record; /** * Prefixes a line typed into a shell with a space so it is not recorded. * Already-prefixed lines are returned unchanged. * * @param line - Shell command line * @returns The line, space-prefixed */ export declare function quietShellLine(line: string): string; /** * The (space-prefixed) line that turns history off inside a running shell. * * @param shell - Shell binary path (defaults to $SHELL, then /bin/bash — what * agent PTYs are spawned with) * @returns The line to type, or null for a shell we do not know how to quiet */ export declare function shellHistoryDisableLine(shell?: string | undefined): string | null; /** * Quotes a value for a POSIX shell word (single quotes). * * @param value - Raw value * @returns Single-quoted value safe for `sh -c` */ export declare function shellQuote(value: string): string; //# sourceMappingURL=shell-history.d.ts.map