feat(plugins): merge Skill management into plugins

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

View File

@@ -4,8 +4,8 @@ import path from 'node:path';
import { closeElectronApp, expect, getStableWindow, test } from './fixtures/electron';
import { createCodingProjectConfigV2 } from '../../electron/coding-projects/project-config';
test.describe('Project configuration skills', () => {
test('does not expose the removed Superpowers feature and supports Skill details', async ({ launchElectronApp }) => {
test.describe('Project configuration plugin capabilities', () => {
test('merges Skill management into the plugin tabs and removes standalone local Skills', async ({ launchElectronApp }) => {
const parentPath = await mkdtemp(path.join(tmpdir(), 'makelore-project-configuration-e2e-'));
const app = await launchElectronApp({ skipSetup: true });
@@ -52,7 +52,7 @@ test.describe('Project configuration skills', () => {
const rect = card.getBoundingClientRect();
return { left: rect.left, top: rect.top, width: rect.width };
}));
expect(resourceCardGeometry).toHaveLength(4);
expect(resourceCardGeometry).toHaveLength(3);
expect(Math.max(...resourceCardGeometry.map(({ top }) => top)) - Math.min(...resourceCardGeometry.map(({ top }) => top))).toBeLessThanOrEqual(1);
expect(resourceCardGeometry.every(({ width }) => width > 0)).toBe(true);
expect(resourceCardGeometry.map(({ left }) => left)).toEqual([...resourceCardGeometry.map(({ left }) => left)].sort((a, b) => a - b));
@@ -60,7 +60,6 @@ test.describe('Project configuration skills', () => {
const drawerWidths: number[] = [];
for (const [resourceId, title] of [
['resource-card-models', '可用模型'],
['resource-card-skills', '可用技能'],
['resource-card-knowledge', '知识文件'],
['resource-card-plugins', '插件'],
] as const) {
@@ -77,7 +76,9 @@ test.describe('Project configuration skills', () => {
if (resourceId === 'resource-card-plugins') {
await expect(page.getByTestId('project-plugins-sheet')).toBeVisible();
await expect(drawer.getByTestId('plugins-page')).toBeVisible();
await expect(drawer.getByText('为你的智能体添加插件,拓展更多能力。')).toBeVisible();
await expect(drawer.getByText('统一管理云端下发的插件与 Skill,以及本机安装的能力。')).toBeVisible();
await expect(drawer.getByRole('tab', { name: /可选/ })).toBeVisible();
await expect(drawer.getByRole('tab', { name: /已安装/ })).toBeVisible();
await expect(drawer.getByRole('button', { name: /刷新/ })).toHaveCount(0);
await expect(drawer.getByRole('searchbox')).toHaveCount(0);
await expect(drawer.getByRole('combobox')).toHaveCount(0);
@@ -120,7 +121,7 @@ test.describe('Project configuration skills', () => {
enabled: true,
model: { accountId: 'moonshot', modelId: 'kimi-k2.6', thinkingLevel: 'off' },
modelResolution: 'resolved',
skillIds: [],
skillIds: ['agent-browser', 'grilling'],
responsibility: { mission: '验证智能体编辑弹窗。', owns: [], boundaries: [], collaborators: [], principles: [] },
prompt: '',
archivedAt: null,
@@ -135,18 +136,12 @@ test.describe('Project configuration skills', () => {
await expect(page.getByTestId('legacy-project-identity-card')).toHaveCount(0);
await expect(page.getByText(/项目 ID|项目身份|独立副本/u)).toHaveCount(0);
await page.getByTestId('resource-card-skills').click();
await expect(page.getByTestId('resource-card-skills')).toHaveCount(0);
await expect(page.getByTestId('project-agent-e2e-agent')).toContainText('0 项插件能力');
await expect(page.getByTestId('superpowers-card')).toHaveCount(0);
await expect(page.getByRole('switch', { name: '启用 Superpowers' })).toHaveCount(0);
await expect(page.getByTestId('skill-card-agent-browser')).toBeVisible();
await page.getByTestId('skill-card-agent-browser').click();
await expect(page.getByTestId('skill-detail-view')).toBeVisible();
await expect(page.getByTestId('skill-structure')).toContainText('SKILL.md');
await expect(page.getByTestId('skill-main-file')).toContainText('# Makelore 开发浏览器');
await page.getByRole('button', { name: '返回技能列表' }).locator('svg').click();
await expect(page.getByTestId('skill-card-agent-browser')).toBeVisible();
await expect(page.getByTestId('skill-card-agent-browser')).toHaveCount(0);
await expect(page.getByTestId('skill-card-game-engine')).toHaveCount(0);
await page.getByRole('button', { name: '关闭' }).click();
await expect(page.getByTestId('resource-card-publish')).toHaveCount(0);
await expect(page.getByRole('button', { name: '一键提交审核' })).toBeVisible();