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

Function sessionStatusBundle

internal/cli/authored_context.go:1231–1272  ·  view source on GitHub ↗
(record SessionStatusRecord)

Source from the content-addressed store, hash-verified

1229}
1230
1231func 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
1274func sessionInspectBundle(record SessionInspectRecord) outputBundle {
1275 return outputBundle{

Callers 1

newSessionStatusCommandFunction · 0.85

Calls 7

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
formatTimeFunction · 0.85
renderHumanBlocksFunction · 0.85
wakeStateSectionFunction · 0.85
renderToonObjectFunction · 0.85
boolStringFunction · 0.70

Tested by

no test coverage detected