@astroanywhere/agent 0.4.3 → 0.5.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.
@@ -11,8 +11,12 @@ export interface WorktreeOptions {
11
11
  agentDir?: string;
12
12
  /** Target branch from dispatch — takes priority over .astro/config.json and auto-detection */
13
13
  baseBranch?: string;
14
- /** Project-level accumulation branch (e.g., 'astro/7b19a9'). Task branches from this instead of main. */
15
- projectBranch?: string;
14
+ /** Delivery branch for this task's connected component (e.g., 'astro/7b19a9-e4f1a2').
15
+ * In multi-task mode, task branches are created from this branch.
16
+ * In singleton mode, the agent works directly on this branch. */
17
+ deliveryBranch?: string;
18
+ /** If true, work directly on the delivery branch (singleton component — no task sub-branch). */
19
+ deliveryBranchIsSingleton?: boolean;
16
20
  stdout?: (data: string) => void;
17
21
  stderr?: (data: string) => void;
18
22
  /** Emit structured operational activity lines */
@@ -23,16 +27,16 @@ export interface WorktreeOptions {
23
27
  export interface WorktreeSetup {
24
28
  workingDirectory: string;
25
29
  branchName: string;
26
- /** The base branch the worktree was created from (project branch or default branch) */
30
+ /** The base branch the worktree was created from (delivery branch or default branch) */
27
31
  baseBranch: string;
28
32
  /** Git SHA of the start point before this task's work */
29
33
  commitBeforeSha?: string;
30
34
  /** Absolute path to the git root directory (for local merge operations) */
31
35
  gitRoot: string;
32
- /** Project accumulation branch name, if applicable (e.g., 'astro/7b19a9') */
33
- projectBranch?: string;
34
- /** Absolute path to the persistent project worktree (detached HEAD), if created */
35
- projectWorktreePath?: string;
36
+ /** Delivery branch name, if applicable (e.g., 'astro/7b19a9-e4f1a2') */
37
+ deliveryBranch?: string;
38
+ /** Absolute path to the persistent delivery worktree (detached HEAD), if created */
39
+ deliveryWorktreePath?: string;
36
40
  cleanup: (options?: {
37
41
  keepBranch?: boolean;
38
42
  }) => Promise<void>;
@@ -45,42 +49,42 @@ export declare function createWorktree(options: WorktreeOptions): Promise<Worktr
45
49
  */
46
50
  export declare function removeLingeringWorktrees(gitRoot: string, branchName: string): Promise<void>;
47
51
  /**
48
- * Create a persistent project-level worktree using detached HEAD.
52
+ * Create a persistent delivery worktree using detached HEAD.
49
53
  *
50
- * The project worktree lives at {baseRoot}/{shortProjectId}/ and mirrors
51
- * the project branch on disk. It uses `--detach` so the project branch
52
- * ref remains free for temporary merge worktrees (localMergeIntoProjectBranch
53
- * checks out the project branch — git prevents the same branch in two worktrees).
54
+ * The delivery worktree lives at {baseRoot}/{shortProjectId}/ and mirrors
55
+ * the delivery branch on disk. It uses `--detach` so the delivery branch
56
+ * ref remains free for temporary merge worktrees (localMergeIntoDeliveryBranch
57
+ * checks out the delivery branch — git prevents the same branch in two worktrees).
54
58
  *
55
59
  * Idempotent — safe to call on every task dispatch. If the worktree
56
60
  * already exists, returns the existing path.
57
61
  */
58
- export declare function createProjectWorktree(gitRoot: string, projectBranch: string, baseRoot: string, shortProjectId: string, operational?: (message: string, source: 'astro' | 'git' | 'delivery') => void): Promise<string | null>;
62
+ export declare function createDeliveryWorktree(gitRoot: string, deliveryBranch: string, baseRoot: string, shortProjectId: string, operational?: (message: string, source: 'astro' | 'git' | 'delivery') => void): Promise<string | null>;
59
63
  /**
60
- * Sync the persistent project worktree to the latest project branch tip.
64
+ * Sync the persistent delivery worktree to the latest delivery branch tip.
61
65
  *
62
- * After each successful merge (branch or PR mode), the project branch moves
63
- * forward. This updates the detached HEAD in the project worktree so the
66
+ * After each successful merge (branch or PR mode), the delivery branch moves
67
+ * forward. This updates the detached HEAD in the delivery worktree so the
64
68
  * files on disk reflect the latest state.
65
69
  *
66
70
  * Ref selection:
67
- * - Branch mode (no remote): localMergeIntoProjectBranch() advances
68
- * refs/heads/{projectBranch} directly → use the local ref.
69
- * - PR mode (has remote): GitHub merge advances origin/{projectBranch},
71
+ * - Branch mode (no remote): localMergeIntoDeliveryBranch() advances
72
+ * refs/heads/{deliveryBranch} directly → use the local ref.
73
+ * - PR mode (has remote): GitHub merge advances origin/{deliveryBranch},
70
74
  * but refs/heads/ is stale (no local commit) → fetch then use remote ref.
71
75
  *
72
76
  * Non-fatal — sync failure doesn't affect task completion.
73
77
  */
74
- export declare function syncProjectWorktree(projectWorktreePath: string, projectBranch: string, gitRoot: string): Promise<void>;
78
+ export declare function syncDeliveryWorktree(deliveryWorktreePath: string, deliveryBranch: string, gitRoot: string): Promise<void>;
75
79
  /**
76
- * Remove the persistent project worktree.
80
+ * Remove the persistent delivery worktree.
77
81
  *
78
82
  * This is an exported utility for the astro platform to call when a project
79
83
  * is deleted. The agent-runner does not manage project lifecycles — it only
80
84
  * provides the building blocks. The integration point (calling this on
81
85
  * project deletion) lives in the astro server, not here.
82
86
  */
83
- export declare function cleanupProjectWorktree(gitRoot: string, projectWorktreePath: string): Promise<void>;
87
+ export declare function cleanupDeliveryWorktree(gitRoot: string, deliveryWorktreePath: string): Promise<void>;
84
88
  /**
85
89
  * Ensure CLAUDE.md is available in the worktree.
86
90
  *
@@ -93,4 +97,5 @@ export declare function cleanupProjectWorktree(gitRoot: string, projectWorktreeP
93
97
  * task execution.
94
98
  */
95
99
  export declare function ensureClaudeMdInWorktree(gitRoot: string, worktreePath: string): Promise<void>;
100
+ export declare function getGitRoot(workingDirectory: string): Promise<string | null>;
96
101
  //# sourceMappingURL=worktree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/lib/worktree.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8FAA8F;IA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