diff --git a/ui/actions/lighthouse/lighthouse.ts b/ui/actions/lighthouse/lighthouse.ts index 44d74e90fe..ce236160a0 100644 --- a/ui/actions/lighthouse/lighthouse.ts +++ b/ui/actions/lighthouse/lighthouse.ts @@ -31,7 +31,6 @@ export const getAIKey = async (): Promise => { const configId = await getAIConfigurationId(); if (!configId) { - console.log("AI configuration ID not found"); return ""; } @@ -83,7 +82,6 @@ export const getAIConfiguration = async () => { const configId = await getAIConfigurationId(); if (!configId) { - console.log("AI configuration ID not found"); return undefined; } @@ -110,7 +108,6 @@ export const updateAIConfiguration = async (config: { const configId = await getAIConfigurationId(); if (!configId) { - console.log("AI configuration ID not found"); return undefined; } diff --git a/ui/app/(ai)/analyst/(tools)/checks.ts b/ui/app/(ai)/analyst/(tools)/checks.ts index 248cbd1a11..0bbac2d36b 100644 --- a/ui/app/(ai)/analyst/(tools)/checks.ts +++ b/ui/app/(ai)/analyst/(tools)/checks.ts @@ -5,7 +5,6 @@ import { checkSchema } from "@/types/ai/checks"; export const getProviderChecksTool = tool( async ({ provider_type }) => { - console.log("=> Invoking getProviderChecksTool - ", provider_type); const checks = await aiGetProviderChecks(provider_type); return checks; }, diff --git a/ui/app/(ai)/analyst/(tools)/compliances.ts b/ui/app/(ai)/analyst/(tools)/compliances.ts index b6ab12788c..182c2d55b0 100644 --- a/ui/app/(ai)/analyst/(tools)/compliances.ts +++ b/ui/app/(ai)/analyst/(tools)/compliances.ts @@ -13,14 +13,6 @@ import { export const getCompliancesOverviewTool = tool( async ({ scanId, fields, filters, page, page_size, sort }) => { - console.log("=> Invoking getCompliancesOverviewTool - ", { - scanId, - fields, - filters, - page, - page_size, - sort, - }); return await aiGetCompliancesOverview({ scanId, fields, @@ -40,7 +32,6 @@ export const getCompliancesOverviewTool = tool( export const getComplianceFrameworksTool = tool( async ({ provider }) => { - console.log("=> Invoking getComplianceFrameworksTool - ", { provider }); return await aiGetComplianceFrameworks(provider); }, { @@ -53,10 +44,6 @@ export const getComplianceFrameworksTool = tool( export const getComplianceOverviewTool = tool( async ({ complianceId, fields }) => { - console.log("=> Invoking getComplianceOverviewTool - ", { - complianceId, - fields, - }); return await aiGetComplianceOverview({ complianceId, fields }); }, { diff --git a/ui/app/(ai)/analyst/(tools)/findings.ts b/ui/app/(ai)/analyst/(tools)/findings.ts index cddc84208c..f8206b3f51 100644 --- a/ui/app/(ai)/analyst/(tools)/findings.ts +++ b/ui/app/(ai)/analyst/(tools)/findings.ts @@ -5,13 +5,6 @@ import { getFindingsSchema, getMetadataInfoSchema } from "@/types/ai/findings"; export const getFindingsTool = tool( async ({ page, pageSize, query, sort, filters }) => { - console.log("=> Invoking getFindingsTool - ", { - page, - pageSize, - query, - sort, - filters, - }); return await getFindings({ page, pageSize, query, sort, filters }); }, { @@ -24,7 +17,6 @@ export const getFindingsTool = tool( export const getMetadataInfoTool = tool( async ({ query, sort, filters }) => { - console.log("=> Invoking getMetadataInfoTool - ", { query, sort, filters }); return await getMetadataInfo({ query, sort, filters }); }, { diff --git a/ui/app/(ai)/analyst/(tools)/overview.ts b/ui/app/(ai)/analyst/(tools)/overview.ts index 1b7fb36aec..c13308ed20 100644 --- a/ui/app/(ai)/analyst/(tools)/overview.ts +++ b/ui/app/(ai)/analyst/(tools)/overview.ts @@ -13,12 +13,6 @@ import { export const getProvidersOverviewTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getProvidersOverviewTool - ", { - page, - query, - sort, - filters, - }); return await getProvidersOverview({ page, query, sort, filters }); }, { @@ -31,12 +25,6 @@ export const getProvidersOverviewTool = tool( export const getFindingsByStatusTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getFindingsByStatusTool - ", { - page, - query, - sort, - filters, - }); return await getFindingsByStatus({ page, query, sort, filters }); }, { @@ -49,13 +37,6 @@ export const getFindingsByStatusTool = tool( export const getFindingsBySeverityTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getFindingsBySeverityTool - ", { - page, - query, - sort, - filters, - }); - // console.log("getFindingsBySeverityTool", { page, query, sort, filters }); return await getFindingsBySeverity({ page, query, sort, filters }); }, { diff --git a/ui/app/(ai)/analyst/(tools)/providers.ts b/ui/app/(ai)/analyst/(tools)/providers.ts index 633aed45ff..d9c9cc38de 100644 --- a/ui/app/(ai)/analyst/(tools)/providers.ts +++ b/ui/app/(ai)/analyst/(tools)/providers.ts @@ -5,12 +5,6 @@ import { getProviderSchema, getProvidersSchema } from "@/types/ai/providers"; export const getProvidersTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getProvidersTool - ", { - page, - query, - sort, - filters, - }); return await getProviders({ page: page, query: query, @@ -28,7 +22,6 @@ export const getProvidersTool = tool( export const getProviderTool = tool( async ({ id }) => { - console.log("=> Invoking getProviderTool - ", { id }); const formData = new FormData(); formData.append("id", id); return await getProvider(formData); diff --git a/ui/app/(ai)/analyst/(tools)/resources.ts b/ui/app/(ai)/analyst/(tools)/resources.ts index a47fcea40b..609031f7fd 100644 --- a/ui/app/(ai)/analyst/(tools)/resources.ts +++ b/ui/app/(ai)/analyst/(tools)/resources.ts @@ -5,13 +5,6 @@ import { getResourceSchema, getResourcesSchema } from "@/types/ai/resources"; export const getResourcesTool = tool( async ({ page, query, sort, filters, fields }) => { - console.log("=> Invoking getResourcesTool - ", { - page, - query, - sort, - filters, - fields, - }); return await aiGetResources(page, query, sort, filters, fields); }, { @@ -23,7 +16,6 @@ export const getResourcesTool = tool( export const getResourceTool = tool( async ({ id, fields, include }) => { - console.log("=> Invoking getResourceTool - ", { id, fields, include }); return await aiGetResource(id, fields, include); }, { diff --git a/ui/app/(ai)/analyst/(tools)/roles.ts b/ui/app/(ai)/analyst/(tools)/roles.ts index 10291dafec..d27d279ca7 100644 --- a/ui/app/(ai)/analyst/(tools)/roles.ts +++ b/ui/app/(ai)/analyst/(tools)/roles.ts @@ -5,7 +5,6 @@ import { getRoleSchema, getRolesSchema } from "@/types/ai/roles"; export const getRolesTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getRolesTool - ", { page, query, sort, filters }); return await getRoles({ page, query, sort, filters }); }, { @@ -17,7 +16,6 @@ export const getRolesTool = tool( export const getRoleTool = tool( async ({ id }) => { - console.log("=> Invoking getRoleTool - ", { id }); return await getRoleInfoById(id); }, { diff --git a/ui/app/(ai)/analyst/(tools)/scans.ts b/ui/app/(ai)/analyst/(tools)/scans.ts index 97bd1f50cc..81bd766032 100644 --- a/ui/app/(ai)/analyst/(tools)/scans.ts +++ b/ui/app/(ai)/analyst/(tools)/scans.ts @@ -5,7 +5,6 @@ import { getScanSchema, getScansSchema } from "@/types/ai/scans"; export const getScansTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getScansTool - ", { page, query, sort, filters }); const scans = await getScans({ page, query, sort, filters }); return scans; @@ -20,7 +19,6 @@ export const getScansTool = tool( export const getScanTool = tool( async ({ id }) => { - console.log("=> Invoking getScanTool - ", { id }); return await getScan(id); }, { diff --git a/ui/app/(ai)/analyst/(tools)/users.ts b/ui/app/(ai)/analyst/(tools)/users.ts index 144eedc3f1..ce0bcec91f 100644 --- a/ui/app/(ai)/analyst/(tools)/users.ts +++ b/ui/app/(ai)/analyst/(tools)/users.ts @@ -6,7 +6,6 @@ import { getUsersSchema } from "@/types/ai/users"; export const getUsersTool = tool( async ({ page, query, sort, filters }) => { - console.log("=> Invoking getUsersTool - ", { page, query, sort, filters }); return await getUsers({ page, query, sort, filters }); }, { @@ -19,7 +18,6 @@ export const getUsersTool = tool( export const getMyProfileInfoTool = tool( async () => { - console.log("=> Invoking getMyProfileInfoTool()"); return await getProfileInfo(); }, { diff --git a/ui/app/(ai)/cache/lib/cache.ts b/ui/app/(ai)/cache/lib/cache.ts index 67918789b7..e2d5de0094 100644 --- a/ui/app/(ai)/cache/lib/cache.ts +++ b/ui/app/(ai)/cache/lib/cache.ts @@ -41,8 +41,7 @@ interface CachedData { } // Function to fetch all required data from APIs -const fetchDataFromAPIs = async (userId: string): Promise => { - console.log(`[Cache MISS] Fetching data from APIs for user: ${userId}`); +const fetchDataFromAPIs = async (): Promise => { cacheMisses++; // Step 1: Get user profile data @@ -128,7 +127,7 @@ export const getCurrentUserId = async (): Promise => { // Create or update cache for a user - this will hit APIs export const createCache = async (userId: string): Promise => { - const data = await fetchDataFromAPIs(userId); + const data = await fetchDataFromAPIs(); // Store in cache cacheStore[userId] = { @@ -136,7 +135,6 @@ export const createCache = async (userId: string): Promise => { timestamp: Date.now(), }; - console.log(`Cache created/updated for user: ${userId}`); return data; }; @@ -147,7 +145,6 @@ export const getUserCache = async (): Promise => { // Check if we have cached data for this user if (userId in cacheStore) { cacheHits++; - console.log(`[Cache HIT] Using cached data for user: ${userId}`); return cacheStore[userId].data; } @@ -187,7 +184,6 @@ export const invalidateCache = async () => { delete cacheStore[userId]; cacheVersion = Date.now(); cacheCreatedAt = new Date().toISOString(); - console.log(`Cache invalidated for user: ${userId}`); } return {