File size: 1,157 Bytes
5871090 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import type { UserSettingsBlob } from "@workspace/db";
import { pickDefaultModel } from "./models";
export function defaultSettings(): UserSettingsBlob {
const m = pickDefaultModel();
return {
appearance: {
theme: "system",
density: "comfortable",
font_scale: 1.0,
code_theme: "github-dark",
},
language: "zh-CN",
default_model_id: m?.id || "mdl_claude-sonnet-4-6",
send_on_enter: true,
show_token_count: true,
spellcheck: true,
voice: { enabled: false, voice_id: null, speed: 1.0 },
data_controls: {
chat_history_enabled: true,
improve_model_with_my_data: false,
auto_archive_after_days: 0,
},
beta_features: { streaming: true, code_interpreter: false },
notifications: { job_completed: true, weekly_digest: false },
long_term_memory: {
enabled: false,
auto_extract: true,
max_facts: 100,
max_tokens_per_turn: 2000,
},
};
}
/**
* Default token quota period: rolling 30-day window from creation.
*/
export function defaultPeriodEnd(start = new Date()): Date {
return new Date(start.getTime() + 30 * 24 * 60 * 60 * 1000);
}
|