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:
@@ -4,8 +4,10 @@ import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
buildUserSpaceConstraints,
|
||||
ensureUserZoneDirs,
|
||||
mirrorAssetToZone,
|
||||
renderUserSpaceHints,
|
||||
resolveUserWorkspaceRoot,
|
||||
syncUserZonesFromAssets,
|
||||
UPLOAD_ZONE_CODES,
|
||||
@@ -60,3 +62,26 @@ test('syncUserZonesFromAssets backfills from canonical storage', async () => {
|
||||
fs.existsSync(path.join(workspace, 'oa', '2025-12-06T13-34_export.csv')),
|
||||
);
|
||||
});
|
||||
|
||||
test('user space publishing guidance points to sandbox file tools', () => {
|
||||
const workspaceRoot = `/var/h5/MindSpace/${USER_ID}`;
|
||||
const hints = renderUserSpaceHints({
|
||||
username: 'john',
|
||||
displayName: 'John',
|
||||
slug: USER_ID,
|
||||
workspaceRoot,
|
||||
});
|
||||
const constraints = buildUserSpaceConstraints({
|
||||
username: 'john',
|
||||
displayName: 'John',
|
||||
slug: USER_ID,
|
||||
workspaceRoot,
|
||||
publicBaseUrl: 'https://m.tkmind.cn',
|
||||
});
|
||||
assert.match(hints, /write_file/);
|
||||
assert.match(hints, /edit_file/);
|
||||
assert.doesNotMatch(hints, /再使用 \\`write\\` 创建/);
|
||||
assert.match(constraints, /write_file/);
|
||||
assert.match(constraints, /edit_file/);
|
||||
assert.doesNotMatch(constraints, /再用 `write` 写入/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user