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:
@@ -159,6 +159,14 @@ const TRUSTED_EXTERNAL_HOSTS = new Set([
|
||||
'images.unsplash.com',
|
||||
]);
|
||||
|
||||
export function replacePrivateResourceReferences(content, replacement) {
|
||||
const source = String(content ?? '');
|
||||
if (!source) return source;
|
||||
const replacer =
|
||||
typeof replacement === 'function' ? replacement : () => String(replacement ?? '');
|
||||
return source.replace(PRIVATE_URL_PATTERN, (...args) => replacer(...args));
|
||||
}
|
||||
|
||||
function inferFormat(content, format) {
|
||||
if (format === 'html') return 'html';
|
||||
return HTML_TAG_PATTERN.test(String(content ?? '')) ? 'html' : 'text';
|
||||
|
||||
Reference in New Issue
Block a user