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

Function agentHeartbeatStatusBundle

internal/cli/authored_context.go:1127–1173  ·  view source on GitHub ↗
(record AgentHeartbeatStatusRecord)

Source from the content-addressed store, hash-verified

1125}
1126
1127func agentHeartbeatStatusBundle(record AgentHeartbeatStatusRecord) outputBundle {
1128 return outputBundle{
1129 jsonValue: record,
1130 human: func() (string, error) {
1131 summary := renderHumanSection("Heartbeat Status", []keyValue{
1132 {Label: authoredContextAgentValue, Value: stringOrDash(record.AgentName)},
1133 {Label: authoredContextEnabledValue, Value: boolString(record.Enabled)},
1134 {Label: authoredContextPresentValue, Value: boolString(record.Present)},
1135 {Label: authoredContextActiveValue, Value: boolString(record.Active)},
1136 {Label: authoredContextValidValue, Value: boolString(record.Valid)},
1137 {Label: authoredContextDigestValue, Value: stringOrDash(record.Digest)},
1138 {Label: authoredContextConfigDigestValue, Value: stringOrDash(record.ConfigDigest)},
1139 {Label: authoredContextSummaryValue, Value: stringOrDash(record.Summary)},
1140 })
1141 blocks := []string{summary, diagnosticsTable(record.Diagnostics)}
1142 if record.WakeState != nil {
1143 blocks = append(blocks, wakeStateSection("Wake State", *record.WakeState))
1144 }
1145 if record.SessionHealth != nil {
1146 blocks = append(blocks, sessionHealthSection("Session Health", *record.SessionHealth))
1147 }
1148 if len(record.WakeEvents) > 0 {
1149 blocks = append(blocks, wakeEventsTable(record.WakeEvents))
1150 }
1151 return renderHumanBlocks(blocks...), nil
1152 },
1153 toon: func() (string, error) {
1154 return renderToonObject("agent_heartbeat_status", []string{
1155 agentAgentKey,
1156 automationEnabledKey,
1157 providerAuthStatePresent,
1158 authoredContextActiveKey,
1159 configValidKey,
1160 authoredContextDigestKey,
1161 authoredContextConfigDigestKey,
1162 }, []string{
1163 record.AgentName,
1164 boolString(record.Enabled),
1165 boolString(record.Present),
1166 boolString(record.Active),
1167 boolString(record.Valid),
1168 record.Digest,
1169 record.ConfigDigest,
1170 }), nil
1171 },
1172 }
1173}
1174
1175func agentHeartbeatWakeBundle(record AgentHeartbeatWakeDecisionRecord) outputBundle {
1176 return outputBundle{

Callers 1

Calls 10

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
diagnosticsTableFunction · 0.85
appendFunction · 0.85
wakeStateSectionFunction · 0.85
sessionHealthSectionFunction · 0.85
wakeEventsTableFunction · 0.85
renderHumanBlocksFunction · 0.85
renderToonObjectFunction · 0.85
boolStringFunction · 0.70

Tested by

no test coverage detected