pr-shepherd 0.48.0 → 0.49.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 (53) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +12 -0
  3. package/bin/api.d.mts +19 -3
  4. package/bin/api.mjs +57 -8
  5. package/bin/classify/apply.d.mts +2 -0
  6. package/bin/classify/apply.mjs +1 -1
  7. package/bin/cli/default-poll.mjs +1 -0
  8. package/bin/cli/help-command-pages.d.mts +1 -1
  9. package/bin/cli/help-iterate-poll-pages.d.mts +1 -1
  10. package/bin/cli/help-iterate-poll-pages.mjs +10 -5
  11. package/bin/cli/help-top-page.d.mts +1 -1
  12. package/bin/cli/help-top-page.mjs +5 -3
  13. package/bin/cli/help.d.mts +2 -2
  14. package/bin/cli/poll-handler.mjs +25 -4
  15. package/bin/cli/poll-summary-emitter.d.mts +4 -0
  16. package/bin/cli/poll-summary-emitter.mjs +22 -0
  17. package/bin/cli/poll-summary-formatter.d.mts +2 -0
  18. package/bin/cli/poll-summary-formatter.mjs +96 -0
  19. package/bin/cli/poll-targets.d.mts +15 -0
  20. package/bin/cli/poll-targets.mjs +114 -0
  21. package/bin/cli/validate-default-args.mjs +1 -4
  22. package/bin/commands/poll-summary.d.mts +10 -0
  23. package/bin/commands/poll-summary.mjs +163 -0
  24. package/bin/commands/ready-delay.d.mts +3 -1
  25. package/bin/commands/ready-delay.mjs +3 -2
  26. package/bin/github/gql/poll-stack-summary.gql +33 -0
  27. package/bin/github/gql/poll-summary-fragment.gql +198 -0
  28. package/bin/github/poll-summary-checks.d.mts +3 -0
  29. package/bin/github/poll-summary-checks.mjs +61 -0
  30. package/bin/github/poll-summary-projector.d.mts +4 -0
  31. package/bin/github/poll-summary-projector.mjs +81 -0
  32. package/bin/github/poll-summary-raw.d.mts +134 -0
  33. package/bin/github/poll-summary-raw.mjs +1 -0
  34. package/bin/github/poll-summary-review.d.mts +4 -0
  35. package/bin/github/poll-summary-review.mjs +85 -0
  36. package/bin/github/poll-summary-route.d.mts +4 -0
  37. package/bin/github/poll-summary-route.mjs +47 -0
  38. package/bin/github/poll-summary.d.mts +7 -0
  39. package/bin/github/poll-summary.mjs +110 -0
  40. package/bin/github/queries.d.mts +4 -0
  41. package/bin/github/queries.mjs +4 -0
  42. package/bin/mcp/server.mjs +39 -6
  43. package/bin/pr-reference.d.mts +2 -0
  44. package/bin/pr-reference.mjs +4 -0
  45. package/bin/types/poll-summary.d.mts +82 -0
  46. package/bin/types/poll-summary.mjs +1 -0
  47. package/bin/types.d.mts +1 -0
  48. package/bin/types.mjs +1 -0
  49. package/package.json +1 -1
  50. package/plugins/pr-shepherd/.codex-plugin/plugin.json +1 -1
  51. package/plugins/pr-shepherd/.codex.mcp.json +1 -1
  52. package/plugins/pr-shepherd/.mcp.json +1 -1
  53. package/plugins/pr-shepherd/skills/pr-shepherd/SKILL.md +2 -2
