claude-task-worker 0.1.1 → 0.3.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/README.md +18 -2
- package/dist/index.js +47 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -146,7 +146,8 @@ claude-task-worker init --force # 既存ファイルを強制上書き
|
|
|
146
146
|
| `cc-need-human-check` | 人間の確認が必要なマーク(付与中はIssueワーカーの処理対象から除外される) |
|
|
147
147
|
| `cc-issue-created` | `/claude-task-worker:create-issue` 由来のIssueマーク(triage-created-issue のトリガー条件) |
|
|
148
148
|
| `cc-pr-created` | PR作成完了マーク |
|
|
149
|
-
| `cc-epic-issue` |
|
|
149
|
+
| `cc-epic-issue` | エピックマーク(Issueではサブ全Closeで `epic-issue` ワーカー起動、PRではリリースゲート対象を示すマーク) |
|
|
150
|
+
| `cc-release-ready` | エピックPRがリリース可能(マージ問題なし)と判定されたマーク。実際のマージ(リリース)は人間が実施 |
|
|
150
151
|
|
|
151
152
|
作成されるファイル:
|
|
152
153
|
|
|
@@ -234,6 +235,8 @@ claude-task-worker yolo --epic 100 --epic 200 --label priority-high
|
|
|
234
235
|
|
|
235
236
|
- `cc-fix-onetime` が付いているPRは除外
|
|
236
237
|
- `cc-resolve-conflict` が付いているPRは除外
|
|
238
|
+
- `cc-release-ready` が付いているPRは除外(リリースゲート判定済みのため再トリアージしない)
|
|
239
|
+
- マージ可能と判定した際、`cc-epic-issue` が付いたエピックPRはマージせず `cc-release-ready` ラベルを付与する(リリースのためのマージは人間の判断に委ねる)。通常PRは従来どおりマージする
|
|
237
240
|
|
|
238
241
|
### resolve-conflict
|
|
239
242
|
|
|
@@ -254,7 +257,8 @@ claude-task-worker yolo --epic 100 --epic 200 --label priority-high
|
|
|
254
257
|
|
|
255
258
|
- `cc-pr-created` が付いているIssueは除外
|
|
256
259
|
- サブIssueが存在しない、または1つでも未Closeのものがあればスキップ
|
|
257
|
-
-
|
|
260
|
+
- 完了後、親Issueに `cc-pr-created` ラベルを付与
|
|
261
|
+
- 完了後、作成されたエピックPR(`cc-epic-<親Issue番号>` ブランチ)に `cc-epic-issue` と `cc-triage-scope` ラベルを付与し、triage-pr のリリースゲート判定に引き継ぐ
|
|
258
262
|
|
|
259
263
|
### all
|
|
260
264
|
|
|
@@ -296,6 +300,18 @@ claude-task-worker update
|
|
|
296
300
|
|
|
297
301
|
いずれかのステップが失敗しても処理は継続し、`[update]` プレフィックス付きでエラー内容がログ出力される。
|
|
298
302
|
|
|
303
|
+
### version
|
|
304
|
+
|
|
305
|
+
インストールされている `claude-task-worker` CLI のバージョンを表示する。
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
claude-task-worker version
|
|
309
|
+
claude-task-worker --version
|
|
310
|
+
claude-task-worker -v
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
`package.json` の `version` を出力する(例: `0.2.0`)。
|
|
314
|
+
|
|
299
315
|
## 設定ファイル
|
|
300
316
|
|
|
301
317
|
コマンドを実行したディレクトリ直下の `claude-task-worker.json` を読み込む。
|
package/dist/index.js
CHANGED
|
@@ -90,6 +90,22 @@ async function listIssuesByNumbers(assignee, labels, excludeLabels, numbers) {
|
|
|
90
90
|
}
|
|
91
91
|
return results;
|
|
92
92
|
}
|
|
93
|
+
async function findOpenPrNumberByHeadRef(headRefName) {
|
|
94
|
+
const output = await execGh([
|
|
95
|
+
"pr",
|
|
96
|
+
"list",
|
|
97
|
+
"--state",
|
|
98
|
+
"open",
|
|
99
|
+
"--head",
|
|
100
|
+
headRefName,
|
|
101
|
+
"--json",
|
|
102
|
+
"number",
|
|
103
|
+
"--limit",
|
|
104
|
+
"1"
|
|
105
|
+
]);
|
|
106
|
+
const prs = JSON.parse(output);
|
|
107
|
+
return prs.length > 0 ? prs[0].number : null;
|
|
108
|
+
}
|
|
93
109
|
async function getIssueSubIssuesSummary(issueNumber) {
|
|
94
110
|
const output = await execGh(["issue", "view", String(issueNumber), "--json", "subIssuesSummary"]);
|
|
95
111
|
const parsed = JSON.parse(output);
|
|
@@ -1450,7 +1466,7 @@ var triagePrWorker = createPrPollingWorker({
|
|
|
1450
1466
|
name: "triage-pr",
|
|
1451
1467
|
command: "/claude-task-worker:triage-pr",
|
|
1452
1468
|
triggerLabel: "cc-triage-scope",
|
|
1453
|
-
excludeLabels: ["cc-fix-onetime", "cc-resolve-conflict"]
|
|
1469
|
+
excludeLabels: ["cc-fix-onetime", "cc-resolve-conflict", "cc-release-ready"]
|
|
1454
1470
|
});
|
|
1455
1471
|
|
|
1456
1472
|
// src/workers/resolve-conflict.ts
|
|
@@ -1487,6 +1503,13 @@ var epicIssueWorker = (opts = {}) => createIssuePollingWorker({
|
|
|
1487
1503
|
},
|
|
1488
1504
|
onCompleted: async (issueNumber) => {
|
|
1489
1505
|
await addLabel("issue", issueNumber, "cc-pr-created");
|
|
1506
|
+
const prNumber = await findOpenPrNumberByHeadRef(`cc-epic-${issueNumber}`);
|
|
1507
|
+
if (prNumber === null) {
|
|
1508
|
+
console.error(`[epic-issue] Epic PR for branch cc-epic-${issueNumber} not found; skip labeling`);
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
await addLabel("pr", prNumber, "cc-epic-issue");
|
|
1512
|
+
await addLabel("pr", prNumber, "cc-triage-scope");
|
|
1490
1513
|
}
|
|
1491
1514
|
})();
|
|
1492
1515
|
|
|
@@ -1503,7 +1526,8 @@ var LABELS = [
|
|
|
1503
1526
|
{ name: "cc-pr-created", color: "006b75" },
|
|
1504
1527
|
{ name: "cc-triage-scope", color: "c5def5" },
|
|
1505
1528
|
{ name: "cc-resolve-conflict", color: "fbca04" },
|
|
1506
|
-
{ name: "cc-epic-issue", color: "8b5cf6" }
|
|
1529
|
+
{ name: "cc-epic-issue", color: "8b5cf6" },
|
|
1530
|
+
{ name: "cc-release-ready", color: "2da44e" }
|
|
1507
1531
|
];
|
|
1508
1532
|
var ISSUE_TEMPLATE = `name: "[claude-task-worker] Issue\u4F5C\u6210\u4F9D\u983C"
|
|
1509
1533
|
description: claude-task-worker\u3067GitHub Issue\u3092\u4F5C\u6210\u3059\u308B
|
|
@@ -1716,6 +1740,22 @@ async function update() {
|
|
|
1716
1740
|
console.log("[update] Done.");
|
|
1717
1741
|
}
|
|
1718
1742
|
|
|
1743
|
+
// src/commands/version.ts
|
|
1744
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
1745
|
+
import { dirname, join as join3 } from "node:path";
|
|
1746
|
+
import { fileURLToPath } from "node:url";
|
|
1747
|
+
function version() {
|
|
1748
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
1749
|
+
const pkgPath = join3(here, "..", "package.json");
|
|
1750
|
+
try {
|
|
1751
|
+
const pkg = JSON.parse(readFileSync3(pkgPath, "utf8"));
|
|
1752
|
+
console.log(pkg.version ?? "unknown");
|
|
1753
|
+
} catch (err) {
|
|
1754
|
+
console.error(`[version] Failed to read version: ${err.message}`);
|
|
1755
|
+
process.exitCode = 1;
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1719
1759
|
// src/index.ts
|
|
1720
1760
|
var WORKERS = {
|
|
1721
1761
|
"exec-issue": execIssueWorker,
|
|
@@ -1737,6 +1777,7 @@ Commands:
|
|
|
1737
1777
|
install Add the claude-task-worker marketplace, install the plugin, and install/update the CLI
|
|
1738
1778
|
update Update the claude-task-worker plugin/marketplace and the CLI itself
|
|
1739
1779
|
usage Notify current usage to Slack
|
|
1780
|
+
version Print the installed claude-task-worker CLI version (aliases: --version, -v)
|
|
1740
1781
|
|
|
1741
1782
|
Workers:
|
|
1742
1783
|
exec-issue Poll issues and run /exec-issue
|
|
@@ -1766,6 +1807,10 @@ Example:
|
|
|
1766
1807
|
claude-task-worker yolo --epic 100 --epic 200 --label priority-high`);
|
|
1767
1808
|
}
|
|
1768
1809
|
var workerType = process.argv[2];
|
|
1810
|
+
if (workerType === "version" || workerType === "--version" || workerType === "-v") {
|
|
1811
|
+
version();
|
|
1812
|
+
process.exit(process.exitCode ?? 0);
|
|
1813
|
+
}
|
|
1769
1814
|
if (!workerType) {
|
|
1770
1815
|
printUsage();
|
|
1771
1816
|
process.exit(1);
|