roots

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Global = &State{}

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.

func (*State) Add

func (s *State) Add(path string)

Add adds a new project root after normalizing it to an absolute path.

func (*State) Get

func (s *State) Get() []string

Get returns a copy of the currently registered roots.

func (*State) Sync

func (s *State) Sync(ctx context.Context, session *mcp.ServerSession)

Sync synchronizes roots with the MCP client.

func (*State) Validate

func (s *State) Validate(path string) (string, error)

Validate checks if the given path is within any of the registered roots. It returns the absolute path if valid, or an error if not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL