mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 09:36:17 +08:00
8d889fc3c7
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced a new endpoint for MCP (Model Context Protocol) server interaction under `/api/workspaces/:workspaceId/mcp`, enabling advanced document reading and search capabilities within workspaces. * Added support for semantic and keyword search tools, as well as document reading through the MCP server, with user access control and input validation. * **Improvements** * Enhanced metadata handling in semantic search results for improved clarity. * Streamlined internal imports and refactored utility functions for better maintainability. * **Chores** * Added a new SDK dependency to the backend server package. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
89 lines
2.5 KiB
TypeScript
89 lines
2.5 KiB
TypeScript
import './config';
|
|
|
|
import { Module } from '@nestjs/common';
|
|
|
|
import { ServerConfigModule } from '../../core';
|
|
import { DocStorageModule } from '../../core/doc';
|
|
import { FeatureModule } from '../../core/features';
|
|
import { PermissionModule } from '../../core/permission';
|
|
import { QuotaModule } from '../../core/quota';
|
|
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';
|
|
|
|
@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,
|
|
],
|
|
controllers: [CopilotController, WorkspaceMcpController],
|
|
})
|
|
export class CopilotModule {}
|