@@ -0,0 +1,82 @@
1
+ import type { ApiUsage, GraphqlQuotaWarning } from "./api-usage.mts";
2
+ import type { MergeableState, MergeStateStatus, ReviewDecision } from "./github.mts";
3
+ import type { ShepherdAction } from "./iterate.mts";
4
+ export interface PollSummaryChecks {
5
+ passing?: number;
6
+ failing?: number;
7
+ inProgress?: number;
8
+ skipped?: number;
9
+ filtered?: number;
10
+ ignored?: number;
11
+ superseded?: number;
12
+ incomplete?: true;
13
+ }
14
+ export interface PollSummaryReview {
15
+ comments?: number;
16
+ reviews?: number;
17
+ threads?: number;
18
+ actionable?: number;
19
+ incomplete?: true;
20
+ }
21
+ interface PollSummaryStack {
22
+ number: number;
23
+ size: number;
24
+ position: number;
25
+ baseRefName: string;
26
+ }
27
+ export interface PollSummaryItem {
28
+ pr: number;
29
+ repo: string;
30
+ title: string;
31
+ url: string;
32
+ /** Conservative routing hint; the selected one-PR poll makes the authoritative decision. */
33
+ action: ShepherdAction;
34
+ reasons: string[];
35
+ state: "OPEN" | "CLOSED" | "MERGED" | "UNKNOWN";
36
+ mergeable: MergeableState;
37
+ mergeStateStatus: MergeStateStatus;
38
+ reviewDecision?: ReviewDecision;
39
+ headRefName: string;
40
+ headRefOid: string;
41
+ baseRefName: string;
42
+ isDraft?: true;
43
+ isInMergeQueue?: true;
44
+ blockingReviewerInProgress?: true;
45
+ remainingSeconds?: number;
46
+ checks?: PollSummaryChecks;
47
+ review?: PollSummaryReview;
48
+ stack?: PollSummaryStack;
49
+ pollCommand?: string;
50
+ }
51
+ export type PollSummarySelection = {
52
+ kind: "prs";
53
+ requested: number[];
54
+ } | {
55
+ kind: "stack";
56
+ anchor: number;
57
+ stackNumber: number;
58
+ stackSize: number;
59
+ };
60
+ export interface PollSummaryResult {
61
+ mode: "summary";
62
+ repo: string;
63
+ selection: PollSummarySelection;
64
+ reason: "actionable" | "all_terminal" | "waiting" | "timeout";
65
+ prs: PollSummaryItem[];
66
+ apiUsage?: ApiUsage;
67
+ quotaWarning?: GraphqlQuotaWarning;
68
+ }
69
+ export interface PollSummaryCommandOptions {
70
+ prNumbers?: number[];
71
+ stackPrNumber?: number;
72
+ targetRepository?: {
73
+ owner: string;
74
+ name: string;
75
+ };
76
+ merge?: boolean;
77
+ readyDelaySeconds?: number;
78
+ stallTimeoutSeconds?: number;
79
+ noAutoMarkReady?: boolean;
80
+ noAutoCancelActionable?: boolean;
81
+ }
82
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/bin/types.d.mts CHANGED
@@ -13,3 +13,4 @@ export * from "./types/merge-action.mts";
13
13
  export * from "./types/escalate.mts";
14
14
  export * from "./types/merge-queue.mts";
15
15
  export * from "./types/api-usage.mts";
16
+ export * from "./types/poll-summary.mts";
package/bin/types.mjs CHANGED
@@ -13,3 +13,4 @@ export * from "./types/merge-action.mjs";
13
13
  export * from "./types/escalate.mjs";
14
14
  export * from "./types/merge-queue.mjs";
15
15
  export * from "./types/api-usage.mjs";
16
+ export * from "./types/poll-summary.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
5
5
  "keywords": [
6
6
  "automation",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for Codex.",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "pr-shepherd": {
4
4
  "command": "npx",
5
- "args": ["--yes", "--package", "pr-shepherd@0.48.0", "pr-shepherd-mcp"]
5
+ "args": ["--yes", "--package", "pr-shepherd@0.49.0", "pr-shepherd-mcp"]
6
6
  }
7
7
  }
8
8
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "pr-shepherd": {
3
3
  "command": "npx",
4
- "args": ["--yes", "--package", "pr-shepherd@0.48.0", "pr-shepherd-mcp"]
4
+ "args": ["--yes", "--package", "pr-shepherd@0.49.0", "pr-shepherd-mcp"]
5
5
  }
