Documentation
¶
Overview ¶
Package patch implements a two-stage fault-tolerant search/replace patch engine for the MCP file tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAmbiguousMatch = errors.New("ambiguous patch block matched multiple locations")
ErrAmbiguousMatch indicates that a search block matched multiple locations.
var ErrInvalidFormat = errors.New("invalid patch format")
ErrInvalidFormat indicates a malformed search/replace patch payload.
var ErrNoMatch = errors.New("patch block did not match file content")
ErrNoMatch indicates that a search block was not found in the target content.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Content string
// Blocks is the number of blocks applied.
Blocks int
// Fuzzy is the number of blocks that matched only after ignoring leading
// and trailing whitespace on each line; callers should surface this so the
// edit can be reviewed.
Fuzzy int
}
Result reports the outcome of Apply.