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

@snoai/sqlite-crypto

v1.1.8

Published

Your memory database, encrypted on your own disk. The key never leaves your machine.

Readme

@snoai/sqlite-crypto

The encryption layer under Sno Station memory: your SQLite database is encrypted on disk with a key that never leaves your machine. It is a thin wrapper over better-sqlite3-multiple-ciphers (SQLCipher v4 mode) and Node's built-in crypto.

The full threat model, settings-file key rules, and recovery steps live in docs/security.md.


Install

npm install @snoai/[email protected]

Needs Node.js 22.14 or newer.

Who it is for: the memory engine, and anyone who wants the same encrypted-database layer. If you only want agent memory, you do not use it directly: the memory service setup creates the key and the plugins for Codex, Claude Code and OpenClaw do the rest.


Public API

Database

import { readFileSync } from "node:fs";
import { homedir } from "node:os";
import { join } from "node:path";
import { getDek, openEncryptedDb } from "@snoai/sqlite-crypto";

const profileRoot = process.env.SNO_PROFILE_DIR ?? join(homedir(), ".sno");
const settings = JSON.parse(readFileSync(join(profileRoot, "settings.json"), "utf8"));
const dek = getDek(settings.store.encryptionKey);
const db = openEncryptedDb(settings.store.path, dek);

The memory service setup generates the 64-hex key once and writes it to settings.json (mode 0600). getDek accepts that explicit key; it does not find or create one. openEncryptedDb returns a better-sqlite3-multiple-ciphers handle configured for SQLCipher v4. Wrong-key reads throw WrongKeyError. The store list remains at ~/.config/sno-station-core/dbs.json.

Keep a recoverable copy of settings.json with the encrypted store. If the file is lost, restore its original store.encryptionKey from that copy before running the memory service. Never generate a new key while the store exists: it cannot open the existing data. If settings are missing or invalid, follow the memory service setup only for a new profile; preserve any existing file and key backup.

.sno-station-core export / import

import { exportEncrypted, importEncrypted } from "@snoai/sqlite-crypto";

await exportEncrypted("backup.sno-station-core", dek); // gzip-tar all manifest DBs + AES-256-GCM
await importEncrypted("backup.sno-station-core", dek); // verify header + decrypt + restore

Layered import error contract:

  1. InvalidExportFormat / UnsupportedExportVersion — structural gates (magic, version) before any AEAD work.
  2. ForeignDekError — DEK fingerprint mismatch (computed BEFORE decipher.final()); restore the original store.encryptionKey from your settings backup.
  3. IntegrityCheckFailed — GCM auth failure (the path that catches all meaningful header tampering, since the entire 12-byte header is bound as AAD).

Settings and recovery

The memory service uses store.path and store.encryptionKey from <profile root>/settings.json, where the profile root is SNO_PROFILE_DIR or ~/.sno. The library has no key-management command. The memory service setup writes the settings file; plugins start the memory service through memoryPackage in that file. The encrypted-store list stays at ~/.config/sno-station-core/dbs.json.


Threat model summary

  • Protects: copied DB files without the settings key, other OS users who cannot read the private settings file.
  • Does not protect: an unlocked compromised account with malware running as your user, whole-disk theft without full-disk encryption, root-level memory scraping, OS swap, content you intentionally send to your configured LLM provider.

See docs/security.md for the full breakdown, including the filesystem-permission boundary for settings.json.