feat(chat): 将工具调用卡片状态化并嵌入消息流
重构工具消息的呈现与更新逻辑,使其与常规消息一同展示并通过视觉状态反映执行进展。 - 为工具消息新增状态指示(执行中/完成/出错)、图标标签及输入摘要 - 实现通过 toolName/toolStatus 字段定位并就地更新已有工具消息而非追加新项 - 从消息列表中移除对 tool 角色的过滤,使其以内联卡片形式嵌入聊天流 - 添加液体填充动画,在工具执行期间提供进度反馈 - 为视频资源预览增加播放按钮遮罩以提示可播放 - 为 .mp4 与 .webm 文件设置正确的 Content-Type 头
This commit is contained in:
@@ -132,6 +132,9 @@ assetsRouter.get('/file', (req, res) => {
|
||||
const fullPath = path.resolve(PROJECT_ROOT, filePath);
|
||||
if (!fullPath.startsWith(PROJECT_ROOT)) return res.status(403).send('Forbidden');
|
||||
if (!fss.existsSync(fullPath)) return res.status(404).send('Not found');
|
||||
// Set correct Content-Type for video files
|
||||
if (fullPath.endsWith('.mp4')) res.setHeader('Content-Type', 'video/mp4');
|
||||
else if (fullPath.endsWith('.webm')) res.setHeader('Content-Type', 'video/webm');
|
||||
// Cache static assets for 1 hour
|
||||
res.setHeader('Cache-Control', 'public, max-age=3600');
|
||||
res.sendFile(fullPath);
|
||||
|
||||
Reference in New Issue
Block a user