@dunnewold-labs/mr-manager 0.4.25 → 0.4.26
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/index.mjs +26 -17
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -185,7 +185,7 @@ import { fileURLToPath } from "url";
|
|
|
185
185
|
// cli/package.json
|
|
186
186
|
var package_default = {
|
|
187
187
|
name: "@dunnewold-labs/mr-manager",
|
|
188
|
-
version: "0.4.
|
|
188
|
+
version: "0.4.26",
|
|
189
189
|
description: "Mr. Manager - Task and project management CLI",
|
|
190
190
|
bin: {
|
|
191
191
|
mr: "./dist/index.mjs"
|
|
@@ -2498,7 +2498,10 @@ ${systemPrompt}` : prompt2;
|
|
|
2498
2498
|
if (mode === "plan") {
|
|
2499
2499
|
return { bin: "claude", args: [...sessionArgs, ...nameArgs, ...systemArgs, ...turnsArgs, ...modelArgs, "--permission-mode", "plan", "-p", prompt2] };
|
|
2500
2500
|
}
|
|
2501
|
-
|
|
2501
|
+
const cfg = loadConfig();
|
|
2502
|
+
const permissionMode = cfg.claudePermissionMode ?? "auto";
|
|
2503
|
+
const permissionArgs = permissionMode === "dangerously-skip-permissions" ? ["--dangerously-skip-permissions"] : ["--permission-mode", "auto", "--enable-auto-mode"];
|
|
2504
|
+
return { bin: "claude", args: [...sessionArgs, ...nameArgs, ...systemArgs, ...turnsArgs, ...modelArgs, ...permissionArgs, "-p", prompt2] };
|
|
2502
2505
|
}
|
|
2503
2506
|
function commandExists(cmd) {
|
|
2504
2507
|
return new Promise((resolve9) => {
|
|
@@ -3011,14 +3014,19 @@ var watchCommand = new Command8("watch").description(
|
|
|
3011
3014
|
await postTaskUpdate(task.id, `Agent finished \u2014 no ${prLabel} found for branch ${branchName}`, "system");
|
|
3012
3015
|
}
|
|
3013
3016
|
}
|
|
3014
|
-
await api.
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3017
|
+
const currentTask = await api.get(`/api/tasks/${task.id}`);
|
|
3018
|
+
if (currentTask.status === "completed" || currentTask.status === "review") {
|
|
3019
|
+
logWarn(prefix, `Task already in "${currentTask.status}" state \u2014 skipping status update`);
|
|
3020
|
+
} else {
|
|
3021
|
+
await api.patch(`/api/tasks/${task.id}`, {
|
|
3022
|
+
status: "review",
|
|
3023
|
+
claudeSessionId: activeEntry.currentAgent === "claude" ? void 0 : null,
|
|
3024
|
+
...prUrl ? { link: prUrl } : {}
|
|
3025
|
+
});
|
|
3026
|
+
logSuccess(prefix, `"${paint("bold", task.title)}" marked ready for review`);
|
|
3027
|
+
if (noMrRequested) {
|
|
3028
|
+
await postTaskUpdate(task.id, `No ${prLabel} required: ${noMrDescription}`, "system");
|
|
3029
|
+
}
|
|
3022
3030
|
}
|
|
3023
3031
|
} catch (err) {
|
|
3024
3032
|
if (isLikelyNetworkError(err)) {
|
|
@@ -3745,6 +3753,7 @@ ${divider}`);
|
|
|
3745
3753
|
if (taskId.startsWith("proto-") || taskId.startsWith("repo-") || taskId.startsWith("scan-")) continue;
|
|
3746
3754
|
if (!activeTaskIds.has(taskId)) {
|
|
3747
3755
|
logWarn(watchTag(), `Task ${paint("yellow", taskId.slice(0, 8))} no longer active, terminating\u2026`);
|
|
3756
|
+
entry.terminatedForError = true;
|
|
3748
3757
|
entry.process.kill("SIGTERM");
|
|
3749
3758
|
active.delete(taskId);
|
|
3750
3759
|
queued.delete(taskId);
|
|
@@ -4121,20 +4130,20 @@ ${divider}`);
|
|
|
4121
4130
|
const prefix = taskTag(sid);
|
|
4122
4131
|
const prLabel = task.link.includes("gitlab") ? "MR" : "PR";
|
|
4123
4132
|
const vcs = task.link.includes("gitlab") ? "gitlab" : "github";
|
|
4124
|
-
const repoDir = findDirectoryForProject(config, task.projectId, rootDir)
|
|
4133
|
+
const repoDir = findDirectoryForProject(config, task.projectId, rootDir);
|
|
4134
|
+
if (!repoDir) continue;
|
|
4125
4135
|
const status = await checkPrStatus(task.link, repoDir, vcs);
|
|
4126
4136
|
if (!status) continue;
|
|
4127
4137
|
if (status.merged) {
|
|
4128
|
-
|
|
4138
|
+
if (task.autoMergedAt) continue;
|
|
4139
|
+
logSuccess(prefix, `${prLabel} merged \u2014 marking for acknowledgment "${paint("bold", task.title)}"`);
|
|
4129
4140
|
try {
|
|
4130
4141
|
await api.patch(`/api/tasks/${task.id}`, {
|
|
4131
|
-
|
|
4132
|
-
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4133
|
-
inProgressSince: null
|
|
4142
|
+
autoMergedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4134
4143
|
});
|
|
4135
|
-
await postTaskUpdate(task.id, `${prLabel} merged \u2014
|
|
4144
|
+
await postTaskUpdate(task.id, `${prLabel} merged \u2014 waiting for your acknowledgment to complete the task`, "system");
|
|
4136
4145
|
} catch (err) {
|
|
4137
|
-
logError(prefix, `Failed to auto-
|
|
4146
|
+
logError(prefix, `Failed to mark task as auto-merged: ${err.message}`);
|
|
4138
4147
|
}
|
|
4139
4148
|
continue;
|
|
4140
4149
|
}
|