feat(card): show cached netx skills per capability group

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
oliver 2026-10-16 23:23:40 +08:00
parent fa82f530e9
commit 056f2d4ea3
9 changed files with 285 additions and 96 deletions

View file

@ -14,6 +14,7 @@ import { refreshMcpCatalog, resetMcpCatalog } from '../src/netx/mcp-store.ts'
import { publishNetxConnection } from '../src/netx/runtime.ts'
import {
hasSkillsCache,
listCachedSkills,
replaceSkillsCache,
skillsCacheDir,
} from '../src/netx/skills-cache.ts'
@ -348,3 +349,19 @@ test('group off → skill not registered', async (t) => {
await registerGroupSkills(ctx, [], 'test')
assert.equal(registered.length, 0)
})
test('listCachedSkills summarizes cached skills per group for the Plugins card', async (t) => {
withTempHome(t)
replaceSkillsCache(API, [
{ group: 'ops', skill: 'netx-ops', relPath: 'SKILL.md', text: OPS_SKILL },
{ group: 'ops', skill: 'netx-ops', relPath: 'reference.md', text: 'ref' },
{ group: 'bizMonitor', skill: 'netx-biz-monitor', relPath: 'SKILL.md', text: OPS_SKILL },
])
const { listedAt, skills } = listCachedSkills(API)
assert.ok(listedAt)
assert.deepEqual(skills, [
{ group: 'ops', name: 'netx-ops', files: 2 },
{ group: 'bizMonitor', name: 'netx-biz-monitor', files: 1 },
])
assert.deepEqual(listCachedSkills('').skills, [])
})