feat(polecat): Add gt polecat status command (gt-6lt3)
Implements detailed polecat status display including: - Lifecycle state (working, done, stuck, idle) - Assigned issue - Session status (running/stopped, attached/detached) - Session creation time - Last activity time with relative "ago" format Also extends tmux.SessionInfo and session.Info to include last activity timestamp from tmux session_activity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,9 @@ type Info struct {
|
||||
|
||||
// Windows is the number of tmux windows.
|
||||
Windows int `json:"windows,omitempty"`
|
||||
|
||||
// LastActivity is when the session last had activity.
|
||||
LastActivity time.Time `json:"last_activity,omitempty"`
|
||||
}
|
||||
|
||||
// sessionName generates the tmux session name for a polecat.
|
||||
@@ -254,6 +257,14 @@ func (m *Manager) Status(polecat string) (*Info, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Parse activity time (unix timestamp from tmux)
|
||||
if tmuxInfo.Activity != "" {
|
||||
var activityUnix int64
|
||||
if _, err := fmt.Sscanf(tmuxInfo.Activity, "%d", &activityUnix); err == nil && activityUnix > 0 {
|
||||
info.LastActivity = time.Unix(activityUnix, 0)
|
||||
}
|
||||
}
|
||||
|
||||
return info, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user