@locusai/sdk 0.10.5 → 0.11.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.
Files changed (43) hide show
  1. package/dist/agent/git-workflow.d.ts +37 -23
  2. package/dist/agent/git-workflow.d.ts.map +1 -1
  3. package/dist/agent/worker-cli.d.ts.map +1 -1
  4. package/dist/agent/worker-types.d.ts +0 -10
  5. package/dist/agent/worker-types.d.ts.map +1 -1
  6. package/dist/agent/worker.d.ts +8 -8
  7. package/dist/agent/worker.d.ts.map +1 -1
  8. package/dist/agent/worker.js +255 -802
  9. package/dist/ai/codex-runner.d.ts.map +1 -1
  10. package/dist/core/config.d.ts +1 -1
  11. package/dist/core/config.d.ts.map +1 -1
  12. package/dist/index-node.d.ts +0 -1
  13. package/dist/index-node.d.ts.map +1 -1
  14. package/dist/index-node.js +783 -1532
  15. package/dist/orchestrator/agent-pool.d.ts +1 -58
  16. package/dist/orchestrator/agent-pool.d.ts.map +1 -1
  17. package/dist/orchestrator/execution.d.ts +1 -54
  18. package/dist/orchestrator/execution.d.ts.map +1 -1
  19. package/dist/orchestrator/index.d.ts +25 -31
  20. package/dist/orchestrator/index.d.ts.map +1 -1
  21. package/dist/orchestrator/tier-merge.d.ts +1 -49
  22. package/dist/orchestrator/tier-merge.d.ts.map +1 -1
  23. package/dist/orchestrator/types.d.ts +0 -11
  24. package/dist/orchestrator/types.d.ts.map +1 -1
  25. package/dist/planning/agents/architect.d.ts.map +1 -1
  26. package/dist/planning/agents/cross-task-reviewer.d.ts +2 -6
  27. package/dist/planning/agents/cross-task-reviewer.d.ts.map +1 -1
  28. package/dist/planning/agents/sprint-organizer.d.ts +1 -1
  29. package/dist/planning/agents/sprint-organizer.d.ts.map +1 -1
  30. package/dist/planning/agents/tech-lead.d.ts.map +1 -1
  31. package/dist/planning/sprint-plan.d.ts +0 -2
  32. package/dist/planning/sprint-plan.d.ts.map +1 -1
  33. package/dist/worktree/index.d.ts +1 -2
  34. package/dist/worktree/index.d.ts.map +1 -1
  35. package/dist/worktree/worktree-config.d.ts +1 -59
  36. package/dist/worktree/worktree-config.d.ts.map +1 -1
  37. package/dist/worktree/worktree-manager.d.ts +1 -115
  38. package/dist/worktree/worktree-manager.d.ts.map +1 -1
  39. package/package.json +2 -2
  40. package/dist/agent/__tests__/orchestrator.cleanup.test.d.ts +0 -2
  41. package/dist/agent/__tests__/orchestrator.cleanup.test.d.ts.map +0 -1
  42. package/dist/agent/__tests__/worker.no-changes.test.d.ts +0 -2
  43. package/dist/agent/__tests__/worker.no-changes.test.d.ts.map +0 -1
@@ -1,59 +1,2 @@
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
- }
1
+ export {};
59
2
  //# sourceMappingURL=agent-pool.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"agent-pool.d.ts","sourceRoot":"","sources":["../../src/orchestrator/agent-pool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
@@ -1,55 +1,2 @@
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
- }
1
+ export {};
55
2
  //# sourceMappingURL=execution.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/orchestrator/execution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
@@ -1,45 +1,35 @@
1
- import { type Task } from "@locusai/shared";
2
1
  import { EventEmitter } from "events";
3
- import type { AgentConfig, AgentState, OrchestratorConfig } from "./types.js";
4
- export type { AgentConfig, AgentState, OrchestratorConfig };
2
+ import type { AgentState, OrchestratorConfig } from "./types.js";
3
+ export type { AgentConfig, AgentState, OrchestratorConfig } from "./types.js";
5
4
  /**
6
- * Top-level orchestrator that coordinates task execution across agents.
5
+ * Top-level orchestrator that coordinates task execution with a single agent.
7
6
  *
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
7
+ * Spawns one worker process that sequentially claims and executes tasks.
8
+ * The worker creates a single branch, pushes after each task, and opens
9
+ * a PR when all tasks are done.
18
10
  */
