Internal npm Consumer App
Consume agentOS as packed npm packages instead of source workspace paths.
What You Build
Section titled “What You Build”A tiny downstream TypeScript app that installs a packed @agent-os/kernel
tarball plus the explicit effect peer, then typechecks and runs a smoke
import.
Prerequisites
Section titled “Prerequisites”-
From the agentOS repo, build tarballs:
Terminal window bun run pack:internal -
In a separate consumer app, install one packed package and its peer:
Terminal window npm install /path/to/dist/internal-npm/tarballs/agent-os-kernel-0.2.9.tgz effect@^3.21.0npm install -D typescript -
Add a NodeNext
tsconfig.json:{"compilerOptions": {"target": "ES2022","module": "NodeNext","moduleResolution": "NodeNext","strict": true,"skipLibCheck": true},"include": ["index.ts"]} -
Import only package entrypoints:
import { Effect } from "effect";import { ABORT, reasonOf } from "@agent-os/kernel";import { makePreClaim } from "@agent-os/kernel/effect-claim";const claim = makePreClaim({operationRef: "operation:tutorial",scopeRef: { kind: "session", scopeId: "session:tutorial" },effectAuthorityRef: { authorityId: "tutorial.proof", authorityClass: "effect" },originRef: { originId: "internal-npm-consumer", originKind: "tutorial" },});await Effect.runPromise(Effect.succeed({ reason: reasonOf(ABORT.TOOL_ERROR), phase: claim.phase }),); -
Run:
Terminal window npm exec tsc -- -p tsconfig.jsonnode smoke.mjsA minimal
smoke.mjscan import the packed package at runtime:const kernel = await import("@agent-os/kernel");if (kernel.reasonOf(kernel.ABORT.TOOL_ERROR) !== "tool_error") {throw new Error("agentOS packed consumer proof failed");}
Checkpoint
Section titled “Checkpoint”The installed package manifest points at dist:
main: ./dist/index.jstypes: ./dist/index.d.tsexports ./effect-claim -> ./dist/effect-claim.jspeerDependencies.effect: ^3.21.0The consumer typecheck and smoke import pass without workspace:, file:,
packages/*, or @agent-os/*/src imports.
Add read-only operations with ops view.