pr-shepherd 0.23.0 → 0.25.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 (61) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +4 -2
  3. package/bin/cli/args.mjs +0 -1
  4. package/bin/cli/fix-formatter.mjs +2 -1
  5. package/bin/cli/formatters.mjs +0 -62
  6. package/bin/cli/help-command-pages.mjs +4 -10
  7. package/bin/cli/help-top-page.mjs +1 -1
  8. package/bin/cli/iterate-instructions.mjs +1 -1
  9. package/bin/cli/list-formatters.mjs +3 -2
  10. package/bin/cli-parser.mjs +28 -27
  11. package/bin/commands/check.mjs +6 -2
  12. package/bin/commands/commit-suggestion-instruction.mjs +3 -3
  13. package/bin/commands/iterate/classify.mjs +13 -7
  14. package/bin/commands/iterate/fix-code.mjs +2 -2
  15. package/bin/commands/iterate/index.mjs +4 -1
  16. package/bin/commands/iterate/render.mjs +3 -0
  17. package/bin/commands/iterate/stall.mjs +1 -1
  18. package/bin/commands/resolve-mutate.mjs +14 -6
  19. package/bin/commands/resolve.mjs +0 -72
  20. package/bin/comments/authors.mjs +19 -1
  21. package/bin/comments/minimize-policy.mjs +6 -5
  22. package/bin/comments/review-thread-markers.mjs +18 -0
  23. package/bin/comments/thread-visibility.mjs +5 -5
  24. package/bin/comments/visible-comments.mjs +2 -2
  25. package/bin/config/load.mjs +7 -0
  26. package/bin/config.json +15 -2
  27. package/bin/github/batch-parsers.mjs +2 -0
  28. package/bin/github/client.mjs +1 -2
  29. package/bin/github/gql/batch-pr.gql +3 -0
  30. package/bin/reporters/agent.mjs +1 -0
  31. package/bin/state/seen-comments.mjs +40 -4
  32. package/package.json +9 -5
  33. package/plugins/pr-shepherd/.codex-plugin/plugin.json +1 -1
  34. package/bin/checks/triage.test-support.mjs +0 -60
  35. package/bin/cli/iterate-lean.test-support.mjs +0 -3
  36. package/bin/cli-parser.clean.test-support.mjs +0 -44
  37. package/bin/cli-parser.commit-suggestion.test-support.mjs +0 -65
  38. package/bin/cli-parser.iterate-fix.test-support.mjs +0 -43
  39. package/bin/cli-parser.iterate-fixtures.mjs +0 -75
  40. package/bin/cli-parser.iterate.test-support.mjs +0 -44
  41. package/bin/cli-parser.test-support.mjs +0 -47
  42. package/bin/commands/check.test-support.mjs +0 -147
  43. package/bin/commands/clean.test-support.mjs +0 -47
  44. package/bin/commands/commit-suggestion.apply.test-support.mjs +0 -87
  45. package/bin/commands/commit-suggestion.test-support.mjs +0 -112
  46. package/bin/commands/iterate-stall.test-support.mjs +0 -24
  47. package/bin/commands/iterate-test-support.mjs +0 -150
  48. package/bin/commands/iterate-thread-test-support.mjs +0 -18
  49. package/bin/commands/iterate.fix-code-in-progress.test-support.mjs +0 -127
  50. package/bin/commands/poll.test-support.mjs +0 -77
  51. package/bin/commands/resolve-instructions.mjs +0 -59
  52. package/bin/commands/resolve.test-support.mjs +0 -116
  53. package/bin/commands/shepherd-journal.test-support.mjs +0 -7
  54. package/bin/comments/outdated.mjs +0 -15
  55. package/bin/comments/resolve.test-support.mjs +0 -44
  56. package/bin/github/batch-parsers.test-support.mjs +0 -66
  57. package/bin/github/batch.test-support.mjs +0 -66
  58. package/bin/github/client.test-support.mjs +0 -55
  59. package/bin/github/http.test-support.mjs +0 -51
  60. package/bin/state/seen-comments.test-support.mjs +0 -19
  61. package/bin/suggestions/patch.test-support.mjs +0 -2
