Classify WeChat page refine and MindSpace URL edits as page.generate.
Memind CI / Test, build, and release guards (push) Has been cancelled

Fixes Tang-style follow-ups like「页面还不够详细」or linked HTML update requests from falling through to Goose chat and hitting stale providers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-31 10:44:50 +08:00
parent 61ba554feb
commit dc948e10c9
2 changed files with 31 additions and 0 deletions
+14
View File
@@ -21,6 +21,13 @@ export const PAGE_GENERATE_FORMAT_PATTERN =
export const PAGE_GENERATE_GUIDE_PATTERN =
/(?:帮我.{0,12})?(?:做|写|生成|整理).{0,48}(?:游玩|旅行|旅游)?(?:攻略|指南|行程)(?!.*(?:不要|别|无需).*(?:页面|网页))/iu;
/** 已有页面的补充/细化(含带 MindSpace URL 的改页请求) */
export const PAGE_REFINE_DETAIL_PATTERN =
/(?:页面|网页|html|攻略).{0,40}(?:不够详细|不够完整|更详细|详细到|补充|完善|优化)|(?:把|将).{0,16}(?:页面|网页|攻略).{0,32}(?:更新|改|完善|补充|优化|加长)/iu;
export const PAGE_MINDSPACE_PUBLIC_URL_PATTERN =
/(?:https?:\/\/[^\s]+)?\/?mindspace\/[0-9a-f-]{36}\/public\/[\w.-]+\.html/iu;
export const PAGE_GENERATE_NEGATION_PATTERN =
/(?:不要|无需|不用|别|不需要)\s*(?:再\s*)?(?:生成|创建|制作|做|写)\s*(?:任何|一个|新的)?\s*(?:html|页面|网页|page|文件)/iu;
@@ -43,6 +50,13 @@ export function isPageGenerateText(text) {
const normalized = String(text ?? '').trim();
if (!normalized) return false;
if (PAGE_GENERATE_NEGATION_PATTERN.test(normalized)) return false;
if (PAGE_REFINE_DETAIL_PATTERN.test(normalized)) return true;
if (
PAGE_MINDSPACE_PUBLIC_URL_PATTERN.test(normalized)
&& /(?:页面|网页|更新|详细|改|完善|补充)/iu.test(normalized)
) {
return true;
}
return (
PAGE_GENERATE_PATTERN.test(normalized)
|| PAGE_GENERATE_AFTER_PAGE_PATTERN.test(normalized)