fix(agent-task/shared): add SessionSymbol func

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-09-05 17:02:45 +01:00
parent 09e1f2532d
commit e68e28ddf3
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -46,3 +46,17 @@ func SessionStateString(state string) string {
return state
}
}
type ColorFunc func(string) string
func SessionSymbol(cs *iostreams.ColorScheme, state string) string {
noColor := func(s string) string { return s }
switch state {
case "completed":
return cs.SuccessIconWithColor(noColor)
case "failed", "timed_out", "cancelled":
return cs.FailureIconWithColor(noColor)
default:
return "-"
}
}