Skip to main content

Module discovery

Module discovery 

Source
Expand description

Resolve a repo root to its caliband control socket, and ensure a daemon is running for it.

Mirrors caliban’s socket-path rule: ${CALIBAN_DAEMON_RUNTIME_DIR:-$XDG_RUNTIME_DIR/caliban}/<hash16>.sock, falling back to ${TMPDIR}/caliban-daemon/<hash16>.sock, where hash16 is the first 16 hex chars of SHA-256(canonical_workspace_root).

Structs§

DiscoveryEnv
The subset of process environment that affects socket-path resolution. Captured explicitly so resolution is a pure, testable function.
EnsureConfig
Configuration for ensure_caliband.

Functions§

canonical_root
Canonicalize a repo root, mapping the IO error to a discovery error.
control_socket_path
Compute the control socket path for a (already canonical) repo root.
ensure_caliband
Ensure a caliband daemon is reachable for workspace_root, returning a client bound to its control socket. If none is reachable and autostart is set, spawns the daemon and waits for the socket.
hash16
First 16 hex chars of SHA-256 of the path’s string form.
resolve_socket
Canonicalize a repo root and compute its control socket path.