merge: wave 2 executor (01-02) into main

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 4.6 committed 2026-03-25 23:46:16 -04:00
1 parent a5b8fcf9d3
commit aa1a78d7d9
1081 files changed
+445341

No files matched your search

@@ -0,0 +1,25 @@
import fs from "node:fs";
import path from "node:path";
import { expandHomePrefix } from "../config/home.js";
function unique(items: string[]): string[] {
return Array.from(new Set(items));
}
export function resolveRuntimeLikePath(value: string, configPath?: string): string {
const expanded = expandHomePrefix(value);
if (path.isAbsolute(expanded)) return path.resolve(expanded);
const cwd = process.cwd();
const configDir = configPath ? path.dirname(configPath) : null;
const workspaceRoot = configDir ? path.resolve(configDir, "..") : cwd;
const candidates = unique([
...(configDir ? [path.resolve(configDir, expanded)] : []),
path.resolve(workspaceRoot, "server", expanded),
path.resolve(workspaceRoot, expanded),
path.resolve(cwd, expanded),
]);
return candidates.find((candidate) => fs.existsSync(candidate)) ?? candidates[0];
}