fix(cli): reject ambiguous namespace paths (#606)

Signed-off-by: dongmucat <1127093059@qq.com>
This commit is contained in:
dongmucat 2026-07-28 11:33:45 +08:00
parent b702f0f9f6
commit bd83d2d95f
2 changed files with 5 additions and 2 deletions

View file

@ -24,7 +24,7 @@ function parseSeparatedCoordinate(
const namespace = skillName.slice(namespaceStart, separatorIndex)
const slug = skillName.slice(separatorIndex + separatorLength)
if (!namespace || !slug) {
if (!namespace || !slug || slug.includes('/')) {
throw invalidCoordinate(skillName)
}

View file

@ -44,7 +44,10 @@ describe('parseSkillName', () => {
'team/',
'/my-skill',
'--my-skill',
'team--'
'team--',
'team/my-skill/extra',
'@team/my-skill/extra',
'team--my-skill/extra'
])('rejects malformed coordinate %p', (skillName) => {
expectUsageError(() => parseSkillName(skillName))
})