Documentation
¶
Index ¶
- Constants
- func Now() int64
- type Note
- type NoteVersion
- type Store
- func (s *Store) Create(note *Note) error
- func (s *Store) Delete(id string) error
- func (s *Store) FinalizeBySession(sessionID, content, exitReason string) error
- func (s *Store) Get(id string) (*Note, error)
- func (s *Store) GetBySessionID(sessionID string) (*Note, error)
- func (s *Store) List(directory string) ([]*Note, error)
- func (s *Store) ListVersions(noteID string) ([]*NoteVersion, error)
- func (s *Store) RecoverStuckNotes() ([]*Note, error)
- func (s *Store) UpdateContent(id, title, content, status string, version int) error
Constants ¶
View Source
const ( StatusGenerating = "generating" StatusDone = "done" StatusError = "error" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Note ¶
type Note struct {
ID string `json:"id"`
Directory string `json:"directory"`
Title string `json:"title"`
Query string `json:"query"`
Content string `json:"content"`
SessionID string `json:"sessionId,omitempty"`
Status string `json:"status"`
Version int `json:"version"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
}
type NoteVersion ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) FinalizeBySession ¶
FinalizeBySession is called when the note agent loop completes. It increments the version, saves the new content to the note table, and records a version entry so the full history is preserved.
func (*Store) ListVersions ¶
func (s *Store) ListVersions(noteID string) ([]*NoteVersion, error)
func (*Store) RecoverStuckNotes ¶ added in v0.3.1
RecoverStuckNotes finds all notes still in "generating" status and marks them as "error". This runs on server startup to handle notes whose agent loop was interrupted by a server restart or crash.
Click to show internal directories.
Click to hide internal directories.