feat: bump to v0.1.23 with security metrics and UI improvements

- Bump agent and server versions to 0.1.23
- Implement security metrics collection (bound agents, command processing, version compliance)
- Add dismiss button for timed out commands in agent status
- Add config sync endpoint for server->agent configuration updates
- Add ignored updates workflow in AgentUpdatesEnhanced (approve/reject workflow)
- Swap AgentScanners layout (subsystems top, security bottom)
- Replace placeholder security data with database metrics
- Add backpressure detection based on pending command ratios
This commit is contained in:
Fimeg
2025-11-04 09:41:27 -05:00
parent 38894f64d3
commit 95f70bd9bb
12 changed files with 511 additions and 244 deletions

View File

@@ -370,6 +370,38 @@ func (q *CommandQueries) CountPendingCommandsForAgent(agentID uuid.UUID) (int, e
return count, err
}
// GetTotalPendingCommands returns total pending commands across all agents
func (q *CommandQueries) GetTotalPendingCommands() (int, error) {
var count int
query := `SELECT COUNT(*) FROM agent_commands WHERE status = 'pending'`
err := q.db.Get(&count, query)
return count, err
}
// GetAgentsWithPendingCommands returns count of agents with pending commands
func (q *CommandQueries) GetAgentsWithPendingCommands() (int, error) {
var count int
query := `
SELECT COUNT(DISTINCT agent_id)
FROM agent_commands
WHERE status = 'pending'
`
err := q.db.Get(&count, query)
return count, err
}
// GetCommandsInTimeRange returns count of commands processed in a time range
func (q *CommandQueries) GetCommandsInTimeRange(hours int) (int, error) {
var count int
query := `
SELECT COUNT(*)
FROM agent_commands
WHERE created_at >= $1 AND status IN ('completed', 'failed', 'timed_out')
`
err := q.db.Get(&count, query, time.Now().Add(-time.Duration(hours)*time.Hour))
return count, err
}
// VerifyCommandsCompleted checks which command IDs from the provided list have been completed or failed
// Returns the list of command IDs that have been successfully recorded (completed or failed status)
func (q *CommandQueries) VerifyCommandsCompleted(commandIDs []string) ([]string, error) {