pub struct PromptFiles { /* private fields */ }Expand description
How the engine reads a file it puts in front of the model on its own —
skill listings and bodies, instruction files, rules, agent definitions,
output styles, memory. What the file resolves to may not be a credential
location, and a file spelled under root (the project, for project
content) may not resolve outside it: a repository can commit a symbolic
link to anything, and its own files are all it gets to show the model.
The state root’s own files are the user’s, not the project’s, even when
the state root sits under root — a project opened at $HOME holds
~/.agix, and the user’s own skills there may link anywhere.
Implementations§
Source§impl PromptFiles
impl PromptFiles
Sourcepub fn unscoped() -> Self
pub fn unscoped() -> Self
With no state root and no root: only the credentials a name alone gives away are refused.
Sourcepub fn for_project(paths: &ConfigPaths) -> Self
pub fn for_project(paths: &ConfigPaths) -> Self
For a session with these roots: the state root’s credentials, and the project as the root. A session without a project reads nothing of a project’s, so it has no root to confine.
Sourcepub fn resolve(&self, path: &Path) -> Result<PathBuf>
pub fn resolve(&self, path: &Path) -> Result<PathBuf>
Where path resolves, when the engine may read it for the model. A
refusal is logged and comes back as PermissionDenied.
Sourcepub fn read_to_string(&self, path: &Path) -> Result<String>
pub fn read_to_string(&self, path: &Path) -> Result<String>
Self::resolve, then the text of what it resolved to.