feat: add portfolio
This commit is contained in:
11 files changed
+669
-38
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user