kantban-cli 0.1.11 → 0.1.12

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.
@@ -2,7 +2,7 @@ import {
2
2
  RalphLoop,
3
3
  cleanupMcpConfig,
4
4
  generateMcpConfig
5
- } from "./chunk-ZCUIGFSP.js";
5
+ } from "./chunk-MTPUHYZV.js";
6
6
 
7
7
  // src/commands/cron.ts
8
8
  import { execFile } from "child_process";
@@ -109,4 +109,4 @@ async function runCron(client, args) {
109
109
  export {
110
110
  runCron
111
111
  };
112
- //# sourceMappingURL=cron-OKQP6QDF.js.map
112
+ //# sourceMappingURL=cron-QKX2LAAY.js.map
package/dist/index.js CHANGED
@@ -163,16 +163,16 @@ async function main() {
163
163
  }
164
164
  case "pipeline": {
165
165
  if (args[0] === "stop") {
166
- const { stopPipeline } = await import("./pipeline-7LG74YA2.js");
166
+ const { stopPipeline } = await import("./pipeline-SFXKDLMA.js");
167
167
  await stopPipeline(args.slice(1));
168
168
  } else {
169
- const { runPipeline } = await import("./pipeline-7LG74YA2.js");
169
+ const { runPipeline } = await import("./pipeline-SFXKDLMA.js");
170
170
  await runPipeline(client, args);
171
171
  }
172
172
  break;
173
173
  }
174
174
  case "cron": {
175
- const { runCron } = await import("./cron-OKQP6QDF.js");
175
+ const { runCron } = await import("./cron-QKX2LAAY.js");
176
176
  await runCron(client, args);
177
177
  break;
178
178
  }
@@ -13,7 +13,7 @@ import {
13
13
  parseStuckDetectionResponse,
14
14
  parseTimeout,
15
15
  resolveGatesForColumn
16
- } from "./chunk-ZCUIGFSP.js";
16
+ } from "./chunk-MTPUHYZV.js";
17
17
 
18
18
  // src/commands/pipeline.ts
19
19
  import { spawn as spawn2, execSync } from "child_process";
@@ -61,10 +61,32 @@ function execPromise(exec, cmd, args) {
61
61
  });
62
62
  });
63
63
  }
64
+ async function findWorktreeForBranch(exec, branch) {
65
+ try {
66
+ const { stdout } = await execPromise(exec, "git", ["worktree", "list", "--porcelain"]);
67
+ const targetRef = `refs/heads/${branch}`;
68
+ let currentPath = null;
69
+ for (const line of stdout.split("\n")) {
70
+ if (line.startsWith("worktree ")) currentPath = line.slice("worktree ".length);
71
+ if (line.startsWith("branch ") && line.slice("branch ".length) === targetRef && currentPath) {
72
+ return currentPath;
73
+ }
74
+ }
75
+ return null;
76
+ } catch {
77
+ return null;
78
+ }
79
+ }
64
80
  async function mergeWorktreeBranch(worktreeName, integrationBranch, exec = defaultExecFile) {
65
81
  try {
66
82
  await execPromise(exec, "git", ["branch", integrationBranch, "HEAD"]).catch(() => {
67
83
  });
84
+ const checkedOutPath = await findWorktreeForBranch(exec, integrationBranch);
85
+ if (checkedOutPath) {
86
+ await execPromise(exec, "git", ["-C", checkedOutPath, "merge", "--no-edit", worktreeName]);
87
+ console.error(`[worktree] merged ${worktreeName} \u2192 ${integrationBranch}`);
88
+ return true;
89
+ }
68
90
  const { stdout: baseOut } = await execPromise(exec, "git", ["merge-base", integrationBranch, worktreeName]);
69
91
  const mergeBase = baseOut.trim();
70
92
  const { stdout: integrationSha } = await execPromise(exec, "git", ["rev-parse", integrationBranch]);
@@ -3691,6 +3713,7 @@ async function runPipeline(client, args) {
3691
3713
  moveTicketToColumn: async (ticketId, columnId, handoff) => {
3692
3714
  await client.patch(`/projects/${projectId}/tickets/${ticketId}/move`, {
3693
3715
  column_id: columnId,
3716
+ position: 0,
3694
3717
  handoff
3695
3718
  });
3696
3719
  },
@@ -4095,4 +4118,4 @@ export {
4095
4118
  runPipeline,
4096
4119
  stopPipeline
4097
4120
  };
4098
- //# sourceMappingURL=pipeline-7LG74YA2.js.map
4121
+ //# sourceMappingURL=pipeline-SFXKDLMA.js.map