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

leuco

v0.6.1

Published

Self-hosted multi-tenant gateway that runs the Codex app-server as a Slack bot. Bun-only.

Readme

Leuco

Self-hosted gateway that bridges chat channels (Slack today) to the Codex app-server. One machine-wide daemon supervises every registered project and runs each (project, agent) pair as an isolated tenant with its own CODEX_HOME.

Install

bun i -g leuco

leuco is Bun-only. Install Bun from https://bun.sh first.

To work from a checkout instead:

bun install
bun link              # exposes the `leuco` bin from this checkout

Quick start

cd your-repo
leuco projects add .  # register the cwd as a leuco project
leuco                 # starts the daemon (or opens the TUI if one is already running)

leuco (no args) opens the live event TUI when the daemon is running and otherwise spawns the daemon in the background. ESC, q, or Ctrl-C exits the TUI.

Commands

| command | what it does | | ------------------------ | ------------------------------------------------------------------------ | | leuco | open TUI when running, otherwise start the daemon | | leuco start | start the daemon in background | | leuco run | run in foreground (debug; logs to stdout) | | leuco stop | stop the daemon | | leuco restart | stop + start | | leuco status | daemon + per-project state | | leuco logs [-f] | print daemon log (-f to follow) | | leuco tui | force-open the live event viewer | | leuco update [--check] | install the latest published leuco (--check only reports the registry) |

Project / agent / channel management:

leuco projects list
leuco projects create <path>            # mkdir + git init + register
leuco projects add [<path>]             # register an existing repo
leuco projects <p> remove [--cascade]
leuco projects <p> rename <new>

leuco projects <p> agents list
leuco projects <p> agents add <a>
leuco projects <p> agents <a> {remove,rename,start,stop,restart}

leuco projects <p> agents <a> channels list
leuco projects <p> agents <a> channels add slack
leuco projects <p> agents <a> channels <c> {remove,rename,start,stop,restart}

Cwd shortcut: when invoked from inside a registered project's path you can drop the projects <p> prefix — leuco agents list resolves to leuco projects <p> agents list.

Other entry points:

leuco slack call <method> --project <p> --agent <a> [--body '<json>'] [--channel <c>]
leuco mcp --project <p> --agent <a>     # stdio MCP server (spawned by codex)

How it works

Slack (Socket Mode) ─→ leuco daemon ─→ codex app-server (one process per tenant)
                            │                    │
                            │   thread/start { cwd: <project.path> }
                            │   turn/start  { input: [{type:"text", text}] }
                            ▼
                       chat.postMessage (in thread)
  • One daemon per machine; the daemon supervises every enabled (project, agent) tenant.
  • Each tenant has a dedicated CODEX_HOME under ~/.leuco/projects/<p>/agents/<a>/home/. auth.json is symlinked from ~/.codex/auth.json so all tenants share the user's codex login while keeping memories isolated.
  • One Slack thread maps to one Codex thread. Turns within a thread serialise; separate threads run in parallel.
  • Mention gating, ack reactions, and bot-message filtering are configurable per channel (ackMode: off | mention | always, custom ackIcons).
  • Codex picks up the project's AGENTS.md / AGENTS.override.md and any files listed in ~/.codex/config.toml's project_doc_fallback_filenames.

Filesystem layout

~/.leuco/
├── settings.json                          machine-wide settings
├── daemon/
│   ├── pid
│   ├── log
│   └── events.jsonl                       newline-delimited LeucoEvent stream
└── projects/
    └── <projectName>/
        ├── settings.json                  project config + per-channel tokens (chmod 600)
        └── agents/
            └── <agentName>/
                └── home/                  CODEX_HOME for this tenant
                    ├── auth.json          symlink → ~/.codex/auth.json
                    └── config.toml        project trust + mcp_servers.leuco

Requirements

  • Bun 1.3+
  • codex CLI on PATH, signed in via codex login
  • A Slack App in Socket Mode
    • Bot scopes: app_mentions:read, chat:write, reactions:write
    • Event subscriptions: app_mention, message.channels (optionally reaction_added)
    • App-level token with connections:write

Environment variables

| Variable | Purpose | | ----------------- | -------------------------------------------------------- | | LEUCO_CODEX_BIN | Codex binary path (default: codex) | | LEUCO_PORT | HTTP gateway port for IPC (default: off; e.g. 9743) | | LEUCO_CWD | Override Codex working directory (default: project path) |

.env.local and .env are read from the cwd at CLI invocation. Existing process env wins over the files.

Per-channel Slack tokens (SLACK_BOT_TOKEN, SLACK_APP_TOKEN) are stored in ~/.leuco/projects/<p>/settings.json and are entered via leuco projects <p> agents <a> channels add slack — no env vars required at runtime.

Live event viewer

leuco tui (or bare leuco while the daemon is running) tails ~/.leuco/daemon/events.jsonl and renders typed events in real time with the newest at the top. The same JSONL is the source of truth — any consumer can tail it without running the TUI.

Event types: tenant.started, tenant.stopped, engine.reconcile, slack.event, turn.start, turn.complete, turn.error, codex.notification, log. See lib/events/leuco-event-types.ts.

Library usage

import { LeucoRuntime } from "leuco"

const runtime = LeucoRuntime.build({ env: process.env })
if (runtime instanceof Error) throw runtime

const start = await runtime.start()
if (start instanceof Error) throw start

Lower-level building blocks (LeucoEngine, LeucoTenant, LeucoCodexClient, LeucoSlackChannelPlugin, LeucoChannelHost, LeucoEventBus, LeucoProjectStore, …) are exported from the package entry point. Every IO boundary is a port type so tests can substitute fakes.

Troubleshooting

leuco stop
leuco run               # foreground, logs to stdout

Common causes when nothing happens on mention:

  • Slack App is missing the app_mention event subscription
  • Bot is not invited to the channel (/invite @yourbot)
  • App-level token is missing connections:write
  • Channel has ackMode: "off" and the agent returned empty text

License

MIT