This commit is contained in:
2026-05-13 10:18:54 +03:00
parent cd8d2683c0
commit c5b61ee3d8
38 changed files with 3929 additions and 3718 deletions
+4 -3
View File
@@ -356,11 +356,12 @@ export async function webSearch(args?: Record<string, unknown>) {
note: "Use returned URLs as sources. Do not invent facts that are not present in the snippets/results.",
};
} catch (e: any) {
} catch (e: unknown) {
logError(e);
const status = e?.response?.status;
const data = e?.response?.data;
const axiosLike = e as {response?: {status?: unknown; data?: unknown}};
const status = axiosLike.response?.status;
const data = axiosLike.response?.data;
return {
ok: false,
+4 -4
View File
@@ -327,8 +327,8 @@ async function assertNoSymlinkInPath(
if (stat.isSymbolicLink()) {
throw new Error("Symlinks are not allowed in file tool paths.");
}
} catch (e: any) {
if (e?.code === "ENOENT" && options?.allowMissingTail) {
} catch (e: unknown) {
if ((e as NodeJS.ErrnoException).code === "ENOENT" && options?.allowMissingTail) {
return;
}
@@ -341,8 +341,8 @@ async function pathExists(absolutePath: string): Promise<boolean> {
try {
await fs.promises.lstat(absolutePath);
return true;
} catch (e: any) {
if (e?.code === "ENOENT") return false;
} catch (e: unknown) {
if ((e as NodeJS.ErrnoException).code === "ENOENT") return false;
throw e;
}
}
+2 -2
View File
@@ -58,11 +58,11 @@ export const marketRatesToolPrompt = [
"- When the user asks for all rates, group fiat currencies separately from crypto and gold.",
].join("\n");
export async function getMarketRates(): Promise<any | undefined> {
export async function getMarketRates(): Promise<unknown | undefined> {
try {
const response = await axios.get("https://apid.r00t.top/api/v2/currency/rates");
return response.data;
} catch (e: any) {
} catch (e: unknown) {
console.error("GET_MARKET_RATES", e);
return undefined;
}
+1 -1
View File
@@ -692,7 +692,7 @@ function parsePythonInterpreterArgs(
return {
code,
stdin,
stdin: typeof stdin === "string" ? stdin : undefined,
timeoutMs: timeoutMs === undefined ? undefined : Number(timeoutMs),
};
}
+1 -1
View File
@@ -96,7 +96,7 @@ export async function loadOllamaModel(model: string, ollama: Ollama, contextLeng
}
});
return true;
} catch (e: any) {
} catch (e: unknown) {
console.error("Error loading Ollama model:", model);
return false;
}
+2 -2
View File
@@ -42,7 +42,7 @@ export const weatherToolPrompt = [
"If the city is missing or unclear, ask the user to specify it.",
].join("\n");
export async function getWeather(args?: Record<string, unknown>): Promise<any | null> {
export async function getWeather(args?: Record<string, unknown>): Promise<Record<string, unknown> | null> {
console.log("getWeather()");
try {
const city = asNonEmptyString(args?.city);
@@ -137,7 +137,7 @@ export async function getWeather(args?: Record<string, unknown>): Promise<any |
windSpeed: wind.speed,
},
};
} catch (e: any) {
} catch (e: unknown) {
logError(e);
return null;
} finally {