claude-task-worker 0.136.0 → 0.137.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.
@@ -361,8 +361,11 @@ async function fetchPRChecks(prNumber) {
361
361
  if (!output) return [];
362
362
  return JSON.parse(output);
363
363
  }
364
+ function excludePrsByLabels(prs, excludeLabels) {
365
+ return prs.filter((pr) => !pr.labels.some((l) => excludeLabels.includes(l.name)));
366
+ }
367
+ var PR_LIST_FETCH_LIMIT = 50;
364
368
  async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], limit = 5) {
365
- const search = ["sort:created-asc", ...excludeLabels.map((l) => `-label:"${l}"`)].join(" ");
366
369
  const args = [
367
370
  "pr",
368
371
  "list",
@@ -371,9 +374,9 @@ async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], l
371
374
  "--json",
372
375
  "number,title,labels,headRefName",
373
376
  "--search",
374
- search,
377
+ "sort:created-asc",
375
378
  "--limit",
376
- String(limit)
379
+ String(PR_LIST_FETCH_LIMIT)
377
380
  ];
378
381
  if (assignee) {
379
382
  args.push("--assignee", assignee);
@@ -382,7 +385,7 @@ async function listPullRequestsWithChecks(assignee, label, excludeLabels = [], l
382
385
  args.push("--label", label);
383
386
  }
384
387
  const output = await execGh(args);
385
- const prs = JSON.parse(output);
388
+ const prs = excludePrsByLabels(JSON.parse(output), excludeLabels).slice(0, limit);
386
389
  const withChecks = await Promise.all(prs.map(async (pr) => ({ ...pr, checks: await fetchPRChecks(pr.number) })));
387
390
  return withChecks.filter((pr) => isCICompleted(pr.checks));
388
391
  }
package/dist/gh.d.ts CHANGED
@@ -85,6 +85,11 @@ export interface PullRequestWithChecks extends PullRequest {
85
85
  checks: PRCheck[];
86
86
  }
87
87
  export declare function isCICompleted(checks: PRCheck[]): boolean;
88
+ export declare function excludePrsByLabels<T extends {
89
+ labels: {
90
+ name: string;
91
+ }[];
92
+ }>(prs: T[], excludeLabels: string[]): T[];
88
93
  export declare function listPullRequestsWithChecks(assignee?: string, label?: string, excludeLabels?: string[], limit?: number): Promise<PullRequestWithChecks[]>;
89
94
  export declare function addLabel(type: "issue" | "pr", number: number, label: string): Promise<void>;
90
95
  export declare function addAssignee(type: "issue" | "pr", number: number, login: string): Promise<void>;
package/dist/index.js CHANGED
@@ -64,7 +64,7 @@ import {
64
64
  shutdown,
65
65
  waitForAllProcesses,
66
66
  writeLastRun
67
- } from "./chunk-NWYH24MB.js";
67
+ } from "./chunk-R4T3CDMO.js";
68
68
  import {
69
69
  UserConfigError,
70
70
  assertCloudCompatibleCommand,
package/dist/lib.js CHANGED
@@ -55,7 +55,7 @@ import {
55
55
  removeWorktreeByBranch,
56
56
  run,
57
57
  syncDefaultBranch
58
- } from "./chunk-NWYH24MB.js";
58
+ } from "./chunk-R4T3CDMO.js";
59
59
  import {
60
60
  getPermissionMode,
61
61
  getRunMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-task-worker",
3
- "version": "0.136.0",
3
+ "version": "0.137.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",