@locusai/sdk 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.
@@ -1680,14 +1680,10 @@ ${line}`;
1680
1680
  }
1681
1681
  getFullContext() {
1682
1682
  const context = this.readContext();
1683
- const progress = this.readProgress();
1684
1683
  const parts = [];
1685
1684
  if (context.trim()) {
1686
1685
  parts.push(context.trim());
1687
1686
  }
1688
- if (progress.trim()) {
1689
- parts.push(progress.trim());
1690
- }
1691
1687
  return parts.join(`
1692
1688
 
1693
1689
  ---
@@ -2079,13 +2075,6 @@ ${serverContext.context}
2079
2075
  prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
2080
2076
 
2081
2077
  `;
2082
- const indexPath = getLocusPath(this.projectPath, "indexFile");
2083
- if (import_node_fs4.existsSync(indexPath)) {
2084
- prompt += `## Codebase Overview
2085
- There is an index file in the .locus/codebase-index.json and if you need you can check it.
2086
-
2087
- `;
2088
- }
2089
2078
  if (task.docs && task.docs.length > 0) {
2090
2079
  prompt += `## Attached Documents (Summarized)
2091
2080
  `;
@@ -2115,19 +2104,17 @@ ${preview}${isTruncated ? `
2115
2104
  `;
2116
2105
  }
2117
2106
  if (task.comments && task.comments.length > 0) {
2118
- const comments = task.comments.slice(0, 3);
2119
- prompt += `## Task History & Feedback
2120
- `;
2121
- prompt += `Review the following comments for context or rejection feedback:
2122
-
2107
+ const filteredComments = task.comments.filter((comment) => comment.author !== "system");
2108
+ const comments = filteredComments.slice(0, 3);
2109
+ prompt += `## Task Comments & Feedback
2123
2110
  `;
2124
2111
  for (const comment of comments) {
2125
2112
  const date = new Date(comment.createdAt).toLocaleString();
2126
- prompt += `### ${comment.author} (${date})
2127
- ${comment.text}
2128
-
2113
+ prompt += `- ${comment.author} (${date}): ${comment.text}
2129
2114
  `;
2130
2115
  }
2116
+ prompt += `
2117
+ `;
2131
2118
  }
2132
2119
  prompt += `## Instructions
2133
2120
  1. Complete this task.
@@ -2192,13 +2179,6 @@ ${fallback}
2192
2179
  prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
2193
2180
 
2194
2181
  `;
2195
- const indexPath = getLocusPath(this.projectPath, "indexFile");
2196
- if (import_node_fs4.existsSync(indexPath)) {
2197
- prompt += `## Codebase Overview
2198
- There is an index file in the .locus/codebase-index.json and if you need you can check it.
2199
-
2200
- `;
2201
- }
2202
2182
  prompt += `## Instructions
2203
2183
  1. Execute the prompt based on the provided project context.
2204
2184
  2. **Paths**: Use relative paths from the project root at all times. Do NOT use absolute local paths (e.g., /Users/...).
@@ -2582,7 +2562,7 @@ class AgentWorker {
2582
2562
  assignedTo: null
2583
2563
  });
2584
2564
  await this.client.tasks.addComment(task.id, this.config.workspaceId, {
2585
- author: this.config.agentId,
2565
+ author: "system",
2586
2566
  text: `⚠️ Agent execution finished with no file changes, so no commit was created.
2587
2567
 
2588
2568
  ${result.summary}`
@@ -2597,7 +2577,7 @@ ${result.summary}`
2597
2577
 
2598
2578
  Branch: \`${result.branch}\`` : "";
2599
2579
  await this.client.tasks.addComment(task.id, this.config.workspaceId, {
2600
- author: this.config.agentId,
2580
+ author: "system",
2601
2581
  text: `✅ ${result.summary}${branchInfo}`
2602
2582
  });
2603
2583
  this.tasksCompleted++;
@@ -2612,7 +2592,7 @@ Branch: \`${result.branch}\`` : "";
2612
2592
  assignedTo: null
2613
2593
  });
2614
2594
  await this.client.tasks.addComment(task.id, this.config.workspaceId, {
2615
- author: this.config.agentId,
2595
+ author: "system",
2616
2596
  text: `❌ ${result.summary}`
2617
2597
  });
2618
2598
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/core/prompt-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGrD,qBAAa,aAAa;IACZ,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,MAAM;IAEjC,KAAK,CACT,IAAI,EAAE,IAAI,EACV,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO,GACrC,OAAO,CAAC,MAAM,CAAC;IA+HZ,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA4DxD,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,mBAAmB;IAuB3B,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,MAAM,GAAG,IAAI;CAoBtD"}
1
+ {"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/core/prompt-builder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGrD,qBAAa,aAAa;IACZ,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,MAAM;IAEjC,KAAK,CACT,IAAI,EAAE,IAAI,EACV,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO,GACrC,OAAO,CAAC,MAAM,CAAC;IA4HZ,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAsDxD,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,mBAAmB;IAuB3B,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,GAAG,MAAM,GAAG,IAAI;CAoBtD"}
@@ -1680,14 +1680,10 @@ ${line}`;
1680
1680
  }
1681
1681
  getFullContext() {
1682
1682
  const context = this.readContext();
1683
- const progress = this.readProgress();
1684
1683
  const parts = [];
1685
1684
  if (context.trim()) {
1686
1685
  parts.push(context.trim());
1687
1686
  }
1688
- if (progress.trim()) {
1689
- parts.push(progress.trim());
1690
- }
1691
1687
  return parts.join(`