@@ -1,51 +0,0 @@
1
- import { vi, beforeEach } from "vitest";
2
- // ---------------------------------------------------------------------------
3
- // Stub fetch and child_process globally before any imports.
4
- // ---------------------------------------------------------------------------
5
- const mockFetch = vi.fn();
6
- vi.stubGlobal("fetch", mockFetch);
7
- const { mockExecFile } = vi.hoisted(() => ({ mockExecFile: vi.fn() }));
8
- vi.mock("node:child_process", () => ({
9
- execFile: (cmd, args, optsOrCb, maybeCb) => {
10
- const cb = typeof optsOrCb === "function" ? optsOrCb : maybeCb;
11
- mockExecFile(cmd, args)
12
- .then((result) => cb(null, result))
13
- .catch((err) => cb(err, { stdout: "", stderr: "" }));
14
- },
15
- }));
16
- import { GitHubRequestError, graphql, graphqlWithRateLimit, rest, restText, _resetTokenCache, } from "./http.mjs";
17
- // ---------------------------------------------------------------------------
18
- // Helpers
19
- // ---------------------------------------------------------------------------
20
- function jsonOk(data) {
21
- return {
22
- ok: true,
23
- status: 200,
24
- headers: new Headers({ "content-type": "application/json" }),
25
- json: () => Promise.resolve(data),
26
- text: () => Promise.resolve(JSON.stringify(data)),
27
- };
28
- }
29
- function gqlOk(data) {
30
- return {
31
- ok: true,
32
- status: 200,
33
- headers: new Headers({ "content-type": "application/json" }),
34
- json: () => Promise.resolve({ data }),
35
- text: () => Promise.resolve(JSON.stringify({ data })),
36
- };
37
- }
38
- // ---------------------------------------------------------------------------
39
- // Token resolution
40
- // ---------------------------------------------------------------------------
41
- export function registerHooks() {
42
- beforeEach(() => {
43
- mockFetch.mockReset();
44
- mockExecFile.mockReset();
45
- _resetTokenCache();
46
- delete process.env["GH_TOKEN"];
47
- delete process.env["GITHUB_TOKEN"];
48
- delete process.env["GITHUB_PERSONAL_ACCESS_TOKEN"];
49
- });
50
- }
51
- export { GitHubRequestError, _resetTokenCache, gqlOk, graphql, graphqlWithRateLimit, jsonOk, mockExecFile, mockFetch, rest, restText, };
@@ -1,19 +0,0 @@
1
- import { beforeEach, afterEach } from "vitest";
2
- import { randomBytes, createHash } from "node:crypto";
3
- import { rm } from "node:fs/promises";
4
- export function idToFilename(id) {
5
- return createHash("sha256").update(id, "utf8").digest("hex") + ".json";
6
- }
7
- export const testKey = { owner: "test-owner", repo: "test-repo", pr: 123 };
8
- export const testId = "PRRT_kwDOTest123";
9
- export let testStateDir;
10
- export function registerHooks() {
11
- beforeEach(() => {
12
- testStateDir = `${process.env["TMPDIR"] ?? "/tmp"}/shepherd-seen-test-${randomBytes(4).toString("hex")}`;
13
- process.env["PR_SHEPHERD_STATE_DIR"] = testStateDir;
14
- });
15
- afterEach(async () => {
16
- delete process.env["PR_SHEPHERD_STATE_DIR"];
17
- await rm(testStateDir, { recursive: true, force: true });
18
- });
19
- }
@@ -1,2 +0,0 @@
1
- import { buildUnifiedDiff } from "./patch.mjs";
2
- export { buildUnifiedDiff };