Documentation
¶
Index ¶
- Constants
- func GenerateDirectoryStructure(path string, allowedFileList []string, opt *commandline.Option) ([]string, error)
- func HandleChunkByID(root string, files []string) http.HandlerFunc
- func HandleChunks(root string, files []string) http.HandlerFunc
- func HandleFile(root string, allowedFiles []string, opt *commandline.ServeOption) http.HandlerFunc
- func HandleMetadata() http.HandlerFunc
- func HandleSearch(root string, allowedFiles []string) http.HandlerFunc
- func HandleStructureJSON(allowedFiles []string) http.HandlerFunc
- func RunMCPServe(root string, serverOpt *commandline.ServeOption)
- func SetupRoutes(root string, pw *ProjectWatcher, serverOpt *commandline.ServeOption) http.Handler
- type Chunk
- type ChunkIndex
- type EndpointMeta
- type FileNode
- type Metadata
- type ProjectWatcher
- type SearchResult
Constants ¶
const DefaultMaxTokensPerChunk = 30000 // Default fallback value
Variables ¶
This section is empty.
Functions ¶
func HandleChunkByID ¶
func HandleChunkByID(root string, files []string) http.HandlerFunc
HandleChunkByID serves one chunk's file contents in arklite-like format
func HandleChunks ¶
func HandleChunks(root string, files []string) http.HandlerFunc
HandleChunks serves the list of available chunks as JSON
func HandleFile ¶
func HandleFile(root string, allowedFiles []string, opt *commandline.ServeOption) http.HandlerFunc
HandleFile serves the content of a single file specified via query param "path"
func HandleMetadata ¶
func HandleMetadata() http.HandlerFunc
HandleMetadata returns static info about available endpoints
func HandleSearch ¶
func HandleSearch(root string, allowedFiles []string) http.HandlerFunc
HandleSearch allows simple plain-text search over allowed files
func HandleStructureJSON ¶
func HandleStructureJSON(allowedFiles []string) http.HandlerFunc
HandleStructureJSON serves the project structure as a hierarchical JSON tree
func RunMCPServe ¶
func RunMCPServe(root string, serverOpt *commandline.ServeOption)
RunMCPServe launches an MCP-compatible HTTP server using ProjectWatcher
func SetupRoutes ¶
func SetupRoutes(root string, pw *ProjectWatcher, serverOpt *commandline.ServeOption) http.Handler
SetupRoutes initializes all MCP endpoints using the ProjectWatcher.
Types ¶
type Chunk ¶
type Chunk struct {
ID int `json:"id"`
TokenEstimate int `json:"token_estimate"`
Files []string `json:"files"`
}
Chunk represents a group of files split by token estimate
type ChunkIndex ¶
type ChunkIndex struct {
TotalTokensEstimate int `json:"total_tokens_estimate"`
MaxPerChunk int `json:"max_per_chunk"`
Chunks []Chunk `json:"chunks"`
}
func GenerateChunkIndex ¶
func GenerateChunkIndex(root string, files []string, maxChunkSize int) (ChunkIndex, error)
GenerateChunkIndex generates a list of file-based chunks given a root dir and a list of allowed files
type EndpointMeta ¶
type Metadata ¶
type Metadata struct {
Name string `json:"name"`
InterfaceType string `json:"interfaceType"`
Description string `json:"description"`
Endpoints []EndpointMeta `json:"endpoints"`
}
type ProjectWatcher ¶
type ProjectWatcher struct {
Root string
AllowedFiles []string
// contains filtered or unexported fields
}
func NewProjectWatcher ¶
func NewProjectWatcher(root string, initial []string, rescan func(string) []string) *ProjectWatcher
func (*ProjectWatcher) GetAllowed ¶
func (pw *ProjectWatcher) GetAllowed() []string
GetAllowed returns the current allowed file list
func (*ProjectWatcher) RefreshIfDirty ¶
func (pw *ProjectWatcher) RefreshIfDirty()
RefreshIfDirty rescans files if dirty flag is set
func (*ProjectWatcher) ShouldRefresh ¶
func (pw *ProjectWatcher) ShouldRefresh() bool
ShouldRefresh tells whether refresh hint should be set