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

Function renderSessionHuman

internal/cli/session.go:761–788  ·  view source on GitHub ↗
(info SessionRecord, now func() time.Time)

Source from the content-addressed store, hash-verified

759}
760
761func renderSessionHuman(info SessionRecord, now func() time.Time) (string, error) {
762 base := renderHumanSection(sessionSessionValue, []keyValue{
763 {Label: "ID", Value: stringOrDash(info.ID)},
764 {Label: sessionNameValue, Value: stringOrDash(info.Name)},
765 {Label: sessionAgentValue, Value: stringOrDash(info.AgentName)},
766 {Label: sessionProviderValue, Value: stringOrDash(info.Provider)},
767 {Label: sessionWorkspaceValue, Value: stringOrDash(displaySessionWorkspace(info))},
768 {Label: sessionChannelValue, Value: stringOrDash(info.Channel)},
769 {Label: sessionStateValue, Value: stringOrDash(string(info.State))},
770 {Label: sessionBadgeValue, Value: stringOrDash(string(info.Badge))},
771 {Label: "Attached To", Value: stringOrDash(info.AttachedTo)},
772 {Label: "Attach Expires", Value: stringOrDash(formatTimePtr(info.AttachExpiresAt))},
773 {Label: "Stop Reason", Value: stringOrDash(string(info.StopReason))},
774 {Label: "Stop Detail", Value: stringOrDash(info.StopDetail)},
775 {Label: "Failure Kind", Value: stringOrDash(sessionFailureKind(info))},
776 {Label: "Failure Summary", Value: stringOrDash(sessionFailureSummary(info))},
777 {Label: "Crash Bundle", Value: stringOrDash(sessionCrashBundlePath(info))},
778 {Label: "ACP Session", Value: stringOrDash(info.ACPSessionID)},
779 {Label: sessionCreatedValue, Value: stringOrDash(formatTime(info.CreatedAt))},
780 {Label: sessionUpdatedValue, Value: stringOrDash(formatTime(info.UpdatedAt))},
781 {Label: "Age", Value: stringOrDash(formatAge(now, info.CreatedAt))},
782 })
783
784 blocks := []string{base}
785 blocks = appendSessionSandboxBlock(blocks, info)
786 blocks = appendSessionCapsBlock(blocks, info)
787 return renderHumanBlocks(blocks...), nil
788}
789
790func appendSessionSandboxBlock(blocks []string, info SessionRecord) []string {
791 if info.Sandbox == nil {

Callers 1

sessionBundleFunction · 0.85

Calls 12

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
displaySessionWorkspaceFunction · 0.85
formatTimePtrFunction · 0.85
formatTimeFunction · 0.85
formatAgeFunction · 0.85
appendSessionCapsBlockFunction · 0.85
renderHumanBlocksFunction · 0.85
sessionFailureKindFunction · 0.70
sessionFailureSummaryFunction · 0.70
sessionCrashBundlePathFunction · 0.70

Tested by

no test coverage detected