mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
feat(ai): expose cached global activity summaries
This commit is contained in:
1 parent
dff4f4dfa8
commit
207c41afaa
17 files changed
+313
-6
No files matched your search
@@ -24,6 +24,7 @@ import {
|
||||
logNativeParserStatus,
|
||||
createContactsService,
|
||||
createCrossChatAnalysisService,
|
||||
createGlobalInsightService,
|
||||
createDatabaseManagerAdapter,
|
||||
PreferencesManager,
|
||||
} from '@openchatlab/node-runtime'
|
||||
@@ -148,9 +149,17 @@ export async function startHttpServer(options?: HttpServerOptions): Promise<{
|
||||
nativeBinding,
|
||||
})
|
||||
const preferencesManager = new PreferencesManager(pathProvider.getSystemDir())
|
||||
const globalInsightService = createGlobalInsightService({
|
||||
adapter: sessionAdapter,
|
||||
pathProvider,
|
||||
runtimeIdentity: runtime,
|
||||
nativeBinding,
|
||||
getExcludedSessionIds: () => preferencesManager.load().ownerExcludedSessionIds,
|
||||
})
|
||||
const crossChatAnalysisService = createCrossChatAnalysisService({
|
||||
adapter: sessionAdapter,
|
||||
contactsService,
|
||||
globalInsightService,
|
||||
getExcludedSessionIds: () => preferencesManager.load().ownerExcludedSessionIds,
|
||||
})
|
||||
|
||||
@@ -203,6 +212,7 @@ export async function startHttpServer(options?: HttpServerOptions): Promise<{
|
||||
nativeBinding,
|
||||
runtimeIdentity: runtime,
|
||||
contactsService,
|
||||
globalInsightService,
|
||||
preferencesManager,
|
||||
semanticIndexService,
|
||||
aiContext: {
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
CustomProviderStore,
|
||||
CustomModelStore,
|
||||
ContactsService,
|
||||
GlobalInsightService,
|
||||
PreferencesManager,
|
||||
PendingDataDirMigration,
|
||||
RuntimeIdentity,
|
||||
@@ -74,6 +75,7 @@ export function registerWebRoutes(
|
||||
nativeBinding?: string
|
||||
runtimeIdentity?: RuntimeIdentity
|
||||
contactsService?: ContactsService
|
||||
globalInsightService?: GlobalInsightService
|
||||
preferencesManager?: PreferencesManager
|
||||
aiContext?: AiContextOptions
|
||||
/** 由 server 入口注入的共享语义索引运行时;传入时由调用方管理生命周期 */
|
||||
@@ -137,6 +139,7 @@ export function registerWebRoutes(
|
||||
nativeBinding: options?.nativeBinding,
|
||||
semanticIndexService,
|
||||
contactsService: options?.contactsService,
|
||||
globalInsightService: options?.globalInsightService,
|
||||
preferencesManager: options?.preferencesManager,
|
||||
analyticsService,
|
||||
getCurrentAiLogPath: () => getServerAiLogger()?.getExistingLogPath() ?? null,
|
||||
|
||||
Reference in new issue
Block a user