Add smart ACK provider for WeChat MP replies

Replace fixed ackText with a rule-based AckProvider that picks
response templates by message type and intent (translate, summary,
rewrite, poster, ppt, mindmap, code, search, schedule). Pure sync,
zero I/O, auto-falls back to config.ackText on any error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
john
2026-06-26 15:19:03 +08:00
parent 9ed4fd48d7
commit 9b4a25799f
162 changed files with 17276 additions and 2054 deletions
+9 -2
View File
@@ -4,6 +4,7 @@ import type { Message } from '../types';
import { getDisplayText, getImageUrls, getThinking } from '../utils/message';
import { getMessageSaveActions } from '../utils/messageSave';
import { renderMarkdown } from '../utils/markdown';
import { filterText } from '../utils/wordFilter';
import { formatChatTime, shouldShowTimestamp } from '../utils/time';
import { TKMindAvatar } from './TKMindAvatar';
import { UserAvatar } from './UserAvatar';
@@ -123,6 +124,7 @@ function MessageRow({
onAvatarClick,
onSaveAsPage,
saveDisabled,
publishUserId,
publishUsername,
compact = false,
}: {
@@ -131,12 +133,14 @@ function MessageRow({
onAvatarClick?: () => void;
onSaveAsPage?: (message: Message) => void;
saveDisabled?: boolean;
publishUserId?: string;
publishUsername?: string;
compact?: boolean;
}) {
const [actionsOpen, setActionsOpen] = useState(false);
const text = getDisplayText(message);
const saveActions = getMessageSaveActions(text, publishUsername);
const rawText = getDisplayText(message);
const text = filterText(rawText);
const saveActions = getMessageSaveActions(text, { userId: publishUserId, username: publishUsername });
const thinking = getThinking(message);
const isUser = message.role === 'user';
const imageUrls = getImageUrls(message);
@@ -283,6 +287,7 @@ export function MessageList({
streaming,
onAvatarClick,
onSaveAsPage,
publishUserId,
publishUsername,
compact = false,
}: {
@@ -290,6 +295,7 @@ export function MessageList({
streaming: boolean;
onAvatarClick?: () => void;
onSaveAsPage?: (message: Message) => void;
publishUserId?: string;
publishUsername?: string;
compact?: boolean;
}) {
@@ -316,6 +322,7 @@ export function MessageList({
onAvatarClick={onAvatarClick}
onSaveAsPage={onSaveAsPage}
saveDisabled={streaming}
publishUserId={publishUserId}
publishUsername={publishUsername}
compact={compact}
/>