Skip to main content

Module session_resources

Module session_resources 

Source
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/prompts entries (paths, globs and !/+/- patterns, project scope first), and the auto-discovered ones (.pi/skills, .pi/prompts, .agents/skills from 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.md in 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§

ResourceSource
Where one resource came from (PathMetadata with its path): its source (local or auto), scope and origin (always top-level), and its base directory.
SessionResources

Constants§

BUNDLED_SKILLS_ENV

Functions§

bundled_skills
defaultBundledSkillPaths: the bundled skills directory dir, unless ULTRON_BUNDLED_SKILLS is off, 0 or false.
prompt_source_info
A prompt template’s SourceInfo: the resolved resource’s, else the loader’s own (local; scope user or project with that prompts directory, else temporary with 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 settings holds (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 (createSkillSourceInfo for 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 in bundled (a directory), the first skill of a name kept.
source_info
findSourceInfoForPath over the resolved resources: the metadata of the first resource that is the file or a directory holding it; None for 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.)