19
11
  export declare class AgentOrchestrator extends EventEmitter {
20
12
  private client;
21
13
  private config;
22
- private pool;
23
14
  private isRunning;
24
15
  private processedTasks;
25
16
  private resolvedSprintId;
26
- private worktreeManager;
17
+ private agentState;
18
+ private heartbeatInterval;
27
19
  constructor(config: OrchestratorConfig);
28
- private get useWorktrees();
29
- private get worktreeCleanupPolicy();
30
20
  /**
31
21
  * Resolve the sprint ID — use provided or find active sprint.
32
22
  */
33
23
  private resolveSprintId;
34
24
  /**
35
- * Start the orchestrator with N agents.
25
+ * Start the orchestrator with a single agent.
36
26
  */
37
27
  start(): Promise<void>;
38
28
  /**
39
29
  * Main orchestration loop.
40
30
  *
41
31
  * 1. Resolves sprint, fetches tasks, runs pre-flight checks
42
- * 2. Delegates to `ExecutionStrategy` for the actual dispatch
32
+ * 2. Spawns a single agent worker process
43
33
  */
44
34
  private orchestrationLoop;
45
35
  private printBanner;
@@ -49,43 +39,47 @@ export declare class AgentOrchestrator extends EventEmitter {
49
39
  */
50
40
  private getAvailableTasks;
51
41
  /**
52
- * Assign task to agent.
42
+ * Spawn a single agent worker process.
53
43
  */
54
- assignTaskToAgent(agentId: string): Promise<Task | null>;
44
+ private spawnAgent;
55
45
  /**
56
- * Mark task as completed by agent.
46
+ * Wait for the agent process to finish.
57
47
  */
58
- completeTask(taskId: string, agentId: string, summary?: string): Promise<void>;
48
+ private waitForAgent;
59
49
  /**
60
- * Mark task as failed.
50
+ * Start monitoring agent heartbeats for stale detection.
61
51
  */
62
- failTask(taskId: string, agentId: string, error: string): Promise<void>;
52
+ private startHeartbeatMonitor;
63
53
  /**
64
54
  * Stop orchestrator.
65
55
  */
66
56
  stop(): Promise<void>;
67
57
  /**
68
- * Stop a specific agent by ID.
58
+ * Stop the agent.
69
59
  */
70
60
  stopAgent(agentId: string): boolean;
71
61
  /**
72
- * Cleanup — kill all agent processes and worktrees.
62
+ * Cleanup — kill agent process.
73
63
  */
74
64
  private cleanup;
75
65
  /**
76
66
  * Get orchestrator stats.
77
67
  */
78
68
  getStats(): {
79
- useWorktrees: boolean;
80
- processedTasks: number;
81
69
  activeAgents: number;
82
- agentCount: number;
83
70
  totalTasksCompleted: number;
84
71
  totalTasksFailed: number;
72
+ processedTasks: number;
85
73
  };
86
74
  /**
87
75
  * Get all agent states for status display.
88
76
  */
89
77
  getAgentStates(): AgentState[];
78
+ private buildWorkerArgs;
79
+ private attachProcessHandlers;
80
+ /**
81
+ * Resolve the worker script path from the SDK module location.
82
+ */
83
+ private resolveWorkerPath;
90
84
  }
91
85
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,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AkB,EAAE,MAAM,YAAY,CAAC;AAE9E;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,iBAAiB,CAA+C;gBAE5D,MAAM,EAAE,kBAAkB;IAStC;;OAEG;YACW,eAAe;IAuB7B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB5B;;;;;OAKG;YACW,iBAAiB;IAkC/B,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,eAAe;IAmBvB;;OAEG;YACW,iBAAiB;IAa/B;;OAEG;YACW,UAAU;IAyCxB;;OAEG;YACW,YAAY;IAM1B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAQnC;;OAEG;YACW,OAAO;IAYrB;;OAEG;IACH,QAAQ;;;;;;IASR;;OAEG;IACH,cAAc,IAAI,UAAU,EAAE;IAI9B,OAAO,CAAC,eAAe;IA2BvB,OAAO,CAAC,qBAAqB;IAwC7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAa1B"}
@@ -1,50 +1,2 @@
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
- }
1
+ export {};
50
2
  //# sourceMappingURL=tier-merge.d.ts.map
