1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! The environment variables the kernel process and its Python runtime (`runtime.py` and its modules) read, where a
//! subagent's worktree lives, and the interpreter the kernel runs.
use Path;
pub const PYTHON_ENV: &str = "ULTRON_PYTHON";
pub const RLM_ENV_ALLOW_ENV: &str = "ULTRON_RLM_ENV_ALLOW";
pub const RLM_MAX_MEMORY_MB_ENV: &str = "ULTRON_RLM_MAX_MEMORY_MB";
pub const RLM_MAX_CPU_SECONDS_ENV: &str = "ULTRON_RLM_MAX_CPU_SECONDS";
pub const RLM_MAX_TREE_MEMORY_MB_ENV: &str = "ULTRON_RLM_MAX_TREE_MEMORY_MB";
pub const RLM_TREE_MEMORY_BACKEND_ENV: &str = "ULTRON_RLM_TREE_MEMORY_BACKEND";
pub const RLM_OUTPUT_BYTES_ENV: &str = "ULTRON_RLM_OUTPUT_BYTES";
pub const RLM_SPILL_DIR_ENV: &str = "ULTRON_RLM_SPILL_DIR";
pub const RLM_STREAM_OUTPUT_ENV: &str = "ULTRON_RLM_STREAM_OUTPUT";
pub const CODE_SKILLS_DIR_ENV: &str = "ULTRON_CODE_SKILLS_DIR";
pub const BASH_YIELD_AFTER_ENV: &str = "ULTRON_BASH_YIELD_AFTER";
pub const CELL_YIELD_AFTER_ENV: &str = "ULTRON_CELL_YIELD_AFTER";
pub const FILE_HOOKS_ENV: &str = "ULTRON_FILE_HOOKS";
/// A subagent's worktree, its parent's checkout and its branch (`worktree_api.py`).
pub const WORKTREE_ENV: &str = "ULTRON_WORKTREE";
pub const PARENT_REPO_ENV: &str = "ULTRON_PARENT_REPO";
pub const WORKTREE_BRANCH_ENV: &str = "ULTRON_WORKTREE_BRANCH";
/// The directory under the Git common dir that holds subagent worktrees and their records (worktrees.ts
/// `WORKTREES_DIR`).
pub const WORKTREES_DIR: &str = "ultron-worktrees";
/// Set (to `1`) in every kernel's environment, so a cell's command or a program it started knows it runs inside a
/// kernel. Rust-only; the resource limits beside it may also come from the user.
pub const IN_KERNEL_ENV: &str = "ULTRON_IN_KERNEL";
/// Whether this process runs inside an Ultron kernel ([`IN_KERNEL_ENV`]).
/// kernel.ts: the interpreter the kernel runs, `ULTRON_PYTHON ?? (linux && /usr/bin/python3 exists ?
/// "/usr/bin/python3" : "python3")`.