(record AgentHeartbeatStatusRecord)
| 1125 | } |
| 1126 | |
| 1127 | func 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 | |
| 1175 | func agentHeartbeatWakeBundle(record AgentHeartbeatWakeDecisionRecord) outputBundle { |
| 1176 | return outputBundle{ |
no test coverage detected