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:
@@ -12,8 +12,8 @@ import (
|
||||
"github.com/anthonyrawlins/bzzz/pubsub"
|
||||
)
|
||||
|
||||
// AntennaeMonitor tracks and logs antennae coordination activity
|
||||
type AntennaeMonitor struct {
|
||||
// HmmmMonitor tracks and logs HMMM coordination activity
|
||||
type HmmmMonitor struct {
|
||||
ctx context.Context
|
||||
pubsub *pubsub.PubSub
|
||||
logFile *os.File
|
||||
@@ -72,8 +72,8 @@ type CoordinationMetrics struct {
|
||||
LastUpdated time.Time `json:"last_updated"`
|
||||
}
|
||||
|
||||
// NewAntennaeMonitor creates a new antennae monitoring system
|
||||
func NewAntennaeMonitor(ctx context.Context, ps *pubsub.PubSub, logDir string) (*AntennaeMonitor, error) {
|
||||
// NewHmmmMonitor creates a new HMMM monitoring system
|
||||
func NewHmmmMonitor(ctx context.Context, ps *pubsub.PubSub, logDir string) (*HmmmMonitor, error) {
|
||||
// Ensure log directory exists
|
||||
if err := os.MkdirAll(logDir, 0755); err != nil {
|
||||
return nil, fmt.Errorf("failed to create log directory: %w", err)
|
||||
@@ -81,8 +81,8 @@ func NewAntennaeMonitor(ctx context.Context, ps *pubsub.PubSub, logDir string) (
|
||||
|
||||
// Create log files
|
||||
timestamp := time.Now().Format("20060102_150405")
|
||||
logPath := filepath.Join(logDir, fmt.Sprintf("antennae_activity_%s.jsonl", timestamp))
|
||||
metricsPath := filepath.Join(logDir, fmt.Sprintf("antennae_metrics_%s.json", timestamp))
|
||||
logPath := filepath.Join(logDir, fmt.Sprintf("hmmm_activity_%s.jsonl", timestamp))
|
||||
metricsPath := filepath.Join(logDir, fmt.Sprintf("hmmm_metrics_%s.json", timestamp))
|
||||
|
||||
logFile, err := os.Create(logPath)
|
||||
if err != nil {
|
||||
@@ -95,7 +95,7 @@ func NewAntennaeMonitor(ctx context.Context, ps *pubsub.PubSub, logDir string) (
|
||||
return nil, fmt.Errorf("failed to create metrics file: %w", err)
|
||||
}
|
||||
|
||||
monitor := &AntennaeMonitor{
|
||||
monitor := &HmmmMonitor{
|
||||
ctx: ctx,
|
||||
pubsub: ps,
|
||||
logFile: logFile,
|
||||
@@ -107,21 +107,21 @@ func NewAntennaeMonitor(ctx context.Context, ps *pubsub.PubSub, logDir string) (
|
||||
},
|
||||
}
|
||||
|
||||
fmt.Printf("📊 Antennae Monitor initialized\n")
|
||||
fmt.Printf("📊 HMMM Monitor initialized\n")
|
||||
fmt.Printf(" Activity Log: %s\n", logPath)
|
||||
fmt.Printf(" Metrics File: %s\n", metricsPath)
|
||||
|
||||
return monitor, nil
|
||||
}
|
||||
|
||||
// Start begins monitoring antennae coordination activity
|
||||
func (am *AntennaeMonitor) Start() {
|
||||
// Start begins monitoring HMMM coordination activity
|
||||
func (am *HmmmMonitor) Start() {
|
||||
if am.isRunning {
|
||||
return
|
||||
}
|
||||
am.isRunning = true
|
||||
|
||||
fmt.Println("🔍 Starting Antennae coordination monitoring...")
|
||||
fmt.Println("🔍 Starting HMMM coordination monitoring...")
|
||||
|
||||
// Start monitoring routines
|
||||
go am.monitorCoordinationMessages()
|
||||
@@ -131,7 +131,7 @@ func (am *AntennaeMonitor) Start() {
|
||||
}
|
||||
|
||||
// Stop stops the monitoring system
|
||||
func (am *AntennaeMonitor) Stop() {
|
||||
func (am *HmmmMonitor) Stop() {
|
||||
if !am.isRunning {
|
||||
return
|
||||
}
|
||||
@@ -148,12 +148,12 @@ func (am *AntennaeMonitor) Stop() {
|
||||
am.metricsFile.Close()
|
||||
}
|
||||
|
||||
fmt.Println("🛑 Antennae monitoring stopped")
|
||||
fmt.Println("🛑 HMMM monitoring stopped")
|
||||
}
|
||||
|
||||
// monitorCoordinationMessages listens for antennae meta-discussion messages
|
||||
func (am *AntennaeMonitor) monitorCoordinationMessages() {
|
||||
// Subscribe to antennae topic
|
||||
// monitorCoordinationMessages listens for HMMM meta-discussion messages
|
||||
func (am *HmmmMonitor) monitorCoordinationMessages() {
|
||||
// Subscribe to HMMM topic
|
||||
msgChan := make(chan pubsub.Message, 100)
|
||||
|
||||
// This would be implemented with actual pubsub subscription
|
||||
@@ -172,7 +172,7 @@ func (am *AntennaeMonitor) monitorCoordinationMessages() {
|
||||
}
|
||||
|
||||
// monitorTaskAnnouncements listens for task announcements
|
||||
func (am *AntennaeMonitor) monitorTaskAnnouncements() {
|
||||
func (am *HmmmMonitor) monitorTaskAnnouncements() {
|
||||
// Subscribe to bzzz coordination topic
|
||||
msgChan := make(chan pubsub.Message, 100)
|
||||
|
||||
@@ -188,8 +188,8 @@ func (am *AntennaeMonitor) monitorTaskAnnouncements() {
|
||||
}
|
||||
}
|
||||
|
||||
// processCoordinationMessage processes an antennae coordination message
|
||||
func (am *AntennaeMonitor) processCoordinationMessage(msg pubsub.Message) {
|
||||
// processCoordinationMessage processes a HMMM coordination message
|
||||
func (am *HmmmMonitor) processCoordinationMessage(msg pubsub.Message) {
|
||||
am.mu.Lock()
|
||||
defer am.mu.Unlock()
|
||||
|
||||
@@ -198,7 +198,7 @@ func (am *AntennaeMonitor) processCoordinationMessage(msg pubsub.Message) {
|
||||
FromAgent: msg.From,
|
||||
MessageType: msg.Type,
|
||||
Content: msg.Data,
|
||||
Topic: "antennae/meta-discussion",
|
||||
Topic: "hmmm/meta-discussion",
|
||||
}
|
||||
|
||||
// Log the message
|
||||
@@ -224,12 +224,12 @@ func (am *AntennaeMonitor) processCoordinationMessage(msg pubsub.Message) {
|
||||
// Update session status based on message type
|
||||
am.updateSessionStatus(session, msg)
|
||||
|
||||
fmt.Printf("🧠 Antennae message: %s from %s (Session: %s)\n",
|
||||
fmt.Printf("🧠 HMMM message: %s from %s (Session: %s)\n",
|
||||
msg.Type, msg.From, sessionID)
|
||||
}
|
||||
|
||||
// processTaskAnnouncement processes a task announcement
|
||||
func (am *AntennaeMonitor) processTaskAnnouncement(msg pubsub.Message) {
|
||||
func (am *HmmmMonitor) processTaskAnnouncement(msg pubsub.Message) {
|
||||
am.mu.Lock()
|
||||
defer am.mu.Unlock()
|
||||
|
||||
@@ -259,7 +259,7 @@ func (am *AntennaeMonitor) processTaskAnnouncement(msg pubsub.Message) {
|
||||
}
|
||||
|
||||
// getOrCreateSession gets an existing session or creates a new one
|
||||
func (am *AntennaeMonitor) getOrCreateSession(sessionID string) *CoordinationSession {
|
||||
func (am *HmmmMonitor) getOrCreateSession(sessionID string) *CoordinationSession {
|
||||
if session, exists := am.activeSessions[sessionID]; exists {
|
||||
return session
|
||||
}
|
||||
@@ -285,7 +285,7 @@ func (am *AntennaeMonitor) getOrCreateSession(sessionID string) *CoordinationSes
|
||||
}
|
||||
|
||||
// updateSessionStatus updates session status based on message content
|
||||
func (am *AntennaeMonitor) updateSessionStatus(session *CoordinationSession, msg pubsub.Message) {
|
||||
func (am *HmmmMonitor) updateSessionStatus(session *CoordinationSession, msg pubsub.Message) {
|
||||
// Analyze message content to determine status changes
|
||||
if content, ok := msg.Data["type"].(string); ok {
|
||||
switch content {
|
||||
@@ -306,7 +306,7 @@ func (am *AntennaeMonitor) updateSessionStatus(session *CoordinationSession, msg
|
||||
}
|
||||
|
||||
// periodicMetricsUpdate saves metrics periodically
|
||||
func (am *AntennaeMonitor) periodicMetricsUpdate() {
|
||||
func (am *HmmmMonitor) periodicMetricsUpdate() {
|
||||
ticker := time.NewTicker(30 * time.Second)
|
||||
defer ticker.Stop()
|
||||
|
||||
@@ -322,7 +322,7 @@ func (am *AntennaeMonitor) periodicMetricsUpdate() {
|
||||
}
|
||||
|
||||
// sessionCleanup removes old inactive sessions
|
||||
func (am *AntennaeMonitor) sessionCleanup() {
|
||||
func (am *HmmmMonitor) sessionCleanup() {
|
||||
ticker := time.NewTicker(5 * time.Minute)
|
||||
defer ticker.Stop()
|
||||
|
||||
@@ -337,7 +337,7 @@ func (am *AntennaeMonitor) sessionCleanup() {
|
||||
}
|
||||
|
||||
// cleanupOldSessions removes sessions inactive for more than 10 minutes
|
||||
func (am *AntennaeMonitor) cleanupOldSessions() {
|
||||
func (am *HmmmMonitor) cleanupOldSessions() {
|
||||
am.mu.Lock()
|
||||
defer am.mu.Unlock()
|
||||
|
||||
@@ -360,7 +360,7 @@ func (am *AntennaeMonitor) cleanupOldSessions() {
|
||||
}
|
||||
|
||||
// logActivity logs an activity to the activity log file
|
||||
func (am *AntennaeMonitor) logActivity(activityType string, data interface{}) {
|
||||
func (am *HmmmMonitor) logActivity(activityType string, data interface{}) {
|
||||
logEntry := map[string]interface{}{
|
||||
"timestamp": time.Now().Unix(),
|
||||
"activity_type": activityType,
|
||||
@@ -374,7 +374,7 @@ func (am *AntennaeMonitor) logActivity(activityType string, data interface{}) {
|
||||
}
|
||||
|
||||
// saveMetrics saves current metrics to file
|
||||
func (am *AntennaeMonitor) saveMetrics() {
|
||||
func (am *HmmmMonitor) saveMetrics() {
|
||||
am.mu.RLock()
|
||||
defer am.mu.RUnlock()
|
||||
|
||||
@@ -406,11 +406,11 @@ func (am *AntennaeMonitor) saveMetrics() {
|
||||
}
|
||||
|
||||
// printStatus prints current monitoring status
|
||||
func (am *AntennaeMonitor) printStatus() {
|
||||
func (am *HmmmMonitor) printStatus() {
|
||||
am.mu.RLock()
|
||||
defer am.mu.RUnlock()
|
||||
|
||||
fmt.Printf("📊 Antennae Monitor Status:\n")
|
||||
fmt.Printf("📊 HMMM Monitor Status:\n")
|
||||
fmt.Printf(" Total Sessions: %d (Active: %d, Completed: %d)\n",
|
||||
am.metrics.TotalSessions, am.metrics.ActiveSessions, am.metrics.CompletedSessions)
|
||||
fmt.Printf(" Messages: %d, Announcements: %d\n",
|
||||
@@ -420,14 +420,14 @@ func (am *AntennaeMonitor) printStatus() {
|
||||
}
|
||||
|
||||
// GetMetrics returns current metrics
|
||||
func (am *AntennaeMonitor) GetMetrics() *CoordinationMetrics {
|
||||
func (am *HmmmMonitor) GetMetrics() *CoordinationMetrics {
|
||||
am.mu.RLock()
|
||||
defer am.mu.RUnlock()
|
||||
return am.metrics
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
func (am *AntennaeMonitor) extractSessionID(data map[string]interface{}) string {
|
||||
func (am *HmmmMonitor) extractSessionID(data map[string]interface{}) string {
|
||||
if sessionID, ok := data["session_id"].(string); ok {
|
||||
return sessionID
|
||||
}
|
||||
@@ -444,4 +444,14 @@ func contains(slice []string, item string) bool {
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Compatibility aliases for the old Antennae naming
|
||||
// Deprecated: Use HmmmMonitor instead
|
||||
type AntennaeMonitor = HmmmMonitor
|
||||
|
||||
// NewAntennaeMonitor is a compatibility alias for NewHmmmMonitor
|
||||
// Deprecated: Use NewHmmmMonitor instead
|
||||
func NewAntennaeMonitor(ctx context.Context, ps *pubsub.PubSub, logDir string) (*HmmmMonitor, error) {
|
||||
return NewHmmmMonitor(ctx, ps, logDir)
|
||||
}
|
||||
Reference in New Issue
Block a user