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

ai-sdk-session-log

v0.1.0

Published

Append-only session event log for durable agents: idempotent appends, ordered reads, live tailing, and blob offload for large payloads.

Readme

AI SDK - Session Log

This package is experimental.

Append-only event log for durable agent sessions. Append events and pass references from workflow steps; resume a session by reading the log.

Event ids are caller-supplied. Re-appending an id returns the stored event unchanged, so deterministic ids (`${turn}:${seq}`) are safe inside a retried durable step. payload is any JSON. watch() streams appends as they land.

Setup

npm i ai-sdk-session-log

Usage

import { jsonlSessionLog } from 'ai-sdk-session-log';

const log = jsonlSessionLog({ sessionId: 's1', dir: '.sessions' });
await log.append([
  {
    id: '0:0',
    type: 'message',
    turn: 0,
    payload: { role: 'user', content: 'hi' },
  },
  {
    id: '0:1',
    type: 'message',
    turn: 0,
    payload: { role: 'assistant', content: 'hello' },
  },
]);

for await (const event of log.read({ types: ['message'] })) {
  // project into AI SDK messages, a UI stream, or analytics
}

Backends

| Backend | Import | Use | | --- | --- | --- | | memorySessionLog | ai-sdk-session-log | Tests and ephemeral sessions. | | jsonlSessionLog | ai-sdk-session-log | Local and single-process runtimes. One <sessionId>.jsonl per session. | | sqliteSessionLog | ai-sdk-session-log/sqlite | Single-writer deployments. Uses node:sqlite (Node >= 22.5). The subpath keeps that import off the main entry. | | durableObjectSessionLog | ai-sdk-session-log/durable-object | A Durable Object's SQLite (ctx.storage.sql). |

SessionLog is the whole contract if you need another backend. All shipped backends run one shared test suite (session-log.shared.test.ts).

Blob store

Engines cap checkpoint sizes (1 MiB on Cloudflare Workflows, 2 MB on Temporal). BlobStore keeps large payloads out of line:

import { fsBlobStore } from 'ai-sdk-session-log';

const blobs = fsBlobStore({ dir: '.sessions/blobs' });
const ref = await blobs.put('s1/turn-3/tool-output', bigText);
await log.append([{ id: '3:2', type: 'tool', payload: { output: ref } }]);

memoryBlobStore and fsBlobStore ship here. An R2 or S3 store implements the same four methods.

License

Apache-2.0