Update agent prompt, improve TUI patch UI, remove obsolete tool tests

- Replace and expand agent coder prompt for clarity and safety
- Add patch tool and TUI dialog support for patch diffs
- Sort sidebar modified files by name
- Remove Bash/Edit/Sourcegraph/Write tool tests

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Kujtim Hoxha
2025-04-17 00:00:19 +02:00
parent cc07f7a186
commit 36172979b4
11 changed files with 377 additions and 1474 deletions

View File

@@ -266,6 +266,18 @@ func (p *permissionDialogCmp) renderEditContent() string {
return ""
}
func (p *permissionDialogCmp) renderPatchContent() string {
if pr, ok := p.permission.Params.(tools.PatchPermissionsParams); ok {
diff := p.GetOrSetDiff(p.permission.ID, func() (string, error) {
return diff.FormatDiff(pr.Diff, diff.WithTotalWidth(p.contentViewPort.Width))
})
p.contentViewPort.SetContent(diff)
return p.styleViewport()
}
return ""
}
func (p *permissionDialogCmp) renderWriteContent() string {
if pr, ok := p.permission.Params.(tools.WritePermissionsParams); ok {
// Use the cache for diff rendering
@@ -350,6 +362,8 @@ func (p *permissionDialogCmp) render() string {
contentFinal = p.renderBashContent()
case tools.EditToolName:
contentFinal = p.renderEditContent()
case tools.PatchToolName:
contentFinal = p.renderPatchContent()
case tools.WriteToolName:
contentFinal = p.renderWriteContent()
case tools.FetchToolName: