@locusai/sdk 0.15.5 → 0.16.2
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/dist/agent/reviewer-worker.d.ts +2 -1
- package/dist/agent/reviewer-worker.d.ts.map +1 -1
- package/dist/agent/worker.d.ts +2 -1
- package/dist/agent/worker.d.ts.map +1 -1
- package/dist/agent/worker.js +134 -208
- package/dist/ai/claude-runner.d.ts +0 -7
- package/dist/ai/claude-runner.d.ts.map +1 -1
- package/dist/ai/claude-stream-parser.d.ts +41 -0
- package/dist/ai/claude-stream-parser.d.ts.map +1 -0
- package/dist/ai/codex-runner.d.ts.map +1 -1
- package/dist/ai/factory.d.ts +11 -0
- package/dist/ai/factory.d.ts.map +1 -1
- package/dist/ai/index.d.ts +3 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/discussion/discussion-facilitator.d.ts.map +1 -1
- package/dist/events.d.ts +0 -2
- package/dist/events.d.ts.map +1 -1
- package/dist/index-node.d.ts +0 -1
- package/dist/index-node.d.ts.map +1 -1
- package/dist/index-node.js +146 -468
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -87
- package/dist/modules/workspaces.d.ts +0 -15
- package/dist/modules/workspaces.d.ts.map +1 -1
- package/dist/planning/planning-meeting.d.ts +2 -1
- package/dist/planning/planning-meeting.d.ts.map +1 -1
- package/dist/utils/resolve-bin.d.ts.map +1 -1
- package/package.json +5 -7
- package/dist/modules/instances.d.ts +0 -46
- package/dist/modules/instances.d.ts.map +0 -1
- package/dist/modules/suggestions.d.ts +0 -12
- package/dist/modules/suggestions.d.ts.map +0 -1
- package/dist/proposals/context-gatherer.d.ts +0 -32
- package/dist/proposals/context-gatherer.d.ts.map +0 -1
- package/dist/proposals/index.d.ts +0 -4
- package/dist/proposals/index.d.ts.map +0 -1
- package/dist/proposals/proposal-engine.d.ts +0 -21
- package/dist/proposals/proposal-engine.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LogFn } from "../ai/factory.js";
|
|
1
2
|
import type { AiProvider } from "../ai/runner.js";
|
|
2
3
|
export interface ReviewerConfig {
|
|
3
4
|
agentId: string;
|
|
@@ -23,8 +24,8 @@ export declare class ReviewerWorker {
|
|
|
23
24
|
private currentTaskId;
|
|
24
25
|
private maxReviews;
|
|
25
26
|
private reviewsCompleted;
|
|
27
|
+
log: LogFn;
|
|
26
28
|
constructor(config: ReviewerConfig);
|
|
27
|
-
log(message: string, level?: "info" | "success" | "warn" | "error"): void;
|
|
28
29
|
/**
|
|
29
30
|
* Discover the next unreviewed Locus PR from GitHub.
|
|
30
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewer-worker.d.ts","sourceRoot":"","sources":["../../src/agent/reviewer-worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reviewer-worker.d.ts","sourceRoot":"","sources":["../../src/agent/reviewer-worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,iBAAiB,CAAC;AAY5D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;;GAIG;AACH,qBAAa,cAAc;IAUb,OAAO,CAAC,MAAM;IAT1B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,iBAAiB,CAA+C;IACxE,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,GAAG,EAAE,KAAK,CAAC;gBAES,MAAM,EAAE,cAAc;IA6B1C;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;YACW,QAAQ;IAiFtB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAgBf,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiE3B"}
|
package/dist/agent/worker.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LogFn } from "../ai/factory.js";
|
|
1
2
|
import type { WorkerConfig } from "./worker-types.js";
|
|
2
3
|
export type { WorkerConfig } from "./worker-types.js";
|
|
3
4
|
/**
|
|
@@ -23,8 +24,8 @@ export declare class AgentWorker {
|
|
|
23
24
|
private currentTaskId;
|
|
24
25
|
private completedTaskList;
|
|
25
26
|
private taskSummaries;
|
|
27
|
+
log: LogFn;
|
|
26
28
|
constructor(config: WorkerConfig);
|
|
27
|
-
log(message: string, level?: "info" | "success" | "warn" | "error"): void;
|
|
28
29
|
private getActiveSprint;
|
|
29
30
|
private getNextTask;
|
|
30
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/agent/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/agent/worker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGlE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,qBAAa,WAAW;IAkBV,OAAO,CAAC,MAAM;IAjB1B,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,WAAW,CAAc;IAGjC,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,iBAAiB,CAA+C;IACxE,OAAO,CAAC,aAAa,CAAuB;IAG5C,OAAO,CAAC,iBAAiB,CAA4C;IACrE,OAAO,CAAC,aAAa,CAAgB;IAErC,GAAG,EAAE,KAAK,CAAC;gBAES,MAAM,EAAE,YAAY;YAyD1B,eAAe;YAcf,WAAW;IAgDzB;;OAEG;YACW,WAAW;IAoCzB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAoBf,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4I3B"}
|
package/dist/agent/worker.js
CHANGED
|
@@ -156,49 +156,6 @@ var init_docs = __esm(() => {
|
|
|
156
156
|
};
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
-
// src/modules/instances.ts
|
|
160
|
-
var InstancesModule;
|
|
161
|
-
var init_instances = __esm(() => {
|
|
162
|
-
InstancesModule = class InstancesModule extends BaseModule {
|
|
163
|
-
async list(workspaceId) {
|
|
164
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances`);
|
|
165
|
-
return data.instances;
|
|
166
|
-
}
|
|
167
|
-
async get(workspaceId, instanceId) {
|
|
168
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}`);
|
|
169
|
-
return data.instance;
|
|
170
|
-
}
|
|
171
|
-
async provision(workspaceId, body) {
|
|
172
|
-
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances`, body);
|
|
173
|
-
return data.instance;
|
|
174
|
-
}
|
|
175
|
-
async performAction(workspaceId, instanceId, action) {
|
|
176
|
-
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/actions`, { action });
|
|
177
|
-
return data.instance;
|
|
178
|
-
}
|
|
179
|
-
async sync(workspaceId, instanceId) {
|
|
180
|
-
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/sync`);
|
|
181
|
-
return data.instance;
|
|
182
|
-
}
|
|
183
|
-
async checkUpdates(workspaceId, instanceId) {
|
|
184
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
185
|
-
return data.update;
|
|
186
|
-
}
|
|
187
|
-
async applyUpdate(workspaceId, instanceId) {
|
|
188
|
-
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
189
|
-
return data.update;
|
|
190
|
-
}
|
|
191
|
-
async getSecurity(workspaceId, instanceId) {
|
|
192
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`);
|
|
193
|
-
return data.rules;
|
|
194
|
-
}
|
|
195
|
-
async updateSecurity(workspaceId, instanceId, body) {
|
|
196
|
-
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`, body);
|
|
197
|
-
return data.rules;
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
});
|
|
201
|
-
|
|
202
159
|
// src/modules/invitations.ts
|
|
203
160
|
var InvitationsModule;
|
|
204
161
|
var init_invitations = __esm(() => {
|
|
@@ -307,29 +264,6 @@ var init_sprints = __esm(() => {
|
|
|
307
264
|
};
|
|
308
265
|
});
|
|
309
266
|
|
|
310
|
-
// src/modules/suggestions.ts
|
|
311
|
-
var SuggestionsModule;
|
|
312
|
-
var init_suggestions = __esm(() => {
|
|
313
|
-
SuggestionsModule = class SuggestionsModule extends BaseModule {
|
|
314
|
-
async create(workspaceId, data) {
|
|
315
|
-
const { data: res } = await this.api.post(`/workspaces/${workspaceId}/suggestions`, data);
|
|
316
|
-
return res.suggestion;
|
|
317
|
-
}
|
|
318
|
-
async list(workspaceId, params) {
|
|
319
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/suggestions`, { params });
|
|
320
|
-
return data.suggestions;
|
|
321
|
-
}
|
|
322
|
-
async get(workspaceId, id) {
|
|
323
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/suggestions/${id}`);
|
|
324
|
-
return data.suggestion;
|
|
325
|
-
}
|
|
326
|
-
async updateStatus(workspaceId, id, status) {
|
|
327
|
-
const { data } = await this.api.patch(`/workspaces/${workspaceId}/suggestions/${id}/status`, status);
|
|
328
|
-
return data.suggestion;
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
});
|
|
332
|
-
|
|
333
267
|
// src/modules/tasks.ts
|
|
334
268
|
var import_shared, TasksModule;
|
|
335
269
|
var init_tasks = __esm(() => {
|
|
@@ -454,17 +388,6 @@ var init_workspaces = __esm(() => {
|
|
|
454
388
|
async deleteApiKey(workspaceId, keyId) {
|
|
455
389
|
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
456
390
|
}
|
|
457
|
-
async getAwsCredentials(workspaceId) {
|
|
458
|
-
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-credentials`);
|
|
459
|
-
return data.credential;
|
|
460
|
-
}
|
|
461
|
-
async saveAwsCredentials(workspaceId, body) {
|
|
462
|
-
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-credentials`, body);
|
|
463
|
-
return data.credential;
|
|
464
|
-
}
|
|
465
|
-
async deleteAwsCredentials(workspaceId) {
|
|
466
|
-
await this.api.delete(`/workspaces/${workspaceId}/aws-credentials`);
|
|
467
|
-
}
|
|
468
391
|
};
|
|
469
392
|
});
|
|
470
393
|
|
|
@@ -506,14 +429,12 @@ var exports_src = {};
|
|
|
506
429
|
__export(exports_src, {
|
|
507
430
|
WorkspacesModule: () => WorkspacesModule,
|
|
508
431
|
TasksModule: () => TasksModule,
|
|
509
|
-
SuggestionsModule: () => SuggestionsModule,
|
|
510
432
|
SprintsModule: () => SprintsModule,
|
|
511
433
|
OrganizationsModule: () => OrganizationsModule,
|
|
512
434
|
LocusEvent: () => LocusEvent,
|
|
513
435
|
LocusEmitter: () => LocusEmitter,
|
|
514
436
|
LocusClient: () => LocusClient,
|
|
515
437
|
InvitationsModule: () => InvitationsModule,
|
|
516
|
-
InstancesModule: () => InstancesModule,
|
|
517
438
|
DocsModule: () => DocsModule,
|
|
518
439
|
DiscussionSchema: () => DiscussionSchema,
|
|
519
440
|
DiscussionMessageSchema: () => DiscussionMessageSchema,
|
|
@@ -534,8 +455,6 @@ class LocusClient {
|
|
|
534
455
|
invitations;
|
|
535
456
|
docs;
|
|
536
457
|
ci;
|
|
537
|
-
instances;
|
|
538
|
-
suggestions;
|
|
539
458
|
constructor(config) {
|
|
540
459
|
this.emitter = new LocusEmitter;
|
|
541
460
|
this.api = import_axios.default.create({
|
|
@@ -555,8 +474,6 @@ class LocusClient {
|
|
|
555
474
|
this.invitations = new InvitationsModule(this.api, this.emitter);
|
|
556
475
|
this.docs = new DocsModule(this.api, this.emitter);
|
|
557
476
|
this.ci = new CiModule(this.api, this.emitter);
|
|
558
|
-
this.instances = new InstancesModule(this.api, this.emitter);
|
|
559
|
-
this.suggestions = new SuggestionsModule(this.api, this.emitter);
|
|
560
477
|
if (config.retryOptions) {
|
|
561
478
|
this.setupRetryInterceptor(config.retryOptions);
|
|
562
479
|
}
|
|
@@ -622,11 +539,9 @@ var init_src = __esm(() => {
|
|
|
622
539
|
init_auth();
|
|
623
540
|
init_ci();
|
|
624
541
|
init_docs();
|
|
625
|
-
init_instances();
|
|
626
542
|
init_invitations();
|
|
627
543
|
init_organizations();
|
|
628
544
|
init_sprints();
|
|
629
|
-
init_suggestions();
|
|
630
545
|
init_tasks();
|
|
631
546
|
init_workspaces();
|
|
632
547
|
init_discussion_types();
|
|
@@ -635,11 +550,9 @@ var init_src = __esm(() => {
|
|
|
635
550
|
init_auth();
|
|
636
551
|
init_ci();
|
|
637
552
|
init_docs();
|
|
638
|
-
init_instances();
|
|
639
553
|
init_invitations();
|
|
640
554
|
init_organizations();
|
|
641
555
|
init_sprints();
|
|
642
|
-
init_suggestions();
|
|
643
556
|
init_tasks();
|
|
644
557
|
init_workspaces();
|
|
645
558
|
});
|
|
@@ -892,7 +805,6 @@ var init_resolve_bin = __esm(() => {
|
|
|
892
805
|
import_node_path2.join(import_node_os.homedir(), ".local", "bin"),
|
|
893
806
|
import_node_path2.join(import_node_os.homedir(), ".npm", "bin"),
|
|
894
807
|
import_node_path2.join(import_node_os.homedir(), ".npm-global", "bin"),
|
|
895
|
-
import_node_path2.join(import_node_os.homedir(), ".npm-packages", "bin"),
|
|
896
808
|
import_node_path2.join(import_node_os.homedir(), ".yarn", "bin"),
|
|
897
809
|
import_node_path2.join(import_node_os.homedir(), ".bun", "bin"),
|
|
898
810
|
import_node_path2.join(import_node_os.homedir(), "Library", "pnpm"),
|
|
@@ -903,6 +815,112 @@ var init_resolve_bin = __esm(() => {
|
|
|
903
815
|
ENV_VARS_TO_STRIP = ["ANTHROPIC_API_KEY", "OPENAI_API_KEY"];
|
|
904
816
|
});
|
|
905
817
|
|
|
818
|
+
// src/ai/claude-stream-parser.ts
|
|
819
|
+
class ClaudeStreamParser {
|
|
820
|
+
activeTools = new Map;
|
|
821
|
+
parseLineToChunk(line) {
|
|
822
|
+
if (!line.trim())
|
|
823
|
+
return null;
|
|
824
|
+
try {
|
|
825
|
+
const item = JSON.parse(line);
|
|
826
|
+
return this.processItemToChunk(item);
|
|
827
|
+
} catch {
|
|
828
|
+
return null;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
parseLine(line, log) {
|
|
832
|
+
if (!line.trim())
|
|
833
|
+
return null;
|
|
834
|
+
try {
|
|
835
|
+
const item = JSON.parse(line);
|
|
836
|
+
return this.processItem(item, log);
|
|
837
|
+
} catch {
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
processItemToChunk(item) {
|
|
842
|
+
if (item.type === "result") {
|
|
843
|
+
return { type: "result", content: item.result || "" };
|
|
844
|
+
}
|
|
845
|
+
if (item.type === "stream_event" && item.event) {
|
|
846
|
+
return this.handleEventToChunk(item.event);
|
|
847
|
+
}
|
|
848
|
+
return null;
|
|
849
|
+
}
|
|
850
|
+
handleEventToChunk(event) {
|
|
851
|
+
const { type, delta, content_block, index } = event;
|
|
852
|
+
if (type === "content_block_delta" && delta?.type === "text_delta") {
|
|
853
|
+
return { type: "text_delta", content: delta.text || "" };
|
|
854
|
+
}
|
|
855
|
+
if (type === "content_block_delta" && delta?.type === "input_json_delta" && delta.partial_json !== undefined && index !== undefined) {
|
|
856
|
+
const activeTool = this.activeTools.get(index);
|
|
857
|
+
if (activeTool) {
|
|
858
|
+
activeTool.parameterJson += delta.partial_json;
|
|
859
|
+
}
|
|
860
|
+
return null;
|
|
861
|
+
}
|
|
862
|
+
if (type === "content_block_start" && content_block) {
|
|
863
|
+
if (content_block.type === "tool_use" && content_block.name) {
|
|
864
|
+
if (index !== undefined) {
|
|
865
|
+
this.activeTools.set(index, {
|
|
866
|
+
name: content_block.name,
|
|
867
|
+
id: content_block.id,
|
|
868
|
+
index,
|
|
869
|
+
parameterJson: "",
|
|
870
|
+
startTime: Date.now()
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
return {
|
|
874
|
+
type: "tool_use",
|
|
875
|
+
tool: content_block.name,
|
|
876
|
+
id: content_block.id
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
if (content_block.type === "thinking") {
|
|
880
|
+
return { type: "thinking" };
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
if (type === "content_block_stop" && index !== undefined) {
|
|
884
|
+
const activeTool = this.activeTools.get(index);
|
|
885
|
+
if (activeTool?.parameterJson) {
|
|
886
|
+
try {
|
|
887
|
+
const parameters = JSON.parse(activeTool.parameterJson);
|
|
888
|
+
return {
|
|
889
|
+
type: "tool_parameters",
|
|
890
|
+
tool: activeTool.name,
|
|
891
|
+
id: activeTool.id,
|
|
892
|
+
parameters
|
|
893
|
+
};
|
|
894
|
+
} catch {}
|
|
895
|
+
}
|
|
896
|
+
return null;
|
|
897
|
+
}
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
processItem(item, log) {
|
|
901
|
+
if (item.type === "result") {
|
|
902
|
+
return item.result || "";
|
|
903
|
+
}
|
|
904
|
+
if (item.type === "stream_event" && item.event) {
|
|
905
|
+
this.handleEvent(item.event, log);
|
|
906
|
+
}
|
|
907
|
+
return null;
|
|
908
|
+
}
|
|
909
|
+
handleEvent(event, log) {
|
|
910
|
+
const { type, content_block } = event;
|
|
911
|
+
if (type === "content_block_start" && content_block) {
|
|
912
|
+
if (content_block.type === "tool_use" && content_block.name) {
|
|
913
|
+
log?.(`
|
|
914
|
+
${c.primary("[Claude]")} ${c.bold(`Running ${content_block.name}...`)}
|
|
915
|
+
`, "info");
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
var init_claude_stream_parser = __esm(() => {
|
|
921
|
+
init_colors();
|
|
922
|
+
});
|
|
923
|
+
|
|
906
924
|
// src/ai/claude-runner.ts
|
|
907
925
|
class ClaudeRunner {
|
|
908
926
|
model;
|
|
@@ -910,7 +928,6 @@ class ClaudeRunner {
|
|
|
910
928
|
projectPath;
|
|
911
929
|
eventEmitter;
|
|
912
930
|
currentToolName;
|
|
913
|
-
activeTools = new Map;
|
|
914
931
|
activeProcess = null;
|
|
915
932
|
aborted = false;
|
|
916
933
|
timeoutMs;
|
|
@@ -945,7 +962,7 @@ class ClaudeRunner {
|
|
|
945
962
|
}
|
|
946
963
|
if (!isLastAttempt) {
|
|
947
964
|
const delay = Math.pow(2, attempt) * 1000;
|
|
948
|
-
|
|
965
|
+
this.log?.(`Claude CLI attempt ${attempt} failed: ${err.message}. Retrying in ${delay}ms...`, "warn");
|
|
949
966
|
await new Promise((resolve2) => setTimeout(resolve2, delay));
|
|
950
967
|
}
|
|
951
968
|
}
|
|
@@ -985,6 +1002,7 @@ class ClaudeRunner {
|
|
|
985
1002
|
}
|
|
986
1003
|
async* runStream(prompt) {
|
|
987
1004
|
this.aborted = false;
|
|
1005
|
+
const parser = new ClaudeStreamParser;
|
|
988
1006
|
const args = this.buildCliArgs();
|
|
989
1007
|
const env = getAugmentedEnv({
|
|
990
1008
|
FORCE_COLOR: "1",
|
|
@@ -1045,7 +1063,7 @@ class ClaudeRunner {
|
|
|
1045
1063
|
`);
|
|
1046
1064
|
buffer = lines.pop() || "";
|
|
1047
1065
|
for (const line of lines) {
|
|
1048
|
-
const chunk =
|
|
1066
|
+
const chunk = parser.parseLineToChunk(line);
|
|
1049
1067
|
if (chunk) {
|
|
1050
1068
|
if (chunk.type === "result") {
|
|
1051
1069
|
lastResultContent = chunk.content;
|
|
@@ -1154,77 +1172,9 @@ class ClaudeRunner {
|
|
|
1154
1172
|
break;
|
|
1155
1173
|
}
|
|
1156
1174
|
}
|
|
1157
|
-
parseStreamLineToChunk(line) {
|
|
1158
|
-
if (!line.trim())
|
|
1159
|
-
return null;
|
|
1160
|
-
try {
|
|
1161
|
-
const item = JSON.parse(line);
|
|
1162
|
-
return this.processStreamItemToChunk(item);
|
|
1163
|
-
} catch {
|
|
1164
|
-
return null;
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
processStreamItemToChunk(item) {
|
|
1168
|
-
if (item.type === "result") {
|
|
1169
|
-
return { type: "result", content: item.result || "" };
|
|
1170
|
-
}
|
|
1171
|
-
if (item.type === "stream_event" && item.event) {
|
|
1172
|
-
return this.handleEventToChunk(item.event);
|
|
1173
|
-
}
|
|
1174
|
-
return null;
|
|
1175
|
-
}
|
|
1176
|
-
handleEventToChunk(event) {
|
|
1177
|
-
const { type, delta, content_block, index } = event;
|
|
1178
|
-
if (type === "content_block_delta" && delta?.type === "text_delta") {
|
|
1179
|
-
return { type: "text_delta", content: delta.text || "" };
|
|
1180
|
-
}
|
|
1181
|
-
if (type === "content_block_delta" && delta?.type === "input_json_delta" && delta.partial_json !== undefined && index !== undefined) {
|
|
1182
|
-
const activeTool = this.activeTools.get(index);
|
|
1183
|
-
if (activeTool) {
|
|
1184
|
-
activeTool.parameterJson += delta.partial_json;
|
|
1185
|
-
}
|
|
1186
|
-
return null;
|
|
1187
|
-
}
|
|
1188
|
-
if (type === "content_block_start" && content_block) {
|
|
1189
|
-
if (content_block.type === "tool_use" && content_block.name) {
|
|
1190
|
-
if (index !== undefined) {
|
|
1191
|
-
this.activeTools.set(index, {
|
|
1192
|
-
name: content_block.name,
|
|
1193
|
-
id: content_block.id,
|
|
1194
|
-
index,
|
|
1195
|
-
parameterJson: "",
|
|
1196
|
-
startTime: Date.now()
|
|
1197
|
-
});
|
|
1198
|
-
}
|
|
1199
|
-
return {
|
|
1200
|
-
type: "tool_use",
|
|
1201
|
-
tool: content_block.name,
|
|
1202
|
-
id: content_block.id
|
|
1203
|
-
};
|
|
1204
|
-
}
|
|
1205
|
-
if (content_block.type === "thinking") {
|
|
1206
|
-
return { type: "thinking" };
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
if (type === "content_block_stop" && index !== undefined) {
|
|
1210
|
-
const activeTool = this.activeTools.get(index);
|
|
1211
|
-
if (activeTool?.parameterJson) {
|
|
1212
|
-
try {
|
|
1213
|
-
const parameters = JSON.parse(activeTool.parameterJson);
|
|
1214
|
-
return {
|
|
1215
|
-
type: "tool_parameters",
|
|
1216
|
-
tool: activeTool.name,
|
|
1217
|
-
id: activeTool.id,
|
|
1218
|
-
parameters
|
|
1219
|
-
};
|
|
1220
|
-
} catch {}
|
|
1221
|
-
}
|
|
1222
|
-
return null;
|
|
1223
|
-
}
|
|
1224
|
-
return null;
|
|
1225
|
-
}
|
|
1226
1175
|
executeRun(prompt) {
|
|
1227
1176
|
this.aborted = false;
|
|
1177
|
+
const parser = new ClaudeStreamParser;
|
|
1228
1178
|
return new Promise((resolve2, reject) => {
|
|
1229
1179
|
const args = this.buildCliArgs();
|
|
1230
1180
|
const env = getAugmentedEnv({
|
|
@@ -1247,7 +1197,7 @@ class ClaudeRunner {
|
|
|
1247
1197
|
`);
|
|
1248
1198
|
buffer = lines.pop() || "";
|
|
1249
1199
|
for (const line of lines) {
|
|
1250
|
-
const result =
|
|
1200
|
+
const result = parser.parseLine(line, this.log);
|
|
1251
1201
|
if (result)
|
|
1252
1202
|
finalResult = result;
|
|
1253
1203
|
}
|
|
@@ -1288,35 +1238,6 @@ class ClaudeRunner {
|
|
|
1288
1238
|
claude.stdin.end();
|
|
1289
1239
|
});
|
|
1290
1240
|
}
|
|
1291
|
-
handleStreamLine(line) {
|
|
1292
|
-
if (!line.trim())
|
|
1293
|
-
return null;
|
|
1294
|
-
try {
|
|
1295
|
-
const item = JSON.parse(line);
|
|
1296
|
-
return this.processStreamItem(item);
|
|
1297
|
-
} catch {
|
|
1298
|
-
return null;
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
processStreamItem(item) {
|
|
1302
|
-
if (item.type === "result") {
|
|
1303
|
-
return item.result || "";
|
|
1304
|
-
}
|
|
1305
|
-
if (item.type === "stream_event" && item.event) {
|
|
1306
|
-
this.handleEvent(item.event);
|
|
1307
|
-
}
|
|
1308
|
-
return null;
|
|
1309
|
-
}
|
|
1310
|
-
handleEvent(event) {
|
|
1311
|
-
const { type, content_block } = event;
|
|
1312
|
-
if (type === "content_block_start" && content_block) {
|
|
1313
|
-
if (content_block.type === "tool_use" && content_block.name) {
|
|
1314
|
-
this.log?.(`
|
|
1315
|
-
${c.primary("[Claude]")} ${c.bold(`Running ${content_block.name}...`)}
|
|
1316
|
-
`, "info");
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
1241
|
shouldSuppressLine(line) {
|
|
1321
1242
|
const infoLogRegex = /^\[\d{2}:\d{2}:\d{2}\]\s\[.*?\]\sℹ\s*$/;
|
|
1322
1243
|
return infoLogRegex.test(line.trim());
|
|
@@ -1330,8 +1251,8 @@ ${c.primary("[Claude]")} ${c.bold(`Running ${content_block.name}...`)}
|
|
|
1330
1251
|
var import_node_child_process, import_node_path3, DEFAULT_TIMEOUT_MS;
|
|
1331
1252
|
var init_claude_runner = __esm(() => {
|
|
1332
1253
|
init_config();
|
|
1333
|
-
init_colors();
|
|
1334
1254
|
init_resolve_bin();
|
|
1255
|
+
init_claude_stream_parser();
|
|
1335
1256
|
import_node_child_process = require("node:child_process");
|
|
1336
1257
|
import_node_path3 = require("node:path");
|
|
1337
1258
|
DEFAULT_TIMEOUT_MS = 60 * 60 * 1000;
|
|
@@ -1379,7 +1300,7 @@ class CodexRunner {
|
|
|
1379
1300
|
}
|
|
1380
1301
|
if (attempt < maxRetries) {
|
|
1381
1302
|
const delay = Math.pow(2, attempt) * 1000;
|
|
1382
|
-
|
|
1303
|
+
this.log?.(`Codex CLI attempt ${attempt} failed: ${lastError.message}. Retrying in ${delay}ms...`, "warn");
|
|
1383
1304
|
await this.sleep(delay);
|
|
1384
1305
|
}
|
|
1385
1306
|
}
|
|
@@ -1676,6 +1597,20 @@ var init_codex_runner = __esm(() => {
|
|
|
1676
1597
|
});
|
|
1677
1598
|
|
|
1678
1599
|
// src/ai/factory.ts
|
|
1600
|
+
function createWorkerLogger(agentId, prefix) {
|
|
1601
|
+
const tag = prefix ? `${prefix}:${agentId.slice(-8)}` : agentId.slice(-8);
|
|
1602
|
+
return (message, level = "info") => {
|
|
1603
|
+
const timestamp = new Date().toISOString().split("T")[1]?.slice(0, 8) ?? "";
|
|
1604
|
+
const colorFn = {
|
|
1605
|
+
info: c.cyan,
|
|
1606
|
+
success: c.green,
|
|
1607
|
+
warn: c.yellow,
|
|
1608
|
+
error: c.red
|
|
1609
|
+
}[level];
|
|
1610
|
+
const icon = { info: "ℹ", success: "✓", warn: "⚠", error: "✗" }[level];
|
|
1611
|
+
console.log(`${c.dim(`[${timestamp}]`)} ${c.bold(`[${tag}]`)} ${colorFn(`${icon} ${message}`)}`);
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1679
1614
|
function createAiRunner(provider, config) {
|
|
1680
1615
|
const resolvedProvider = provider ?? PROVIDER.CLAUDE;
|
|
1681
1616
|
const model = config.model ?? DEFAULT_MODEL[resolvedProvider];
|
|
@@ -1690,8 +1625,10 @@ function createAiRunner(provider, config) {
|
|
|
1690
1625
|
return new ClaudeRunner(config.projectPath, model, config.log, config.timeoutMs);
|
|
1691
1626
|
}
|
|
1692
1627
|
}
|
|
1628
|
+
var noopLogger = () => {};
|
|
1693
1629
|
var init_factory = __esm(() => {
|
|
1694
1630
|
init_config();
|
|
1631
|
+
init_colors();
|
|
1695
1632
|
init_claude_runner();
|
|
1696
1633
|
init_codex_runner();
|
|
1697
1634
|
});
|
|
@@ -2624,9 +2561,11 @@ class AgentWorker {
|
|
|
2624
2561
|
currentTaskId = null;
|
|
2625
2562
|
completedTaskList = [];
|
|
2626
2563
|
taskSummaries = [];
|
|
2564
|
+
log;
|
|
2627
2565
|
constructor(config) {
|
|
2628
2566
|
this.config = config;
|
|
2629
2567
|
const projectPath = config.projectPath || process.cwd();
|
|
2568
|
+
this.log = createWorkerLogger(config.agentId);
|
|
2630
2569
|
this.client = new LocusClient({
|
|
2631
2570
|
baseUrl: config.apiBase,
|
|
2632
2571
|
token: config.apiKey,
|
|
@@ -2637,7 +2576,6 @@ class AgentWorker {
|
|
|
2637
2576
|
factor: 2
|
|
2638
2577
|
}
|
|
2639
2578
|
});
|
|
2640
|
-
const log = this.log.bind(this);
|
|
2641
2579
|
if (!isGitAvailable()) {
|
|
2642
2580
|
this.log("git is not installed — branch management will not work", "error");
|
|
2643
2581
|
}
|
|
@@ -2648,29 +2586,18 @@ class AgentWorker {
|
|
|
2648
2586
|
this.aiRunner = createAiRunner(provider, {
|
|
2649
2587
|
projectPath,
|
|
2650
2588
|
model: config.model,
|
|
2651
|
-
log,
|
|
2589
|
+
log: this.log,
|
|
2652
2590
|
reasoningEffort: config.reasoningEffort
|
|
2653
2591
|
});
|
|
2654
2592
|
this.taskExecutor = new TaskExecutor({
|
|
2655
2593
|
aiRunner: this.aiRunner,
|
|
2656
2594
|
projectPath,
|
|
2657
|
-
log
|
|
2595
|
+
log: this.log
|
|
2658
2596
|
});
|
|
2659
|
-
this.gitWorkflow = new GitWorkflow(config, log);
|
|
2597
|
+
this.gitWorkflow = new GitWorkflow(config, this.log);
|
|
2660
2598
|
const providerLabel = provider === "codex" ? "Codex" : "Claude";
|
|
2661
2599
|
this.log(`Using ${providerLabel} CLI for all phases`, "info");
|
|
2662
2600
|
}
|
|
2663
|
-
log(message, level = "info") {
|
|
2664
|
-
const timestamp = new Date().toISOString().split("T")[1]?.slice(0, 8) ?? "";
|
|
2665
|
-
const colorFn = {
|
|
2666
|
-
info: c.cyan,
|
|
2667
|
-
success: c.green,
|
|
2668
|
-
warn: c.yellow,
|
|
2669
|
-
error: c.red
|
|
2670
|
-
}[level];
|
|
2671
|
-
const prefix = { info: "ℹ", success: "✓", warn: "⚠", error: "✗" }[level];
|
|
2672
|
-
console.log(`${c.dim(`[${timestamp}]`)} ${c.bold(`[${this.config.agentId.slice(-8)}]`)} ${colorFn(`${prefix} ${message}`)}`);
|
|
2673
|
-
}
|
|
2674
2601
|
async getActiveSprint() {
|
|
2675
2602
|
try {
|
|
2676
2603
|
if (this.config.sprintId) {
|
|
@@ -2846,7 +2773,6 @@ var init_worker = __esm(() => {
|
|
|
2846
2773
|
init_config();
|
|
2847
2774
|
init_git_utils();
|
|
2848
2775
|
init_src();
|
|
2849
|
-
init_colors();
|
|
2850
2776
|
init_git_workflow();
|
|
2851
2777
|
init_task_executor();
|
|
2852
2778
|
import_shared3 = require("@locusai/shared");
|
|
@@ -8,7 +8,6 @@ export declare class ClaudeRunner implements AiRunner {
|
|
|
8
8
|
private projectPath;
|
|
9
9
|
private eventEmitter?;
|
|
10
10
|
private currentToolName?;
|
|
11
|
-
private activeTools;
|
|
12
11
|
private activeProcess;
|
|
13
12
|
private aborted;
|
|
14
13
|
timeoutMs: number;
|
|
@@ -29,13 +28,7 @@ export declare class ClaudeRunner implements AiRunner {
|
|
|
29
28
|
* Emit an event corresponding to a stream chunk.
|
|
30
29
|
*/
|
|
31
30
|
private emitEventForChunk;
|
|
32
|
-
private parseStreamLineToChunk;
|
|
33
|
-
private processStreamItemToChunk;
|
|
34
|
-
private handleEventToChunk;
|
|
35
31
|
private executeRun;
|
|
36
|
-
private handleStreamLine;
|
|
37
|
-
private processStreamItem;
|
|
38
|
-
private handleEvent;
|
|
39
32
|
private shouldSuppressLine;
|
|
40
33
|
private createExecutionError;
|
|
41
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/ai/claude-runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/ai/claude-runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,qBAAa,YAAa,YAAW,QAAQ;IAUzC,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG,CAAC;IAVd,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAC,CAAmB;IACxC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,OAAO,CAAS;IACxB,SAAS,EAAE,MAAM,CAAC;gBAGhB,WAAW,EAAE,MAAM,EACX,KAAK,GAAE,MAAuC,EAC9C,GAAG,CAAC,EAAE,KAAK,YAAA,EACnB,SAAS,CAAC,EAAE,MAAM;IAMpB;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAIhD;;OAEG;IACH,KAAK,IAAI,IAAI;IAQP,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA+B1C,OAAO,CAAC,WAAW;IA0BnB,OAAO,CAAC,YAAY;IAgBb,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC;IA6K5E;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAiCzB,OAAO,CAAC,UAAU;IAkFlB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,oBAAoB;CAO7B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { StreamChunk } from "../exec/types.js";
|
|
2
|
+
import type { LogFn } from "./factory.js";
|
|
3
|
+
export interface ClaudeStreamItem {
|
|
4
|
+
type: string;
|
|
5
|
+
result?: string;
|
|
6
|
+
event?: {
|
|
7
|
+
type: string;
|
|
8
|
+
index?: number;
|
|
9
|
+
delta?: {
|
|
10
|
+
type: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
partial_json?: string;
|
|
13
|
+
};
|
|
14
|
+
content_block?: {
|
|
15
|
+
type: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parses Claude CLI stream-json output into typed StreamChunks.
|
|
23
|
+
* Handles both streaming mode (returns StreamChunk) and
|
|
24
|
+
* non-streaming mode (returns result string).
|
|
25
|
+
*/
|
|
26
|
+
export declare class ClaudeStreamParser {
|
|
27
|
+
private activeTools;
|
|
28
|
+
/**
|
|
29
|
+
* Parse a stream-json line into a StreamChunk (for streaming mode).
|
|
30
|
+
*/
|
|
31
|
+
parseLineToChunk(line: string): StreamChunk | null;
|
|
32
|
+
/**
|
|
33
|
+
* Parse a stream-json line and extract the final result string (for non-streaming mode).
|
|
34
|
+
*/
|
|
35
|
+
parseLine(line: string, log?: LogFn): string | null;
|
|
36
|
+
private processItemToChunk;
|
|
37
|
+
private handleEventToChunk;
|
|
38
|
+
private processItem;
|
|
39
|
+
private handleEvent;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=claude-stream-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-stream-parser.d.ts","sourceRoot":"","sources":["../../src/ai/claude-stream-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAEhE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE;YACN,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,YAAY,CAAC,EAAE,MAAM,CAAC;SACvB,CAAC;QACF,aAAa,CAAC,EAAE;YACd,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,EAAE,CAAC,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC;CACH;AAaD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAA+C;IAElE;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAWlD;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI;IAWnD,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,kBAAkB;IAwE1B,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,WAAW;CAYpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-runner.d.ts","sourceRoot":"","sources":["../../src/ai/codex-runner.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,qBAAa,WAAY,YAAW,QAAQ;IAQxC,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG,CAAC;IACZ,OAAO,CAAC,eAAe,CAAC;IAV1B,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAC,CAAmB;IACxC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,SAAS,EAAE,MAAM,CAAC;gBAGR,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,MAAsC,EAC7C,GAAG,CAAC,EAAE,KAAK,YAAA,EACX,eAAe,CAAC,EAAE,MAAM,YAAA,EAChC,SAAS,CAAC,EAAE,MAAM;IAKpB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAIhD;;OAEG;IACH,KAAK,IAAI,IAAI;IAQP,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-runner.d.ts","sourceRoot":"","sources":["../../src/ai/codex-runner.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,qBAAa,WAAY,YAAW,QAAQ;IAQxC,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG,CAAC;IACZ,OAAO,CAAC,eAAe,CAAC;IAV1B,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAC,CAAmB;IACxC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,SAAS,EAAE,MAAM,CAAC;gBAGR,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,MAAsC,EAC7C,GAAG,CAAC,EAAE,KAAK,YAAA,EACX,eAAe,CAAC,EAAE,MAAM,YAAA,EAChC,SAAS,CAAC,EAAE,MAAM;IAKpB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAIhD;;OAEG;IACH,KAAK,IAAI,IAAI;IAQP,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA8B1C,OAAO,CAAC,WAAW;IA0BZ,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC;IA8J5E,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,UAAU;IAyDlB,OAAO,CAAC,SAAS;IAqBjB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,KAAK;CAGd"}
|
package/dist/ai/factory.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { AiProvider, AiRunner } from "./runner.js";
|
|
2
2
|
export type LogFn = (message: string, level?: "info" | "success" | "warn" | "error") => void;
|
|
3
|
+
/**
|
|
4
|
+
* Silent no-op logger. Use as default when logging is optional.
|
|
5
|
+
*/
|
|
6
|
+
export declare const noopLogger: LogFn;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a worker-style logger with timestamps and agent ID prefix.
|
|
9
|
+
* Used by SDK agent workers for structured log output.
|
|
10
|
+
*
|
|
11
|
+
* Output format: `[HH:mm:ss] [agent-id] ℹ message`
|
|
12
|
+
*/
|
|
13
|
+
export declare function createWorkerLogger(agentId: string, prefix?: string): LogFn;
|
|
3
14
|
export interface AiRunnerConfig {
|
|
4
15
|
projectPath: string;
|
|
5
16
|
model?: string;
|