Documentation
¶
Overview ¶
Package config charge la configuration globale et projet (TOML).
La configuration projet est une frontière de sécurité : un dépôt malveillant ne doit pouvoir ni assouplir les permissions ni rediriger le trafic vers un autre fournisseur.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalPath ¶
GlobalPath : $XDG_CONFIG_HOME/tenon/config.toml, sinon $HOME/.config/tenon/config.toml.
Types ¶
type Config ¶
type Config struct {
Lang string `toml:"lang"`
DefaultProvider string `toml:"default_provider"`
MaxIterations int `toml:"max_iterations"`
ShellTimeout Duration `toml:"shell_timeout"`
OutputLimit int `toml:"output_limit"`
// CompactionThreshold : part de la fenêtre de contexte au-delà de
// laquelle l'historique est compacté. Clé globale uniquement.
CompactionThreshold float64 `toml:"compaction_threshold"`
Audit Audit `toml:"audit"`
Providers []Provider `toml:"providers"`
Permissions Permissions `toml:"permissions"`
Redaction Redaction `toml:"redaction"`
// MCP : serveurs MCP. Clé globale uniquement (un serveur stdio est une
// exécution de code arbitraire : un dépôt ne peut pas en déclarer).
MCP MCP `toml:"mcp"`
}
type Duration ¶
Duration encapsule time.Duration pour le décodage TOML ("2m").
func (*Duration) UnmarshalText ¶
type MCPServer ¶
type MCPServer struct {
ID string `toml:"id"` // [a-z0-9_-]{1,32}
Transport string `toml:"transport"` // "stdio" | "http"
Command []string `toml:"command"` // stdio : argv, non vide
EnvFrom []string `toml:"env_from"` // stdio : variables transmises au serveur
URL string `toml:"url"` // http : https://… (http:// seulement vers localhost/127.0.0.1/::1)
BearerEnv string `toml:"bearer_env"` // http : variable contenant le jeton
Jurisdiction string `toml:"jurisdiction"` // "eu" | "non-eu" | "local"
Country string `toml:"country"`
Risk string `toml:"risk"` // "" | "read" | "write" | "exec" | "network"
Tools []string `toml:"tools"` // liste blanche optionnelle des outils exposés
Disabled bool `toml:"disabled"`
}
MCPServer déclare un serveur MCP. Aucun secret : variables référencées par nom.
type Permissions ¶
type Permissions struct {
Rules []Rule `toml:"rules"`
}
type Provider ¶
type Provider struct {
ID string `toml:"id"`
Name string `toml:"name"`
BaseURL string `toml:"base_url"`
APIKeyEnv string `toml:"api_key_env"`
Model string `toml:"model"`
Country string `toml:"country"`
Jurisdiction string `toml:"jurisdiction"`
ContextWindow int `toml:"context_window"`
// Detect : "ollama" ou "vllm" pour interroger le serveur au démarrage
// (modèle servi, fenêtre appliquée) quand model ou context_window est
// vide ; "off" désactive la détection héritée d'un préréglage.
Detect string `toml:"detect"`
}
type Redaction ¶
type Redaction struct {
Rules []RedactionRule `toml:"rules"`
}
type RedactionRule ¶
Click to show internal directories.
Click to hide internal directories.