Expand description
khived daemon server — persistent warm runtime over a Unix socket.
The daemon binds ~/.khive/khived.sock, accepts length-prefixed request
frames, dispatches them through a DaemonDispatch implementor, and serves
results back. It is transport-agnostic: the MCP crate provides the dispatch
impl, but any future client (CLI, HTTP gateway) can reuse this server.
The client side (forwarding, auto-spawn) lives in the transport crate
(e.g. khive-mcp), not here.
Structs§
- Daemon
Request Frame - Request frame sent from a client to the daemon.
- Daemon
Response Frame - Response frame sent from the daemon back to a client.
Constants§
- MAX_
FRAME_ BYTES - Maximum frame size accepted in either direction.
Traits§
- Daemon
Dispatch - Transport-agnostic dispatch interface for the daemon server.
Functions§
- env_
truthy - Returns
truefor non-empty env values that are not"0"or"false". - pid_
path - PID file path written by the daemon.
- read_
frame - Read one length-prefixed frame (4-byte BE u32 length + JSON bytes).
- run_
daemon - Run the daemon: bind the socket, warm in the background, serve request frames until SIGTERM/SIGINT.
- socket_
path - Unix socket path the daemon binds and clients connect to.
- write_
frame - Write one length-prefixed frame.