@locusai/cli 0.21.9 → 0.21.10
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 +30 -9
- package/package.json +2 -2
package/bin/locus.js
CHANGED
|
@@ -2261,7 +2261,21 @@ function loadRegistry() {
|
|
|
2261
2261
|
const raw = readFileSync5(registryPath, "utf-8");
|
|
2262
2262
|
const parsed = JSON.parse(raw);
|
|
2263
2263
|
if (typeof parsed === "object" && parsed !== null && "packages" in parsed && typeof parsed.packages === "object") {
|
|
2264
|
-
|
|
2264
|
+
const registry = parsed;
|
|
2265
|
+
let pruned = false;
|
|
2266
|
+
for (const key of Object.keys(registry.packages)) {
|
|
2267
|
+
if (!key.startsWith(PACKAGE_SCOPE)) {
|
|
2268
|
+
delete registry.packages[key];
|
|
2269
|
+
pruned = true;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
if (pruned) {
|
|
2273
|
+
const tmp = `${registryPath}.tmp`;
|
|
2274
|
+
writeFileSync5(tmp, `${JSON.stringify(registry, null, 2)}
|
|
2275
|
+
`, "utf-8");
|
|
2276
|
+
renameSync(tmp, registryPath);
|
|
2277
|
+
}
|
|
2278
|
+
return registry;
|
|
2265
2279
|
}
|
|
2266
2280
|
return { packages: {} };
|
|
2267
2281
|
} catch {
|
|
@@ -2383,18 +2397,25 @@ async function pkgCommand(args, _flags) {
|
|
|
2383
2397
|
process.exit(1);
|
|
2384
2398
|
return;
|
|
2385
2399
|
}
|
|
2386
|
-
|
|
2400
|
+
let binaryPath = entry.binaryPath;
|
|
2387
2401
|
if (!binaryPath || !existsSync8(binaryPath)) {
|
|
2388
|
-
|
|
2402
|
+
const resolved = resolvePackageBinary(packageName);
|
|
2403
|
+
if (resolved) {
|
|
2404
|
+
binaryPath = resolved;
|
|
2405
|
+
entry.binaryPath = resolved;
|
|
2406
|
+
saveRegistry(registry);
|
|
2407
|
+
} else {
|
|
2408
|
+
process.stderr.write(`${red2("✗")} Binary for ${bold2(packageName)} not found on disk.
|
|
2389
2409
|
`);
|
|
2390
|
-
|
|
2391
|
-
|
|
2410
|
+
if (binaryPath) {
|
|
2411
|
+
process.stderr.write(` Expected: ${dim2(binaryPath)}
|
|
2392
2412
|
`);
|
|
2393
|
-
|
|
2394
|
-
|
|
2413
|
+
}
|
|
2414
|
+
process.stderr.write(` Try reinstalling: ${bold2(`locus install ${packageInput} --upgrade`)}
|
|
2395
2415
|
`);
|
|
2396
|
-
|
|
2397
|
-
|
|
2416
|
+
process.exit(1);
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2398
2419
|
}
|
|
2399
2420
|
const remainingArgs = args.slice(1);
|
|
2400
2421
|
const exitCode = await spawnPackageBinary(binaryPath, remainingArgs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/cli",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.10",
|
|
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.21.
|
|
39
|
+
"@locusai/sdk": "^0.21.10",
|
|
40
40
|
"@types/bun": "latest",
|
|
41
41
|
"typescript": "^5.8.3"
|
|
42
42
|
},
|