Documentation
¶
Index ¶
- Variables
- type State
- func (s *State) Add(session *mcp.ServerSession, path string)
- func (s *State) Delete(session *mcp.ServerSession)
- func (s *State) Get(session *mcp.ServerSession) []string
- func (s *State) GetAllRoots() []string
- func (s *State) OnChange(cb func([]string))
- func (s *State) Sync(ctx context.Context, session *mcp.ServerSession)
- func (s *State) Validate(session *mcp.ServerSession, projectDir string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Global = &State{ roots: make(map[*mcp.ServerSession][]string), }
Global is the singleton instance for the entire application.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State manages the registered project roots on a per-session basis.
func (*State) Add ¶
func (s *State) Add(session *mcp.ServerSession, path string)
Add adds a new project root for the given session after normalizing it to an absolute path.
func (*State) Delete ¶ added in v0.16.0
func (s *State) Delete(session *mcp.ServerSession)
Delete removes all registered roots for the given session.
func (*State) Get ¶
func (s *State) Get(session *mcp.ServerSession) []string
Get returns a copy of the registered roots for the given session.
func (*State) GetAllRoots ¶ added in v0.20.2
GetAllRoots returns a deep copy of all registered roots across all sessions.
func (*State) OnChange ¶ added in v0.20.2
OnChange registers a callback that fires whenever roots change.
Click to show internal directories.
Click to hide internal directories.