feat(coding-agent): removed insertBefore and substr hashline edit operations

- Removed insertBefore and substr hashline edit operations, simplifying the edit API to support only replaceLine, replaceLines, and insertAfter operations.
- Updated hashline edit schema and type definitions to remove insertBefore and substr operation types from the ParsedRefs union and edit validation logic.
- Removed insertBefore and substr test cases from hashline test suite, including tests for insert-before functionality, anchor echo stripping, and substring matching.
- Updated benchmark runner to refactor edit operations from src/dst format to discriminated union types (replaceLine, replaceLines, insertAfter) and adjusted insertAfter line references.
This commit is contained in:
can1357
2026-02-11 07:12:28 +01:00
parent 4c0cba5984
commit 6c5fa149da
8 changed files with 36 additions and 200 deletions
+3 -17
View File
@@ -88,9 +88,7 @@ interface EditRenderArgs {
type HashlineEditPreview =
| { replaceLine: { loc: string; content: string } }
| { replaceLines: { start: string; end: string; content: string } }
| { insertAfter: { loc: string; content: string } }
| { insertBefore: { loc: string; content: string } }
| { substr: { needle: string; content: string } };
| { insertAfter: { loc: string; content: string } };
/** Extended context for edit tool rendering */
export interface EditRenderContext {
@@ -170,21 +168,9 @@ function formatStreamingHashlineEdits(edits: HashlineEditPreview[], uiTheme: The
dst: edit.replaceLines.content,
};
}
if ("insertAfter" in edit) {
return {
srcLabel: `• insertAfter ${edit.insertAfter.loc}..`,
dst: edit.insertAfter.content,
};
}
if ("substr" in edit) {
return {
srcLabel: `• substr "${edit.substr.needle}"`,
dst: edit.substr.content,
};
}
return {
srcLabel: `• insertBefore ..${edit.insertBefore.loc}`,
dst: edit.insertBefore.content,
srcLabel: `• insertAfter ${edit.insertAfter.loc}..`,
dst: edit.insertAfter.content,
};
}
}