feat(mindspace): add SEO/GEO delivery, page template catalog, and admin hooks
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
Enable optional SEO/GEO injection and discovery routes for confirmed public pages while keeping private pages noindex. Add premium page template skills, portal catalog API, template shop UI, and Baidu push gated by memind_adm config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
isPageGenerationIntent,
|
||||
isGenericPageGenerationRequest,
|
||||
mergeChatSkillPromptWithInput,
|
||||
applyPageTemplatePrefill,
|
||||
} from './chat-skills.mjs';
|
||||
|
||||
test('filterChatSkills shows summarize and analyze without granted skills', () => {
|
||||
@@ -61,6 +62,17 @@ test('mergeChatSkillPromptWithInput preserves an existing user task', () => {
|
||||
assert.equal(mergeChatSkillPromptWithInput(prompt, `${prompt}${task}`), `${prompt}${task}`);
|
||||
});
|
||||
|
||||
test('applyPageTemplatePrefill replaces previous template prompt instead of stacking', () => {
|
||||
const travel = buildChatSkillPrompt('page-template-travel', 'page-template-travel');
|
||||
const restaurant = buildChatSkillPrompt('page-template-restaurant', 'page-template-restaurant');
|
||||
const userTask = '周末去杭州';
|
||||
const withTravel = applyPageTemplatePrefill(travel, userTask);
|
||||
assert.equal(withTravel, `${travel}${userTask}`);
|
||||
const switched = applyPageTemplatePrefill(restaurant, withTravel);
|
||||
assert.equal(switched, `${restaurant}${userTask}`);
|
||||
assert.equal(applyPageTemplatePrefill('', switched), userTask);
|
||||
});
|
||||
|
||||
test('extractAiderDevelopmentTask rejects the template-only submission', () => {
|
||||
const prompt = buildChatSkillPrompt('aider-development', 'aider-development');
|
||||
assert.equal(
|
||||
@@ -105,6 +117,16 @@ test('filterChatSkills shows generate-page when publish is allowed', () => {
|
||||
assert.ok(visible.some((item) => item.id === 'generate-page'));
|
||||
});
|
||||
|
||||
test('filterChatSkills shows page templates when granted', () => {
|
||||
const visible = filterChatSkills(CHAT_SKILL_DEFINITIONS, {
|
||||
canPublish: true,
|
||||
grantedSkills: ['page-template-travel', 'page-template-campaign'],
|
||||
});
|
||||
assert.ok(visible.some((item) => item.id === 'page-template-travel'));
|
||||
assert.ok(visible.some((item) => item.id === 'page-template-campaign'));
|
||||
assert.equal(visible.some((item) => item.id === 'page-template-survey'), false);
|
||||
});
|
||||
|
||||
test('buildChatSkillPrompt includes skill name for platform skills', () => {
|
||||
const webPrompt = buildChatSkillPrompt('web', 'web');
|
||||
assert.match(webPrompt, /请使用 web 技能/);
|
||||
@@ -126,6 +148,9 @@ test('buildChatSkillPrompt includes skill name for platform skills', () => {
|
||||
assert.match(buildChatSkillPrompt('generate-page'), /generate_long_image/);
|
||||
assert.match(buildChatSkillPrompt('page-data-collect'), /Page Data API/);
|
||||
assert.match(buildChatSkillPrompt('page-data-collect'), /禁止自建 Express/);
|
||||
assert.match(buildChatSkillPrompt('page-template-travel'), /travel-hero/);
|
||||
assert.match(buildChatSkillPrompt('page-template-campaign'), /campaign-cta/);
|
||||
assert.match(buildChatSkillPrompt('page-template-survey'), /page-data-collect/);
|
||||
});
|
||||
|
||||
test('prefillOnly is set for open-ended chat skills', () => {
|
||||
|
||||
Reference in New Issue
Block a user