style: oxfmt format

This commit is contained in:
Peter Steinberger
2026-01-17 05:48:34 +00:00
parent 8b42902cee
commit e59d8c5436
47 changed files with 152 additions and 165 deletions

View File

@@ -409,7 +409,7 @@ export async function resolveReplyDirectives(params: {
return {
kind: "continue",
result: {
commandSource: commandText,
commandSource: commandText,
command,
allowTextCommands,
skillCommands,

View File

@@ -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();

View File

@@ -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");
});
});

View File

@@ -16,4 +16,3 @@ describe("normalizeInboundTextNewlines", () => {
expect(normalizeInboundTextNewlines("a\\nb")).toBe("a\nb");
});
});

View File

@@ -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 ?? "";