Documentation
¶
Overview ¶
Package who answers "who holds this, and who is waiting for it?" from the agentsync lease store and the agentscope snapshot, with each session's reachable SendMessage name. It is the ONE implementation: the CLI (`agentscope who`) and the gRPC method both call Ask.
It never says "nobody" for something it could not read: an unreadable lease store is ErrUnreadable, and only a clean read that finds nothing is ErrNotFound.
Index ¶
Constants ¶
const ( RoleHolder = "holder" RoleQueued = "queued" RoleSession = "session" // a session matched by id that holds and awaits nothing )
Roles of a Party.
const DefaultIdle = 15 * time.Minute
DefaultIdle is agentsync's default idle limit, used only to say whether a lease is takeable.
Variables ¶
var ( // ErrNotFound: the stores were read cleanly and hold nothing for the query. ErrNotFound = errors.New("who: nothing found") // ErrUnreadable: a store could not be read, so no answer, not "nobody". ErrUnreadable = errors.New("who: unreadable") // ErrBadQuery: the query is neither an owner/repo nor a session id prefix. ErrBadQuery = errors.New("who: the query is neither owner/repo nor a session id prefix (4+ hex characters)") )
Functions ¶
Types ¶
type Party ¶
type Party struct {
Role string `json:"role"`
Position int `json:"position,omitempty"` // 1-based place in the line, queued only
Resource string `json:"resource,omitempty"`
Session string `json:"session"`
Short string `json:"short"`
Note string `json:"note,omitempty"`
// State is active, idle, no-transcript, or unknown (not in the snapshot).
State string `json:"state"`
SubAgents int `json:"subAgents"`
Reach names.Reach `json:"reach"`
// Since is when the lease was acquired, or the place in line was taken.
Since time.Time `json:"since,omitempty"`
Expires time.Time `json:"expires,omitempty"`
Takeable bool `json:"takeable,omitempty"`
}
Party is one session in the answer.