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
|
- **Town beads** (prefix: `gm-`): Mayor inbox, cross-rig coordination, handoffs
|
||||||
- **Rig beads** (prefix: varies): Rig-local agent communication
|
- **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
|
```bash
|
||||||
gt mail send mayor/ -s "Subject" -m "Body" # Uses bd mail send
|
gt mail send mayor/ -s "Subject" -m "Body" # Creates message issue
|
||||||
gt mail inbox # Uses bd mail inbox
|
gt mail inbox # Lists message issues
|
||||||
gt mail read gm-abc # Uses bd mail read
|
gt mail read gm-abc # Shows message issue
|
||||||
```
|
```
|
||||||
|
|
||||||
```mermaid
|
```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:
|
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`):**
|
**Routing logic (`resolveBeadsDir`):**
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Message types:
|
|||||||
notification - Informational (default)
|
notification - Informational (default)
|
||||||
reply - Response to message
|
reply - Response to message
|
||||||
|
|
||||||
Priority levels (compatible with bd mail send):
|
Priority levels:
|
||||||
0 - urgent/critical
|
0 - urgent/critical
|
||||||
1 - high
|
1 - high
|
||||||
2 - normal (default)
|
2 - normal (default)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ func (d *Daemon) ProcessLifecycleRequests() {
|
|||||||
|
|
||||||
output, err := cmd.Output()
|
output, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// bd mail might not be available or inbox empty
|
// gt mail might not be available or inbox empty
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ Time: %s
|
|||||||
|
|
||||||
// processShutdownRequests checks mail for lifecycle requests and handles them.
|
// processShutdownRequests checks mail for lifecycle requests and handles them.
|
||||||
func (m *Manager) processShutdownRequests(w *Witness) error {
|
func (m *Manager) processShutdownRequests(w *Witness) error {
|
||||||
// Get witness mailbox via bd mail inbox
|
// Get witness mailbox via gt mail
|
||||||
messages, err := m.getWitnessMessages()
|
messages, err := m.getWitnessMessages()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("getting messages: %w", err)
|
return fmt.Errorf("getting messages: %w", err)
|
||||||
@@ -477,9 +477,9 @@ Rig: %s
|
|||||||
Time: %s
|
Time: %s
|
||||||
`, reason, polecatName, m.rig.Name, time.Now().Format(time.RFC3339))
|
`, 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)
|
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,
|
"-s", subject,
|
||||||
"-m", body,
|
"-m", body,
|
||||||
)
|
)
|
||||||
@@ -502,8 +502,8 @@ type WitnessMessage struct {
|
|||||||
|
|
||||||
// getWitnessMessages retrieves unread messages for the witness.
|
// getWitnessMessages retrieves unread messages for the witness.
|
||||||
func (m *Manager) getWitnessMessages() ([]WitnessMessage, error) {
|
func (m *Manager) getWitnessMessages() ([]WitnessMessage, error) {
|
||||||
// Use bd mail inbox --json
|
// Use gt mail inbox --json
|
||||||
cmd := exec.Command("bd", "mail", "inbox", "--json")
|
cmd := exec.Command("gt", "mail", "inbox", "--json")
|
||||||
cmd.Dir = m.workDir
|
cmd.Dir = m.workDir
|
||||||
cmd.Env = append(os.Environ(), "BEADS_AGENT_NAME="+m.rig.Name+"-witness")
|
cmd.Env = append(os.Environ(), "BEADS_AGENT_NAME="+m.rig.Name+"-witness")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user