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

Function agentHeartbeatMutationBundle

internal/cli/authored_context.go:1040–1080  ·  view source on GitHub ↗
(record *AgentHeartbeatMutationRecord)

Source from the content-addressed store, hash-verified

1038}
1039
1040func agentHeartbeatMutationBundle(record *AgentHeartbeatMutationRecord) outputBundle {
1041 if record == nil {
1042 empty := AgentHeartbeatMutationRecord{}
1043 record = &empty
1044 }
1045 return outputBundle{
1046 jsonValue: record,
1047 human: func() (string, error) {
1048 revision := renderHumanSection("Heartbeat Revision", []keyValue{
1049 {Label: "ID", Value: stringOrDash(record.Revision.ID)},
1050 {Label: authoredContextOperationValue, Value: stringOrDash(string(record.Revision.Operation))},
1051 {Label: authoredContextPreviousDigestValue, Value: stringOrDash(record.Revision.PreviousDigest)},
1052 {Label: authoredContextNewDigestValue, Value: stringOrDash(record.Revision.NewDigest)},
1053 {Label: authoredContextSnapshotValue, Value: stringOrDash(record.Revision.NewSnapshotID)},
1054 {Label: authoredContextCreatedValue, Value: stringOrDash(formatTime(record.Revision.CreatedAt))},
1055 })
1056 heartbeat, err := agentHeartbeatBundle(&record.Heartbeat).human()
1057 if err != nil {
1058 return "", err
1059 }
1060 return renderHumanBlocks(heartbeat, revision), nil
1061 },
1062 toon: func() (string, error) {
1063 return renderToonObject("agent_heartbeat_revision", []string{
1064 "id",
1065 authoredContextOperationKey,
1066 authoredContextPreviousDigestKey,
1067 authoredContextNewDigestKey,
1068 "snapshot",
1069 automationCreatedAtKey,
1070 }, []string{
1071 record.Revision.ID,
1072 string(record.Revision.Operation),
1073 record.Revision.PreviousDigest,
1074 record.Revision.NewDigest,
1075 record.Revision.NewSnapshotID,
1076 formatTime(record.Revision.CreatedAt),
1077 }), nil
1078 },
1079 }
1080}
1081
1082func agentHeartbeatHistoryBundle(record AgentHeartbeatHistoryRecord) outputBundle {
1083 return listBundle(

Calls 6

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
formatTimeFunction · 0.85
agentHeartbeatBundleFunction · 0.85
renderHumanBlocksFunction · 0.85
renderToonObjectFunction · 0.85

Tested by

no test coverage detected