@locusai/sdk 0.9.18 → 0.10.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/git-workflow.d.ts +44 -0
- package/dist/agent/git-workflow.d.ts.map +1 -0
- package/dist/agent/index.d.ts +2 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/reviewer-worker.d.ts.map +1 -1
- package/dist/agent/worker-cli.d.ts +6 -0
- package/dist/agent/worker-cli.d.ts.map +1 -0
- package/dist/agent/worker-types.d.ts +44 -0
- package/dist/agent/worker-types.d.ts.map +1 -0
- package/dist/agent/worker.d.ts +12 -48
- package/dist/agent/worker.d.ts.map +1 -1
- package/dist/agent/worker.js +1026 -847
- package/dist/ai/claude-runner.d.ts.map +1 -1
- package/dist/index-node.d.ts +1 -1
- package/dist/index-node.d.ts.map +1 -1
- package/dist/index-node.js +1660 -1133
- package/dist/index.js +363 -316
- package/dist/orchestrator/agent-pool.d.ts +59 -0
- package/dist/orchestrator/agent-pool.d.ts.map +1 -0
- package/dist/orchestrator/execution.d.ts +55 -0
- package/dist/orchestrator/execution.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts +91 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/tier-merge.d.ts +50 -0
- package/dist/orchestrator/tier-merge.d.ts.map +1 -0
- package/dist/orchestrator/types.d.ts +45 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/planning/agents/cross-task-reviewer.d.ts.map +1 -1
- package/dist/planning/agents/sprint-organizer.d.ts.map +1 -1
- package/dist/planning/plan-manager.d.ts.map +1 -1
- package/dist/planning/sprint-plan.d.ts +2 -0
- package/dist/planning/sprint-plan.d.ts.map +1 -1
- package/dist/project/knowledge-base.d.ts +4 -5
- package/dist/project/knowledge-base.d.ts.map +1 -1
- package/dist/utils/resolve-bin.d.ts +3 -0
- package/dist/utils/resolve-bin.d.ts.map +1 -1
- package/dist/worktree/worktree-manager.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/orchestrator.d.ts +0 -124
- package/dist/orchestrator.d.ts.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
import type { AgentState, OrchestratorConfig } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Manages the lifecycle of agent worker processes.
|
|
5
|
+
*
|
|
6
|
+
* Responsibilities:
|
|
7
|
+
* - Spawning agent processes with correct CLI args
|
|
8
|
+
* - Tracking agent state (idle, working, completed, failed)
|
|
9
|
+
* - Heartbeat monitoring for stale agent detection
|
|
10
|
+
* - Graceful shutdown and process tree cleanup
|
|
11
|
+
*/
|
|
12
|
+
export declare class AgentPool extends EventEmitter {
|
|
13
|
+
private config;
|
|
14
|
+
private agents;
|
|
15
|
+
private heartbeatInterval;
|
|
16
|
+
constructor(config: OrchestratorConfig);
|
|
17
|
+
get size(): number;
|
|
18
|
+
get effectiveAgentCount(): number;
|
|
19
|
+
getAll(): AgentState[];
|
|
20
|
+
get(agentId: string): AgentState | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Spawn a single agent worker process.
|
|
23
|
+
*
|
|
24
|
+
* Each worker manages its own per-task worktrees internally.
|
|
25
|
+
* The optional `baseBranch` tells the worker which branch to use
|
|
26
|
+
* as the starting point for worktree creation and PR targeting
|
|
27
|
+
* (used in tier-based and legacy execution).
|
|
28
|
+
*/
|
|
29
|
+
spawn(index: number, resolvedSprintId: string | null, baseBranch?: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Wait for all active agent processes to finish.
|
|
32
|
+
*/
|
|
33
|
+
waitForAll(isRunning: () => boolean): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Start monitoring agent heartbeats for stale detection.
|
|
36
|
+
*/
|
|
37
|
+
startHeartbeatMonitor(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Stop a specific agent by ID.
|
|
40
|
+
*/
|
|
41
|
+
stopAgent(agentId: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Kill all agent processes and stop the heartbeat monitor.
|
|
44
|
+
*/
|
|
45
|
+
shutdown(): void;
|
|
46
|
+
getStats(): {
|
|
47
|
+
activeAgents: number;
|
|
48
|
+
agentCount: number;
|
|
49
|
+
totalTasksCompleted: number;
|
|
50
|
+
totalTasksFailed: number;
|
|
51
|
+
};
|
|
52
|
+
private buildWorkerArgs;
|
|
53
|
+
private attachProcessHandlers;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the worker script path from the SDK module location.
|
|
56
|
+
*/
|
|
57
|
+
private resolveWorkerPath;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=agent-pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-pool.d.ts","sourceRoot":"","sources":["../../src/orchestrator/agent-pool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIjE;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,YAAY;IAI7B,OAAO,CAAC,MAAM;IAH1B,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,iBAAiB,CAA+C;gBAEpD,MAAM,EAAE,kBAAkB;IAI9C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED,MAAM,IAAI,UAAU,EAAE;IAItB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI5C;;;;;;;OAOG;IACG,KAAK,CACT,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAgDhB;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAMzD;;OAEG;IACH,qBAAqB,IAAI,IAAI;IAsB7B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IASnC;;OAEG;IACH,QAAQ,IAAI,IAAI;IAgBhB,QAAQ;;;;;;IAeR,OAAO,CAAC,eAAe;IAwCvB,OAAO,CAAC,qBAAqB;IAyC7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAe1B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Task } from "@locusai/shared";
|
|
2
|
+
import type { AgentPool } from "./agent-pool.js";
|
|
3
|
+
import type { TierMergeService } from "./tier-merge.js";
|
|
4
|
+
import type { OrchestratorConfig } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Orchestrates how tasks are dispatched to agents.
|
|
7
|
+
*
|
|
8
|
+
* Two execution strategies:
|
|
9
|
+
* - **Tier-based**: Tasks grouped by tier; each tier runs in parallel,
|
|
10
|
+
* tiers execute sequentially with stacked branching.
|
|
11
|
+
* - **Legacy**: All tasks dispatched to agents in parallel on separate
|
|
12
|
+
* branches from the default branch.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ExecutionStrategy {
|
|
15
|
+
private config;
|
|
16
|
+
private pool;
|
|
17
|
+
private tierMerge;
|
|
18
|
+
private resolvedSprintId;
|
|
19
|
+
private isRunning;
|
|
20
|
+
constructor(config: OrchestratorConfig, pool: AgentPool, tierMerge: TierMergeService, resolvedSprintId: string | null, isRunning: () => boolean);
|
|
21
|
+
/**
|
|
22
|
+
* Determine the execution strategy and run tasks.
|
|
23
|
+
*/
|
|
24
|
+
execute(tasks: Task[]): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Tier-based execution: run tasks tier-by-tier with stacked branching.
|
|
27
|
+
*
|
|
28
|
+
* Tier 0 branches from main. After tier 0 completes, a merge branch
|
|
29
|
+
* is created. Tier 1 branches from that merge branch, and so on.
|
|
30
|
+
*
|
|
31
|
+
* ```
|
|
32
|
+
* main
|
|
33
|
+
* ├── agent/task-A (tier 0)
|
|
34
|
+
* ├── agent/task-B (tier 0)
|
|
35
|
+
* ├── locus/tier-0 (merge of A + B)
|
|
36
|
+
* │ ├── agent/task-C (tier 1)
|
|
37
|
+
* │ ├── agent/task-D (tier 1)
|
|
38
|
+
* │ ├── locus/tier-1 (merge of C + D)
|
|
39
|
+
* │ │ └── agent/task-E (tier 2)
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
private tierBasedExecution;
|
|
43
|
+
/**
|
|
44
|
+
* Legacy execution: all tasks dispatched in parallel on separate branches.
|
|
45
|
+
*
|
|
46
|
+
* Each agent creates a worktree branching from the default branch.
|
|
47
|
+
* All task PRs target the default branch directly.
|
|
48
|
+
*/
|
|
49
|
+
private legacyExecution;
|
|
50
|
+
/**
|
|
51
|
+
* Spawn a batch of agents with staggered delays.
|
|
52
|
+
*/
|
|
53
|
+
private spawnAgentsForTasks;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/orchestrator/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKrD;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;gBAJT,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,gBAAgB,EAC3B,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,SAAS,EAAE,MAAM,OAAO;IAGlC;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAW3C;;;;;;;;;;;;;;;;OAgBG;YACW,kBAAkB;IA+DhC;;;;;OAKG;YACW,eAAe;IAM7B;;OAEG;YACW,mBAAmB;CAgBlC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type Task } from "@locusai/shared";
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import type { AgentConfig, AgentState, OrchestratorConfig } from "./types.js";
|
|
4
|
+
export type { AgentConfig, AgentState, OrchestratorConfig };
|
|
5
|
+
/**
|
|
6
|
+
* Top-level orchestrator that coordinates task execution across agents.
|
|
7
|
+
*
|
|
8
|
+
* Delegates to:
|
|
9
|
+
* - `AgentPool` — spawning and managing agent worker processes
|
|
10
|
+
* - `TierMergeService` — creating stacked merge branches between tiers
|
|
11
|
+
* - `ExecutionStrategy` — choosing and running the tier-based or legacy execution flow
|
|
12
|
+
*
|
|
13
|
+
* The orchestrator itself handles:
|
|
14
|
+
* - Sprint resolution
|
|
15
|
+
* - Task fetching and assignment
|
|
16
|
+
* - Worktree cleanup on shutdown
|
|
17
|
+
* - Event emission for CLI consumers
|
|
18
|
+
*/
|
|
19
|
+
export declare class AgentOrchestrator extends EventEmitter {
|
|
20
|
+
private client;
|
|
21
|
+
private config;
|
|
22
|
+
private pool;
|
|
23
|
+
private isRunning;
|
|
24
|
+
private processedTasks;
|
|
25
|
+
private resolvedSprintId;
|
|
26
|
+
private worktreeManager;
|
|
27
|
+
constructor(config: OrchestratorConfig);
|
|
28
|
+
private get useWorktrees();
|
|
29
|
+
private get worktreeCleanupPolicy();
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the sprint ID — use provided or find active sprint.
|
|
32
|
+
*/
|
|
33
|
+
private resolveSprintId;
|
|
34
|
+
/**
|
|
35
|
+
* Start the orchestrator with N agents.
|
|
36
|
+
*/
|
|
37
|
+
start(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Main orchestration loop.
|
|
40
|
+
*
|
|
41
|
+
* 1. Resolves sprint, fetches tasks, runs pre-flight checks
|
|
42
|
+
* 2. Delegates to `ExecutionStrategy` for the actual dispatch
|
|
43
|
+
*/
|
|
44
|
+
private orchestrationLoop;
|
|
45
|
+
private printBanner;
|
|
46
|
+
private preflightChecks;
|
|
47
|
+
/**
|
|
48
|
+
* Get available tasks in sprint.
|
|
49
|
+
*/
|
|
50
|
+
private getAvailableTasks;
|
|
51
|
+
/**
|
|
52
|
+
* Assign task to agent.
|
|
53
|
+
*/
|
|
54
|
+
assignTaskToAgent(agentId: string): Promise<Task | null>;
|
|
55
|
+
/**
|
|
56
|
+
* Mark task as completed by agent.
|
|
57
|
+
*/
|
|
58
|
+
completeTask(taskId: string, agentId: string, summary?: string): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Mark task as failed.
|
|
61
|
+
*/
|
|
62
|
+
failTask(taskId: string, agentId: string, error: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Stop orchestrator.
|
|
65
|
+
*/
|
|
66
|
+
stop(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Stop a specific agent by ID.
|
|
69
|
+
*/
|
|
70
|
+
stopAgent(agentId: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Cleanup — kill all agent processes and worktrees.
|
|
73
|
+
*/
|
|
74
|
+
private cleanup;
|
|
75
|
+
/**
|
|
76
|
+
* Get orchestrator stats.
|
|
77
|
+
*/
|
|
78
|
+
getStats(): {
|
|
79
|
+
useWorktrees: boolean;
|
|
80
|
+
processedTasks: number;
|
|
81
|
+
activeAgents: number;
|
|
82
|
+
agentCount: number;
|
|
83
|
+
totalTasksCompleted: number;
|
|
84
|
+
totalTasksFailed: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Get all agent states for status display.
|
|
88
|
+
*/
|
|
89
|
+
getAgentStates(): AgentState[];
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAA4B,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAStC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAG9E,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,eAAe,CAAgC;gBAE3C,MAAM,EAAE,kBAAkB;IAiBtC,OAAO,KAAK,YAAY,GAEvB;IAED,OAAO,KAAK,qBAAqB,GAEhC;IAED;;OAEG;YACW,eAAe;IAuB7B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B;;;;;OAKG;YACW,iBAAiB;IAoD/B,OAAO,CAAC,WAAW;IAqBnB,OAAO,CAAC,eAAe;IAqBvB;;OAEG;YACW,iBAAiB;IAa/B;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAyC9D;;OAEG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IA4BhB;;OAEG;IACG,QAAQ,CACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;IAyBhB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAInC;;OAEG;YACW,OAAO;IA4BrB;;OAEG;IACH,QAAQ;;;;;;;;IASR;;OAEG;IACH,cAAc,IAAI,UAAU,EAAE;CAG/B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manages git operations for tier-based branch merging.
|
|
3
|
+
*
|
|
4
|
+
* After a tier of tasks completes, this service:
|
|
5
|
+
* 1. Finds all pushed task branches belonging to the tier
|
|
6
|
+
* 2. Creates a merge branch that combines them (octopus merge)
|
|
7
|
+
* 3. Pushes the merge branch to remote
|
|
8
|
+
*
|
|
9
|
+
* The resulting merge branch becomes the base for the next tier.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TierMergeService {
|
|
12
|
+
private projectPath;
|
|
13
|
+
private sprintId;
|
|
14
|
+
/** Map of tier number -> task IDs for branch matching */
|
|
15
|
+
private tierTaskIds;
|
|
16
|
+
constructor(projectPath: string, sprintId: string | null);
|
|
17
|
+
/**
|
|
18
|
+
* Register task IDs for a tier so we can match branches later.
|
|
19
|
+
*/
|
|
20
|
+
registerTierTasks(tasks: Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
tier?: number | null;
|
|
23
|
+
}>): void;
|
|
24
|
+
/**
|
|
25
|
+
* Build the merge branch name for a tier.
|
|
26
|
+
* Includes sprint ID suffix to avoid collisions between sprints.
|
|
27
|
+
*/
|
|
28
|
+
tierBranchName(tier: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* Check if a branch exists on the remote.
|
|
31
|
+
*/
|
|
32
|
+
remoteBranchExists(branch: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Create a merge branch that combines all completed task branches for a tier.
|
|
35
|
+
*
|
|
36
|
+
* The merge branch (`locus/tier-N`) starts from the base branch and
|
|
37
|
+
* sequentially merges all task branches from the completed tier.
|
|
38
|
+
* This branch is then pushed to remote so the next tier can use it as a base.
|
|
39
|
+
*
|
|
40
|
+
* Returns the merge branch name, or null if creation failed.
|
|
41
|
+
*/
|
|
42
|
+
createMergeBranch(tier: number, baseBranch: string): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Find remote branches that belong to a specific tier's tasks.
|
|
45
|
+
* Matches against registered task IDs by checking branch names.
|
|
46
|
+
*/
|
|
47
|
+
private findTierTaskBranches;
|
|
48
|
+
private gitExec;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=tier-merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier-merge.d.ts","sourceRoot":"","sources":["../../src/orchestrator/tier-merge.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,QAAQ;IALlB,yDAAyD;IACzD,OAAO,CAAC,WAAW,CAAoC;gBAG7C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GAAG,IAAI;IAGjC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI;IAY3E;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKpC;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAiB3C;;;;;;;;OAQG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA0ElE;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAkC5B,OAAO,CAAC,OAAO;CAOhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ChildProcess } from "node:child_process";
|
|
2
|
+
import type { AiProvider } from "../ai/runner.js";
|
|
3
|
+
import type { WorktreeCleanupPolicy } from "../worktree/worktree-config.js";
|
|
4
|
+
export interface AgentConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
maxConcurrentTasks: number;
|
|
7
|
+
}
|
|
8
|
+
export interface AgentState {
|
|
9
|
+
id: string;
|
|
10
|
+
status: "IDLE" | "WORKING" | "COMPLETED" | "FAILED";
|
|
11
|
+
currentTaskId: string | null;
|
|
12
|
+
tasksCompleted: number;
|
|
13
|
+
tasksFailed: number;
|
|
14
|
+
lastHeartbeat: Date;
|
|
15
|
+
process?: ChildProcess;
|
|
16
|
+
worktreePath?: string;
|
|
17
|
+
worktreeBranch?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface OrchestratorConfig {
|
|
20
|
+
/** Workspace ID */
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
/** Sprint ID */
|
|
23
|
+
sprintId: string;
|
|
24
|
+
/** API base URL */
|
|
25
|
+
apiBase: string;
|
|
26
|
+
/** Maximum number of iterations to run */
|
|
27
|
+
maxIterations: number;
|
|
28
|
+
/** Path to the project */
|
|
29
|
+
projectPath: string;
|
|
30
|
+
/** API key */
|
|
31
|
+
apiKey: string;
|
|
32
|
+
/** AI model (e.g. opus, sonnet, gpt-5.3-codex.) */
|
|
33
|
+
model?: string;
|
|
34
|
+
/** AI provider (e.g. codex, claude, etc.) */
|
|
35
|
+
provider?: AiProvider;
|
|
36
|
+
/** Number of agents to spawn */
|
|
37
|
+
agentCount?: number;
|
|
38
|
+
/** Whether to use worktrees for each agent */
|
|
39
|
+
useWorktrees?: boolean;
|
|
40
|
+
/** Worktree management */
|
|
41
|
+
worktreeCleanupPolicy?: WorktreeCleanupPolicy;
|
|
42
|
+
/** Whether to push agent branches to remote after committing */
|
|
43
|
+
autoPush?: boolean;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/orchestrator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IACpD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc;IACd,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0BAA0B;IAC1B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-task-reviewer.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/cross-task-reviewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,sBAAsB,GAC5B,MAAM,
|
|
1
|
+
{"version":3,"file":"cross-task-reviewer.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/cross-task-reviewer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,sBAAsB,GAC5B,MAAM,CA6HR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprint-organizer.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/sprint-organizer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,oBAAoB,GAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"sprint-organizer.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/sprint-organizer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,oBAAoB,GAC1B,MAAM,CAwFR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-manager.d.ts","sourceRoot":"","sources":["../../src/planning/plan-manager.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,qBAAa,WAAW;IAGV,OAAO,CAAC,WAAW;IAF/B,OAAO,CAAC,QAAQ,CAAS;gBAEL,WAAW,EAAE,MAAM;IAIvC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAa9B;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAoBzC;;OAEG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,EAAE;IA4BjD;;;OAGG;IACG,OAAO,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"plan-manager.d.ts","sourceRoot":"","sources":["../../src/planning/plan-manager.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAEL,KAAK,UAAU,EAEhB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,qBAAa,WAAW;IAGV,OAAO,CAAC,WAAW;IAF/B,OAAO,CAAC,QAAQ,CAAS;gBAEL,WAAW,EAAE,MAAM;IAIvC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAa9B;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAoBzC;;OAEG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,EAAE;IA4BjD;;;OAGG;IACG,OAAO,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC;IA+C7C;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU;IAmBtD;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAW9B;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IA6B9B;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAM5C,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,OAAO;CAMhB"}
|
|
@@ -10,6 +10,8 @@ export interface PlannedTask {
|
|
|
10
10
|
complexity: number;
|
|
11
11
|
acceptanceCriteria: string[];
|
|
12
12
|
labels: string[];
|
|
13
|
+
/** Execution tier (0 = foundational, higher = depends on lower tiers) */
|
|
14
|
+
tier: number;
|
|
13
15
|
}
|
|
14
16
|
export interface SprintPlanRisk {
|
|
15
17
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprint-plan.d.ts","sourceRoot":"","sources":["../../src/planning/sprint-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"sprint-plan.d.ts","sourceRoot":"","sources":["../../src/planning/sprint-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CA8E7D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,UAAU,EAAE,CAiBd;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,UAAU,CA2CZ"}
|
|
@@ -3,10 +3,9 @@ export interface ProjectInfo {
|
|
|
3
3
|
mission: string;
|
|
4
4
|
techStack: string[];
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
details?: string;
|
|
6
|
+
export interface ProgressEntry {
|
|
7
|
+
role: "user" | "assistant";
|
|
8
|
+
content: string;
|
|
10
9
|
timestamp?: Date;
|
|
11
10
|
}
|
|
12
11
|
export declare class KnowledgeBase {
|
|
@@ -16,7 +15,7 @@ export declare class KnowledgeBase {
|
|
|
16
15
|
readContext(): string;
|
|
17
16
|
readProgress(): string;
|
|
18
17
|
updateContext(content: string): void;
|
|
19
|
-
updateProgress(
|
|
18
|
+
updateProgress(entry: ProgressEntry): void;
|
|
20
19
|
getFullContext(): string;
|
|
21
20
|
initialize(info: ProjectInfo): void;
|
|
22
21
|
get exists(): boolean;
|
|
@@ -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,
|
|
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"}
|
|
@@ -7,6 +7,9 @@ export declare function getAugmentedPath(): string;
|
|
|
7
7
|
* Returns a copy of the current process.env with an augmented PATH.
|
|
8
8
|
* Use this when spawning CLI tools (claude, codex) to ensure they
|
|
9
9
|
* can be found even when running from restricted environments.
|
|
10
|
+
*
|
|
11
|
+
* Strips environment variables that interfere with spawned CLI
|
|
12
|
+
* processes (e.g. CLAUDECODE which triggers nested-session guards).
|
|
10
13
|
*/
|
|
11
14
|
export declare function getAugmentedEnv(overrides?: Record<string, string>): NodeJS.ProcessEnv;
|
|
12
15
|
//# sourceMappingURL=resolve-bin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-bin.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-bin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-bin.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-bin.ts"],"names":[],"mappings":"AA4GA;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CA2BzC;AASD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACrC,MAAM,CAAC,UAAU,CAYnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-manager.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,GAAG,CAAQ;gBAGjB,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAChC,GAAG,CAAC,EAAE,KAAK;IAOb;;OAEG;IACH,OAAO,KAAK,QAAQ,GAEnB;IAED;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAUzD;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB;
|
|
1
|
+
{"version":3,"file":"worktree-manager.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAEzB,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,GAAG,CAAQ;gBAGjB,WAAW,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAChC,GAAG,CAAC,EAAE,KAAK;IAOb;;OAEG;IACH,OAAO,KAAK,QAAQ,GAEnB;IAED;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAUzD;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB;IAyG5D;;;OAGG;IACH,IAAI,IAAI,YAAY,EAAE;IA+CtB;;OAEG;IACH,kBAAkB,IAAI,YAAY,EAAE;IAIpC;;OAEG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,UAAO,GAAG,IAAI;IAsCvD;;OAEG;IACH,KAAK,IAAI,MAAM;IAmBf;;;OAGG;IACH,SAAS,IAAI,MAAM;IAyBnB;;OAEG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAKzC;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAYlE;;;;;;;;OAQG;IACH,aAAa,CACX,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI;IAgChB;;;;OAIG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,SAAW,GAAG,MAAM;IAoC3D;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAM3C;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,yBAAyB;IASjC;;OAEG;IACH,OAAO,CAAC,GAAG;IAQX;;OAEG;IACH,OAAO,CAAC,OAAO;CAOhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.2",
|
|
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.
|
|
33
|
+
"@locusai/shared": "^0.10.2",
|
|
34
34
|
"axios": "^1.13.2",
|
|
35
35
|
"events": "^3.3.0",
|
|
36
36
|
"globby": "^14.0.2"
|
package/dist/orchestrator.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { ChildProcess } from "node:child_process";
|
|
2
|
-
import { Task } from "@locusai/shared";
|
|
3
|
-
import { EventEmitter } from "events";
|
|
4
|
-
import type { AiProvider } from "./ai/runner.js";
|
|
5
|
-
import type { WorktreeCleanupPolicy } from "./worktree/worktree-config.js";
|
|
6
|
-
export interface AgentConfig {
|
|
7
|
-
id: string;
|
|
8
|
-
maxConcurrentTasks: number;
|
|
9
|
-
}
|
|
10
|
-
export interface AgentState {
|
|
11
|
-
id: string;
|
|
12
|
-
status: "IDLE" | "WORKING" | "COMPLETED" | "FAILED";
|
|
13
|
-
currentTaskId: string | null;
|
|
14
|
-
tasksCompleted: number;
|
|
15
|
-
tasksFailed: number;
|
|
16
|
-
lastHeartbeat: Date;
|
|
17
|
-
process?: ChildProcess;
|
|
18
|
-
worktreePath?: string;
|
|
19
|
-
worktreeBranch?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface OrchestratorConfig {
|
|
22
|
-
workspaceId: string;
|
|
23
|
-
sprintId: string;
|
|
24
|
-
apiBase: string;
|
|
25
|
-
maxIterations: number;
|
|
26
|
-
projectPath: string;
|
|
27
|
-
apiKey: string;
|
|
28
|
-
model?: string;
|
|
29
|
-
provider?: AiProvider;
|
|
30
|
-
agentCount?: number;
|
|
31
|
-
useWorktrees?: boolean;
|
|
32
|
-
worktreeCleanupPolicy?: WorktreeCleanupPolicy;
|
|
33
|
-
/** Whether to push agent branches to remote after committing */
|
|
34
|
-
autoPush?: boolean;
|
|
35
|
-
}
|
|
36
|
-
export declare class AgentOrchestrator extends EventEmitter {
|
|
37
|
-
private client;
|
|
38
|
-
private config;
|
|
39
|
-
private agents;
|
|
40
|
-
private isRunning;
|
|
41
|
-
private processedTasks;
|
|
42
|
-
private resolvedSprintId;
|
|
43
|
-
private worktreeManager;
|
|
44
|
-
private heartbeatInterval;
|
|
45
|
-
constructor(config: OrchestratorConfig);
|
|
46
|
-
private get agentCount();
|
|
47
|
-
private get useWorktrees();
|
|
48
|
-
private get worktreeCleanupPolicy();
|
|
49
|
-
/**
|
|
50
|
-
* Resolve the sprint ID - use provided or find active sprint
|
|
51
|
-
*/
|
|
52
|
-
private resolveSprintId;
|
|
53
|
-
/**
|
|
54
|
-
* Start the orchestrator with N agents
|
|
55
|
-
*/
|
|
56
|
-
start(): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Main orchestration loop - spawns N agents and monitors them
|
|
59
|
-
*/
|
|
60
|
-
private orchestrationLoop;
|
|
61
|
-
/**
|
|
62
|
-
* Spawn a single agent process. Each agent manages its own per-task worktrees.
|
|
63
|
-
*/
|
|
64
|
-
private spawnAgent;
|
|
65
|
-
/**
|
|
66
|
-
* Resolve the worker script path from the SDK module location
|
|
67
|
-
*/
|
|
68
|
-
private resolveWorkerPath;
|
|
69
|
-
/**
|
|
70
|
-
* Start monitoring agent heartbeats for stale detection
|
|
71
|
-
*/
|
|
72
|
-
private startHeartbeatMonitor;
|
|
73
|
-
/**
|
|
74
|
-
* Get available tasks in sprint
|
|
75
|
-
*/
|
|
76
|
-
private getAvailableTasks;
|
|
77
|
-
/**
|
|
78
|
-
* Assign task to agent
|
|
79
|
-
*/
|
|
80
|
-
assignTaskToAgent(agentId: string): Promise<Task | null>;
|
|
81
|
-
/**
|
|
82
|
-
* Mark task as completed by agent
|
|
83
|
-
*/
|
|
84
|
-
completeTask(taskId: string, agentId: string, summary?: string): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Mark task as failed
|
|
87
|
-
*/
|
|
88
|
-
failTask(taskId: string, agentId: string, error: string): Promise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* Stop orchestrator
|
|
91
|
-
*/
|
|
92
|
-
stop(): Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* Stop a specific agent by ID
|
|
95
|
-
*/
|
|
96
|
-
stopAgent(agentId: string): boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Kill a process and all its descendants.
|
|
99
|
-
* Sends SIGTERM first to allow graceful shutdown, which triggers the worker's
|
|
100
|
-
* signal handler to abort the active Claude/Codex CLI process.
|
|
101
|
-
*/
|
|
102
|
-
private killProcessTree;
|
|
103
|
-
/**
|
|
104
|
-
* Cleanup - kill all agent processes and worktrees
|
|
105
|
-
*/
|
|
106
|
-
private cleanup;
|
|
107
|
-
/**
|
|
108
|
-
* Get orchestrator stats
|
|
109
|
-
*/
|
|
110
|
-
getStats(): {
|
|
111
|
-
activeAgents: number;
|
|
112
|
-
agentCount: number;
|
|
113
|
-
useWorktrees: boolean;
|
|
114
|
-
processedTasks: number;
|
|
115
|
-
totalTasksCompleted: number;
|
|
116
|
-
totalTasksFailed: number;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Get all agent states for status display
|
|
120
|
-
*/
|
|
121
|
-
getAgentStates(): AgentState[];
|
|
122
|
-
private sleep;
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"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"}
|