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

Function flattenHistory

internal/cli/session.go:1330–1341  ·  view source on GitHub ↗
(history []TurnHistoryRecord)

Source from the content-addressed store, hash-verified

1328}
1329
1330func flattenHistory(history []TurnHistoryRecord) []SessionEventRecord {
1331 flattened := make([]SessionEventRecord, 0)
1332 for _, turn := range history {
1333 for _, event := range turn.Events {
1334 if strings.TrimSpace(event.TurnID) == "" {
1335 event.TurnID = turn.TurnID
1336 }
1337 flattened = append(flattened, event)
1338 }
1339 }
1340 return flattened
1341}
1342
1343func parseSinceFlag(raw string, now func() time.Time) (time.Time, error) {
1344 value := strings.TrimSpace(raw)

Callers 1

sessionHistoryBundleFunction · 0.85

Calls 1

appendFunction · 0.85

Tested by

no test coverage detected