feat: add generated scene skill platform hardening

This commit is contained in:
木炎
2026-04-21 23:19:06 +08:00
parent 118fc77935
commit 956f0c2b68
439 changed files with 61974 additions and 3645 deletions

View File

@@ -7,6 +7,20 @@ function resolveProjectRoot() {
return path.resolve(envRoot);
}
// Search for Cargo.toml to find the actual project root
const candidates = [
path.resolve(__dirname, "..", ".."), // claw-new (has Cargo.toml)
path.resolve(__dirname, "..", "..", "..", "claw-new"), // sgClaw/claw-new
path.resolve(__dirname, "..", "..", ".."), // sgClaw root
];
for (const p of candidates) {
if (fs.existsSync(path.join(p, "Cargo.toml"))) {
return p;
}
}
// Fallback: directory containing sgclaw_config.json
const configPath = resolveConfigPath();
if (configPath && fs.existsSync(configPath)) {
return path.dirname(configPath);