feat(skills): add dry-run installer planning surface
This commit is contained in:
+18
-1
@@ -2,7 +2,7 @@ import type { Command } from 'commander';
|
||||
import { resolve } from 'path';
|
||||
import { homedir } from 'os';
|
||||
import type { Skill } from '../skills/index.js';
|
||||
import { loadAllSkills, SkillInstaller } from '../skills/index.js';
|
||||
import { loadAllSkills, SkillInstaller, buildInstallerPlan } from '../skills/index.js';
|
||||
import { loadConfigSafe } from './shared.js';
|
||||
|
||||
export interface SkillListRow {
|
||||
@@ -75,6 +75,23 @@ export function renderSkillInfo(skill: Skill): string {
|
||||
lines.push(`Unavailable reasons: ${skill.unavailableReasons.join('; ')}`);
|
||||
}
|
||||
|
||||
if (skill.manifest.installers && skill.manifest.installers.length > 0) {
|
||||
const plan = buildInstallerPlan(skill.manifest.installers);
|
||||
lines.push(`Installer plan mode: ${plan.mode}`);
|
||||
if (plan.steps.length > 0) {
|
||||
lines.push('Installer planned steps:');
|
||||
for (const step of plan.steps) {
|
||||
lines.push(`- [${step.installerType}] ${step.command}`);
|
||||
}
|
||||
}
|
||||
if (plan.skipped.length > 0) {
|
||||
lines.push('Installer skipped steps:');
|
||||
for (const skip of plan.skipped) {
|
||||
lines.push(`- [${skip.installerType}] ${skip.reason}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user