pr-shepherd 2.2.3 → 2.2.4
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/.claude-plugin/plugin.json +1 -2
- package/README.md +2 -2
- package/bin/github/batch-response.mjs +4 -1
- package/bin/github/check-suite-nodes.d.mts +17 -0
- package/bin/github/check-suite-nodes.mjs +14 -0
- package/bin/github/poll-summary-check-hydration.mjs +2 -0
- package/bin/github/stack-handoff-page.mjs +2 -0
- package/bin/index.mjs +3 -0
- package/package.json +1 -3
- package/plugins/pr-shepherd/.claude-plugin/plugin.json +1 -2
- package/plugins/pr-shepherd/.codex-plugin/plugin.json +1 -2
- package/plugins/pr-shepherd/.codex.mcp.json +0 -8
- package/plugins/pr-shepherd/.mcp.json +0 -6
- package/plugins/pr-shepherd/package-lock.json +0 -1278
- package/plugins/pr-shepherd/package.json +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-shepherd",
|
|
3
3
|
"description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jonathan Ong",
|
|
7
7
|
"email": "jonathanrichardong@gmail.com"
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"keywords": ["github", "pull-request", "ci", "code-review", "automation"],
|
|
13
13
|
"skills": "./plugins/pr-shepherd/skills/",
|
|
14
|
-
"mcpServers": "./plugins/pr-shepherd/.mcp.json",
|
|
15
14
|
"hooks": {
|
|
16
15
|
"PreToolUse": [
|
|
17
16
|
{
|
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ More features are in [docs/features.md](docs/features.md).
|
|
|
81
81
|
|
|
82
82
|
## Install
|
|
83
83
|
|
|
84
|
-
The plugin
|
|
84
|
+
The plugin ships the skills, which drive the CLI, so install both.
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
# Claude Code
|
|
@@ -101,7 +101,7 @@ pnpm i -g pr-shepherd
|
|
|
101
101
|
|
|
102
102
|
Use one package manager for global installs, because a second global copy shadows the first (`which -a pr-shepherd` lists every copy).
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
The plugin is the CLI plus skills; it does not start the MCP server. For why, and to register the server yourself, see [docs/mcp.md](docs/mcp.md#why-the-plugin-does-not-start-it).
|
|
105
105
|
|
|
106
106
|
Requirements:
|
|
107
107
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EXIT, ShepherdError } from "../exit-codes.mjs";
|
|
2
2
|
import { GitHubRequestError } from "./errors.mjs";
|
|
3
|
+
import { dropUnreadableSuites } from "./check-suite-nodes.mjs";
|
|
3
4
|
export function requireRawPr(response, pr, repo) {
|
|
4
5
|
if (!response?.repository) {
|
|
5
6
|
throw new GitHubRequestError(`GitHub GraphQL response did not include repository ${repo.owner}/${repo.name} (not found or access denied)`, { status: 200 });
|
|
@@ -7,7 +8,9 @@ export function requireRawPr(response, pr, repo) {
|
|
|
7
8
|
if (!response.repository.pullRequest) {
|
|
8
9
|
throw new ShepherdError(`PR #${pr} not found`, EXIT.UNAVAILABLE);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
+
const raw = response.repository.pullRequest;
|
|
12
|
+
dropUnreadableSuites(raw.commits?.nodes[0]?.commit);
|
|
13
|
+
return raw;
|
|
11
14
|
}
|
|
12
15
|
export function requireContextNodes(nodes) {
|
|
13
16
|
const nullIndex = nodes.findIndex((node) => node === null);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface SuiteCommit {
|
|
2
|
+
checkSuites?: {
|
|
3
|
+
pageInfo?: {
|
|
4
|
+
hasNextPage: boolean;
|
|
5
|
+
};
|
|
6
|
+
nodes: unknown[];
|
|
7
|
+
} | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* GitHub can return `null` in place of a check suite it has not finished
|
|
11
|
+
* creating or cannot read (seen in a PR's first seconds, with no GraphQL error).
|
|
12
|
+
* Nothing is known about such a suite, so it is dropped rather than guessed at,
|
|
13
|
+
* and the page is marked as not fully read: consumers already treat an unread
|
|
14
|
+
* suite page as unverified, which fails readiness closed instead of crashing.
|
|
15
|
+
*/
|
|
16
|
+
export declare function dropUnreadableSuites(commit: SuiteCommit | null | undefined): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub can return `null` in place of a check suite it has not finished
|
|
3
|
+
* creating or cannot read (seen in a PR's first seconds, with no GraphQL error).
|
|
4
|
+
* Nothing is known about such a suite, so it is dropped rather than guessed at,
|
|
5
|
+
* and the page is marked as not fully read: consumers already treat an unread
|
|
6
|
+
* suite page as unverified, which fails readiness closed instead of crashing.
|
|
7
|
+
*/
|
|
8
|
+
export function dropUnreadableSuites(commit) {
|
|
9
|
+
const suites = commit?.checkSuites;
|
|
10
|
+
if (!suites || !suites.nodes.includes(null))
|
|
11
|
+
return;
|
|
12
|
+
suites.nodes = suites.nodes.filter((node) => node !== null);
|
|
13
|
+
suites.pageInfo = { ...suites.pageInfo, hasNextPage: true };
|
|
14
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { githubOperation } from "./transport.mjs";
|
|
2
|
+
import { dropUnreadableSuites } from "./check-suite-nodes.mjs";
|
|
2
3
|
import { readRestCommitChecks } from "./rest-check-read.mjs";
|
|
3
4
|
import { graphqlWithRateLimit } from "./client.mjs";
|
|
4
5
|
import { POLL_SUMMARY_CHECK_PAGE_QUERY } from "./queries.mjs";
|
|
@@ -13,6 +14,7 @@ import { POLL_SUMMARY_CHECK_PAGE_QUERY } from "./queries.mjs";
|
|
|
13
14
|
*/
|
|
14
15
|
export async function hydratePollSummaryChecks(raw, repo) {
|
|
15
16
|
const headCommit = raw.commits.nodes[0]?.commit;
|
|
17
|
+
dropUnreadableSuites(headCommit);
|
|
16
18
|
if (headCommit)
|
|
17
19
|
await hydrateCommitContexts(headCommit, repo);
|
|
18
20
|
const queueCommit = raw.mergeQueueEntry?.headCommit;
|
|
@@ -42,6 +42,8 @@ export function summaryComplete(layer, source) {
|
|
|
42
42
|
const commit = headCommit(layer);
|
|
43
43
|
if (!commit || commit.oid !== layer.headRefOid || !commit.checkSuites?.pageInfo)
|
|
44
44
|
return false;
|
|
45
|
+
if (commit.checkSuites.nodes.includes(null))
|
|
46
|
+
return false;
|
|
45
47
|
const contexts = commit.statusCheckRollup?.contexts;
|
|
46
48
|
if (contexts &&
|
|
47
49
|
(contexts.pageInfo.hasPreviousPage ||
|
package/bin/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { main } from "./cli-parser.mjs";
|
|
11
11
|
import { errorToExitCode } from "./exit-codes.mjs";
|
|
12
12
|
import { formatCliError } from "./cli/error-format.mjs";
|
|
13
|
+
import { appendEntry } from "./log/log-file.mjs";
|
|
13
14
|
function formatCause(cause, seen = new Set(), depth = 0) {
|
|
14
15
|
if (depth > 5 || seen.has(cause))
|
|
15
16
|
return "[circular or deep cause chain]";
|
|
@@ -23,6 +24,8 @@ function formatCause(cause, seen = new Set(), depth = 0) {
|
|
|
23
24
|
}
|
|
24
25
|
main(process.argv).catch((err) => {
|
|
25
26
|
const msg = formatCliError(err);
|
|
27
|
+
// The terminal gets the message only; the stack goes to the debug log (a no-op when it is off).
|
|
28
|
+
appendEntry(`## Unhandled error\n\n\`\`\`\n${formatCause(err)}\n\`\`\`\n\n`);
|
|
26
29
|
const causeStr = err instanceof Error && err.cause != null ? formatCause(err.cause) : null;
|
|
27
30
|
process.stderr.write(`pr-shepherd error: ${msg}${causeStr !== null ? ` (cause: ${causeStr})` : ""}\n`);
|
|
28
31
|
process.exit(errorToExitCode(err));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-shepherd",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"bin/**",
|
|
31
|
-
"plugins/**/.mcp.json",
|
|
32
|
-
"plugins/**/.codex.mcp.json",
|
|
33
31
|
"src/classify/types.mts",
|
|
34
32
|
"plugins/**",
|
|
35
33
|
"plugins/**/.codex-plugin/**",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-shepherd",
|
|
3
3
|
"description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jonathan Ong",
|
|
7
7
|
"email": "jonathanrichardong@gmail.com"
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"keywords": ["github", "pull-request", "ci", "code-review", "automation"],
|
|
13
13
|
"skills": "./skills/",
|
|
14
|
-
"mcpServers": "./.mcp.json",
|
|
15
14
|
"userConfig": {
|
|
16
15
|
"poll_guard": {
|
|
17
16
|
"type": "string",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-shepherd",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Autonomous PR CI monitor and review-comment resolver for Codex.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jonathan Ong",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"keywords": ["github", "pull-request", "ci", "code-review", "automation", "codex"],
|
|
14
14
|
"skills": "./skills/",
|
|
15
|
-
"mcpServers": "./.codex.mcp.json",
|
|
16
15
|
"interface": {
|
|
17
16
|
"displayName": "pr-shepherd",
|
|
18
17
|
"shortDescription": "Monitor PR CI and review comments from Codex",
|