Versions in this module Expand all Collapse all v1 v1.0.0 Mar 11, 2026 Changes in this version + type Applier struct + func NewApplier(basePath string, options ApplyOptions) (*Applier, error) + func (a *Applier) Apply(ctx context.Context, change *ProposedChange) (*ApplyResult, error) + func (a *Applier) ApplyAll(ctx context.Context, changes []*ProposedChange) ([]*ApplyResult, error) + type ApplyOptions struct + BackupSuffix string + CreateBackups bool + CreateDirs bool + DirMode os.FileMode + DryRun bool + FileMode os.FileMode + func DefaultApplyOptions() ApplyOptions + type ApplyResult struct + Applied bool + BackupPath string + BytesWritten int64 + Error string + FilePath string + HunksApplied int + HunksRejected int + Success bool + type ChangeRisk string + const RiskCritical + const RiskHigh + const RiskLow + const RiskMedium + func (r ChangeRisk) String() string + type DecisionAction string + const DecisionAccept + const DecisionEdit + const DecisionPending + const DecisionReject + const DecisionSkip + func (d DecisionAction) IsTerminal() bool + func (d DecisionAction) String() string + type DiffLine struct + Content string + NewNum int + OldNum int + Type LineType + func (l DiffLine) IsAddition() bool + func (l DiffLine) IsContext() bool + func (l DiffLine) IsDeletion() bool + func (l DiffLine) String() string + type FileDecision struct + Action DecisionAction + EditedContent string + FilePath string + HunkDecisions map[int]HunkStatus + type Hunk struct + EditedLines []DiffLine + Lines []DiffLine + NewCount int + NewStart int + OldCount int + OldStart int + Status HunkStatus + func (h *Hunk) AddedCount() int + func (h *Hunk) EffectiveLines() []DiffLine + func (h *Hunk) Header() string + func (h *Hunk) RemovedCount() int + type HunkStatus string + const HunkAccepted + const HunkEdited + const HunkPending + const HunkRejected + func (s HunkStatus) IsTerminal() bool + func (s HunkStatus) String() string + type LineType string + const LineAdded + const LineContext + const LineRemoved + func (lt LineType) String() string + type ProposedChange struct + FilePath string + Hunks []*Hunk + IsDelete bool + IsNew bool + Language string + NewContent string + OldContent string + Rationale string + Related []string + Risk ChangeRisk + func GenerateDiff(filePath, oldContent, newContent, rationale string) (*ProposedChange, error) + func ParseMultiFileDiff(diffText string) ([]*ProposedChange, error) + func (c *ProposedChange) AcceptedCount() int + func (c *ProposedChange) AllAccepted() bool + func (c *ProposedChange) AllRejected() bool + func (c *ProposedChange) AnyPending() bool + func (c *ProposedChange) HunkCount() int + func (c *ProposedChange) LineStats() (added, removed int) + func (c *ProposedChange) PendingCount() int + func (c *ProposedChange) RejectedCount() int + func (c *ProposedChange) Stats() string + type ReviewResult struct + CancelReason string + Cancelled bool + Decisions map[string]*FileDecision + func NewReviewResult() *ReviewResult + func (r *ReviewResult) AcceptedFiles() []string + func (r *ReviewResult) AllDecided() bool + func (r *ReviewResult) PendingFiles() []string + func (r *ReviewResult) RejectedFiles() []string + func (r *ReviewResult) Summary() string