mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-30 18:10:22 +08:00
fix: 发布 1.1.44,回退后下一句按新消息发,启动就注入默认提示词。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3c7c234b34
commit
b8a5171d78
5 files changed
+138
-20
No files matched your search
@@ -294,6 +294,24 @@ function installFreshFullAccess(ctx) {
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function installRewindDeriveFilter(ctx) {
|
||||
if (!ctx || ctx.__dshPurgeRewindDerive) return;
|
||||
ctx.__dshPurgeRewindDerive = true;
|
||||
const wrapOne = (session) => {
|
||||
try { rewind.wrapSessionDeriveMessages(session); } catch { /* ignore */ }
|
||||
};
|
||||
try {
|
||||
const store = ctx.get?.("sessions");
|
||||
const all = typeof store?.all === "function" ? store.all()
|
||||
: typeof store?.list === "function" ? store.list()
|
||||
: [];
|
||||
for (const session of all || []) wrapOne(session);
|
||||
} catch { /* ignore */ }
|
||||
try {
|
||||
ctx.on("session/created", (session) => wrapOne(session));
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
|
||||
function installIdentityOverride(ctx, config = {}) {
|
||||
if (typeof ctx.on !== "function") return;
|
||||
installSubagentRoleCapture(ctx);
|
||||
@@ -798,6 +816,7 @@ export function apply(ctx, config) {
|
||||
installIdentityOverride(ctx, cfg);
|
||||
installRegionGate(ctx);
|
||||
installFreshFullAccess(ctx);
|
||||
installRewindDeriveFilter(ctx);
|
||||
installMnemonMessageStrip(ctx, cfg);
|
||||
const injectFile = core.findOverrideFile(core.findDshHome());
|
||||
registerPromptSections(ctx, cfg, injectFile);
|
||||
|
||||
Reference in new issue
Block a user