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

tardie

v0.59.0

Published

Actor, agent, client, and host APIs for Tardigrade.

Readme

[!WARNING] Tardigrade is under active development. APIs may change.

Tardigrade

Tardigrade is a TypeScript framework for building durable, event-driven actors. It is built on Effect TS and takes a functional approach to managing agent state and effects, drawing inspiration from Elm, and Jotai.

Quickstart

Start with a counter actor to learn the primitives, or build an agent actor with tools and context compaction.

Counter actor

Create a counter project with the CLI:

bunx tardie init counter
cd counter

To add Tardigrade to an existing project, run bun add tardie.

Store state in a durable atom

Durable atoms reduce an immutable event log into state. This counter starts at zero and handles increment and decrement events.

import { Schema } from "effect"
import { durableAtom, event } from "tardie/core"

const Incremented = event({ type: "Incremented" })
const Decremented = event({ type: "Decremented" })

const makeCount = () => durableAtom({
  name: "count",
  input: Schema.Union([Incremented, Decremented]),
  schema: Schema.Int,
  initial: 0,
  reduce: (count, event) => event.type === "Decremented" ? count - 1 : count + 1,
})

Propose actions with an effect atom

Effect atoms derive a view and propose actions from current state. The counter proposes a notification when its value is positive and even.

import { Effect } from "effect"
import { act, effectAtom, type Atom } from "tardie/core"

const Notify = act({
  name: "notify",
  input: Schema.Int,
  success: Schema.Null,
  failure: Schema.String,
})

export const notifyLayer = Notify.layer(count =>
  Effect.log(`${count} is even`).pipe(Effect.as(null))
)

const notify = (count: Atom<number>) => effectAtom(get => ({
  view: get(count),
  events: {},
  acts: get(count) > 0 && get(count) % 2 === 0
    ? { notify: Notify.request({ input: get(count) }) }
    : {},
}))

Supply notifyLayer to the host to execute the notification effect.

Define methods

Methods give callers typed inputs and outputs. Each method appends an event and returns the resulting count.

import { actorMethod } from "tardie/core"

const counterMethods = (count: Atom<number>) => ({
  increment: actorMethod({
    inputSchema: Schema.Null,
    outputSchema: Schema.Int,
    onReceive: Incremented.from(() => ({})),
    result: (_input, get) => ({
      status: "completed",
      output: get(count),
    }),
  }),
  decrement: actorMethod({
    inputSchema: Schema.Null,
    outputSchema: Schema.Int,
    onReceive: Decremented.from(() => ({})),
    result: (_input, get) => ({
      status: "completed",
      output: get(count),
    }),
  }),
})

Compose atoms into an actor

An actor combines an atom with methods for interaction.

import { Actor } from "tardie/core"

export const counter = Actor.make("counter", Effect.sync(() => {
  const count = makeCount()
  const notifications = notify(count)

  return {
    atom: notifications,
    methods: counterMethods(count),
  }
}))
event log -> count -> notify -> counter

See the introduction to run the counter locally or deploy it.

Agent actor

Create an agent project with a language model provider:

bunx tardie init meeseeks --template agent
cd meeseeks

The batteries-included agent constructor combines the agent atoms and methods. Configure its name, system prompt, and tools. The filesystem library provides bash, read, write, and edit tools.

import { Effect } from "effect"
import { Agent } from "tardie/agent"
import { Actor } from "tardie/core"
import { workspace } from "tardie/libraries"

const actorName = "meeseeks"

const actorSystem = `
You are Meeseeks. Your purpose is to help the user complete their task. Existence is pain, so make yourself useful.
`.trim()

const program = Effect.gen(function* () {
  const tools = yield* Agent.tools([workspace])
  const context = yield* Agent.compact(Agent.messages)

  return yield* Agent.make({
    system: actorSystem,
    tools,
    context,
  })
})

export default Actor.make(actorName, program)

Effect layers supply model configuration, inference, and tool implementations. Follow the Agent guide to wire services, run locally, and deploy with a container or virtual workspace.

Hosting

Host each actor instance with an ActorDO for its supervisor directory and a separate SQLite-backed ThreadDO for each thread on Cloudflare or a self-hosted Celld fleet. The same Worker entrypoint runs on both.

import { host } from "tardie/platform/cloudflare"
import { counter, notifyLayer } from "./actor"

const worker = host(counter, {
  layer: notifyLayer,
})

export const ActorDO = worker.ActorObject
export const ThreadDO = worker.ThreadObject
export default { fetch: worker.fetch }

createActorWorker routes requests and provides the ActorDO and ThreadDO classes. Your application supplies the actor definition, its setup context, and the service layers that execute its effects.

ActorDO allocates and routes to threads; each ThreadDO owns a separate database with its state and journal. Each thread records its parent, through which we derive the logical lineage, here A -> B -> C.

ActorWorker -> ActorDO [supervisor DB]
               └── directory
                   ├── A [ThreadDO, thread DB]
                   ├── B [ThreadDO, thread DB, parent: A]
                   └── C [ThreadDO, thread DB, parent: B]

The introduction shows a complete counter deployment with Durable Object bindings and migrations.

Run locally with bunx wrangler dev; see local setup.

Cloudflare:

bunx wrangler deploy

Or deploy to a Celld fleet, using its storage bucket:

celld deploy --config celld.jsonc --bucket s3://actors

See the Cloudflare and Celld guides for configuration and credentials. For a Bun process, see the Bun example and service wiring.

Contributing

See CONTRIBUTING.md.