feat: complete Aider Page Data review workflow

This commit is contained in:
john
2026-07-25 09:47:25 +08:00
parent be9c25f1d0
commit 104fb4e370
15 changed files with 914 additions and 30 deletions
+39
View File
@@ -5,11 +5,13 @@ import {
buildChatSkillPrompt,
CHAT_SKILL_DEFINITIONS,
filterChatSkills,
extractAiderDevelopmentTask,
isExcelAnalysisIntent,
isPageDataDevIntent,
isPageDataIntent,
isPageGenerationIntent,
isGenericPageGenerationRequest,
mergeChatSkillPromptWithInput,
} from './chat-skills.mjs';
test('filterChatSkills shows summarize and analyze without granted skills', () => {
@@ -47,6 +49,36 @@ test('filterChatSkills shows service integration smoke when granted', () => {
assert.ok(visible.some((item) => item.id === 'service-integration-smoke'));
});
test('Aider development skill prefills instead of submitting an empty template', () => {
const aider = CHAT_SKILL_DEFINITIONS.find((item) => item.id === 'aider-development');
assert.equal(aider?.prefillOnly, true);
});
test('mergeChatSkillPromptWithInput preserves an existing user task', () => {
const prompt = buildChatSkillPrompt('aider-development', 'aider-development');
const task = '帮我设计一个简单下单系统,不要支付,可以有简单后台';
assert.equal(mergeChatSkillPromptWithInput(prompt, task), `${prompt}${task}`);
assert.equal(mergeChatSkillPromptWithInput(prompt, `${prompt}${task}`), `${prompt}${task}`);
});
test('extractAiderDevelopmentTask rejects the template-only submission', () => {
const prompt = buildChatSkillPrompt('aider-development', 'aider-development');
assert.equal(
extractAiderDevelopmentTask({
metadata: { displayText: prompt },
content: [{ type: 'text', text: prompt }],
}),
'',
);
assert.equal(
extractAiderDevelopmentTask({
metadata: { displayText: `${prompt}修复页面` },
content: [{ type: 'text', text: `${prompt}修复页面` }],
}),
'修复页面',
);
});
test('filterChatSkills only shows Aider development when granted', () => {
const hidden = filterChatSkills(CHAT_SKILL_DEFINITIONS, {
canPublish: false,
@@ -176,6 +208,13 @@ test('isPageDataIntent treats storefront ordering plus product administration as
);
});
test('isPageDataIntent recognizes order systems with an admin backend', () => {
assert.equal(
isPageDataIntent('帮我设计一个简单下单系统,不要支付,可以有简单后台管理订单'),
true,
);
});
test('isPageDataIntent matches implicit interactive sticky-note app requests', () => {
const text = '帮我设计一个便签提醒,可以写便签提交,时间轴来显示';
assert.equal(isPageDataIntent(text), true);