@pourkit/cli 0.0.0-next-20260613163823 → 0.0.0-next-20260613201753

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/cli.js CHANGED
@@ -8826,24 +8826,16 @@ function selectIssue(candidates, options = {}) {
8826
8826
  }
8827
8827
 
8828
8828
  // issues/blocked-issue.ts
8829
- function parseBlockedBy(body) {
8830
- if (!body) return [];
8831
- const bm = body.match(/## Blocked by\s*\n([\s\S]*?)(?=\n## |$)/i);
8832
- if (!bm) return [];
8833
- const refs = [];
8834
- const re = /#(\d+)/g;
8835
- let m;
8836
- while ((m = re.exec(bm[1])) !== null) {
8837
- refs.push(Number(m[1]));
8838
- }
8839
- return refs;
8840
- }
8841
8829
  async function reconcileBlockedIssue(issue, deps) {
8842
- const blockers = parseBlockedBy(issue.body);
8843
- if (blockers.length === 0) {
8830
+ const parsedBlockers = parseBlockedByRefs(issue.body);
8831
+ if (!parsedBlockers.hasSection) {
8844
8832
  await deps.transitions.moveToNeedsTriage(issue.number);
8845
8833
  return "needs-triage";
8846
8834
  }
8835
+ const blockers = await resolveBlockedRefs(parsedBlockers.refs, issue, deps);
8836
+ if (blockers.length === 0) {
8837
+ return "still-blocked";
8838
+ }
8847
8839
  const stillBlocked = await anyBlockerStillOpen(blockers, deps.getIssueState);
8848
8840
  if (stillBlocked) {
8849
8841
  return "still-blocked";
@@ -8861,6 +8853,37 @@ async function reconcileBlockedIssue(issue, deps) {
8861
8853
  await deps.transitions.moveToNeedsTriage(issue.number);
8862
8854
  return "needs-triage";
8863
8855
  }
8856
+ function parseBlockedByRefs(body) {
8857
+ if (!body) return { hasSection: false, refs: [] };
8858
+ const bm = body.match(/## Blocked by\s*\n([\s\S]*?)(?=\n## |$)/i);
8859
+ if (!bm) return { hasSection: false, refs: [] };
8860
+ const refs = [];
8861
+ const re = /#(\d+)|\bI-\d+\b/gi;
8862
+ let m;
8863
+ while ((m = re.exec(bm[1])) !== null) {
8864
+ refs.push((m[1] ? `#${m[1]}` : m[0]).toUpperCase());
8865
+ }
8866
+ return { hasSection: true, refs: Array.from(new Set(refs)) };
8867
+ }
8868
+ async function resolveBlockedRefs(refs, issue, deps) {
8869
+ const resolved = [];
8870
+ for (const ref of refs) {
8871
+ const issueNumber = parseGitHubIssueRef(ref);
8872
+ if (issueNumber !== null) {
8873
+ resolved.push(issueNumber);
8874
+ continue;
8875
+ }
8876
+ const siblingNumber = deps.resolveIssueRef ? await deps.resolveIssueRef(ref, issue) : null;
8877
+ if (siblingNumber !== null) {
8878
+ resolved.push(siblingNumber);
8879
+ }
8880
+ }
8881
+ return Array.from(new Set(resolved));
8882
+ }
8883
+ function parseGitHubIssueRef(ref) {
8884
+ const match = ref.match(/^#?(\d+)$/);
8885
+ return match ? Number(match[1]) : null;
8886
+ }
8864
8887
  async function reconcileBlockedIssues(issues, deps) {
8865
8888
  const results = [];
8866
8889
  for (const issue of issues) {
@@ -9009,6 +9032,16 @@ function makeReconcileDeps(options) {
9009
9032
  const issue = await options.issueProvider.fetchIssue(issueNumber);
9010
9033
  return issue.state === "closed" ? "CLOSED" : "OPEN";
9011
9034
  },
9035
+ resolveIssueRef: async (ref, issue) => {
9036
+ const parentRef = options.prdRef ?? parseStackedIssue(issue.title ?? "", issue.body).parentRef;
9037
+ if (!parentRef) return null;
9038
+ const related = await options.issueProvider.listRelatedIssues(parentRef);
9039
+ const expectedPrefix = `${parentRef} / ${ref.toUpperCase()}:`;
9040
+ const match = related.find(
9041
+ (candidate) => candidate.title.toUpperCase().startsWith(expectedPrefix)
9042
+ );
9043
+ return match?.number ?? null;
9044
+ },
9012
9045
  transitions,
9013
9046
  typeLabels: TYPE_LABELS,
9014
9047
  readyLabel: options.config.labels.readyForAgent
@@ -13040,6 +13073,7 @@ var GitHubIssueProvider = class {
13040
13073
  );
13041
13074
  return data.filter((issue) => !issue.pull_request).map((issue) => ({
13042
13075
  number: issue.number,
13076
+ title: issue.title,
13043
13077
  body: issue.body ?? null,
13044
13078
  labels: issue.labels.map((l) => ({
13045
13079
  name: typeof l === "string" ? l : l.name ?? ""
@@ -14447,11 +14481,11 @@ function createCliProgram(version) {
14447
14481
  return program;
14448
14482
  }
14449
14483
  async function resolveCliVersion() {
14450
- if (isPackageVersion("0.0.0-next-20260613163823")) {
14451
- return "0.0.0-next-20260613163823";
14484
+ if (isPackageVersion("0.0.0-next-20260613201753")) {
14485
+ return "0.0.0-next-20260613201753";
14452
14486
  }
14453
- if (isReleaseVersion("0.0.0-next-20260613163823")) {
14454
- return "0.0.0-next-20260613163823";
14487
+ if (isReleaseVersion("0.0.0-next-20260613201753")) {
14488
+ return "0.0.0-next-20260613201753";
14455
14489
  }
14456
14490
  try {
14457
14491
  const root = repoRoot();