aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-12-22 16:59:04 +0200
committerGitHub <noreply@github.com>2025-12-22 14:59:04 +0000
commit0bdba54ba24a14e7dc2cfab64084452756bccce7 (patch)
treee7158eec50a462b58f1c25dbd9caf18d483e2e5e /packages/shared
parentece68ed078be3f6d66b5dcd7de8ba9853d48be27 (diff)
downloadkarakeep-0bdba54ba24a14e7dc2cfab64084452756bccce7.tar.zst
feat: Add user settings to disable auto tagging/summarization (#2275)
* feat: Add per-user settings to disable auto-tagging and auto-summarization This commit adds user-level controls for AI features when they are enabled on the server. Users can now toggle auto-tagging and auto-summarization on/off from the AI Settings page. Changes: - Added autoTaggingEnabled and autoSummarizationEnabled fields to user table - Updated user settings schemas and API endpoints to handle new fields - Modified inference workers to check user preferences before processing - Added toggle switches to AI Settings page (only visible when server has features enabled) - Generated database migration for new fields - Exposed enableAutoTagging and enableAutoSummarization in client config The settings default to null (use server default). When explicitly set to false, the user's bookmarks will skip the respective AI processing. * revert migration * i18n --------- Co-authored-by: Claude <noreply@anthropic.com>
Diffstat (limited to 'packages/shared')
-rw-r--r--packages/shared/config.ts2
-rw-r--r--packages/shared/types/users.ts5
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/shared/config.ts b/packages/shared/config.ts
index b8809ded..52dd2cf2 100644
--- a/packages/shared/config.ts
+++ b/packages/shared/config.ts
@@ -449,6 +449,8 @@ export const clientConfig = {
inference: {
isConfigured: serverConfig.inference.isConfigured,
inferredTagLang: serverConfig.inference.inferredTagLang,
+ enableAutoTagging: serverConfig.inference.enableAutoTagging,
+ enableAutoSummarization: serverConfig.inference.enableAutoSummarization,
},
serverVersion: serverConfig.serverVersion,
disableNewReleaseCheck: serverConfig.disableNewReleaseCheck,
diff --git a/packages/shared/types/users.ts b/packages/shared/types/users.ts
index 73b99885..d4fff9a1 100644
--- a/packages/shared/types/users.ts
+++ b/packages/shared/types/users.ts
@@ -119,6 +119,9 @@ export const zUserSettingsSchema = z.object({
readerFontSize: z.number().int().min(12).max(24).nullable(),
readerLineHeight: z.number().min(1.2).max(2.5).nullable(),
readerFontFamily: zReaderFontFamilySchema.nullable(),
+ // AI settings (nullable = opt-in, null means use server default)
+ autoTaggingEnabled: z.boolean().nullable(),
+ autoSummarizationEnabled: z.boolean().nullable(),
});
export type ZUserSettings = z.infer<typeof zUserSettingsSchema>;
@@ -133,6 +136,8 @@ export const zUpdateUserSettingsSchema = zUserSettingsSchema.partial().pick({
readerFontSize: true,
readerLineHeight: true,
readerFontFamily: true,
+ autoTaggingEnabled: true,
+ autoSummarizationEnabled: true,
});
export const zUpdateBackupSettingsSchema = zUpdateUserSettingsSchema.pick({