_run-execute.mjs
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env node
import { execFileSync } from "node:child_process";
import path from "node:path";
import process from "node:process";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(__dirname, "..");
process.env.FIGMA_API_KEY = "figd_Cs0tDjz-UVojDvRlC2c-_4g5xR-hSwm7xP6kFzwd";
process.env.AI_DIRECT_OPENAI_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
process.env.AI_DIRECT_OPENAI_API_KEY = "sk-954dfaed75e040b6a06f9c908b0a8c85";
process.env.AI_DIRECT_OPENAI_MODEL = "qwen3.7-max";
process.env.AI_DIRECT_VISION_MODEL = "qwen3.6-plus";
const bundleFile = path.join(
repoRoot,
"apps/web/ai-workspace/.ai-direct/allocationconfirmation/allocationconfirmation.ai-direct-context-bundle.json",
);
const args = [
"scripts/ai-direct-execute.mjs",
"--bundle-file", bundleFile,
"--provider", "openai-compatible",
"--model", "qwen3.7-max",
"--auto-repair",
"--without-variables",
"--preview-dir", "apps/web/ai-previews",
"--force",
];
try {
execFileSync(process.execPath, args, {
cwd: repoRoot,
stdio: "inherit",
env: process.env,
timeout: 600_000,
});
console.log("\n[run-execute] ✓ 完成");
} catch (error) {
console.error(`\n[run-execute] ✗ 失败: ${error.message}`);
process.exit(1);
}