Silo.open()
Binds to one project root.
cwd defaults to process.cwd(). It is captured once rather than read again further down, so a single process can serve several projects at the same time. Opening a path that is not a directory throws environment_not_found.
Environments
create is silo init. open binds to one that already exists and throws environment_not_found if it does not.
A SiloEnvironment exposes name, cwd, the four resource collections, and validate().
Resources
Each resource collection mirrors the matching CLI command family.put has no CLI equivalent — it adds or replaces without caring which, which is what you want in a generator that may run twice.
Scaffolding
ScaffoldResult describing the file created and the barrel entry added. As with the CLI, the generated code compiles and fails on purpose — it never contains business logic.
Validation
env validate --json: ok, findings[] and counts. It runs the real TypeScript compiler, not a file-presence check.
Errors
Every failure throws aSiloError with a stable code:
isSiloError is a type guard, so error.code and error.details are typed inside the branch. See Error Codes.
Authoring exports
The SDK also re-exports what environment code itself is written against:tools/ and verifiers/ files import. They are runtime values, not types, so the package must be installed for an environment to run — not only to type-check.
Running
Running a rollout is currently a CLI concern. To run agents from a script, shell out:.silo/runs/<runId>/ either way, and result.json is designed to be read back programmatically — see Run Artifacts.
Silo