mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 01:26:37 +08:00
feat(server): refactor copilot (#14892)
#### PR Dependency Tree * **PR #14892** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
@@ -7,82 +7,55 @@ import { DocStorageModule } from '../../core/doc';
|
||||
import { FeatureModule } from '../../core/features';
|
||||
import { PermissionModule } from '../../core/permission';
|
||||
import { QuotaModule } from '../../core/quota';
|
||||
import { StorageModule } from '../../core/storage';
|
||||
import { WorkspaceModule } from '../../core/workspaces';
|
||||
import { IndexerModule } from '../indexer';
|
||||
import {
|
||||
CopilotContextResolver,
|
||||
CopilotContextRootResolver,
|
||||
CopilotContextService,
|
||||
} from './context';
|
||||
import { CopilotController } from './controller';
|
||||
import { CopilotCronJobs } from './cron';
|
||||
import { CopilotEmbeddingJob } from './embedding';
|
||||
import { WorkspaceMcpController } from './mcp/controller';
|
||||
import { WorkspaceMcpProvider } from './mcp/provider';
|
||||
import { ChatMessageCache } from './message';
|
||||
import { PromptService } from './prompt';
|
||||
import { CopilotProviderFactory, CopilotProviders } from './providers';
|
||||
import {
|
||||
CopilotResolver,
|
||||
PromptsManagementResolver,
|
||||
UserCopilotResolver,
|
||||
} from './resolver';
|
||||
import { ChatSessionService } from './session';
|
||||
import { CopilotStorage } from './storage';
|
||||
import {
|
||||
CopilotTranscriptionResolver,
|
||||
CopilotTranscriptionService,
|
||||
} from './transcript';
|
||||
import { CopilotWorkflowExecutors, CopilotWorkflowService } from './workflow';
|
||||
import {
|
||||
CopilotWorkspaceEmbeddingConfigResolver,
|
||||
CopilotWorkspaceEmbeddingResolver,
|
||||
CopilotWorkspaceService,
|
||||
} from './workspace';
|
||||
COPILOT_API_PROVIDERS,
|
||||
COPILOT_FEATURE_PROVIDERS,
|
||||
COPILOT_KERNEL_PROVIDERS,
|
||||
} from './module-providers';
|
||||
|
||||
const COPILOT_SHARED_IMPORTS = [
|
||||
DocStorageModule,
|
||||
FeatureModule,
|
||||
QuotaModule,
|
||||
PermissionModule,
|
||||
ServerConfigModule,
|
||||
StorageModule,
|
||||
WorkspaceModule,
|
||||
IndexerModule,
|
||||
];
|
||||
|
||||
@Module({
|
||||
imports: [...COPILOT_SHARED_IMPORTS],
|
||||
providers: [...COPILOT_KERNEL_PROVIDERS],
|
||||
exports: [...COPILOT_KERNEL_PROVIDERS],
|
||||
})
|
||||
export class CopilotKernelModule {}
|
||||
|
||||
@Module({
|
||||
imports: [...COPILOT_SHARED_IMPORTS, CopilotKernelModule],
|
||||
providers: [...COPILOT_FEATURE_PROVIDERS],
|
||||
exports: [...COPILOT_FEATURE_PROVIDERS],
|
||||
})
|
||||
export class CopilotFeatureModule {}
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
DocStorageModule,
|
||||
FeatureModule,
|
||||
QuotaModule,
|
||||
PermissionModule,
|
||||
ServerConfigModule,
|
||||
WorkspaceModule,
|
||||
IndexerModule,
|
||||
],
|
||||
providers: [
|
||||
// providers
|
||||
...CopilotProviders,
|
||||
CopilotProviderFactory,
|
||||
// services
|
||||
ChatSessionService,
|
||||
CopilotResolver,
|
||||
ChatMessageCache,
|
||||
PromptService,
|
||||
CopilotStorage,
|
||||
// workflow
|
||||
CopilotWorkflowService,
|
||||
...CopilotWorkflowExecutors,
|
||||
// context
|
||||
CopilotContextResolver,
|
||||
CopilotContextService,
|
||||
// jobs
|
||||
CopilotEmbeddingJob,
|
||||
CopilotCronJobs,
|
||||
// transcription
|
||||
CopilotTranscriptionService,
|
||||
CopilotTranscriptionResolver,
|
||||
// workspace embeddings
|
||||
CopilotWorkspaceService,
|
||||
CopilotWorkspaceEmbeddingResolver,
|
||||
CopilotWorkspaceEmbeddingConfigResolver,
|
||||
// gql resolvers
|
||||
UserCopilotResolver,
|
||||
PromptsManagementResolver,
|
||||
CopilotContextRootResolver,
|
||||
// mcp
|
||||
WorkspaceMcpProvider,
|
||||
...COPILOT_SHARED_IMPORTS,
|
||||
CopilotKernelModule,
|
||||
CopilotFeatureModule,
|
||||
],
|
||||
providers: [...COPILOT_API_PROVIDERS],
|
||||
exports: [...COPILOT_API_PROVIDERS],
|
||||
})
|
||||
export class CopilotApiModule {}
|
||||
|
||||
@Module({
|
||||
imports: [CopilotKernelModule, CopilotFeatureModule, CopilotApiModule],
|
||||
controllers: [CopilotController, WorkspaceMcpController],
|
||||
})
|
||||
export class CopilotModule {}
|
||||
|
||||
Reference in New Issue
Block a user