Skip to main content

Module resources

Module resources 

Source
Expand description

Resource file advertisement.

Resources are reference files (a CV, a style guide, reference docs, …) that the agent is told about through its system prompt so it can choose to read them with its file tools on demand. Unlike Step.files, resources are never inlined into the user message — only their absolute paths are advertised, keeping context cheap and letting the agent decide what to pull in.

Resources come from four tiers, merged at run time in this order:

  1. Global shared — every file under ~/.zig/resources/_shared/
  2. Global per-workflow — every file under ~/.zig/resources/<workflow-name>/
  3. Project (cwd) — every file under <git-root>/.zig/resources/
  4. Inline workflowresources = [...] in [workflow] of the .zwf file
  5. Inline stepresources = [...] on a single [[step]]

Entries are deduplicated by canonicalized absolute path; the first tier to discover a path wins for display ordering. Name collisions across different paths are not dropped — both files are advertised so the agent can see everything that’s actually on disk.

Structs§

Resource
A single resolved resource entry — the form that gets rendered into the system prompt.
ResourceCollector
Run-time configuration for resource collection, built once per workflow invocation in crate::run::run_workflow and threaded through to every step.
ResourceSet
An ordered, deduplicated collection of resources.

Enums§

ResourceOrigin
Where a resource was discovered. Tiers are emitted in declaration order; the first tier to register a given canonical path wins.

Functions§

collect_inline_resources
Convenience for tests and the original PR 1 API: collect inline-only resources without walking any global/cwd tiers.
render_system_block
Render a <resources> XML-ish block to prepend to a system prompt.