From 55a07a0ef0a5b4753ff370d9eb35c44c85168f35 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 3 Jan 2026 18:51:25 +0000 Subject: [PATCH] style: fix lint formatting --- src/discord/monitor.ts | 11 ++------ src/gateway/server-bridge.ts | 49 ++++++++++++++++++++--------------- src/gateway/server-browser.ts | 4 +-- src/gateway/server.ts | 22 +++++----------- 4 files changed, 38 insertions(+), 48 deletions(-) diff --git a/src/discord/monitor.ts b/src/discord/monitor.ts index b511cbd15..dbaa1cc1e 100644 --- a/src/discord/monitor.ts +++ b/src/discord/monitor.ts @@ -983,15 +983,8 @@ export function shouldEmitDiscordReactionNotification(params: { userTag?: string | null; allowlist?: Array | null; }) { - const { - mode, - botId, - messageAuthorId, - userId, - userName, - userTag, - allowlist, - } = params; + const { mode, botId, messageAuthorId, userId, userName, userTag, allowlist } = + params; const effectiveMode = mode ?? "own"; if (effectiveMode === "off") return false; if (effectiveMode === "own") { diff --git a/src/gateway/server-bridge.ts b/src/gateway/server-bridge.ts index e88498cb7..fb8623a8f 100644 --- a/src/gateway/server-bridge.ts +++ b/src/gateway/server-bridge.ts @@ -1,6 +1,7 @@ -import fs from "node:fs"; import { randomUUID } from "node:crypto"; +import fs from "node:fs"; import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js"; +import type { ModelCatalogEntry } from "../agents/model-catalog.js"; import { buildAllowedModelSet, buildModelAliasIndex, @@ -14,7 +15,9 @@ import { normalizeThinkLevel, normalizeVerboseLevel, } from "../auto-reply/thinking.js"; -import { buildConfigSchema } from "../config/schema.js"; +import type { CliDeps } from "../cli/deps.js"; +import { agentCommand } from "../commands/agent.js"; +import type { HealthSummary } from "../commands/health.js"; import { CONFIG_PATH_CLAWDIS, loadConfig, @@ -23,29 +26,19 @@ import { validateConfigObject, writeConfigFile, } from "../config/config.js"; +import { buildConfigSchema } from "../config/schema.js"; import { loadSessionStore, resolveStorePath, type SessionEntry, saveSessionStore, } from "../config/sessions.js"; -import type { CliDeps } from "../cli/deps.js"; -import { agentCommand } from "../commands/agent.js"; -import { type HealthSummary } from "../commands/health.js"; -import { defaultRuntime } from "../runtime.js"; -import { loadVoiceWakeConfig, setVoiceWakeTriggers } from "../infra/voicewake.js"; import { - archiveFileOnDisk, - capArrayByJsonBytes, - listSessionsFromStore, - loadSessionEntry, - readSessionMessages, - resolveSessionModelRef, - resolveSessionTranscriptCandidates, - type SessionsPatchResult, -} from "./session-utils.js"; + loadVoiceWakeConfig, + setVoiceWakeTriggers, +} from "../infra/voicewake.js"; +import { defaultRuntime } from "../runtime.js"; import { buildMessageWithAttachments } from "./chat-attachments.js"; -import { normalizeVoiceWakeTriggers } from "./server-utils.js"; import { ErrorCodes, errorShape, @@ -69,18 +62,32 @@ import { validateSessionsResetParams, validateTalkModeParams, } from "./protocol/index.js"; +import type { ChatRunEntry } from "./server-chat.js"; import { HEALTH_REFRESH_INTERVAL_MS, MAX_CHAT_HISTORY_MESSAGES_BYTES, } from "./server-constants.js"; -import { formatForLog } from "./ws-log.js"; -import type { ChatRunEntry } from "./server-chat.js"; import type { DedupeEntry } from "./server-shared.js"; -import type { ModelCatalogEntry } from "../agents/model-catalog.js"; +import { normalizeVoiceWakeTriggers } from "./server-utils.js"; +import { + archiveFileOnDisk, + capArrayByJsonBytes, + listSessionsFromStore, + loadSessionEntry, + readSessionMessages, + resolveSessionModelRef, + resolveSessionTranscriptCandidates, + type SessionsPatchResult, +} from "./session-utils.js"; +import { formatForLog } from "./ws-log.js"; export type BridgeHandlersContext = { deps: CliDeps; - broadcast: (event: string, payload: unknown, opts?: { dropIfSlow?: boolean }) => void; + broadcast: ( + event: string, + payload: unknown, + opts?: { dropIfSlow?: boolean }, + ) => void; bridgeSendToSession: ( sessionKey: string, event: string, diff --git a/src/gateway/server-browser.ts b/src/gateway/server-browser.ts index 8eb19b88b..89ae834be 100644 --- a/src/gateway/server-browser.ts +++ b/src/gateway/server-browser.ts @@ -2,9 +2,7 @@ export type BrowserControlServer = { stop: () => Promise; }; -export async function startBrowserControlServerIfEnabled(): Promise< - BrowserControlServer | null -> { +export async function startBrowserControlServerIfEnabled(): Promise { if (process.env.CLAWDIS_SKIP_BROWSER_CONTROL_SERVER === "1") return null; // Lazy import: keeps startup fast, but still bundles for the embedded // gateway (bun --compile) via the static specifier path. diff --git a/src/gateway/server.ts b/src/gateway/server.ts index a998a86c7..f462edead 100644 --- a/src/gateway/server.ts +++ b/src/gateway/server.ts @@ -28,10 +28,7 @@ import { STATE_DIR_CLAWDIS, writeConfigFile, } from "../config/config.js"; -import { - loadSessionStore, - resolveStorePath, -} from "../config/sessions.js"; +import { loadSessionStore, resolveStorePath } from "../config/sessions.js"; import { runCronIsolatedAgentTurn } from "../cron/isolated-agent.js"; import { appendCronRunLog, resolveCronRunLogPath } from "../cron/run-log.js"; import { CronService } from "../cron/service.js"; @@ -69,9 +66,7 @@ import { enableTailscaleServe, getTailnetHostname, } from "../infra/tailscale.js"; -import { - loadVoiceWakeConfig, -} from "../infra/voicewake.js"; +import { loadVoiceWakeConfig } from "../infra/voicewake.js"; import { WIDE_AREA_DISCOVERY_DOMAIN, writeWideAreaBridgeZone, @@ -98,6 +93,10 @@ import { isLoopbackHost, resolveGatewayBindHost, } from "./net.js"; +import { createBridgeHandlers } from "./server-bridge.js"; +import { createBridgeSubscriptionManager } from "./server-bridge-subscriptions.js"; +import { startBrowserControlServerIfEnabled } from "./server-browser.js"; +import { createAgentEventHandler, createChatRunState } from "./server-chat.js"; import { DEDUPE_MAX, DEDUPE_TTL_MS, @@ -107,13 +106,6 @@ import { MAX_PAYLOAD_BYTES, TICK_INTERVAL_MS, } from "./server-constants.js"; -import { startBrowserControlServerIfEnabled } from "./server-browser.js"; -import { createBridgeHandlers } from "./server-bridge.js"; -import { createBridgeSubscriptionManager } from "./server-bridge-subscriptions.js"; -import { - createAgentEventHandler, - createChatRunState, -} from "./server-chat.js"; import { formatBonjourInstanceName, resolveBonjourCliPath, @@ -126,8 +118,8 @@ import { } from "./server-http.js"; import { handleGatewayRequest } from "./server-methods.js"; import { createProviderManager } from "./server-providers.js"; -import { formatError } from "./server-utils.js"; import type { DedupeEntry } from "./server-shared.js"; +import { formatError } from "./server-utils.js"; import { formatForLog, logWs, summarizeAgentEventForWsLog } from "./ws-log.js"; ensureClawdisCliOnPath();