import type { SessionEntry } from "../../config/sessions/types.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import type { MsgContext } from "../templating.js";
export type AbortCutoff = {
messageSid?: string;
timestamp?: number;
};
type SessionAbortCutoffEntry = Pick<SessionEntry, "abortCutoffMessageSid" | "abortCutoffTimestamp">;
export function shouldPersistAbortCutoff(params: {
commandSessionKey?: string;
targetSessionKey?: string;
}): boolean { const commandSessionKey = normalizeOptionalString(params.commandSessionKey); const targetSessionKey = normalizeOptionalString(params.targetSessionKey); if (!commandSessionKey || !targetSessionKey) { returntrue;
} // Native targeted /stop can run from a slash/session-control key while the // actual target session uses different message id/timestamp spaces. // Persist cutoff only when command source and target are the same session. return commandSessionKey === targetSessionKey;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.