corepack enable
pnpm installNode 24 or newer is required. The package is ESM-only and targets NestJS 12 and CapsuleOS 0.2.
pnpm run check # Oxlint, Prettier, and TypeScript
pnpm run test # unit and compile-time tests
pnpm run build # tsdown output in dist/
pnpm run verify:pack # build, Publint, packed declarations, and package shape
pnpm run verify # every local release gateAdd a Changeset for every user-visible change with pnpm changeset.
After the one-time package-name bootstrap described below, releases run only in GitHub Actions on
main through npm Trusted Publishing. The guarded publisher validates Changesets prerelease state
and explicitly keeps alpha versions on the alpha dist-tag; never invoke routine npm publication
directly from a developer workstation.
npm cannot attach a trusted publisher until the package record exists. The initial
@nestm/capsuleos@0.1.0-alpha.0 publication therefore uses the separate, manually dispatched
bootstrap-release.yml workflow and a short-lived granular token in the npm-bootstrap
environment's NPM_TOKEN secret. The workflow is restricted to main, accepts one exact typed
confirmation, verifies the full package, checks the npm identity and package absence, and publishes
on the alpha dist-tag without provenance. It cannot publish any later version.
Immediately after that bootstrap succeeds:
- Configure the npm trusted publisher for repository
nestm-dev/capsuleos, workflowrelease.yml, and environmentrelease. - Remove the
NPM_TOKENGitHub secret and revoke the bootstrap token unless an explicit security exception keeps it alive elsewhere. - Dispatch
release.ymlonce to prove OIDC publication setup. All subsequent releases use OIDC with provenance and have no token fallback.
The intended GitHub repository must be public before routine provenance-bearing publication. A new package name requires a separately reviewed bootstrap rather than broadening the routine workflow.
- Keep CapsuleOS providers and native clients application-owned. Nest must never close them.
- Keep prebuilt Capsule facades application-owned and preserve their identity.
- Do not load testing, Harness, or concrete provider SDKs from the root entrypoint.
- Preserve provider aliases and provider-specific request types through public generics.
- Preserve ESM output and emitted decorator metadata.
- Unit and packaging tests must not allocate a live sandbox or call a provider API.
- Harness registration may construct a sandbox provider at bootstrap, but must not create a session.
Keep changes focused, document public behavior, include regression coverage, and make sure
pnpm run verify passes before requesting review.