diff --git a/README.md b/README.md index b28b1acfc8..70ea927272 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,16 @@ English | [δΈ­ζ–‡](./README_zh.md) ## πŸ’‘ What's New -**πŸš€ 3.8 Sandbox Environment!** +**πŸš€ 3.9 Enhanced Multi-Agent Collaboration!** + +XpertAI 3.9 introduces enhanced multi-agent collaboration capabilities, allowing agents to work together more effectively on complex tasks. Key features include: + +- **Agent Team Composition**: Create specialized agent teams with predefined roles and responsibilities +- **Task Decomposition**: Automatic task breakdown and distribution among team members +- **Collaborative Decision Making**: Agents can share insights and coordinate decisions +- **Progress Sync**: Real-time progress synchronization between collaborating agents + +**πŸš€ 3.8 Sandbox Environment!**** XpertAI 3.8 releases the Agent Sandbox feature, providing an isolated execution and file operation environment for agents. One of the core capabilities of the sandbox plugin is the provider plugin mechanism. Through custom providers, you can integrate different runtime infrastructures, such as: diff --git a/package.json b/package.json index a54cadf1bd..cccbfa3642 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xpert.ai", - "version": "3.0", + "version": "3.9", "description": "", "license": "AGPL-3.0", "homepage": "https://xpertai.cn", diff --git a/packages/server-ai/src/knowledge-document/document.subscriber.ts b/packages/server-ai/src/knowledge-document/document.subscriber.ts index 31eacbb281..3ee321e2b4 100644 --- a/packages/server-ai/src/knowledge-document/document.subscriber.ts +++ b/packages/server-ai/src/knowledge-document/document.subscriber.ts @@ -1,31 +1,52 @@ import { DocumentTypeEnum } from '@metad/contracts' -import { EntitySubscriberInterface, EventSubscriber, InsertEvent } from 'typeorm' +import { StorageFile } from '@metad/server-core' +import { EntitySubscriberInterface, EventSubscriber, InsertEvent, LoadEvent } from 'typeorm' import { Knowledgebase } from '../core/entities/internal' import { KnowledgeDocument } from './document.entity' +import { FileStorage } from '@metad/server-core' @EventSubscriber() export class KnowledgeDocumentSubscriber implements EntitySubscriberInterface { - /** - * Specify the entity type to monitor - */ - listenTo() { - return KnowledgeDocument - } + /** + * Specify the entity type to monitor + */ + listenTo() { + return KnowledgeDocument + } - /** - * Increment the document count when creating a file - * - * @param event - */ - async beforeInsert(event: InsertEvent) { - if (event.entity.sourceType !== DocumentTypeEnum.FOLDER) { - const kbRepo = event.queryRunner.manager.getRepository(Knowledgebase) - const kb = await kbRepo.findOneBy({ id: event.entity.knowledgebaseId }) - if (kb) { - kb.documentNum ??= 0 - kb.documentNum += 1 - await kbRepo.save(kb) - } - } - } + /** + * Increment the document count when creating a file + * + * @param event + */ + async beforeInsert(event: InsertEvent) { + if (event.entity.sourceType !== DocumentTypeEnum.FOLDER) { + const kbRepo = event.queryRunner.manager.getRepository(Knowledgebase) + const kb = await kbRepo.findOne({ where: { id: event.entity.knowledgebaseId } }) + if (kb) { + kb.documentNum ??= 0 + kb.documentNum += 1 + await kbRepo.save(kb) + } + } + } + + /** + * Populate fileUrl from StorageFile when loading document + * + * @param entity + * @param event + */ + async afterLoad(entity: KnowledgeDocument, event?: LoadEvent): Promise { + if (entity instanceof KnowledgeDocument && entity.storageFileId && !entity.fileUrl) { + const storageFile = await event.manager.findOne(StorageFile, { + where: { id: entity.storageFileId }, + select: ['id', 'file', 'storageProvider'] + }) + if (storageFile?.file && storageFile.storageProvider) { + const store = new FileStorage().setProvider(storageFile.storageProvider) + entity.fileUrl = store.getProviderInstance().url(storageFile.file) + } + } + } }