mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
docs(readme): clarify displayed file size represents original file size
This commit is contained in:
@@ -402,12 +402,31 @@ describe('Agent Chat Workflow', () => {
|
||||
it('should execute direct-context chatbot flow resolving file metadata and skipping comment placeholder', async () => {
|
||||
mockActivities.getAssetActivity.mockImplementation(async (id: string) => {
|
||||
if (id === 'file-attachment-1') {
|
||||
return { id: 'file-attachment-1', name: 'attachment.png', type: 'file', mediaType: 'image/png', projectId: 'p1' }
|
||||
return {
|
||||
id: 'file-attachment-1',
|
||||
name: 'attachment.png',
|
||||
type: 'file',
|
||||
mediaType: 'image/png',
|
||||
projectId: 'p1',
|
||||
}
|
||||
}
|
||||
if (id === 'referenced-asset-1') {
|
||||
return { id: 'referenced-asset-1', name: 'ref-folder', type: 'folder', mediaType: null, projectId: 'p1' }
|
||||
return {
|
||||
id: 'referenced-asset-1',
|
||||
name: 'ref-folder',
|
||||
type: 'folder',
|
||||
mediaType: null,
|
||||
projectId: 'p1',
|
||||
}
|
||||
}
|
||||
return {
|
||||
id,
|
||||
name: 'test-file.png',
|
||||
type: 'file',
|
||||
mediaType: 'image/png',
|
||||
projectId: 'p1',
|
||||
project: { teamId: 't1' },
|
||||
}
|
||||
return { id, name: 'test-file.png', type: 'file', mediaType: 'image/png', projectId: 'p1', project: { teamId: 't1' } }
|
||||
})
|
||||
|
||||
mockActivities.getAssetPathContextActivity.mockImplementation(async (id: string) => {
|
||||
@@ -448,8 +467,12 @@ describe('Agent Chat Workflow', () => {
|
||||
.withAssetDetails('test-file.png', 'image/png', undefined)
|
||||
.withCommentTimestamp(undefined)
|
||||
.withExplicitMention(true)
|
||||
.withAttachedFiles(['- Name: attachment.png (ID: file-attachment-1, Type: file, Media Type: image/png, Project ID: p1, Path: attachment.png)'])
|
||||
.withReferencedAssets(['- Name: ref-folder (ID: referenced-asset-1, Type: folder, Media Type: unknown, Project ID: p1, Path: ref-folder)'])
|
||||
.withAttachedFiles([
|
||||
'- Name: attachment.png (ID: file-attachment-1, Type: file, Media Type: image/png, Project ID: p1, Path: attachment.png)',
|
||||
])
|
||||
.withReferencedAssets([
|
||||
'- Name: ref-folder (ID: referenced-asset-1, Type: folder, Media Type: unknown, Project ID: p1, Path: ref-folder)',
|
||||
])
|
||||
.build()
|
||||
|
||||
expect(mockActivities.agentChatActivity).toHaveBeenCalledWith({
|
||||
|
||||
@@ -132,7 +132,7 @@ export async function agentChat(task: WorkflowTask): Promise<void> {
|
||||
if (file) {
|
||||
const path = await executeActivity(agentWorkerQueue, getAssetPathContextActivity, fileId)
|
||||
attachedFileDetailsList.push(
|
||||
`- Name: ${file.name} (ID: ${file.id}, Type: ${file.type}, Media Type: ${file.mediaType || 'unknown'}, Project ID: ${file.projectId || 'unknown'}, Path: ${path})`
|
||||
`- Name: ${file.name} (ID: ${file.id}, Type: ${file.type}, Media Type: ${file.mediaType || 'unknown'}, Project ID: ${file.projectId || 'unknown'}, Path: ${path})`,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ export async function agentChat(task: WorkflowTask): Promise<void> {
|
||||
if (referencedAsset) {
|
||||
const path = await executeActivity(agentWorkerQueue, getAssetPathContextActivity, assetId)
|
||||
referencedAssetDetailsList.push(
|
||||
`- Name: ${referencedAsset.name} (ID: ${referencedAsset.id}, Type: ${referencedAsset.type}, Media Type: ${referencedAsset.mediaType || 'unknown'}, Project ID: ${referencedAsset.projectId || 'unknown'}, Path: ${path})`
|
||||
`- Name: ${referencedAsset.name} (ID: ${referencedAsset.id}, Type: ${referencedAsset.type}, Media Type: ${referencedAsset.mediaType || 'unknown'}, Project ID: ${referencedAsset.projectId || 'unknown'}, Path: ${path})`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user