From 3c6c765e51eb2962e2c572910c13d12c748750f4 Mon Sep 17 00:00:00 2001
From: jack <40621978+SuperCoderMan521@users.noreply.github.com>
Date: Sun, 28 Jun 2026 16:06:06 +0800
Subject: [PATCH] feat(chat): surface generated-file artifacts in the
run-overview rail
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Extract generated-file download links from tool results — on the backend (persisted to message metadata for history) and on the frontend (live during SSE) — de-duplicate by URL, and render them as a Generated Files section with file-type icons and a rail badge.
---
.../vip/mate/channel/web/ChatController.java | 34 ++++++++
.../src/components/chat/RunOverviewPanel.vue | 84 ++++++++++++++++++-
mateclaw-ui/src/composables/chat/useChat.ts | 31 ++++++-
mateclaw-ui/src/i18n/locales/en-US.ts | 2 +
mateclaw-ui/src/i18n/locales/zh-CN.ts | 2 +
mateclaw-ui/src/types/index.ts | 9 ++
6 files changed, 158 insertions(+), 4 deletions(-)
diff --git a/mateclaw-server/src/main/java/vip/mate/channel/web/ChatController.java b/mateclaw-server/src/main/java/vip/mate/channel/web/ChatController.java
index 06f384ac..2e8a6764 100644
--- a/mateclaw-server/src/main/java/vip/mate/channel/web/ChatController.java
+++ b/mateclaw-server/src/main/java/vip/mate/channel/web/ChatController.java
@@ -1731,6 +1731,11 @@ public class ChatController {
|| lower.contains("client abort") || lower.contains("closed");
}
+ /** Markdown link pointing at a generated-file download URL. Used by the
+ * StreamAccumulator to surface generated artifacts in the run-overview rail. */
+ private static final java.util.regex.Pattern GENERATED_FILE_LINK_PATTERN =
+ java.util.regex.Pattern.compile("\\[([^\\]]+)\\]\\(([^)]*?/api/v1/files/generated/[a-zA-Z0-9-]+)\\)");
+
/**
* 流式累积器 — 收集 StreamDelta 事件,持久化到 DB。
*
@@ -1753,6 +1758,8 @@ public class ChatController {
private final List