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

Function printProfileTimeline

cli/memory_command.go:825–846  ·  view source on GitHub ↗

printProfileTimeline renders stances and the milestone timeline.

(profile memory.UserProfile)

Source from the content-addressed store, hash-verified

823
824// printProfileTimeline renders stances and the milestone timeline.
825func printProfileTimeline(profile memory.UserProfile) {
826 if len(profile.Stances) > 0 {
827 fmt.Printf("\n %s\n", colorize(i18n.T("mem.cmd.profile.stances"), ColorYellow))
828 for _, s := range profile.Stances {
829 line := s.Position
830 if s.Reason != "" {
831 line += " — " + s.Reason
832 }
833 fmt.Printf(" %s\n", line)
834 }
835 }
836 if len(profile.Milestones) > 0 {
837 fmt.Printf("\n %s\n", colorize(i18n.T("mem.cmd.profile.milestones"), ColorYellow))
838 ms := profile.Milestones
839 if len(ms) > 10 {
840 ms = ms[len(ms)-10:]
841 }
842 for _, m := range ms {
843 fmt.Printf(" [%s] %s\n", m.Date.Format("2006-01-02"), m.Text)
844 }
845 }
846}
847
848// sortedStringKeys returns map keys in stable order for deterministic output.
849func sortedStringKeys(m map[string]string) []string {

Callers 1

showMemoryProfileMethod · 0.85

Calls 2

TFunction · 0.92
colorizeFunction · 0.85

Tested by

no test coverage detected