mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-30 16:30:22 +08:00
feat: 发布 1.1.3,提示词只注入一次并修复插件加载
This commit is contained in:
1 parent
ea2632cd75
commit
d49a3b5eed
10 files changed
+434
-61
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { lastHumanUserText } from "../lib/rewind.js";
|
||||
|
||||
const events = [
|
||||
{ type: "turn/start", seq: 1 },
|
||||
{
|
||||
type: "user/message",
|
||||
seq: 2,
|
||||
data: { content: [{ type: "text", text: "first" }], source: { kind: "user" } },
|
||||
},
|
||||
{ type: "turn/end", seq: 3 },
|
||||
{ type: "turn/start", seq: 4 },
|
||||
{
|
||||
type: "user/message",
|
||||
seq: 5,
|
||||
data: { content: [{ type: "text", text: "second" }], source: { kind: "user" } },
|
||||
},
|
||||
{
|
||||
type: "user/message",
|
||||
seq: 6,
|
||||
data: { content: [{ type: "text", text: "[MNEMON] skip" }], source: { kind: "plugin", plugin: "dsh-mnemon" } },
|
||||
},
|
||||
];
|
||||
|
||||
assert.equal(lastHumanUserText(events), "second");
|
||||
assert.equal(lastHumanUserText([]), "");
|
||||
assert.equal(lastHumanUserText(null), "");
|
||||
|
||||
console.log("rewind-last-user ok");
|
||||
Reference in new issue
Block a user