feat: MVU规则模块+世界书MVU过滤+prompt组装MVU清洗+端到端测试

This commit is contained in:
Youzini-afk
2026-03-27 15:22:00 +08:00
parent a5ab93e701
commit cf4a73e0a8
10 changed files with 1341 additions and 28 deletions

View File

@@ -402,6 +402,22 @@ async function resolveEntry(renderCtx, currentWorldbook, worldbookOrEntry, entry
renderCtx.allEntries.get(identifier);
}
if (
!resolved &&
typeof renderCtx.resolveIgnoredEntry === "function"
) {
const ignoredEntry =
renderCtx.resolveIgnoredEntry(explicitWorldbook || fallbackWorldbook, identifier) ||
renderCtx.resolveIgnoredEntry("", identifier);
if (ignoredEntry) {
const descriptor = ignoredEntry.sourceName || ignoredEntry.name || identifier;
recordRenderWarning(
renderCtx,
`mvu filtered world info blocked: ${ignoredEntry.worldbook ? `${ignoredEntry.worldbook}/` : ""}${descriptor}`,
);
}
}
return resolved;
}
@@ -631,6 +647,10 @@ export function createTaskEjsRenderContext(entries = [], options = {}) {
typeof options.loadWorldbookEntries === "function"
? options.loadWorldbookEntries
: null,
resolveIgnoredEntry:
typeof options.resolveIgnoredEntry === "function"
? options.resolveIgnoredEntry
: null,
templateContext: {
...(options.templateContext || {}),
hostSnapshot: hostSnapshot.snapshot,