feat(server): workspace doc update event from indexer (#12186)

fix AI-108
fix AI-109
fix AI-13
This commit is contained in:
darkskygit
2025-05-09 07:35:47 +00:00
parent 918b3b2dab
commit 5f5de8e89d
6 changed files with 66 additions and 8 deletions

View File

@@ -87,6 +87,30 @@ export class CopilotContextDocJob {
}
}
// @OnEvent('doc.indexer.updated')
async addDocEmbeddingQueueFromEvent(
// TODO(@darkskygit): replace this with real event type
doc: { workspaceId: string; docId: string } //Events['doc.indexer.updated'],
) {
if (!this.supportEmbedding) return;
await this.queue.add('copilot.embedding.docs', {
workspaceId: doc.workspaceId,
docId: doc.workspaceId,
});
}
// @OnEvent('doc.indexer.deleted')
async deleteDocEmbeddingQueueFromEvent(
// TODO(@darkskygit): replace this with real event type
doc: { workspaceId: string; docId: string } //Events['doc.indexer.deleted'],
) {
await this.models.copilotContext.deleteWorkspaceEmbedding(
doc.workspaceId,
doc.docId
);
}
async readCopilotBlob(
userId: string,
workspaceId: string,