pub struct Home { /* private fields */ }Expand description
The RIG_HOME layout. Every file the launcher and the agent write lives
under this one root.
Implementations§
Source§impl Home
impl Home
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
The root from env::HOME, else ~/.rig, made absolute so the
launcher, the agent and their children agree on it from any
directory.
Sourcepub fn at(root: impl Into<PathBuf>) -> Self
pub fn at(root: impl Into<PathBuf>) -> Self
The layout under root, made absolute: a home of its own, such as
a test’s.
Sourcepub fn plugins_toml(&self) -> PathBuf
pub fn plugins_toml(&self) -> PathBuf
plugins.toml, the plugin list.
Sourcepub fn plugins(&self) -> PathBuf
pub fn plugins(&self) -> PathBuf
plugins/, where rig plugin new makes plugin crates, outside any
workspace: plugins/<name> is listed in plugins.toml as
path = "plugins/<name>".
Sourcepub fn settings(&self) -> PathBuf
pub fn settings(&self) -> PathBuf
settings.toml, the user’s settings for plugins: one table per
plugin, which the agent hands to the plugin that reads it.
Sourcepub fn defaults(&self) -> PathBuf
pub fn defaults(&self) -> PathBuf
defaults.json, the model and reasoning setting a new session
starts with: the last ones chosen.
Sourcepub fn auth(&self) -> PathBuf
pub fn auth(&self) -> PathBuf
auth/, where /login keeps each subscription credential, as
<provider>.json.
Sourcepub fn build_log(&self) -> PathBuf
pub fn build_log(&self) -> PathBuf
The whole output of the last build, the launcher’s and cargo’s,
rewritten by every build: the one before each start and rig build,
which /reload runs. Its last line says how the build ended.
Sourcepub fn described(&self, stamp: &str) -> PathBuf
pub fn described(&self, stamp: &str) -> PathBuf
The AgentDescription report of the build whose stamp is stamp (its
modification time in nanoseconds and its length, as "{mtime} {len}"),
one per build, which every copy of the build shares.
Sourcepub fn rejected(&self) -> PathBuf
pub fn rejected(&self) -> PathBuf
The stamp of the last build that stopped before it was ready.
Sourcepub fn build_lock(&self) -> PathBuf
pub fn build_lock(&self) -> PathBuf
The lock every launcher on this root takes to generate, build and stage the agent.
Sourcepub fn staged_for(&self, session: &SessionId) -> PathBuf
pub fn staged_for(&self, session: &SessionId) -> PathBuf
The build staged for the launcher of session alone.
Sourcepub fn trial_for(&self, session: &SessionId) -> PathBuf
pub fn trial_for(&self, session: &SessionId) -> PathBuf
The build the launcher of session runs until it is ready.
Sourcepub fn owner_of(name: &str) -> Option<SessionId>
pub fn owner_of(name: &str) -> Option<SessionId>
The session whose launcher owns a file of Home::bin named
name: a staged-<session> or trial-<session>.
Sourcepub fn projects(&self) -> PathBuf
pub fn projects(&self) -> PathBuf
projects/, where plugins keep files per project, one directory
for each project the agent worked in.
Sourcepub fn run(&self, launcher: u32) -> RunDir
pub fn run(&self, launcher: u32) -> RunDir
The run directory of the launcher with the process id launcher.
Sourcepub fn session(&self, session: &SessionId) -> SessionDir
pub fn session(&self, session: &SessionId) -> SessionDir
The directory of session.
Sourcepub fn new_session(&self) -> Result<(SessionId, SessionDir)>
pub fn new_session(&self) -> Result<(SessionId, SessionDir)>
A new session, its directory created: a SessionId::generated
id, or, when a session of this home has that one, the first free
one after it, such as 1700000000-42-1.
§Errors
When the directory cannot be created.
Sourcepub fn saved_sessions(&self) -> Vec<(SessionId, SessionDir)>
pub fn saved_sessions(&self) -> Vec<(SessionId, SessionDir)>
Every saved session of this home (not one being deleted), in no
order, with its directory: what every listing and Self::find
read.
Sourcepub fn find(&self, name_or_id: &str) -> Result<SessionId, String>
pub fn find(&self, name_or_id: &str) -> Result<SessionId, String>
The saved session name_or_id names: the one with that id when it
parses as one and is saved, else the only saved session with that
SessionDir::name.
§Errors
When no saved session has that id or name, or several have that name: the error lists their ids.