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

@verist/storage

v0.1.1

Published

Storage interface for workflow state with three-layer model (computed, overlay, effective)

Readme

@verist/storage

npm version npm downloads Ask ChatGPT Twitter Follow

Storage interfaces and state-layer helpers for Verist.

Install

bun add @verist/storage verist

What This Package Provides

  • RunStore contract for durable workflow state
  • createMemoryStore() — in-memory RunStore for examples and tests
  • RunState and commit/overlay types
  • effectiveState() helper for computed + overlay merge
  • typedStore<T>() — bind a state type to a RunStore, removing repeated <T> at each call site
  • Typed storage conflict reasons for retry/fatal handling

Layered State Model

Verist uses three logical layers:

  • computed - values produced by steps
  • overlay - human corrections (never overwritten by automation)
  • effective - shallow merge where overlay wins
import { effectiveState } from "@verist/storage";

const state = {
  computed: { verdict: "reject", confidence: 0.61 },
  overlay: { verdict: "accept" },
};

const effective = effectiveState(state);
// { verdict: "accept", confidence: 0.61 }

RunStore Contract

interface RunStore {
  load<T = unknown>(
    workflowId,
    runId,
  ): Promise<Result<RunState<T>, StorageError>>;
  commit<T>(
    params: CommitParams<T>,
  ): Promise<Result<RunState<T>, StorageError>>;
  setOverlay<T>(
    workflowId,
    runId,
    overlay: Partial<T>,
  ): Promise<Result<RunState<T>, StorageError>>;
}

Key invariants:

  • commit() is atomic for state + events (+ optional commands in adapter implementations)
  • Optimistic concurrency via expectedVersion
  • First commit to a run must use expectedVersion: 0
  • Conflict results include reason for typed retry/fatal decisions

For a production implementation, see @verist/storage-pg.

In-Memory Store

For examples and tests, use the built-in in-memory store:

import { createMemoryStore } from "@verist/storage";

const store = createMemoryStore();

// Create a new run
await store.commit({
  workflowId: "verify-doc",
  runId: "run-1",
  stepId: "extract",
  expectedVersion: 0,
  output: { score: 0.8, risk: "high" },
  events: [{ type: "scored" }],
});

// Load and apply overlay
await store.setOverlay("verify-doc", "run-1", { risk: "low" });

No persistence, no outbox — events and commands are accepted but not stored.

Typed Store

When all calls share the same state type, use typedStore<T>() to avoid repeating the type parameter:

import { createMemoryStore, typedStore } from "@verist/storage";

interface AppState {
  score: number;
  risk: string;
}

const store = typedStore<AppState>(createMemoryStore());

// T is AppState at every call site — no <AppState> needed
await store.commit({
  workflowId: "verify-doc",
  runId: "run-1",
  stepId: "extract",
  expectedVersion: 0,
  output: { score: 0.8, risk: "high" },
  events: [{ type: "scored" }],
});

License

Apache-2.0