MCPcopy Create free account
hub / github.com/compozy/agh / memoryHistoryBundle

Function memoryHistoryBundle

internal/cli/memory.go:1659–1701  ·  view source on GitHub ↗
(records []MemoryHistoryRecord, now func() time.Time)

Source from the content-addressed store, hash-verified

1657}
1658
1659func memoryHistoryBundle(records []MemoryHistoryRecord, now func() time.Time) outputBundle {
1660 items := make([]memoryHistoryItem, 0, len(records))
1661 for _, record := range records {
1662 items = append(items, memoryHistoryItem{
1663 ID: record.ID,
1664 Operation: record.Operation,
1665 Scope: record.Scope,
1666 WorkspaceID: record.WorkspaceID,
1667 Filename: record.Filename,
1668 AgentName: record.AgentName,
1669 AgentTier: record.AgentTier,
1670 Summary: record.Summary,
1671 Age: formatAge(now, record.Timestamp),
1672 Timestamp: record.Timestamp,
1673 })
1674 }
1675 return listBundle(
1676 contract.MemoryOperationHistoryResponse{Operations: records},
1677 items,
1678 "Memory History",
1679 []string{"Time", memoryOperationValue, automationScopeValue, memoryFilenameValue, authoredContextSummaryValue},
1680 "operations",
1681 []string{networkTimestampKey, memoryOperationKey, automationScopeKey, memoryFilenameKey, memorySummaryKey},
1682 func(item memoryHistoryItem) []string {
1683 return []string{
1684 stringOrDash(formatTime(item.Timestamp)),
1685 stringOrDash(string(item.Operation)),
1686 stringOrDash(memoryScopeLabel(item.Scope, item.AgentTier)),
1687 stringOrDash(item.Filename),
1688 stringOrDash(item.Summary),
1689 }
1690 },
1691 func(item memoryHistoryItem) []string {
1692 return []string{
1693 formatTime(item.Timestamp),
1694 string(item.Operation),
1695 memoryScopeLabel(item.Scope, item.AgentTier),
1696 item.Filename,
1697 item.Summary,
1698 }
1699 },
1700 )
1701}
1702
1703func memoryMutationBundle(title string, response MemoryMutationRecord) outputBundle {
1704 return memoryDecisionBundle(title, response.Decision, response)

Callers 1

newMemoryHistoryCommandFunction · 0.85

Calls 6

appendFunction · 0.85
formatAgeFunction · 0.85
listBundleFunction · 0.85
stringOrDashFunction · 0.85
formatTimeFunction · 0.85
memoryScopeLabelFunction · 0.85

Tested by

no test coverage detected