feat: add graph links and hooks system (bd-kwro.2-5, bd-kwro.8)

- bd mail reply: reply to messages with thread linking via replies_to
- bd show --thread: display full conversation threads
- bd relate/unrelate: bidirectional relates_to links for knowledge graph
- bd duplicate --of: mark issues as duplicates with auto-close
- bd supersede --with: mark issues as superseded with auto-close
- Hooks system: on_create, on_update, on_close, on_message in .beads/hooks/
- RPC protocol: added Sender, Ephemeral, RepliesTo fields to CreateArgs/UpdateArgs

🤖 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-16 18:34:48 -08:00
parent 5e39a0a24f
commit 46bfb43b8d
9 changed files with 1132 additions and 20 deletions

View File

@@ -72,6 +72,10 @@ type CreateArgs struct {
EstimatedMinutes *int `json:"estimated_minutes,omitempty"` // Time estimate in minutes
Labels []string `json:"labels,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
// Messaging fields (bd-kwro)
Sender string `json:"sender,omitempty"` // Who sent this (for messages)
Ephemeral bool `json:"ephemeral,omitempty"` // Can be bulk-deleted when closed
RepliesTo string `json:"replies_to,omitempty"` // Issue ID for conversation threading
}
// UpdateArgs represents arguments for the update operation
@@ -91,6 +95,10 @@ type UpdateArgs struct {
AddLabels []string `json:"add_labels,omitempty"`
RemoveLabels []string `json:"remove_labels,omitempty"`
SetLabels []string `json:"set_labels,omitempty"`
// Messaging fields (bd-kwro)
Sender *string `json:"sender,omitempty"` // Who sent this (for messages)
Ephemeral *bool `json:"ephemeral,omitempty"` // Can be bulk-deleted when closed
RepliesTo *string `json:"replies_to,omitempty"` // Issue ID for conversation threading
}
// CloseArgs represents arguments for the close operation

View File

@@ -76,6 +76,16 @@ func updatesFromArgs(a UpdateArgs) map[string]interface{} {
if a.IssueType != nil {
u["issue_type"] = *a.IssueType
}
// Messaging fields (bd-kwro)
if a.Sender != nil {
u["sender"] = *a.Sender
}
if a.Ephemeral != nil {
u["ephemeral"] = *a.Ephemeral
}
if a.RepliesTo != nil {
u["replies_to"] = *a.RepliesTo
}
return u
}
@@ -150,6 +160,10 @@ func (s *Server) handleCreate(req *Request) Response {
ExternalRef: externalRef,
EstimatedMinutes: createArgs.EstimatedMinutes,
Status: types.StatusOpen,
// Messaging fields (bd-kwro)
Sender: createArgs.Sender,
Ephemeral: createArgs.Ephemeral,
RepliesTo: createArgs.RepliesTo,
}
// Check if any dependencies are discovered-from type