Bundle Cursor Chat Bridge into Portal runtime for 103 deploy.
Memind CI / Test, build, and release guards (push) Successful in 6m43s

Add prod runner and LaunchAgent installer so Tang chatBridge toggle can reach a live OpenAI-compatible bridge after env enablement.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-31 09:55:06 +08:00
parent 71d1316919
commit 3688d732c0
4 changed files with 152 additions and 2 deletions
+18 -2
View File
@@ -6,6 +6,7 @@
* Usage:
* node scripts/apply-tang-cursor-config-103.mjs
* node scripts/apply-tang-cursor-config-103.mjs --apply
* node scripts/apply-tang-cursor-config-103.mjs --apply --enable-chat-bridge
*/
import process from 'node:process';
import { execSync } from 'node:child_process';
@@ -38,6 +39,7 @@ RECOMMENDED.intentAllowlist = intentAllowlistFromFeatures(RECOMMENDED.features);
async function main() {
const apply = process.argv.includes('--apply');
const enableChatBridge = process.argv.includes('--enable-chat-bridge');
const databaseUrl = execSync(
"ssh -o BatchMode=yes -o ConnectTimeout=8 john@58.38.22.103 \"grep '^DATABASE_URL=' /Users/john/Project/Memind/.env | cut -d= -f2-\"",
{ encoding: 'utf8' },
@@ -49,10 +51,24 @@ async function main() {
'SELECT config_json FROM h5_wechat_cursor_executor_config WHERE config_scope = ? LIMIT 1',
['global'],
);
const target = {
...RECOMMENDED,
features: {
...RECOMMENDED.features,
...(enableChatBridge
? { [CURSOR_CHANNEL_FEATURES.CHAT_BRIDGE]: { enabled: true } }
: {}),
},
};
target.intentAllowlist = intentAllowlistFromFeatures(target.features);
if (enableChatBridge) {
target.meta = { ...target.meta, notes: '唐用户 Cursor 灰度 — 页面+问卷+定时任务+聊天 Bridge' };
}
console.log('--- before ---');
console.log(JSON.stringify(before[0]?.config_json ?? null, null, 2));
console.log('--- target ---');
console.log(JSON.stringify(RECOMMENDED, null, 2));
console.log(JSON.stringify(target, null, 2));
if (!apply) {
console.log('\n(dry-run) 追加 --apply 写入生产库');
@@ -67,7 +83,7 @@ async function main() {
ON DUPLICATE KEY UPDATE
config_json = VALUES(config_json),
updated_at = VALUES(updated_at)`,
[JSON.stringify(RECOMMENDED), now],
[JSON.stringify(target), now],
);
const [after] = await pool.query(