@@ -1 +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;IA0C5B,OAAO,CAAC,OAAO;CAOhB"}
1
+ {"version":3,"file":"tier-merge.d.ts","sourceRoot":"","sources":["../../src/orchestrator/tier-merge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import type { ChildProcess } from "node:child_process";
2
2
  import type { AiProvider } from "../ai/runner.js";
3
- import type { WorktreeCleanupPolicy } from "../worktree/worktree-config.js";
4
3
  export interface AgentConfig {
5
4
  id: string;
6
5
  maxConcurrentTasks: number;
@@ -13,8 +12,6 @@ export interface AgentState {
13
12
  tasksFailed: number;
14
13
  lastHeartbeat: Date;
15
14
  process?: ChildProcess;
16
- worktreePath?: string;
17
- worktreeBranch?: string;
18
15
  }
19
16
  export interface OrchestratorConfig {
20
17
  /** Workspace ID */
@@ -33,13 +30,5 @@ export interface OrchestratorConfig {
33
30
  model?: string;
34
31
  /** AI provider (e.g. codex, claude, etc.) */
35
32
  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
33
  }
45
34
  //# sourceMappingURL=types.d.ts.map
@@ -1 +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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AM,iBAAiB,CAAC;AAElD,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;CACxB;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;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"architect.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/architect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CA+ElE"}
1
+ {"version":3,"file":"architect.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/architect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAwElE"}
@@ -2,12 +2,8 @@
2
2
  * Cross-Task Reviewer Agent Persona
3
3
  *
4
4
  * Phase 4 (final) of the planning meeting. Reviews the Sprint Organizer's
5
- * finalized plan specifically for task isolation issues: overlapping file
6
- * modifications, duplicated work, shared dependencies, and merge conflict risks.
7
- *
8
- * This is a brainstorming review where the architect, engineer, and planner
9
- * perspectives are combined to catch issues that would cause conflicts when
10
- * tasks are executed by independent agents on separate git branches.
5
+ * finalized plan for task ordering issues, dependency correctness,
6
+ * description quality, and overall plan coherence.
11
7
  */
12
8
  export interface CrossTaskReviewerInput {
13
9
  directive: string;
@@ -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,CAuIR"}
1
+ {"version":3,"file":"cross-task-reviewer.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/cross-task-reviewer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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,CAkHR"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Sprint Organizer Agent Persona
3
3
  *
4
- * Phase 3 (final) of the planning meeting. Takes the Architect's
4
+ * Phase 3 of the planning meeting. Takes the Architect's
5
5
  * refined task list and produces the final sprint plan with
6
6
  * name, goal, estimated duration, and organized task assignments.
7
7
  */
@@ -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,CA0FR"}
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,CAiFR"}
@@ -1 +1 @@
1
- {"version":3,"file":"tech-lead.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/tech-lead.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAoFhE"}
1
+ {"version":3,"file":"tech-lead.d.ts","sourceRoot":"","sources":["../../../src/planning/agents/tech-lead.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAmFhE"}
@@ -10,8 +10,6 @@ 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;
15
13
  }
16
14
  export interface SprintPlanRisk {
17
15
  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;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,MAA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AAM,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,CAmE7D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,UAAU,EAAE,CAgBd;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,GAChB,UAAU,CA0CZ"}
@@ -1,3 +1,2 @@
1
- export { type CreateWorktreeOptions, type CreateWorktreeResult, DEFAULT_WORKTREE_CONFIG, WORKTREE_BRANCH_PREFIX, WORKTREE_ROOT_DIR, type WorktreeCleanupPolicy, type WorktreeConfig, type WorktreeInfo, } from "./worktree-config.js";
2
- export { WorktreeManager } from "./worktree-manager.js";
1
+ export {};
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/worktree/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/worktree/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
@@ -1,60 +1,2 @@
1
- /**
2
- * Worktree configuration types and constants.
3
- * Defines the directory layout, branch naming, and cleanup policies
4
- * for agent worktrees used in parallel task execution.
5
- */
6
- /** Root directory for all agent worktrees, relative to project root */
7
- export declare const WORKTREE_ROOT_DIR = ".locus-worktrees";
8
- /** Branch prefix for agent worktrees */
9
- export declare const WORKTREE_BRANCH_PREFIX = "agent";
10
- /** Cleanup policy for completed worktrees */
11
- export type WorktreeCleanupPolicy = "auto" | "retain-on-failure" | "manual";
12
- /** Configuration for worktree management */
13
- export interface WorktreeConfig {
14
- /** Root directory for worktrees (default: `.locus-worktrees/`) */
15
- rootDir: string;
16
- /** Branch naming prefix (default: `agent`) */
17
- branchPrefix: string;
18
- /** Cleanup policy (default: `retain-on-failure`) */
19
- cleanupPolicy: WorktreeCleanupPolicy;
20
- /** Base branch to create worktrees from (default: current HEAD) */
21
- baseBranch?: string;
22
- }
23
- /** Metadata for a single worktree */
24
- export interface WorktreeInfo {
25
- /** Absolute path to the worktree directory */
26
- path: string;
27
- /** Branch name checked out in this worktree */
28
- branch: string;
29
- /** HEAD commit hash */
30
- head: string;
31
- /** Whether this is the main worktree */
32
- isMain: boolean;
33
- /** Whether the worktree directory is missing (prunable) */
34
- isPrunable: boolean;
35
- }
36
- /** Options for creating a worktree */
37
- export interface CreateWorktreeOptions {
38
- /** Task ID associated with this worktree */
39
- taskId: string;
40
- /** Task slug for branch naming */
41
- taskSlug: string;
42
- /** Agent ID that will use this worktree */
43
- agentId: string;
44
- /** Base branch to create from (defaults to config.baseBranch or current HEAD) */
45
- baseBranch?: string;
46
- }
47
- /** Result of creating a worktree */
48
- export interface CreateWorktreeResult {
49
- /** Absolute path to the created worktree */
50
- worktreePath: string;
51
- /** Branch name created */
52
- branch: string;
53
- /** Base branch used to create the task branch */
54
- baseBranch: string;
55
- /** Commit hash of the base branch at worktree creation time */
56
- baseCommitHash: string;
57
- }
58
- /** Default worktree configuration */
59
- export declare const DEFAULT_WORKTREE_CONFIG: WorktreeConfig;
1
+ export {};
60
2
  //# sourceMappingURL=worktree-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worktree-config.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAE9C,6CAA6C;AAC7C,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,mBAAmB,GAAG,QAAQ,CAAC;AAE5E,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,aAAa,EAAE,qBAAqB,CAAC;IACrC,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,sCAAsC;AACtC,MAAM,WAAW,qBAAqB;IACpC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oCAAoC;AACpC,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,qCAAqC;AACrC,eAAO,MAAM,uBAAuB,EAAE,cAIrC,CAAC"}
1
+ {"version":3,"file":"worktree-config.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
@@ -1,116 +1,2 @@
1
- import type { LogFn } from "../ai/factory.js";
2
- import { type CreateWorktreeOptions, type CreateWorktreeResult, type WorktreeConfig, type WorktreeInfo } from "./worktree-config.js";
3
- /**
4
- * Manages git worktrees for parallel agent execution.
5
- * Each agent gets an isolated worktree with a dedicated branch,
6
- * allowing multiple agents to work on different tasks without conflicts.
7
- */
8
- export declare class WorktreeManager {
9
- private config;
10
- private projectPath;
11
- private log;
12
- constructor(projectPath: string, config?: Partial<WorktreeConfig>, log?: LogFn);
13
- /**
14
- * Get the absolute path to the worktree root directory.
15
- */
16
- private get rootPath();
17
- /**
18
- * Build the branch name for a task.
19
- * Format: `agent/<taskId>-<slug>`
20
- */
21
- buildBranchName(taskId: string, taskSlug: string): string;
22
- /**
23
- * Create a new worktree for an agent task.
24
- * Creates the branch and worktree directory.
25
- */
26
- create(options: CreateWorktreeOptions): CreateWorktreeResult;
27
- /**
28
- * List all worktrees with metadata.
29
- * Returns both the main worktree and agent worktrees.
30
- */
31
- list(): WorktreeInfo[];
32
- /**
33
- * List only agent worktrees (excludes the main worktree).
34
- */
35
- listAgentWorktrees(): WorktreeInfo[];
36
- /**
37
- * Remove a specific worktree by path and optionally delete its branch.
38
- */
39
- remove(worktreePath: string, deleteBranch?: boolean): void;
40
- /**
41
- * Prune stale worktree references (directories that no longer exist).
42
- */
43
- prune(): number;
44
- /**
45
- * Remove all agent worktrees and their branches.
46
- * Does not touch the main worktree.
47
- */
48
- removeAll(): number;
49
- /**
50
- * Check if a worktree has uncommitted changes.
51
- */
52
- hasChanges(worktreePath: string): boolean;
53
- /**
54
- * Check if a worktree has commits ahead of the base branch.
55
- * This detects changes that the AI agent committed during execution.
56
- */
57
- hasCommitsAhead(worktreePath: string, baseBranch: string): boolean;
58
- /**
59
- * Check if the worktree HEAD differs from a specific commit hash.
60
- * This is a fallback for when the base branch ref cannot be resolved.
61
- */
62
- private hasCommitsAheadOfHash;
63
- /**
64
- * Stage all changes and commit in a worktree.
65
- * Returns the commit hash, or null if there were no changes to commit.
66
- *
67
- * When `baseBranch` is provided, also checks for commits already made by
68
- * the AI agent during execution. If there are no uncommitted changes but
69
- * the branch has diverged from the base, returns the current HEAD hash
70
- * without creating a new commit.
71
- *
72
- * When `baseCommitHash` is provided as a fallback, it is used if the
73
- * base branch ref cannot be resolved (common in tier-based execution
74
- * where merge branches may not be available locally).
75
- */
76
- commitChanges(worktreePath: string, message: string, baseBranch?: string, baseCommitHash?: string): string | null;
77
- /**
78
- * Push a worktree's branch to a remote.
79
- * Returns the branch name on success, or throws on failure.
80
- * Expects the remote to be an HTTPS URL with `gh auth setup-git` configured.
81
- */
82
- pushBranch(worktreePath: string, remote?: string): string;
83
- /**
84
- * Get the current branch checked out in a worktree.
85
- */
86
- getBranch(worktreePath: string): string;
87
- /**
88
- * Check if a worktree exists for a given task ID.
89
- */
90
- hasWorktreeForTask(taskId: string): boolean;
91
- /**
92
- * Check if a branch exists locally.
93
- */
94
- private branchExists;
95
- /**
96
- * Get the current branch of the main repository.
97
- */
98
- private getCurrentBranch;
99
- /**
100
- * Check if a worktree path is managed by Locus.
101
- */
102
- private isManagedWorktreePath;
103
- private ensureDirectory;
104
- private isMissingDirectoryError;
105
- private cleanupFailedWorktree;
106
- private isNonFastForwardPushError;
107
- /**
108
- * Execute a git command (string form) and return stdout.
109
- */
110
- private git;
111
- /**
112
- * Execute a git command with array args (safe from shell injection).
113
- */
114
- private gitExec;
115
- }
1
+ export {};
116
2
  //# sourceMappingURL=worktree-manager.d.ts.map
@@ -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;IAiH5D;;;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;IAgBlE;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAY7B;;;;;;;;;;;;OAYG;IACH,aAAa,CACX,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,GAAG,IAAI;IAgEhB;;;;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"}
1
+ {"version":3,"file":"worktree-manager.d.ts","sourceRoot":"","sources":["../../src/worktree/worktree-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusai/sdk",
3
- "version": "0.10.5",
3
+ "version": "0.11.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.10.5",
33
+ "@locusai/shared": "^0.11.0",
34
34
  "axios": "^1.13.2",
35
35
  "events": "^3.3.0",
36
36
  "globby": "^14.0.2"
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=orchestrator.cleanup.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrator.cleanup.test.d.ts","sourceRoot":"","sources":["../../../src/agent/__tests__/orchestrator.cleanup.test.ts"],"names":[],"mappings":""}