feat: simplify mail wisps - single DB with --wisp flag (gt-fgms)
Removed dual-routing architecture that used separate .beads-wisp/ directory. Now uses single .beads/ with --wisp flag passed to bd create. Changes: - router.go: Remove resolveWispDir(), simplify shouldBeWisp() - mailbox.go: Remove wispDir field and dual-source query logic - types.go: Rename Ephemeral to Wisp, remove MessageSource - mail.go: Rename --ephemeral to --wisp flag - spawn.go: Use Wisp field for lifecycle messages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ var (
|
||||
mailPriority int
|
||||
mailUrgent bool
|
||||
mailPinned bool
|
||||
mailEphemeral bool
|
||||
mailWisp bool
|
||||
mailType string
|
||||
mailReplyTo string
|
||||
mailNotify bool
|
||||
@@ -236,7 +236,7 @@ func init() {
|
||||
mailSendCmd.Flags().StringVar(&mailReplyTo, "reply-to", "", "Message ID this is replying to")
|
||||
mailSendCmd.Flags().BoolVarP(&mailNotify, "notify", "n", false, "Send tmux notification to recipient")
|
||||
mailSendCmd.Flags().BoolVar(&mailPinned, "pinned", false, "Pin message (for handoff context that persists)")
|
||||
mailSendCmd.Flags().BoolVar(&mailEphemeral, "ephemeral", false, "Send as ephemeral wisp (auto-cleanup on patrol squash)")
|
||||
mailSendCmd.Flags().BoolVar(&mailWisp, "wisp", false, "Send as wisp (ephemeral, auto-cleanup on patrol squash)")
|
||||
mailSendCmd.Flags().BoolVar(&mailSendSelf, "self", false, "Send to self (auto-detect from cwd)")
|
||||
_ = mailSendCmd.MarkFlagRequired("subject")
|
||||
|
||||
@@ -334,8 +334,8 @@ func runMailSend(cmd *cobra.Command, args []string) error {
|
||||
// Set pinned flag
|
||||
msg.Pinned = mailPinned
|
||||
|
||||
// Set ephemeral flag
|
||||
msg.Ephemeral = mailEphemeral
|
||||
// Set wisp flag (ephemeral message)
|
||||
msg.Wisp = mailWisp
|
||||
|
||||
// Handle reply-to: auto-set type to reply and look up thread
|
||||
if mailReplyTo != "" {
|
||||
@@ -439,12 +439,12 @@ func runMailInbox(cmd *cobra.Command, args []string) error {
|
||||
if msg.Priority == mail.PriorityHigh || msg.Priority == mail.PriorityUrgent {
|
||||
priorityMarker = " " + style.Bold.Render("!")
|
||||
}
|
||||
ephemeralMarker := ""
|
||||
if msg.Ephemeral || msg.Source == mail.SourceWisp {
|
||||
ephemeralMarker = " " + style.Dim.Render("(ephemeral)")
|
||||
wispMarker := ""
|
||||
if msg.Wisp {
|
||||
wispMarker = " " + style.Dim.Render("(wisp)")
|
||||
}
|
||||
|
||||
fmt.Printf(" %s %s%s%s%s\n", readMarker, msg.Subject, typeMarker, priorityMarker, ephemeralMarker)
|
||||
fmt.Printf(" %s %s%s%s%s\n", readMarker, msg.Subject, typeMarker, priorityMarker, wispMarker)
|
||||
fmt.Printf(" %s from %s\n",
|
||||
style.Dim.Render(msg.ID),
|
||||
msg.From)
|
||||
|
||||
@@ -398,11 +398,11 @@ func runSpawn(cmd *cobra.Command, args []string) error {
|
||||
// Notify Witness with POLECAT_STARTED message (ephemeral - lifecycle ping)
|
||||
witnessAddr := fmt.Sprintf("%s/witness", rigName)
|
||||
witnessNotification := &mail.Message{
|
||||
To: witnessAddr,
|
||||
From: sender,
|
||||
Subject: fmt.Sprintf("POLECAT_STARTED %s", polecatName),
|
||||
Body: fmt.Sprintf("Issue: %s\nSession: %s", assignmentID, sessionName),
|
||||
Ephemeral: true,
|
||||
To: witnessAddr,
|
||||
From: sender,
|
||||
Subject: fmt.Sprintf("POLECAT_STARTED %s", polecatName),
|
||||
Body: fmt.Sprintf("Issue: %s\nSession: %s", assignmentID, sessionName),
|
||||
Wisp: true,
|
||||
}
|
||||
|
||||
if err := townRouter.Send(witnessNotification); err != nil {
|
||||
@@ -414,11 +414,11 @@ func runSpawn(cmd *cobra.Command, args []string) error {
|
||||
// Notify Deacon with POLECAT_STARTED message (ephemeral - lifecycle ping)
|
||||
deaconAddr := "deacon/"
|
||||
deaconNotification := &mail.Message{
|
||||
To: deaconAddr,
|
||||
From: sender,
|
||||
Subject: fmt.Sprintf("POLECAT_STARTED %s/%s", rigName, polecatName),
|
||||
Body: fmt.Sprintf("Issue: %s\nSession: %s", assignmentID, sessionName),
|
||||
Ephemeral: true,
|
||||
To: deaconAddr,
|
||||
From: sender,
|
||||
Subject: fmt.Sprintf("POLECAT_STARTED %s/%s", rigName, polecatName),
|
||||
Body: fmt.Sprintf("Issue: %s\nSession: %s", assignmentID, sessionName),
|
||||
Wisp: true,
|
||||
}
|
||||
|
||||
if err := townRouter.Send(deaconNotification); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user