fix(mail): Align gt mail send --priority with bd mail send (gt-kspu)

Changed --priority flag from string values (low/normal/high/urgent) to
numeric values (0-4) to match bd mail send interface:
- 0 = urgent/critical
- 1 = high
- 2 = normal (default)
- 3 = low
- 4 = backlog

Also added --urgent flag as shortcut for --priority 0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-20 07:59:02 -08:00
parent 481138a72b
commit bae097cb35
3 changed files with 111 additions and 74 deletions

View File

@@ -219,6 +219,24 @@ func ParsePriority(s string) Priority {
}
}
// PriorityFromInt converts a beads-style integer priority to a Priority.
// Accepts: 0=urgent, 1=high, 2=normal, 3=low, 4=backlog (treated as low).
// Invalid values default to PriorityNormal.
func PriorityFromInt(p int) Priority {
switch p {
case 0:
return PriorityUrgent
case 1:
return PriorityHigh
case 2:
return PriorityNormal
case 3, 4:
return PriorityLow
default:
return PriorityNormal
}
}
// ParseMessageType parses a message type string, returning TypeNotification for invalid values.
func ParseMessageType(s string) MessageType {
switch MessageType(s) {