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

Function sessionInspectBundle

internal/cli/authored_context.go:1274–1305  ·  view source on GitHub ↗
(record SessionInspectRecord)

Source from the content-addressed store, hash-verified

1272}
1273
1274func sessionInspectBundle(record SessionInspectRecord) outputBundle {
1275 return outputBundle{
1276 jsonValue: record,
1277 human: func() (string, error) {
1278 blocks := []string{
1279 sessionHealthSection("Session Health", record.Health),
1280 renderHumanSection("Policy Correlation", []keyValue{
1281 {Label: "Policy Digest", Value: stringOrDash(record.PolicyDigest)},
1282 {Label: authoredContextConfigDigestValue, Value: stringOrDash(record.ConfigDigest)},
1283 }),
1284 diagnosticsTable(record.Diagnostics),
1285 }
1286 if record.WakeState != nil {
1287 blocks = append(blocks, wakeStateSection("Wake State", *record.WakeState))
1288 }
1289 if len(record.WakeEvents) > 0 {
1290 blocks = append(blocks, wakeEventsTable(record.WakeEvents))
1291 }
1292 return renderHumanBlocks(blocks...), nil
1293 },
1294 toon: func() (string, error) {
1295 return renderToonObject("session_inspect", []string{
1296 sessionSessionKey, "policy_digest", authoredContextConfigDigestKey, "wake_events",
1297 }, []string{
1298 record.SessionID,
1299 record.PolicyDigest,
1300 record.ConfigDigest,
1301 strconv.Itoa(len(record.WakeEvents)),
1302 }), nil
1303 },
1304 }
1305}
1306
1307func sessionHealthSection(title string, record SessionHealthRecord) string {
1308 return renderHumanSection(title, []keyValue{

Callers 1

newSessionInspectCommandFunction · 0.85

Calls 9

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

Tested by

no test coverage detected