npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@crow-agent/session-backend-sqlite-node

v0.2.0

Published

SQLite session storage for the Crow agent runtime on Node.js.

Readme

@crow-agent/session-backend-sqlite-node

Durable session storage for @crow-agent/agent-core, built on Node's built-in node:sqlite. Point it at a directory and it persists sessions, branches, and operation lanes as SQLite databases — one file per session by default.

import { BACKGROUND_CONTEXT } from "@crow-agent/agent-core";
import {
  createNodeSqliteFactory,
  SqliteSessionRepo,
} from "@crow-agent/session-backend-sqlite-node";

const factory = createNodeSqliteFactory();
const repo = new SqliteSessionRepo({
  databaseFactory: factory,
  directory: "/var/lib/crow/sessions",
});

const session = await repo.create({ id: "demo" }, BACKGROUND_CONTEXT);
const main = await session.createBranch("main", null, BACKGROUND_CONTEXT);
await main.appendMessage(
  { role: "user", content: "hi", timestamp: Date.now() },
  BACKGROUND_CONTEXT,
);
await session.close(BACKGROUND_CONTEXT);
await repo.close(BACKGROUND_CONTEXT);

Where sessions live

By default every session gets its own file under directory. Session ids made only of ASCII letters, digits, _, and - map straight to {sessionId}.sqlite; anything else is encoded as ~-prefixed base64url over its UTF-16 code units, so a hostile id can never escape the repository directory. The durable session id itself is never altered, and every metadata object the repository hands back carries the canonical on-disk path. If you'd rather keep many sessions in one file, pass databasePath instead — its parent directory is created on demand.

Opening, listing, deleting

The database factory treats the three open modes as separate operations: create, open read-write without creating, and open read-only without creating. open() and delete() validate that the metadata resolves inside this repository and never materialize a database that isn't there. list() is read-only and forgiving — corrupt files, newer storage versions, and foreign databases are skipped rather than reported. Forking is the deliberate exception: it accepts a source path outside the repository, opening exactly that container read-only instead of substituting a live local session that happens to share the id.

One writer per session

Write ownership belongs to the host, not to this backend: opening the same session for writes from two processes is unsupported. The repository does reject overlapping local create/open/fork/delete claims on one id, but there is no cross-process lease, lock, fence, heartbeat, or takeover — shut the worker down before you delete its sessions.

When the fork source is open in the same repository, the snapshot is queued behind that source's commit queue. Any other source — including one a live worker currently holds — is read through its own read-only connection inside a single deferred WAL transaction, so the worker's later commits can land while the snapshot stays open. In a shared container, deleting a session removes only that session's rows. Repository close() waits for every open session's cleanup attempt before surfacing failures. There is no search service or full-text index here; search belongs in a separate projection.