fix: guard WeChat Page Data delivery with Aider review
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:
@@ -1,4 +1,8 @@
|
||||
import { buildAutoChatSkillPrefix, isPageDataIntent } from '../../chat-skills.mjs';
|
||||
import {
|
||||
buildAutoChatSkillPrefix,
|
||||
isPageDataDevIntent,
|
||||
isPageDataIntent,
|
||||
} from '../../chat-skills.mjs';
|
||||
import { shouldUseScheduleAssistant } from '../../schedule-intent.mjs';
|
||||
import { buildCurrentTimeAgentPrefix } from '../../user-memory-profile.mjs';
|
||||
import { isPageGenerateText, wantsDocxDownload } from '../intent/patterns.mjs';
|
||||
@@ -42,6 +46,16 @@ export function buildWechatAgentPrompt(intent, { grantedSkills = [], imagePolicy
|
||||
'',
|
||||
].join('\n')
|
||||
: '';
|
||||
const pageDataRepairHint = isPageDataDevIntent(agentText)
|
||||
? [
|
||||
'【Page Data 修复要求】这条消息是在修复现有数据页面,不是普通静态页面修改。',
|
||||
'开始前必须先调用 `load_skill` → `page-data-collect`,检查本轮目标 HTML、dataset、真实表、page policy 与 bind 是否一致。',
|
||||
'缺表、dataset 未注册或 bind 不完整时,必须用 private_data_* 工具补齐;禁止只改前端后声称保存成功。',
|
||||
'HTML 必须使用 /assets/page-data-client.js 和服务端 authenticate/listRows/insertRow,禁止前端硬编码口令和浏览器本地存储 fallback。',
|
||||
'完成后必须重新执行提交/读取交付验收;未通过前不要发送链接或说“已修复”。',
|
||||
'',
|
||||
].join('\n')
|
||||
: '';
|
||||
const scheduleTimezone = process.env.H5_DEFAULT_TIMEZONE || 'Asia/Shanghai';
|
||||
const currentTimeHint = buildCurrentTimeAgentPrefix({ timezone: scheduleTimezone });
|
||||
const scheduleAssistantHint = shouldUseScheduleAssistant(agentText)
|
||||
@@ -63,6 +77,7 @@ export function buildWechatAgentPrompt(intent, { grantedSkills = [], imagePolicy
|
||||
return [
|
||||
docxDownloadHint,
|
||||
pageDataCollectHint,
|
||||
pageDataRepairHint,
|
||||
currentTimeHint,
|
||||
scheduleAssistantHint,
|
||||
imageGenerationHint,
|
||||
@@ -140,6 +155,7 @@ export function buildWechatAgentPrompt(intent, { grantedSkills = [], imagePolicy
|
||||
}
|
||||
if (docxDownloadHint) lines.push(docxDownloadHint);
|
||||
if (pageDataCollectHint) lines.push(pageDataCollectHint);
|
||||
if (pageDataRepairHint) lines.push(pageDataRepairHint);
|
||||
if (pagePublishHint) lines.push(pagePublishHint);
|
||||
if (scheduleAssistantHint) lines.push(scheduleAssistantHint);
|
||||
if (imageGenerationHint) lines.push(imageGenerationHint);
|
||||
|
||||
Reference in New Issue
Block a user