Files
oh-my-pi/packages/coding-agent/src/task/omp-command.ts
T
can1357 cb5bbbf382 refactor(coding-agent): flattened directory structure, eliminated core/ folder
- Eliminated core/ directory (252 files, 23 subdirs → distributed)
- Reduced max nesting from 9 levels to 5 levels
- Promoted tool subdirs to top level: exa/, lsp/, patch/, task/, web/
- Merged web-scrapers/ + web-search/ into web/{scrapers,search}/
- Flattened modes/interactive/ to modes/
- Split execution/ into: ipy/ (python), exec/ (bash), ssh/
- Renamed ipy/python-*.ts to ipy/*.ts (executor, kernel, etc.)
- Flattened cursor/exec-bridge.ts to cursor.ts
- Created logical groupings: config/, session/, extensibility/, export/
- Updated all imports across 500+ files
2026-01-23 12:24:47 +01:00

25 lines
648 B
TypeScript

import process from "node:process";
interface OmpCommand {
cmd: string;
args: string[];
shell: boolean;
}
const DEFAULT_CMD = process.platform === "win32" ? "omp.cmd" : "omp";
const DEFAULT_SHELL = process.platform === "win32";
export function resolveOmpCommand(): OmpCommand {
const envCmd = process.env.OMP_SUBPROCESS_CMD;
if (envCmd?.trim()) {
return { cmd: envCmd, args: [], shell: DEFAULT_SHELL };
}
const entry = process.argv[1];
if (entry && (entry.endsWith(".ts") || entry.endsWith(".js"))) {
return { cmd: process.execPath, args: [entry], shell: false };
}
return { cmd: DEFAULT_CMD, args: [], shell: DEFAULT_SHELL };
}