Documentation
¶
Index ¶
- Variables
- func DiscoverAllAgentLogs() (map[string][]DiscoveredLog, error)
- func FindLogFiles(dirPath string) ([]string, error)
- func GetLatestLogFile(dirPath string) (string, error)
- type Config
- type DiscoveredLog
- type Watcher
- func (w *Watcher) EventQueue() <-chan *types.AgentEvent
- func (w *Watcher) GetStats() map[string]interface{}
- func (w *Watcher) Start() error
- func (w *Watcher) StartDynamicDiscovery(interval time.Duration, onNewWorkspace func(string, adapters.AgentAdapter))
- func (w *Watcher) Stop() error
- func (w *Watcher) Watch(path string, adapter adapters.AgentAdapter) error
- func (w *Watcher) WatchParentDirs(paths []string, adapter adapters.AgentAdapter) error
Constants ¶
This section is empty.
Variables ¶
var AgentLogLocations = map[string]map[string][]string{
"copilot": {
"darwin": {
"~/Library/Application Support/Code/User/workspaceStorage/*/chatSessions",
"~/Library/Application Support/Code - Insiders/User/workspaceStorage/*/chatSessions",
},
"linux": {
"~/.config/Code/User/workspaceStorage/*/chatSessions",
"~/.config/Code - Insiders/User/workspaceStorage/*/chatSessions",
},
"windows": {
"%APPDATA%\\Code\\User\\workspaceStorage\\*\\chatSessions",
"%APPDATA%\\Code - Insiders\\User\\workspaceStorage\\*\\chatSessions",
},
},
"claude": {
"darwin": {
"~/.claude/logs",
"~/Library/Application Support/Claude/logs",
"~/Library/Logs/Claude",
},
"linux": {
"~/.claude/logs",
"~/.config/claude/logs",
"~/.local/share/claude/logs",
},
"windows": {
"%APPDATA%\\Claude\\logs",
"%LOCALAPPDATA%\\Claude\\logs",
},
},
"cursor": {
"darwin": {
"~/Library/Application Support/Cursor/logs",
"~/Library/Logs/Cursor",
},
"linux": {
"~/.config/Cursor/logs",
"~/.local/share/Cursor/logs",
},
"windows": {
"%APPDATA%\\Cursor\\logs",
"%LOCALAPPDATA%\\Cursor\\logs",
},
},
"cline": {
"darwin": {
"~/.vscode/extensions/saoudrizwan.claude-dev-*/logs",
"~/Library/Application Support/Code/logs/*/exthost",
},
"linux": {
"~/.vscode/extensions/saoudrizwan.claude-dev-*/logs",
"~/.config/Code/logs/*/exthost",
},
"windows": {
"%USERPROFILE%\\.vscode\\extensions\\saoudrizwan.claude-dev-*\\logs",
"%APPDATA%\\Code\\logs\\*\\exthost",
},
},
"aider": {
"darwin": {
"~/.aider/logs",
"~/.aider/.aider.history",
},
"linux": {
"~/.aider/logs",
"~/.aider/.aider.history",
},
"windows": {
"%USERPROFILE%\\.aider\\logs",
"%USERPROFILE%\\.aider\\.aider.history",
},
},
}
AgentLogLocations defines default log paths per OS and agent
Functions ¶
func DiscoverAllAgentLogs ¶
func DiscoverAllAgentLogs() (map[string][]DiscoveredLog, error)
DiscoverAllAgentLogs discovers logs for all known agents
func FindLogFiles ¶
FindLogFiles recursively finds log files in a directory
func GetLatestLogFile ¶
GetLatestLogFile finds the most recently modified log file in a directory
Types ¶
type Config ¶
type Config struct {
Registry *adapters.Registry
EventQueueSize int
DebounceMs int
Logger *logrus.Logger
}
Config holds watcher configuration
type DiscoveredLog ¶
DiscoveredLog represents a discovered log file or directory
func DiscoverAgentLogs ¶
func DiscoverAgentLogs(agentName string) ([]DiscoveredLog, error)
DiscoverAgentLogs finds actual log file locations for a specific agent
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher monitors log files for changes
func NewWatcher ¶
NewWatcher creates a new file system watcher
func (*Watcher) EventQueue ¶
func (w *Watcher) EventQueue() <-chan *types.AgentEvent
EventQueue returns the channel for receiving parsed events
func (*Watcher) StartDynamicDiscovery ¶
func (w *Watcher) StartDynamicDiscovery(interval time.Duration, onNewWorkspace func(string, adapters.AgentAdapter))
StartDynamicDiscovery starts a background goroutine that periodically scans for new workspaces
func (*Watcher) Watch ¶
func (w *Watcher) Watch(path string, adapter adapters.AgentAdapter) error
Watch adds a file or directory to watch
func (*Watcher) WatchParentDirs ¶
func (w *Watcher) WatchParentDirs(paths []string, adapter adapters.AgentAdapter) error
WatchParentDirs watches parent directories for new workspaces (e.g., VS Code workspaceStorage) This enables detecting new workspaces when they are created (user opens new project in VS Code)