feat: add pluggable Excel analyst report guard
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
This commit is contained in:
@@ -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/);
|
||||
|
||||
Reference in New Issue
Block a user