| 4093 | } |
| 4094 | |
| 4095 | func taskRunBundle(item TaskRunRecord) outputBundle { |
| 4096 | return outputBundle{ |
| 4097 | jsonValue: item, |
| 4098 | human: func() (string, error) { |
| 4099 | return renderHumanSection("Task Run", []keyValue{ |
| 4100 | {Label: "ID", Value: stringOrDash(item.ID)}, |
| 4101 | {Label: taskTaskValue, Value: stringOrDash(item.TaskID)}, |
| 4102 | {Label: taskStatusValue, Value: stringOrDash(string(item.Status))}, |
| 4103 | {Label: taskAttemptValue, Value: intOrDash(item.Attempt)}, |
| 4104 | {Label: "Previous Run", Value: stringOrDash(item.PreviousRunID)}, |
| 4105 | {Label: "Failure Kind", Value: stringOrDash(item.FailureKind)}, |
| 4106 | { |
| 4107 | Label: taskClaimedByValue, |
| 4108 | Value: stringOrDash(formatTaskActorPtr(item.ClaimedBy)), |
| 4109 | }, |
| 4110 | {Label: taskSessionValue, Value: stringOrDash(item.SessionID)}, |
| 4111 | {Label: taskOriginValue, Value: stringOrDash(formatTaskOrigin(item.Origin))}, |
| 4112 | {Label: "Idempotency Key", Value: stringOrDash(item.IdempotencyKey)}, |
| 4113 | {Label: taskChannelValue, Value: stringOrDash(item.NetworkChannel)}, |
| 4114 | { |
| 4115 | Label: taskCoordinationChannelValue, |
| 4116 | Value: stringOrDash(item.CoordinationChannelID), |
| 4117 | }, |
| 4118 | {Label: taskQueuedValue, Value: stringOrDash(formatTime(item.QueuedAt))}, |
| 4119 | {Label: "Claimed", Value: stringOrDash(formatTimePtr(item.ClaimedAt))}, |
| 4120 | {Label: taskStartedValue, Value: stringOrDash(formatTimePtr(item.StartedAt))}, |
| 4121 | {Label: taskEndedValue, Value: stringOrDash(formatTimePtr(item.EndedAt))}, |
| 4122 | {Label: taskErrorValue, Value: stringOrDash(item.Error)}, |
| 4123 | {Label: taskResultValue, Value: stringOrDash(compactJSON(item.Result))}, |
| 4124 | }), nil |
| 4125 | }, |
| 4126 | toon: func() (string, error) { |
| 4127 | return renderToonObject("task_run", []string{ |
| 4128 | "id", |
| 4129 | taskTaskIDKey, |
| 4130 | taskStatusKey, |
| 4131 | taskAttemptKey, |
| 4132 | "previous_run_id", |
| 4133 | taskFailureKindKey, |
| 4134 | taskClaimedByKey, |
| 4135 | taskSessionIDKey, |
| 4136 | taskOriginKey, |
| 4137 | "idempotency_key", |
| 4138 | taskNetworkChannelKey, |
| 4139 | taskCoordinationChannelIDKey, |
| 4140 | taskQueuedAtKey, |
| 4141 | "claimed_at", |
| 4142 | taskStartedAtKey, |
| 4143 | taskEndedAtKey, |
| 4144 | taskErrorKey, |
| 4145 | "result", |
| 4146 | }, []string{ |
| 4147 | item.ID, |
| 4148 | item.TaskID, |
| 4149 | string(item.Status), |
| 4150 | strconv.Itoa(item.Attempt), |
| 4151 | item.PreviousRunID, |
| 4152 | item.FailureKind, |