mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-09 03:17:52 +00:00
feat: add generic user-level agent install target
Signed-off-by: betterlmy <betterlmy@icloud.com>
This commit is contained in:
parent
2e4a69d590
commit
8b84201516
2 changed files with 33 additions and 0 deletions
|
|
@ -68,6 +68,18 @@ async function resolveScopedTargets(
|
|||
}
|
||||
candidates = dedupeByRoot(candidates)
|
||||
|
||||
if (scope === 'user' && agentList.length === 0 && options.interactive && !options.json) {
|
||||
candidates = dedupeByRoot([
|
||||
...candidates,
|
||||
{
|
||||
agent: 'generic',
|
||||
rootDir: `${scopedHome}/.agents/skills`,
|
||||
scope: 'user',
|
||||
source: 'fallback'
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
if (candidates.length === 0) {
|
||||
const fallbackRoot = scope === 'user'
|
||||
? `${scopedHome}/.agents/skills`
|
||||
|
|
|
|||
|
|
@ -33,4 +33,25 @@ describe('resolveInstallTargets interactive prompt', () => {
|
|||
|
||||
expect(targets).toEqual([highlighted])
|
||||
})
|
||||
|
||||
test('offers the generic user target alongside detected agent targets', async () => {
|
||||
const targets = await resolveInstallTargets({
|
||||
cwd: '/repo',
|
||||
home: '/home/u',
|
||||
agents: [],
|
||||
scope: 'user',
|
||||
json: false,
|
||||
interactive: true,
|
||||
detected: [
|
||||
{ agent: 'codex', rootDir: '/home/u/.codex/skills', scope: 'user', source: 'detected' }
|
||||
]
|
||||
})
|
||||
|
||||
expect(targets).toEqual([{
|
||||
agent: 'generic',
|
||||
rootDir: '/home/u/.agents/skills',
|
||||
scope: 'user',
|
||||
source: 'fallback'
|
||||
}])
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue