Add files via upload

This commit is contained in:
公明
2026-08-15 01:39:58 +08:00
committed by GitHub
parent 4fe6defa28
commit 70b01206e4
47 changed files with 5598 additions and 1191 deletions
@@ -0,0 +1,57 @@
package multiagent
import (
"strings"
"sync"
)
type einoExecuteStdoutSuppressor struct {
mu sync.Mutex
pending string
}
func newEinoExecuteStdoutSuppressor() *einoExecuteStdoutSuppressor {
return &einoExecuteStdoutSuppressor{}
}
func (s *einoExecuteStdoutSuppressor) Record(toolName, stdout string, isErr bool) {
if s == nil || isErr || !strings.EqualFold(strings.TrimSpace(toolName), "execute") {
return
}
t := strings.TrimSpace(stdout)
if t == "" {
return
}
s.mu.Lock()
s.pending = t
s.mu.Unlock()
}
func (s *einoExecuteStdoutSuppressor) Peek() string {
if s == nil {
return ""
}
s.mu.Lock()
defer s.mu.Unlock()
return s.pending
}
func (s *einoExecuteStdoutSuppressor) Consume() string {
if s == nil {
return ""
}
s.mu.Lock()
defer s.mu.Unlock()
out := s.pending
s.pending = ""
return out
}
func (s *einoExecuteStdoutSuppressor) Clear() {
if s == nil {
return
}
s.mu.Lock()
s.pending = ""
s.mu.Unlock()
}