(view MemoryHealthRecord)
| 1609 | } |
| 1610 | |
| 1611 | func memoryHealthBundle(view MemoryHealthRecord) outputBundle { |
| 1612 | return outputBundle{ |
| 1613 | jsonValue: view, |
| 1614 | jsonl: func(cmd *cobra.Command) error { |
| 1615 | return writeJSONLine(cmd, view) |
| 1616 | }, |
| 1617 | human: func() (string, error) { |
| 1618 | return renderHumanSection("Memory Health", []keyValue{ |
| 1619 | {Label: memoryStatusValue, Value: stringOrDash(view.Status)}, |
| 1620 | {Label: memoryReasonValue, Value: stringOrDash(view.Reason)}, |
| 1621 | {Label: memoryEnabledValue, Value: fmt.Sprintf("%t", view.Enabled)}, |
| 1622 | {Label: "Configured", Value: fmt.Sprintf("%t", view.Configured)}, |
| 1623 | {Label: "Global Dir", Value: stringOrDash(view.GlobalDir)}, |
| 1624 | {Label: "Global Files", Value: fmt.Sprintf("%d", view.GlobalFiles)}, |
| 1625 | {Label: "Workspace Files", Value: fmt.Sprintf("%d", view.WorkspaceFiles)}, |
| 1626 | {Label: "Workspace Count", Value: fmt.Sprintf("%d", view.WorkspaceCount)}, |
| 1627 | {Label: "Indexed Files", Value: fmt.Sprintf("%d", view.IndexedFiles)}, |
| 1628 | {Label: "Orphaned Files", Value: fmt.Sprintf("%d", view.OrphanedFiles)}, |
| 1629 | {Label: "Operation Count", Value: fmt.Sprintf("%d", view.OperationCount)}, |
| 1630 | {Label: "Last Operation", Value: stringOrDash(formatMemoryOptionalTime(view.LastOperationAt))}, |
| 1631 | {Label: "Dream Enabled", Value: fmt.Sprintf("%t", view.DreamEnabled)}, |
| 1632 | {Label: "Dream Agent", Value: stringOrDash(view.DreamAgent)}, |
| 1633 | }), nil |
| 1634 | }, |
| 1635 | toon: func() (string, error) { |
| 1636 | return renderToonObject( |
| 1637 | "memory_health", |
| 1638 | []string{ |
| 1639 | memoryStatusKey, |
| 1640 | memoryEnabledKey, |
| 1641 | "configured", |
| 1642 | "global_files", |
| 1643 | "workspace_files", |
| 1644 | "operation_count", |
| 1645 | }, |
| 1646 | []string{ |
| 1647 | view.Status, |
| 1648 | fmt.Sprintf("%t", view.Enabled), |
| 1649 | fmt.Sprintf("%t", view.Configured), |
| 1650 | fmt.Sprintf("%d", view.GlobalFiles), |
| 1651 | fmt.Sprintf("%d", view.WorkspaceFiles), |
| 1652 | fmt.Sprintf("%d", view.OperationCount), |
| 1653 | }, |
| 1654 | ), nil |
| 1655 | }, |
| 1656 | } |
| 1657 | } |
| 1658 | |
| 1659 | func memoryHistoryBundle(records []MemoryHistoryRecord, now func() time.Time) outputBundle { |
| 1660 | items := make([]memoryHistoryItem, 0, len(records)) |
no test coverage detected