Skip to main content

ConfigPaths

Struct ConfigPaths 

Source
pub struct ConfigPaths {
    pub user_data_dir: PathBuf,
    pub global_data_dir: PathBuf,
    pub local_data_dir: PathBuf,
    pub project_root: Option<PathBuf>,
    pub project_untrusted: bool,
    pub layout: Layout,
}
Expand description

Unified management of AGENT persistent directory paths: the three tiers’ roots and every path derived from them. A caller asks for the path here rather than joining a name onto a root.

Usually global_data_dir = $HOME/.agix/, user_data_dir = <global>/scenes/<scope>/, local_data_dir = <project>/<layout's project dir>/.

Fields§

§user_data_dir: PathBuf

User-level, scene-specific override root.

§global_data_dir: PathBuf

User-level, cross-scene global root (flat, shared by every scene).

§local_data_dir: PathBuf

The project tier’s root; the state root in a session without a project.

§project_root: Option<PathBuf>

The project, None for a session without one (crate::paths::PathSettings::project_root).

§project_untrusted: bool§layout: Layout

Implementations§

Source§

impl ConfigPaths

Source

pub fn new( global_data_dir: PathBuf, local_data_dir: PathBuf, scope: &str, layout: Layout, ) -> Self

Build from explicit roots.

There is no constructor that consults the environment, and that is the point: a process serves one instance, and which directory that instance owns is the caller’s to decide. Reading $HOME here would make every downstream module silently agree on the invoking user’s home, which is wrong for a test, wrong for a service account, and wrong for any deployment that keeps its state somewhere else.

scope identifies the product instance whose scene-specific override tree lives under global_data_dir/scenes/<scope>/.

Source

pub fn of( global_data_dir: PathBuf, scene_dir: PathBuf, project: Option<&Path>, layout: Layout, ) -> Self

The paths of a session of scene_dir in project, or in none: the project tier is layout’s directory in the project, and without a project it is the state root, as LoadedSettings makes it.

Source

pub fn from_settings(paths: &PathSettings) -> Self

The same roots [crate::settings::Settings] already carries — for the call sites that hold Settings and want these accessors without re-deriving anything.

Source

pub fn state_root(&self) -> StateRoot

Source

pub fn scene_dir(&self) -> &Path

Source

pub fn project_dir(&self) -> Option<&Path>

The project’s own directory, None without a project.

Source

pub fn tier_dir(&self, tier: Tier) -> Option<PathBuf>

The directory of a settings tier: the state root, the scene directory, the project directory. None for the project tier without a project, the cli and session ones, and the managed one, which is a file.

Source

pub fn tier_entry(&self, tier: Tier, name: &str) -> Option<PathBuf>

name, one of entry, in a tier’s directory.

Source

pub fn settings_file(&self, tier: Tier) -> Option<PathBuf>

Source

pub fn settings_local_file(&self, tier: Tier) -> Option<PathBuf>

Source

pub fn global_skills_dir(&self) -> PathBuf

Source

pub fn user_skills_dir(&self) -> PathBuf

Source

pub fn project_skills_dir(&self) -> Option<PathBuf>

<project>/.agents/skills: beside the project directory, not in it.

Source

pub fn global_agents_dir(&self) -> PathBuf

Source

pub fn user_agents_dir(&self) -> PathBuf

Source

pub fn project_agents_dir(&self) -> Option<PathBuf>

Source

pub fn global_hooks_dir(&self) -> PathBuf

Source

pub fn user_hooks_dir(&self) -> PathBuf

Source

pub fn project_hooks_dir(&self) -> Option<PathBuf>

Source

pub fn global_rules_dir(&self) -> PathBuf

Source

pub fn user_rules_dir(&self) -> PathBuf

Source

pub fn project_rules_dir(&self) -> Option<PathBuf>

Source

pub fn user_output_styles_dir(&self) -> PathBuf

Source

pub fn project_output_styles_dir(&self) -> Option<PathBuf>

Source

pub fn global_plugins_dir(&self) -> PathBuf

Source

pub fn user_plugins_dir(&self) -> PathBuf

Source

pub fn global_memory_dir(&self) -> PathBuf

The state root’s memory, the user’s across every project.

Source

pub fn global_recordings_dir(&self) -> PathBuf

Source

pub fn project_state_dir(&self) -> Option<PathBuf>

The project directory’s state/, None without a project.

Source

pub fn local_state_dir(&self) -> PathBuf

Where this machine’s data of the session’s place is: the project directory’s state/, and without a project the state root, which has no state/ of its own.

Source

pub fn local_memory_dir(&self) -> PathBuf

Source

pub fn scratchpad_dir(&self) -> PathBuf

Source

pub fn telemetry_dir(&self) -> PathBuf

Source

pub fn tool_results_dir(&self, session_id: &str) -> PathBuf

Source

pub fn scheduled_tasks_file(&self) -> PathBuf

The scene’s scheduled_tasks.json.

Source

pub fn mcp_oauth_dir(&self) -> PathBuf

Source

pub fn imported_marker(&self) -> Option<PathBuf>

Where the import records that its question was answered, None without a project.

Source

pub fn teams_dir(&self, cwd: &Path) -> PathBuf

The teams of a session working in cwd (Layout::teams_dir).

Source

pub fn worktrees_dir(&self) -> Option<PathBuf>

The engine’s worktrees of the project (Layout::worktrees_dir).

Trait Implementations§

Source§

impl Clone for ConfigPaths

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigPaths

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more