feat(ai): support agent attachments and on-demand LMS documentation
This commit is contained in:
@@ -36,4 +36,24 @@ describe('CreateAgentPlanDto', () => {
|
||||
|
||||
expect(errors).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('accepts text attachments and explicit source-read status', async () => {
|
||||
const dto = plainToInstance(CreateAgentPlanDto, {
|
||||
...createDto('첨부 파일에서 조향 설정을 확인해줘'),
|
||||
attachments: [{ name: 'control.yaml', content: 'steering: ackermann' }],
|
||||
modules: [{ name: 'Control', files: [], fileContext: { status: 'empty', message: 'No text files' } }],
|
||||
});
|
||||
expect(await validate(dto, { whitelist: true, forbidNonWhitelisted: true })).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('validates attachment count, file size and nested source-read metadata', async () => {
|
||||
const dto = plainToInstance(CreateAgentPlanDto, {
|
||||
...createDto('파일 확인'),
|
||||
attachments: Array.from({ length: 6 }, () => ({ name: '', content: 'x'.repeat(50_001) })),
|
||||
modules: [{ name: 'Control', files: [], fileContext: { status: 'invented', message: 'x'.repeat(501) } }],
|
||||
});
|
||||
const errors = await validate(dto);
|
||||
expect(errors.some((error) => error.property === 'attachments')).toBe(true);
|
||||
expect(errors.some((error) => error.property === 'modules')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user