//#region src/heartbeat/tokens.ts
const HEARTBEAT_OK = "HEARTBEAT_OK";
const NO_REPLY = "NO_REPLY";
const DEFAULT_ACK_MAX_CHARS = 300;
/**
* Strip HEARTBEAT_OK token from model text.
* Supports plain text, Markdown bold, inline code, trailing punctuation.
*/
function stripHeartbeatToken(text) {
	const hadToken = text.includes(HEARTBEAT_OK);
	return {
		stripped: text.replace(/<[^>]*>/g, " ").replace(/\*\*HEARTBEAT_OK\*\*/g, "").replace(/`HEARTBEAT_OK`/g, "").replace(/HEARTBEAT_OK\.?/g, "").trim(),
		hadToken
	};
}
/**
* Whether the reply should not be sent to the user: HEARTBEAT_OK present and little else.
*/
function shouldSilence(text, ackMaxChars = 300) {
	const { stripped, hadToken } = stripHeartbeatToken(text);
	if (!hadToken) return false;
	return stripped.length <= ackMaxChars;
}
//#endregion
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken };

//# sourceMappingURL=tokens.js.map