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

+3 -35
View File
@@ -71,43 +71,11 @@ describe('Makelore character scene partner profiles', () => {
expect(hostApiFetchMock.mock.calls.some(([path]) => String(path).includes('/api/coding/agents'))).toBe(false);
});
it('opens an installed Skill detail with its structure and main file', async () => {
const project = {
id: 'project-1',
path: 'D:/projects/project-1',
name: '详情测试项目',
createdAt: '2026-01-01T00:00:00.000Z',
updatedAt: '2026-01-01T00:00:00.000Z',
lastOpenedAt: '2026-01-01T00:00:00.000Z',
};
codingWorkspaceStore.setState({ activeProject: project, projects: [project] });
hostApiFetchMock.mockResolvedValue({
skills: [{
id: 'agent-browser',
name: 'agent-browser',
description: 'E2E browser debugging skill.',
location: 'D:/managed/skills/agent-browser/SKILL.md',
content: '# Browser debugging',
entries: [
{ path: 'references', type: 'directory' },
{ path: 'references/guide.md', type: 'file' },
{ path: 'SKILL.md', type: 'file' },
],
}],
});
it('routes Skill management through the merged plugin module', () => {
render(<MemoryRouter><CharacterScene /></MemoryRouter>);
fireEvent.click(screen.getByTestId('resource-card-skills'));
await screen.findByText('本地已安装');
fireEvent.click(screen.getByTestId('skill-library-card-agent-browser'));
expect(await screen.findByTestId('skill-detail-view')).toBeInTheDocument();
expect(screen.getByTestId('skill-structure')).toHaveTextContent('references/guide.md');
expect(screen.getByTestId('skill-main-file')).toHaveTextContent('# Browser debugging');
fireEvent.click(screen.getByRole('button', { name: '返回技能列表' }));
expect(await screen.findByTestId('skill-library-card-agent-browser')).toBeInTheDocument();
expect(screen.getByTestId('resource-card-plugins')).toHaveTextContent('可选与已安装');
expect(screen.queryByTestId('resource-card-skills')).not.toBeInTheDocument();
});
it('defers the automatic model refresh and applies it only after an explicit click', async () => {