Documentation
¶
Overview ¶
Package agnt provides configuration and runtime management for the agnt CLI.
Index ¶
Constants ¶
const ConfigFileName = ".agnt.kdl"
ConfigFileName is the name of the agnt configuration file.
Variables ¶
This section is empty.
Functions ¶
func FindConfigFile ¶
FindConfigFile searches for .agnt.kdl starting from dir and walking up.
func WriteDefaultConfig ¶
WriteDefaultConfig writes a default configuration file with documentation.
Types ¶
type AutoStarter ¶
type AutoStarter struct {
// contains filtered or unexported fields
}
AutoStarter manages auto-starting scripts and proxies from config.
func NewAutoStarter ¶
func NewAutoStarter(config *Config, client *daemon.ResilientClient) *AutoStarter
NewAutoStarter creates a new AutoStarter.
func (*AutoStarter) Start ¶
func (a *AutoStarter) Start(ctx context.Context, projectPath string) error
Start starts all configured auto-start scripts and proxies.
func (*AutoStarter) StartedProxies ¶
func (a *AutoStarter) StartedProxies() []string
StartedProxies returns the names of proxies that were auto-started.
func (*AutoStarter) StartedScripts ¶
func (a *AutoStarter) StartedScripts() []string
StartedScripts returns the names of scripts that were auto-started.
type Config ¶
type Config struct {
// Scripts to manage
Scripts map[string]*ScriptConfig `kdl:"scripts"`
// Proxies to manage
Proxies map[string]*ProxyConfig `kdl:"proxies"`
// Hooks configuration
Hooks *HooksConfig `kdl:"hooks"`
// Toast notification settings
Toast *ToastConfig `kdl:"toast"`
}
Config represents the agnt configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a config with sensible defaults.
func LoadConfig ¶
LoadConfig loads configuration from the specified directory. It looks for .agnt.kdl in the directory and its parents.
func LoadConfigFile ¶
LoadConfigFile loads configuration from a specific file.
func ParseConfig ¶
ParseConfig parses KDL configuration data.
func (*Config) GetAutostartProxies ¶
func (c *Config) GetAutostartProxies() map[string]*ProxyConfig
GetAutostartProxies returns proxies configured for autostart.
func (*Config) GetAutostartScripts ¶
func (c *Config) GetAutostartScripts() map[string]*ScriptConfig
GetAutostartScripts returns scripts configured for autostart.
type HooksConfig ¶
type HooksConfig struct {
// OnResponse controls what happens when Claude responds
OnResponse *ResponseHookConfig `kdl:"on-response"`
}
HooksConfig defines hook behavior.
type ProxyConfig ¶
type ProxyConfig struct {
Target string `kdl:"target"`
Port int `kdl:"port"`
Autostart bool `kdl:"autostart"`
MaxLogSize int `kdl:"max-log-size"`
}
ProxyConfig defines a reverse proxy to start.
type ResponseHookConfig ¶
type ResponseHookConfig struct {
// Toast shows a toast notification in the browser
Toast bool `kdl:"toast"`
// Indicator updates the bug indicator
Indicator bool `kdl:"indicator"`
// Sound plays a notification sound
Sound bool `kdl:"sound"`
}
ResponseHookConfig controls response notification behavior.
type ScriptConfig ¶
type ScriptConfig struct {
Command string `kdl:"command"`
Args []string `kdl:"args"`
Autostart bool `kdl:"autostart"`
Env map[string]string `kdl:"env"`
Cwd string `kdl:"cwd"`
}
ScriptConfig defines a script to run.
type ToastConfig ¶
type ToastConfig struct {
// Duration in milliseconds (default 4000)
Duration int `kdl:"duration"`
// Position: "top-right", "top-left", "bottom-right", "bottom-left"
Position string `kdl:"position"`
// MaxVisible is the max number of visible toasts (default 3)
MaxVisible int `kdl:"max-visible"`
}
ToastConfig configures toast notifications.