(info SessionRecord, now func() time.Time)
| 759 | } |
| 760 | |
| 761 | func 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 | |
| 790 | func appendSessionSandboxBlock(blocks []string, info SessionRecord) []string { |
| 791 | if info.Sandbox == nil { |
no test coverage detected