feat(plugins): merge Skill management into plugins

This commit is contained in:
inman committed 2026-09-07 18:36:33 +08:00
1 parent bb8a19eecf
commit ab9f889233
49 files changed
+461 -1218

No files matched your search

+14 -9
View File
@@ -201,27 +201,32 @@ describe('PI-090 product tools', () => {
)).rejects.toThrow('project-relative');
});
it('projects only bundled selected skills and safe command metadata', async () => {
it('projects only Plugin-delivered selected Skills and safe command metadata', async () => {
const pluginRoot = path.resolve('resources/coding-plugins/data-service');
const skills = await listProductCodingSkills(
path.resolve('resources/coding-skills'),
['agent-browser', 'grilling'],
['data-service'],
[{
id: 'data-service',
pluginId: 'makelore.data-service',
directory: pluginRoot,
entryPath: 'skills/data-service/SKILL.md',
}],
);
expect(skills.filter(({ selected }) => selected).map(({ id }) => id)).toEqual([
'agent-browser', 'grilling',
]);
expect(skills[0]?.location).toBe('resources/coding-skills/agent-browser');
expect(JSON.stringify(skills)).not.toContain(path.resolve('resources/coding-skills'));
expect(skills.filter(({ selected }) => selected).map(({ id }) => id)).toEqual(['data-service']);
expect(skills[0]?.location).toBe(pluginRoot);
expect(JSON.stringify(skills)).not.toContain('resources/coding-skills');
const commands = buildProductCodingCommandCatalog(skills, [
{ name: 'custom', description: 'Custom Pi command' },
{ name: 'compact', description: 'Must not shadow Makelore' },
]);
expect(commands).toContainEqual(expect.objectContaining({ name: 'compact', source: 'makelore' }));
expect(commands).toContainEqual(expect.objectContaining({ name: 'custom', source: 'pi' }));
expect(commands).toContainEqual(expect.objectContaining({ name: 'agent-browser', source: 'skill' }));
expect(commands).toContainEqual(expect.objectContaining({ name: 'data-service', source: 'skill' }));
expect(commands.some(({ name }) => name === 'planning-with-files')).toBe(false);
await expect(listProductCodingSkills(
path.resolve('resources/coding-skills'), ['not-installed'],
)).rejects.toThrow('Unknown bundled coding skill');
)).resolves.toEqual([]);
});
it('hides unassigned disabled plugin Skills and retains assigned ones as ineffective', async () => {