Skip to main content

Module storage

Module storage 

Source
Expand description

Workflow storage — structured, writable working data for a run.

Storage is a first-class workflow concept alongside vars (scalar state) and resources (read-only reference files). It gives a workflow a place to accumulate files that its steps produce and consume — the canonical example is a book-writing workflow that maintains character sheets, world-building notes, and a consistency bible across many steps.

§Path resolution

Storage paths resolve relative to <cwd>/.zig/ — where <cwd> is the directory the user invoked zig run from. Absolute paths pass through unchanged. This differs from resources, which resolve relative to the .zwf file: resources ship with the workflow, storage belongs to the run.

§Backends

The StorageBackend trait abstracts over the underlying store. The only implementation today is FilesystemBackend; future sqlite/remote backends slot in behind the same trait without workflow-format changes.

Structs§

FilesystemBackend
Filesystem-backed storage rooted at <cwd>/.zig/.
StorageEntry
A single entry inside a folder-typed storage item, surfaced to the agent so it can see what previous steps wrote.
StorageItem
A single declared storage item bound to the backend that services it.
StorageListing
The current contents of a storage item at the moment a step starts.
StorageManager
Owns the set of declared storage items for a single workflow run and routes operations to the appropriate backend. Built once in [crate::run::execute] and threaded through to every step.

Traits§

StorageBackend
Abstraction over a storage backend. Implementations decide how to materialise a StorageSpec and how to enumerate its contents.

Functions§

resolve_against
Resolve a raw storage path against <cwd>/.zig/ for callers that don’t have a full StorageManager — used by tests and by code that wants to know the absolute path without going through the backend.