@locusai/cli 0.22.4 → 0.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/locus.js +28 -3
  2. package/package.json +2 -2
package/bin/locus.js CHANGED
@@ -1044,17 +1044,42 @@ function detectContainerWorkdir(sandboxName, hostProjectRoot) {
1044
1044
  log.debug("Host path not found in container, probing for mount point...");
1045
1045
  }
1046
1046
  try {
1047
- const gitDir = execSync2(`docker sandbox exec ${sandboxName} sh -c "find / -maxdepth 4 -name .git -type d ! -path '*/proc/*' ! -path '*/sys/*' 2>/dev/null | head -1"`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 1e4 }).trim();
1047
+ const raw = execSync2(`docker sandbox exec ${sandboxName} cat /proc/mounts`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 5000 }).trim();
1048
+ if (raw) {
1049
+ const systemPrefixes = ["/proc", "/sys", "/dev"];
1050
+ const candidates = raw.split(`
1051
+ `).map((line) => {
1052
+ const fields = line.split(" ");
1053
+ return fields[1];
1054
+ }).filter((mp) => !!mp && mp !== "/" && !systemPrefixes.some((p) => mp === p || mp.startsWith(`${p}/`)));
1055
+ for (const candidate of candidates) {
1056
+ try {
1057
+ execSync2(`docker sandbox exec ${sandboxName} sh -c "test -d ${JSON.stringify(candidate + "/.git")} || test -f ${JSON.stringify(candidate + "/package.json")}"`, { stdio: ["pipe", "pipe", "pipe"], timeout: 3000 });
1058
+ log.debug("Detected container workdir from mount table", {
1059
+ hostProjectRoot,
1060
+ containerWorkdir: candidate
1061
+ });
1062
+ return candidate;
1063
+ } catch {}
1064
+ }
1065
+ }
1066
+ } catch (err) {
1067
+ log.debug("Mount table probe failed", {
1068
+ error: err instanceof Error ? err.message : String(err)
1069
+ });
1070
+ }
1071
+ try {
1072
+ const gitDir = execSync2(`docker sandbox exec ${sandboxName} sh -c "find / -maxdepth 10 -name .git -type d ! -path '*/proc/*' ! -path '*/sys/*' ! -path '*/dev/*' ! -path '*/node_modules/*' 2>/dev/null | head -1"`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 15000 }).trim();
1048
1073
  if (gitDir) {
1049
1074
  const containerPath = gitDir.replace(/\/\.git$/, "") || "/";
1050
- log.debug("Detected container workdir from .git marker", {
1075
+ log.debug("Detected container workdir from .git marker (deep find)", {
1051
1076
  hostProjectRoot,
1052
1077
  containerWorkdir: containerPath
1053
1078
  });
1054
1079
  return containerPath;
1055
1080
  }
1056
1081
  } catch (err) {
1057
- log.debug("Container workdir detection via .git probe failed", {
1082
+ log.debug("Container workdir detection via deep find failed", {
1058
1083
  error: err instanceof Error ? err.message : String(err)
1059
1084
  });
1060
1085
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusai/cli",
3
- "version": "0.22.4",
3
+ "version": "0.22.5",
4
4
  "description": "GitHub-native AI engineering assistant",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,7 +36,7 @@
36
36
  "license": "MIT",
37
37
  "dependencies": {},
38
38
  "devDependencies": {
39
- "@locusai/sdk": "^0.22.4",
39
+ "@locusai/sdk": "^0.22.5",
40
40
  "@types/bun": "latest",
41
41
  "typescript": "^5.8.3"
42
42
  },