@capsulos/template
v0.13.0
Published
capsule.yaml: the declarative template format of capsulos. Schema, validation, inheritance, the lock, and the compiler that turns a template into a build context for any provider.
Maintainers
Readme
@capsulos/template
capsule.yaml, the declarative template format of capsulos: the machine an agent works in, in one file. This package reads it, says what is wrong with it, resolves what it extends, pins what it resolves to (capsule.lock) and compiles it into a build context any provider can build. The reference of the format is docs/capsule-yaml.md; the commands are in @capsulos/cli (capsulos template init | validate | lock | plan | apply).
import { resolveTemplate, makeLock, compile, writeContext, plan, apply } from '@capsulos/template';
const { template, issues } = resolveTemplate('./my-app'); // issues: path, code, message, hint, line
const lock = await makeLock(template); // versions, hashes, one digest
writeContext(compile(template, lock), './out'); // a Dockerfile and its filescapsule.schema.json(@capsulos/template/schema): the JSON Schema of the format, for editors and other tools.planandapplytakeTemplateTargets: how a provider lists the versions it has, builds a context and removes an image.@capsulos/clibrings the ones for Docker and Lambda MicroVMs.- The catalog (
base,pi-agent,java-gradle) ships with the package:from: capsulos/base@2needs no network.
