From 7f4ba4e17ca9b7a98047d12f75d38f0aff0714b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ACT=E4=B8=B6=E6=B5=81=E6=98=9F=E9=9B=A8?= <1340145680@qq.com> Date: Tue, 10 Feb 2026 17:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlog=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E5=88=9B=E5=BB=BA=E5=AF=BC=E8=87=B4=E8=B6=8A=E6=9D=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NOTICES.txt | 94 ++++++++++++++++++++++++++++++++++++++++----------- src/logger.ts | 11 +++++- 2 files changed, 84 insertions(+), 21 deletions(-) diff --git a/NOTICES.txt b/NOTICES.txt index 210e056..4e21b5c 100644 --- a/NOTICES.txt +++ b/NOTICES.txt @@ -1,24 +1,42 @@ -Name: @aigne/core -License: Elastic-2.0 -Repository: https://github.com/AIGNE-io/aigne-framework +Name: @ai-sdk/anthropic +License: Apache-2.0 +Repository: https://github.com/vercel/ai ----------------------------- -Name: @aigne/openai -License: Elastic-2.0 -Repository: https://github.com/AIGNE-io/aigne-framework +Name: @ai-sdk/deepseek +License: Apache-2.0 +Repository: https://github.com/vercel/ai ----------------------------- -Name: @langchain/core -License: MIT -Repository: https://github.com/langchain-ai/langchainjs +Name: @ai-sdk/devtools +License: MIT* +Repository: N/A ----------------------------- -Name: @langchain/openai -License: MIT -Repository: https://github.com/langchain-ai/langchainjs +Name: @ai-sdk/google +License: Apache-2.0 +Repository: https://github.com/vercel/ai + +----------------------------- + +Name: @ai-sdk/openai-compatible +License: Apache-2.0 +Repository: https://github.com/vercel/ai + +----------------------------- + +Name: @ai-sdk/openai +License: Apache-2.0 +Repository: https://github.com/vercel/ai + +----------------------------- + +Name: @ai-sdk/xai +License: Apache-2.0 +Repository: https://github.com/vercel/ai ----------------------------- @@ -64,6 +82,12 @@ Repository: https://github.com/DefinitelyTyped/DefinitelyTyped ----------------------------- +Name: ai +License: Apache-2.0 +Repository: https://github.com/vercel/ai + +----------------------------- + Name: axios-retry License: Apache-2.0 Repository: https://github.com/softonic/axios-retry @@ -76,6 +100,12 @@ Repository: https://github.com/axios/axios ----------------------------- +Name: best-effort-json-parser +License: BSD-2-Clause +Repository: https://github.com/beenotung/best-effort-json-parser + +----------------------------- + Name: better-sqlite3 License: MIT Repository: https://github.com/WiseLibs/better-sqlite3 @@ -88,6 +118,12 @@ Repository: https://github.com/expressjs/cors ----------------------------- +Name: cross-env +License: MIT +Repository: https://github.com/kentcdodds/cross-env + +----------------------------- + Name: dotenv License: BSD-2-Clause Repository: https://github.com/motdotla/dotenv @@ -166,12 +202,6 @@ Repository: https://github.com/knex/knex ----------------------------- -Name: langchain -License: MIT -Repository: https://github.com/langchain-ai/langchainjs - ------------------------------ - Name: license-checker License: BSD-3-Clause Repository: https://github.com/davglass/license-checker @@ -190,6 +220,24 @@ Repository: https://github.com/remy/nodemon ----------------------------- +Name: qwen-ai-provider +License: Apache-2.0 +Repository: https://github.com/Younis-Ahmed/qwen-ai-provider + +----------------------------- + +Name: serialize-error +License: MIT +Repository: https://github.com/sindresorhus/serialize-error + +----------------------------- + +Name: serialize-error +License: MIT +Repository: https://github.com/sindresorhus/serialize-error + +----------------------------- + Name: sharp License: Apache-2.0 Repository: https://github.com/lovell/sharp @@ -214,9 +262,15 @@ Repository: https://github.com/microsoft/TypeScript ----------------------------- -Name: zod +Name: uuid License: MIT -Repository: https://github.com/colinhacks/zod +Repository: https://github.com/uuidjs/uuid + +----------------------------- + +Name: zhipu-ai-provider +License: Apache-2.0 +Repository: https://github.com/Xiang-CH/zhipu-ai-provider ----------------------------- diff --git a/src/logger.ts b/src/logger.ts index 68acbe6..a10cbd4 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -4,7 +4,16 @@ import * as path from "path"; type LogLevel = "log" | "info" | "warn" | "error" | "debug"; type ConsoleMethod = (...args: unknown[]) => void; -const LOG_DIR = "./logs"; +function getLogDir(): string { + const isElectron = typeof process.versions?.electron !== "undefined"; + if (isElectron) { + const { app } = require("electron"); + return path.join(app.getPath("userData"), "logs"); + } + return path.join(process.cwd(), "logs"); +} + +const LOG_DIR = getLogDir(); const LOG_FILE = path.join(LOG_DIR, "app.log"); const MAX_SIZE = 1000 * 1024 * 1024; const LEVELS: LogLevel[] = ["log", "info", "warn", "error", "debug"];