feat: add pluggable Excel analyst report guard
Memind CI / Test, build, and release guards (push) Has been cancelled

This commit is contained in:
john
2026-07-17 11:52:21 +08:00
parent 75b32d959c
commit 0c1c0c3b48
20 changed files with 2099 additions and 8 deletions
+12
View File
@@ -5,6 +5,7 @@ import {
buildChatSkillPrompt,
CHAT_SKILL_DEFINITIONS,
filterChatSkills,
isExcelAnalysisIntent,
isPageDataIntent,
isPageGenerationIntent,
} from './chat-skills.mjs';
@@ -84,6 +85,17 @@ test('buildAutoChatSkillPrefix enables web for news-like queries', () => {
assert.equal(buildAutoChatSkillPrefix('帮我搜索今天热点新闻', ['search']), '');
});
test('buildAutoChatSkillPrefix routes an uploaded xlsx only when Excel Analyst is granted', () => {
const text = '帮我分析一下\n\n[文件1: sales.xlsx]: /api/mindspace/v1/assets/asset-1/download';
assert.match(
buildAutoChatSkillPrefix(text, ['excel-analyst']),
/excel_inspect/,
);
assert.equal(buildAutoChatSkillPrefix(text, []), '');
assert.equal(isExcelAnalysisIntent('请分析这份工作簿的销售趋势'), true);
assert.equal(isExcelAnalysisIntent('请总结这段普通文字'), false);
});
test('manifest enhanced search route is opt-in and uses the MindSearch skill prompt', () => {
const routes = [{ skillName: 'search-enhanced', promptKey: 'search-enhanced', keywords: ['最新资料'], priority: 30 }];
assert.match(buildAutoChatSkillPrefix('请搜索最新资料:Goose MCP', ['search-enhanced'], { skillRouterV2: true, manifestRoutes: routes }), /tkmind-search/);