feat: add bundled OpenCode skills and refine module flow
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-14 18:15:55 +08:00
parent 88f9ee8708
commit c809002180
31 changed files with 1153 additions and 241 deletions

View File

@@ -344,6 +344,40 @@ describe('AgentConversationSidebar', () => {
})));
});
it('defaults only the planning Skills and leaves presentation optional', async () => {
hostApiFetchMock.mockResolvedValue({
skills: [
{ name: 'agent-browser' },
{ name: 'frontend-slides' },
{ name: 'grilling' },
{ name: 'planning-with-files' },
],
});
const callbacks = renderSidebar();
fireEvent.click(screen.getByRole('button', { name: '创建伙伴' }));
const grilling = await screen.findByLabelText('绑定技能:方案质询');
const planning = await screen.findByLabelText('绑定技能:项目规划');
const slides = await screen.findByLabelText('绑定技能:项目演示');
const browser = await screen.findByLabelText('绑定技能:开发浏览器');
await waitFor(() => {
expect(grilling).toBeChecked();
expect(planning).toBeChecked();
expect(slides).not.toBeChecked();
expect(browser).not.toBeChecked();
});
fireEvent.click(grilling);
expect(grilling).not.toBeChecked();
fireEvent.change(screen.getByLabelText(/伙伴名称/), { target: { value: '小李' } });
fireEvent.change(screen.getByLabelText(/职责简述/), { target: { value: '负责整理资料。' } });
fireEvent.click(screen.getByRole('button', { name: '创建并开始对话' }));
await waitFor(() => expect(callbacks.onCreateAgent).toHaveBeenCalledWith(expect.objectContaining({
skillIds: ['planning-with-files'],
})));
});
it('shows advanced creation settings directly below the basics', () => {
renderSidebar();
fireEvent.click(screen.getByRole('button', { name: '创建伙伴' }));