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

@viloris/vela-host

v0.0.1

Published

Desktop Bun host: Shell UDS client, process lifecycle, plugins, call bridge

Readme

@viloris/vela-host

Desktop Bun host runtime: framed Shell RPC client, process lifecycle, plugin load, and Host-side call bridge on top of @viloris/vela-host-core.

Status: UDS client + Shell spawn + startHostSession + plugin register + Host-side call bridge + Shell→Host reverse call wire (shell.forwardCall / session.reverseCall). L4 composition shells wire preload call via --listen + reverse UDS (hosts/shared/host_rpc); packaging still Phase 2.
Contracts: @viloris/vela-api RPC envelopes.
Shell: hosts/zig-shell (--listen PATH).
Decisions: ADR 0002, ADR 0005.

Role

App / CLI
    │
    ▼
@viloris/vela-host          ← this package (Bun process)
  · spawnShellProcess / ShellClient (UDS frames)
  · startHostSession (lifecycle + multi-window policy)
  · registerPlugins / createDesktopHost
  · handleCallRpc (capability-checked call channel)
    │
    ▼
@viloris/vela-host-core
    │
    │  UDS + length-prefixed JSON
    ▼
hosts/zig-shell             (mock or real L4)

| Owns | Does not own | |------|----------------| | UDS connect + frame codec (TS) | Page / window.vela injection | | Shell process spawn / quit | Pure capability policy (host-core) | | Plugin register(host) load | Toolkit paint / hit routing | | Host-side callinvokeRpc | Real L4 WebView embed | | Shell→Host reverse demux + handler | Plugin marketplace / signing | | Multi-window policy (one Shell process) | |

Usage

Session (preferred)

import { startHostSession } from "@viloris/vela-host";
import { clipboardPlugin } from "@viloris/vela-plugin-clipboard/host";

const session = await startHostSession({
  api: { platform: "linux", sys: { /* inject facades */ } },
  capabilities: {
    default: { permissions: ["clipboard:read"] },
  },
  plugins: [clipboardPlugin],
  multiWindow: { maxWindows: 4, quitOnLastWindowClose: true },
  // shellBinary / VELA_ZIG_SHELL optional in monorepo after zig build
});

console.log(await session.shell.ping());
// → { pong: true, backend: "mock" }

const res = await session.call("clipboard.read");
// Host-local capability-checked VelaRpcResponse

// Same bridge over Shell reverse wire (stand-in for WebView window.vela.call):
const viaShell = await session.reverseCall("clipboard.read");

await session.quit();

Low-level client only

import { ShellClient, createDesktopHost } from "@viloris/vela-host";

const shell = await ShellClient.connect({
  path: "/tmp/vela-shell.sock",
});

const desktop = await createDesktopHost({
  api: { platform: "linux", sys: {} },
  capabilities: { default: { permissions: [] } },
  shell,
});

console.log(await shell.ping());
desktop.close();

Shell side (mock L4):

cd hosts/zig-shell && zig build
./zig-out/bin/vela-shell --listen /tmp/vela-shell.sock
# tests: --once accepts one client session then exits

Multi-window policy

One Host process + one Shell process. Windows are created with session.createWindow → Shell window.create. Host never spawns a Shell per window. Optional maxWindows and quitOnLastWindowClose (default true).

Call bridge + reverse RPC

handleCallRpc / session.call map channel call onto CapabilityHost.invokeRpc (structured deny).

Reverse wire (ADR 0002 D4): Shell may send Host a framed VelaRpcRequest with channel: "call". ShellClient demuxes request vs response frames and dispatches reverse requests to a handler. startHostSession wires that handler to handleCallRpc.

Live page path (composition shells with --listen):

window.vela.call(method, args)
  → preload {type:req, method:"call", args:{method, args}}
  → L4 bridge → HostSession.reverseCall (channel call)
  → Host reverse handler → handleCallRpc
  → preload {type:res, …} via __velaHostDispatch

Host probe path (no WebView):

session.reverseCall(method, args)
  → Host shell.forwardCall
  → Shell Session.reverseCall (channel call)
  → Host reverse handler → handleCallRpc
  → response rebinding back to outer request

Framing

Host detail (not a public app API): u32 little-endian length + UTF-8 JSON body, max 16 MiB. Payload shapes match VelaRpcRequest / VelaRpcResponse in @viloris/vela-api.

Verify

# unit + UDS integration (skips integration if binary missing)
bun test packages/host

# force binary:
cd hosts/zig-shell && zig build
bun test packages/host

Related