(record *AgentHeartbeatRecord)
| 991 | } |
| 992 | |
| 993 | func agentHeartbeatBundle(record *AgentHeartbeatRecord) outputBundle { |
| 994 | if record == nil { |
| 995 | empty := AgentHeartbeatRecord{} |
| 996 | record = &empty |
| 997 | } |
| 998 | return outputBundle{ |
| 999 | jsonValue: record, |
| 1000 | human: func() (string, error) { |
| 1001 | summary := renderHumanSection("Agent Heartbeat", []keyValue{ |
| 1002 | {Label: authoredContextAgentValue, Value: stringOrDash(record.AgentName)}, |
| 1003 | {Label: authoredContextEnabledValue, Value: boolString(record.Enabled)}, |
| 1004 | {Label: authoredContextPresentValue, Value: boolString(record.Present)}, |
| 1005 | {Label: authoredContextActiveValue, Value: boolString(record.Active)}, |
| 1006 | {Label: authoredContextValidValue, Value: boolString(record.Valid)}, |
| 1007 | {Label: "Validation", Value: stringOrDash(string(record.ValidationStatus))}, |
| 1008 | {Label: authoredContextDigestValue, Value: stringOrDash(record.Digest)}, |
| 1009 | {Label: authoredContextConfigDigestValue, Value: stringOrDash(record.ConfigDigest)}, |
| 1010 | {Label: authoredContextSnapshotValue, Value: stringOrDash(record.SnapshotID)}, |
| 1011 | {Label: authoredContextSourceValue, Value: stringOrDash(record.SourcePath)}, |
| 1012 | {Label: authoredContextSummaryValue, Value: stringOrDash(record.Summary)}, |
| 1013 | }) |
| 1014 | return renderHumanBlocks(summary, diagnosticsTable(record.Diagnostics)), nil |
| 1015 | }, |
| 1016 | toon: func() (string, error) { |
| 1017 | return renderToonObject("agent_heartbeat", []string{ |
| 1018 | agentAgentKey, |
| 1019 | automationEnabledKey, |
| 1020 | providerAuthStatePresent, |
| 1021 | authoredContextActiveKey, |
| 1022 | configValidKey, |
| 1023 | "validation_status", |
| 1024 | authoredContextDigestKey, |
| 1025 | authoredContextConfigDigestKey, |
| 1026 | }, []string{ |
| 1027 | record.AgentName, |
| 1028 | boolString(record.Enabled), |
| 1029 | boolString(record.Present), |
| 1030 | boolString(record.Active), |
| 1031 | boolString(record.Valid), |
| 1032 | string(record.ValidationStatus), |
| 1033 | record.Digest, |
| 1034 | record.ConfigDigest, |
| 1035 | }), nil |
| 1036 | }, |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | func agentHeartbeatMutationBundle(record *AgentHeartbeatMutationRecord) outputBundle { |
| 1041 | if record == nil { |
no test coverage detected