feat: AI 对话支持 A2UI 表单/审查/图表与 Agent 工具

This commit is contained in:
2026-08-05 17:11:00 +08:00
parent 644c35ce53
commit 0e6e3e2d96
64 changed files with 8395 additions and 6434 deletions

View File

@@ -28,14 +28,6 @@ const ACCEPTED_MIME_TYPES = new Set([
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
]);
interface MammothResult {
value: string;
}
interface MammothModule {
extractRawText(input: { buffer: Buffer }): Promise<MammothResult>;
}
export interface AiAttachmentModelPart {
attachment: AiAttachment;
text?: string;
@@ -218,7 +210,7 @@ export class AiAttachmentService {
}
}
if (mimeType.includes('wordprocessingml')) {
const mammoth = (await import('mammoth')) as unknown as MammothModule;
const mammoth = await import('mammoth');
const result = await mammoth.extractRawText({ buffer });
return this.normalizeExtractedText(result.value);
}