chore: oxfmt
This commit is contained in:
@@ -15,7 +15,10 @@ import type { MsgContext } from "../templating.js";
|
|||||||
import { logVerbose } from "../../globals.js";
|
import { logVerbose } from "../../globals.js";
|
||||||
import { stripMentions, stripStructuralPrefixes } from "./mentions.js";
|
import { stripMentions, stripStructuralPrefixes } from "./mentions.js";
|
||||||
import { clearSessionQueues } from "./queue.js";
|
import { clearSessionQueues } from "./queue.js";
|
||||||
import { resolveInternalSessionKey, resolveMainSessionAlias } from "../../agents/tools/sessions-helpers.js";
|
import {
|
||||||
|
resolveInternalSessionKey,
|
||||||
|
resolveMainSessionAlias,
|
||||||
|
} from "../../agents/tools/sessions-helpers.js";
|
||||||
|
|
||||||
const ABORT_TRIGGERS = new Set(["stop", "esc", "abort", "wait", "exit", "interrupt"]);
|
const ABORT_TRIGGERS = new Set(["stop", "esc", "abort", "wait", "exit", "interrupt"]);
|
||||||
const ABORT_MEMORY = new Map<string, boolean>();
|
const ABORT_MEMORY = new Map<string, boolean>();
|
||||||
|
|||||||
@@ -6,7 +6,12 @@ import { scheduleGatewaySigusr1Restart, triggerClawdbotRestart } from "../../inf
|
|||||||
import { parseAgentSessionKey } from "../../routing/session-key.js";
|
import { parseAgentSessionKey } from "../../routing/session-key.js";
|
||||||
import { parseActivationCommand } from "../group-activation.js";
|
import { parseActivationCommand } from "../group-activation.js";
|
||||||
import { parseSendPolicyCommand } from "../send-policy.js";
|
import { parseSendPolicyCommand } from "../send-policy.js";
|
||||||
import { formatAbortReplyText, isAbortTrigger, setAbortMemory, stopSubagentsForRequester } from "./abort.js";
|
import {
|
||||||
|
formatAbortReplyText,
|
||||||
|
isAbortTrigger,
|
||||||
|
setAbortMemory,
|
||||||
|
stopSubagentsForRequester,
|
||||||
|
} from "./abort.js";
|
||||||
import { clearSessionQueues } from "./queue.js";
|
import { clearSessionQueues } from "./queue.js";
|
||||||
import type { CommandHandler } from "./commands-types.js";
|
import type { CommandHandler } from "./commands-types.js";
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export function resolveMentionGating(params: MentionGateParams): MentionGateResu
|
|||||||
const implicit = params.implicitMention === true;
|
const implicit = params.implicitMention === true;
|
||||||
const bypass = params.shouldBypassMention === true;
|
const bypass = params.shouldBypassMention === true;
|
||||||
const effectiveWasMentioned = params.wasMentioned || implicit || bypass;
|
const effectiveWasMentioned = params.wasMentioned || implicit || bypass;
|
||||||
const shouldSkip =
|
const shouldSkip = params.requireMention && params.canDetectMention && !effectiveWasMentioned;
|
||||||
params.requireMention && params.canDetectMention && !effectiveWasMentioned;
|
|
||||||
return { effectiveWasMentioned, shouldSkip };
|
return { effectiveWasMentioned, shouldSkip };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import { randomUUID } from "node:crypto";
|
import { randomUUID } from "node:crypto";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
|
|
||||||
import {
|
import { abortEmbeddedPiRun, waitForEmbeddedPiRunEnd } from "../../agents/pi-embedded.js";
|
||||||
abortEmbeddedPiRun,
|
|
||||||
waitForEmbeddedPiRunEnd,
|
|
||||||
} from "../../agents/pi-embedded.js";
|
|
||||||
import { stopSubagentsForRequester } from "../../auto-reply/reply/abort.js";
|
import { stopSubagentsForRequester } from "../../auto-reply/reply/abort.js";
|
||||||
import { clearSessionQueues } from "../../auto-reply/reply/queue.js";
|
import { clearSessionQueues } from "../../auto-reply/reply/queue.js";
|
||||||
import { loadConfig } from "../../config/config.js";
|
import { loadConfig } from "../../config/config.js";
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ describe("applyGroupGating", () => {
|
|||||||
it("treats reply-to-bot as implicit mention", () => {
|
it("treats reply-to-bot as implicit mention", () => {
|
||||||
const groupHistories = new Map();
|
const groupHistories = new Map();
|
||||||
const result = applyGroupGating({
|
const result = applyGroupGating({
|
||||||
cfg: baseConfig as unknown as ReturnType<typeof import("../../../config/config.js").loadConfig>,
|
cfg: baseConfig as unknown as ReturnType<
|
||||||
|
typeof import("../../../config/config.js").loadConfig
|
||||||
|
>,
|
||||||
msg: {
|
msg: {
|
||||||
id: "m1",
|
id: "m1",
|
||||||
from: "123@g.us",
|
from: "123@g.us",
|
||||||
|
|||||||
Reference in New Issue
Block a user