1692
1688
 
1693
1689
  ---
@@ -2079,13 +2075,6 @@ ${serverContext.context}
2079
2075
  prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
2080
2076
 
2081
2077
  `;
2082
- const indexPath = getLocusPath(this.projectPath, "indexFile");
2083
- if (import_node_fs4.existsSync(indexPath)) {
2084
- prompt += `## Codebase Overview
2085
- There is an index file in the .locus/codebase-index.json and if you need you can check it.
2086
-
2087
- `;
2088
- }
2089
2078
  if (task.docs && task.docs.length > 0) {
2090
2079
  prompt += `## Attached Documents (Summarized)
2091
2080
  `;
@@ -2115,19 +2104,17 @@ ${preview}${isTruncated ? `
2115
2104
  `;
2116
2105
  }
2117
2106
  if (task.comments && task.comments.length > 0) {
2118
- const comments = task.comments.slice(0, 3);
2119
- prompt += `## Task History & Feedback
2120
- `;
2121
- prompt += `Review the following comments for context or rejection feedback:
2122
-
2107
+ const filteredComments = task.comments.filter((comment) => comment.author !== "system");
2108
+ const comments = filteredComments.slice(0, 3);
2109
+ prompt += `## Task Comments & Feedback
2123
2110
  `;
2124
2111
  for (const comment of comments) {
2125
2112
  const date = new Date(comment.createdAt).toLocaleString();
2126
- prompt += `### ${comment.author} (${date})
2127
- ${comment.text}
2128
-
2113
+ prompt += `- ${comment.author} (${date}): ${comment.text}
2129
2114
  `;
2130
2115
  }
2116
+ prompt += `
2117
+ `;
2131
2118
  }
2132
2119
  prompt += `## Instructions
2133
2120
  1. Complete this task.
@@ -2192,13 +2179,6 @@ ${fallback}
2192
2179
  prompt += `If you need more information about the project strategies, plans, or architecture, please read files in these directories.
2193
2180
 
2194
2181
  `;
2195
- const indexPath = getLocusPath(this.projectPath, "indexFile");
2196
- if (import_node_fs4.existsSync(indexPath)) {
2197
- prompt += `## Codebase Overview
2198
- There is an index file in the .locus/codebase-index.json and if you need you can check it.
2199
-
2200
- `;
2201
- }
2202
2182
  prompt += `## Instructions
2203
2183
  1. Execute the prompt based on the provided project context.
2204
2184
  2. **Paths**: Use relative paths from the project root at all times. Do NOT use absolute local paths (e.g., /Users/...).
@@ -2582,7 +2562,7 @@ class AgentWorker {
2582
2562
  assignedTo: null
2583
2563
  });
2584
2564
  await this.client.tasks.addComment(task.id, this.config.workspaceId, {
2585
- author: this.config.agentId,
2565
+ author: "system",
2586
2566
  text: `⚠️ Agent execution finished with no file changes, so no commit was created.
2587
2567
 
2588
2568
  ${result.summary}`
@@ -2597,7 +2577,7 @@ ${result.summary}`
2597
2577
 
2598
2578
  Branch: \`${result.branch}\`` : "";
2599
2579
  await this.client.tasks.addComment(task.id, this.config.workspaceId, {
2600
- author: this.config.agentId,
2580
+ author: "system",
2601
2581
  text: `✅ ${result.summary}${branchInfo}`
2602
2582
  });
2603
2583
  this.tasksCompleted++;
@@ -2612,7 +2592,7 @@ Branch: \`${result.branch}\`` : "";
2612
2592
  assignedTo: null
2613
2593
  });
2614
2594
  await this.client.tasks.addComment(task.id, this.config.workspaceId, {
2615
- author: this.config.agentId,
2595
+ author: "system",
2616
2596
  text: `❌ ${result.summary}`
2617
2597
  });
2618
2598
  }
@@ -5003,9 +4983,7 @@ class PlanManager {
5003
4983
  }
5004
4984
  }
5005
4985
  // src/planning/planning-meeting.ts
5006
- init_config();
5007
4986
  init_knowledge_base();
5008
- var import_node_fs10 = require("node:fs");
5009
4987
 
5010
4988
  // src/planning/agents/cross-task-reviewer.ts
