(record SessionStatusRecord)
| 1229 | } |
| 1230 | |
| 1231 | func sessionStatusBundle(record SessionStatusRecord) outputBundle { |
| 1232 | return outputBundle{ |
| 1233 | jsonValue: record, |
| 1234 | human: func() (string, error) { |
| 1235 | status := renderHumanSection("Session Status", []keyValue{ |
| 1236 | {Label: authoredContextSessionValue, Value: stringOrDash(record.SessionID)}, |
| 1237 | {Label: authoredContextWorkspaceValue, Value: stringOrDash(record.WorkspaceID)}, |
| 1238 | {Label: authoredContextAgentValue, Value: stringOrDash(record.AgentName)}, |
| 1239 | {Label: authoredContextStateValue, Value: stringOrDash(string(record.State))}, |
| 1240 | {Label: authoredContextHealthValue, Value: stringOrDash(string(record.Health))}, |
| 1241 | {Label: "Active Prompt", Value: boolString(record.ActivePrompt)}, |
| 1242 | {Label: "Attachable", Value: boolString(record.Attachable)}, |
| 1243 | {Label: "Eligible For Wake", Value: boolString(record.EligibleForWake)}, |
| 1244 | {Label: "Ineligibility Reason", Value: stringOrDash(string(record.IneligibilityReason))}, |
| 1245 | {Label: authoredContextUpdatedValue, Value: stringOrDash(formatTime(record.UpdatedAt))}, |
| 1246 | }) |
| 1247 | if record.WakeState == nil { |
| 1248 | return status, nil |
| 1249 | } |
| 1250 | return renderHumanBlocks(status, wakeStateSection("Wake State", *record.WakeState)), nil |
| 1251 | }, |
| 1252 | toon: func() (string, error) { |
| 1253 | return renderToonObject("session_status", []string{ |
| 1254 | sessionSessionKey, |
| 1255 | workspaceSkillSource, |
| 1256 | agentAgentKey, |
| 1257 | networkStateKey, |
| 1258 | authoredContextHealthKey, |
| 1259 | "eligible_for_wake", |
| 1260 | memoryReasonKey, |
| 1261 | }, []string{ |
| 1262 | record.SessionID, |
| 1263 | record.WorkspaceID, |
| 1264 | record.AgentName, |
| 1265 | string(record.State), |
| 1266 | string(record.Health), |
| 1267 | boolString(record.EligibleForWake), |
| 1268 | string(record.IneligibilityReason), |
| 1269 | }), nil |
| 1270 | }, |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | func sessionInspectBundle(record SessionInspectRecord) outputBundle { |
| 1275 | return outputBundle{ |
no test coverage detected