feat(mail): extend message bead for queues/channels

Add queue/channel routing fields to message beads:
- queue: string (queue name, mutually exclusive with to/channel)
- channel: string (channel name, mutually exclusive with to/queue)
- claimed_by: string (who claimed queue message)
- claimed_at: timestamp (when claimed)

Messages can now be direct (To), queued (Queue), or broadcast (Channel).
Added constructors NewQueueMessage/NewChannelMessage, type helpers
IsQueueMessage/IsChannelMessage/IsDirectMessage/IsClaimed, and
Validate() for mutual exclusivity checks.

Also fixes build error in mail_queue.go (QueueConfig struct nil comparison).

Closes gt-xfqh1e.4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/jack
2026-01-14 21:14:36 -08:00
committed by Steve Yegge
parent a244c3d498
commit 8eafcc8a16
3 changed files with 530 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ func runMailClaim(cmd *cobra.Command, args []string) error {
}
queueCfg, ok := cfg.Queues[queueName]
if !ok || queueCfg == nil {
if !ok {
return fmt.Errorf("unknown queue: %s", queueName)
}