@locusai/cli 0.11.8 → 0.12.0
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 +9 -29
- package/bin/locus.js +45 -97
- package/package.json +2 -2
package/bin/agent/worker.js
CHANGED
|
@@ -31816,14 +31816,10 @@ ${line}`;
|
|
|
31816
31816
|
}
|
|
31817
31817
|
getFullContext() {
|
|
31818
31818
|
const context2 = this.readContext();
|
|
31819
|
-
const progress = this.readProgress();
|
|
31820
31819
|
const parts = [];
|
|
31821
31820
|
if (context2.trim()) {
|
|
31822
31821
|
parts.push(context2.trim());
|
|
31823
31822
|
}
|
|
31824
|
-
if (progress.trim()) {
|
|
31825
|
-
parts.push(progress.trim());
|
|
31826
|
-
}
|
|
31827
31823
|
return parts.join(`
|
|
31828
31824
|
|
|
31829
31825
|
---
|
|
@@ -32215,13 +32211,6 @@ ${serverContext.context}
|
|
|
32215
32211
|
prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
|
|
32216
32212
|
|
|
32217
32213
|
`;
|
|
32218
|
-
const indexPath = getLocusPath(this.projectPath, "indexFile");
|
|
32219
|
-
if (existsSync4(indexPath)) {
|
|
32220
|
-
prompt += `## Codebase Overview
|
|
32221
|
-
There is an index file in the .locus/codebase-index.json and if you need you can check it.
|
|
32222
|
-
|
|
32223
|
-
`;
|
|
32224
|
-
}
|
|
32225
32214
|
if (task2.docs && task2.docs.length > 0) {
|
|
32226
32215
|
prompt += `## Attached Documents (Summarized)
|
|
32227
32216
|
`;
|
|
@@ -32251,19 +32240,17 @@ ${preview}${isTruncated ? `
|
|
|
32251
32240
|
`;
|
|
32252
32241
|
}
|
|
32253
32242
|
if (task2.comments && task2.comments.length > 0) {
|
|
32254
|
-
const
|
|
32255
|
-
|
|
32256
|
-
|
|
32257
|
-
prompt += `Review the following comments for context or rejection feedback:
|
|
32258
|
-
|
|
32243
|
+
const filteredComments = task2.comments.filter((comment) => comment.author !== "system");
|
|
32244
|
+
const comments = filteredComments.slice(0, 3);
|
|
32245
|
+
prompt += `## Task Comments & Feedback
|
|
32259
32246
|
`;
|
|
32260
32247
|
for (const comment of comments) {
|
|
32261
32248
|
const date5 = new Date(comment.createdAt).toLocaleString();
|
|
32262
|
-
prompt +=
|
|
32263
|
-
${comment.text}
|
|
32264
|
-
|
|
32249
|
+
prompt += `- ${comment.author} (${date5}): ${comment.text}
|
|
32265
32250
|
`;
|
|
32266
32251
|
}
|
|
32252
|
+
prompt += `
|
|
32253
|
+
`;
|
|
32267
32254
|
}
|
|
32268
32255
|
prompt += `## Instructions
|
|
32269
32256
|
1. Complete this task.
|
|
@@ -32328,13 +32315,6 @@ ${fallback}
|
|
|
32328
32315
|
prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
|
|
32329
32316
|
|
|
32330
32317
|
`;
|
|
32331
|
-
const indexPath = getLocusPath(this.projectPath, "indexFile");
|
|
32332
|
-
if (existsSync4(indexPath)) {
|
|
32333
|
-
prompt += `## Codebase Overview
|
|
32334
|
-
There is an index file in the .locus/codebase-index.json and if you need you can check it.
|
|
32335
|
-
|
|
32336
|
-
`;
|
|
32337
|
-
}
|
|
32338
32318
|
prompt += `## Instructions
|
|
32339
32319
|
1. Execute the prompt based on the provided project context.
|
|
32340
32320
|
2. **Paths**: Use relative paths from the project root at all times. Do NOT use absolute local paths (e.g., /Users/...).
|
|
@@ -32709,7 +32689,7 @@ class AgentWorker {
|
|
|
32709
32689
|
assignedTo: null
|
|
32710
32690
|
});
|
|
32711
32691
|
await this.client.tasks.addComment(task2.id, this.config.workspaceId, {
|
|
32712
|
-
author:
|
|
32692
|
+
author: "system",
|
|
32713
32693
|
text: `⚠️ Agent execution finished with no file changes, so no commit was created.
|
|
32714
32694
|
|
|
32715
32695
|
${result.summary}`
|
|
@@ -32724,7 +32704,7 @@ ${result.summary}`
|
|
|
32724
32704
|
|
|
32725
32705
|
Branch: \`${result.branch}\`` : "";
|
|
32726
32706
|
await this.client.tasks.addComment(task2.id, this.config.workspaceId, {
|
|
32727
|
-
author:
|
|
32707
|
+
author: "system",
|
|
32728
32708
|
text: `✅ ${result.summary}${branchInfo}`
|
|
32729
32709
|
});
|
|
32730
32710
|
this.tasksCompleted++;
|
|
@@ -32739,7 +32719,7 @@ Branch: \`${result.branch}\`` : "";
|
|
|
32739
32719
|
assignedTo: null
|
|
32740
32720
|
});
|
|
32741
32721
|
await this.client.tasks.addComment(task2.id, this.config.workspaceId, {
|
|
32742
|
-
author:
|
|
32722
|
+
author: "system",
|
|
32743
32723
|
text: `❌ ${result.summary}`
|
|
32744
32724
|
});
|
|
32745
32725
|
}
|
package/bin/locus.js
CHANGED
|
@@ -38781,14 +38781,10 @@ ${line}`;
|
|
|
38781
38781
|
}
|
|
38782
38782
|
getFullContext() {
|
|
38783
38783
|
const context2 = this.readContext();
|
|
38784
|
-
const progress = this.readProgress();
|
|
38785
38784
|
const parts = [];
|
|
38786
38785
|
if (context2.trim()) {
|
|
38787
38786
|
parts.push(context2.trim());
|
|
38788
38787
|
}
|
|
38789
|
-
if (progress.trim()) {
|
|
38790
|
-
parts.push(progress.trim());
|
|
38791
|
-
}
|
|
38792
38788
|
return parts.join(`
|
|
38793
38789
|
|
|
38794
38790
|
---
|
|
@@ -39162,13 +39158,6 @@ ${serverContext.context}
|
|
|
39162
39158
|
prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
|
|
39163
39159
|
|
|
39164
39160
|
`;
|
|
39165
|
-
const indexPath = getLocusPath(this.projectPath, "indexFile");
|
|
39166
|
-
if (existsSync6(indexPath)) {
|
|
39167
|
-
prompt += `## Codebase Overview
|
|
39168
|
-
There is an index file in the .locus/codebase-index.json and if you need you can check it.
|
|
39169
|
-
|
|
39170
|
-
`;
|
|
39171
|
-
}
|
|
39172
39161
|
if (task2.docs && task2.docs.length > 0) {
|
|
39173
39162
|
prompt += `## Attached Documents (Summarized)
|
|
39174
39163
|
`;
|
|
@@ -39198,19 +39187,17 @@ ${preview}${isTruncated ? `
|
|
|
39198
39187
|
`;
|
|
39199
39188
|
}
|
|
39200
39189
|
if (task2.comments && task2.comments.length > 0) {
|
|
39201
|
-
const
|
|
39202
|
-
|
|
39203
|
-
|
|
39204
|
-
prompt += `Review the following comments for context or rejection feedback:
|
|
39205
|
-
|
|
39190
|
+
const filteredComments = task2.comments.filter((comment) => comment.author !== "system");
|
|
39191
|
+
const comments = filteredComments.slice(0, 3);
|
|
39192
|
+
prompt += `## Task Comments & Feedback
|
|
39206
39193
|
`;
|
|
39207
39194
|
for (const comment of comments) {
|
|
39208
39195
|
const date5 = new Date(comment.createdAt).toLocaleString();
|
|
39209
|
-
prompt +=
|
|
39210
|
-
${comment.text}
|
|
39211
|
-
|
|
39196
|
+
prompt += `- ${comment.author} (${date5}): ${comment.text}
|
|
39212
39197
|
`;
|
|
39213
39198
|
}
|
|
39199
|
+
prompt += `
|
|
39200
|
+
`;
|
|
39214
39201
|
}
|
|
39215
39202
|
prompt += `## Instructions
|
|
39216
39203
|
1. Complete this task.
|
|
@@ -39275,13 +39262,6 @@ ${fallback}
|
|
|
39275
39262
|
prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
|
|
39276
39263
|
|
|
39277
39264
|
`;
|
|
39278
|
-
const indexPath = getLocusPath(this.projectPath, "indexFile");
|
|
39279
|
-
if (existsSync6(indexPath)) {
|
|
39280
|
-
prompt += `## Codebase Overview
|
|
39281
|
-
There is an index file in the .locus/codebase-index.json and if you need you can check it.
|
|
39282
|
-
|
|
39283
|
-
`;
|
|
39284
|
-
}
|
|
39285
39265
|
prompt += `## Instructions
|
|
39286
39266
|
1. Execute the prompt based on the provided project context.
|
|
39287
39267
|
2. **Paths**: Use relative paths from the project root at all times. Do NOT use absolute local paths (e.g., /Users/...).
|
|
@@ -39656,7 +39636,7 @@ class AgentWorker {
|
|
|
39656
39636
|
assignedTo: null
|
|
39657
39637
|
});
|
|
39658
39638
|
await this.client.tasks.addComment(task2.id, this.config.workspaceId, {
|
|
39659
|
-
author:
|
|
39639
|
+
author: "system",
|
|
39660
39640
|
text: `⚠️ Agent execution finished with no file changes, so no commit was created.
|
|
39661
39641
|
|
|
39662
39642
|
${result.summary}`
|
|
@@ -39671,7 +39651,7 @@ ${result.summary}`
|
|
|
39671
39651
|
|
|
39672
39652
|
Branch: \`${result.branch}\`` : "";
|
|
39673
39653
|
await this.client.tasks.addComment(task2.id, this.config.workspaceId, {
|
|
39674
|
-
author:
|
|
39654
|
+
author: "system",
|
|
39675
39655
|
text: `✅ ${result.summary}${branchInfo}`
|
|
39676
39656
|
});
|
|
39677
39657
|
this.tasksCompleted++;
|
|
@@ -39686,7 +39666,7 @@ Branch: \`${result.branch}\`` : "";
|
|
|
39686
39666
|
assignedTo: null
|
|
39687
39667
|
});
|
|
39688
39668
|
await this.client.tasks.addComment(task2.id, this.config.workspaceId, {
|
|
39689
|
-
author:
|
|
39669
|
+
author: "system",
|
|
39690
39670
|
text: `❌ ${result.summary}`
|
|
39691
39671
|
});
|
|
39692
39672
|
}
|
|
@@ -41325,9 +41305,6 @@ IMPORTANT: Incorporate this feedback into your plan. The CEO has reviewed a prev
|
|
|
41325
41305
|
## Project Context
|
|
41326
41306
|
${input.projectContext || "No project context available."}
|
|
41327
41307
|
|
|
41328
|
-
## Codebase Structure
|
|
41329
|
-
${input.codebaseIndex || "No codebase index available."}
|
|
41330
|
-
|
|
41331
41308
|
## Your Task
|
|
41332
41309
|
|
|
41333
41310
|
Analyze the directive and produce a **complete sprint plan** with the following:
|
|
@@ -41410,8 +41387,6 @@ IMPORTANT: Tasks are executed sequentially by a single agent. The array order IS
|
|
|
41410
41387
|
}
|
|
41411
41388
|
|
|
41412
41389
|
// ../sdk/src/planning/planning-meeting.ts
|
|
41413
|
-
import { existsSync as existsSync10, readFileSync as readFileSync9 } from "node:fs";
|
|
41414
|
-
|
|
41415
41390
|
class PlanningMeeting {
|
|
41416
41391
|
projectPath;
|
|
41417
41392
|
aiRunner;
|
|
@@ -41425,14 +41400,13 @@ class PlanningMeeting {
|
|
|
41425
41400
|
}
|
|
41426
41401
|
async run(directive, feedback) {
|
|
41427
41402
|
const projectContext = this.getProjectContext();
|
|
41428
|
-
const codebaseIndex = this.getCodebaseIndex();
|
|
41429
41403
|
this.log("Phase 1/2: Planner building sprint plan...", "info");
|
|
41430
41404
|
const plannerPrompt = buildPlannerPrompt({
|
|
41431
41405
|
directive,
|
|
41432
41406
|
projectContext,
|
|
41433
|
-
codebaseIndex,
|
|
41434
41407
|
feedback
|
|
41435
41408
|
});
|
|
41409
|
+
console.log(plannerPrompt);
|
|
41436
41410
|
const plannerOutput = await this.aiRunner.run(plannerPrompt);
|
|
41437
41411
|
this.log("Planner phase complete.", "success");
|
|
41438
41412
|
this.log("Phase 2/2: Reviewer checking for conflicts and quality...", "info");
|
|
@@ -41460,34 +41434,8 @@ class PlanningMeeting {
|
|
|
41460
41434
|
const kb = new KnowledgeBase(this.projectPath);
|
|
41461
41435
|
return kb.getFullContext();
|
|
41462
41436
|
}
|
|
41463
|
-
getCodebaseIndex() {
|
|
41464
|
-
const indexPath = getLocusPath(this.projectPath, "indexFile");
|
|
41465
|
-
if (!existsSync10(indexPath)) {
|
|
41466
|
-
return "";
|
|
41467
|
-
}
|
|
41468
|
-
try {
|
|
41469
|
-
const raw = readFileSync9(indexPath, "utf-8");
|
|
41470
|
-
const index = JSON.parse(raw);
|
|
41471
|
-
const parts = [];
|
|
41472
|
-
if (index.responsibilities) {
|
|
41473
|
-
parts.push("### File Responsibilities");
|
|
41474
|
-
const entries = Object.entries(index.responsibilities);
|
|
41475
|
-
for (const [file2, summary] of entries.slice(0, 50)) {
|
|
41476
|
-
parts.push(`- \`${file2}\`: ${summary}`);
|
|
41477
|
-
}
|
|
41478
|
-
if (entries.length > 50) {
|
|
41479
|
-
parts.push(`... and ${entries.length - 50} more files`);
|
|
41480
|
-
}
|
|
41481
|
-
}
|
|
41482
|
-
return parts.join(`
|
|
41483
|
-
`);
|
|
41484
|
-
} catch {
|
|
41485
|
-
return "";
|
|
41486
|
-
}
|
|
41487
|
-
}
|
|
41488
41437
|
}
|
|
41489
41438
|
var init_planning_meeting = __esm(() => {
|
|
41490
|
-
init_config();
|
|
41491
41439
|
init_knowledge_base();
|
|
41492
41440
|
init_sprint_plan();
|
|
41493
41441
|
});
|
|
@@ -42570,7 +42518,7 @@ import { createInterface } from "node:readline";
|
|
|
42570
42518
|
|
|
42571
42519
|
// src/settings-manager.ts
|
|
42572
42520
|
init_index_node();
|
|
42573
|
-
import { existsSync as
|
|
42521
|
+
import { existsSync as existsSync10, readFileSync as readFileSync9, unlinkSync as unlinkSync3, writeFileSync as writeFileSync6 } from "node:fs";
|
|
42574
42522
|
import { join as join10 } from "node:path";
|
|
42575
42523
|
function getSettingsPath(projectPath) {
|
|
42576
42524
|
return join10(projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG.settingsFile);
|
|
@@ -42583,10 +42531,10 @@ class SettingsManager {
|
|
|
42583
42531
|
}
|
|
42584
42532
|
load() {
|
|
42585
42533
|
const settingsPath = getSettingsPath(this.projectPath);
|
|
42586
|
-
if (!
|
|
42534
|
+
if (!existsSync10(settingsPath)) {
|
|
42587
42535
|
return {};
|
|
42588
42536
|
}
|
|
42589
|
-
return JSON.parse(
|
|
42537
|
+
return JSON.parse(readFileSync9(settingsPath, "utf-8"));
|
|
42590
42538
|
}
|
|
42591
42539
|
save(settings) {
|
|
42592
42540
|
const { $schema: _2, ...rest } = settings;
|
|
@@ -42604,12 +42552,12 @@ class SettingsManager {
|
|
|
42604
42552
|
}
|
|
42605
42553
|
remove() {
|
|
42606
42554
|
const settingsPath = getSettingsPath(this.projectPath);
|
|
42607
|
-
if (
|
|
42555
|
+
if (existsSync10(settingsPath)) {
|
|
42608
42556
|
unlinkSync3(settingsPath);
|
|
42609
42557
|
}
|
|
42610
42558
|
}
|
|
42611
42559
|
exists() {
|
|
42612
|
-
return
|
|
42560
|
+
return existsSync10(getSettingsPath(this.projectPath));
|
|
42613
42561
|
}
|
|
42614
42562
|
}
|
|
42615
42563
|
|
|
@@ -42875,7 +42823,7 @@ import { parseArgs } from "node:util";
|
|
|
42875
42823
|
// src/config-manager.ts
|
|
42876
42824
|
init_index_node();
|
|
42877
42825
|
import { execSync as execSync2 } from "node:child_process";
|
|
42878
|
-
import { existsSync as
|
|
42826
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync6, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "node:fs";
|
|
42879
42827
|
import { join as join11 } from "node:path";
|
|
42880
42828
|
var LOCUS_GITIGNORE_MARKER = "# Locus AI";
|
|
42881
42829
|
var DEFAULT_CONTEXT_MD = `# Project
|
|
@@ -42946,8 +42894,8 @@ function updateGitignore(projectPath) {
|
|
|
42946
42894
|
let content = "";
|
|
42947
42895
|
const locusBlock = LOCUS_GITIGNORE_PATTERNS.join(`
|
|
42948
42896
|
`);
|
|
42949
|
-
if (
|
|
42950
|
-
content =
|
|
42897
|
+
if (existsSync11(gitignorePath)) {
|
|
42898
|
+
content = readFileSync10(gitignorePath, "utf-8");
|
|
42951
42899
|
if (content.includes(LOCUS_GITIGNORE_MARKER)) {
|
|
42952
42900
|
const lines = content.split(`
|
|
42953
42901
|
`);
|
|
@@ -43028,7 +42976,7 @@ class ConfigManager {
|
|
|
43028
42976
|
async init(version2) {
|
|
43029
42977
|
const locusConfigDir = join11(this.projectPath, LOCUS_CONFIG.dir);
|
|
43030
42978
|
const locusConfigPath = getLocusPath(this.projectPath, "configFile");
|
|
43031
|
-
if (!
|
|
42979
|
+
if (!existsSync11(locusConfigDir)) {
|
|
43032
42980
|
mkdirSync6(locusConfigDir, { recursive: true });
|
|
43033
42981
|
}
|
|
43034
42982
|
const locusSubdirs = [
|
|
@@ -43041,23 +42989,23 @@ class ConfigManager {
|
|
|
43041
42989
|
];
|
|
43042
42990
|
for (const subdir of locusSubdirs) {
|
|
43043
42991
|
const subdirPath = join11(locusConfigDir, subdir);
|
|
43044
|
-
if (!
|
|
42992
|
+
if (!existsSync11(subdirPath)) {
|
|
43045
42993
|
mkdirSync6(subdirPath, { recursive: true });
|
|
43046
42994
|
}
|
|
43047
42995
|
}
|
|
43048
42996
|
const contextFilePath = getLocusPath(this.projectPath, "projectContextFile");
|
|
43049
|
-
if (!
|
|
42997
|
+
if (!existsSync11(contextFilePath)) {
|
|
43050
42998
|
writeFileSync7(contextFilePath, DEFAULT_CONTEXT_MD);
|
|
43051
42999
|
}
|
|
43052
43000
|
const progressFilePath = getLocusPath(this.projectPath, "projectProgressFile");
|
|
43053
|
-
if (!
|
|
43001
|
+
if (!existsSync11(progressFilePath)) {
|
|
43054
43002
|
writeFileSync7(progressFilePath, DEFAULT_PROGRESS_MD);
|
|
43055
43003
|
}
|
|
43056
43004
|
const locusMdPath = getLocusPath(this.projectPath, "contextFile");
|
|
43057
|
-
if (!
|
|
43005
|
+
if (!existsSync11(locusMdPath)) {
|
|
43058
43006
|
writeFileSync7(locusMdPath, LOCUS_MD_TEMPLATE);
|
|
43059
43007
|
}
|
|
43060
|
-
if (!
|
|
43008
|
+
if (!existsSync11(locusConfigPath)) {
|
|
43061
43009
|
const config2 = {
|
|
43062
43010
|
$schema: LOCUS_SCHEMAS.config,
|
|
43063
43011
|
version: version2,
|
|
@@ -43071,8 +43019,8 @@ class ConfigManager {
|
|
|
43071
43019
|
}
|
|
43072
43020
|
loadConfig() {
|
|
43073
43021
|
const path2 = getLocusPath(this.projectPath, "configFile");
|
|
43074
|
-
if (
|
|
43075
|
-
return JSON.parse(
|
|
43022
|
+
if (existsSync11(path2)) {
|
|
43023
|
+
return JSON.parse(readFileSync10(path2, "utf-8"));
|
|
43076
43024
|
}
|
|
43077
43025
|
return null;
|
|
43078
43026
|
}
|
|
@@ -43105,8 +43053,8 @@ class ConfigManager {
|
|
|
43105
43053
|
}
|
|
43106
43054
|
}
|
|
43107
43055
|
const settingsPath = join11(this.projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG.settingsFile);
|
|
43108
|
-
if (
|
|
43109
|
-
const raw =
|
|
43056
|
+
if (existsSync11(settingsPath)) {
|
|
43057
|
+
const raw = readFileSync10(settingsPath, "utf-8");
|
|
43110
43058
|
const settings = JSON.parse(raw);
|
|
43111
43059
|
if (settings.$schema !== LOCUS_SCHEMAS.settings) {
|
|
43112
43060
|
const { $schema: _2, ...rest } = settings;
|
|
@@ -43114,7 +43062,7 @@ class ConfigManager {
|
|
|
43114
43062
|
writeFileSync7(settingsPath, JSON.stringify(ordered, null, 2), "utf-8");
|
|
43115
43063
|
}
|
|
43116
43064
|
}
|
|
43117
|
-
const locusMdExisted =
|
|
43065
|
+
const locusMdExisted = existsSync11(locusMdPath);
|
|
43118
43066
|
writeFileSync7(locusMdPath, LOCUS_MD_TEMPLATE);
|
|
43119
43067
|
if (!locusMdExisted) {
|
|
43120
43068
|
result.directoriesCreated.push(".locus/LOCUS.md");
|
|
@@ -43129,25 +43077,25 @@ class ConfigManager {
|
|
|
43129
43077
|
];
|
|
43130
43078
|
for (const subdir of locusSubdirs) {
|
|
43131
43079
|
const subdirPath = join11(locusConfigDir, subdir);
|
|
43132
|
-
if (!
|
|
43080
|
+
if (!existsSync11(subdirPath)) {
|
|
43133
43081
|
mkdirSync6(subdirPath, { recursive: true });
|
|
43134
43082
|
result.directoriesCreated.push(`.locus/${subdir}`);
|
|
43135
43083
|
}
|
|
43136
43084
|
}
|
|
43137
43085
|
const contextFilePath = getLocusPath(this.projectPath, "projectContextFile");
|
|
43138
|
-
if (!
|
|
43086
|
+
if (!existsSync11(contextFilePath)) {
|
|
43139
43087
|
writeFileSync7(contextFilePath, DEFAULT_CONTEXT_MD);
|
|
43140
43088
|
result.directoriesCreated.push(".locus/project/context.md");
|
|
43141
43089
|
}
|
|
43142
43090
|
const progressFilePath = getLocusPath(this.projectPath, "projectProgressFile");
|
|
43143
|
-
if (!
|
|
43091
|
+
if (!existsSync11(progressFilePath)) {
|
|
43144
43092
|
writeFileSync7(progressFilePath, DEFAULT_PROGRESS_MD);
|
|
43145
43093
|
result.directoriesCreated.push(".locus/project/progress.md");
|
|
43146
43094
|
}
|
|
43147
43095
|
const gitignorePath = join11(this.projectPath, ".gitignore");
|
|
43148
|
-
const gitignoreBefore =
|
|
43096
|
+
const gitignoreBefore = existsSync11(gitignorePath) ? readFileSync10(gitignorePath, "utf-8") : "";
|
|
43149
43097
|
updateGitignore(this.projectPath);
|
|
43150
|
-
const gitignoreAfter =
|
|
43098
|
+
const gitignoreAfter = readFileSync10(gitignorePath, "utf-8");
|
|
43151
43099
|
if (gitignoreBefore !== gitignoreAfter) {
|
|
43152
43100
|
result.gitignoreUpdated = true;
|
|
43153
43101
|
}
|
|
@@ -43166,7 +43114,7 @@ class ConfigManager {
|
|
|
43166
43114
|
init_index_node();
|
|
43167
43115
|
|
|
43168
43116
|
// src/utils/version.ts
|
|
43169
|
-
import { existsSync as
|
|
43117
|
+
import { existsSync as existsSync12, readFileSync as readFileSync11 } from "node:fs";
|
|
43170
43118
|
import { dirname as dirname4, join as join12 } from "node:path";
|
|
43171
43119
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
43172
43120
|
function getVersion() {
|
|
@@ -43175,14 +43123,14 @@ function getVersion() {
|
|
|
43175
43123
|
const __dirname2 = dirname4(__filename2);
|
|
43176
43124
|
const bundledPath = join12(__dirname2, "..", "package.json");
|
|
43177
43125
|
const sourcePath = join12(__dirname2, "..", "..", "package.json");
|
|
43178
|
-
if (
|
|
43179
|
-
const pkg = JSON.parse(
|
|
43126
|
+
if (existsSync12(bundledPath)) {
|
|
43127
|
+
const pkg = JSON.parse(readFileSync11(bundledPath, "utf-8"));
|
|
43180
43128
|
if (pkg.name === "@locusai/cli") {
|
|
43181
43129
|
return pkg.version || "0.0.0";
|
|
43182
43130
|
}
|
|
43183
43131
|
}
|
|
43184
|
-
if (
|
|
43185
|
-
const pkg = JSON.parse(
|
|
43132
|
+
if (existsSync12(sourcePath)) {
|
|
43133
|
+
const pkg = JSON.parse(readFileSync11(sourcePath, "utf-8"));
|
|
43186
43134
|
if (pkg.name === "@locusai/cli") {
|
|
43187
43135
|
return pkg.version || "0.0.0";
|
|
43188
43136
|
}
|
|
@@ -43204,12 +43152,12 @@ function printBanner() {
|
|
|
43204
43152
|
}
|
|
43205
43153
|
// src/utils/helpers.ts
|
|
43206
43154
|
init_index_node();
|
|
43207
|
-
import { existsSync as
|
|
43155
|
+
import { existsSync as existsSync13 } from "node:fs";
|
|
43208
43156
|
import { join as join13 } from "node:path";
|
|
43209
43157
|
function isProjectInitialized(projectPath) {
|
|
43210
43158
|
const locusDir = join13(projectPath, LOCUS_CONFIG.dir);
|
|
43211
43159
|
const configPath = join13(locusDir, LOCUS_CONFIG.configFile);
|
|
43212
|
-
return
|
|
43160
|
+
return existsSync13(locusDir) && existsSync13(configPath);
|
|
43213
43161
|
}
|
|
43214
43162
|
function requireInitialization(projectPath, command) {
|
|
43215
43163
|
if (!isProjectInitialized(projectPath)) {
|
|
@@ -44384,7 +44332,7 @@ function showPlanHelp() {
|
|
|
44384
44332
|
}
|
|
44385
44333
|
// src/commands/review.ts
|
|
44386
44334
|
init_index_node();
|
|
44387
|
-
import { existsSync as
|
|
44335
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync7, writeFileSync as writeFileSync8 } from "node:fs";
|
|
44388
44336
|
import { join as join14 } from "node:path";
|
|
44389
44337
|
import { parseArgs as parseArgs5 } from "node:util";
|
|
44390
44338
|
async function reviewCommand(args) {
|
|
@@ -44525,7 +44473,7 @@ async function reviewLocalCommand(args) {
|
|
|
44525
44473
|
return;
|
|
44526
44474
|
}
|
|
44527
44475
|
const reviewsDir = join14(projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG.reviewsDir);
|
|
44528
|
-
if (!
|
|
44476
|
+
if (!existsSync14(reviewsDir)) {
|
|
44529
44477
|
mkdirSync7(reviewsDir, { recursive: true });
|
|
44530
44478
|
}
|
|
44531
44479
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
@@ -44622,7 +44570,7 @@ ${c.info(`Received ${signal}. Stopping agent and cleaning up...`)}`);
|
|
|
44622
44570
|
// src/commands/telegram.ts
|
|
44623
44571
|
init_index_node();
|
|
44624
44572
|
import { spawn as spawn4 } from "node:child_process";
|
|
44625
|
-
import { existsSync as
|
|
44573
|
+
import { existsSync as existsSync15 } from "node:fs";
|
|
44626
44574
|
import { join as join15 } from "node:path";
|
|
44627
44575
|
import { createInterface as createInterface3 } from "node:readline";
|
|
44628
44576
|
function ask2(question) {
|
|
@@ -44858,7 +44806,7 @@ function runBotCommand(projectPath) {
|
|
|
44858
44806
|
process.exit(1);
|
|
44859
44807
|
}
|
|
44860
44808
|
const monorepoTelegramEntry = join15(projectPath, "packages/telegram/src/index.ts");
|
|
44861
|
-
const isMonorepo =
|
|
44809
|
+
const isMonorepo = existsSync15(monorepoTelegramEntry);
|
|
44862
44810
|
let cmd;
|
|
44863
44811
|
let args;
|
|
44864
44812
|
if (isMonorepo) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "CLI for Locus - AI-native project management platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"author": "",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@locusai/sdk": "^0.
|
|
36
|
+
"@locusai/sdk": "^0.12.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {}
|
|
39
39
|
}
|