@@ -211,12 +211,7 @@ export async function setupSkills(
211211 }
212212 }
213213 const candidateInstallable = installable ;
214- const needsBrewPrompt =
215- supportsHomebrewPrompt ( process . platform ) &&
216- candidateInstallable . some ( ( skill ) => skill . install . some ( ( option ) => option . kind === "brew" ) ) &&
217- ! ( await detectBrewOnce ( ) ) ;
218- const readyInstallable : typeof installable = [ ] ;
219- const skippedInstallable : SkippedInstall [ ] = [ ] ;
214+ const readinessBySkillName = new Map < string , SkillInstallReadiness > ( ) ;
220215 for ( const skill of candidateInstallable ) {
221216 // Onboarding intentionally executes only the primary recipe below. Keep
222217 // readiness aligned with that recipe instead of silently changing methods.
@@ -225,33 +220,10 @@ export async function setupSkills(
225220 continue ;
226221 }
227222 const readiness = await resolveKindReadinessOnce ( primaryInstall . kind ) ;
228- if ( readiness . ready ) {
229- readyInstallable . push ( skill ) ;
230- } else {
231- skippedInstallable . push ( { skill, reason : readiness . reason } ) ;
232- }
233- }
234- installable = readyInstallable ;
235- if ( needsBrewPrompt ) {
236- await prompter . note (
237- [
238- "Many skill dependencies are shipped via Homebrew." ,
239- "Without brew, you'll need to build from source or download releases manually." ,
240- "" ,
241- "Install Homebrew:" ,
242- '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' ,
243- ] . join ( "\n" ) ,
244- t ( "wizard.skills.homebrewRecommendedTitle" ) ,
245- ) ;
246- }
247- if ( skippedInstallable . length > 0 ) {
248- await prompter . note (
249- formatSkippedInstallNote ( skippedInstallable ) ,
250- t ( "wizard.skills.manualPrereqsTitle" ) ,
251- ) ;
223+ readinessBySkillName . set ( skill . name , readiness ) ;
252224 }
253225 let next : OpenClawConfig = cfg ;
254- if ( installable . length === 0 && missing . length === 0 ) {
226+ if ( candidateInstallable . length === 0 && missing . length === 0 ) {
255227 await prompter . note (
256228 [
257229 "No missing skill dependencies to install." ,
@@ -262,7 +234,7 @@ export async function setupSkills(
262234 ) ;
263235 return next ;
264236 }
265- if ( installable . length > 0 ) {
237+ if ( candidateInstallable . length > 0 ) {
266238 const selected = await prompter . multiselect ( {
267239 message : t ( "wizard.skills.installDeps" ) ,
268240 options : [
@@ -271,19 +243,29 @@ export async function setupSkills(
271243 label : t ( "common.skipForNow" ) ,
272244 hint : t ( "wizard.skills.skipDepsHint" ) ,
273245 } ,
274- ...installable . map ( ( skill ) => ( {
246+ ...candidateInstallable . map ( ( skill ) => ( {
275247 value : skill . name ,
276248 label : `${ skill . emoji ?? "🧩" } ${ skill . name } ` ,
277249 hint : formatSkillHint ( skill ) ,
278250 } ) ) ,
279251 ] ,
280252 } ) ;
281- const selectedNames = selected . includes ( "__skip__" ) ? [ ] : selected ;
253+ const selectedNames = selected . filter ( ( name ) => name !== "__skip__" ) ;
282254 const selectedSkills = selectedNames
283- . map ( ( name ) => installable . find ( ( skill ) => skill . name === name ) )
284- . filter ( ( skill ) : skill is ( typeof installable ) [ number ] => skill !== undefined ) ;
255+ . map ( ( name ) => candidateInstallable . find ( ( skill ) => skill . name === name ) )
256+ . filter ( ( skill ) : skill is ( typeof candidateInstallable ) [ number ] => skill !== undefined ) ;
257+ const selectedReadySkills : typeof selectedSkills = [ ] ;
258+ const selectedSkippedInstallable : SkippedInstall [ ] = [ ] ;
259+ for ( const skill of selectedSkills ) {
260+ const readiness = readinessBySkillName . get ( skill . name ) ;
261+ if ( readiness ?. ready !== false ) {
262+ selectedReadySkills . push ( skill ) ;
263+ } else {
264+ selectedSkippedInstallable . push ( { skill, reason : readiness . reason } ) ;
265+ }
266+ }
285267
286- const needsNodeManagerPrompt = selectedSkills . some ( ( skill ) =>
268+ const needsNodeManagerPrompt = selectedReadySkills . some ( ( skill ) =>
287269 skill . install . some ( ( option ) => option . kind === "node" ) ,
288270 ) ;
289271 if ( needsNodeManagerPrompt ) {
@@ -303,7 +285,7 @@ export async function setupSkills(
303285 }
304286
305287 const deferredSkippedInstallable : SkippedInstall [ ] = [ ] ;
306- for ( const target of selectedSkills ) {
288+ for ( const target of selectedReadySkills ) {
307289 if ( target . install . length === 0 ) {
308290 continue ;
309291 }
@@ -369,8 +351,26 @@ export async function setupSkills(
369351 runtime . log ( t ( "wizard.skills.docsLine" ) ) ;
370352 }
371353 if ( deferredSkippedInstallable . length > 0 ) {
354+ selectedSkippedInstallable . push ( ...deferredSkippedInstallable ) ;
355+ }
356+ if (
357+ supportsHomebrewPrompt ( process . platform ) &&
358+ selectedSkippedInstallable . some ( ( item ) => item . reason === "brew" )
359+ ) {
360+ await prompter . note (
361+ [
362+ "Many skill dependencies are shipped via Homebrew." ,
363+ "Without brew, you'll need to build from source or download releases manually." ,
364+ "" ,
365+ "Install Homebrew:" ,
366+ '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' ,
367+ ] . join ( "\n" ) ,
368+ t ( "wizard.skills.homebrewRecommendedTitle" ) ,
369+ ) ;
370+ }
371+ if ( selectedSkippedInstallable . length > 0 ) {
372372 await prompter . note (
373- formatSkippedInstallNote ( deferredSkippedInstallable ) ,
373+ formatSkippedInstallNote ( selectedSkippedInstallable ) ,
374374 t ( "wizard.skills.manualPrereqsTitle" ) ,
375375 ) ;
376376 }
0 commit comments