@locusai/cli 0.9.13 → 0.9.16
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/agent/worker.js +0 -2
- package/bin/locus.js +48 -9
- package/package.json +2 -2
package/bin/agent/worker.js
CHANGED
|
@@ -30940,8 +30940,6 @@ class WorktreeManager {
|
|
|
30940
30940
|
this.log("No changes to commit", "info");
|
|
30941
30941
|
return null;
|
|
30942
30942
|
}
|
|
30943
|
-
this.gitExec(["config", "user.name", "LocusAgent"], worktreePath);
|
|
30944
|
-
this.gitExec(["config", "user.email", "agent@locusai.team"], worktreePath);
|
|
30945
30943
|
this.git("add -A", worktreePath);
|
|
30946
30944
|
const staged = this.git("diff --cached --name-only", worktreePath).trim();
|
|
30947
30945
|
if (!staged) {
|
package/bin/locus.js
CHANGED
|
@@ -38633,8 +38633,6 @@ class WorktreeManager {
|
|
|
38633
38633
|
this.log("No changes to commit", "info");
|
|
38634
38634
|
return null;
|
|
38635
38635
|
}
|
|
38636
|
-
this.gitExec(["config", "user.name", "LocusAgent"], worktreePath);
|
|
38637
|
-
this.gitExec(["config", "user.email", "agent@locusai.team"], worktreePath);
|
|
38638
38636
|
this.git("add -A", worktreePath);
|
|
38639
38637
|
const staged = this.git("diff --cached --name-only", worktreePath).trim();
|
|
38640
38638
|
if (!staged) {
|
|
@@ -42658,6 +42656,7 @@ import { parseArgs as parseArgs2 } from "node:util";
|
|
|
42658
42656
|
|
|
42659
42657
|
// src/config-manager.ts
|
|
42660
42658
|
init_index_node();
|
|
42659
|
+
import { execSync as execSync3 } from "node:child_process";
|
|
42661
42660
|
import { existsSync as existsSync15, mkdirSync as mkdirSync7, readFileSync as readFileSync11, writeFileSync as writeFileSync7 } from "node:fs";
|
|
42662
42661
|
import { join as join14 } from "node:path";
|
|
42663
42662
|
var LOCUS_GITIGNORE_MARKER = "# Locus AI";
|
|
@@ -42749,6 +42748,44 @@ function updateGitignore(projectPath) {
|
|
|
42749
42748
|
`;
|
|
42750
42749
|
writeFileSync7(gitignorePath, content);
|
|
42751
42750
|
}
|
|
42751
|
+
function ensureGitIdentity(projectPath) {
|
|
42752
|
+
const hasName = (() => {
|
|
42753
|
+
try {
|
|
42754
|
+
return execSync3("git config --get user.name", {
|
|
42755
|
+
cwd: projectPath,
|
|
42756
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
42757
|
+
}).toString().trim();
|
|
42758
|
+
} catch {
|
|
42759
|
+
return "";
|
|
42760
|
+
}
|
|
42761
|
+
})();
|
|
42762
|
+
const hasEmail = (() => {
|
|
42763
|
+
try {
|
|
42764
|
+
return execSync3("git config --get user.email", {
|
|
42765
|
+
cwd: projectPath,
|
|
42766
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
42767
|
+
}).toString().trim();
|
|
42768
|
+
} catch {
|
|
42769
|
+
return "";
|
|
42770
|
+
}
|
|
42771
|
+
})();
|
|
42772
|
+
if (!hasName) {
|
|
42773
|
+
execSync3('git config user.name "LocusAgent"', {
|
|
42774
|
+
cwd: projectPath,
|
|
42775
|
+
stdio: "ignore"
|
|
42776
|
+
});
|
|
42777
|
+
}
|
|
42778
|
+
if (!hasEmail) {
|
|
42779
|
+
execSync3('git config user.email "agent@locusai.team"', {
|
|
42780
|
+
cwd: projectPath,
|
|
42781
|
+
stdio: "ignore"
|
|
42782
|
+
});
|
|
42783
|
+
}
|
|
42784
|
+
execSync3("git config --global pull.rebase true", {
|
|
42785
|
+
cwd: projectPath,
|
|
42786
|
+
stdio: "ignore"
|
|
42787
|
+
});
|
|
42788
|
+
}
|
|
42752
42789
|
|
|
42753
42790
|
class ConfigManager {
|
|
42754
42791
|
projectPath;
|
|
@@ -42797,6 +42834,7 @@ class ConfigManager {
|
|
|
42797
42834
|
writeFileSync7(locusConfigPath, JSON.stringify(config2, null, 2));
|
|
42798
42835
|
}
|
|
42799
42836
|
updateGitignore(this.projectPath);
|
|
42837
|
+
ensureGitIdentity(this.projectPath);
|
|
42800
42838
|
}
|
|
42801
42839
|
loadConfig() {
|
|
42802
42840
|
const path2 = getLocusPath(this.projectPath, "configFile");
|
|
@@ -42880,6 +42918,7 @@ class ConfigManager {
|
|
|
42880
42918
|
if (gitignoreBefore !== gitignoreAfter) {
|
|
42881
42919
|
result.gitignoreUpdated = true;
|
|
42882
42920
|
}
|
|
42921
|
+
ensureGitIdentity(this.projectPath);
|
|
42883
42922
|
return result;
|
|
42884
42923
|
}
|
|
42885
42924
|
getWorkspaceId() {
|
|
@@ -44423,11 +44462,11 @@ async function telegramCommand(args) {
|
|
|
44423
44462
|
}
|
|
44424
44463
|
// src/commands/upgrade.ts
|
|
44425
44464
|
init_index_node();
|
|
44426
|
-
import { execSync as
|
|
44465
|
+
import { execSync as execSync4 } from "node:child_process";
|
|
44427
44466
|
var PACKAGES = ["@locusai/cli", "@locusai/telegram"];
|
|
44428
44467
|
function getInstalledVersion(pkg) {
|
|
44429
44468
|
try {
|
|
44430
|
-
const output =
|
|
44469
|
+
const output = execSync4(`npm list -g ${pkg} --depth=0 --json`, {
|
|
44431
44470
|
encoding: "utf-8",
|
|
44432
44471
|
stdio: ["pipe", "pipe", "pipe"]
|
|
44433
44472
|
});
|
|
@@ -44439,7 +44478,7 @@ function getInstalledVersion(pkg) {
|
|
|
44439
44478
|
}
|
|
44440
44479
|
function getLatestVersion(pkg) {
|
|
44441
44480
|
try {
|
|
44442
|
-
return
|
|
44481
|
+
return execSync4(`npm view ${pkg} version`, {
|
|
44443
44482
|
encoding: "utf-8",
|
|
44444
44483
|
stdio: ["pipe", "pipe", "pipe"]
|
|
44445
44484
|
}).trim();
|
|
@@ -44453,7 +44492,7 @@ async function upgradeCommand() {
|
|
|
44453
44492
|
`);
|
|
44454
44493
|
try {
|
|
44455
44494
|
console.log(` ${c.dim("◌")} Cleaning npm cache...`);
|
|
44456
|
-
|
|
44495
|
+
execSync4("npm cache clean --force", {
|
|
44457
44496
|
stdio: ["pipe", "pipe", "pipe"]
|
|
44458
44497
|
});
|
|
44459
44498
|
console.log(` ${c.success("✔")} npm cache cleaned
|
|
@@ -44479,7 +44518,7 @@ async function upgradeCommand() {
|
|
|
44479
44518
|
}
|
|
44480
44519
|
console.log(` ${c.primary("↑")} ${c.bold(pkg)} ${c.dim(`v${current}`)} → ${c.primary(`v${latest}`)}`);
|
|
44481
44520
|
try {
|
|
44482
|
-
|
|
44521
|
+
execSync4(`npm install -g ${pkg}@latest`, {
|
|
44483
44522
|
stdio: "inherit"
|
|
44484
44523
|
});
|
|
44485
44524
|
console.log(` ${c.success("✔")} ${c.bold(pkg)} updated to ${c.primary(`v${latest}`)}
|
|
@@ -44494,10 +44533,10 @@ async function upgradeCommand() {
|
|
|
44494
44533
|
}
|
|
44495
44534
|
// src/commands/version.ts
|
|
44496
44535
|
init_index_node();
|
|
44497
|
-
import { execSync as
|
|
44536
|
+
import { execSync as execSync5 } from "node:child_process";
|
|
44498
44537
|
function getTelegramVersion() {
|
|
44499
44538
|
try {
|
|
44500
|
-
const output =
|
|
44539
|
+
const output = execSync5("npm list -g @locusai/telegram --depth=0 --json", {
|
|
44501
44540
|
encoding: "utf-8",
|
|
44502
44541
|
stdio: ["pipe", "pipe", "pipe"]
|
|
44503
44542
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.16",
|
|
4
4
|
"description": "CLI for Locus - AI-native project management platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@locusai/sdk": "^0.9.
|
|
35
|
+
"@locusai/sdk": "^0.9.16"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {}
|
|
38
38
|
}
|