mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 00:24:33 +00:00
refactor(auto-reply): split reply flow
This commit is contained in:
16
src/auto-reply/reply/abort.ts
Normal file
16
src/auto-reply/reply/abort.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
const ABORT_TRIGGERS = new Set(["stop", "esc", "abort", "wait", "exit"]);
|
||||
const ABORT_MEMORY = new Map<string, boolean>();
|
||||
|
||||
export function isAbortTrigger(text?: string): boolean {
|
||||
if (!text) return false;
|
||||
const normalized = text.trim().toLowerCase();
|
||||
return ABORT_TRIGGERS.has(normalized);
|
||||
}
|
||||
|
||||
export function getAbortMemory(key: string): boolean | undefined {
|
||||
return ABORT_MEMORY.get(key);
|
||||
}
|
||||
|
||||
export function setAbortMemory(key: string, value: boolean): void {
|
||||
ABORT_MEMORY.set(key, value);
|
||||
}
|
||||
Reference in New Issue
Block a user