From d69f246ba7147b1e84cb8ba5df887d6d634d2564 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 20 Jan 2026 13:52:59 +0000 Subject: [PATCH] chore: fix lint/format --- src/agents/auth-profiles/external-cli-sync.ts | 7 ++++--- src/agents/model-auth.ts | 10 ++++------ src/agents/pi-embedded-runner/model.ts | 3 +-- src/agents/tools/web-search.test.ts | 14 ++++---------- src/cli/update-cli.ts | 1 - src/config/config.identity-defaults.test.ts | 4 +--- src/config/io.ts | 4 +--- src/config/plugin-auto-enable.ts | 6 +++++- src/config/zod-schema.core.ts | 7 +------ src/gateway/server-methods/nodes.ts | 5 +---- src/types/pdfjs-dist-legacy.d.ts | 7 +++---- 11 files changed, 25 insertions(+), 43 deletions(-) diff --git a/src/agents/auth-profiles/external-cli-sync.ts b/src/agents/auth-profiles/external-cli-sync.ts index 8668f1d43..8a7d8270f 100644 --- a/src/agents/auth-profiles/external-cli-sync.ts +++ b/src/agents/auth-profiles/external-cli-sync.ts @@ -179,9 +179,10 @@ export function syncExternalCliCredentials( !existingCodex || existingCodex.provider !== "openai-codex" || !isExternalProfileFresh(existingCodex, now); - const codexCreds = shouldSyncCodex || duplicateExistingId - ? readCodexCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS }) - : null; + const codexCreds = + shouldSyncCodex || duplicateExistingId + ? readCodexCliCredentialsCached({ ttlMs: EXTERNAL_CLI_SYNC_TTL_MS }) + : null; if (codexCreds) { const duplicateProfileId = findDuplicateCodexProfile(store, codexCreds); if (duplicateProfileId) { diff --git a/src/agents/model-auth.ts b/src/agents/model-auth.ts index 754d75e66..f04a8e53d 100644 --- a/src/agents/model-auth.ts +++ b/src/agents/model-auth.ts @@ -38,9 +38,9 @@ function resolveProviderConfig( } return ( (providers[normalized] as ModelProviderConfig | undefined) ?? - (Object.entries(providers).find( - ([key]) => normalizeProviderId(key) === normalized, - )?.[1] as ModelProviderConfig | undefined) + (Object.entries(providers).find(([key]) => normalizeProviderId(key) === normalized)?.[1] as + | ModelProviderConfig + | undefined) ); } @@ -353,7 +353,5 @@ export async function getApiKeyForModel(params: { export function requireApiKey(auth: ResolvedProviderAuth, provider: string): string { const key = auth.apiKey?.trim(); if (key) return key; - throw new Error( - `No API key resolved for provider "${provider}" (auth mode: ${auth.mode}).`, - ); + throw new Error(`No API key resolved for provider "${provider}" (auth mode: ${auth.mode}).`); } diff --git a/src/agents/pi-embedded-runner/model.ts b/src/agents/pi-embedded-runner/model.ts index 4fa836f98..15248aeaa 100644 --- a/src/agents/pi-embedded-runner/model.ts +++ b/src/agents/pi-embedded-runner/model.ts @@ -55,8 +55,7 @@ export function resolveModel( const inlineModels = buildInlineProviderModels(providers); const normalizedProvider = normalizeProviderId(provider); const inlineMatch = inlineModels.find( - (entry) => - normalizeProviderId(entry.provider) === normalizedProvider && entry.id === modelId, + (entry) => normalizeProviderId(entry.provider) === normalizedProvider && entry.id === modelId, ); if (inlineMatch) { const normalized = normalizeModelCompat(inlineMatch as Model); diff --git a/src/agents/tools/web-search.test.ts b/src/agents/tools/web-search.test.ts index 51b6e5c9e..0c49749a5 100644 --- a/src/agents/tools/web-search.test.ts +++ b/src/agents/tools/web-search.test.ts @@ -18,19 +18,13 @@ describe("web_search perplexity baseUrl defaults", () => { }); it("prefers explicit baseUrl over key-based defaults", () => { - expect( - resolvePerplexityBaseUrl( - { baseUrl: "https://example.com" }, - "config", - "pplx-123", - ), - ).toBe("https://example.com"); + expect(resolvePerplexityBaseUrl({ baseUrl: "https://example.com" }, "config", "pplx-123")).toBe( + "https://example.com", + ); }); it("defaults to direct when using PERPLEXITY_API_KEY", () => { - expect(resolvePerplexityBaseUrl(undefined, "perplexity_env")).toBe( - "https://api.perplexity.ai", - ); + expect(resolvePerplexityBaseUrl(undefined, "perplexity_env")).toBe("https://api.perplexity.ai"); }); it("defaults to OpenRouter when using OPENROUTER_API_KEY", () => { diff --git a/src/cli/update-cli.ts b/src/cli/update-cli.ts index e4cf84298..af2a8dd41 100644 --- a/src/cli/update-cli.ts +++ b/src/cli/update-cli.ts @@ -18,7 +18,6 @@ import { DEFAULT_GIT_CHANNEL, DEFAULT_PACKAGE_CHANNEL, normalizeUpdateChannel, - type UpdateChannel, } from "../infra/update-channels.js"; import { defaultRuntime } from "../runtime.js"; import { formatDocsLink } from "../terminal/links.js"; diff --git a/src/config/config.identity-defaults.test.ts b/src/config/config.identity-defaults.test.ts index b1f4da64d..829264a29 100644 --- a/src/config/config.identity-defaults.test.ts +++ b/src/config/config.identity-defaults.test.ts @@ -309,9 +309,7 @@ describe("config identity defaults", () => { expect(cfg.messages?.groupChat?.mentionPatterns).toBeUndefined(); expect(cfg.agents?.list).toBeUndefined(); expect(cfg.agents?.defaults?.maxConcurrent).toBe(DEFAULT_AGENT_MAX_CONCURRENT); - expect(cfg.agents?.defaults?.subagents?.maxConcurrent).toBe( - DEFAULT_SUBAGENT_MAX_CONCURRENT, - ); + expect(cfg.agents?.defaults?.subagents?.maxConcurrent).toBe(DEFAULT_SUBAGENT_MAX_CONCURRENT); expect(cfg.session).toBeUndefined(); }); }); diff --git a/src/config/io.ts b/src/config/io.ts index bff886c4e..b2302a7c4 100644 --- a/src/config/io.ts +++ b/src/config/io.ts @@ -258,9 +258,7 @@ export function createConfigIO(overrides: ConfigIoDeps = {}) { applyCompactionDefaults( applyContextPruningDefaults( applyAgentDefaults( - applySessionDefaults( - applyLoggingDefaults(applyMessageDefaults(validated.config)), - ), + applySessionDefaults(applyLoggingDefaults(applyMessageDefaults(validated.config))), ), ), ), diff --git a/src/config/plugin-auto-enable.ts b/src/config/plugin-auto-enable.ts index d7bd67d87..3ec2123a2 100644 --- a/src/config/plugin-auto-enable.ts +++ b/src/config/plugin-auto-enable.ts @@ -1,5 +1,9 @@ import type { ClawdbotConfig } from "./config.js"; -import { getChatChannelMeta, listChatChannels, normalizeChatChannelId } from "../channels/registry.js"; +import { + getChatChannelMeta, + listChatChannels, + normalizeChatChannelId, +} from "../channels/registry.js"; import { getChannelPluginCatalogEntry, listChannelPluginCatalogEntries, diff --git a/src/config/zod-schema.core.ts b/src/config/zod-schema.core.ts index 4b38644ec..6e7b34b0d 100644 --- a/src/config/zod-schema.core.ts +++ b/src/config/zod-schema.core.ts @@ -50,12 +50,7 @@ export const ModelProviderSchema = z baseUrl: z.string().min(1), apiKey: z.string().optional(), auth: z - .union([ - z.literal("api-key"), - z.literal("aws-sdk"), - z.literal("oauth"), - z.literal("token"), - ]) + .union([z.literal("api-key"), z.literal("aws-sdk"), z.literal("oauth"), z.literal("token")]) .optional(), api: ModelApiSchema.optional(), headers: z.record(z.string(), z.string()).optional(), diff --git a/src/gateway/server-methods/nodes.ts b/src/gateway/server-methods/nodes.ts index b5a26039d..b112d4a9c 100644 --- a/src/gateway/server-methods/nodes.ts +++ b/src/gateway/server-methods/nodes.ts @@ -29,10 +29,7 @@ import { uniqueSortedStrings, } from "./nodes.helpers.js"; import { loadConfig } from "../../config/config.js"; -import { - isNodeCommandAllowed, - resolveNodeCommandAllowlist, -} from "../node-command-policy.js"; +import { isNodeCommandAllowed, resolveNodeCommandAllowlist } from "../node-command-policy.js"; import type { GatewayRequestHandlers } from "./types.js"; function isNodeEntry(entry: { role?: string; roles?: string[] }) { diff --git a/src/types/pdfjs-dist-legacy.d.ts b/src/types/pdfjs-dist-legacy.d.ts index b88ec386b..078e02e49 100644 --- a/src/types/pdfjs-dist-legacy.d.ts +++ b/src/types/pdfjs-dist-legacy.d.ts @@ -27,8 +27,7 @@ declare module "pdfjs-dist/legacy/build/pdf.mjs" { getPage(pageNumber: number): Promise; }; - export function getDocument(params: { - data: Uint8Array; - disableWorker?: boolean; - }): { promise: Promise }; + export function getDocument(params: { data: Uint8Array; disableWorker?: boolean }): { + promise: Promise; + }; }