feat: expand model tools and document handling

This commit is contained in:
lofyer
2026-08-11 19:52:58 +08:00
parent 71a8662690
commit 184180e618
50 changed files with 2537 additions and 747 deletions
+19 -1
View File
@@ -277,8 +277,12 @@ describe('ContextManager', () => {
filePaths: [filePath]
})
const manager = new ContextManager()
const onProgress = vi.fn()
const [attachment] = await manager.selectFiles({} as BrowserWindow)
const [attachment] = await manager.selectFiles(
{} as BrowserWindow,
onProgress
)
expect(attachment).toMatchObject({
name: '需求说明.docx',
@@ -301,6 +305,20 @@ describe('ContextManager', () => {
])
})
)
expect(onProgress.mock.calls.map(([progress]) => progress)).toEqual([
{
phase: 'reading',
fileName: '需求说明.docx',
fileNumber: 1,
fileCount: 1
},
{
phase: 'parsing',
fileName: '需求说明.docx',
fileNumber: 1,
fileCount: 1
}
])
const prompt = manager.enrichRequest({
requestId: '1f6a37b6-e0a3-449f-8878-b10d353fbfb4',
conversationId: 'conversation-1',