Documentation
¶
Index ¶
- type Entry
- func (e *Entry) Count() int
- func (e *Entry) FieldValue(key string) string
- func (e *Entry) Headline() string
- func (e *Entry) Markdown() string
- func (e *Entry) RelatedIDs() []string
- func (e *Entry) ReviewItem() ReviewItem
- func (e *Entry) SetCount(count int)
- func (e *Entry) SetField(key string, value string)
- func (e *Entry) SetRelatedIDs(ids []string)
- func (e *Entry) SetStatus(status string)
- func (e *Entry) Status() string
- type Factory
- type Field
- type LogResult
- type Parser
- type PromoteResult
- type Repository
- func (r *Repository) AppendEntry(entry *Entry) (string, error)
- func (r *Repository) AppendToMemorySection(filename string, sectionTitle string, bullet string) (string, error)
- func (r *Repository) ListRecentEntries(days int, limit int) ([]*Entry, error)
- func (r *Repository) ReadSlice(relativePath string, fromLine int, lines int) (*Slice, error)
- func (r *Repository) Search(query string, limit int) ([]SearchMatch, error)
- func (r *Repository) UpdateEntry(entryID string, updater func(*Entry)) (*Entry, error)
- type ReviewItem
- type SearchMatch
- type Service
- func (s *Service) BuildReviewMarkdown(days int, limit int, maxChars int) (string, error)
- func (s *Service) Get(relativePath string, fromLine int, lines int) (*Slice, error)
- func (s *Service) Log(kind string, title string, category string, fields []Field, ...) (*LogResult, error)
- func (s *Service) Promote(target string, content string, title string, entryID string) (*PromoteResult, error)
- func (s *Service) ResolveEntry(entryID string, note string) (*ReviewItem, error)
- func (s *Service) ReviewRecentEntries(days int, limit int) ([]ReviewItem, error)
- func (s *Service) Search(query string, limit int) ([]SearchMatch, error)
- func (s *Service) SetEntryStatus(entryID string, status string, note string) (*ReviewItem, error)
- type SimilarityMatcher
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"entry_id"`
CreatedAt time.Time `json:"created_at"`
Kind string `json:"kind"`
Title string `json:"title"`
Category string `json:"category,omitempty"`
Fields []Field `json:"fields"`
Path string `json:"path,omitempty"`
}
Entry 表示单条日记条目。
type Factory ¶
type Factory struct{}
Factory 负责生成标准化记忆条目。
func (Factory) Create ¶
func (f Factory) Create(kind string, title string, category string, fields []Field, relatedEntries []*Entry, now time.Time) (*Entry, error)
Create 构建新条目。
func (Factory) InferAutoPromotionTarget ¶
InferAutoPromotionTarget 推断自动提升目标。
type LogResult ¶
type LogResult struct {
Path string `json:"path"`
EntryID string `json:"entry_id"`
Entry string `json:"entry"`
Status string `json:"status"`
Count int `json:"count"`
RelatedEntries []ReviewItem `json:"related_entries"`
Promoted *PromoteResult `json:"promoted,omitempty"`
}
LogResult 表示记录日记后的结果。
type PromoteResult ¶
PromoteResult 表示长期提升结果。
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository 负责管理 workspace 记忆文件。
func (*Repository) AppendEntry ¶
func (r *Repository) AppendEntry(entry *Entry) (string, error)
AppendEntry 把条目追加到今日日志。
func (*Repository) AppendToMemorySection ¶
func (r *Repository) AppendToMemorySection(filename string, sectionTitle string, bullet string) (string, error)
AppendToMemorySection 向长期文件追加规则。
func (*Repository) ListRecentEntries ¶
func (r *Repository) ListRecentEntries(days int, limit int) ([]*Entry, error)
ListRecentEntries 返回近期条目。
func (*Repository) Search ¶
func (r *Repository) Search(query string, limit int) ([]SearchMatch, error)
Search 在记忆文件中做关键词检索。
func (*Repository) UpdateEntry ¶
func (r *Repository) UpdateEntry(entryID string, updater func(*Entry)) (*Entry, error)
UpdateEntry 更新指定条目。
type ReviewItem ¶
type ReviewItem struct {
EntryID string `json:"entry_id"`
Path string `json:"path"`
Headline string `json:"headline"`
Kind string `json:"kind"`
Status string `json:"status"`
Count int `json:"count"`
}
ReviewItem 表示近期回顾条目的摘要。
type SearchMatch ¶
type SearchMatch struct {
Path string `json:"path"`
Line int `json:"line"`
Content string `json:"content"`
}
SearchMatch 表示检索结果。
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service 负责检索、记录、提升和流转工作区记忆。
func (*Service) BuildReviewMarkdown ¶
BuildReviewMarkdown 构造注入 prompt 的近期摘要。
func (*Service) Log ¶
func (s *Service) Log(kind string, title string, category string, fields []Field, promoteTarget string) (*LogResult, error)
Log 记录今日日记。
func (*Service) Promote ¶
func (s *Service) Promote(target string, content string, title string, entryID string) (*PromoteResult, error)
Promote 把经验提升到长期文件。
func (*Service) ResolveEntry ¶
func (s *Service) ResolveEntry(entryID string, note string) (*ReviewItem, error)
ResolveEntry 把条目标记为已解决。
func (*Service) ReviewRecentEntries ¶
func (s *Service) ReviewRecentEntries(days int, limit int) ([]ReviewItem, error)
ReviewRecentEntries 返回近期日记摘要。
func (*Service) Search ¶
func (s *Service) Search(query string, limit int) ([]SearchMatch, error)
Search 执行关键词检索。
func (*Service) SetEntryStatus ¶
SetEntryStatus 更新条目状态。
type SimilarityMatcher ¶
type SimilarityMatcher struct{}
SimilarityMatcher 负责发现相似条目。
func (SimilarityMatcher) FindRelated ¶
func (SimilarityMatcher) FindRelated(target *Entry, candidates []*Entry, limit int) []*Entry
FindRelated 返回相似条目。
Click to show internal directories.
Click to hide internal directories.