filewatch

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package filewatch monitors file/directory patterns and triggers plan re-evaluation when watched files change. Designed for TDD-style AI loops where code changes should drive plan updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintEvent

func PrintEvent(evt ChangeEvent)

PrintEvent prints a colored summary of a ChangeEvent to stdout.

func Run

func Run(ctx context.Context, cfg Config, onTrigger func(ChangeEvent)) error

Run starts the file watcher. It blocks until ctx is cancelled. onTrigger is called after each debounced batch of changes once the state has been updated (relevant tasks reset to pending).

Types

type ChangeEvent

type ChangeEvent struct {
	// Files is the list of changed file paths (relative to WorkDir).
	Files []string
	// ResetTaskIDs are the task IDs that were reset to pending.
	ResetTaskIDs []int
	// Context is a human-readable description of what changed.
	Context string
}

ChangeEvent describes a batch of file changes that triggered re-evaluation.

type Config

type Config struct {
	// WorkDir is the project root.
	WorkDir string
	// Globs are file patterns to watch (e.g. "**/*.go", "src/**/*.ts").
	Globs []string
	// Debounce is the duration to wait after the last change before triggering.
	Debounce time.Duration
}

Config holds file-watch configuration.

Jump to

Keyboard shortcuts

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