fix(audit): P2 frontend any→concrete types (181→61), heroicons→lucide-react, missing type exports, toast API, Select options, TaskStatus types; P2-9 hooks.py type annotations

This commit is contained in:
Agent Zero
2026-08-17 22:24:24 +02:00
parent 40fd633917
commit 45ebbee26f
52 changed files with 404 additions and 302 deletions
+13 -12
View File
@@ -1,3 +1,4 @@
import { asError } from '@/utils/errorTypes';
import React, { useState } from 'react';
// TODO: P2-F25 — Replace hardcoded commonModels with /ai/providers API
import { useTranslation } from 'react-i18next';
@@ -432,8 +433,8 @@ function VersionHistoryModal({
try {
await restoreMutation.mutateAsync({ id: agentId, versionId });
toast.success(t('agent.versionRestored'));
} catch (err: any) {
toast.error(err.message || t('common.error'));
} catch (err: unknown) { const errObj = asError(err);
toast.error(errObj.message || t('common.error'));
}
};
@@ -510,8 +511,8 @@ export function AgentDashboardPage() {
}
setShowForm(false);
setEditingAgent(undefined);
} catch (err: any) {
toast.error(err.message || t('common.error'));
} catch (err: unknown) { const errObj = asError(err);
toast.error(errObj.message || t('common.error'));
}
};
@@ -521,8 +522,8 @@ export function AgentDashboardPage() {
await deleteMutation.mutateAsync(confirmDelete.id);
toast.success(t('agent.deleted'));
setConfirmDelete(null);
} catch (err: any) {
toast.error(err.message || t('common.error'));
} catch (err: unknown) { const errObj = asError(err);
toast.error(errObj.message || t('common.error'));
}
};
@@ -530,8 +531,8 @@ export function AgentDashboardPage() {
try {
await executeMutation.mutateAsync(id);
toast.success(t('agent.executed'));
} catch (err: any) {
toast.error(err.message || t('common.error'));
} catch (err: unknown) { const errObj = asError(err);
toast.error(errObj.message || t('common.error'));
}
};
@@ -539,8 +540,8 @@ export function AgentDashboardPage() {
try {
await testRunMutation.mutateAsync(id);
toast.success(t('agent.testRunSuccess'));
} catch (err: any) {
toast.error(err.message || t('common.error'));
} catch (err: unknown) { const errObj = asError(err);
toast.error(errObj.message || t('common.error'));
}
};
@@ -554,8 +555,8 @@ export function AgentDashboardPage() {
});
toast.success(t('agent.messageSent'));
setChatMessage('');
} catch (err: any) {
toast.error(err.message || t('common.error'));
} catch (err: unknown) { const errObj = asError(err);
toast.error(errObj.message || t('common.error'));
}
};