fix: use 'bd message' instead of 'bd mail' for agent messaging

The beads command for messaging is 'bd message', not 'bd mail'.
Fixed 4 locations:
- mailbox.go: inbox, read, ack commands
- router.go: send command (also fixed arg order to match bd API)

🤖 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-17 19:42:46 -08:00
parent 41609e8def
commit 56d30e1896
2 changed files with 10 additions and 12 deletions

View File

@@ -72,8 +72,8 @@ func (m *Mailbox) List() ([]*Message, error) {
}
func (m *Mailbox) listBeads() ([]*Message, error) {
// bd mail inbox --json
cmd := exec.Command("bd", "mail", "inbox", "--json")
// bd message inbox --json
cmd := exec.Command("bd", "message", "inbox", "--json")
cmd.Dir = m.workDir
cmd.Env = append(cmd.Environ(), "BD_IDENTITY="+m.identity)
@@ -173,7 +173,7 @@ func (m *Mailbox) Get(id string) (*Message, error) {
}
func (m *Mailbox) getBeads(id string) (*Message, error) {
cmd := exec.Command("bd", "mail", "read", id, "--json")
cmd := exec.Command("bd", "message", "read", id, "--json")
cmd.Dir = m.workDir
var stdout, stderr bytes.Buffer
@@ -221,7 +221,7 @@ func (m *Mailbox) MarkRead(id string) error {
}
func (m *Mailbox) markReadBeads(id string) error {
cmd := exec.Command("bd", "mail", "ack", id)
cmd := exec.Command("bd", "message", "ack", id)
cmd.Dir = m.workDir
var stderr bytes.Buffer

View File

@@ -25,22 +25,20 @@ func NewRouter(workDir string) *Router {
}
}
// Send delivers a message via beads mail.
// Send delivers a message via beads message.
func (r *Router) Send(msg *Message) error {
// Convert addresses to beads identities
toIdentity := addressToIdentity(msg.To)
fromIdentity := addressToIdentity(msg.From)
// Build command: bd mail send <recipient> -s <subject> -m <body> --identity <sender>
args := []string{"mail", "send", toIdentity,
// Build command: bd message send <to> <body> -s <subject>
// Note: sender identity comes from BEADS_AGENT_NAME env var
args := []string{"message", "send", toIdentity, msg.Body,
"-s", msg.Subject,
"-m", msg.Body,
"--identity", fromIdentity,
}
// Add --urgent flag for high priority
// Add importance flag for high priority
if msg.Priority == PriorityHigh {
args = append(args, "--urgent")
args = append(args, "--importance", "urgent")
}
cmd := exec.Command("bd", args...)