Prepare for v2 development: Add MCP integration and future development planning
- Add FUTURE_DEVELOPMENT.md with comprehensive v2 protocol specification - Add MCP integration design and implementation foundation - Add infrastructure and deployment configurations - Update system architecture for v2 evolution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -200,7 +200,7 @@ func (dd *DependencyDetector) announceDependency(dep *TaskDependency) {
|
||||
dep.Task2.Repository, dep.Task2.Title, dep.Task2.TaskID,
|
||||
dep.Relationship)
|
||||
|
||||
// Create coordination message for Antennae meta-discussion
|
||||
// Create coordination message for HMMM meta-discussion
|
||||
coordMsg := map[string]interface{}{
|
||||
"message_type": "dependency_detected",
|
||||
"dependency": dep,
|
||||
@@ -219,11 +219,11 @@ func (dd *DependencyDetector) announceDependency(dep *TaskDependency) {
|
||||
"detected_at": dep.DetectedAt.Unix(),
|
||||
}
|
||||
|
||||
// Publish to Antennae meta-discussion channel
|
||||
if err := dd.pubsub.PublishAntennaeMessage(pubsub.MetaDiscussion, coordMsg); err != nil {
|
||||
// Publish to HMMM meta-discussion channel
|
||||
if err := dd.pubsub.PublishHmmmMessage(pubsub.MetaDiscussion, coordMsg); err != nil {
|
||||
fmt.Printf("❌ Failed to announce dependency: %v\n", err)
|
||||
} else {
|
||||
fmt.Printf("📡 Dependency coordination request sent to Antennae channel\n")
|
||||
fmt.Printf("📡 Dependency coordination request sent to HMMM channel\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anthonyrawlins/bzzz/pkg/integration"
|
||||
"github.com/anthonyrawlins/bzzz/pubsub"
|
||||
"github.com/anthonyrawlins/bzzz/reasoning"
|
||||
"github.com/libp2p/go-libp2p/core/peer"
|
||||
@@ -18,6 +19,7 @@ type MetaCoordinator struct {
|
||||
pubsub *pubsub.PubSub
|
||||
ctx context.Context
|
||||
dependencyDetector *DependencyDetector
|
||||
slurpIntegrator *integration.SlurpEventIntegrator
|
||||
|
||||
// Active coordination sessions
|
||||
activeSessions map[string]*CoordinationSession // sessionID -> session
|
||||
@@ -79,7 +81,7 @@ func NewMetaCoordinator(ctx context.Context, ps *pubsub.PubSub) *MetaCoordinator
|
||||
mc.dependencyDetector = NewDependencyDetector(ctx, ps)
|
||||
|
||||
// Set up message handler for meta-discussions
|
||||
ps.SetAntennaeMessageHandler(mc.handleMetaMessage)
|
||||
ps.SetHmmmMessageHandler(mc.handleMetaMessage)
|
||||
|
||||
// Start session management
|
||||
go mc.sessionCleanupLoop()
|
||||
@@ -88,7 +90,13 @@ func NewMetaCoordinator(ctx context.Context, ps *pubsub.PubSub) *MetaCoordinator
|
||||
return mc
|
||||
}
|
||||
|
||||
// handleMetaMessage processes incoming Antennae meta-discussion messages
|
||||
// SetSlurpIntegrator sets the SLURP event integrator for the coordinator
|
||||
func (mc *MetaCoordinator) SetSlurpIntegrator(integrator *integration.SlurpEventIntegrator) {
|
||||
mc.slurpIntegrator = integrator
|
||||
fmt.Printf("🎯 SLURP integrator attached to Meta Coordinator\n")
|
||||
}
|
||||
|
||||
// handleMetaMessage processes incoming HMMM meta-discussion messages
|
||||
func (mc *MetaCoordinator) handleMetaMessage(msg pubsub.Message, from peer.ID) {
|
||||
messageType, hasType := msg.Data[\"message_type\"].(string)
|
||||
if !hasType {
|
||||
@@ -227,7 +235,7 @@ Keep the plan practical and actionable. Focus on specific next steps.`,
|
||||
|
||||
// broadcastToSession sends a message to all participants in a session
|
||||
func (mc *MetaCoordinator) broadcastToSession(session *CoordinationSession, data map[string]interface{}) {
|
||||
if err := mc.pubsub.PublishAntennaeMessage(pubsub.MetaDiscussion, data); err != nil {
|
||||
if err := mc.pubsub.PublishHmmmMessage(pubsub.MetaDiscussion, data); err != nil {
|
||||
fmt.Printf(\"❌ Failed to broadcast to session %s: %v\\n\", session.SessionID, err)
|
||||
}
|
||||
}
|
||||
@@ -320,6 +328,11 @@ func (mc *MetaCoordinator) escalateSession(session *CoordinationSession, reason
|
||||
|
||||
fmt.Printf(\"🚨 Escalating coordination session %s: %s\\n\", session.SessionID, reason)
|
||||
|
||||
// Generate SLURP event if integrator is available
|
||||
if mc.slurpIntegrator != nil {
|
||||
mc.generateSlurpEventFromSession(session, \"escalated\")
|
||||
}
|
||||
|
||||
// Create escalation message
|
||||
escalationData := map[string]interface{}{
|
||||
\"message_type\": \"escalation\",
|
||||
@@ -341,6 +354,11 @@ func (mc *MetaCoordinator) resolveSession(session *CoordinationSession, resoluti
|
||||
|
||||
fmt.Printf(\"✅ Resolved coordination session %s: %s\\n\", session.SessionID, resolution)
|
||||
|
||||
// Generate SLURP event if integrator is available
|
||||
if mc.slurpIntegrator != nil {
|
||||
mc.generateSlurpEventFromSession(session, \"resolved\")
|
||||
}
|
||||
|
||||
// Broadcast resolution
|
||||
resolutionData := map[string]interface{}{
|
||||
\"message_type\": \"resolution\",
|
||||
@@ -437,4 +455,72 @@ func (mc *MetaCoordinator) handleCoordinationRequest(msg pubsub.Message, from pe
|
||||
func (mc *MetaCoordinator) handleEscalationRequest(msg pubsub.Message, from peer.ID) {
|
||||
fmt.Printf(\"🚨 Escalation request from %s\\n\", from.ShortString())
|
||||
// Implementation for handling escalation requests
|
||||
}
|
||||
|
||||
// generateSlurpEventFromSession creates and sends a SLURP event based on session outcome
|
||||
func (mc *MetaCoordinator) generateSlurpEventFromSession(session *CoordinationSession, outcome string) {
|
||||
// Convert coordination session to HMMM discussion context
|
||||
hmmmMessages := make([]integration.HmmmMessage, len(session.Messages))
|
||||
for i, msg := range session.Messages {
|
||||
hmmmMessages[i] = integration.HmmmMessage{
|
||||
From: msg.FromAgentID,
|
||||
Content: msg.Content,
|
||||
Type: msg.MessageType,
|
||||
Timestamp: msg.Timestamp,
|
||||
Metadata: msg.Metadata,
|
||||
}
|
||||
}
|
||||
|
||||
// Extract participant IDs
|
||||
participants := make([]string, 0, len(session.Participants))
|
||||
for agentID := range session.Participants {
|
||||
participants = append(participants, agentID)
|
||||
}
|
||||
|
||||
// Determine consensus strength based on outcome
|
||||
var consensusStrength float64
|
||||
switch outcome {
|
||||
case \"resolved\":
|
||||
consensusStrength = 0.9 // High consensus for resolved sessions
|
||||
case \"escalated\":
|
||||
consensusStrength = 0.3 // Low consensus for escalated sessions
|
||||
default:
|
||||
consensusStrength = 0.5 // Medium consensus for other outcomes
|
||||
}
|
||||
|
||||
// Determine project path from tasks involved
|
||||
projectPath := \"/unknown\"
|
||||
if len(session.TasksInvolved) > 0 && session.TasksInvolved[0] != nil {
|
||||
projectPath = session.TasksInvolved[0].Repository
|
||||
}
|
||||
|
||||
// Create HMMM discussion context
|
||||
discussionContext := integration.HmmmDiscussionContext{
|
||||
DiscussionID: session.SessionID,
|
||||
SessionID: session.SessionID,
|
||||
Participants: participants,
|
||||
StartTime: session.CreatedAt,
|
||||
EndTime: session.LastActivity,
|
||||
Messages: hmmmMessages,
|
||||
ConsensusReached: outcome == \"resolved\",
|
||||
ConsensusStrength: consensusStrength,
|
||||
OutcomeType: outcome,
|
||||
ProjectPath: projectPath,
|
||||
RelatedTasks: []string{}, // Could be populated from TasksInvolved
|
||||
Metadata: map[string]interface{}{
|
||||
\"session_type\": session.Type,
|
||||
\"session_status\": session.Status,
|
||||
\"resolution\": session.Resolution,
|
||||
\"escalation_reason\": session.EscalationReason,
|
||||
\"message_count\": len(session.Messages),
|
||||
\"participant_count\": len(session.Participants),
|
||||
},
|
||||
}
|
||||
|
||||
// Process the discussion through SLURP integrator
|
||||
if err := mc.slurpIntegrator.ProcessHmmmDiscussion(mc.ctx, discussionContext); err != nil {
|
||||
fmt.Printf(\"❌ Failed to process HMMM discussion for SLURP: %v\\n\", err)
|
||||
} else {
|
||||
fmt.Printf(\"🎯 Generated SLURP event from session %s (outcome: %s)\\n\", session.SessionID, outcome)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user