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

@codemantle/agent-daemon

v0.1.39

Published

CodeMantle host daemon for secure reverse control-plane orchestration.

Readme

@codemantle/agent-daemon

npm version npm downloads License

CodeMantle host daemon package.

This daemon connects outbound to the control plane, executes session operations locally, and enforces filesystem/process safety boundaries on the host.

What this package includes

  • Reverse WebSocket client for control-plane connectivity.
  • OpenCode runtime lifecycle and session orchestration.
  • Local path/root/symlink boundary enforcement.
  • JIT credential handling and revocation support.
  • npm launcher that resolves and runs platform binaries.

Install and run

Run directly:

npx @codemantle/agent-daemon

Or install globally:

npm install -g @codemantle/agent-daemon
codemantle-agent

Initial setup

Run interactive setup:

codemantle-agent --setup

This setup flow probes local dependencies, prompts for required values, and writes .env into your workspace.

Required environment variables

  • CONTROL_PLANE_URL (ws:// or wss:// endpoint)
  • AGENT_AUTH_TOKEN (must match a token in panel VALID_TOKENS)

Common runtime variables:

  • AGENT_PROJECT_ROOT (root boundary for filesystem operations)
  • DEVICE_ID (stable host identity; auto-generated if absent)
  • OPENCODE_COMMAND (default opencode)
  • OPENCODE_HOST (default 127.0.0.1)
  • OPENCODE_START_PORT (default 4096)
  • REQUEST_TIMEOUT_MS
  • RECONNECT_BASE_MS
  • RECONNECT_MAX_MS

npm wrapper and binary distribution

The npm package launches a platform-specific binary and verifies downloaded artifacts with SHA-256 checksums from release checksums.txt.

Distribution controls:

  • CODEMANTLE_AGENT_BINARY_BASE_URL to use a private mirror.
  • CODEMANTLE_AGENT_INSTALL_DIR to change binary cache location.
  • CODEMANTLE_AGENT_BINARY_PATH to run an explicit local binary.
  • CODEMANTLE_AGENT_SKIP_DOWNLOAD=1 to skip postinstall fetch.

Supported binary targets:

  • Windows x64
  • macOS x64
  • macOS arm64
  • Linux x64
  • Linux arm64

Keep it running

PM2 example:

pm2 start "codemantle-agent" --name codemantle-agent
pm2 save
pm2 startup

systemd example:

[Unit]
Description=CodeMantle Agent Daemon
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/codemantle-agent
EnvironmentFile=/opt/codemantle-agent/.env
ExecStart=/usr/bin/env codemantle-agent
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Development

npm ci
npm run dev

Build TypeScript and launcher bundle:

npm run build

Build standalone binaries with pkg:

npm run pkg

Troubleshooting

  • AUTH or handshake failures: verify AGENT_AUTH_TOKEN matches panel VALID_TOKENS.
  • connection retries: verify CONTROL_PLANE_URL and network egress.
  • missing binary / checksum mismatch: verify release availability or set CODEMANTLE_AGENT_BINARY_BASE_URL.
  • unsupported platform error: use a supported OS/arch combo listed above.

For protocol and security details, see:

  • https://github.com/XQuestCode/codemantle/blob/main/PROTOCOL.md
  • https://github.com/XQuestCode/codemantle/blob/main/docs/architecture.md
  • https://github.com/XQuestCode/codemantle/blob/main/docs/security-model.md