(date time.Time)
| 98 | } |
| 99 | |
| 100 | func (cli *ChatCLI) showDayNotes(date time.Time) { |
| 101 | dateStr := date.Format("2006-01-02") |
| 102 | dir := filepath.Dir(cli.memoryStore.TodayNotePath()) |
| 103 | memDir := filepath.Dir(dir) // go up from YYYYMM to memory/ |
| 104 | path := filepath.Join(memDir, date.Format("200601"), date.Format("20060102")+".md") |
| 105 | |
| 106 | data, err := os.ReadFile(path) //#nosec G304 -- path supplied by user/agent through validated tool surface (boundary check upstream) |
| 107 | if err != nil { |
| 108 | fmt.Printf(" %s %s\n", colorize(i18n.T("memory.no_notes_for"), ColorGray), colorize(dateStr, ColorCyan)) |
| 109 | return |
| 110 | } |
| 111 | |
| 112 | content := strings.TrimSpace(string(data)) |
| 113 | if content == "" { |
| 114 | fmt.Printf(" %s %s\n", colorize(i18n.T("memory.no_notes_for"), ColorGray), colorize(dateStr, ColorCyan)) |
| 115 | return |
| 116 | } |
| 117 | |
| 118 | fmt.Println() |
| 119 | fmt.Printf(" %s %s\n", colorize(i18n.T("memory.notes_for"), ColorCyan+ColorBold), colorize(dateStr, ColorYellow)) |
| 120 | fmt.Println(colorize(" ─────────────────────────────────────────", ColorGray)) |
| 121 | for _, line := range strings.Split(content, "\n") { |
| 122 | fmt.Printf(" %s\n", line) |
| 123 | } |
| 124 | fmt.Println() |
| 125 | } |
| 126 | |
| 127 | func (cli *ChatCLI) showWeekNotes() { |
| 128 | notes := cli.memoryStore.GetRecentDailyNotes(7) |
no test coverage detected