pm-github 2026.10.14 → 2026.10.16
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/CHANGELOG.md +18 -0
- package/README.md +200 -3
- package/dist/closeout.d.ts +104 -0
- package/dist/closeout.d.ts.map +1 -0
- package/dist/closeout.js +457 -0
- package/dist/closeout.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// Issues use the REST API; Projects v2 is GraphQL-only (see the Projects v2
|
|
15
15
|
// section below and the pure plan/mapping logic in ./projects.ts).
|
|
16
|
+
import { CloseoutUsageError, compactCloseoutReport, runCloseout } from "./closeout.js";
|
|
16
17
|
import http from "node:http";
|
|
17
18
|
import https from "node:https";
|
|
18
19
|
import crypto from "node:crypto";
|
|
@@ -4976,7 +4977,7 @@ const PROJECT_SYNC_FLAGS = [
|
|
|
4976
4977
|
const defineExtension = (module) => module;
|
|
4977
4978
|
export default defineExtension({
|
|
4978
4979
|
name: "pm-github",
|
|
4979
|
-
version: "2026.10.
|
|
4980
|
+
version: "2026.10.16",
|
|
4980
4981
|
activate(api) {
|
|
4981
4982
|
// -----------------------------------------------------------------------
|
|
4982
4983
|
// schema — declare the GitHub provenance fields so the workspace knows them
|
|
@@ -5300,6 +5301,37 @@ export default defineExtension({
|
|
|
5300
5301
|
return report;
|
|
5301
5302
|
},
|
|
5302
5303
|
});
|
|
5304
|
+
// Closeout uses the existing repository resolution and REST transport.
|
|
5305
|
+
api.registerCommand({
|
|
5306
|
+
name: "github closeout",
|
|
5307
|
+
description: "Close items linked by merged PRs after verifying head checks. Dry-run by default; --apply writes through the SDK. Returns a compact TOON plan or --json.",
|
|
5308
|
+
intent: "close delivered pm items with verifiable GitHub evidence",
|
|
5309
|
+
examples: ["pm github closeout --repo owner/repo --pr 42 --pr 43", "pm github closeout --since 2026-10-01 --skip pm-123 --apply --json"],
|
|
5310
|
+
flags: [
|
|
5311
|
+
{ long: "--repo", value_name: "owner/repo", description: "Repository (or PM_GITHUB_REPO)" },
|
|
5312
|
+
{ long: "--pr", value_name: "n", repeatable: true, description: "Select a PR number (repeatable; conflicts with --since)" },
|
|
5313
|
+
{ long: "--since", value_name: "ISO date", description: "Select PRs merged at or after this ISO date/time" },
|
|
5314
|
+
{ long: "--skip", value_name: "id", repeatable: true, description: "Never close this item (repeatable)" },
|
|
5315
|
+
{ long: "--apply", description: "Close eligible items (default: dry-run)" },
|
|
5316
|
+
{ long: "--dry-run", description: "Preview only; overrides --apply" },
|
|
5317
|
+
{ long: "--full", description: "Include every plan row and PR check (also available with --json)" },
|
|
5318
|
+
],
|
|
5319
|
+
async run(ctx) {
|
|
5320
|
+
try {
|
|
5321
|
+
const token = resolveGitHubToken();
|
|
5322
|
+
const report = await runCloseout(ctx.pm_root, resolveSearchRepo(ctx.options), ctx.options, {
|
|
5323
|
+
base: githubApiBase(), get: url => fetchJSON(url, token), next: parseNextLink,
|
|
5324
|
+
});
|
|
5325
|
+
if (report.failed > 0)
|
|
5326
|
+
throw new CommandError(JSON.stringify({ ...report, error: "pm github closeout: some closes failed" }), EXIT_CODE.GENERIC_FAILURE);
|
|
5327
|
+
return ctx.global.json === true || ctx.options.full === true ? report : compactCloseoutReport(report);
|
|
5328
|
+
}
|
|
5329
|
+
catch (error) {
|
|
5330
|
+
// A plain Error would make the host re-run the handler (repeating GitHub reads and remaining closes).
|
|
5331
|
+
throw new CommandError(error.message, error instanceof CloseoutUsageError ? EXIT_CODE.USAGE : EXIT_CODE.GENERIC_FAILURE);
|
|
5332
|
+
}
|
|
5333
|
+
},
|
|
5334
|
+
});
|
|
5303
5335
|
// -----------------------------------------------------------------------
|
|
5304
5336
|
// command — `pm github blockers` (revalidate blocked items against the
|
|
5305
5337
|
// live state of their GitHub blockers). REPORT-ONLY: it never unblocks,
|