// env vars that indicate the CLI is being driven by an agent/automation rather // than a human at a terminal. when any is present, auto-waits get a longer // budget and log more aggressively, because an agent can't see mid-animation // flicker the way a human can. const AGENT_ENV_VARS = [ 'RNX_AGENT', 'TM_SESSION', 'CLAUDECODE', 'CLAUDE_CODE_ENTRYPOINT', 'CLAUDE_CODE_SESSION_ID', 'CODEX_THREAD_ID', 'CURSOR_TRACE_ID', 'AIDER_MODEL', ] export function isAgentEnv( env: Readonly> = process.env, ): boolean { if (env.RNX_AGENT === '0') return false for (const name of AGENT_ENV_VARS) { const v = env[name] if (v && v.trim() && v !== '0') return true } return false }