Documentation
¶
Overview ¶
Package session tracks advisory state for an MCP server session, including tool call counts, entry adds, and pending updates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PendingUpdate ¶
PendingUpdate represents a context update awaiting human confirmation.
type State ¶
type State struct {
ToolCalls int
AddsPerformed map[string]int
PendingFlush []PendingUpdate
// contains filtered or unexported fields
}
State tracks per-context-dir advisory state.
Session state is keyed by contextDir on the Server struct. It tracks tool call counts, entry additions, and pending context updates that need human review before persisting.
Thread-safety: State is only accessed from the main request loop (single goroutine). If future work introduces concurrent access, a mutex should be added here.
func (*State) PendingCount ¶
PendingCount returns the number of pending updates.
func (*State) QueuePendingUpdate ¶
func (ss *State) QueuePendingUpdate(update PendingUpdate)
QueuePendingUpdate adds an update to the pending flush queue.
func (*State) RecordToolCall ¶
func (ss *State) RecordToolCall()
RecordToolCall increments the tool call counter.