config

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// RepoRoot is the absolute path to the repository to index
	RepoRoot string

	// DBPath is the path to the SQLite database file
	DBPath string

	// DebounceInterval is the duration to wait before processing filesystem events
	DebounceInterval time.Duration

	// MaxBFSDepth is the maximum depth for blast radius BFS traversal
	MaxBFSDepth int

	// EmbeddingBatchSize is the number of nodes to embed in a single batch
	EmbeddingBatchSize int

	// WorkerCount is the number of parallel workers for file parsing
	WorkerCount int

	// ExcludedDirs are additional directories to exclude beyond .gitignore
	ExcludedDirs []string

	// ONNXModelDir is the path to the ONNX model directory (contains model_quantized.onnx + tokenizer.json).
	// Empty string disables ONNX and uses the TFIDF fallback embedder.
	ONNXModelDir string

	// ONNXLibPath is the path to the ONNX Runtime shared library (libonnxruntime.dylib/.so/.dll).
	// Required when ONNXModelDir is set.
	ONNXLibPath string

	// EmbeddingDim is the embedding vector dimension. For ONNX models with
	// Matryoshka support, valid values are 64, 128, 256, 512, 896.
	// Defaults to 384 (TFIDF) or 256 (ONNX).
	EmbeddingDim int

	// ColdStartEnabled enables Git-derived intent metadata ingestion
	ColdStartEnabled bool

	// GitHistoryDepth is the maximum number of commits to scan per repository
	GitHistoryDepth int

	// GitPerFileCommitCap is the maximum commits to associate per file
	GitPerFileCommitCap int

	// GitMaxMessageBytes is the maximum bytes per commit message/body to store
	GitMaxMessageBytes int

	// GitMaxIntentBytes is the maximum bytes for compacted file intent text
	GitMaxIntentBytes int

	// Profile selects which tools are registered for MCP SDK mode.
	// Valid values: "core" (8 tools), "extended" (15 tools), "full" (all 20).
	// CLI mode always registers all 20 tools regardless of profile.
	Profile string

	// OllamaEndpoint is the Ollama API endpoint (e.g., http://localhost:11434).
	// Empty string disables the Ollama backend.
	OllamaEndpoint string

	// OllamaModel is the Ollama model name for embeddings (e.g., nomic-embed-code).
	OllamaModel string

	// LlamaCppEndpoint is the llama.cpp server endpoint (e.g., http://localhost:8080).
	// Empty string disables the llama.cpp backend.
	LlamaCppEndpoint string

	// OpenAIEndpoint is the OpenAI-compatible API endpoint (e.g., http://localhost:1234).
	// Empty string disables the OpenAI-compatible backend.
	OpenAIEndpoint string

	// OpenAIModel is the model name for the OpenAI-compatible embeddings API.
	OpenAIModel string

	// HTTPPort is the port for serve-http mode (default: 8080)
	HTTPPort int

	// HTTPBearerToken is the optional bearer token for HTTP authentication.
	// When set, requests must include "Authorization: Bearer <token>".
	HTTPBearerToken string
}

Config holds all configuration for the context-mcp daemon

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a Config with sensible defaults

func ParseFlags

func ParseFlags() (*Config, error)

ParseFlags populates the config from command-line flags. Uses a dedicated FlagSet so context-mcp can be embedded in programs that also use the global flag package, and returns an error on unknown flags instead of calling os.Exit(2).

Jump to

Keyboard shortcuts

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