@cosplay-ai/protocol
v0.11.0
Published
Shared TypeScript types and Zod runtime validators for the Cosplay wire protocol. This package is the single source of truth for the contract between the OSS relay (`cosplay/relay/`) and the proprietary cloud Lambda handlers (`cosplay-cloud/lambda/`).
Readme
@cosplay-ai/protocol
Shared TypeScript types and Zod runtime validators for the Cosplay wire protocol. This package is the single source of truth for the contract between the OSS relay (cosplay/relay/) and the proprietary cloud Lambda handlers (cosplay-cloud/lambda/).
Both consumers depend on this package and must agree on its SemVer: PATCH for additive-optional changes, MINOR for new endpoints or message kinds, MAJOR for breaking changes (accompanied by a schema-version integer bump and the 426 Upgrade Required gate).
For the full design rationale and per-phase task list, see .cosplay/artifacts/cto/tasks-cosplay-protocol.md.
Installation (consumer side)
Cloud-side Lambda code (cosplay-cloud/) and any self-hosted-cloud implementation install the package from GitHub Packages:
npm install @cosplay-ai/protocolThis requires a .npmrc file pointing at the GitHub Packages registry:
@cosplay:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}- CI workflows in
cosplay-cloudauthenticate using GitHub Actions' built-inGITHUB_TOKEN— no extra secrets needed. - Developer workstations create a classic personal access token at https://github.com/settings/tokens with the
read:packagesscope, then setGITHUB_TOKENin the shell environment (or.env).
Publishing (maintainer side)
The CI workflow .github/workflows/publish-protocol.yml publishes automatically on a protocol-v* tag push (e.g. protocol-v0.1.0). Before cutting the first tag, complete the following operator-action checklist:
Register the
@cosplayorg scope on npmjs.org (free, ~5 minutes): https://www.npmjs.com/org/create — verify@cosplayis available.- If
@cosplayis taken: rename the package to@aaronk9-web/cosplay-protocol(your reserved scope) and update all references inpackages/protocol/package.jsonand the workflow file.
- If
Enable GitHub Packages write permissions for this repo: Settings → Actions → General → Workflow permissions → check "Read and write packages".
Dry-run the publish locally from a clean build:
npm run build:protocol npm publish -w @cosplay-ai/protocol --dry-runConfirm the tarball contains only:
dist/,package.json,README.md.Cut the first tag (version in
package.jsonmust match the tag suffix):git tag protocol-v0.1.0 git push origin protocol-v0.1.0
