Expand description
The resources a session loads, as resource-loader.ts reload assembles them for the session worker:
- every local resource (crate::local_resources) in its precedence order: the settings’ local
skills/promptsentries (paths, globs and!/+/-patterns, project scope first), and the auto-discovered ones (.pi/skills,.pi/prompts,.agents/skillsfrom the cwd up to the git root,<agentDir>/skills,<agentDir>/prompts,~/.agents/skills). A project that is not trusted contributes no settings, no project resources and no ancestor.agents/skills; - then the bundled skills (
bundledSkillPaths), the first skill of a name kept; - the base system prompt and its addendum:
.pi/SYSTEM.md/.pi/APPEND_SYSTEM.mdin a trusted project, else<agentDir>/SYSTEM.md/<agentDir>/APPEND_SYSTEM.md(discoverSystemPromptFile).
Pi packages (the settings packages) and the -e sources are not supported by ultron-rs: they contribute
nothing (the CLI notes the ignored packages once at startup).
Every skill and prompt carries its SourceInfo as findSourceInfoForPath gives it (the resolved resource’s
metadata, exact path first, then the first resource directory holding it), else the loader’s own.
Structs§
- Resource
Source - Where one resource came from (
PathMetadatawith its path): its source (localorauto), scope and origin (alwaystop-level), and its base directory. - Session
Resources
Constants§
Functions§
- bundled_
skills defaultBundledSkillPaths: the bundled skills directorydir, unlessULTRON_BUNDLED_SKILLSisoff,0orfalse.- prompt_
source_ info - A prompt template’s
SourceInfo: the resolved resource’s, else the loader’s own (local; scopeuserorprojectwith that prompts directory, elsetemporarywith the file’s directory). - prompts
- The prompt templates of a session (
updatePromptsFromPaths): the resolved ones, the first of a name kept. - resolve
- The session’s resources for the settings
settingsholds (with the session’s project trust).append_system_prompt(--append-system-prompt) replaces a discovered APPEND_SYSTEM.md. - resolve_
default - The resources a session in
env’s directory loads with no flags, its project trust decided as the worker decides it (workerProjectTrusted). - skill_
source_ info - A skill’s
SourceInfo: the resolved resource’s, else the loader’s own (createSkillSourceInfofor a path outside the profile’s and project’s skill directories, whose skills always have metadata:local,temporary, the skill’s directory). In practice the bundled skills. - skills
- The skills of a session (
updateSkillsFromPaths): without--no-skills, the resolved ones and the bundled ones inbundled(a directory), the first skill of a name kept. - source_
info findSourceInfoForPathover the resolved resources: the metadata of the first resource that is the file or a directory holding it;Nonefor anything else. (TypeScript looks for the exact path first; here every resolved skill and prompt is a file of its own, listed before any directory that could hold it, so one pass is the same.)