import type { ClaudeAuthMode, Config, RunnerName } from "../config.js"; import type { Secrets } from "../env.js"; import { type Skill } from "../skills.js"; export declare function defaultPathEntries(home?: string): string[]; /** The server's PATH plus the usual tool locations, so launchd's minimal PATH still finds `claude` and `codex`. */ export declare function mergedPath(current: string | undefined, home?: string): string; export interface RunEnvInput { /** Merged secrets (.env file with the process environment layered on top); used for explicit `env:` names. */ secrets: Secrets; /** Secrets from the .env file only. Runner credentials (ANTHROPIC_*, CLAUDE_*, OPENAI_*, CODEX_*) pass through from here. Defaults to `secrets`. */ fileSecrets?: Secrets; skill: Skill; config: Config; jobVars: Record; processEnv?: NodeJS.ProcessEnv; /** The runner the job runs with: for `claude`, `runners.claude.auth` decides which credentials stay. */ runner?: RunnerName; } /** * The environment every run starts from, before a skill's own `env:` names and the job variables: session basics, the * merged PATH and the runner credentials. Also what the health probes run `claude`/`codex` with, so `CLAUDE_CONFIG_DIR`, * `CODEX_HOME` or an API key in `.env` apply to the diagnosis exactly as to the jobs. */ export declare function baseRunEnv(input: Pick): Record; /** * What a probe of `claude` / `codex` (a version or login check, a listing, the control protocol) runs with: `env` cut * down to PATH, the session basics (`BASE_KEYS`) and the runner's own credentials and settings (`ANTHROPIC_*`, * `CLAUDE_*`, `OPENAI_*`, `CODEX_*`, proxies and certificates). A probe does no work for a skill, so nothing a skill * was given (`env_passthrough`, `env:`, the job variables) and nothing else `.env` holds reaches its environment, where * `ps` would show it. */ export declare function probeEnv(env: Record): Record; /** Of those, the API keys: what `runners.claude.auth: api_key` keeps, and what makes the runner ready under it. */ export declare const CLAUDE_API_KEY_VARS: string[]; /** The skill's `claude.config_dir` as an absolute path (`~` expanded, relative to the skill's directory), if it names one. */ export declare function claudeConfigDir(skill: Pick): string | undefined; /** * `env` with Claude Code pointed at `configDir`: `CLAUDE_CONFIG_DIR` set and the variables that would authenticate as * someone else instead (an API key, an OAuth token) removed, unless `keep` names them or `auth` is `api_key` (which * keeps the API keys: the directory then supplies settings and plugins, the key the billing). */ export declare function withClaudeConfigDir(env: Record, configDir: string | undefined, keep?: readonly string[], auth?: ClaudeAuthMode): Record; /** * `env` as `runners.claude.auth` says Claude Code authenticates: under `login` the API keys and tokens are removed * (unless `keep` names them), so the login in the configuration directory is what runs; `auto` and `api_key` leave them. */ export declare function withClaudeAuth(env: Record, auth: ClaudeAuthMode, keep?: readonly string[]): Record; export declare function buildRunEnv(input: RunEnvInput): Record;