@yansirplus/backend-in-memory
v0.5.3
Published
<!-- generated by scripts/generate-docs.mjs; edit docs/surface.json and docs/packages/backend-in-memory.md -->
Readme
@agent-os/backend-in-memory
Purpose
In-memory backend instance for runtime contract tests and local backend parity checks.
Public API Status
Backend package for tests and local contract verification.
Invariant
Runtime Tags are the backend contract. The in-memory backend implements the same Ledger, Scheduler, Dispatch, Resources, Quota, Admission, LlmTransport, AttachedStreams, and MaterializedProjections Tag surface without importing Cloudflare or SQL substrate APIs.
The in-memory backend accepts only pure ReadonlyArray<AnyDurableTrigger>
registrations. It does not accept backend-bound trigger factories and does not
model custom app-owned SQL tables. Materialized projection declarations are
backend-neutral and are mirrored here for contract tests and local product
spikes.
For pure trigger parity tests, the in-memory backend mirrors durable trigger
claim, cancel, and redrive semantics: expired claims become claimable again,
cancelTrigger respects each trigger's cancellation declaration, and
claim-token checks prevent duplicate terminal facts. It does not model
Cloudflare isolate eviction.
Minimal Usage
Create an in-memory runtime backend in tests.
import { createInMemoryRuntimeBackend } from "@agent-os/backend-in-memory";Verification
cd packages/backends/in-memory
bun run test