# applyHunks

**Kind:** Function

**Source:** [`atloria-monorepo/libs/agent-core/src/tools/edit-file.tool.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/tools/edit-file.tool.ts#L625)

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

| Name | Type |
|---|---|
| `content` | `string` |
| `hunks` | `DiffHunk[]` |
| `fuzzLines` | `any` |

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