Skip to content

applyHunks

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/agent-core/src/tools/edit-file.tool.ts

Apply parsed hunks to file content with fuzzy line offset matching. Hunks are applied in reverse order (bottom-to-top) to preserve line numbers.

Signature

ts
function applyHunks(content: string, hunks: DiffHunk[], fuzzLines): { success: boolean; content?: string; error?: string; lastNewText?: string }

Parameters

NameType
contentstring
hunksDiffHunk[]
fuzzLinesany

Returns: { success: boolean; content?: string; error?: string; lastNewText?: string }

Was this page helpful?

Download as PDF