Documentation
¶
Overview ¶
Package presence tracks who is connected to a daemon right now (PRD §8.1): MCP sessions, their last tool call, and when they were last seen. It is ephemeral and per daemon, and never written to git.
Index ¶
Constants ¶
const IdleTimeout = 30 * time.Minute
IdleTimeout drops a session that made no call for this long (a client that went away without closing).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
Method, Tool, Ticket, Error string
}
Call describes one request a session made.
type Change ¶
type Change struct {
State string `json:"state" doc:"connected, active or disconnected."`
Session Session `json:"session"`
}
Change is the presence.changed payload.
type Session ¶
type Session struct {
ID string `json:"id"`
Actor string `json:"actor"`
OnBehalfOf string `json:"on_behalf_of,omitempty"`
Client string `json:"client,omitempty" doc:"clientInfo name and version."`
Transport string `json:"transport" doc:"mcp-http (directly or through the ka mcp proxy)."`
Connected string `json:"connected"`
LastSeen string `json:"last_seen"`
LastMethod string `json:"last_method,omitempty"`
LastTool string `json:"last_tool,omitempty"`
LastTicket string `json:"last_ticket,omitempty"`
LastError string `json:"last_error,omitempty" doc:"The error code of the last call, if it failed."`
Calls int `json:"calls"`
}
Session is one connected agent session.
type Tracker ¶
Tracker holds the live sessions.