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:
+11
-11
@@ -26,24 +26,24 @@ test('publish dir and public url use stable user id', () => {
|
||||
const h5Root = fs.mkdtempSync(path.join(os.tmpdir(), 'h5-'));
|
||||
const layout = ensureUserPublishLayout({
|
||||
h5Root,
|
||||
publicBaseUrl: 'https://g2.tkmind.cn',
|
||||
publicBaseUrl: 'https://m.tkmind.cn',
|
||||
user: { id: USER_ID, username: 'john' },
|
||||
});
|
||||
assert.equal(layout.slug, USER_ID);
|
||||
assert.equal(layout.username, 'john');
|
||||
assert.ok(layout.publishDir.endsWith(`${path.sep}${PUBLISH_ROOT_DIR}${path.sep}${USER_ID}`));
|
||||
assert.equal(layout.publicUrl, `https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/`);
|
||||
assert.equal(layout.publicUrl, `https://m.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/`);
|
||||
assert.equal(
|
||||
buildPublicUrl('https://g2.tkmind.cn', USER_ID, 'report.html'),
|
||||
`https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/report.html`,
|
||||
buildPublicUrl('https://m.tkmind.cn', USER_ID, 'report.html'),
|
||||
`https://m.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/report.html`,
|
||||
);
|
||||
assert.equal(
|
||||
buildPublicZonePageUrl('https://g2.tkmind.cn', USER_ID, 'report.html'),
|
||||
`https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/report.html`,
|
||||
buildPublicZonePageUrl('https://m.tkmind.cn', USER_ID, 'report.html'),
|
||||
`https://m.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/report.html`,
|
||||
);
|
||||
assert.equal(
|
||||
buildPublicZonePageUrl('https://g2.tkmind.cn', USER_ID, `${PUBLIC_ZONE_DIR}/report.html`),
|
||||
`https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/report.html`,
|
||||
buildPublicZonePageUrl('https://m.tkmind.cn', USER_ID, `${PUBLIC_ZONE_DIR}/report.html`),
|
||||
`https://m.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/report.html`,
|
||||
);
|
||||
const catalog = listPlatformSkillCatalog(platformRoot);
|
||||
syncSkillsToWorkspace({
|
||||
@@ -52,7 +52,7 @@ test('publish dir and public url use stable user id', () => {
|
||||
skillMap: { 'static-page-publish': true },
|
||||
catalog,
|
||||
user: { id: USER_ID, username: 'john' },
|
||||
publicBaseUrl: 'https://g2.tkmind.cn',
|
||||
publicBaseUrl: 'https://m.tkmind.cn',
|
||||
});
|
||||
const skillPath = path.join(layout.publishDir, '.agents', 'skills', 'static-page-publish', 'SKILL.md');
|
||||
assert.ok(fs.existsSync(skillPath));
|
||||
@@ -71,7 +71,7 @@ test('migrateUserPublishDir merges legacy username directory', () => {
|
||||
fs.writeFileSync(path.join(legacyDir, 'legacy.html'), '<html></html>');
|
||||
const layout = ensureUserPublishLayout({
|
||||
h5Root,
|
||||
publicBaseUrl: 'https://g2.tkmind.cn',
|
||||
publicBaseUrl: 'https://m.tkmind.cn',
|
||||
user: { id: USER_ID, username: 'john' },
|
||||
});
|
||||
assert.ok(fs.existsSync(path.join(layout.publishDir, 'legacy.html')));
|
||||
@@ -83,7 +83,7 @@ test('buildPublishConstraints scopes default search to user workspace', () => {
|
||||
slug: USER_ID,
|
||||
username: 'john',
|
||||
displayName: 'John',
|
||||
publicBaseUrl: 'https://g2.tkmind.cn',
|
||||
publicBaseUrl: 'https://m.tkmind.cn',
|
||||
publishDir,
|
||||
});
|
||||
assert.match(constraints, /唯一文件根目录/);
|
||||
|
||||
Reference in New Issue
Block a user