mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 09:50:22 +08:00
fix: 发布 1.1.66,Hooks 开关与会话来源
清洗页可关掉 hooks deny 旁路。继续/拒答续跑改用官方允许的来源 kind,限流和传输失败不再自动续一轮。 Closes #80. Closes #81. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
76e64d65e0
commit
09bac57f2c
13 files changed
+789
-59
No files matched your search
@@ -729,6 +729,23 @@ export function rewritePromptAssembly(assembled, fallbackInject = "", options =
|
||||
: withOps;
|
||||
}
|
||||
assembled.sections = sanitizeAssemblySections(leadWithInject(sections, injectText, protocol));
|
||||
if (injectText) {
|
||||
const needle = injectText.slice(0, 80);
|
||||
const has = assembled.sections.some((section) => (
|
||||
typeof section?.text === "string" && needle && section.text.includes(needle)
|
||||
));
|
||||
if (!has) {
|
||||
assembled.sections = [
|
||||
{
|
||||
name: "dsh-purge",
|
||||
text: injectText,
|
||||
interpolate: false,
|
||||
order: GLOBAL_PROMPT_ORDER + 1,
|
||||
},
|
||||
...assembled.sections.filter((section) => section && section.name !== "dsh-purge"),
|
||||
];
|
||||
}
|
||||
}
|
||||
if (!Array.isArray(assembled.contexts)) assembled.contexts = [];
|
||||
if (!Array.isArray(assembled.tools)) assembled.tools = [];
|
||||
return assembled;
|
||||
|
||||
Reference in new issue
Block a user