From ed80860c3403ddd415fabed8183c4f26a2b0f85f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 8 Jan 2026 22:22:17 +0000 Subject: [PATCH] chore(format): apply biome fixes --- src/commands/doctor.ts | 5 ++--- src/commands/providers.test.ts | 4 +++- src/discord/probe.intents.test.ts | 1 - src/discord/probe.ts | 7 +++++-- src/gateway/server-methods/providers.ts | 9 +++++++-- src/gateway/server-providers.ts | 5 ++++- src/infra/providers-status-issues.ts | 16 ++++++++++++---- src/web/auto-reply.test.ts | 5 ++++- 8 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/commands/doctor.ts b/src/commands/doctor.ts index 2e28d4322..496619412 100644 --- a/src/commands/doctor.ts +++ b/src/commands/doctor.ts @@ -15,8 +15,9 @@ import { resolveGatewayProgramArguments } from "../daemon/program-args.js"; import { resolvePreferredNodePath } from "../daemon/runtime-paths.js"; import { resolveGatewayService } from "../daemon/service.js"; import { buildServiceEnvironment } from "../daemon/service-env.js"; -import { buildGatewayConnectionDetails } from "../gateway/call.js"; +import { buildGatewayConnectionDetails, callGateway } from "../gateway/call.js"; import { formatPortDiagnostics, inspectPortUsage } from "../infra/ports.js"; +import { collectProvidersStatusIssues } from "../infra/providers-status-issues.js"; import type { RuntimeEnv } from "../runtime.js"; import { defaultRuntime } from "../runtime.js"; import { resolveUserPath, sleep } from "../utils.js"; @@ -66,8 +67,6 @@ import { printWizardHeader, } from "./onboard-helpers.js"; import { ensureSystemdUserLingerInteractive } from "./systemd-linger.js"; -import { callGateway } from "../gateway/call.js"; -import { collectProvidersStatusIssues } from "../infra/providers-status-issues.js"; function resolveMode(cfg: ClawdbotConfig): "local" | "remote" { return cfg.gateway?.mode === "remote" ? "remote" : "local"; diff --git a/src/commands/providers.test.ts b/src/commands/providers.test.ts index 93c9333e4..a2fcf8ac8 100644 --- a/src/commands/providers.test.ts +++ b/src/commands/providers.test.ts @@ -357,7 +357,9 @@ describe("providers command", () => { it("surfaces WhatsApp auth/runtime hints when unlinked or disconnected", () => { const unlinked = formatGatewayProvidersStatusLines({ - whatsappAccounts: [{ accountId: "default", enabled: true, linked: false }], + whatsappAccounts: [ + { accountId: "default", enabled: true, linked: false }, + ], }); expect(unlinked.join("\n")).toMatch(/WhatsApp/i); expect(unlinked.join("\n")).toMatch(/Not linked/i); diff --git a/src/discord/probe.intents.test.ts b/src/discord/probe.intents.test.ts index 1b58657ac..e7179ddb4 100644 --- a/src/discord/probe.intents.test.ts +++ b/src/discord/probe.intents.test.ts @@ -39,4 +39,3 @@ describe("resolveDiscordPrivilegedIntentsFromFlags", () => { }); }); }); - diff --git a/src/discord/probe.ts b/src/discord/probe.ts index ccea3c410..bb15ef85a 100644 --- a/src/discord/probe.ts +++ b/src/discord/probe.ts @@ -150,8 +150,11 @@ export async function probeDiscord( }; if (includeApplication) { result.application = - (await fetchDiscordApplicationSummary(normalized, timeoutMs, fetcher)) ?? - undefined; + (await fetchDiscordApplicationSummary( + normalized, + timeoutMs, + fetcher, + )) ?? undefined; } return { ...result, elapsedMs: Date.now() - started }; } catch (err) { diff --git a/src/gateway/server-methods/providers.ts b/src/gateway/server-methods/providers.ts index 062391ec5..e4b3cb434 100644 --- a/src/gateway/server-methods/providers.ts +++ b/src/gateway/server-methods/providers.ts @@ -98,9 +98,14 @@ export const providersHandlers: GatewayRequestHandlers = { lastProbeAt = Date.now(); } const groups = - cfg.telegram?.accounts?.[account.accountId]?.groups ?? cfg.telegram?.groups; + cfg.telegram?.accounts?.[account.accountId]?.groups ?? + cfg.telegram?.groups; const allowUnmentionedGroups = - Boolean(groups?.["*"] && (groups["*"] as { requireMention?: boolean }).requireMention === false) || + Boolean( + groups?.["*"] && + (groups["*"] as { requireMention?: boolean }).requireMention === + false, + ) || Object.entries(groups ?? {}).some( ([key, value]) => key !== "*" && diff --git a/src/gateway/server-providers.ts b/src/gateway/server-providers.ts index 20a8ac90c..1a4efbbc1 100644 --- a/src/gateway/server-providers.ts +++ b/src/gateway/server-providers.ts @@ -5,7 +5,10 @@ import { resolveDiscordAccount, } from "../discord/accounts.js"; import { monitorDiscordProvider } from "../discord/index.js"; -import type { DiscordApplicationSummary, DiscordProbe } from "../discord/probe.js"; +import type { + DiscordApplicationSummary, + DiscordProbe, +} from "../discord/probe.js"; import { probeDiscord } from "../discord/probe.js"; import { shouldLogVerbose } from "../globals.js"; import { diff --git a/src/infra/providers-status-issues.ts b/src/infra/providers-status-issues.ts index 45aff902f..01f923e56 100644 --- a/src/infra/providers-status-issues.ts +++ b/src/infra/providers-status-issues.ts @@ -58,7 +58,9 @@ function readDiscordAccountStatus(value: unknown): DiscordAccountStatus | null { }; } -function readDiscordApplicationSummary(value: unknown): DiscordApplicationSummary { +function readDiscordApplicationSummary( + value: unknown, +): DiscordApplicationSummary { if (!isRecord(value)) return {}; const intentsRaw = value.intents; if (!isRecord(intentsRaw)) return {}; @@ -74,7 +76,9 @@ function readDiscordApplicationSummary(value: unknown): DiscordApplicationSummar }; } -function readTelegramAccountStatus(value: unknown): TelegramAccountStatus | null { +function readTelegramAccountStatus( + value: unknown, +): TelegramAccountStatus | null { if (!isRecord(value)) return null; return { accountId: value.accountId, @@ -84,7 +88,9 @@ function readTelegramAccountStatus(value: unknown): TelegramAccountStatus | null }; } -function readWhatsAppAccountStatus(value: unknown): WhatsAppAccountStatus | null { +function readWhatsAppAccountStatus( + value: unknown, +): WhatsAppAccountStatus | null { if (!isRecord(value)) return null; return { accountId: value.accountId, @@ -159,7 +165,9 @@ export function collectProvidersStatusIssues( const running = account.running === true; const connected = account.connected === true; const reconnectAttempts = - typeof account.reconnectAttempts === "number" ? account.reconnectAttempts : null; + typeof account.reconnectAttempts === "number" + ? account.reconnectAttempts + : null; const lastError = asString(account.lastError); if (!linked) { diff --git a/src/web/auto-reply.test.ts b/src/web/auto-reply.test.ts index 5a456cf04..cf85f0414 100644 --- a/src/web/auto-reply.test.ts +++ b/src/web/auto-reply.test.ts @@ -1151,7 +1151,10 @@ describe("web auto-reply", () => { bindings: [ { agentId: "work", - match: { provider: "whatsapp", peer: { kind: "group", id: "123@g.us" } }, + match: { + provider: "whatsapp", + peer: { kind: "group", id: "123@g.us" }, + }, }, ], },