| 4168 | } |
| 4169 | |
| 4170 | func taskRunDetailBundle(detail *TaskRunDetailRecord) outputBundle { |
| 4171 | return outputBundle{ |
| 4172 | jsonValue: detail, |
| 4173 | human: func() (string, error) { |
| 4174 | runBlock, err := taskRunBundle(detail.Run).human() |
| 4175 | if err != nil { |
| 4176 | return "", err |
| 4177 | } |
| 4178 | |
| 4179 | blocks := []string{ |
| 4180 | runBlock, |
| 4181 | renderHumanSection(taskTaskValue, []keyValue{ |
| 4182 | {Label: "ID", Value: stringOrDash(detail.Task.ID)}, |
| 4183 | {Label: taskIdentifierValue, Value: stringOrDash(detail.Task.Identifier)}, |
| 4184 | {Label: taskTitleValue, Value: stringOrDash(detail.Task.Title)}, |
| 4185 | {Label: taskStatusValue, Value: stringOrDash(string(detail.Task.Status))}, |
| 4186 | {Label: cliPriorityValue, Value: stringOrDash(string(detail.Task.Priority))}, |
| 4187 | { |
| 4188 | Label: taskOwnerValue, |
| 4189 | Value: stringOrDash(formatTaskOwnership(detail.Task.Owner)), |
| 4190 | }, |
| 4191 | {Label: taskScopeValue, Value: stringOrDash(string(detail.Task.Scope))}, |
| 4192 | {Label: taskWorkspaceValue, Value: stringOrDash(detail.Task.WorkspaceID)}, |
| 4193 | {Label: "Latest Event", Value: int64OrDash(detail.Task.LatestEventSeq)}, |
| 4194 | }), |
| 4195 | } |
| 4196 | |
| 4197 | if detail.Session != nil { |
| 4198 | blocks = append(blocks, renderHumanSection(taskSessionValue, []keyValue{ |
| 4199 | {Label: "ID", Value: stringOrDash(detail.Session.SessionID)}, |
| 4200 | {Label: taskWorkspaceValue, Value: stringOrDash(detail.Session.WorkspaceID)}, |
| 4201 | {Label: bundleAgentValue, Value: stringOrDash(detail.Session.AgentName)}, |
| 4202 | {Label: providerNameValue, Value: stringOrDash(detail.Session.Name)}, |
| 4203 | {Label: taskChannelValue, Value: stringOrDash(detail.Session.Channel)}, |
| 4204 | {Label: taskStatusValue, Value: stringOrDash(detail.Session.State)}, |
| 4205 | { |
| 4206 | Label: taskCreatedValue, |
| 4207 | Value: stringOrDash(formatTime(detail.Session.CreatedAt)), |
| 4208 | }, |
| 4209 | { |
| 4210 | Label: taskUpdatedValue, |
| 4211 | Value: stringOrDash(formatTime(detail.Session.UpdatedAt)), |
| 4212 | }, |
| 4213 | })) |
| 4214 | } |
| 4215 | |
| 4216 | blocks = append( |
| 4217 | blocks, |
| 4218 | renderHumanSection( |
| 4219 | "Operational Summary", |
| 4220 | taskRunOperationalSummaryRows(detail.Summary), |
| 4221 | ), |
| 4222 | ) |
| 4223 | return renderHumanBlocks(blocks...), nil |
| 4224 | }, |
| 4225 | toon: func() (string, error) { |
| 4226 | return renderToonObject("task_run_detail", []string{ |
| 4227 | "id", |