| |
| |
| |
|
|
|
|
| export interface DatabaseSettings {
|
|
|
| location: {
|
| databasePath: string;
|
| dataDir: string;
|
| walSizeBytes: number;
|
| schemaVersion: number;
|
| };
|
|
|
|
|
| logs: {
|
| detailedLogsEnabled: boolean;
|
| callLogPipelineEnabled: boolean;
|
| maxDetailSizeKb: number;
|
| ringBufferSize: number;
|
| };
|
|
|
|
|
| backup: {
|
| autoBackupEnabled: boolean;
|
| autoBackupFrequency: "never" | "daily" | "weekly" | "monthly";
|
| keepLastNBackups: number;
|
| };
|
|
|
|
|
| cache: {
|
| semanticCacheEnabled: boolean;
|
| semanticCacheMaxSize: number;
|
| semanticCacheTTL: number;
|
| promptCacheEnabled: boolean;
|
| promptCacheStrategy: "auto" | "system-only" | "manual";
|
| alwaysPreserveClientCache: "auto" | "always" | "never";
|
| };
|
|
|
|
|
| retention: {
|
| quotaSnapshots: number;
|
| compressionAnalytics: number;
|
| mcpAudit: number;
|
| a2aEvents: number;
|
| callLogs: number;
|
| usageHistory: number;
|
| memoryEntries: number;
|
| autoCleanupEnabled: boolean;
|
| };
|
|
|
|
|
| aggregation: {
|
| enabled: boolean;
|
| rawDataRetentionDays: number;
|
| granularity: "hourly" | "daily" | "weekly";
|
| };
|
|
|
|
|
| optimization: {
|
| autoVacuumMode: "NONE" | "FULL" | "INCREMENTAL";
|
| scheduledVacuum: "never" | "daily" | "weekly" | "monthly";
|
| vacuumHour: number;
|
| pageSize: number;
|
| cacheSize: number;
|
| optimizeOnStartup: boolean;
|
| };
|
|
|
|
|
| stats: {
|
| databaseSizeBytes: number;
|
| pageCount: number;
|
| freelistCount: number;
|
| lastVacuumAt: string | null;
|
| lastOptimizationAt: string | null;
|
| integrityCheck: "ok" | "error" | null;
|
| };
|
| }
|
|
|
|
|
| export const DEFAULT_DATABASE_SETTINGS: Omit<DatabaseSettings, "location" | "stats"> = {
|
| logs: {
|
| detailedLogsEnabled: false,
|
| callLogPipelineEnabled: false,
|
| maxDetailSizeKb: 10,
|
| ringBufferSize: 500,
|
| },
|
| backup: {
|
| autoBackupEnabled: false,
|
| autoBackupFrequency: "never",
|
| keepLastNBackups: 5,
|
| },
|
| cache: {
|
| semanticCacheEnabled: true,
|
| semanticCacheMaxSize: 100,
|
| semanticCacheTTL: 1800000,
|
| promptCacheEnabled: true,
|
| promptCacheStrategy: "auto",
|
| alwaysPreserveClientCache: "auto",
|
| },
|
| retention: {
|
| quotaSnapshots: 7,
|
| compressionAnalytics: 30,
|
| mcpAudit: 30,
|
| a2aEvents: 30,
|
| callLogs: 30,
|
| usageHistory: 30,
|
| memoryEntries: 30,
|
| autoCleanupEnabled: true,
|
| },
|
| aggregation: {
|
| enabled: true,
|
| rawDataRetentionDays: 30,
|
| granularity: "daily",
|
| },
|
| optimization: {
|
| autoVacuumMode: "FULL",
|
| scheduledVacuum: "weekly",
|
| vacuumHour: 2,
|
| pageSize: 4096,
|
| cacheSize: -2000,
|
| optimizeOnStartup: true,
|
| },
|
| };
|
|
|