feat: add typing mode controls
This commit is contained in:
@@ -65,6 +65,10 @@ import {
|
||||
prependSystemEvents,
|
||||
} from "./reply/session-updates.js";
|
||||
import { createTypingController } from "./reply/typing.js";
|
||||
import {
|
||||
resolveTypingMode,
|
||||
shouldStartTypingImmediately,
|
||||
} from "./reply/typing-mode.js";
|
||||
import type { MsgContext, TemplateContext } from "./templating.js";
|
||||
import {
|
||||
type ElevatedLevel,
|
||||
@@ -594,7 +598,13 @@ export async function getReplyFromConfig(
|
||||
const isGroupChat = sessionCtx.ChatType === "group";
|
||||
const wasMentioned = ctx.WasMentioned === true;
|
||||
const isHeartbeat = opts?.isHeartbeat === true;
|
||||
const shouldEagerType = (!isGroupChat || wasMentioned) && !isHeartbeat;
|
||||
const typingMode = resolveTypingMode({
|
||||
configured: agentCfg?.typingMode,
|
||||
isGroupChat,
|
||||
wasMentioned,
|
||||
isHeartbeat,
|
||||
});
|
||||
const shouldEagerType = shouldStartTypingImmediately(typingMode);
|
||||
const shouldInjectGroupIntro = Boolean(
|
||||
isGroupChat &&
|
||||
(isFirstTurnInSession || sessionEntry?.groupActivationNeedsSystemIntro),
|
||||
@@ -816,6 +826,7 @@ export async function getReplyFromConfig(
|
||||
resolvedBlockStreamingBreak,
|
||||
sessionCtx,
|
||||
shouldInjectGroupIntro,
|
||||
typingMode,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user