agent-pocket-protocol
v0.8.3
Published
Wire protocol, peer capabilities, and constants for the agent-pocket relay, daemon, and clients.
Readme
agent-pocket-protocol
Wire protocol, peer capabilities, and shared constants for the agent-pocket ecosystem. Consumed by:
- The relay server
- The agent-pocket Mac daemon
- iOS and other future clients (via type generation)
Why a separate package
Both the relay and the daemon must agree on the wire format byte-for-byte. Keeping the protocol in its own versioned npm package means:
- A protocol change is a single source of truth, not two copy-pasted directories.
- Each consumer pins a semver range, so deploys can roll forward independently.
- Version skew between relay and daemon is visible in lockfiles, not silent.
Workflow for protocol changes
- Edit
protocol.ts/capabilities.ts/constants.ts/features.tshere. - Run
npm testlocally. The contract tests verify capability/feature lists are well-formed; the wake-blob fixture tests verify the cross-language encrypted-payload format has not drifted. - Bump
versioninpackage.json. Additive changes -> minor. Removals or incompatible shapes -> major, following the capability-deprecation pattern. - Add the release notes to
CHANGELOG.mdand merge the change tomain. - Publish only through GitHub Actions: create and push a signed or annotated tag named
vX.Y.Zfrom the release commit. The publish workflow verifies the tag matchespackage.json, runs build and tests, then publishes to npm with provenance. - Do not run
npm publishfrom a local machine. The repository secretNPM_TOKENmust be configured in GitHub for the workflow to publish. - In each consumer (
agent-pocketmonorepo,agent-pocket-daemonrepo), bump theagent-pocket-protocoldependency, then implement the new behavior.
Tests
npm install
npm testTests live alongside the source in test/, with synthetic fixtures in fixtures/. They are excluded from the published tarball — only the compiled dist/ ships to npm.
Install
npm install agent-pocket-protocolimport { PEER_CAPABILITIES, WIRE_VERSION_CURRENT } from 'agent-pocket-protocol';License
MIT.
