Integrate-with-supabase-backend

This commit is contained in:
Harshavardhan Musanalli
2025-10-28 07:53:14 +01:00
parent 8832450a1f
commit 8328f8d5b3
6 changed files with 267 additions and 55 deletions

View File

@@ -60,7 +60,7 @@ func NewInvestigationServer(agent *LinuxDiagnosticAgent, authManager *auth.AuthM
if authManager != nil {
if id, err := authManager.GetCurrentAgentID(); err == nil {
agentID = id
fmt.Printf("✅ Retrieved agent ID from auth manager: %s\n", agentID)
} else {
fmt.Printf("❌ Failed to get agent ID from auth manager: %v\n", err)
}
@@ -250,7 +250,7 @@ func (s *InvestigationServer) sendCommandResultsToTensorZero(diagnosticResp Diag
// Check if it's a resolution response
if err := json.Unmarshal([]byte(content), &resolutionResp); err == nil && resolutionResp.ResponseType == "resolution" {
fmt.Printf("✅ TensorZero provided final resolution\n")
return map[string]interface{}{
"type": "resolution",
"response": resolutionResp,
@@ -355,7 +355,7 @@ func (s *InvestigationServer) handleDiagnosticExecution(requestBody map[string]i
result := s.agent.executor.Execute(cmd)
commandResults = append(commandResults, result)
fmt.Printf("✅ Command '%s' completed with exit code %d\n", cmd.ID, result.ExitCode)
if result.Error != "" {
fmt.Printf("⚠️ Command '%s' had error: %s\n", cmd.ID, result.Error)
}
@@ -471,7 +471,7 @@ func (s *InvestigationServer) handlePendingInvestigation(investigation PendingIn
return
}
fmt.Printf("✅ Realtime investigation %s completed successfully\n", investigation.InvestigationID)
}
// updateInvestigationStatus updates the status of a pending investigation