feat(task): inject uploaded documents into task materials and enable LAN host access

- backend: add Materials field to TaskRunRequestDTO and forward to ExecuteTask
- backend: add TestTaskStream_MaterialsInjection test case in taskstream_test.go
- web: serialize materials in buildTaskRequest and add unit test
- web: improve isSameMessage identity comparison in messageIdentity.ts
- web: configure host: '0.0.0.0' in vite.config.ts for LAN collaboration access
This commit is contained in:
WeiCHEN
2026-09-13 02:50:22 +00:00
committed by weichen
parent cc2aa33b10
commit eea28f0be4
6 changed files with 117 additions and 22 deletions
+15
View File
@@ -35,6 +35,21 @@ test('buildTaskRequest: omits optional fields when absent', () => {
assert.equal('target_market' in req, false);
assert.equal('user_id' in req, false);
assert.equal('project_id' in req, false);
assert.equal('materials' in req, false);
});
test('buildTaskRequest: includes materials when provided and non-empty', () => {
const req = buildTaskRequest({
taskKey: 'intake',
projectName: 'P',
customerName: 'C',
deviceType: 'D',
materials: [
{ filename: 'doc1.txt', content: 'b64content==' },
],
});
assert.equal('materials' in req, true);
assert.deepEqual(req.materials, [{ filename: 'doc1.txt', content: 'b64content==' }]);
});
test('buildResumeRequest: adds work_dir on top of task request', () => {