Skip to content

bounded-systems/machine-schema

@bounded-systems/machine-schema

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.

Install

npm install @bounded-systems/machine-schema zod

zod is a peer dependency (^3.25 || ^4).

Usage

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.

Design

  • 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 zod peer dep; an extractability test enforces no upward edges and no ambient authority.

License

MIT © Bounded Systems

About

Brands, handoff envelope, and state/phase/invariant primitives for work-unit machines

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors