From ecac4dd72ae35067812194f0e25f60bac5ab0efd Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 3 Dec 2025 00:30:05 +0000 Subject: [PATCH] Auto-reply: format and lint fixes --- src/auto-reply/chunk.test.ts | 3 ++- src/auto-reply/chunk.ts | 5 ++++- src/auto-reply/reply.chunking.test.ts | 1 - src/auto-reply/reply.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/auto-reply/chunk.test.ts b/src/auto-reply/chunk.test.ts index d19cdf972..065edc672 100644 --- a/src/auto-reply/chunk.test.ts +++ b/src/auto-reply/chunk.test.ts @@ -29,7 +29,8 @@ describe("chunkText", () => { }); it("otherwise breaks at the last whitespace under the limit", () => { - const text = "This is a message that should break nicely near a word boundary."; + const text = + "This is a message that should break nicely near a word boundary."; const chunks = chunkText(text, 30); expect(chunks[0].length).toBeLessThanOrEqual(30); expect(chunks[1].length).toBeLessThanOrEqual(30); diff --git a/src/auto-reply/chunk.ts b/src/auto-reply/chunk.ts index 90140742e..a9470db87 100644 --- a/src/auto-reply/chunk.ts +++ b/src/auto-reply/chunk.ts @@ -38,7 +38,10 @@ export function chunkText(text: string, limit: number): string[] { // If we broke on whitespace/newline, skip that separator; for hard breaks keep it. const brokeOnSeparator = breakIdx < remaining.length && /\s/.test(remaining[breakIdx]); - const nextStart = Math.min(remaining.length, breakIdx + (brokeOnSeparator ? 1 : 0)); + const nextStart = Math.min( + remaining.length, + breakIdx + (brokeOnSeparator ? 1 : 0), + ); remaining = remaining.slice(nextStart).trimStart(); } diff --git a/src/auto-reply/reply.chunking.test.ts b/src/auto-reply/reply.chunking.test.ts index bf3c98fef..4b30c8c56 100644 --- a/src/auto-reply/reply.chunking.test.ts +++ b/src/auto-reply/reply.chunking.test.ts @@ -46,4 +46,3 @@ describe("autoReplyIfConfigured chunking", () => { ); }); }); - diff --git a/src/auto-reply/reply.ts b/src/auto-reply/reply.ts index 843a7254d..8de6c7615 100644 --- a/src/auto-reply/reply.ts +++ b/src/auto-reply/reply.ts @@ -16,8 +16,8 @@ import { runCommandWithTimeout } from "../process/exec.js"; import { defaultRuntime, type RuntimeEnv } from "../runtime.js"; import type { TwilioRequester } from "../twilio/types.js"; import { sendTypingIndicator } from "../twilio/typing.js"; -import { runCommandReply } from "./command-reply.js"; import { chunkText } from "./chunk.js"; +import { runCommandReply } from "./command-reply.js"; import { applyTemplate, type MsgContext,