5011
4989
  function buildCrossTaskReviewerPrompt(input) {
@@ -5142,9 +5120,6 @@ IMPORTANT: Incorporate this feedback into your plan. The CEO has reviewed a prev
5142
5120
  ## Project Context
5143
5121
  ${input.projectContext || "No project context available."}
5144
5122
 
5145
- ## Codebase Structure
5146
- ${input.codebaseIndex || "No codebase index available."}
5147
-
5148
5123
  ## Your Task
5149
5124
 
5150
5125
  Analyze the directive and produce a **complete sprint plan** with the following:
@@ -5240,14 +5215,13 @@ class PlanningMeeting {
5240
5215
  }
5241
5216
  async run(directive, feedback) {
5242
5217
  const projectContext = this.getProjectContext();
5243
- const codebaseIndex = this.getCodebaseIndex();
5244
5218
  this.log("Phase 1/2: Planner building sprint plan...", "info");
5245
5219
  const plannerPrompt = buildPlannerPrompt({
5246
5220
  directive,
5247
5221
  projectContext,
5248
- codebaseIndex,
5249
5222
  feedback
5250
5223
  });
5224
+ console.log(plannerPrompt);
5251
5225
  const plannerOutput = await this.aiRunner.run(plannerPrompt);
5252
5226
  this.log("Planner phase complete.", "success");
5253
5227
  this.log("Phase 2/2: Reviewer checking for conflicts and quality...", "info");
@@ -5275,31 +5249,6 @@ class PlanningMeeting {
5275
5249
  const kb = new KnowledgeBase(this.projectPath);
5276
5250
  return kb.getFullContext();
5277
5251
  }
5278
- getCodebaseIndex() {
5279
- const indexPath = getLocusPath(this.projectPath, "indexFile");
5280
- if (!import_node_fs10.existsSync(indexPath)) {
5281
- return "";
5282
- }
5283
- try {
5284
- const raw = import_node_fs10.readFileSync(indexPath, "utf-8");
5285
- const index = JSON.parse(raw);
5286
- const parts = [];
5287
- if (index.responsibilities) {
5288
- parts.push("### File Responsibilities");
5289
- const entries = Object.entries(index.responsibilities);
5290
- for (const [file, summary] of entries.slice(0, 50)) {
5291
- parts.push(`- \`${file}\`: ${summary}`);
5292
- }
5293
- if (entries.length > 50) {
5294
- parts.push(`... and ${entries.length - 50} more files`);
5295
- }
5296
- }
5297
- return parts.join(`
5298
- `);
5299
- } catch {
5300
- return "";
5301
- }
5302
- }
5303
5252
  }
5304
5253
  // src/index-node.ts
5305
5254
  init_knowledge_base();
@@ -8,7 +8,6 @@
8
8
  export interface PlannerInput {
9
9
  directive: string;
10
10
  projectContext: string;
11
- codebaseIndex: string;
12
11
  feedback?: string;
13
12
  }
14
13
  export declare function buildPlannerPrompt(input: PlannerInput): string;
@@ -1 +1 @@
1
- {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/planner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAyG9D"}
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/planner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAsG9D"}
@@ -30,6 +30,5 @@ export declare class PlanningMeeting {
30
30
  */
31
31
  run(directive: string, feedback?: string): Promise<PlanningMeetingResult>;
32
32
  private getProjectContext;
33
- private getCodebaseIndex;
34
33
  }
35
34
  //# sourceMappingURL=planning-meeting.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planning-meeting.d.ts","sourceRoot":"","sources":["../../src/planning/planning-meeting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAKhD,OAAO,EAAyB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,CAAC,EAAE,CACJ,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,KAC1C,IAAI,CAAC;CACX;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,6DAA6D;IAC7D,YAAY,EAAE;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;;;;GAKG;AACH,qBAAa,eAAe;IAC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jC,OAAO,CAAC,iBAAiB;CAI1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-base.d.ts","sourceRoot":"","sources":["../../src/project/knowledge-base.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;gBAEjB,WAAW,EAAE,MAAM;IAK/B,WAAW,IAAI,MAAM;IAOrB,YAAY,IAAI,MAAM;IAOtB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKpC,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAa1C,cAAc,IAAI,MAAM;IAiBxB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA+BnC,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,OAAO,CAAC,SAAS;CAMlB"}
1
+ {"version":3,"file":"knowledge-base.d.ts","sourceRoot":"","sources":["../../src/project/knowledge-base.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;gBAEjB,WAAW,EAAE,MAAM;IAK/B,WAAW,IAAI,MAAM;IAOrB,YAAY,IAAI,MAAM;IAOtB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKpC,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAa1C,cAAc,IAAI,MAAM;IAYxB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA+BnC,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,OAAO,CAAC,SAAS;CAMlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusai/sdk",
3
- "version": "0.11.8",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -30,7 +30,7 @@
30
30
  "clean": "rm -rf node_modules"
31
31
  },
32
32
  "dependencies": {
33
- "@locusai/shared": "^0.11.8",
33
+ "@locusai/shared": "^0.12.0",
34
34
  "axios": "^1.13.2",
35
35
  "events": "^3.3.0",
36
36
  "globby": "^14.0.2"