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

@agenshield/daemon

v0.7.2

Published

AgenShield HTTP daemon server with embedded UI

Readme

@agenshield/daemon

AgenShield daemon is a Fastify-based HTTP service that exposes the management API and (optionally) serves the embedded UI. It is separate from the broker: this daemon focuses on control-plane operations, status, and UI interactions.

Purpose

  • Provide a local HTTP API for status, config, and security checks.
  • Serve the management UI if assets are present.
  • Stream live events over Server-Sent Events (SSE).
  • Handle passcode authentication and session management.
  • Offer AgenCo integration for MCP tool access.

Key Components

  • src/main.ts - Entry point, PID file handling, and server startup.
  • src/server.ts - Fastify server setup + static UI serving.
  • src/routes/* - HTTP endpoints and SSE routes.
  • src/auth/* - Passcode hashing, session manager, auth middleware.
  • src/config/* - Config loader and defaults.
  • src/state/* - Persistent state file management.
  • src/vault/* - Encrypted vault for tokens/secrets.
  • src/watchers/* - Background watchers (security status).
  • src/events/* - Event emitter feeding SSE.

API Overview

Base prefix is /api (see @agenshield/ipc constants).

Core endpoints:

  • GET /api/health - Health check.
  • GET /api/status - Daemon status + version.
  • GET /api/config - Current config.
  • PUT /api/config - Update config.
  • GET /api/security - Security status snapshot.

Wrappers:

  • GET /api/wrappers - List available wrappers.
  • GET /api/wrappers/:name - Wrapper details + generated content.
  • GET /api/wrappers/status - Installed status.
  • POST /api/wrappers/install - Install wrappers.
  • DELETE /api/wrappers/:name - Uninstall wrapper.
  • PUT /api/wrappers/:name - Update wrapper.
  • POST /api/wrappers/custom - Add a custom wrapper.
  • DELETE /api/wrappers/custom/:name - Remove a custom wrapper.
  • POST /api/wrappers/sync - Sync wrapper set based on policy.
  • POST /api/wrappers/regenerate - Regenerate installed wrappers.

Auth:

  • GET /api/auth/status
  • POST /api/auth/setup
  • POST /api/auth/unlock
  • POST /api/auth/lock
  • POST /api/auth/change
  • POST /api/auth/refresh
  • POST /api/auth/enable
  • POST /api/auth/disable

AgenCo:

  • POST /api/agenco/auth/start
  • POST /api/agenco/auth/callback
  • GET /api/agenco/auth/status
  • POST /api/agenco/auth/logout
  • POST /api/agenco/tool/run
  • GET /api/agenco/tool/list
  • GET /api/agenco/tool/search
  • GET /api/agenco/integrations
  • GET /api/agenco/integrations/connected
  • POST /api/agenco/integrations/connect

SSE:

  • GET /sse/events?token=...
  • GET /sse/events/:filter?token=...

Authentication Model

  • Passcodes are hashed with PBKDF2 and stored in the encrypted vault.
  • Sessions are in-memory only (lost on daemon restart).
  • Tokens can be supplied via Authorization: Bearer <token> or ?token=... for SSE.
  • Root users bypass authentication.
  • Only selected routes are protected when passcode protection is enabled.

Configuration and State

  • Config file: ~/.agenshield/config.json
  • State file: ~/.agenshield/state.json
  • Vault file: ~/.agenshield/vault.enc (encrypted with machine-bound key)

Defaults are defined in @agenshield/ipc and src/config/defaults.ts.

Limitations and Caveats

  • No HTTPS/TLS built in; intended for localhost use.
  • CORS is fully enabled for development.
  • Sessions are not persisted; tokens become invalid after restart.
  • Wrapper operations depend on @agenshield/sandbox (macOS-specific).
  • SSE is best-effort; no replay or persistence of events.
  • Default wrapper target dir is hardcoded to /Users/clawagent/bin.

Roadmap (Ideas)

  • Persisted sessions and stronger auth/scopes.
  • OpenAPI schema for clients.
  • Cross-platform wrapper management.
  • Metrics and health probes beyond /health.

Development

# Run directly
npx tsx libs/shield-daemon/src/main.ts

# Build
npx nx build shield-daemon

Contribution Guide

  • Add new routes in src/routes/ and register in src/routes/index.ts.
  • Update src/auth/middleware.ts if new endpoints need protection.
  • Keep response shapes aligned with @agenshield/ipc types.
  • Emit SSE events through src/events/emitter.ts for UI reactivity.

Agent Notes

  • startServer() starts the security watcher; remember to stop it on shutdown.
  • The UI assets are served from ui-assets (prod) or dist/apps/shield-ui (dev).
  • AgenCo tokens are stored in the vault; expect network calls to the MCP gateway.
  • Config updates are persisted via src/config/loader.ts (JSON + Zod).