style: format runtime helpers

This commit is contained in:
Eyejoker
2026-03-23 06:17:41 +09:00
parent d4b19ab950
commit c733217074
2 changed files with 20 additions and 13 deletions

View File

@@ -5,7 +5,11 @@ import {
} from './db.js';
import { filterProcessableMessages } from './bot-message-filter.js';
import { isTriggerAllowed, loadSenderAllowlist } from './sender-allowlist.js';
import { type Channel, type NewMessage, type RegisteredGroup } from './types.js';
import {
type Channel,
type NewMessage,
type RegisteredGroup,
} from './types.js';
const BOT_COLLABORATION_WINDOW_MS = 12 * 60 * 60 * 1000;
@@ -77,10 +81,18 @@ export function hasAllowedTrigger(opts: {
messages: NewMessage[];
group: RegisteredGroup;
triggerPattern: RegExp;
hasImplicitContinuationWindow: (chatJid: string, messages: NewMessage[]) => boolean;
hasImplicitContinuationWindow: (
chatJid: string,
messages: NewMessage[],
) => boolean;
}): boolean {
const { chatJid, messages, group, triggerPattern, hasImplicitContinuationWindow } =
opts;
const {
chatJid,
messages,
group,
triggerPattern,
hasImplicitContinuationWindow,
} = opts;
if (group.isMain === true || group.requiresTrigger === false) {
return true;

View File

@@ -700,17 +700,12 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): {
await turnController.start();
const output = await runAgent(
group,
prompt,
chatJid,
runId,
(result) => turnController.handleOutput(result),
const output = await runAgent(group, prompt, chatJid, runId, (result) =>
turnController.handleOutput(result),
);
const { deliverySucceeded, visiblePhase } = await turnController.finish(
output,
);
const { deliverySucceeded, visiblePhase } =
await turnController.finish(output);
if (!deliverySucceeded) {
logger.warn(