mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-25 06:36:49 +09:00
fix(ruflo-console): skills add checks the listed name without case (the CLI lowercases on install)
Co-Authored-By: RuFlo <ruv@ruv.net>
This commit is contained in:
1 parent
ea0a8d7b4c
commit
d59daa3c4c
2 files changed
+7
-5
No files matched your search
@@ -150,7 +150,8 @@ function change(state: State, host: Host, label: string, argv: readonly string[]
|
||||
}
|
||||
}
|
||||
|
||||
const isIn = (name: string, scope: Scope) => (installed: InstalledSkill[]) => installed.some(skill => skill.name === name && skill.scope === scope)
|
||||
/** The CLI lowercases a skill's folder name on install, so a listed name is matched without case. */
|
||||
const isIn = (name: string, scope: Scope) => (installed: InstalledSkill[]) => installed.some(skill => skill.name.toLowerCase() === name.toLowerCase() && skill.scope === scope)
|
||||
|
||||
export function addSpec(state: State, host: Host, found: FoundSkill, scope: Scope): ActionSpec | null {
|
||||
const id = skillIdOf(found.id)
|
||||
|
||||
@@ -146,19 +146,20 @@ describe('the skills actions', () => {
|
||||
|
||||
return argv[3] === 'ls' ? { exitCode: 0, stdout: argv.includes('-g') ? '[]' : JSON.stringify(isAdded ? [{ name: 'tdd', path: '/work/.agents/skills/tdd', scope: 'project', agents: ['Claude Code'] }] : []), stderr: '' } : { exitCode: 0, stdout: 'Installed tdd\n', stderr: '' }
|
||||
})
|
||||
const spec = addSpec(state, host, { id: 'mattpocock/skills@tdd' }, 'project')
|
||||
// Listed lowercase, as the CLI installs it: the check still finds it.
|
||||
const spec = addSpec(state, host, { id: 'mattpocock/skills@TDD' }, 'project')
|
||||
|
||||
runner.ask(spec, '')
|
||||
expect(state.pending?.shows).toBe('npx -y skills add mattpocock/skills@tdd -y')
|
||||
expect(state.pending?.shows).toBe('npx -y skills add mattpocock/skills@TDD -y')
|
||||
expect(runs).toEqual([])
|
||||
|
||||
await runner.confirm()
|
||||
for (let i = 0; i < 20 && state.skills.busy !== null; i++) await settle()
|
||||
await settle()
|
||||
|
||||
expect(runs[0]).toEqual(['npx', '-y', 'skills', 'add', 'mattpocock/skills@tdd', '-y'])
|
||||
expect(runs[0]).toEqual(['npx', '-y', 'skills', 'add', 'mattpocock/skills@TDD', '-y'])
|
||||
expect(runs.slice(1).map(argv => argv[3])).toEqual(['ls', 'ls'])
|
||||
expect(state.outcome).toMatchObject({ label: 'add skill mattpocock/skills@tdd to this project', ok: true, verified: 'yes' })
|
||||
expect(state.outcome).toMatchObject({ label: 'add skill mattpocock/skills@TDD to this project', ok: true, verified: 'yes' })
|
||||
expect(state.skills.last?.label).toBe(state.outcome?.label)
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user