Documentation
¶
Overview ¶
Package proc provides the CLI-side glue between session-creating commands (`ctm attach`, `ctm new`, `ctm yolo`, etc.) and the local `ctm serve` daemon: a fire-and-forget spawner that ensures serve is up, and a tiny HTTP client that POSTs lifecycle events to its /api/hooks/:event endpoint.
Both helpers are best-effort. Serve is observability — failures here log at WARN/DEBUG and never block the user-visible CLI flow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureServeRunning ¶
EnsureServeRunning probes /healthz; if no `ctm serve` listens, it spawns one as a detached child via setsid and waits up to 2 s for readiness, then returns. The caller never blocks past 2 s — if serve isn't up by then, subsequent PostEvent calls degrade silently.
func PostEvent ¶
PostEvent fires a hook event to the local serve daemon. event must match one of the names whitelisted in `internal/serve/api.Hooks` (session_new / session_attached / session_killed / on_yolo). The form is sent as `application/x-www-form-urlencoded`. No bearer token is needed — /api/hooks/* is unauthed (daemon binds 127.0.0.1 only).
Types ¶
This section is empty.