From 053840d75584f9d41a64f83d462657716ae6d1f9 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Mon, 8 Dec 2025 10:35:52 -0700 Subject: [PATCH] refactor: use consistent return type in handleMissingCustomSources --- tools/cli/installers/lib/core/installer.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index f9cf1493..81c3f0e8 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -2596,18 +2596,7 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: installedModules, ); - // Handle both old return format (array) and new format (object) - let validCustomModules = []; - let keptModulesWithoutSources = []; - - if (Array.isArray(customModuleResult)) { - // Old format - just an array - validCustomModules = customModuleResult; - } else if (customModuleResult && typeof customModuleResult === 'object') { - // New format - object with two arrays - validCustomModules = customModuleResult.validCustomModules || []; - keptModulesWithoutSources = customModuleResult.keptModulesWithoutSources || []; - } + const { validCustomModules, keptModulesWithoutSources } = customModuleResult; const customModulesFromManifest = validCustomModules.map((m) => ({ ...m, @@ -3386,7 +3375,10 @@ If AgentVibes party mode is enabled, immediately trigger TTS with agent's voice: // If no missing sources, return immediately if (customModulesWithMissingSources.length === 0) { - return validCustomModules; + return { + validCustomModules, + keptModulesWithoutSources: [], + }; } // Stop any spinner for interactive prompts