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

@vilano/runtime

v0.1.4

Published

TypeScript SDK for Vilano Runtime durable workflows and services.

Readme

TypeScript SDK

The TypeScript SDK is the primary authoring surface for Vilano Runtime.

It gives you two durable definition types:

  • workflow() for orchestration and supervision
  • service() for durable keyed, inbox-driven agent execution

These examples assume vilano is on PATH and Bun 1.3.10+ is installed. Install Bun from bun.sh before running the starter path.

Fastest Start

Generate a runnable starter project with the CLI:

vilano init ./my-agent --starter
cd my-agent
bun add @vilano/runtime
vilano project add . --name my-agent
vilano run start my-agent/reviewCoordinator --input '{"repoId":"repo_123","note":"Ship 0.1"}'

For an existing repo, add the package and generate an explicit manifest:

bun add @vilano/runtime
vilano init .

vilano project add and vilano project sync import the declared definitions from the pinned snapshot to validate export identity, so treat project registration as a trusted local-code step.

Core APIs

Inside workflows and service turns, the runtime context supports:

  • ctx.step(name, fn, options?)
  • ctx.exec(spec)
  • ctx.sleep(duration, options?)
  • ctx.waitForSignal(name, options?)
  • ctx.spawn(workflow, input, options?)
  • ctx.connect(service, keyInput, options?)
  • ctx.log(message, fields?)
  • ctx.monitor(target, options?)
  • ctx.link(target, options?)
  • ctx.trapExit(enabled?)
  • ctx.nextExit(options?)
  • ctx.supervise(options)
  • ctx.mailbox()
  • ctx.defer(options)
  • ctx.reject(error)
  • ctx.lookupSingleton(name, scope?)
  • ctx.publish(topic, payload, options?)
  • ctx.subscribe(topic, options?) / ctx.unsubscribe(topic, options?)

Connected services expose typed refs:

const ref = await ctx.connect(reviewer, { repoId: "repo_123" });
await ref.send.hint({ note: "Focus on migrations" });
const status = await ref.ask.status();

Semantics

The SDK follows the Vilano replay model:

  • orchestration replays from the top
  • durable operations resolve from history
  • arbitrary JavaScript continuation capture is not attempted

JS/TS gets BEAM-like operational semantics from the runtime kernel, while the kernel remains the durable source of truth.

step()

Use step() for short, replayable in-process logic.

Step callbacks receive cooperative control helpers:

  • step.signal
  • step.checkCancelled()
  • await step.yield()

exec()

Use exec() for subprocess-heavy work that should be:

  • killable
  • retryable as a process boundary
  • observable through stdout/stderr/artifacts

spawn()

ctx.spawn() reuses child runs by key. If you want deterministic fresh children without hand-rolled namespacing, pass policy: "fresh":

const child = ctx.spawn(workerTask, input, {
  key: `job:${input.jobId}`,
  policy: "fresh",
});

Retries

Preferred retry shape:

retry: {
  retries: 2,
  backoff: { kind: "exponential", initial: "50ms", factor: 2, max: "1s" },
  on: ["application", "timeout"],
}

Supported retry families:

  • application
  • timeout
  • process_exit
  • process_spawn
  • always

If a failure should bypass retries entirely:

import { nonRetryable } from "@vilano/runtime";

throw nonRetryable(new Error("invalid input"));

Runtime Notes

  • workflows and service turns replay from the top against durable history
  • managed workers supervised by the kernel get hard-stop fallback for blocking timed steps
  • step() is for replayable in-process logic; exec() is for subprocess boundaries

See docs/architecture.md and docs/support-matrix.md for the broader runtime context.