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:
@@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user