style: format with oxfmt

This commit is contained in:
Peter Steinberger
2026-01-17 00:03:00 +00:00
parent c54c665f97
commit 1569db1754
2 changed files with 16 additions and 14 deletions

View File

@@ -33,14 +33,16 @@ type WebFetchConfig = NonNullable<ClawdbotConfig["tools"]>["web"] extends infer
: undefined : undefined
: undefined; : undefined;
type FirecrawlFetchConfig = { type FirecrawlFetchConfig =
enabled?: boolean; | {
apiKey?: string; enabled?: boolean;
baseUrl?: string; apiKey?: string;
onlyMainContent?: boolean; baseUrl?: string;
maxAgeMs?: number; onlyMainContent?: boolean;
timeoutSeconds?: number; maxAgeMs?: number;
} | undefined; timeoutSeconds?: number;
}
| undefined;
type CacheEntry<T> = { type CacheEntry<T> = {
value: T; value: T;
@@ -497,7 +499,7 @@ async function runWebSearch(params: {
ui_lang?: string; ui_lang?: string;
}): Promise<Record<string, unknown>> { }): Promise<Record<string, unknown>> {
const cacheKey = normalizeCacheKey( const cacheKey = normalizeCacheKey(
`${params.provider}:${params.query}:${params.count}:${params.country || "default"}:${params.search_lang || "default"}:${params.ui_lang || "default"}` `${params.provider}:${params.query}:${params.count}:${params.country || "default"}:${params.search_lang || "default"}:${params.ui_lang || "default"}`,
); );
const cached = readCache(SEARCH_CACHE, cacheKey); const cached = readCache(SEARCH_CACHE, cacheKey);
if (cached) return { ...cached.value, cached: true }; if (cached) return { ...cached.value, cached: true };
@@ -701,7 +703,9 @@ async function runWebFetch(params: {
} }
} }
} else { } else {
throw new Error("Web fetch extraction failed: Readability disabled and Firecrawl unavailable."); throw new Error(
"Web fetch extraction failed: Readability disabled and Firecrawl unavailable.",
);
} }
} else if (contentType.includes("application/json")) { } else if (contentType.includes("application/json")) {
try { try {

View File

@@ -265,16 +265,14 @@ const FIELD_HELP: Record<string, string> = {
"tools.web.fetch.readability": "tools.web.fetch.readability":
"Use Readability to extract main content from HTML (fallbacks to basic HTML cleanup).", "Use Readability to extract main content from HTML (fallbacks to basic HTML cleanup).",
"tools.web.fetch.firecrawl.enabled": "Enable Firecrawl fallback for web_fetch (if configured).", "tools.web.fetch.firecrawl.enabled": "Enable Firecrawl fallback for web_fetch (if configured).",
"tools.web.fetch.firecrawl.apiKey": "tools.web.fetch.firecrawl.apiKey": "Firecrawl API key (fallback: FIRECRAWL_API_KEY env var).",
"Firecrawl API key (fallback: FIRECRAWL_API_KEY env var).",
"tools.web.fetch.firecrawl.baseUrl": "tools.web.fetch.firecrawl.baseUrl":
"Firecrawl base URL (e.g. https://api.firecrawl.dev or custom endpoint).", "Firecrawl base URL (e.g. https://api.firecrawl.dev or custom endpoint).",
"tools.web.fetch.firecrawl.onlyMainContent": "tools.web.fetch.firecrawl.onlyMainContent":
"When true, Firecrawl returns only the main content (default: true).", "When true, Firecrawl returns only the main content (default: true).",
"tools.web.fetch.firecrawl.maxAgeMs": "tools.web.fetch.firecrawl.maxAgeMs":
"Firecrawl maxAge (ms) for cached results when supported by the API.", "Firecrawl maxAge (ms) for cached results when supported by the API.",
"tools.web.fetch.firecrawl.timeoutSeconds": "tools.web.fetch.firecrawl.timeoutSeconds": "Timeout in seconds for Firecrawl requests.",
"Timeout in seconds for Firecrawl requests.",
"channels.slack.allowBots": "channels.slack.allowBots":
"Allow bot-authored messages to trigger Slack replies (default: false).", "Allow bot-authored messages to trigger Slack replies (default: false).",
"channels.slack.thread.historyScope": "channels.slack.thread.historyScope":