feat(skills): add installer execution stub command
This commit is contained in:
@@ -15,6 +15,8 @@ import {
|
||||
renderSkillInstallerPlan,
|
||||
toSkillInstallPreflightView,
|
||||
renderSkillInstallPreflight,
|
||||
toSkillInstallerExecutionStubView,
|
||||
renderSkillInstallerExecutionStub,
|
||||
} from './skills.js';
|
||||
import type { Skill } from '../skills/index.js';
|
||||
|
||||
@@ -212,6 +214,39 @@ describe('skills CLI helpers', () => {
|
||||
expect(output).toContain('[download] download https://example.com/tool.tgz -> <default destination>');
|
||||
});
|
||||
|
||||
it('builds installer execution stub view from skill plan', () => {
|
||||
const view = toSkillInstallerExecutionStubView(
|
||||
buildSkill({
|
||||
manifest: {
|
||||
name: 'exec-stub',
|
||||
description: 'Execution stub test',
|
||||
version: '1.1.0',
|
||||
tier: 'managed',
|
||||
installers: [{ type: 'download', url: 'https://example.com/tool.tgz' }],
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
expect(view.execution).toBe('stub');
|
||||
expect(view.wouldRun.length).toBe(1);
|
||||
expect(view.wouldRun[0]).toContain('download https://example.com/tool.tgz');
|
||||
});
|
||||
|
||||
it('renders installer execution stub output text', () => {
|
||||
const output = renderSkillInstallerExecutionStub({
|
||||
skill: { name: 'exec-stub', tier: 'bundled', version: '1.0.0' },
|
||||
execution: 'stub',
|
||||
wouldRun: ['brew install jq'],
|
||||
skipped: [{ installerType: 'node', reason: 'neither pnpm nor npm available in PATH' }],
|
||||
});
|
||||
|
||||
expect(output).toContain("Installer execution stub for 'exec-stub'");
|
||||
expect(output).toContain('No installer commands were executed.');
|
||||
expect(output).toContain('Would run:');
|
||||
expect(output).toContain('- brew install jq');
|
||||
expect(output).toContain('Skipped:');
|
||||
});
|
||||
|
||||
it('summarizes refresh counts across status and tiers', () => {
|
||||
const summary = summarizeSkillsRefresh([
|
||||
buildSkill({ manifest: { name: 'a', description: 'a', version: '1.0.0', tier: 'bundled' } }),
|
||||
|
||||
Reference in New Issue
Block a user