claude-task-worker 0.83.0 → 0.84.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3287,7 +3287,7 @@ function createIssuePollingWorker(config) {
3287
3287
  }
3288
3288
  try {
3289
3289
  if (status === "completed") {
3290
- const verified = await config.onCompleted?.(issue.number, worktreeId) ?? true;
3290
+ const verified = await config.onCompleted?.(issue.number, worktreeId, output) ?? true;
3291
3291
  if (verified === false) {
3292
3292
  await notifyTaskFailed(config.name, name, issue.number, issue.title, issueUrl, output);
3293
3293
  } else {
@@ -3333,11 +3333,22 @@ function createIssuePollingWorker(config) {
3333
3333
  }
3334
3334
 
3335
3335
  // src/workers/exec-issue.ts
3336
- function prMissingComment(worktreeId) {
3336
+ var REPORT_TAIL_LIMIT = 3e3;
3337
+ function formatSessionReport(output) {
3338
+ const trimmed = output.trim();
3339
+ if (trimmed === "") return "\uFF08\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u51FA\u529B\u306F\u3042\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF09";
3340
+ const tail = trimmed.length > REPORT_TAIL_LIMIT ? `\u2026\uFF08\u5148\u982D\u3092\u7701\u7565\uFF09
3341
+ ${trimmed.slice(-REPORT_TAIL_LIMIT)}` : trimmed;
3342
+ return ["```", tail, "```"].join("\n");
3343
+ }
3344
+ function prMissingComment(worktreeId, output) {
3337
3345
  return [
3338
3346
  "## PR\u672A\u4F5C\u6210\u306E\u307E\u307E\u81EA\u52D5\u5B9F\u884C\u304C\u7D42\u4E86\u3057\u307E\u3057\u305F\uFF08\u8981\u4EBA\u624B\u78BA\u8A8D\uFF09",
3339
3347
  `exec-issue \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306F\u6B63\u5E38\u7D42\u4E86\uFF08exit 0\uFF09\u3057\u307E\u3057\u305F\u304C\u3001\u3053\u306E\u5B9F\u884C\u306E\u4F5C\u696D\u30D6\u30E9\u30F3\u30C1\uFF08\`${worktreeId}\`\uFF09\u3092 head \u3068\u3059\u308BPR\u3082\u3001\u672CIssue\u3092 closing \u53C2\u7167\u3059\u308BPR\u3082\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002PR\u4F5C\u6210\u524D\u306B\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u7D42\u4E86\u3057\u305F\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002`,
3340
3348
  "",
3349
+ "## PR\u3092\u4F5C\u6210\u3057\u306A\u304B\u3063\u305F\u7406\u7531\uFF08\u30BB\u30C3\u30B7\u30E7\u30F3\u306E\u6700\u7D42\u5831\u544A\uFF09",
3350
+ formatSessionReport(output),
3351
+ "",
3341
3352
  "## \u72B6\u614B\u306E\u78BA\u8A8D",
3342
3353
  `- \u5909\u66F4\u304C push \u6E08\u307F\u306E\u5834\u5408\u306F\u30EA\u30E2\u30FC\u30C8\u30D6\u30E9\u30F3\u30C1 \`${worktreeId}\` \u304C\u6B8B\u3063\u3066\u3044\u307E\u3059\u3002\u5185\u5BB9\u3092\u78BA\u8A8D\u3057\u3001\u5FC5\u8981\u306A\u3089\u624B\u52D5\u3067PR\u3092\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044`,
3343
3354
  "",
@@ -3352,7 +3363,7 @@ var execIssueWorker = (opts = {}) => createIssuePollingWorker({
3352
3363
  triggerLabels: ["cc-exec-issue"],
3353
3364
  epicFilters: opts.epicFilters,
3354
3365
  labelFilters: opts.labelFilters,
3355
- onCompleted: async (issueNumber, worktreeId) => {
3366
+ onCompleted: async (issueNumber, worktreeId, output) => {
3356
3367
  if (await hasLabel("issue", issueNumber, "cc-need-human-check")) {
3357
3368
  console.log(`[exec-issue] #${issueNumber}: cc-need-human-check present, skip cc-pr-created`);
3358
3369
  return false;
@@ -3370,7 +3381,7 @@ var execIssueWorker = (opts = {}) => createIssuePollingWorker({
3370
3381
  `[exec-issue] #${issueNumber}: session exited without a PR (branch: ${worktreeId}); marking cc-need-human-check`
3371
3382
  );
3372
3383
  await addLabel("issue", issueNumber, "cc-need-human-check");
3373
- await commentOnIssue(issueNumber, prMissingComment(worktreeId)).catch(
3384
+ await commentOnIssue(issueNumber, prMissingComment(worktreeId, output)).catch(
3374
3385
  (err) => console.error(`[exec-issue] commentOnIssue failed for #${issueNumber}: ${err}`)
3375
3386
  );
3376
3387
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-task-worker",
3
- "version": "0.83.0",
3
+ "version": "0.84.0",
4
4
  "description": "CLI tool that polls GitHub Issues/PRs and delegates work to Claude CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",