feat: Add overseer identity for human operator mail support
Adds first-class support for the human overseer in Gas Town mail: - New OverseerConfig in internal/config/overseer.go with identity detection (git config, gh cli, environment) - Overseer detected/saved on town install (mayor/overseer.json) - Simplified detectSender(): GT_ROLE set = agent, else = overseer - New overseer address alongside mayor/ and deacon/ - Added --cc flag to mail send for CC recipients - Inbox now includes CC'd messages via label query - gt status shows overseer identity and unread mail count - New gt whoami command shows current mail identity Generated with Claude Code Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,10 +82,10 @@ func (r *Router) resolveBeadsDir(address string) string {
|
||||
return filepath.Join(r.townRoot, ".beads")
|
||||
}
|
||||
|
||||
// isTownLevelAddress returns true if the address is for a town-level agent.
|
||||
// isTownLevelAddress returns true if the address is for a town-level agent or the overseer.
|
||||
func isTownLevelAddress(address string) bool {
|
||||
addr := strings.TrimSuffix(address, "/")
|
||||
return addr == "mayor" || addr == "deacon"
|
||||
return addr == "mayor" || addr == "deacon" || addr == "overseer"
|
||||
}
|
||||
|
||||
// shouldBeWisp determines if a message should be stored as a wisp.
|
||||
@@ -118,7 +118,7 @@ func (r *Router) Send(msg *Message) error {
|
||||
// Convert addresses to beads identities
|
||||
toIdentity := addressToIdentity(msg.To)
|
||||
|
||||
// Build labels for from/thread/reply-to
|
||||
// Build labels for from/thread/reply-to/cc
|
||||
var labels []string
|
||||
labels = append(labels, "from:"+msg.From)
|
||||
if msg.ThreadID != "" {
|
||||
@@ -127,6 +127,11 @@ func (r *Router) Send(msg *Message) error {
|
||||
if msg.ReplyTo != "" {
|
||||
labels = append(labels, "reply-to:"+msg.ReplyTo)
|
||||
}
|
||||
// Add CC labels (one per recipient)
|
||||
for _, cc := range msg.CC {
|
||||
ccIdentity := addressToIdentity(cc)
|
||||
labels = append(labels, "cc:"+ccIdentity)
|
||||
}
|
||||
|
||||
// Build command: bd create <subject> --type=message --assignee=<recipient> -d <body>
|
||||
args := []string{"create", msg.Subject,
|
||||
|
||||
Reference in New Issue
Block a user