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

Function renderTaskInspectHuman

internal/cli/task.go:3754–3812  ·  view source on GitHub ↗
(record *TaskInspectRecord)

Source from the content-addressed store, hash-verified

3752}
3753
3754func renderTaskInspectHuman(record *TaskInspectRecord) (string, error) {
3755 blocks := []string{
3756 renderHumanSection("Task Inspect", []keyValue{
3757 {Label: "Target", Value: stringOrDash(record.Target)},
3758 {Label: taskTaskValue, Value: stringOrDash(record.Task.ID)},
3759 {Label: taskTitleValue, Value: stringOrDash(record.Task.Title)},
3760 {Label: taskStatusValue, Value: stringOrDash(string(record.Task.Status))},
3761 {Label: "Current Run", Value: stringOrDash(taskInspectCurrentRunID(record.CurrentRun))},
3762 {Label: cliNextActionValue, Value: stringOrDash(record.NextAction)},
3763 {Label: "As Of", Value: stringOrDash(formatTime(record.AsOf))},
3764 }),
3765 }
3766 if record.CurrentRun != nil {
3767 blocks = append(
3768 blocks,
3769 renderHumanSection("Current Run", taskInspectRunSectionRows(record.CurrentRun)),
3770 )
3771 }
3772 if record.BoundSession != nil {
3773 blocks = append(
3774 blocks,
3775 renderHumanSection("Bound Session", taskInspectSessionRows(record.BoundSession)),
3776 )
3777 }
3778 blocks = append(
3779 blocks,
3780 renderHumanTable(
3781 "Diagnostics",
3782 []string{cliCodeValue, cliSeverityValue, "Message", cliCommandValue},
3783 taskInspectDiagnosticRows(record.Diagnostics),
3784 ),
3785 renderHumanTable(
3786 "Recent Runs",
3787 []string{
3788 taskRunValue,
3789 taskStatusValue,
3790 taskAttemptValue,
3791 taskSessionValue,
3792 cliHashValue,
3793 "Heartbeat Age",
3794 taskErrorValue,
3795 },
3796 taskInspectRunRows(record.RecentRuns),
3797 ),
3798 renderHumanTable(
3799 "Recent Events",
3800 []string{
3801 "ID",
3802 taskTypeValue,
3803 taskRunValue,
3804 taskOutcomeValue,
3805 authoredContextSummaryValue,
3806 taskTimeValue,
3807 },
3808 taskInspectEventRows(record.RecentEvents),
3809 ),
3810 )
3811 return renderHumanBlocks(blocks...), nil

Callers 1

taskInspectBundleFunction · 0.85

Calls 12

renderHumanSectionFunction · 0.85
stringOrDashFunction · 0.85
taskInspectCurrentRunIDFunction · 0.85
formatTimeFunction · 0.85
appendFunction · 0.85
taskInspectSessionRowsFunction · 0.85
renderHumanTableFunction · 0.85
taskInspectRunRowsFunction · 0.85
taskInspectEventRowsFunction · 0.85
renderHumanBlocksFunction · 0.85

Tested by

no test coverage detected