MCPcopy Create free account
hub / github.com/diillson/chatcli / formatMemoryNotice

Function formatMemoryNotice

cli/memory_notice.go:51–69  ·  view source on GitHub ↗

formatMemoryNotice renders an ExtractionSummary as a compact one-liner, e.g. "memory: +2 facts, profile updated, +1 project". Returns "" when nothing user-visible was persisted (a lone daily-note write is noise).

(s memory.ExtractionSummary)

Source from the content-addressed store, hash-verified

49// e.g. "memory: +2 facts, profile updated, +1 project". Returns "" when
50// nothing user-visible was persisted (a lone daily-note write is noise).
51func formatMemoryNotice(s memory.ExtractionSummary) string {
52 var parts []string
53 if s.FactsAdded > 0 {
54 parts = append(parts, i18n.T("mem.notice.facts", s.FactsAdded))
55 }
56 if s.ProfileUpdated {
57 parts = append(parts, i18n.T("mem.notice.profile"))
58 }
59 if s.ProjectsUpserted > 0 {
60 parts = append(parts, i18n.T("mem.notice.projects", s.ProjectsUpserted))
61 }
62 if s.TopicsRecorded > 0 {
63 parts = append(parts, i18n.T("mem.notice.topics", s.TopicsRecorded))
64 }
65 if len(parts) == 0 {
66 return ""
67 }
68 return i18n.T("mem.notice.prefix") + " " + strings.Join(parts, ", ")
69}

Callers 2

TestFormatMemoryNoticeFunction · 0.85
extractAndSaveMethod · 0.85

Calls 1

TFunction · 0.92

Tested by 1

TestFormatMemoryNoticeFunction · 0.68