WIP: Save agent roles integration work before CHORUS rebrand

- Agent roles and coordination features
- Chat API integration testing
- New configuration and workspace management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
anthonyrawlins
2025-08-01 02:21:11 +10:00
parent 81b473d48f
commit 5978a0b8f5
3713 changed files with 1103925 additions and 59 deletions

62
main.go
View File

@@ -14,8 +14,9 @@ import (
"syscall"
"time"
"github.com/anthonyrawlins/bzzz/api"
"github.com/anthonyrawlins/bzzz/coordinator"
"github.com/anthonyrawlins/bzzz/discovery"
"github.com/anthonyrawlins/bzzz/github"
"github.com/anthonyrawlins/bzzz/logging"
"github.com/anthonyrawlins/bzzz/p2p"
"github.com/anthonyrawlins/bzzz/pkg/config"
@@ -127,8 +128,8 @@ func main() {
}
defer mdnsDiscovery.Close()
// Initialize PubSub
ps, err := pubsub.NewPubSub(ctx, node.Host(), "bzzz/coordination/v1", "antennae/meta-discussion/v1")
// Initialize PubSub with hypercore logging
ps, err := pubsub.NewPubSubWithLogger(ctx, node.Host(), "bzzz/coordination/v1", "antennae/meta-discussion/v1", hlog)
if err != nil {
log.Fatalf("Failed to create PubSub: %v", err)
}
@@ -143,7 +144,7 @@ func main() {
}
}
// === Hive & Dynamic Repository Integration ===
// === Hive & Task Coordination Integration ===
// Initialize Hive API client
hiveClient := hive.NewHiveClient(cfg.HiveAPI.BaseURL, cfg.HiveAPI.APIKey)
@@ -155,40 +156,31 @@ func main() {
fmt.Printf("✅ Hive API connected\n")
}
// Get GitHub token from configuration
githubToken, err := cfg.GetGitHubToken()
if err != nil {
fmt.Printf("⚠️ GitHub token not available: %v\n", err)
fmt.Printf("🔧 Repository integration disabled\n")
githubToken = ""
}
// Initialize Task Coordinator
taskCoordinator := coordinator.NewTaskCoordinator(
ctx,
hiveClient,
ps,
hlog,
cfg,
node.ID().ShortString(),
)
// Initialize dynamic GitHub integration
var ghIntegration *github.Integration
if githubToken != "" {
// Use agent ID from config (auto-generated from node ID)
agentID := cfg.Agent.ID
if agentID == "" {
agentID = node.ID().ShortString()
}
integrationConfig := &github.IntegrationConfig{
AgentID: agentID,
Capabilities: cfg.Agent.Capabilities,
PollInterval: cfg.Agent.PollInterval,
MaxTasks: cfg.Agent.MaxTasks,
}
ghIntegration = github.NewIntegration(ctx, hiveClient, githubToken, ps, hlog, integrationConfig, &cfg.Agent)
// Start the integration service
ghIntegration.Start()
fmt.Printf("✅ Dynamic repository integration active\n")
} else {
fmt.Printf("🔧 Repository integration skipped - no GitHub token\n")
}
// Start task coordination
taskCoordinator.Start()
fmt.Printf("✅ Task coordination system active\n")
// ==========================
// Start HTTP API server
httpServer := api.NewHTTPServer(8080, hlog, ps)
go func() {
if err := httpServer.Start(); err != nil && err != http.ErrServerClosed {
fmt.Printf("❌ HTTP server error: %v\n", err)
}
}()
defer httpServer.Stop()
fmt.Printf("🌐 HTTP API server started on :8080\n")
// Create simple task tracker
taskTracker := &SimpleTaskTracker{