diff --git a/src/auto-reply/reply/history.test.ts b/src/auto-reply/reply/history.test.ts index 8838e8c8e..9727d2d3c 100644 --- a/src/auto-reply/reply/history.test.ts +++ b/src/auto-reply/reply/history.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from "vitest"; -import { CURRENT_MESSAGE_MARKER } from "./mentions.js"; import { - HISTORY_CONTEXT_MARKER, appendHistoryEntry, buildHistoryContext, buildHistoryContextFromEntries, + HISTORY_CONTEXT_MARKER, } from "./history.js"; +import { CURRENT_MESSAGE_MARKER } from "./mentions.js"; describe("history helpers", () => { it("returns current message when history is empty", () => { diff --git a/src/auto-reply/reply/history.ts b/src/auto-reply/reply/history.ts index 2a39ea970..92b740946 100644 --- a/src/auto-reply/reply/history.ts +++ b/src/auto-reply/reply/history.ts @@ -51,9 +51,8 @@ export function buildHistoryContextFromEntries(params: { excludeLast?: boolean; }): string { const lineBreak = params.lineBreak ?? "\n"; - const entries = params.excludeLast === false - ? params.entries - : params.entries.slice(0, -1); + const entries = + params.excludeLast === false ? params.entries : params.entries.slice(0, -1); if (entries.length === 0) return params.currentMessage; const historyText = entries.map(params.formatEntry).join(lineBreak); return buildHistoryContext({ diff --git a/src/discord/monitor.ts b/src/discord/monitor.ts index 7c8c20a82..d9ce5c971 100644 --- a/src/discord/monitor.ts +++ b/src/discord/monitor.ts @@ -34,15 +34,15 @@ import { formatThreadStarterEnvelope, } from "../auto-reply/envelope.js"; import { dispatchReplyFromConfig } from "../auto-reply/reply/dispatch-from-config.js"; -import { - buildMentionRegexes, - matchesMentionPatterns, -} from "../auto-reply/reply/mentions.js"; import { appendHistoryEntry, buildHistoryContextFromEntries, type HistoryEntry, } from "../auto-reply/reply/history.js"; +import { + buildMentionRegexes, + matchesMentionPatterns, +} from "../auto-reply/reply/mentions.js"; import { createReplyDispatcher, createReplyDispatcherWithTyping, diff --git a/src/imessage/monitor.ts b/src/imessage/monitor.ts index 3da711932..2a544a098 100644 --- a/src/imessage/monitor.ts +++ b/src/imessage/monitor.ts @@ -7,9 +7,9 @@ import { hasControlCommand } from "../auto-reply/command-detection.js"; import { formatAgentEnvelope } from "../auto-reply/envelope.js"; import { dispatchReplyFromConfig } from "../auto-reply/reply/dispatch-from-config.js"; import { - DEFAULT_GROUP_HISTORY_LIMIT, appendHistoryEntry, buildHistoryContextFromEntries, + DEFAULT_GROUP_HISTORY_LIMIT, type HistoryEntry, } from "../auto-reply/reply/history.js"; import { diff --git a/src/msteams/monitor-handler.ts b/src/msteams/monitor-handler.ts index 4c16706f9..15349579d 100644 --- a/src/msteams/monitor-handler.ts +++ b/src/msteams/monitor-handler.ts @@ -1,9 +1,9 @@ import { formatAgentEnvelope } from "../auto-reply/envelope.js"; import { dispatchReplyFromConfig } from "../auto-reply/reply/dispatch-from-config.js"; import { - DEFAULT_GROUP_HISTORY_LIMIT, appendHistoryEntry, buildHistoryContextFromEntries, + DEFAULT_GROUP_HISTORY_LIMIT, type HistoryEntry, } from "../auto-reply/reply/history.js"; import type { ClawdbotConfig } from "../config/types.js"; diff --git a/src/signal/monitor.ts b/src/signal/monitor.ts index c0a605b82..112834ec0 100644 --- a/src/signal/monitor.ts +++ b/src/signal/monitor.ts @@ -6,9 +6,9 @@ import { chunkText, resolveTextChunkLimit } from "../auto-reply/chunk.js"; import { formatAgentEnvelope } from "../auto-reply/envelope.js"; import { dispatchReplyFromConfig } from "../auto-reply/reply/dispatch-from-config.js"; import { - DEFAULT_GROUP_HISTORY_LIMIT, appendHistoryEntry, buildHistoryContextFromEntries, + DEFAULT_GROUP_HISTORY_LIMIT, type HistoryEntry, } from "../auto-reply/reply/history.js"; import { createReplyDispatcher } from "../auto-reply/reply/reply-dispatcher.js"; diff --git a/src/slack/monitor.ts b/src/slack/monitor.ts index 1915ba602..da4c09acb 100644 --- a/src/slack/monitor.ts +++ b/src/slack/monitor.ts @@ -24,16 +24,16 @@ import { formatThreadStarterEnvelope, } from "../auto-reply/envelope.js"; import { dispatchReplyFromConfig } from "../auto-reply/reply/dispatch-from-config.js"; +import { + appendHistoryEntry, + buildHistoryContextFromEntries, + DEFAULT_GROUP_HISTORY_LIMIT, + type HistoryEntry, +} from "../auto-reply/reply/history.js"; import { buildMentionRegexes, matchesMentionPatterns, } from "../auto-reply/reply/mentions.js"; -import { - DEFAULT_GROUP_HISTORY_LIMIT, - appendHistoryEntry, - buildHistoryContextFromEntries, - type HistoryEntry, -} from "../auto-reply/reply/history.js"; import { createReplyDispatcherWithTyping } from "../auto-reply/reply/reply-dispatcher.js"; import { getReplyFromConfig } from "../auto-reply/reply.js"; import { isSilentReplyText, SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js"; diff --git a/src/telegram/bot.ts b/src/telegram/bot.ts index b7550a1cf..d36fd3b2e 100644 --- a/src/telegram/bot.ts +++ b/src/telegram/bot.ts @@ -20,16 +20,16 @@ import { } from "../auto-reply/commands-registry.js"; import { formatAgentEnvelope } from "../auto-reply/envelope.js"; import { resolveTelegramDraftStreamingChunking } from "../auto-reply/reply/block-streaming.js"; +import { + appendHistoryEntry, + buildHistoryContextFromEntries, + DEFAULT_GROUP_HISTORY_LIMIT, + type HistoryEntry, +} from "../auto-reply/reply/history.js"; import { buildMentionRegexes, matchesMentionPatterns, } from "../auto-reply/reply/mentions.js"; -import { - DEFAULT_GROUP_HISTORY_LIMIT, - appendHistoryEntry, - buildHistoryContextFromEntries, - type HistoryEntry, -} from "../auto-reply/reply/history.js"; import { dispatchReplyWithBufferedBlockDispatcher } from "../auto-reply/reply/provider-dispatcher.js"; import { getReplyFromConfig } from "../auto-reply/reply.js"; import type { ReplyPayload } from "../auto-reply/types.js"; diff --git a/src/web/auto-reply.ts b/src/web/auto-reply.ts index 07fce8c8f..902db7792 100644 --- a/src/web/auto-reply.ts +++ b/src/web/auto-reply.ts @@ -17,14 +17,14 @@ import { resolveHeartbeatPrompt, stripHeartbeatToken, } from "../auto-reply/heartbeat.js"; -import { - buildMentionRegexes, - normalizeMentionText, -} from "../auto-reply/reply/mentions.js"; import { buildHistoryContext, DEFAULT_GROUP_HISTORY_LIMIT, } from "../auto-reply/reply/history.js"; +import { + buildMentionRegexes, + normalizeMentionText, +} from "../auto-reply/reply/mentions.js"; import { dispatchReplyWithBufferedBlockDispatcher } from "../auto-reply/reply/provider-dispatcher.js"; import { getReplyFromConfig } from "../auto-reply/reply.js"; import { HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js";