feat: add portfolio

This commit is contained in:
ytshih committed 2026-09-11 09:54:49 +08:00
1 parent ba63c5deb0
commit f09cf4d5c2
11 files changed
+669 -38

No files matched your search

+6
View File
@@ -50,6 +50,10 @@ func Save(cfg config.ArchiveConfig, run Run, now time.Time) (string, error) {
if err != nil {
return "", fmt.Errorf("archive: marshal recommendations: %w", err)
}
portfolioJSON, err := json.MarshalIndent(run.Report.Portfolio, "", " ")
if err != nil {
return "", fmt.Errorf("archive: marshal portfolio snapshot: %w", err)
}
files := map[string][]byte{
"fetched.json": fetchedJSON,
@@ -57,6 +61,8 @@ func Save(cfg config.ArchiveConfig, run Run, now time.Time) (string, error) {
"analysis_raw.md": []byte(run.RawResponse),
"report.md": []byte(run.Report.Text),
"recommendations.json": recsJSON,
"portfolio.json": portfolioJSON,
"memory.md": []byte(run.Report.Memory),
}
for name, data := range files {
if err := os.WriteFile(filepath.Join(dir, name), data, 0o644); err != nil {