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

@lite-agent/checkpoint-sqlite

v0.8.0

Published

SQLite (WAL) Checkpointer backend for @lite-agent/core — single-host multi-process event-sourced persistence.

Readme

@lite-agent/checkpoint-sqlite

English | 简体中文

面向 @lite-agent/core 的 SQLite(WAL)Checkpointer 后端 —— 为单机、多进程场景提供事件溯源的会话持久化。

@lite-agent/sdk 中默认的 checkpointer 是基于文件的(每个会话一个 JSONL)。本适配器改为把同样的事件日志存进 SQLite 数据库,采用 WAL 日志模式BEGIN IMMEDIATE 写入路径,使单机上的多个进程能够并发追加 —— 冲突的追加会干净地抛出 CheckpointConflictError,而不会损坏日志。

安装

pnpm add @lite-agent/checkpoint-sqlite

依赖 better-sqlite3(原生模块 —— 安装时会编译)。

用法

把 checkpointer 传给 createLiteAgent / query;它会覆盖默认的文件存储:

import { createLiteAgent } from "@lite-agent/sdk";
import { anthropic } from "@lite-agent/provider";
import { sqliteCheckpointer } from "@lite-agent/checkpoint-sqlite";

const checkpointer = sqliteCheckpointer({ file: "./sessions.db" }); // 或 ":memory:"

const agent = createLiteAgent({
  model: anthropic(),
  modelName: "claude-sonnet-4-6",
  workdir: process.cwd(),
  checkpointer,
});

await agent.send("你好!");
// 会话持久化到 sessions.db,并在本机各进程间共享。

checkpointer.close(); // 用完后关闭

API

sqliteCheckpointer({ file })SqliteCheckpointer(core 的 Checkpointer 再加 checkIntegrity() / close()):

  • file —— SQLite 数据库文件路径,或用 ":memory:" 得到一个临时(内存)数据库。
  • synchronous —— "normal"(默认)或更强持久性的 "full"
  • busyTimeoutMs —— 写锁等待超时(默认 5000 ms)。
  • integrityCheckOnOpen —— 启动时执行 PRAGMA quick_check,损坏则失败。

它实现了完整的 Checkpointer 契约 —— append(乐观并发,由 expectedHead 守护)、readheadlistdelete,以及 truncate(因此会话时间旅行 / restore 可用)—— 并通过 core 的 checkpointerConformance 测试套件验证。

架构说明见 monorepo 根目录