style: oxfmt format
This commit is contained in:
@@ -409,7 +409,7 @@ export async function resolveReplyDirectives(params: {
|
||||
return {
|
||||
kind: "continue",
|
||||
result: {
|
||||
commandSource: commandText,
|
||||
commandSource: commandText,
|
||||
command,
|
||||
allowTextCommands,
|
||||
skillCommands,
|
||||
|
||||
@@ -42,9 +42,9 @@ export function finalizeInboundContext<T extends Record<string, unknown>>(
|
||||
const bodyForCommandsSource = opts.forceBodyForCommands
|
||||
? (normalized.CommandBody ?? normalized.RawBody ?? normalized.Body)
|
||||
: (normalized.BodyForCommands ??
|
||||
normalized.CommandBody ??
|
||||
normalized.RawBody ??
|
||||
normalized.Body);
|
||||
normalized.CommandBody ??
|
||||
normalized.RawBody ??
|
||||
normalized.Body);
|
||||
normalized.BodyForCommands = normalizeInboundTextNewlines(bodyForCommandsSource);
|
||||
|
||||
const explicitLabel = normalized.ConversationLabel?.trim();
|
||||
|
||||
@@ -44,8 +44,6 @@ describe("formatInboundBodyWithSenderMeta", () => {
|
||||
|
||||
it("does not append when the body already includes a sender prefix", () => {
|
||||
const ctx: MsgContext = { ChatType: "group", SenderName: "Alice", SenderId: "A1" };
|
||||
expect(formatInboundBodyWithSenderMeta({ ctx, body: "Alice (A1): hi" })).toBe(
|
||||
"Alice (A1): hi",
|
||||
);
|
||||
expect(formatInboundBodyWithSenderMeta({ ctx, body: "Alice (A1): hi" })).toBe("Alice (A1): hi");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -16,4 +16,3 @@ describe("normalizeInboundTextNewlines", () => {
|
||||
expect(normalizeInboundTextNewlines("a\\nb")).toBe("a\nb");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -129,7 +129,8 @@ export async function initSessionState(params: {
|
||||
|
||||
const groupResolution = resolveGroupSessionKey(sessionCtxForState) ?? undefined;
|
||||
const normalizedChatType = normalizeChatType(ctx.ChatType);
|
||||
const isGroup = normalizedChatType != null && normalizedChatType !== "direct" ? true : Boolean(groupResolution);
|
||||
const isGroup =
|
||||
normalizedChatType != null && normalizedChatType !== "direct" ? true : Boolean(groupResolution);
|
||||
// Prefer CommandBody/RawBody (clean message) for command detection; fall back
|
||||
// to Body which may contain structural context (history, sender labels).
|
||||
const commandSource = ctx.BodyForCommands ?? ctx.CommandBody ?? ctx.RawBody ?? ctx.Body ?? "";
|
||||
|
||||
Reference in New Issue
Block a user