@bakers-build/addon-herdr 0.6.1-next.2 → 0.6.1-next.4

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.
@@ -88,6 +88,11 @@ export interface HerdrWorkspaceOptions {
88
88
  execGit?: GitExec;
89
89
  /** Optional logger for the best-effort open-layout path (defaults to noop). */
90
90
  logger?: ConductorLogger;
91
+ /**
92
+ * Default `false`: before creating a worktree, set `branch.autoSetupMerge=false`
93
+ * in `root`, and give runs `push.default=current`. `true` leaves Git alone.
94
+ */
95
+ autoSetupMerge?: boolean;
91
96
  }
92
97
  /** Git-safe branch validation: safe ref chars only, no leading dot, no `..`. */
93
98
  export declare function validateBranch(branch: string): void;
@@ -162,6 +167,7 @@ export declare function herdrWorkspace(opts?: {
162
167
  worktreeDir?: string;
163
168
  baseBranch?: string;
164
169
  open?: OpenLayout;
170
+ autoSetupMerge?: boolean;
165
171
  /** Overrideable git exec for root derivation (tests). */
166
172
  execGit?: RootGitExec;
167
173
  /** Overrideable herdr exec (tests) — sibling of `execGit`. */
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'node:path';
2
- import { loadInstructions } from '@bakers-build/addon-workspace-git';
2
+ import { loadInstructions, runBranchGit, } from '@bakers-build/addon-workspace-git';
3
3
  import { exec } from '@bakers-build/core';
4
4
  import { herdrAgentHost } from './agents.js';
5
5
  import { renderTemplate } from './config.js';
@@ -145,6 +145,9 @@ export class HerdrWorkspace {
145
145
  throw new Error('herdr workspace requires a branch name');
146
146
  }
147
147
  validateBranch(branch);
148
+ const extra = this.options.autoSetupMerge
149
+ ? {}
150
+ : { env: await runBranchGit(this.root, this.logger) };
148
151
  const worktrees = parseWorktreeList(await this.execHerdr(['worktree', 'list', '--cwd', this.root, '--json']));
149
152
  const existing = worktrees.find((w) => w.branch === branch);
150
153
  if (existing) {
@@ -165,7 +168,12 @@ export class HerdrWorkspace {
165
168
  '--json',
166
169
  ]), 'worktree open');
167
170
  }
168
- return { path, instructions: loadInstructions(path), created: false };
171
+ return {
172
+ path,
173
+ instructions: loadInstructions(path),
174
+ created: false,
175
+ ...extra,
176
+ };
169
177
  }
170
178
  // Fresh: create the git worktree + herdr workspace in one call. Base the
171
179
  // new branch on the (freshly fetched) remote tracking branch, not the
@@ -213,7 +221,12 @@ export class HerdrWorkspace {
213
221
  }
214
222
  // The `after_create` hook is run by the executor (BB-84), not here — the
215
223
  // workspace only reports that it created a fresh worktree.
216
- return { path, instructions: loadInstructions(path), created: true };
224
+ return {
225
+ path,
226
+ instructions: loadInstructions(path),
227
+ created: true,
228
+ ...extra,
229
+ };
217
230
  }
218
231
  /**
219
232
  * Apply the open layout to the root pane captured by the most recent
@@ -340,6 +353,7 @@ export function herdrWorkspace(opts = {}) {
340
353
  ...(opts.baseBranch ? { baseBranch: opts.baseBranch } : {}),
341
354
  ...(opts.open ? { open: opts.open } : {}),
342
355
  ...(opts.execHerdr ? { execHerdr: opts.execHerdr } : {}),
356
+ ...(opts.autoSetupMerge ? { autoSetupMerge: true } : {}),
343
357
  ...(deps?.logger ? { logger: deps.logger } : {}),
344
358
  });
345
359
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-herdr",
3
- "version": "0.6.1-next.2",
3
+ "version": "0.6.1-next.4",
4
4
  "description": "bakers.build herdr integration: spawn executor + per-ticket worktree workspace.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,14 +21,14 @@
21
21
  "directory": "bakers-cli/addons/herdr"
22
22
  },
23
23
  "dependencies": {
24
- "@bakers-build/addon-workspace-git": "^0.6.1-next.2"
24
+ "@bakers-build/addon-workspace-git": "^0.6.1-next.4"
25
25
  },
26
26
  "peerDependencies": {
27
- "@bakers-build/conductor": "^0.6.1-next.2",
28
- "@bakers-build/core": "^0.6.1-next.2"
27
+ "@bakers-build/conductor": "^0.6.1-next.4",
28
+ "@bakers-build/core": "^0.6.1-next.4"
29
29
  },
30
30
  "bakersBuild": {
31
- "commit": "9f3866c099b1a9d0db76bd304fef38aeddcce8bb",
31
+ "commit": "f9ce4e2980c83b80ba5f007fe2d8e534797cf66c",
32
32
  "channel": "next"
33
33
  }
34
34
  }