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:
- Global shared — every file under
~/.zig/resources/_shared/ - Global per-workflow — every file under
~/.zig/resources/<workflow-name>/ - Project (cwd) — every file under
<git-root>/.zig/resources/ - Inline workflow —
resources = [...]in[workflow]of the.zwffile - Inline step —
resources = [...]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.
- Resource
Collector - Run-time configuration for resource collection, built once per workflow
invocation in
crate::run::run_workflowand threaded through to every step. - Resource
Set - An ordered, deduplicated collection of resources.
Enums§
- Resource
Origin - 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.