6
6
  }
@@ -18,9 +18,9 @@ If the requested PR does not exist yet, review and commit the in-scope changes,
18
18
 
19
19
  ## Arguments: $ARGUMENTS
20
20
 
21
- 1. Parse an optional PR number, repository-qualified `owner/repo#N`, or GitHub PR URL and an optional `--merge` flag from `$ARGUMENTS`; otherwise let pr-shepherd infer the current branch PR. Reject any remaining argument. Follow the target repository's local `AGENTS.md` and `CLAUDE.md` standards while making changes.
21
+ 1. Parse optional PR numbers, repository-qualified `owner/repo#N` references, or GitHub PR URLs and an optional `--merge` flag from `$ARGUMENTS`; alternatively parse one `--stack PR` selector. Otherwise let pr-shepherd infer the current branch PR. Reject any remaining argument. Follow the target repository's local `AGENTS.md` and `CLAUDE.md` standards while making changes.
22
22
 
23
- 2. For the CLI, convert supplied `owner/repo#N` to `https://github.com/owner/repo/pull/N`; otherwise pass the supplied URL or bare number unchanged, then run the canonical poll command `pr-shepherd [PR] --until-terminal`, omitting `[PR]` when none was supplied and appending `--merge` when requested. This command keeps ordinary `[WAIT]` and `[MARK_READY]` ticks inside the same invocation; it returns for agent-facing work (including an emitted `[MERGE]` command, which is non-terminal and must run before the next invocation), a quota warning, `[CANCEL]`, or `[ESCALATE]`. A qualified reference may name a fork or upstream repository: it is the GitHub target, while the current checkout continues to supply local git/config/rules context. Do not run `pr-shepherd iterate`. If the CLI is unavailable and the `iterate` MCP tool is available, first obtain a repository-qualified reference: use a supplied GitHub PR URL or `owner/repo#N` unchanged; for a bare number, run `gh pr view <number> --json url --jq .url`; when omitted, run `gh pr view --json url --jq .url`. If that does not produce one qualified PR reference, stop and report that MCP cannot safely determine the PR. Otherwise call `iterate` with that qualified reference, plus `merge: true` when `--merge` was supplied, and print its full result.
23
+ 2. For the CLI, convert supplied `owner/repo#N` references to `https://github.com/owner/repo/pull/N`; otherwise pass supplied URLs or bare numbers unchanged, then run `pr-shepherd [PR ...] --until-terminal`, or `pr-shepherd --stack PR --until-terminal` for a stack, omitting `[PR ...]` when none was supplied and appending `--merge` when requested. This command keeps ordinary `[WAIT]` and `[MARK_READY]` ticks inside the same invocation; aggregate selectors return when any row needs work or all rows are terminal. It also returns for a quota warning or an emitted `[MERGE]` command, which is non-terminal and must run before the next invocation. A qualified reference may name a fork or upstream repository: it is the GitHub target, while the current checkout continues to supply local git/config/rules context. Do not run `pr-shepherd iterate`. If the CLI is unavailable and the `iterate` MCP tool is available, first repository-qualify every supplied reference with its GitHub URL or `owner/repo#N`; resolve bare numbers through `gh pr view <number> --json url --jq .url`, and resolve an omitted target with `gh pr view --json url --jq .url`. If that does not produce the required qualified selector, stop and report that MCP cannot safely determine it. Otherwise call `iterate` with `pr`, `prs`, or `stack` as selected, plus `merge: true` when `--merge` was supplied, and print its full result.
24
24
 
25
25
  3. Print the full result and follow every returned `## Instructions` step exactly. For CLI output, run each printed mutation command when instructed. For MCP output, use MCP `apply` and `build_suggestion_patches` with the same qualified PR reference; do not run a shell `pr-shepherd apply` command.
26
26