@psci-labs/chat-persistence-filesystem
v0.2.1
Published
Filesystem-backed PersistenceAdapter for @psci-labs/chat-runtime — JSON checkpoints + NDJSON message log
Readme
@psci-labs/chat-persistence-filesystem
Filesystem-backed PersistenceAdapter for @psci-labs/chat-runtime.
Stores per-thread JSON checkpoints and an append-only NDJSON message log under a directory you choose. Atomic writes via tmp+rename. Single-process; not safe for cross-process concurrency.
Install
pnpm add @psci-labs/chat-persistence-filesystemUsage
import { createAgentRunner } from '@psci-labs/chat-runtime';
import { FilesystemPersistence } from '@psci-labs/chat-persistence-filesystem';
const runner = createAgentRunner({
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-sonnet-4-6',
getUserContext: async () => ({ userId: 'local' }),
persistence: new FilesystemPersistence({ root: './.chat-data' }),
});See the package source for the full layout and contract — runPersistenceAdapterContract from @psci-labs/chat-runtime/testing is the source of truth for adapter behavior.
