feat(skills): add optional shell command runner
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
mergeInstallerExecutionResults,
|
||||
runInstallerCommandsWithPolicy,
|
||||
noOpSkillInstallerCommandRunner,
|
||||
createShellSkillInstallerCommandRunner,
|
||||
runSkillInstallAction,
|
||||
} from './skills.js';
|
||||
import type { Skill } from '../skills/index.js';
|
||||
@@ -376,6 +377,33 @@ describe('skills CLI helpers', () => {
|
||||
expect(runner.run).toHaveBeenCalledWith(['brew install jq']);
|
||||
});
|
||||
|
||||
it('shell command runner reports succeeded command status', () => {
|
||||
const runner = createShellSkillInstallerCommandRunner();
|
||||
|
||||
const results = runner.run(['node -e "process.exit(0)"']);
|
||||
|
||||
expect(results).toEqual([
|
||||
{
|
||||
command: 'node -e "process.exit(0)"',
|
||||
status: 'succeeded',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('shell command runner reports failed command with exit code reason', () => {
|
||||
const runner = createShellSkillInstallerCommandRunner();
|
||||
|
||||
const results = runner.run(['node -e "process.exit(7)"']);
|
||||
|
||||
expect(results).toEqual([
|
||||
{
|
||||
command: 'node -e "process.exit(7)"',
|
||||
status: 'failed',
|
||||
reason: 'exit_code_7',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('maps runner command results into structured per-step statuses', () => {
|
||||
const attempted = [
|
||||
{ installer_type: 'brew', command: 'brew install jq' },
|
||||
|
||||
Reference in New Issue
Block a user