From 09a2ab420ba1f16698a44fd41c22f1e922cbaf5d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 1 Jan 2026 15:31:36 +0000 Subject: [PATCH] style: biome formatting --- src/agents/minimax.live.test.ts | 68 ++++++++++++++++----------------- src/agents/skills-status.ts | 2 +- src/agents/skills.ts | 4 +- src/agents/zai.live.test.ts | 8 +--- src/commands/agent.ts | 2 +- src/commands/send.ts | 4 +- src/gateway/server.test.ts | 7 +++- src/gateway/server.ts | 15 ++++---- 8 files changed, 51 insertions(+), 59 deletions(-) diff --git a/src/agents/minimax.live.test.ts b/src/agents/minimax.live.test.ts index 59167ef1b..666943876 100644 --- a/src/agents/minimax.live.test.ts +++ b/src/agents/minimax.live.test.ts @@ -10,40 +10,36 @@ const LIVE = process.env.MINIMAX_LIVE_TEST === "1" || process.env.LIVE === "1"; const describeLive = LIVE && MINIMAX_KEY ? describe : describe.skip; describeLive("minimax live", () => { - it( - "returns assistant text", - async () => { - const model: Model<"openai-completions"> = { - id: MINIMAX_MODEL, - name: `MiniMax ${MINIMAX_MODEL}`, - api: "openai-completions", - provider: "minimax", - baseUrl: MINIMAX_BASE_URL, - reasoning: false, - input: ["text"], - cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, - contextWindow: 200000, - maxTokens: 8192, - }; - const res = await completeSimple( - model, - { - messages: [ - { - role: "user", - content: "Reply with the word ok.", - timestamp: Date.now(), - }, - ], - }, - { apiKey: MINIMAX_KEY, maxTokens: 64 }, - ); - const text = res.content - .filter((block) => block.type === "text") - .map((block) => block.text.trim()) - .join(" "); - expect(text.length).toBeGreaterThan(0); - }, - 20000, - ); + it("returns assistant text", async () => { + const model: Model<"openai-completions"> = { + id: MINIMAX_MODEL, + name: `MiniMax ${MINIMAX_MODEL}`, + api: "openai-completions", + provider: "minimax", + baseUrl: MINIMAX_BASE_URL, + reasoning: false, + input: ["text"], + cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, + contextWindow: 200000, + maxTokens: 8192, + }; + const res = await completeSimple( + model, + { + messages: [ + { + role: "user", + content: "Reply with the word ok.", + timestamp: Date.now(), + }, + ], + }, + { apiKey: MINIMAX_KEY, maxTokens: 64 }, + ); + const text = res.content + .filter((block) => block.type === "text") + .map((block) => block.text.trim()) + .join(" "); + expect(text.length).toBeGreaterThan(0); + }, 20000); }); diff --git a/src/agents/skills-status.ts b/src/agents/skills-status.ts index 367aadad4..bec69f5a6 100644 --- a/src/agents/skills-status.ts +++ b/src/agents/skills-status.ts @@ -4,13 +4,13 @@ import type { ClawdisConfig } from "../config/config.js"; import { CONFIG_DIR } from "../utils.js"; import { hasBinary, + isBundledSkillAllowed, isConfigPathTruthy, loadWorkspaceSkillEntries, resolveBundledAllowlist, resolveConfigPath, resolveSkillConfig, resolveSkillsInstallPreferences, - isBundledSkillAllowed, type SkillEntry, type SkillInstallSpec, type SkillsInstallPreferences, diff --git a/src/agents/skills.ts b/src/agents/skills.ts index 0e83066a6..8ad19586b 100644 --- a/src/agents/skills.ts +++ b/src/agents/skills.ts @@ -223,9 +223,7 @@ export function resolveSkillConfig( function normalizeAllowlist(input: unknown): string[] | undefined { if (!input) return undefined; if (!Array.isArray(input)) return undefined; - const normalized = input - .map((entry) => String(entry).trim()) - .filter(Boolean); + const normalized = input.map((entry) => String(entry).trim()).filter(Boolean); return normalized.length > 0 ? normalized : undefined; } diff --git a/src/agents/zai.live.test.ts b/src/agents/zai.live.test.ts index df5cb1dec..04c5ca80b 100644 --- a/src/agents/zai.live.test.ts +++ b/src/agents/zai.live.test.ts @@ -7,9 +7,7 @@ const LIVE = process.env.ZAI_LIVE_TEST === "1" || process.env.LIVE === "1"; const describeLive = LIVE && ZAI_KEY ? describe : describe.skip; describeLive("zai live", () => { - it( - "returns assistant text", - async () => { + it("returns assistant text", async () => { const model = getModel("zai", "glm-4.7"); const res = await completeSimple( model, @@ -29,7 +27,5 @@ describeLive("zai live", () => { .map((block) => block.text.trim()) .join(" "); expect(text.length).toBeGreaterThan(0); - }, - 20000, - ); + }, 20000); }); diff --git a/src/commands/agent.ts b/src/commands/agent.ts index a256b7ef9..3501221d1 100644 --- a/src/commands/agent.ts +++ b/src/commands/agent.ts @@ -427,7 +427,7 @@ export async function agentCommand( ? discordTarget : deliveryProvider === "signal" ? signalTarget - : undefined; + : undefined; const message = `Delivery failed (${deliveryProvider}${deliveryTarget ? ` to ${deliveryTarget}` : ""}): ${String(err)}`; runtime.error?.(message); if (!runtime.error) runtime.log(message); diff --git a/src/commands/send.ts b/src/commands/send.ts index 3f46edd44..f708f8293 100644 --- a/src/commands/send.ts +++ b/src/commands/send.ts @@ -86,9 +86,7 @@ export async function sendCommand( const result = await deps.sendMessageSignal(opts.to, opts.message, { mediaUrl: opts.media, }); - runtime.log( - success(`✅ Sent via signal. Message ID: ${result.messageId}`), - ); + runtime.log(success(`✅ Sent via signal. Message ID: ${result.messageId}`)); if (opts.json) { runtime.log( JSON.stringify( diff --git a/src/gateway/server.test.ts b/src/gateway/server.test.ts index 6557d126b..cff7b0a18 100644 --- a/src/gateway/server.test.ts +++ b/src/gateway/server.test.ts @@ -8,8 +8,8 @@ import { WebSocket } from "ws"; import { agentCommand } from "../commands/agent.js"; import { CONFIG_PATH_CLAWDIS, - STATE_DIR_CLAWDIS, readConfigFileSnapshot, + STATE_DIR_CLAWDIS, writeConfigFile, } from "../config/config.js"; import { emitAgentEvent } from "../infra/agent-events.js"; @@ -2108,7 +2108,10 @@ describe("gateway server", () => { ); expect(res.ok).toBe(true); const payload = res.payload as - | { type?: unknown; snapshot?: { configPath?: string; stateDir?: string } } + | { + type?: unknown; + snapshot?: { configPath?: string; stateDir?: string }; + } | undefined; expect(payload?.type).toBe("hello-ok"); expect(payload?.snapshot?.configPath).toBe(CONFIG_PATH_CLAWDIS); diff --git a/src/gateway/server.ts b/src/gateway/server.ts index 4375ca065..a93f122ec 100644 --- a/src/gateway/server.ts +++ b/src/gateway/server.ts @@ -46,11 +46,11 @@ import { getStatusSummary } from "../commands/status.js"; import { type ClawdisConfig, CONFIG_PATH_CLAWDIS, - STATE_DIR_CLAWDIS, isNixMode, loadConfig, parseConfigJson5, readConfigFileSnapshot, + STATE_DIR_CLAWDIS, validateConfigObject, writeConfigFile, } from "../config/config.js"; @@ -74,8 +74,6 @@ import { sendMessageDiscord, } from "../discord/index.js"; import { type DiscordProbe, probeDiscord } from "../discord/probe.js"; -import { monitorSignalProvider, sendMessageSignal } from "../signal/index.js"; -import { type SignalProbe, probeSignal } from "../signal/probe.js"; import { isVerbose } from "../globals.js"; import { onAgentEvent } from "../infra/agent-events.js"; import { startGatewayBonjourAdvertiser } from "../infra/bonjour.js"; @@ -141,6 +139,8 @@ import { setCommandLaneConcurrency } from "../process/command-queue.js"; import { runExec } from "../process/exec.js"; import { monitorWebProvider, webAuthExists } from "../providers/web/index.js"; import { defaultRuntime } from "../runtime.js"; +import { monitorSignalProvider, sendMessageSignal } from "../signal/index.js"; +import { probeSignal, type SignalProbe } from "../signal/probe.js"; import { monitorTelegramProvider } from "../telegram/monitor.js"; import { probeTelegram, type TelegramProbe } from "../telegram/probe.js"; import { sendMessageTelegram } from "../telegram/send.js"; @@ -4097,7 +4097,8 @@ export async function startGatewayServer( const signalHost = signalCfg?.httpHost?.trim() || "127.0.0.1"; const signalPort = signalCfg?.httpPort ?? 8080; const signalBaseUrl = - signalCfg?.httpUrl?.trim() || `http://${signalHost}:${signalPort}`; + signalCfg?.httpUrl?.trim() || + `http://${signalHost}:${signalPort}`; const signalConfigured = Boolean(signalCfg) && signalEnabled; let signalProbe: SignalProbe | undefined; let signalLastProbeAt: number | null = null; @@ -6518,9 +6519,9 @@ export async function startGatewayServer( await stopBrowserControlServerIfStarted().catch(() => {}); } await Promise.allSettled( - [whatsappTask, telegramTask, signalTask].filter( - Boolean, - ) as Array>, + [whatsappTask, telegramTask, signalTask].filter(Boolean) as Array< + Promise + >, ); await new Promise((resolve) => wss.close(() => resolve())); await new Promise((resolve, reject) =>