@locusai/cli 0.22.2 → 0.22.3
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.
- package/bin/locus.js +22 -26
- package/package.json +2 -2
package/bin/locus.js
CHANGED
|
@@ -1037,26 +1037,22 @@ ${yellow2("⚠")} Docker sandbox not available. Install Docker Desktop 4.58+ fo
|
|
|
1037
1037
|
function detectContainerWorkdir(sandboxName, hostProjectRoot) {
|
|
1038
1038
|
const log = getLogger();
|
|
1039
1039
|
try {
|
|
1040
|
-
execSync2(`docker sandbox exec ${sandboxName}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
try {
|
|
1045
|
-
const result = execSync2(`docker sandbox exec ${sandboxName} find / -maxdepth 5 -path '*/.locus/config.json' -type f 2>/dev/null`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 15000 }).trim();
|
|
1046
|
-
if (result) {
|
|
1047
|
-
const configPath = result.split(`
|
|
1048
|
-
`)[0].trim();
|
|
1049
|
-
const workdir = configPath.replace(/\/.locus\/config\.json$/, "");
|
|
1050
|
-
if (workdir) {
|
|
1051
|
-
log.debug("Detected container workdir", {
|
|
1052
|
-
hostProjectRoot,
|
|
1053
|
-
containerWorkdir: workdir
|
|
1054
|
-
});
|
|
1055
|
-
return workdir;
|
|
1056
|
-
}
|
|
1040
|
+
const containerPath = execSync2(`docker sandbox exec ${sandboxName} pwd`, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 5000 }).trim();
|
|
1041
|
+
if (!containerPath) {
|
|
1042
|
+
log.debug("Container pwd returned empty result");
|
|
1043
|
+
return null;
|
|
1057
1044
|
}
|
|
1045
|
+
if (containerPath === hostProjectRoot) {
|
|
1046
|
+
log.debug("Container workdir matches host path", { hostProjectRoot });
|
|
1047
|
+
return null;
|
|
1048
|
+
}
|
|
1049
|
+
log.debug("Detected container workdir differs from host", {
|
|
1050
|
+
hostProjectRoot,
|
|
1051
|
+
containerWorkdir: containerPath
|
|
1052
|
+
});
|
|
1053
|
+
return containerPath;
|
|
1058
1054
|
} catch (err) {
|
|
1059
|
-
log.debug("Container workdir
|
|
1055
|
+
log.debug("Container workdir detection via pwd failed", {
|
|
1060
1056
|
error: err instanceof Error ? err.message : String(err)
|
|
1061
1057
|
});
|
|
1062
1058
|
}
|
|
@@ -13125,11 +13121,17 @@ async function handleCreate(projectRoot) {
|
|
|
13125
13121
|
`);
|
|
13126
13122
|
}
|
|
13127
13123
|
}
|
|
13124
|
+
const workdir = config.sandbox.containerWorkdir ?? projectRoot;
|
|
13125
|
+
const backup = backupIgnoredFiles(projectRoot);
|
|
13126
|
+
try {
|
|
13127
|
+
await enforceSandboxIgnore(name, projectRoot, config.sandbox.containerWorkdir);
|
|
13128
|
+
} finally {
|
|
13129
|
+
backup.restore();
|
|
13130
|
+
}
|
|
13128
13131
|
readySandboxes[provider] = name;
|
|
13129
13132
|
config.sandbox.enabled = true;
|
|
13130
13133
|
config.sandbox.providers = readySandboxes;
|
|
13131
13134
|
saveConfig(projectRoot, config);
|
|
13132
|
-
const workdir = config.sandbox.containerWorkdir ?? projectRoot;
|
|
13133
13135
|
await runSandboxSetup(name, projectRoot, workdir);
|
|
13134
13136
|
process.stderr.write(`
|
|
13135
13137
|
${green("✓")} Sandbox mode enabled for ${bold2(provider)}.
|
|
@@ -13614,7 +13616,7 @@ function runInteractiveCommand(command, args) {
|
|
|
13614
13616
|
child.on("error", () => resolve2(false));
|
|
13615
13617
|
});
|
|
13616
13618
|
}
|
|
13617
|
-
async function createProviderSandbox(provider, sandboxName, projectRoot
|
|
13619
|
+
async function createProviderSandbox(provider, sandboxName, projectRoot) {
|
|
13618
13620
|
try {
|
|
13619
13621
|
execSync20(`docker sandbox create --name ${sandboxName} claude ${projectRoot}`, {
|
|
13620
13622
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -13627,12 +13629,6 @@ async function createProviderSandbox(provider, sandboxName, projectRoot, contain
|
|
|
13627
13629
|
if (provider === "codex") {
|
|
13628
13630
|
await ensureCodexInSandbox(sandboxName);
|
|
13629
13631
|
}
|
|
13630
|
-
const backup = backupIgnoredFiles(projectRoot);
|
|
13631
|
-
try {
|
|
13632
|
-
await enforceSandboxIgnore(sandboxName, projectRoot, containerWorkdir);
|
|
13633
|
-
} finally {
|
|
13634
|
-
backup.restore();
|
|
13635
|
-
}
|
|
13636
13632
|
return true;
|
|
13637
13633
|
}
|
|
13638
13634
|
async function ensurePackageManagerInSandbox(sandboxName, pm) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/cli",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
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.
|
|
39
|
+
"@locusai/sdk": "^0.22.3",
|
|
40
40
|
"@types/bun": "latest",
|
|
41
41
|
"typescript": "^5.8.3"
|
|
42
42
|
},
|