conflict

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

type Detector struct {
	// contains filtered or unexported fields
}

Detector watches for file modifications across instances and detects conflicts

func New

func New() (*Detector, error)

New creates a new conflict detector

func (*Detector) AddInstance

func (d *Detector) AddInstance(instanceID, worktreePath string) error

AddInstance starts watching files for an instance's worktree

func (*Detector) ClearOldModifications

func (d *Detector) ClearOldModifications(maxAge time.Duration)

ClearOldModifications removes modifications older than the given duration

func (*Detector) ConflictCount

func (d *Detector) ConflictCount() int

ConflictCount returns the number of files with conflicts

func (*Detector) GetConflicts

func (d *Detector) GetConflicts() []FileConflict

GetConflicts returns the current list of conflicts

func (*Detector) GetFilesModifiedByInstance

func (d *Detector) GetFilesModifiedByInstance(instanceID string) []string

GetFilesModifiedByInstance returns files modified by a specific instance

func (*Detector) HasConflicts

func (d *Detector) HasConflicts() bool

HasConflicts returns true if there are any active conflicts

func (*Detector) RemoveInstance

func (d *Detector) RemoveInstance(instanceID string)

RemoveInstance stops watching an instance's worktree

func (*Detector) SetConflictCallback

func (d *Detector) SetConflictCallback(cb func([]FileConflict))

SetConflictCallback sets the callback for when conflicts are detected

func (*Detector) Start

func (d *Detector) Start()

Start begins watching for file changes

func (*Detector) Stop

func (d *Detector) Stop()

Stop stops the detector and cleans up resources

type FileConflict

type FileConflict struct {
	RelativePath string    // Path relative to worktree root
	Instances    []string  // Instance IDs that modified this file
	LastModified time.Time // When the conflict was last detected
}

FileConflict represents a file being modified by multiple instances

type InstanceInfo

type InstanceInfo struct {
	ID           string
	WorktreePath string
}

InstanceInfo holds info about a watched instance

Jump to

Keyboard shortcuts

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