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
+29
View File
@@ -176,6 +176,26 @@ async function bundleDeepseekCompatProxy() {
await run(esbuildBin, args);
}
async function bundleCursorChatBridge() {
if (!(await exists(esbuildBin))) {
throw new Error(`未找到 esbuild: ${esbuildBin}`);
}
console.log('==> 打包 Cursor Chat Bridge');
const args = [
'cursor-openai-bridge.mjs',
'--bundle',
'--platform=node',
'--format=esm',
`--target=${runtimeNodeTarget}`,
'--outfile=.runtime/portal/cursor-openai-bridge.mjs',
'--banner:js=import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);',
];
for (const pkg of externalPackages) {
args.push(`--external:${pkg}`);
}
await run(esbuildBin, args);
}
async function bundleSandboxMcp() {
if (!(await exists(esbuildBin))) {
throw new Error(`未找到 esbuild: ${esbuildBin}`);
@@ -430,6 +450,7 @@ async function writeMetadata() {
'run-memind-portal-candidate.sh',
'run-memind-canary-proxy-prod.sh',
'run-deepseek-compat-proxy-candidate.sh',
'run-cursor-chat-bridge-prod.sh',
]) {
const source = path.join(root, 'scripts', scriptName);
if (!(await exists(source))) {
@@ -523,6 +544,10 @@ async function writeMetadata() {
path.join(root, 'scripts', 'install-agent-run-guard-agent.sh'),
path.join(runtimeRoot, 'scripts', 'install-agent-run-guard-agent.sh'),
);
await fs.copyFile(
path.join(root, 'scripts', 'install-cursor-chat-bridge-agent.sh'),
path.join(runtimeRoot, 'scripts', 'install-cursor-chat-bridge-agent.sh'),
);
await fs.copyFile(
path.join(root, 'scripts', 'resume-agent-run-prod.sh'),
path.join(runtimeRoot, 'scripts', 'resume-agent-run-prod.sh'),
@@ -553,6 +578,7 @@ async function writeMetadata() {
' wechat-mp.bundle.mjs (esbuild bundle; hot-swappable WeChat MP module)',
' memind-canary-proxy.mjs (immutable-identity stable/candidate router)',
' deepseek-no-think-proxy.mjs (DeepSeek V4 tool-round compatibility proxy)',
' cursor-openai-bridge.mjs (Cursor agent OpenAI-compatible chat bridge)',
'',
'Post-deploy validation (scripts/check-mindspace-public-links.mjs):',
' Scans MindSpace/*/public/*.html for missing relative href/src/cover targets.',
@@ -625,6 +651,7 @@ async function main() {
await bundleServer();
await bundleCanaryProxy();
await bundleDeepseekCompatProxy();
await bundleCursorChatBridge();
await bundleWechatMp();
await bundleSandboxMcp();
await bundleMindSearchMcp();
@@ -642,6 +669,7 @@ async function main() {
path.join(runtimeRoot, 'scripts', 'run-deepseek-compat-proxy-candidate.sh'),
0o755,
);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'run-cursor-chat-bridge-prod.sh'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'wechat-mp-menu.mjs'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'check-stream-runtime.mjs'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'runtime-worker-drain.mjs'), 0o755);
@@ -656,6 +684,7 @@ async function main() {
await fs.chmod(path.join(runtimeRoot, 'scripts', 'install-agent-run-worker-agent.sh'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'agent-run-guard.mjs'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'install-agent-run-guard-agent.sh'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'install-cursor-chat-bridge-agent.sh'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'resume-agent-run-prod.sh'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'ensure-goose-session-postgres.sh'), 0o755);
await fs.chmod(path.join(runtimeRoot, 'scripts', 'check-tool-runtime.mjs'), 0o755);