Skip to content

Build your personal knowledge base with Trilium Notes

Merge branch 'develop' into ai-llm-integration

perf3ct435e7cdd4fc7
diff --cc src/app.ts
index 9896c8e775,326c15efdd..1ea0f7a879
--- a/src/app.ts
+++ b/src/app.ts
@@@ -14,9 -14,9 +14,11 @@@ import custom from "./routes/custom.js"
import error_handlers from "./routes/error_handlers.js";
import { startScheduledCleanup } from "./services/erase.js";
import sql_init from "./services/sql_init.js";
+ import { auth } from "express-openid-connect";
+ import openID from "./services/open_id.js";
import { t } from "i18next";
+import eventService from "./services/events.js";
+import log from "./services/log.js";
await import("./services/handlers.js");
await import("./becca/becca_loader.js");
diff --cc src/public/translations/en/translation.json
index 2e567abd68,13bb74dfd8..580efbc933
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@@ -1579,7 -1467,7 +1612,8 @@@
"confirm-change": "It is not recommended to change note type when note content is not empty. Do you want to continue anyway?",
"geo-map": "Geo Map",
"beta-feature": "Beta",
- "ai-chat": "AI Chat"
++ "ai-chat": "AI Chat",
+ "task-list": "Task List"
},
"protect_note": {
"toggle-on": "Protect the note",
diff --cc src/routes/api/options.ts
index 650f8fba31,140e2448e4..6fdd32d12b
--- a/src/routes/api/options.ts
+++ b/src/routes/api/options.ts
@@@ -80,37 -80,9 +80,41 @@@ const ALLOWED_OPTIONS = new Set<OptionN
"allowedHtmlTags",
"redirectBareDomain",
"showLoginInShareTheme",
++
+ // AI/LLM integration options
+ "aiEnabled",
+ "openaiApiKey",
+ "openaiDefaultModel",
+ "openaiEmbeddingModel",
+ "openaiBaseUrl",
+ "anthropicApiKey",
+ "anthropicDefaultModel",
+ "voyageEmbeddingModel",
+ "voyageApiKey",
+ "anthropicBaseUrl",
+ "ollamaEnabled",
+ "ollamaBaseUrl",
+ "ollamaDefaultModel",
+ "ollamaEmbeddingModel",
+ "aiProviderPrecedence",
+ "aiTemperature",
+ "aiSystemPrompt",
++
+ // Embedding options
+ "embeddingAutoUpdateEnabled",
+ "embeddingBatchSize",
+ "embeddingUpdateInterval",
+ "embeddingDefaultDimension",
+ "embeddingsDefaultProvider",
+ "embeddingProviderPrecedence",
+ "embeddingSimilarityThreshold",
+ "maxNotesPerLlmQuery",
+ "enableAutomaticIndexing",
+ "embeddingGenerationLocation",
+ "embeddingDimensionStrategy",
- "splitEditorOrientation"
+ "splitEditorOrientation",
+ "mfaEnabled",
+ "mfaMethod"
]);
function getOptions() {
diff --cc src/services/app_info.ts
index 63c4edfcd2,bd1436912b..60b453f9db
--- a/src/services/app_info.ts
+++ b/src/services/app_info.ts
@@@ -5,8 -3,8 +3,8 @@@ import build from "./build.js"
import packageJson from "../../package.json" with { type: "json" };
import dataDir from "./data_dir.js";
--const APP_DB_VERSION = 229;
-const SYNC_VERSION = 34;
++const APP_DB_VERSION = 230;
+const SYNC_VERSION = 35;
const CLIPPER_PROTOCOL_VERSION = "1.0";
export default {
diff --cc src/services/options_interface.ts
index 3a0af26b5b,cdd9184fb6..bd86bdc4b9
--- a/src/services/options_interface.ts
+++ b/src/services/options_interface.ts
@@@ -48,39 -48,17 +48,50 @@@ export interface OptionDefinitions exte
encryptedDataKey: string;
hoistedNoteId: string;
+ // AI/LLM integration options
+ aiEnabled: boolean;
+ aiProvider: string;
+ aiSystemPrompt: string;
+ aiTemperature: string;
+ openaiApiKey: string;
+ openaiDefaultModel: string;
+ openaiEmbeddingModel: string;
+ openaiBaseUrl: string;
+ anthropicApiKey: string;
+ anthropicDefaultModel: string;
+ voyageEmbeddingModel: string;
+ voyageApiKey: string;
+ anthropicBaseUrl: string;
+ ollamaEnabled: boolean;
+ ollamaBaseUrl: string;
+ ollamaDefaultModel: string;
+ ollamaEmbeddingModel: string;
+ codeOpenAiModel: string;
+ aiProviderPrecedence: string;
+
+ // Embedding-related options
+ embeddingAutoUpdateEnabled: boolean;
+ embeddingUpdateInterval: number;
+ embeddingBatchSize: number;
+ embeddingDefaultDimension: number;
+ embeddingsDefaultProvider: string;
+ embeddingProviderPrecedence: string;
+ enableAutomaticIndexing: boolean;
+ embeddingSimilarityThreshold: string;
+ maxNotesPerLlmQuery: string;
+ embeddingGenerationLocation: string;
+ embeddingDimensionStrategy: string; // 'adapt' or 'regenerate'
+ // Multi-Factor Authentication
+ mfaEnabled: boolean;
+ mfaMethod: string;
+ totpEncryptionSalt: string;
+ totpEncryptedSecret: string;
+ totpVerificationHash: string;
+ encryptedRecoveryCodes: boolean;
+ userSubjectIdentifierSaved: boolean;
+ recoveryCodeInitialVector: string;
+ recoveryCodeSecurityKey: string;
+ recoveryCodesEncrypted: string;
lastSyncedPull: number;
lastSyncedPush: number;