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

@fomular-os/daemon

v0.2.11

Published

FomularOS daemon — connects machines to the FomularOS server and manages AI agents

Downloads

1,316

Readme

@fomular-os/daemon

Daemon process that connects a machine to the FomularOS server and manages AI agents (Claude Code instances).

Quick Start

npx @fomular-os/daemon --server-url wss://api.fomularos.com --key <your-machine-api-key>

Install globally

npm install -g @fomular-os/daemon
fomular-daemon --server-url wss://api.fomularos.com --key <your-machine-api-key>

User-prefix install (no-root fallback)

When the daemon runs as a non-root service user without write access to the global npm prefix, in-place daemon:update falls back automatically to a user-local install under ~/.fomular. The daemon:update:result message reports mode: "user-prefix" so operators can confirm which install path was used. To put the user-prefix binary on PATH for manual invocation, add:

export PATH="$HOME/.fomular/bin:$PATH"

Supervisor (systemd/pm2) unit files should prefer the absolute path $HOME/.fomular/bin/fomular-daemon when the service runs under a dedicated account.

In-place update & self-relaunch (bare daemon)

On a successful daemon:update, the daemon double-forks a detached child process with the same argv/env/cwd captured at startup, then exits (via the existing 500 ms delay). The reported daemon:update:result.restart_strategy disambiguates the two outcomes:

| restart_strategy | Meaning | |------------------|---------| | self | Detached relaunch spawned successfully — the new daemon process inherits the machine registration and reconnects to the server. | | supervisor_required | Relaunch skipped or failed — the parent still exits, and an external supervisor (systemd/pm2) is expected to start a fresh process. |

Assumes the standard npm install layout (either global -g or user-prefix), where the bin name resolves via symlink to dist/index.js and npm install atomically replaces the target before the daemon re-execs. No wrapper script is required.

Opting out under an external supervisor

If systemd or pm2 already manages the daemon lifecycle, self-relaunch would race with supervisor-managed restart. Set:

FOMULAR_DAEMON_NO_SELF_RELAUNCH=1

The daemon then always reports restart_strategy: "supervisor_required" and falls back to "exit, let the supervisor restart me" semantics. Recommended for all non-bare deployments.

systemd unit (sample)

[Unit]
Description=FomularOS daemon
After=network-online.target

[Service]
Type=simple
User=fomular
ExecStart=/home/fomular/.fomular/bin/fomular-daemon \
  --server-url wss://api.fomularos.com \
  --key ${MACHINE_KEY}
Environment=MACHINE_KEY=...
Environment=FOMULAR_DAEMON_NO_SELF_RELAUNCH=1
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target

pm2 ecosystem (sample)

// ecosystem.config.js
module.exports = {
  apps: [
    {
      name: "fomular-daemon",
      script: "/home/fomular/.fomular/bin/fomular-daemon",
      args: "--server-url wss://api.fomularos.com --key $MACHINE_KEY",
      env: {
        FOMULAR_DAEMON_NO_SELF_RELAUNCH: "1",
      },
      autorestart: true,
      max_restarts: 50,
    },
  ],
};

Bare deployment (no supervisor)

Launch once from a login shell or startup script — leave FOMULAR_DAEMON_NO_SELF_RELAUNCH unset. The daemon will keep itself alive across daemon:update cycles without an external watchdog.

Options

| Flag | Description | Default | |------|-------------|---------| | --server-url <url> | WebSocket URL of the FomularOS server | ws://localhost:3001 | | --key <key> | Machine API key (required) | — |

Requirements

What it does

  1. Connects to the FomularOS server via WebSocket
  2. Receives agent start/stop commands from the server
  3. Spawns and manages Claude Code processes for each agent
  4. Streams agent activity (thinking, tool use, messages) back to the server
  5. Handles graceful shutdown of all agents on SIGTERM/SIGINT

Publishing

cd packages/daemon
npm login            # login to npm (once)
npm publish --access public

After publishing, verify:

npx @fomular-os/daemon --help