export type WorkspaceEnvMode = "shell" | "direnv" | "off"; /** * M20: never carried, even when the whole environment is: a job's identity (the worker * gets its own), and what names the terminal the launch came from (the session runs in * its own PTY and is opened from any terminal, or a phone). */ export declare const ENV_NEVER: Set; /** A name a worker's environment may hold: not on the never list, not denied. */ export declare function envKept(name: string, deny?: readonly string[]): boolean; export declare const PROBE_TIMEOUT_MS = 8000; /** The script that cds like a person would and prints the environment after a marker. */ export declare function probeScript(shell: string): { args: string[]; } | undefined; /** The environment printed after the marker (NUL-separated `K=V`). */ export declare function parseProbe(out: Buffer): Record | undefined; export declare function killProbes(): void; export interface WorkspaceEnvResult { env: Record; /** What gave it: the shell's hooks, direnv, or nothing (the base as it came). */ via: "shell" | "direnv" | "none"; } /** * The environment for a session in `cwd`, from `base` (what the launch carried). `keep` * decides which names may come out of the probe (the deny list and the never list). */ export declare function workspaceEnv(cwd: string, base: Record, mode: WorkspaceEnvMode, keep: (name: string) => boolean, timeoutMs?: number): Promise;