pub struct SessionEnv {
pub cwd: PathBuf,
pub refusal_rule_roots: Vec<PathBuf>,
pub additional_writable_dirs: Vec<PathBuf>,
pub read_directories: Vec<PathBuf>,
pub read_anywhere: bool,
pub cache_directories: Vec<PathBuf>,
pub unattended: bool,
pub base_mode: PermissionMode,
pub skill_dirs: LiveDirs,
pub protected_dirs: LiveDirs,
}Expand description
What the engine running a session derives from its settings and scene. Each engine brings its own, and attaching an engine replaces the session’s whole.
Fields§
§cwd: PathBuf§refusal_rule_roots: Vec<PathBuf>Directories a relative deny or ask path rule is also read against,
besides cwd: the project root, for a session working in one of its
worktrees. An allow is read against cwd alone.
additional_writable_dirs: Vec<PathBuf>用户级附加可写目录(files.extra_dirs)—— Tool 在做路径校验时用
read_directories: Vec<PathBuf>Directories outside the project the file tools may read without
asking — files.read_dirs.
read_anywhere: boolfiles.read_dirs holding /.
cache_directories: Vec<PathBuf>Package and build caches a sandboxed command may write —
sandbox.cache_dirs; a ~/ path is expanded when the command
runs.
unattended: boolNobody answers this session’s questions or permission prompts — see
SceneSpec::interactive.
base_mode: PermissionModeThe permission mode the engine runs the session in: the one decided
for the session, not necessarily its settings’ permissions.mode.
skill_dirs: LiveDirsThe host’s skill directories this session lists: readable without
asking, like read_directories, and changed without a rebuild.
protected_dirs: LiveDirsEvery host skill directory a session in this process has listed, and the directory of each of the host’s own packages: no tool writes under one, in any permission mode, and no sandboxed command.