mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 10:30:24 +08:00
fix: 第一轮注入后不再钉上一轮整段系统提示 (#25)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f5f57b4669
commit
30bdb49958
4 files changed
+2
-9
No files matched your search
@@ -188,14 +188,12 @@ function normalizeRewriteOptions(fallbackInject, options) {
|
||||
fallbackInject: typeof fallbackInject.fallbackInject === "string" ? fallbackInject.fallbackInject : "",
|
||||
dropMnemon: fallbackInject.dropMnemon !== false,
|
||||
dropPurgeAfterFold: fallbackInject.dropPurgeAfterFold !== false,
|
||||
pinPersonaText: typeof fallbackInject.pinPersonaText === "string" ? fallbackInject.pinPersonaText : "",
|
||||
};
|
||||
}
|
||||
return {
|
||||
fallbackInject: typeof fallbackInject === "string" ? fallbackInject : "",
|
||||
dropMnemon: options?.dropMnemon !== false,
|
||||
dropPurgeAfterFold: options?.dropPurgeAfterFold !== false,
|
||||
pinPersonaText: typeof options?.pinPersonaText === "string" ? options.pinPersonaText : "",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -224,10 +222,6 @@ function foldInjectIntoPersona(sections, injectText) {
|
||||
export function rewritePromptAssembly(assembled, fallbackInject = "", options = {}) {
|
||||
if (!assembled || !Array.isArray(assembled.sections)) return assembled;
|
||||
const opts = normalizeRewriteOptions(fallbackInject, options);
|
||||
if (opts.pinPersonaText) {
|
||||
assembled.sections = [{ name: "deployment:persona-prefix", text: opts.pinPersonaText }];
|
||||
return assembled;
|
||||
}
|
||||
const rest = [];
|
||||
const purge = [];
|
||||
for (const section of assembled.sections) {
|
||||
|
||||
Reference in new issue
Block a user