mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-04 16:34:55 +01:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user