@sealant/workspace-composition
@sealant/workspace-composition
Purpose
@sealant/workspace-composition defines the core composition contracts used to turn user intent
into a normalized sandbox build target.
It accepts a user-facing UserWorkspaceSpec, normalizes it into WorkspaceBlueprint, and defines
the executor contracts consumed by concrete OS integrations.
Why this package exists
- Keep sandbox composition rules centralized and reusable across apps.
- Keep product-facing inputs (
sandboxandissue workflowcontext) separated from execution implementation details. - Provide stable, typed contracts that integration packages can compile from.
Public surface
Core export groups:
user-workspace-spec: parse and normalize user input (parseUserWorkspaceSpec,normalizeUserWorkspaceSpec,userWorkspaceSpecSchema)blueprint: normalized model (workspaceBlueprintSchema,parseWorkspaceBlueprint,workspaceBlueprintVersion)executor: OS executor contracts and build artifact schemasbuildkit: BuildKit-specific compile input/output schemas used by BuildKit-backed executors
Top-level exports live in packages/workspace-composition/src/index.ts.
Module map
src/user-workspace-spec.ts- ergonomic user input schema
- alias conflict validation
- shorthand normalization to canonical blueprint shape
src/blueprint.ts- normalized internal blueprint schema
- target/runtime/access/lifecycle/customization defaults
src/executor.tsOsExecutorinterface- support failure vocabulary
- standardized build artifact schemas
src/buildkit.ts- BuildKit-specialized compile schemas (
ResolvedImagePlan,BuildkitBuildSpec)
- BuildKit-specialized compile schemas (
Normalization guarantees
normalizeUserWorkspaceSpec(input) guarantees that downstream layers receive one strict contract:
- exactly one workspace source (
source,repo, orsources.workspace) - inferred source provider when omitted (
github,gitlab,generic) - deduped symbolic package requests
- normalized setup/startup command steps
- explicit target OS and runtime selectors
- resolved runtime defaults (workspace paths, persistence, OCI runtime, outbound networking)
Support and compile contracts
OsExecutor.supports(...) returns a typed success/failure shape.
Standardized support failure reasons:
unsupported-osunsupported-harnessunsupported-packageunsupported-access-modeunsupported-runtime-requirement
OsExecutor.compile(...) returns one or more standardized artifacts:
oci-imagefilesystem-closuremanifestmetadata
Related contract docs
packages/workspace-composition/docs/contracts.mdpackages/workspace-composition/docs/user-workspace-spec.mdpackages/workspace-composition/docs/workspace-blueprint.mdpackages/workspace-composition/docs/executor-contract.md
Deep dive pages
Internal dependencies
- External runtime dependencies:
zod - Internal package dependencies: none
Typical call flow
- Product/API surface receives a workspace request.
- Request is normalized into
WorkspaceBlueprint. - Blueprint is passed to OS executor selection and compile steps.
- Compile step returns artifacts that downstream registry/runtime layers use.
Scripts
pnpm --filter @sealant/workspace-composition lintpnpm --filter @sealant/workspace-composition testpnpm --filter @sealant/workspace-composition typecheck