mirror of
https://github.com/safedep/vet.git
synced 2025-12-11 01:01:10 -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>
30 lines
486 B
Go
30 lines
486 B
Go
package agent
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type session struct {
|
|
sessionID string
|
|
memory Memory
|
|
}
|
|
|
|
var _ Session = (*session)(nil)
|
|
|
|
func NewSession(memory Memory) (*session, error) {
|
|
return newSessionWithID(uuid.New().String(), memory), nil
|
|
}
|
|
|
|
func newSessionWithID(id string, memory Memory) *session {
|
|
return &session{
|
|
sessionID: id,
|
|
memory: memory,
|
|
}
|
|
}
|
|
|
|
func (s *session) ID() string {
|
|
return s.sessionID
|
|
}
|
|
|
|
func (s *session) Memory() Memory {
|
|
return s.memory
|
|
}
|