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

@nodetool-ai/app-runtime

v0.8.1

Published

Framework-independent runtime core for NodeTool mini apps: application document, typed bindings, namespaced instance state, and the streaming message fold

Readme

@nodetool-ai/app-runtime

The runtime core for NodeTool mini apps, with no framework and no dependencies. A mini app is a UI document plus typed bindings to workflow operations — all computation stays in the graph, so the only semantics this layer owns are document parsing, binding resolution, instance state, the streaming fold, run policy, conditions, and the widget catalog.

Four hosts run those semantics: the web runtime, the mobile app, the nodetool app debug harness, and the eval suites. They share this package so they cannot drift. src/fold.ts is here because three of them once folded a run's messages their own way and disagreed about what an app was showing.

Modules

| Module | Owns | | --- | --- | | document.ts | The ApplicationDocument schema and its parser, including lifting legacy workflow.app_doc v1–v3 | | bindings.ts | The binding token (op:<id>/out:<nodeId>, var:<id>, …), its parser, and the state key it resolves to | | state.ts | AppInstanceState, its four value namespaces, and the pure reducer over AppStateEvent | | fold.ts | Turning a run's ProcessingMessages into state events | | operations.ts | Resolving an operation binding into the name-keyed params a run wants | | policy.ts | What to do when an operation is asked to run while already running | | conditions.ts | visibleWhen / disabledWhen evaluation and format templates | | actions.ts | The six-verb action vocabulary a widget event dispatches | | widgets.ts | The widget catalog — one table behind the Puck editor config, the harness, and the app-tools eval | | doc-ops.ts | Immutable edits to the non-UI half of a document (operations, variables, resources) | | bundle.ts | The ApplicationBundle: an app plus the full graphs it binds, as one JSON artifact | | script-run.ts | The contract for an operation that runs a JS script instead of a workflow | | chat.ts | Reading a bound value as a conversation, for the thread and composer widgets | | documents.ts | Unwrapping sketch and timeline refs out of a bound value |

Usage

Everything is a pure function, so a host drives the reducer itself. Folding a run's messages into the state an app displays:

import {
  applyEvents,
  createInstanceState,
  messagesToEvents,
  type InvocationState
} from "@nodetool-ai/app-runtime";

const invocation: InvocationState = {
  id: "job-1",
  operationId: "main",
  status: "running",
  startedAt: Date.now()
};

let state = applyEvents(createInstanceState(), [
  { type: "runStarted", invocation, outputKeys: ["main:out"] }
]);

state = applyEvents(
  state,
  messagesToEvents(
    [
      { type: "chunk", job_id: "job-1", node_id: "out", content: "Hello " },
      { type: "chunk", job_id: "job-1", node_id: "out", content: "world", done: true },
      { type: "chunk", job_id: "other-job", node_id: "out", content: "!" }
    ],
    {
      resolveInvocation: (jobId) => state.invocations[jobId ?? ""] ?? null,
      outputKey: (opId, nodeId) => `${opId}:${nodeId}`
    }
  )
);

state.outputs["main:out"];
// { value: "Hello world", invocationId: "job-1", status: "done", revision: 3 }

Two rules that example pins. Text chunks concatenate rather than giving the slot one value per token. And the message stamped other-job is dropped: matching on job_id is what stops a second tab, an overlapping run, or a run started in the graph editor from writing into this app's values.

No dependencies, on purpose

dependencies is empty and stays empty. The Puck document and the workflow graph are typed structurally here rather than imported from @puckeditor/core and @nodetool-ai/protocol, so the package loads in a browser bundle, in a Node harness, and in React Native without dragging a server-side tree behind it. Mobile compiles it from source — wired in mobile/metro.config.js, mobile/tsconfig.json, and mobile/jest.config.js, all three of which must agree.

Develop

npm run build --workspace=packages/app-runtime
npm run test  --workspace=packages/app-runtime
npm run lint  --workspace=packages/app-runtime   # tsc --noEmit

What a mini app is: docs/mini-apps.md. Every widget, binding, action, and condition in tables: docs/mini-apps-reference.md. Building one: docs/mini-apps-guide.md. The headless harness that drives this package: nodetool app debug, in docs/cli.md.