Documentation
¶
Overview ¶
Package agentgit provides a WebSocket-based service for watching git repository changes on the agent. It is mounted at /api/v0/git/watch and allows clients to subscribe to file paths, triggering scans of the corresponding git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API exposes the git watch HTTP routes for the agent.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler manages per-connection git watch state.
func NewHandler ¶
NewHandler creates a new git watch handler.
func (*Handler) RequestScan ¶
func (h *Handler) RequestScan()
RequestScan pokes the scan trigger so the run loop performs a scan.
func (*Handler) RunLoop ¶
RunLoop runs the main event loop that listens for refresh requests and fallback poll ticks. It calls scanFn whenever a scan should happen (rate-limited to scanCooldown). It blocks until ctx is canceled.
type Option ¶
type Option func(*Handler)
Option configures the git watch service.
func WithGitBinary ¶
WithGitBinary overrides the git binary path (for testing).
type PathStore ¶
type PathStore struct {
// contains filtered or unexported fields
}
PathStore tracks which file paths each chat has touched. It is safe for concurrent use.
func (*PathStore) AddPaths ¶
AddPaths adds paths to every chat in chatIDs and notifies their subscribers. Zero-value UUIDs are silently skipped.
func (*PathStore) GetPaths ¶
GetPaths returns all paths tracked for a chat, deduplicated and sorted lexicographically.