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

stitchkit-tui

v0.1.1

Published

Composable terminal UI for the Stitchkit headless agent runtime

Readme

stitchkit-tui

The official composable terminal host for stitchkit/agent-runtime.

It supplies a full durable transcript, multiline composer, slash-command registry, live model catalog picker, approval cards, conversation switching and an authenticated local session socket. The package never owns provider policy or tools: applications compose those in one typed config. The default shell keeps the terminal's own canvas, executes the highlighted slash suggestion on Enter and shows a compact two-row status line with model capacity and durable usage.

Applications that own a different terminal product shell import the pure state layer instead:

import {
  createTerminalCollection,
  reduceTerminalCollection,
  createTerminalPaneState,
} from 'stitchkit-tui/core';

let sessions = createTerminalCollection(['one', 'two'], 8, 'two');
sessions = reduceTerminalCollection(sessions, {
  type: 'reconcile',
  keys: ['two', 'one'],
});

const panes = createTerminalPaneState({
  totalSize: 120,
  primarySize: 48,
  minPrimary: 32,
  minSecondary: 48,
});

stitchkit-tui/core imports no React, OpenTUI or agent-runtime code. It owns only identity-stable collections, feed viewport state, split panes, command selection and confirmed operations. Session cards, process supervision, restart policy and runtime adapters remain with the embedding product.

Every normal launch starts a fresh durable conversation. Use /resume (or /sessions) to pick an earlier conversation, and /clear to leave the current one resumable while starting clean. Embedding hosts that intentionally want a fixed identity may set initialConversationId.

import { defineAgentTui, runAgentTui } from 'stitchkit-tui';

const config = defineAgentTui({
  context: () => ({}),
  modelCatalog,
  createRuntime: ({ catalog, selections }) => ({ harness, conversations }),
  statusLine: ({ model, activity, conversationId }) => [
    [{ text: model?.name ?? 'no model', tone: 'accent' }],
    [
      { text: conversationId.slice(0, 8), tone: 'muted' },
      { text: activity.toLowerCase(), tone: 'success' },
    ],
  ],
});

await runAgentTui(config);

Omit statusLine for the default projection, provide a formatter to replace every row, or set it to false to hide the status line. The formatter receives the selected catalog entry, workspace, activity, local identities and the canonical durable snapshot; it does not receive guessed token counts. theme remains an independent semantic color override.

The bundled CLI loads stitchkit.agent.ts by default:

stitchkit-agent run
stitchkit-agent sessions --workspace /path/to/project
stitchkit-agent send --session SESSION_ID --idempotency-key CALLER_KEY -- "Continue the review"
stitchkit-agent interrupt --session SESSION_ID

Local clients authenticate through a mode-0600 descriptor and Unix socket. They submit through the live TUI controller, so there is one runtime owner and one durable admission path. Startup resumes still-queued work and safely skips acquired work by default. A host may provide recover only when it can derive stronger replay evidence; the TUI never invents replaySafe: true for application side effects.

Each terminal session writes a bounded, rotating metadata journal under .stitchkit/logs/tui/<session-id>.jsonl. It records conversation and run identities plus lifecycle transitions; prompt/model text, reasoning, tool arguments, provider causes and credentials are discarded before journal admission. Live-session files are retained, alongside the eight newest inactive session journals.