Consume npm Packages
Outcome
Section titled “Outcome”An independent agent app can install agentOS through versioned npm packages instead of sharing the agentOS source workspace lockfile.
Prerequisites
Section titled “Prerequisites”- Install required packages with semver versions.
- Use the published
@yansirplus/*package names. - Install required peers such as
effect. - For prepublish first-party work, run a local registry channel:
bun run registry:local, thenbun run publish:localin agentOS. - Read
dist/internal-npm/local-channel.json. - Copy the required
dependenciesentries into the consumer app. Use the logical tag value, for exampleagentos-dev; do not copy worktree tarball paths. Configure@yansirplus:registryonce in the consumer.npmrconly when consuming the local channel. - Run the app typecheck and tests under its own lockfile.
For first-party prepublish work, use the local channel instead of hand-writing tarball paths:
bun run registry:localbun run publish:localConsumer .npmrc:
@yansirplus:registry=http://127.0.0.1:4873Consumer package.json:
{ "dependencies": { "@yansirplus/ag-ui": "agentos-dev", "@yansirplus/runtime": "agentos-dev" }}Every publish:local call generates one unique prerelease version and moves
the agentos-dev dist-tag. The consumer lockfile pins the resolved package
version; the package manifest stays stable across worktrees.