claude-task-worker 0.14.0 → 0.15.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.
- package/dist/index.js +24 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67,10 +67,10 @@ __export(herdr_exports, {
|
|
|
67
67
|
tabCreate: () => tabCreate,
|
|
68
68
|
tabList: () => tabList
|
|
69
69
|
});
|
|
70
|
-
import { createRequire } from "node:module";
|
|
70
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
71
71
|
function runHerdr(args) {
|
|
72
72
|
return new Promise((resolve2) => {
|
|
73
|
-
|
|
73
|
+
childProcess2.execFile(
|
|
74
74
|
"herdr",
|
|
75
75
|
args,
|
|
76
76
|
{ timeout: HERDR_TIMEOUT_MS, killSignal: "SIGKILL" },
|
|
@@ -162,11 +162,11 @@ async function checkHerdrAvailable() {
|
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
var
|
|
165
|
+
var childProcess2, HerdrUnavailableError, HerdrError, HERDR_TIMEOUT_MS;
|
|
166
166
|
var init_herdr = __esm({
|
|
167
167
|
"src/herdr.ts"() {
|
|
168
168
|
"use strict";
|
|
169
|
-
|
|
169
|
+
childProcess2 = createRequire2(import.meta.url)("node:child_process");
|
|
170
170
|
HerdrUnavailableError = class extends Error {
|
|
171
171
|
reason;
|
|
172
172
|
constructor(message, reason) {
|
|
@@ -475,10 +475,11 @@ var init_dispatcher = __esm({
|
|
|
475
475
|
});
|
|
476
476
|
|
|
477
477
|
// src/gh.ts
|
|
478
|
-
import {
|
|
478
|
+
import { createRequire } from "node:module";
|
|
479
|
+
var childProcess = createRequire(import.meta.url)("node:child_process");
|
|
479
480
|
function execGh(args) {
|
|
480
481
|
return new Promise((resolve2, reject) => {
|
|
481
|
-
execFile("gh", args, (error, stdout, stderr) => {
|
|
482
|
+
childProcess.execFile("gh", args, (error, stdout, stderr) => {
|
|
482
483
|
if (error) {
|
|
483
484
|
reject(new Error(`gh ${args.join(" ")} failed: ${stderr || error.message}`));
|
|
484
485
|
return;
|
|
@@ -489,7 +490,7 @@ function execGh(args) {
|
|
|
489
490
|
}
|
|
490
491
|
function execGhAllowExit(args, allowedCodes) {
|
|
491
492
|
return new Promise((resolve2, reject) => {
|
|
492
|
-
execFile("gh", args, (error, stdout, stderr) => {
|
|
493
|
+
childProcess.execFile("gh", args, (error, stdout, stderr) => {
|
|
493
494
|
if (error) {
|
|
494
495
|
const code = error.code;
|
|
495
496
|
if (typeof code === "number" && allowedCodes.includes(code)) {
|
|
@@ -664,6 +665,14 @@ async function addLabel(type, number, label) {
|
|
|
664
665
|
}
|
|
665
666
|
});
|
|
666
667
|
}
|
|
668
|
+
async function hasLabel(type, number, label) {
|
|
669
|
+
return withRetry(async () => {
|
|
670
|
+
const output = await execGh([type, "view", String(number), "--json", "labels"]);
|
|
671
|
+
const parsed = JSON.parse(output);
|
|
672
|
+
const labels = parsed?.labels ?? [];
|
|
673
|
+
return labels.some((l) => l.name === label);
|
|
674
|
+
});
|
|
675
|
+
}
|
|
667
676
|
async function removeLabel(type, number, label) {
|
|
668
677
|
await withRetry(async () => {
|
|
669
678
|
try {
|
|
@@ -890,9 +899,9 @@ function getWorkerConfig(workerName) {
|
|
|
890
899
|
}
|
|
891
900
|
|
|
892
901
|
// src/git.ts
|
|
893
|
-
import { execSync, execFile
|
|
902
|
+
import { execSync, execFile } from "node:child_process";
|
|
894
903
|
import { promisify } from "node:util";
|
|
895
|
-
var execFileAsync = promisify(
|
|
904
|
+
var execFileAsync = promisify(execFile);
|
|
896
905
|
var running = false;
|
|
897
906
|
function syncDefaultBranch(branch) {
|
|
898
907
|
if (running) return;
|
|
@@ -1539,11 +1548,11 @@ async function notifyError(workerName, repoName, error) {
|
|
|
1539
1548
|
}
|
|
1540
1549
|
|
|
1541
1550
|
// src/worktree.ts
|
|
1542
|
-
import { execFile as
|
|
1551
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
1543
1552
|
import { promisify as promisify3 } from "node:util";
|
|
1544
1553
|
import { readdir, rm, stat } from "node:fs/promises";
|
|
1545
1554
|
import { basename, resolve, sep } from "node:path";
|
|
1546
|
-
var execFileAsync2 = promisify3(
|
|
1555
|
+
var execFileAsync2 = promisify3(execFile2);
|
|
1547
1556
|
var WORKTREES_DIR = ".claude/worktrees";
|
|
1548
1557
|
function isManagedWorktreePath(path) {
|
|
1549
1558
|
return resolve(path).startsWith(resolve(WORKTREES_DIR) + sep);
|
|
@@ -1817,6 +1826,10 @@ var execIssueWorker = (opts = {}) => createIssuePollingWorker({
|
|
|
1817
1826
|
epicFilters: opts.epicFilters,
|
|
1818
1827
|
labelFilters: opts.labelFilters,
|
|
1819
1828
|
onCompleted: async (issueNumber) => {
|
|
1829
|
+
if (await hasLabel("issue", issueNumber, "cc-need-human-check")) {
|
|
1830
|
+
console.log(`[exec-issue] #${issueNumber}: cc-need-human-check present, skip cc-pr-created`);
|
|
1831
|
+
return;
|
|
1832
|
+
}
|
|
1820
1833
|
await addLabel("issue", issueNumber, "cc-pr-created");
|
|
1821
1834
|
}
|
|
1822
1835
|
})();
|