fix: repair version detection platform query format

- Fix GetLatestVersionByTypeAndArch to separate platform/architecture
- Query now correctly uses platform='linux' and architecture='amd64'
- Resolves UI showing 'no packages available' despite updates existing
This commit is contained in:
Fimeg
2025-11-10 20:11:32 -05:00
parent e6ac0b1ec4
commit 1f2b1b7179
7 changed files with 412 additions and 34 deletions

View File

@@ -172,6 +172,24 @@ export const agentApi = {
return response.data;
},
// Check if update available for agent
checkForUpdateAvailable: async (agentId: string): Promise<{ hasUpdate: boolean; currentVersion: string; latestVersion?: string; reason?: string; platform?: string }> => {
const response = await api.get(`/agents/${agentId}/updates/available`);
return response.data;
},
// Get update status for agent
getUpdateStatus: async (agentId: string): Promise<{ status: string; progress?: number; error?: string }> => {
const response = await api.get(`/agents/${agentId}/updates/status`);
return response.data;
},
// Generate update nonce for agent (new security feature)
generateUpdateNonce: async (agentId: string, targetVersion: string): Promise<{ agent_id: string; target_version: string; update_nonce: string; expires_at: number; expires_in_seconds: number }> => {
const response = await api.post(`/agents/${agentId}/update-nonce?target_version=${targetVersion}`);
return response.data;
},
// Update multiple agents (bulk)
updateMultipleAgents: async (updateData: {
agent_ids: string[];