Skip to main content

Module daemon

Module daemon 

Source
Expand description

Single-instance daemon for sharing a hyperd process across MCP clients.

Modules§

discovery
Discovery file management for the single-instance daemon.
health
TCP health listener for the daemon.
run
Daemon main loop: spawns hyperd, runs health listener, monitors hyperd liveness and optional idle timeout, restarts hyperd if it dies.
spawn
Spawn the daemon as a detached background process.

Constants§

DAEMON_PORT_SCAN_SPAN
Number of ports to scan starting from the base port when discovering or spawning a daemon. Used by the later port-scanning stage (not yet implemented).
DEFAULT_DAEMON_BASE_PORT
Default base TCP port for the daemon health listener. When no env var is set, the daemon scans [base, base + DAEMON_PORT_SCAN_SPAN) to find a free port. Previously 7484; changed to 7485 to avoid collision with hyperd’s default gRPC port.
DEFAULT_IDLE_TIMEOUT_SECS
Suggested idle timeout value (30 minutes) for use with the --idle-timeout flag or HYPERDB_DAEMON_IDLE_TIMEOUT env var. By default (when neither is set), the daemon never auto-shuts down due to inactivity.
ENV_DAEMON_PORT
Environment variable to override the daemon port.
ENV_IDLE_TIMEOUT
Environment variable to override the idle timeout (seconds).