107
return existing;
108
}
109
>
// Fold our lines into the contributor's content (preserve it, don't clobber),
toolInstructions.ts
110
>
// then pad relative to the foundation by where this action places the content:
111
>
// `append` sits after it (lead with a newline), `prepend` sits before it (trail
112
>
// with a newline), `replace` owns the section (no foundation adjacency, so no
113
>
// padding — and no leading newline even when the contributor's content is empty).
114
>
const base = existing.content ?? '';
115
const merged = base ? `${base}\n${content}` : content;
116
switch (existing.action) {