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:
@@ -12,7 +12,10 @@ import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const plazaDir = process.env.PLAZA_APP_DIR ?? path.join(root, '../tkmind_go/ui/plaza');
|
||||
const defaultPlazaDir = fs.existsSync(path.join(root, '../test-memindplaza/app/plaza/package.json'))
|
||||
? path.join(root, '../test-memindplaza/app/plaza')
|
||||
: path.join(root, '../tkmind_go/ui/plaza');
|
||||
const plazaDir = process.env.PLAZA_APP_DIR ?? defaultPlazaDir;
|
||||
const portalPort = Number(process.env.H5_PORT ?? 8081);
|
||||
const plazaPort = Number(process.env.PLAZA_PORT ?? 3001);
|
||||
const publicPort = Number(process.env.PLAZA_PUBLIC_PORT ?? 443);
|
||||
@@ -116,7 +119,7 @@ process.on('SIGINT', () => shutdown(0));
|
||||
process.on('SIGTERM', () => shutdown(0));
|
||||
|
||||
if (!fs.existsSync(path.join(plazaDir, 'package.json'))) {
|
||||
console.error(`未找到 Plaza Next.js:${plazaDir}`);
|
||||
console.error(`未找到 Plaza Next.js:${plazaDir}。请设置 PLAZA_APP_DIR 指向本地 Plaza 源码,例如 ../test-memindplaza/app/plaza`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user