Schema primitives for work-unit state machines: branded types, the handoff envelope, and the state / phase / invariant building blocks.
This is the shared vocabulary the machines are written against — branded identifiers that can't be confused with bare strings, the envelope one machine hands to the next, and the Zod schemas for states, phases, and invariants.
npm install @bounded-systems/machine-schema zodzod is a peer dependency (^3.25 || ^4).
import {
// brands — nominal types over primitives
// handoff — the envelope passed between machines
// state — state/phase/invariant schemas
} from "@bounded-systems/machine-schema";The barrel re-exports the brands, handoff, and state modules; import the
brand constructors, the handoff envelope schema, and the state primitives you
need.
- Brands over strings. Identifiers are nominal, so a work-unit id can't be passed where a contract id is expected.
- Leaf package. Its only dependency is the
zodpeer dep; an extractability test enforces no upward edges and no ambient authority.
MIT © Bounded Systems