diff --git a/apps/api/src/reception.ts b/apps/api/src/reception.ts index a8906ac..7db791a 100644 --- a/apps/api/src/reception.ts +++ b/apps/api/src/reception.ts @@ -15,9 +15,9 @@ import { loadMessagePage } from "./thread-message-pages.js"; export interface ReceptionService { isEnabled(): boolean; - plan(input: Omit & { botName: string }): Promise< - ReceptionPlan | null - >; + plan( + input: Omit & { botName: string }, + ): Promise; } export function createReceptionService(deps: { diff --git a/apps/api/src/thread-target.ts b/apps/api/src/thread-target.ts index f61045c..e9c3d91 100644 --- a/apps/api/src/thread-target.ts +++ b/apps/api/src/thread-target.ts @@ -40,8 +40,8 @@ import { resolveSendAttachments, } from "./artifacts.js"; import { resolveBusyBotName, toComputerStatus } from "./computer-status.js"; -import { withSerializableRetry } from "./serializable-retry.js"; import type { ReceptionService } from "./reception.js"; +import { withSerializableRetry } from "./serializable-retry.js"; import { loadMessagePage } from "./thread-message-pages.js"; export type ThreadTarget = diff --git a/packages/adapters/src/reception.test.ts b/packages/adapters/src/reception.test.ts index 6f815f0..dca2cd2 100644 --- a/packages/adapters/src/reception.test.ts +++ b/packages/adapters/src/reception.test.ts @@ -51,9 +51,7 @@ describe("heuristicReceptionRoute", () => { }); it("routes clear work orders to work", () => { - expect( - heuristicReceptionRoute("Split executor.ts into modules and open a PR"), - ).toBe("work"); + expect(heuristicReceptionRoute("Split executor.ts into modules and open a PR")).toBe("work"); expect(heuristicReceptionRoute("Refactor the login flow and add tests")).toBe("work"); }); diff --git a/packages/adapters/src/reception.ts b/packages/adapters/src/reception.ts index c2093fe..4a570f9 100644 --- a/packages/adapters/src/reception.ts +++ b/packages/adapters/src/reception.ts @@ -64,11 +64,7 @@ export function receptionMaxHistoryMessages(env: NodeJS.ProcessEnv = process.env return Math.floor(value); } -function receptionTokenLimit( - env: NodeJS.ProcessEnv, - name: string, - fallback: number, -): number { +function receptionTokenLimit(env: NodeJS.ProcessEnv, name: string, fallback: number): number { const raw = env[name]?.trim(); if (!raw) return fallback; const value = Number(raw); @@ -106,10 +102,9 @@ export function isReceptionConfigured(env: NodeJS.ProcessEnv = process.env): boo } /** Hard skips before any model call. */ -export function shouldSkipReception(input: Pick< - ReceptionPlanInput, - "hasAttachments" | "text" ->): boolean { +export function shouldSkipReception( + input: Pick, +): boolean { if (input.hasAttachments) return true; const text = input.text?.trim(); if (!text) return true; @@ -172,8 +167,7 @@ export function parseReceptionResponse(raw: string | undefined): ReceptionPlan | const parsed = JSON.parse(object) as { route?: unknown; reply?: unknown }; if (parsed.route === "work") return { route: "work" }; if (parsed.route === "chat" || parsed.route === "clarify") { - const reply = - typeof parsed.reply === "string" ? truncate(parsed.reply, MAX_REPLY_CHARS) : ""; + const reply = typeof parsed.reply === "string" ? truncate(parsed.reply, MAX_REPLY_CHARS) : ""; if (!reply) return parsed.route === "clarify" ? { route: "clarify" } : null; return { route: parsed.route, reply }; } @@ -261,7 +255,10 @@ export async function runReceptionPlan( } function defaultGreetingReply(botName: string): string { - return truncate(`Hi! I'm ${cleanLine(botName)}. What would you like to work on?`, MAX_REPLY_CHARS); + return truncate( + `Hi! I'm ${cleanLine(botName)}. What would you like to work on?`, + MAX_REPLY_CHARS, + ); } export function receptionBotName(name: string): string {