fix: replace stale 'bd mail' references with 'gt mail'
- docs/architecture.md: update mail routing explanation - internal/witness/manager.go: fix actual bd mail calls to gt mail - internal/cmd/mail.go: remove stale compatibility note - internal/daemon/lifecycle.go: update comment
This commit is contained in:
@@ -114,11 +114,11 @@ Agents communicate via **mail** - messages stored as beads issues with `type=mes
|
||||
- **Town beads** (prefix: `gm-`): Mayor inbox, cross-rig coordination, handoffs
|
||||
- **Rig beads** (prefix: varies): Rig-local agent communication
|
||||
|
||||
Mail commands use `bd mail` under the hood:
|
||||
Mail commands use beads issues with type=message:
|
||||
```bash
|
||||
gt mail send mayor/ -s "Subject" -m "Body" # Uses bd mail send
|
||||
gt mail inbox # Uses bd mail inbox
|
||||
gt mail read gm-abc # Uses bd mail read
|
||||
gt mail send mayor/ -s "Subject" -m "Body" # Creates message issue
|
||||
gt mail inbox # Lists message issues
|
||||
gt mail read gm-abc # Shows message issue
|
||||
```
|
||||
|
||||
```mermaid
|
||||
@@ -248,7 +248,7 @@ Gas Town uses a **two-level beads architecture**. This is critical to understand
|
||||
Mail is routed to the correct beads database based on recipient address. The `Router` (in `internal/mail/router.go`) handles this:
|
||||
|
||||
```
|
||||
Sender → Router.Send() → resolveBeadsDir(recipient) → bd mail send with BEADS_DIR
|
||||
Sender → Router.Send() → resolveBeadsDir(recipient) → creates message issue in target beads
|
||||
```
|
||||
|
||||
**Routing logic (`resolveBeadsDir`):**
|
||||
|
||||
@@ -63,7 +63,7 @@ Message types:
|
||||
notification - Informational (default)
|
||||
reply - Response to message
|
||||
|
||||
Priority levels (compatible with bd mail send):
|
||||
Priority levels:
|
||||
0 - urgent/critical
|
||||
1 - high
|
||||
2 - normal (default)
|
||||
|
||||
@@ -32,7 +32,7 @@ func (d *Daemon) ProcessLifecycleRequests() {
|
||||
|
||||
output, err := cmd.Output()
|
||||
if err != nil {
|
||||
// bd mail might not be available or inbox empty
|
||||
// gt mail might not be available or inbox empty
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ Time: %s
|
||||
|
||||
// processShutdownRequests checks mail for lifecycle requests and handles them.
|
||||
func (m *Manager) processShutdownRequests(w *Witness) error {
|
||||
// Get witness mailbox via bd mail inbox
|
||||
// Get witness mailbox via gt mail
|
||||
messages, err := m.getWitnessMessages()
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting messages: %w", err)
|
||||
@@ -477,9 +477,9 @@ Rig: %s
|
||||
Time: %s
|
||||
`, reason, polecatName, m.rig.Name, time.Now().Format(time.RFC3339))
|
||||
|
||||
// Send via bd mail
|
||||
// Send via gt mail
|
||||
recipient := fmt.Sprintf("%s/%s", m.rig.Name, polecatName)
|
||||
cmd := exec.Command("bd", "mail", "send", recipient,
|
||||
cmd := exec.Command("gt", "mail", "send", recipient,
|
||||
"-s", subject,
|
||||
"-m", body,
|
||||
)
|
||||
@@ -502,8 +502,8 @@ type WitnessMessage struct {
|
||||
|
||||
// getWitnessMessages retrieves unread messages for the witness.
|
||||
func (m *Manager) getWitnessMessages() ([]WitnessMessage, error) {
|
||||
// Use bd mail inbox --json
|
||||
cmd := exec.Command("bd", "mail", "inbox", "--json")
|
||||
// Use gt mail inbox --json
|
||||
cmd := exec.Command("gt", "mail", "inbox", "--json")
|
||||
cmd.Dir = m.workDir
|
||||
cmd.Env = append(os.Environ(), "BEADS_AGENT_NAME="+m.rig.Name+"-witness")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user