更新 lib/config.js

This commit is contained in:
QQ 2026-11-11 10:51:12 +08:00
parent d998236583
commit 484e2d892d
1 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,8 @@ export const DEFAULT_SETTINGS = {
defaultK: 10,
summaryEnabled: true,
summaryMaxChars: 6000,
skillsSyncEnabled: true,
skillsDir: '',
};
const MIN_TIMEOUT_MS = 1000;
const MAX_TIMEOUT_MS = 60_000;
@ -72,5 +74,9 @@ export function settingsFromConfig(raw) {
const summaryMaxChars = boundedInt(source.summaryMaxChars, 1000, 16_000);
if (summaryMaxChars !== undefined)
result.summaryMaxChars = summaryMaxChars;
if (typeof source.skillsSyncEnabled === 'boolean')
result.skillsSyncEnabled = source.skillsSyncEnabled;
if (typeof source.skillsDir === 'string')
result.skillsDir = source.skillsDir.trim().slice(0, 512);
return result;
}