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:
@@ -10,6 +10,11 @@ import {
|
||||
materializeMissingPublicHtmlWrites,
|
||||
} from './mindspace-public-finish-sync.mjs';
|
||||
import { scanWorkspaceFilesForProhibitedBrowserStorage } from './mindspace-browser-storage-policy.mjs';
|
||||
import {
|
||||
buildPageTemplateRepairPrompt,
|
||||
collectPageTemplateViolations,
|
||||
resolveSelectedPageTemplateSkill,
|
||||
} from './page-template-enforcement.mjs';
|
||||
|
||||
const PUBLIC_HTML_PATH_PATTERN_GLOBAL = /(?:^|[^a-z0-9_./-])(public\/[a-z0-9][a-z0-9._/-]{0,255}\.html)\b/gi;
|
||||
const PUBLIC_ASSET_ATTR_PATTERN = /(?:href|src)=["']([^"'#?\s]+)["']/gi;
|
||||
@@ -192,6 +197,7 @@ export function evaluateH5HtmlFinishGuard({
|
||||
currentUser,
|
||||
publishDir,
|
||||
syncResult = null,
|
||||
h5Root = process.cwd(),
|
||||
} = {}) {
|
||||
materializeMissingPublicHtmlWrites({ messages, publishDir });
|
||||
const missingHtml = collectMissingPublicHtmlPaths(messages, currentUser, publishDir);
|
||||
@@ -200,6 +206,12 @@ export function evaluateH5HtmlFinishGuard({
|
||||
publishDir,
|
||||
relativePaths: collectTouchedPublicCodePaths(messages, publishDir, syncResult),
|
||||
});
|
||||
const pageTemplateViolations = collectPageTemplateViolations({
|
||||
messages,
|
||||
publishDir,
|
||||
syncResult,
|
||||
h5Root,
|
||||
});
|
||||
|
||||
const lastAssistant = [...(Array.isArray(messages) ? messages : [])]
|
||||
.reverse()
|
||||
@@ -225,6 +237,7 @@ export function evaluateH5HtmlFinishGuard({
|
||||
missingHtml.length > 0 ||
|
||||
missingAssets.length > 0 ||
|
||||
browserStorageViolations.length > 0 ||
|
||||
pageTemplateViolations.length > 0 ||
|
||||
htmlGenerationNeedsRetry;
|
||||
|
||||
return {
|
||||
@@ -232,6 +245,8 @@ export function evaluateH5HtmlFinishGuard({
|
||||
missingHtml,
|
||||
missingAssets,
|
||||
browserStorageViolations,
|
||||
pageTemplateViolations,
|
||||
pageTemplateSkill: resolveSelectedPageTemplateSkill(messages),
|
||||
htmlGenerationNeedsRetry,
|
||||
linkExists,
|
||||
};
|
||||
@@ -241,7 +256,12 @@ export function buildH5HtmlRepairPrompt({
|
||||
missingHtml = [],
|
||||
missingAssets = [],
|
||||
browserStorageViolations = [],
|
||||
pageTemplateViolations = [],
|
||||
pageTemplateSkill = null,
|
||||
} = {}) {
|
||||
if (pageTemplateViolations.length && pageTemplateSkill) {
|
||||
return buildPageTemplateRepairPrompt(pageTemplateViolations, pageTemplateSkill);
|
||||
}
|
||||
const lines = [
|
||||
'【系统补盘请求】检测到 public 页面交付不完整。请立即使用 write_file 写入缺失文件(完整内容),并在完成后确认磁盘存在。',
|
||||
'要求:先 load_skill static-page-publish,再逐个 write_file;不要用空回复或仅 edit_file 改 HTML 代替资源落盘。',
|
||||
|
||||
Reference in New Issue
Block a user