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
+10
View File
@@ -22,6 +22,15 @@ test('filterChatSkills gates platform skills by grantedSkills', () => {
assert.ok(visible.some((item) => item.id === 'web-search'));
assert.ok(visible.some((item) => item.id === 'code-search'));
assert.equal(visible.some((item) => item.id === 'form-collect'), false);
assert.equal(visible.some((item) => item.id === 'product-campaign-page'), false);
});
test('filterChatSkills shows product campaign page when granted', () => {
const visible = filterChatSkills(CHAT_SKILL_DEFINITIONS, {
canPublish: false,
grantedSkills: ['product-campaign-page'],
});
assert.ok(visible.some((item) => item.id === 'product-campaign-page'));
});
test('filterChatSkills shows generate-page when publish is allowed', () => {
@@ -31,6 +40,7 @@ test('filterChatSkills shows generate-page when publish is allowed', () => {
test('buildChatSkillPrompt includes skill name for platform skills', () => {
assert.match(buildChatSkillPrompt('web', 'web'), /请使用 web 技能/);
assert.match(buildChatSkillPrompt('product-campaign-page'), /商品宣传 \/ 活动页/);
assert.match(buildChatSkillPrompt('generate-page'), /static-page-publish/);
});