mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 13:43:01 -06:00
* Add initial UI for agent mode * fix: Cleanup and define agent contract * Add react agent * Add interactions memory * Add support for stdio based MCP integration * Add basic sqlite3 report generator * fix: Persist vulnerabilities with package relation * fix: Persist license information * refactor: Agents into its own command package * feat: Add support for tool calling introspection * refactor: UI to hide implementation detail * sqlite3 reporter persist dependency graph * fix: Support multiple LLM provider for agent * docs: Update agents doc * docs: Remove deprecated query docs * fix: UI tests * fix: Linter issue * Add support for prompt mode * Improve UI with animation * Fix UI tests after update * Add OpenSSF scorecard persistence * Add slsa provenances in sqlite3 reporter * Add test cases for sqlite3 reporter * Fix agent doc * fix: Sqlite3 reporter use safe accessors * feat: Add support for fast model * feat: Simplify and streamline agent UI for better user experience - Remove decorative borders and excessive styling to maximize output area - Implement clean minimal design similar to modern TUI interfaces - Add bordered input area for clear visual separation - Move thinking indicator above input area for better visibility - Enhance input field reset logic for proper line alignment - Remove verbose help text and status messages - Optimize layout calculations for full width utilization - Add smooth animations for agent thinking state with spinner - Clean up code structure and remove unused progress bar functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: Improve agent status line * test: Update UI tests * fix: Use terminal safe rendering * fix: Fix nil deref without storing empty strings in DB * fix: Support overwriting sqlite3 database * fix: Data model to use m2m between manifest and package * style: Fix linter issue with unused variables * Misc fixes * Add test for agent memory --------- Co-authored-by: Claude <noreply@anthropic.com>
46 lines
863 B
Go
46 lines
863 B
Go
package agent
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
|
|
"github.com/cloudwego/eino/schema"
|
|
)
|
|
|
|
type simpleMemory struct {
|
|
mutex sync.RWMutex
|
|
interactions []*schema.Message
|
|
}
|
|
|
|
var _ Memory = (*simpleMemory)(nil)
|
|
|
|
func NewSimpleMemory() (*simpleMemory, error) {
|
|
return &simpleMemory{
|
|
interactions: make([]*schema.Message, 0),
|
|
}, nil
|
|
}
|
|
|
|
func (m *simpleMemory) AddInteraction(ctx context.Context, interaction *schema.Message) error {
|
|
m.mutex.Lock()
|
|
defer m.mutex.Unlock()
|
|
|
|
m.interactions = append(m.interactions, interaction)
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *simpleMemory) GetInteractions(ctx context.Context) ([]*schema.Message, error) {
|
|
m.mutex.RLock()
|
|
defer m.mutex.RUnlock()
|
|
|
|
return m.interactions, nil
|
|
}
|
|
|
|
func (m *simpleMemory) Clear(ctx context.Context) error {
|
|
m.mutex.Lock()
|
|
defer m.mutex.Unlock()
|
|
|
|
m.interactions = make([]*schema.Message, 0)
|
|
return nil
|
|
}
|