@kody-ade/kody-engine-lite 0.1.35 → 0.1.36
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/bin/cli.js +25 -9
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -414,6 +414,14 @@ function getIssue(issueNumber) {
|
|
|
414
414
|
return null;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
+
function getIssueLabels(issueNumber) {
|
|
418
|
+
try {
|
|
419
|
+
const output = gh(["issue", "view", String(issueNumber), "--json", "labels", "--jq", ".labels[].name"]);
|
|
420
|
+
return output.split("\n").filter(Boolean);
|
|
421
|
+
} catch {
|
|
422
|
+
return [];
|
|
423
|
+
}
|
|
424
|
+
}
|
|
417
425
|
function setLabel(issueNumber, label) {
|
|
418
426
|
try {
|
|
419
427
|
gh(["issue", "edit", String(issueNumber), "--add-label", label]);
|
|
@@ -2549,24 +2557,32 @@ function resolveTaskAction(issueNumber, existingTaskId, existingState) {
|
|
|
2549
2557
|
}
|
|
2550
2558
|
function resolveForIssue(issueNumber, projectDir) {
|
|
2551
2559
|
const existingTaskId = findLatestTaskForIssue(issueNumber, projectDir);
|
|
2552
|
-
if (
|
|
2553
|
-
|
|
2560
|
+
if (existingTaskId) {
|
|
2561
|
+
const statusPath = path17.join(projectDir, ".tasks", existingTaskId, "status.json");
|
|
2562
|
+
let existingState = null;
|
|
2563
|
+
if (fs18.existsSync(statusPath)) {
|
|
2564
|
+
try {
|
|
2565
|
+
existingState = JSON.parse(fs18.readFileSync(statusPath, "utf-8"));
|
|
2566
|
+
} catch {
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
return resolveTaskAction(issueNumber, existingTaskId, existingState);
|
|
2554
2570
|
}
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
existingState = JSON.parse(fs18.readFileSync(statusPath, "utf-8"));
|
|
2560
|
-
} catch {
|
|
2571
|
+
try {
|
|
2572
|
+
const labels = getIssueLabels(issueNumber);
|
|
2573
|
+
if (labels.includes("kody:done")) {
|
|
2574
|
+
return { action: "already-completed", taskId: `${issueNumber}-unknown` };
|
|
2561
2575
|
}
|
|
2576
|
+
} catch {
|
|
2562
2577
|
}
|
|
2563
|
-
return resolveTaskAction(issueNumber,
|
|
2578
|
+
return resolveTaskAction(issueNumber, null, null);
|
|
2564
2579
|
}
|
|
2565
2580
|
var STAGE_ORDER;
|
|
2566
2581
|
var init_task_state = __esm({
|
|
2567
2582
|
"src/cli/task-state.ts"() {
|
|
2568
2583
|
"use strict";
|
|
2569
2584
|
init_task_resolution();
|
|
2585
|
+
init_github_api();
|
|
2570
2586
|
STAGE_ORDER = ["taskify", "plan", "build", "verify", "review", "review-fix", "ship"];
|
|
2571
2587
|
}
|
|
2572
2588
|
});
|