Documentation
¶
Index ¶
- func IsRunning(conf config.Config) bool
- func NewSocketClient(conf config.Config) *http.Client
- func RequestStop(conf config.Config, logger *slog.Logger) error
- func RunStdioServer(ctx context.Context, conf config.Config) error
- func WatchDaemon(ctx context.Context, httpClient *http.Client, interval time.Duration) (context.Context, context.CancelFunc)
- type Daemon
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSocketClient ¶ added in v0.0.10
NewSocketClient returns an HTTP client that dials the daemon's Unix socket.
func RequestStop ¶
RequestStop attempts a shutdown via Unix socket then TCP, and verifies each transport is no longer reachable afterwards.
func RunStdioServer ¶
RunStdioServer connects to the daemon's MCP endpoint over the Unix socket and proxies it to stdio. Tools are queried from session then forwarded to avoid duplicating the implementation here and in the daemon.
func WatchDaemon ¶ added in v0.0.10
func WatchDaemon(ctx context.Context, httpClient *http.Client, interval time.Duration) (context.Context, context.CancelFunc)
WatchDaemon polls GET /api/status via httpClient every interval and cancels the returned context when the daemon becomes unreachable or restarts (detected via started_at changing). The caller must call the returned CancelFunc to release resources when the watch is no longer needed.