@bensandee/tooling 0.104.0 → 0.105.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.
package/dist/bin.mjs CHANGED
@@ -173,7 +173,7 @@ function loadEnvFileForBin(rawArgs, bin, io = processIo) {
173
173
  // src/env-file-preload.ts
174
174
  const envFileLoad = loadEnvFileForBin(process.argv.slice(2), {
175
175
  name: "bst",
176
- version: "0.104.0"
176
+ version: "0.105.0"
177
177
  });
178
178
  // ../cli-kit/src/logger.ts
179
179
  const RANK = {
@@ -846,7 +846,6 @@ const TolerantDockerCheckConfigSchema = z.object({
846
846
  });
847
847
  const DEFAULT_BRANCH_NAME_PATTERN = /^(?!refs\/)(?!.*\/\/)(?!.*\.\.)(?!.*\/$)(?!.*\.lock$)[A-Za-z0-9][A-Za-z0-9._/-]*$/;
848
848
  const DefaultBranchNameSchema = z.string().regex(DEFAULT_BRANCH_NAME_PATTERN, "must be a plain branch name: ASCII letters, digits, '.', '_', '-' and '/', starting with a letter or digit, with no leading 'refs/', no '//', '..', trailing '/', or '.lock' suffix");
849
- const TrustedRunnerLabelSchema = z.string().regex(/^(?!ubuntu-latest$)[A-Za-z0-9][A-Za-z0-9._-]*$/, "must be a plain runner label: ASCII letters, digits, '.', '_' and '-', starting with a letter or digit, non-empty, and not 'ubuntu-latest' (the shared label this setting moves work off)");
850
849
  const AgentEnabledSliceSchema = z.looseObject({ agent: z.looseObject({ enabled: z.boolean().optional() }).optional() });
851
850
  function agentEnabledIn(raw) {
852
851
  try {
@@ -1744,7 +1743,8 @@ const AgentConfigSchema = z.strictObject({
1744
1743
  egress: AgentEgressConfigSchema.optional().meta({ description: "Extra egress hosts this repo's agent containers ask to reach -- a request the deployment grants, not an opening of a host. `browseHosts` joins the agent's browse lane (GET and HEAD only) on top of the hosts every run needs; the passthrough lane stays agent-owned. Each entry is a host pattern -- an exact host or a *.host wildcard, never a port. Read from the repo's DEFAULT BRANCH, never off a pull request's own tree, so a run can never widen its own egress: under the default `auto` grant mode the request takes effect on the first container started after a human merges it, and under `approve` it waits for an admin's grant for this repo. A host the product or the deployment known-denies is never opened, whatever the declaration or the verdict says. An entry whose pattern the agent cannot parse refuses the run rather than being dropped. Changing this block holds the pull request from automerge." }),
1745
1744
  findingHolds: FindingHoldsConfigSchema.optional().meta({ description: "Which of a pull request's linked open findings withhold its unattended merge. `rules` is ordered and the first `when` that matches decides; no match falls through to `default`; an absent block is { rules: [], default: true }, so every open linked finding holds by default. Read off the repo's DEFAULT BRANCH, never off the pull request's own tree -- a pull request cannot edit the rule deciding whether it is held. In a `mentions` entry a /.../flags pattern is a regular expression, a literal:<text> pattern is the substring <text> (how to name a path such as /src/utils), and anything else is a case-insensitive substring." }),
1746
1745
  chatIssueRepos: z.array(z.string().regex(REPO_FULL_NAME)).optional().meta({ description: "Repositories with a DIFFERENT owner that a control-panel chat from this repository may file an issue in, each one a full `owner/name`, never a wildcard. A repository with the same owner needs no entry, and an entry grants nothing on its own: the target must have enabled the agent too. Read from the repo's DEFAULT BRANCH at the moment a card is applied, so a pull request cannot widen the reach of its own chat. Like every other `agent.*` key, this has no effect unless `agent.enabled` is true." }),
1747
- ciOnlySteps: z.array(z.string().regex(/^[\w:*?.\-[\]{}!,]+$/)).optional().meta({ description: "Step names or globs in `checks:run --skip` syntax that agent runs leave to CI, for example [\"docker:check\"]. Separate from `checks.skip`, which drops a step in CI too: here CI still runs the step and its status still gates the merge. Read from the repo's DEFAULT BRANCH only, never off the pull request's own tree, so a pull request cannot widen its own skip list. The agent merges such a pull request only on green CI, because the gate no longer measures these steps. Like every other `agent.*` key, this has no effect unless `agent.enabled` is true." })
1746
+ ciOnlySteps: z.array(z.string().regex(/^[\w:*?.\-[\]{}!,]+$/)).optional().meta({ description: "Step names or globs in `checks:run --skip` syntax that agent runs leave to CI, for example [\"docker:check\"]. Separate from `checks.skip`, which drops a step in CI too: here CI still runs the step and its status still gates the merge. Read from the repo's DEFAULT BRANCH only, never off the pull request's own tree, so a pull request cannot widen its own skip list. The agent merges such a pull request only on green CI, because the gate no longer measures these steps. Like every other `agent.*` key, this has no effect unless `agent.enabled` is true." }),
1747
+ localVerify: z.boolean().optional().meta({ description: "Keep an agent run's check gate in the agent's own sandboxed verify container instead of measuring it on this repo's forge CI. `true` is the local verify; leaving the key out is the other answer, so the agent waits for the CI run of the commit it pushed and reads its `checks:run` job log, falling back to the local verify whenever CI cannot stand in. Read from the repo's DEFAULT BRANCH only, never off the pull request's own tree, so a pull request cannot choose the gate that measures it. Like every other `agent.*` key, this has no effect unless `agent.enabled` is true." })
1748
1748
  });
1749
1749
  const TolerantAgentConfigSchema = z.object({
1750
1750
  ...AgentConfigSchema.shape,
@@ -1803,7 +1803,6 @@ const ToolingConfigSchema = z.strictObject({
1803
1803
  deploy: DeployConfigSchema.optional().meta({ description: "Generate a deploy-dispatch step in the release workflow that triggers a workflow_dispatch event in another repo after a successful release. The resolved release token must have rights on `dispatchRepo`." }),
1804
1804
  pnpmWorkspace: z.literal(false).optional().meta({ description: "Set to false to opt out of pnpm-workspace.yaml management (skips both generation and the repo:sync --check validation)." }),
1805
1805
  defaultBranch: DefaultBranchNameSchema.optional().meta({ description: "Repository default branch name. Drives the generated CI `on.push` trigger and every default-branch gate in `ci.yml` and `release.yml`, the release path (`release:changesets`, the version PR, `release:trigger`) and `checks:run`'s coverage gate. Generated output uses 'main' when unset; `checks:run` still falls back to `origin/HEAD`. Must be a plain branch name: ASCII letters, digits, '.', '_', '-' and '/', with no leading 'refs/'." }),
1806
- trustedRunner: TrustedRunnerLabelSchema.optional().meta({ description: "Self-hosted runner label for default-branch CI jobs: they run on this label while pull request jobs stay on 'ubuntu-latest'. Only a workflow edit moves a job, so the runner must be scoped so no other repository can name this label. A job aimed at a label no runner serves waits forever, so set this key only once the runner exists." }),
1807
1806
  unmanagedDevDependencies: UnmanagedDevDependenciesSchema.optional().meta({ description: "devDependency names repo:sync must never add or re-pin. Escape hatch for holding a tooling-managed dep (oxlint, vitest, knip, ...) at a deliberately off-canonical version; without it, repo:sync raises any managed devDep whose version has drifted below the canonical pin." }),
1808
1807
  stack: StackSchema.optional().meta({ description: "Whether the repo has TS/JS source. Detected from source evidence; TypeScript is never inferred from absence. Setting this key pins its value, even one that equals detection, and repo:sync keeps it until the key is deleted." }),
1809
1808
  builder: z.enum([
@@ -4477,7 +4476,7 @@ function createDockerDiscoveryMemo() {
4477
4476
  }
4478
4477
  return { detect };
4479
4478
  }
4480
- // src/generators/docker-reader.ts
4479
+ // src/generators/ci/docker-reader.ts
4481
4480
  const perContextMemos = /* @__PURE__ */ new WeakMap();
4482
4481
  function memoFor(ctx) {
4483
4482
  if (ctx.dockerDiscovery !== void 0) return ctx.dockerDiscovery;
@@ -4780,6 +4779,11 @@ function preservePinnedActions(generated, existing, owned = []) {
4780
4779
  }
4781
4780
  return result;
4782
4781
  }
4782
+ const SHARED_RUNNER_EXPR = "vars.BST_RUNNER || 'ubuntu-latest'";
4783
+ const TRUSTED_RUNNER_EXPR = "vars.BST_TRUSTED_RUNNER || vars.BST_RUNNER || 'ubuntu-latest'";
4784
+ function runnerExpr(expr) {
4785
+ return `\${{ ${expr} }}`;
4786
+ }
4783
4787
  function buildWorkflowYaml(options) {
4784
4788
  const doc = { name: options.name };
4785
4789
  if (options.enableEmailNotifications) doc["enable-email-notifications"] = true;
@@ -4788,7 +4792,7 @@ function buildWorkflowYaml(options) {
4788
4792
  if (options.concurrency) doc["concurrency"] = options.concurrency;
4789
4793
  const jobs = { [options.jobName]: {
4790
4794
  ...options.jobIf && { if: options.jobIf },
4791
- "runs-on": options.runsOn ?? "ubuntu-latest",
4795
+ "runs-on": options.runsOn ?? runnerExpr("vars.BST_RUNNER || 'ubuntu-latest'"),
4792
4796
  ...options.jobEnv && { env: options.jobEnv },
4793
4797
  ...options.jobOutputs && { outputs: options.jobOutputs },
4794
4798
  steps: options.steps.map((s) => s.step)
@@ -4797,7 +4801,7 @@ function buildWorkflowYaml(options) {
4797
4801
  ...def.needs && { needs: def.needs },
4798
4802
  ...def.if && { if: def.if },
4799
4803
  ...def["continue-on-error"] && { "continue-on-error": true },
4800
- "runs-on": def.runsOn ?? "ubuntu-latest",
4804
+ "runs-on": def.runsOn ?? runnerExpr("vars.BST_RUNNER || 'ubuntu-latest'"),
4801
4805
  ...def.env && { env: def.env },
4802
4806
  steps: def.steps.map((s) => s.step)
4803
4807
  };
@@ -4809,12 +4813,12 @@ function buildWorkflowYaml(options) {
4809
4813
  return ensureSchemaComment(WORKFLOW_MANAGED_HEADER + "\n" + readable, options.ci);
4810
4814
  }
4811
4815
  // src/generators/mise-pin.ts
4812
- const MISE_VERSION = "2026.10.19";
4813
- const MISE_LINUX_X64_SHA256 = "3162760f40b6b5f706c60641e4ef5ee7322bc6c54f72fc26a7111b337aa18d9d";
4816
+ const MISE_VERSION = "2026.10.25";
4817
+ const MISE_LINUX_X64_SHA256 = "5d362ecc578dc7c146679b841dda949d6472cbf86ff5635db7afdca1b6b3fd87";
4814
4818
  const SETUP_MISE_ACTION_URL = "https://code.orangebikelabs.com/bensandee/common/actions/setup-mise";
4815
4819
  const SETUP_MISE_ACTION_TAG = "setup-mise@latest";
4816
4820
  const SETUP_MISE_ACTION_SHA = "ebe622ef0d24c7efec4a5f6093ddb18500900e24";
4817
- // src/generators/ci-utils.ts
4821
+ // src/generators/ci/ci-utils.ts
4818
4822
  function actionsExpr(expr) {
4819
4823
  return `\${{ ${expr} }}`;
4820
4824
  }
@@ -4822,10 +4826,6 @@ function branchNameLiteral(name) {
4822
4826
  if (DEFAULT_BRANCH_NAME_PATTERN.test(name)) return name;
4823
4827
  return name.replace(/'/g, "''");
4824
4828
  }
4825
- const TrustedRunnerSliceSchema = z.object({ trustedRunner: TrustedRunnerLabelSchema.optional() });
4826
- function configuredTrustedRunner(raw) {
4827
- return parseToolingConfigSlice(raw, TrustedRunnerSliceSchema, { block: "trustedRunner" })?.trustedRunner;
4828
- }
4829
4829
  function isDefaultBranch(name) {
4830
4830
  return `github.ref == 'refs/heads/${branchNameLiteral(name)}'`;
4831
4831
  }
@@ -4962,7 +4962,7 @@ function retireManagedWorkflow(ctx, workflowPath, reason) {
4962
4962
  description
4963
4963
  };
4964
4964
  }
4965
- // src/generators/publish-ci.ts
4965
+ // src/generators/ci/publish-ci.ts
4966
4966
  const RegistryHostSchema = z.object({ registryHost: z.string().optional() });
4967
4967
  function resolveGenTimeHost(ctx) {
4968
4968
  const toolingRaw = ctx.read(".tooling.json");
@@ -5381,18 +5381,18 @@ function perPackageDevDeps(config) {
5381
5381
  "@types/node": "24.19.2",
5382
5382
  "@vitest/coverage-v8": "5.0.5",
5383
5383
  "commit-and-tag-version": "13.3.0",
5384
- "knip": "6.42.1",
5384
+ "knip": "6.44.0",
5385
5385
  "lefthook": "2.2.2",
5386
- "modern-web-guidance": "0.0.195",
5387
- "oxfmt": "0.74.0",
5388
- "oxlint": "1.89.0",
5386
+ "modern-web-guidance": "0.0.196",
5387
+ "oxfmt": "0.75.0",
5388
+ "oxlint": "1.90.0",
5389
5389
  "oxlint-tsgolint": "7.0.2005",
5390
5390
  "prettier": "3.9.10",
5391
5391
  "release-it": "21.1.1",
5392
- "tsdown": "0.23.1",
5392
+ "tsdown": "0.23.4",
5393
5393
  "typescript": "6.0.3",
5394
5394
  "vitest": "5.0.5",
5395
- "pnpm": "11.28.8"
5395
+ "pnpm": "11.28.9"
5396
5396
  }["typescript"];
5397
5397
  deps["@types/node"] = {
5398
5398
  "@changesets/cli": "3.0.3",
@@ -5400,18 +5400,18 @@ function perPackageDevDeps(config) {
5400
5400
  "@types/node": "24.19.2",
5401
5401
  "@vitest/coverage-v8": "5.0.5",
5402
5402
  "commit-and-tag-version": "13.3.0",
5403
- "knip": "6.42.1",
5403
+ "knip": "6.44.0",
5404
5404
  "lefthook": "2.2.2",
5405
- "modern-web-guidance": "0.0.195",
5406
- "oxfmt": "0.74.0",
5407
- "oxlint": "1.89.0",
5405
+ "modern-web-guidance": "0.0.196",
5406
+ "oxfmt": "0.75.0",
5407
+ "oxlint": "1.90.0",
5408
5408
  "oxlint-tsgolint": "7.0.2005",
5409
5409
  "prettier": "3.9.10",
5410
5410
  "release-it": "21.1.1",
5411
- "tsdown": "0.23.1",
5411
+ "tsdown": "0.23.4",
5412
5412
  "typescript": "6.0.3",
5413
5413
  "vitest": "5.0.5",
5414
- "pnpm": "11.28.8"
5414
+ "pnpm": "11.28.9"
5415
5415
  }["@types/node"];
5416
5416
  }
5417
5417
  if (config.builder === "tsdown") deps["tsdown"] = {
@@ -5420,18 +5420,18 @@ function perPackageDevDeps(config) {
5420
5420
  "@types/node": "24.19.2",
5421
5421
  "@vitest/coverage-v8": "5.0.5",
5422
5422
  "commit-and-tag-version": "13.3.0",
5423
- "knip": "6.42.1",
5423
+ "knip": "6.44.0",
5424
5424
  "lefthook": "2.2.2",
5425
- "modern-web-guidance": "0.0.195",
5426
- "oxfmt": "0.74.0",
5427
- "oxlint": "1.89.0",
5425
+ "modern-web-guidance": "0.0.196",
5426
+ "oxfmt": "0.75.0",
5427
+ "oxlint": "1.90.0",
5428
5428
  "oxlint-tsgolint": "7.0.2005",
5429
5429
  "prettier": "3.9.10",
5430
5430
  "release-it": "21.1.1",
5431
- "tsdown": "0.23.1",
5431
+ "tsdown": "0.23.4",
5432
5432
  "typescript": "6.0.3",
5433
5433
  "vitest": "5.0.5",
5434
- "pnpm": "11.28.8"
5434
+ "pnpm": "11.28.9"
5435
5435
  }["tsdown"];
5436
5436
  return deps;
5437
5437
  }
@@ -5443,18 +5443,18 @@ function vitestDevDeps() {
5443
5443
  "@types/node": "24.19.2",
5444
5444
  "@vitest/coverage-v8": "5.0.5",
5445
5445
  "commit-and-tag-version": "13.3.0",
5446
- "knip": "6.42.1",
5446
+ "knip": "6.44.0",
5447
5447
  "lefthook": "2.2.2",
5448
- "modern-web-guidance": "0.0.195",
5449
- "oxfmt": "0.74.0",
5450
- "oxlint": "1.89.0",
5448
+ "modern-web-guidance": "0.0.196",
5449
+ "oxfmt": "0.75.0",
5450
+ "oxlint": "1.90.0",
5451
5451
  "oxlint-tsgolint": "7.0.2005",
5452
5452
  "prettier": "3.9.10",
5453
5453
  "release-it": "21.1.1",
5454
- "tsdown": "0.23.1",
5454
+ "tsdown": "0.23.4",
5455
5455
  "typescript": "6.0.3",
5456
5456
  "vitest": "5.0.5",
5457
- "pnpm": "11.28.8"
5457
+ "pnpm": "11.28.9"
5458
5458
  }["vitest"],
5459
5459
  "@vitest/coverage-v8": {
5460
5460
  "@changesets/cli": "3.0.3",
@@ -5462,18 +5462,18 @@ function vitestDevDeps() {
5462
5462
  "@types/node": "24.19.2",
5463
5463
  "@vitest/coverage-v8": "5.0.5",
5464
5464
  "commit-and-tag-version": "13.3.0",
5465
- "knip": "6.42.1",
5465
+ "knip": "6.44.0",
5466
5466
  "lefthook": "2.2.2",
5467
- "modern-web-guidance": "0.0.195",
5468
- "oxfmt": "0.74.0",
5469
- "oxlint": "1.89.0",
5467
+ "modern-web-guidance": "0.0.196",
5468
+ "oxfmt": "0.75.0",
5469
+ "oxlint": "1.90.0",
5470
5470
  "oxlint-tsgolint": "7.0.2005",
5471
5471
  "prettier": "3.9.10",
5472
5472
  "release-it": "21.1.1",
5473
- "tsdown": "0.23.1",
5473
+ "tsdown": "0.23.4",
5474
5474
  "typescript": "6.0.3",
5475
5475
  "vitest": "5.0.5",
5476
- "pnpm": "11.28.8"
5476
+ "pnpm": "11.28.9"
5477
5477
  }["@vitest/coverage-v8"]
5478
5478
  };
5479
5479
  }
@@ -5484,18 +5484,18 @@ function rootDevDeps(config) {
5484
5484
  "@types/node": "24.19.2",
5485
5485
  "@vitest/coverage-v8": "5.0.5",
5486
5486
  "commit-and-tag-version": "13.3.0",
5487
- "knip": "6.42.1",
5487
+ "knip": "6.44.0",
5488
5488
  "lefthook": "2.2.2",
5489
- "modern-web-guidance": "0.0.195",
5490
- "oxfmt": "0.74.0",
5491
- "oxlint": "1.89.0",
5489
+ "modern-web-guidance": "0.0.196",
5490
+ "oxfmt": "0.75.0",
5491
+ "oxlint": "1.90.0",
5492
5492
  "oxlint-tsgolint": "7.0.2005",
5493
5493
  "prettier": "3.9.10",
5494
5494
  "release-it": "21.1.1",
5495
- "tsdown": "0.23.1",
5495
+ "tsdown": "0.23.4",
5496
5496
  "typescript": "6.0.3",
5497
5497
  "vitest": "5.0.5",
5498
- "pnpm": "11.28.8"
5498
+ "pnpm": "11.28.9"
5499
5499
  }["lefthook"] };
5500
5500
  if (config.stack !== "none") {
5501
5501
  deps["knip"] = {
@@ -5504,18 +5504,18 @@ function rootDevDeps(config) {
5504
5504
  "@types/node": "24.19.2",
5505
5505
  "@vitest/coverage-v8": "5.0.5",
5506
5506
  "commit-and-tag-version": "13.3.0",
5507
- "knip": "6.42.1",
5507
+ "knip": "6.44.0",
5508
5508
  "lefthook": "2.2.2",
5509
- "modern-web-guidance": "0.0.195",
5510
- "oxfmt": "0.74.0",
5511
- "oxlint": "1.89.0",
5509
+ "modern-web-guidance": "0.0.196",
5510
+ "oxfmt": "0.75.0",
5511
+ "oxlint": "1.90.0",
5512
5512
  "oxlint-tsgolint": "7.0.2005",
5513
5513
  "prettier": "3.9.10",
5514
5514
  "release-it": "21.1.1",
5515
- "tsdown": "0.23.1",
5515
+ "tsdown": "0.23.4",
5516
5516
  "typescript": "6.0.3",
5517
5517
  "vitest": "5.0.5",
5518
- "pnpm": "11.28.8"
5518
+ "pnpm": "11.28.9"
5519
5519
  }["knip"];
5520
5520
  deps["oxlint"] = {
5521
5521
  "@changesets/cli": "3.0.3",
@@ -5523,18 +5523,18 @@ function rootDevDeps(config) {
5523
5523
  "@types/node": "24.19.2",
5524
5524
  "@vitest/coverage-v8": "5.0.5",
5525
5525
  "commit-and-tag-version": "13.3.0",
5526
- "knip": "6.42.1",
5526
+ "knip": "6.44.0",
5527
5527
  "lefthook": "2.2.2",
5528
- "modern-web-guidance": "0.0.195",
5529
- "oxfmt": "0.74.0",
5530
- "oxlint": "1.89.0",
5528
+ "modern-web-guidance": "0.0.196",
5529
+ "oxfmt": "0.75.0",
5530
+ "oxlint": "1.90.0",
5531
5531
  "oxlint-tsgolint": "7.0.2005",
5532
5532
  "prettier": "3.9.10",
5533
5533
  "release-it": "21.1.1",
5534
- "tsdown": "0.23.1",
5534
+ "tsdown": "0.23.4",
5535
5535
  "typescript": "6.0.3",
5536
5536
  "vitest": "5.0.5",
5537
- "pnpm": "11.28.8"
5537
+ "pnpm": "11.28.9"
5538
5538
  }["oxlint"];
5539
5539
  Object.assign(deps, vitestDevDeps());
5540
5540
  }
@@ -5544,18 +5544,18 @@ function rootDevDeps(config) {
5544
5544
  "@types/node": "24.19.2",
5545
5545
  "@vitest/coverage-v8": "5.0.5",
5546
5546
  "commit-and-tag-version": "13.3.0",
5547
- "knip": "6.42.1",
5547
+ "knip": "6.44.0",
5548
5548
  "lefthook": "2.2.2",
5549
- "modern-web-guidance": "0.0.195",
5550
- "oxfmt": "0.74.0",
5551
- "oxlint": "1.89.0",
5549
+ "modern-web-guidance": "0.0.196",
5550
+ "oxfmt": "0.75.0",
5551
+ "oxlint": "1.90.0",
5552
5552
  "oxlint-tsgolint": "7.0.2005",
5553
5553
  "prettier": "3.9.10",
5554
5554
  "release-it": "21.1.1",
5555
- "tsdown": "0.23.1",
5555
+ "tsdown": "0.23.4",
5556
5556
  "typescript": "6.0.3",
5557
5557
  "vitest": "5.0.5",
5558
- "pnpm": "11.28.8"
5558
+ "pnpm": "11.28.9"
5559
5559
  }["oxlint-tsgolint"];
5560
5560
  return deps;
5561
5561
  }
@@ -5568,18 +5568,18 @@ function addReleaseDeps(deps, ctx) {
5568
5568
  "@types/node": "24.19.2",
5569
5569
  "@vitest/coverage-v8": "5.0.5",
5570
5570
  "commit-and-tag-version": "13.3.0",
5571
- "knip": "6.42.1",
5571
+ "knip": "6.44.0",
5572
5572
  "lefthook": "2.2.2",
5573
- "modern-web-guidance": "0.0.195",
5574
- "oxfmt": "0.74.0",
5575
- "oxlint": "1.89.0",
5573
+ "modern-web-guidance": "0.0.196",
5574
+ "oxfmt": "0.75.0",
5575
+ "oxlint": "1.90.0",
5576
5576
  "oxlint-tsgolint": "7.0.2005",
5577
5577
  "prettier": "3.9.10",
5578
5578
  "release-it": "21.1.1",
5579
- "tsdown": "0.23.1",
5579
+ "tsdown": "0.23.4",
5580
5580
  "typescript": "6.0.3",
5581
5581
  "vitest": "5.0.5",
5582
- "pnpm": "11.28.8"
5582
+ "pnpm": "11.28.9"
5583
5583
  }["release-it"];
5584
5584
  if (ctx.config.structure === "monorepo") deps["@release-it/bumper"] = {
5585
5585
  "@changesets/cli": "3.0.3",
@@ -5587,18 +5587,18 @@ function addReleaseDeps(deps, ctx) {
5587
5587
  "@types/node": "24.19.2",
5588
5588
  "@vitest/coverage-v8": "5.0.5",
5589
5589
  "commit-and-tag-version": "13.3.0",
5590
- "knip": "6.42.1",
5590
+ "knip": "6.44.0",
5591
5591
  "lefthook": "2.2.2",
5592
- "modern-web-guidance": "0.0.195",
5593
- "oxfmt": "0.74.0",
5594
- "oxlint": "1.89.0",
5592
+ "modern-web-guidance": "0.0.196",
5593
+ "oxfmt": "0.75.0",
5594
+ "oxlint": "1.90.0",
5595
5595
  "oxlint-tsgolint": "7.0.2005",
5596
5596
  "prettier": "3.9.10",
5597
5597
  "release-it": "21.1.1",
5598
- "tsdown": "0.23.1",
5598
+ "tsdown": "0.23.4",
5599
5599
  "typescript": "6.0.3",
5600
5600
  "vitest": "5.0.5",
5601
- "pnpm": "11.28.8"
5601
+ "pnpm": "11.28.9"
5602
5602
  }["@release-it/bumper"];
5603
5603
  break;
5604
5604
  case "simple":
@@ -5608,18 +5608,18 @@ function addReleaseDeps(deps, ctx) {
5608
5608
  "@types/node": "24.19.2",
5609
5609
  "@vitest/coverage-v8": "5.0.5",
5610
5610
  "commit-and-tag-version": "13.3.0",
5611
- "knip": "6.42.1",
5611
+ "knip": "6.44.0",
5612
5612
  "lefthook": "2.2.2",
5613
- "modern-web-guidance": "0.0.195",
5614
- "oxfmt": "0.74.0",
5615
- "oxlint": "1.89.0",
5613
+ "modern-web-guidance": "0.0.196",
5614
+ "oxfmt": "0.75.0",
5615
+ "oxlint": "1.90.0",
5616
5616
  "oxlint-tsgolint": "7.0.2005",
5617
5617
  "prettier": "3.9.10",
5618
5618
  "release-it": "21.1.1",
5619
- "tsdown": "0.23.1",
5619
+ "tsdown": "0.23.4",
5620
5620
  "typescript": "6.0.3",
5621
5621
  "vitest": "5.0.5",
5622
- "pnpm": "11.28.8"
5622
+ "pnpm": "11.28.9"
5623
5623
  }["commit-and-tag-version"];
5624
5624
  break;
5625
5625
  case "changesets": deps["@changesets/cli"] = {
@@ -5628,18 +5628,18 @@ function addReleaseDeps(deps, ctx) {
5628
5628
  "@types/node": "24.19.2",
5629
5629
  "@vitest/coverage-v8": "5.0.5",
5630
5630
  "commit-and-tag-version": "13.3.0",
5631
- "knip": "6.42.1",
5631
+ "knip": "6.44.0",
5632
5632
  "lefthook": "2.2.2",
5633
- "modern-web-guidance": "0.0.195",
5634
- "oxfmt": "0.74.0",
5635
- "oxlint": "1.89.0",
5633
+ "modern-web-guidance": "0.0.196",
5634
+ "oxfmt": "0.75.0",
5635
+ "oxlint": "1.90.0",
5636
5636
  "oxlint-tsgolint": "7.0.2005",
5637
5637
  "prettier": "3.9.10",
5638
5638
  "release-it": "21.1.1",
5639
- "tsdown": "0.23.1",
5639
+ "tsdown": "0.23.4",
5640
5640
  "typescript": "6.0.3",
5641
5641
  "vitest": "5.0.5",
5642
- "pnpm": "11.28.8"
5642
+ "pnpm": "11.28.9"
5643
5643
  }["@changesets/cli"];
5644
5644
  }
5645
5645
  }
@@ -5756,18 +5756,18 @@ function applyMetadataDefaults(pkg, ctx, changes) {
5756
5756
  "@types/node": "24.19.2",
5757
5757
  "@vitest/coverage-v8": "5.0.5",
5758
5758
  "commit-and-tag-version": "13.3.0",
5759
- "knip": "6.42.1",
5759
+ "knip": "6.44.0",
5760
5760
  "lefthook": "2.2.2",
5761
- "modern-web-guidance": "0.0.195",
5762
- "oxfmt": "0.74.0",
5763
- "oxlint": "1.89.0",
5761
+ "modern-web-guidance": "0.0.196",
5762
+ "oxfmt": "0.75.0",
5763
+ "oxlint": "1.90.0",
5764
5764
  "oxlint-tsgolint": "7.0.2005",
5765
5765
  "prettier": "3.9.10",
5766
5766
  "release-it": "21.1.1",
5767
- "tsdown": "0.23.1",
5767
+ "tsdown": "0.23.4",
5768
5768
  "typescript": "6.0.3",
5769
5769
  "vitest": "5.0.5",
5770
- "pnpm": "11.28.8"
5770
+ "pnpm": "11.28.9"
5771
5771
  }["pnpm"];
5772
5772
  const desiredPm = pinnedPnpm ? `pnpm@${pinnedPnpm}` : void 0;
5773
5773
  if (desiredPm) {
@@ -5806,27 +5806,27 @@ function buildManagedDevDeps(ctx) {
5806
5806
  const devDeps = { ...rootDevDeps(ctx.config) };
5807
5807
  if (!isMonorepo) Object.assign(devDeps, perPackageDevDeps(ctx.config));
5808
5808
  if (ctx.config.stack !== "none") devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.15.1";
5809
- if (!isWorkspacePackage(ctx, "@bensandee/tooling")) devDeps["@bensandee/tooling"] = "0.104.0";
5809
+ if (!isWorkspacePackage(ctx, "@bensandee/tooling")) devDeps["@bensandee/tooling"] = "0.105.0";
5810
5810
  if (ctx.config.useEslintPlugin && ctx.config.stack !== "none") devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.18.0";
5811
- if (wantsAgentCli(ctx)) devDeps[AGENT_CLI_PACKAGE] = "0.3.1";
5811
+ if (wantsAgentCli(ctx)) devDeps[AGENT_CLI_PACKAGE] = "0.3.2";
5812
5812
  if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = {
5813
5813
  "@changesets/cli": "3.0.3",
5814
5814
  "@release-it/bumper": "8.0.1",
5815
5815
  "@types/node": "24.19.2",
5816
5816
  "@vitest/coverage-v8": "5.0.5",
5817
5817
  "commit-and-tag-version": "13.3.0",
5818
- "knip": "6.42.1",
5818
+ "knip": "6.44.0",
5819
5819
  "lefthook": "2.2.2",
5820
- "modern-web-guidance": "0.0.195",
5821
- "oxfmt": "0.74.0",
5822
- "oxlint": "1.89.0",
5820
+ "modern-web-guidance": "0.0.196",
5821
+ "oxfmt": "0.75.0",
5822
+ "oxlint": "1.90.0",
5823
5823
  "oxlint-tsgolint": "7.0.2005",
5824
5824
  "prettier": "3.9.10",
5825
5825
  "release-it": "21.1.1",
5826
- "tsdown": "0.23.1",
5826
+ "tsdown": "0.23.4",
5827
5827
  "typescript": "6.0.3",
5828
5828
  "vitest": "5.0.5",
5829
- "pnpm": "11.28.8"
5829
+ "pnpm": "11.28.9"
5830
5830
  }["oxfmt"];
5831
5831
  if (ctx.config.formatter === "prettier") devDeps["prettier"] = {
5832
5832
  "@changesets/cli": "3.0.3",
@@ -5834,18 +5834,18 @@ function buildManagedDevDeps(ctx) {
5834
5834
  "@types/node": "24.19.2",
5835
5835
  "@vitest/coverage-v8": "5.0.5",
5836
5836
  "commit-and-tag-version": "13.3.0",
5837
- "knip": "6.42.1",
5837
+ "knip": "6.44.0",
5838
5838
  "lefthook": "2.2.2",
5839
- "modern-web-guidance": "0.0.195",
5840
- "oxfmt": "0.74.0",
5841
- "oxlint": "1.89.0",
5839
+ "modern-web-guidance": "0.0.196",
5840
+ "oxfmt": "0.75.0",
5841
+ "oxlint": "1.90.0",
5842
5842
  "oxlint-tsgolint": "7.0.2005",
5843
5843
  "prettier": "3.9.10",
5844
5844
  "release-it": "21.1.1",
5845
- "tsdown": "0.23.1",
5845
+ "tsdown": "0.23.4",
5846
5846
  "typescript": "6.0.3",
5847
5847
  "vitest": "5.0.5",
5848
- "pnpm": "11.28.8"
5848
+ "pnpm": "11.28.9"
5849
5849
  }["prettier"];
5850
5850
  addReleaseDeps(devDeps, ctx);
5851
5851
  return devDeps;
@@ -5905,18 +5905,18 @@ async function generatePackageJson(ctx) {
5905
5905
  "@types/node": "24.19.2",
5906
5906
  "@vitest/coverage-v8": "5.0.5",
5907
5907
  "commit-and-tag-version": "13.3.0",
5908
- "knip": "6.42.1",
5908
+ "knip": "6.44.0",
5909
5909
  "lefthook": "2.2.2",
5910
- "modern-web-guidance": "0.0.195",
5911
- "oxfmt": "0.74.0",
5912
- "oxlint": "1.89.0",
5910
+ "modern-web-guidance": "0.0.196",
5911
+ "oxfmt": "0.75.0",
5912
+ "oxlint": "1.90.0",
5913
5913
  "oxlint-tsgolint": "7.0.2005",
5914
5914
  "prettier": "3.9.10",
5915
5915
  "release-it": "21.1.1",
5916
- "tsdown": "0.23.1",
5916
+ "tsdown": "0.23.4",
5917
5917
  "typescript": "6.0.3",
5918
5918
  "vitest": "5.0.5",
5919
- "pnpm": "11.28.8"
5919
+ "pnpm": "11.28.9"
5920
5920
  }["pnpm"]}`
5921
5921
  };
5922
5922
  ctx.write(filePath, JSON.stringify(pkg, null, 2) + "\n");
@@ -6657,7 +6657,7 @@ async function generateVitest(ctx) {
6657
6657
  warnIfMissingInclude(ctx);
6658
6658
  return results;
6659
6659
  }
6660
- // src/generators/oxlint.ts
6660
+ // src/generators/lint-format/oxlint.ts
6661
6661
  const IGNORE_PATTERNS_SPREAD = "...(recommended.ignorePatterns ?? [])";
6662
6662
  const CONFIG_WITH_LINT_RULES = `import recommended from "@bensandee/config/oxlint/recommended";
6663
6663
  import bensandee from "@bensandee/eslint-plugin/recommended";
@@ -6835,7 +6835,7 @@ async function generateOxlint(ctx) {
6835
6835
  description: "Generated oxlint.config.ts"
6836
6836
  };
6837
6837
  }
6838
- // src/generators/formatter.ts
6838
+ // src/generators/lint-format/formatter.ts
6839
6839
  const BASE_IGNORE_PATTERNS = [
6840
6840
  ".claude",
6841
6841
  ".agent/findings",
@@ -7819,7 +7819,7 @@ function refuseForgeDefaultMismatch(configured, source, command) {
7819
7819
  if (reported === void 0 || reported === configured) return;
7820
7820
  throw new FatalError(`${command}: .tooling.json#defaultBranch is "${configured}", but the forge reports "${reported}" as this repository's default branch. Set .tooling.json#defaultBranch to "${reported}" and run pnpm exec bst repo:sync.`);
7821
7821
  }
7822
- // src/generators/release-ci.ts
7822
+ // src/generators/ci/release-ci.ts
7823
7823
  const DEFAULT_POST_RELEASE_COMMAND = [
7824
7824
  "pnpm exec bst webhook:send",
7825
7825
  " \"$POST_RELEASE_HOOK_URL\"",
@@ -7850,7 +7850,7 @@ function postReleaseHookJob(opts) {
7850
7850
  return {
7851
7851
  needs: opts.needsJob,
7852
7852
  if: onlyOnDefaultBranch(opts.defaultBranch, opts.publishCondition),
7853
- ...opts.runsOn && { runsOn: opts.runsOn },
7853
+ runsOn: opts.runsOn,
7854
7854
  "continue-on-error": true,
7855
7855
  steps: [...commonSteps(opts.ci), { step: {
7856
7856
  name: "Post-release hook",
@@ -7995,7 +7995,7 @@ async function generateReleaseCi(ctx) {
7995
7995
  const filePath = "release-ci";
7996
7996
  const isGitHub = ctx.config.ci === "github";
7997
7997
  const defaultBranch = configuredDefaultBranch(ctx.read(".tooling.json"));
7998
- const trustedRunner = configuredTrustedRunner(ctx.read(".tooling.json"));
7998
+ const trustedRunsOn = actionsExpr(TRUSTED_RUNNER_EXPR);
7999
7999
  if (ctx.config.ci === "none" || ctx.config.releaseStrategy === "none") return {
8000
8000
  filePath,
8001
8001
  action: "skipped",
@@ -8052,7 +8052,7 @@ async function generateReleaseCi(ctx) {
8052
8052
  defaultBranch,
8053
8053
  ci: ctx.config.ci,
8054
8054
  needsJob: "release",
8055
- ...trustedRunner && { runsOn: trustedRunner },
8055
+ runsOn: trustedRunsOn,
8056
8056
  publishCondition: "needs.release.outputs.pushed == 'true'",
8057
8057
  releaseTagExpr: actionsExpr("needs.release.outputs.tag"),
8058
8058
  command: getPostReleaseHookCommand(ctx),
@@ -8067,7 +8067,7 @@ async function generateReleaseCi(ctx) {
8067
8067
  ...isGitHub && { permissions: { contents: "write" } },
8068
8068
  jobName: "release",
8069
8069
  jobIf: isDefaultBranch(defaultBranch),
8070
- ...trustedRunner && { runsOn: trustedRunner },
8070
+ runsOn: trustedRunsOn,
8071
8071
  ...jobOutputs && { jobOutputs },
8072
8072
  steps,
8073
8073
  ...extraJobs && { extraJobs }
@@ -8100,7 +8100,7 @@ async function generateReleaseCi(ctx) {
8100
8100
  function versionPrBranch(defaultBranch) {
8101
8101
  return `changeset-release/${defaultBranch}`;
8102
8102
  }
8103
- // src/generators/ci.ts
8103
+ // src/generators/ci/ci.ts
8104
8104
  function coverageHistorySteps() {
8105
8105
  return [
8106
8106
  { step: {
@@ -8174,9 +8174,8 @@ function ciConcurrency(ci, defaultBranch) {
8174
8174
  "cancel-in-progress": actionsExpr(isNotDefaultBranch(defaultBranch))
8175
8175
  };
8176
8176
  }
8177
- function checkJobRunsOn(defaultBranch, trustedRunner) {
8178
- if (trustedRunner === void 0) return void 0;
8179
- return actionsExpr(`${isDefaultBranch(defaultBranch)} && '${trustedRunner}' || 'ubuntu-latest'`);
8177
+ function checkJobRunsOn(defaultBranch) {
8178
+ return actionsExpr(`${isDefaultBranch(defaultBranch)} && (${TRUSTED_RUNNER_EXPR}) || (${SHARED_RUNNER_EXPR})`);
8180
8179
  }
8181
8180
  function checkSteps(ci, coverageEnabled, emitDockerSweepStep) {
8182
8181
  const checkCommand = coverageEnabled ? "pnpm ci:check" : "pnpm ci:check --no-coverage";
@@ -8207,8 +8206,7 @@ async function generateCi(ctx) {
8207
8206
  description: "CI workflow not requested"
8208
8207
  };
8209
8208
  const defaultBranch = configuredDefaultBranch(ctx.read(".tooling.json"));
8210
- const trustedRunner = configuredTrustedRunner(ctx.read(".tooling.json"));
8211
- const checkRunsOn = checkJobRunsOn(defaultBranch, trustedRunner);
8209
+ const checkRunsOn = checkJobRunsOn(defaultBranch);
8212
8210
  const isGitHub = ctx.config.ci === "github";
8213
8211
  const isForgejo = !isGitHub;
8214
8212
  const isChangesets = ctx.config.releaseStrategy === "changesets";
@@ -8277,7 +8275,7 @@ async function generateCi(ctx) {
8277
8275
  defaultBranch,
8278
8276
  ci: ctx.config.ci,
8279
8277
  needsJob: "check",
8280
- ...trustedRunner && { runsOn: trustedRunner },
8278
+ runsOn: actionsExpr(TRUSTED_RUNNER_EXPR),
8281
8279
  publishCondition: "needs.check.outputs.published == 'true'",
8282
8280
  releaseTagExpr: actionsExpr("needs.check.outputs.tag"),
8283
8281
  command: hookCommand,
@@ -8301,7 +8299,7 @@ async function generateCi(ctx) {
8301
8299
  enableEmailNotifications: isForgejo,
8302
8300
  ...isChangesets && { concurrency: ciConcurrency(ctx.config.ci, defaultBranch) },
8303
8301
  jobName: "check",
8304
- ...checkRunsOn && { runsOn: checkRunsOn },
8302
+ runsOn: checkRunsOn,
8305
8303
  ...skipOnVersionPr && { jobIf: `github.head_ref != '${versionPrBranch(defaultBranch)}'` },
8306
8304
  ...Object.keys(checkJobEnv).length > 0 && { jobEnv: checkJobEnv },
8307
8305
  ...jobOutputs && { jobOutputs },
@@ -8333,7 +8331,7 @@ async function generateCi(ctx) {
8333
8331
  description: `Generated ${isGitHub ? "GitHub" : "Forgejo"} Actions CI workflow`
8334
8332
  };
8335
8333
  }
8336
- // src/generators/knip.ts
8334
+ // src/generators/lint-format/knip.ts
8337
8335
  const FOREIGN_OWNED = ["composer"];
8338
8336
  function scriptsInvoke(ctx, binary) {
8339
8337
  const invocation = new RegExp(String.raw`(?<![\w.-])${binary}(?![\w.-])`);
@@ -8718,10 +8716,10 @@ async function generatePnpmWorkspace(ctx) {
8718
8716
  description: changes.join(", ")
8719
8717
  };
8720
8718
  }
8721
- // src/generators/claude-hooks-placeholder.ts
8719
+ // src/generators/claude/claude-hooks-placeholder.ts
8722
8720
  const HOOK_NOT_BUILT_PLACEHOLDER = "/* bst-hook not built -- run pnpm build from packages/claude-hooks first */";
8723
8721
  const GUIDE_NOT_BUILT_PLACEHOLDER = "<!-- bst-hook guide not built -->";
8724
- // src/generators/claude-hooks.ts
8722
+ // src/generators/claude/claude-hooks.ts
8725
8723
  const HOOK_PATH = ".claude/hooks/bst-hook.mjs";
8726
8724
  const GUIDE_PATH = ".claude/hooks/bst-hook-guide.md";
8727
8725
  const SETTINGS_PATH$1 = ".claude/hooks/bst-hook.settings.json";
@@ -8788,7 +8786,7 @@ async function generateClaudeHooks(ctx, embedded = {
8788
8786
  if (legacyAllowResult) results.push(legacyAllowResult);
8789
8787
  return results;
8790
8788
  }
8791
- // src/generators/claude-settings.ts
8789
+ // src/generators/claude/claude-settings.ts
8792
8790
  const HookEntrySchema = z.object({
8793
8791
  type: z.string().optional(),
8794
8792
  command: z.string().optional()
@@ -8945,7 +8943,7 @@ async function generateClaudeSettings(ctx) {
8945
8943
  }
8946
8944
  return results;
8947
8945
  }
8948
- // src/generators/release-it.ts
8946
+ // src/generators/release/release-it.ts
8949
8947
  function buildConfig$3(ci, isMonorepo) {
8950
8948
  const config = {
8951
8949
  $schema: "https://unpkg.com/release-it/schema/release-it.json",
@@ -8995,7 +8993,7 @@ async function generateReleaseIt(ctx) {
8995
8993
  description: "Generated .release-it.json"
8996
8994
  };
8997
8995
  }
8998
- // src/generators/changesets.ts
8996
+ // src/generators/release/changesets.ts
8999
8997
  function buildConfig$2(defaultBranch) {
9000
8998
  return {
9001
8999
  $schema: "https://unpkg.com/@changesets/config@3.1.1/schema.json",
@@ -9030,7 +9028,7 @@ async function generateChangesets(ctx) {
9030
9028
  description: "Generated .changeset/config.json"
9031
9029
  };
9032
9030
  }
9033
- // src/generators/lefthook.ts
9031
+ // src/generators/lint-format/lefthook.ts
9034
9032
  const LINT_COMMAND = "pnpm exec oxlint --no-error-on-unmatched-pattern {staged_files}";
9035
9033
  function formatCommandFor(formatter) {
9036
9034
  return formatter === "prettier" ? "pnpm exec prettier --ignore-unknown --no-error-on-unmatched-pattern --write {staged_files}" : "pnpm exec oxfmt --no-error-on-unmatched-pattern {staged_files}";
@@ -9604,7 +9602,7 @@ function matchStatusBlock(content) {
9604
9602
  quoted: statusQuoted
9605
9603
  };
9606
9604
  }
9607
- // src/generators/claude-md.ts
9605
+ // src/generators/claude/claude-md.ts
9608
9606
  const FILE = "CLAUDE.md";
9609
9607
  function codeList(words) {
9610
9608
  return words.map((word) => `\`${word}\``).join(", ");
@@ -9869,18 +9867,18 @@ function webUiGuideBody() {
9869
9867
  "@types/node": "24.19.2",
9870
9868
  "@vitest/coverage-v8": "5.0.5",
9871
9869
  "commit-and-tag-version": "13.3.0",
9872
- "knip": "6.42.1",
9870
+ "knip": "6.44.0",
9873
9871
  "lefthook": "2.2.2",
9874
- "modern-web-guidance": "0.0.195",
9875
- "oxfmt": "0.74.0",
9876
- "oxlint": "1.89.0",
9872
+ "modern-web-guidance": "0.0.196",
9873
+ "oxfmt": "0.75.0",
9874
+ "oxlint": "1.90.0",
9877
9875
  "oxlint-tsgolint": "7.0.2005",
9878
9876
  "prettier": "3.9.10",
9879
9877
  "release-it": "21.1.1",
9880
- "tsdown": "0.23.1",
9878
+ "tsdown": "0.23.4",
9881
9879
  "typescript": "6.0.3",
9882
9880
  "vitest": "5.0.5",
9883
- "pnpm": "11.28.8"
9881
+ "pnpm": "11.28.9"
9884
9882
  }["modern-web-guidance"]}`;
9885
9883
  return [
9886
9884
  "# Web UI",
@@ -10284,7 +10282,7 @@ async function generateClaudeMd(ctx) {
10284
10282
  syncAgentsMdLink(ctx)
10285
10283
  ];
10286
10284
  }
10287
- // src/generators/versionrc.ts
10285
+ // src/generators/release/versionrc.ts
10288
10286
  function buildConfig() {
10289
10287
  return {
10290
10288
  header: "# Changelog\n\nAll notable changes to this project will be documented in this file.\n",
@@ -10349,7 +10347,7 @@ async function generateVersionrc(ctx) {
10349
10347
  description: "Generated .versionrc.json"
10350
10348
  };
10351
10349
  }
10352
- // src/generators/stale-ci-workflows.ts
10350
+ // src/generators/ci/stale-ci-workflows.ts
10353
10351
  async function generateStaleCiWorkflows(ctx) {
10354
10352
  const ci = ctx.config.ci;
10355
10353
  if (ci === "none") return [];
@@ -10430,7 +10428,7 @@ async function runGenerators(ctx) {
10430
10428
  results.push(saveToolingConfig(ctx, ctx.config));
10431
10429
  return results;
10432
10430
  }
10433
- // src/utils/generator-failures.ts
10431
+ // src/generators/generator-failures.ts
10434
10432
  function failedResults(results) {
10435
10433
  return results.filter((r) => r.action === "failed");
10436
10434
  }
@@ -10443,7 +10441,7 @@ function reportFailures(failed, command) {
10443
10441
  function generateMigratePrompt(results, config, detected) {
10444
10442
  const sections = [];
10445
10443
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
10446
- sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.104.0 repo:sync\` on ${timestamp}_\n`);
10444
+ sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.105.0 repo:sync\` on ${timestamp}_\n`);
10447
10445
  const changed = results.filter((r) => r.action === "created" || r.action === "updated" || r.action === "archived");
10448
10446
  if (changed.length > 0) {
10449
10447
  const items = changed.map((r) => {
@@ -10554,7 +10552,7 @@ function addTestGenerationTasks(tasks, results) {
10554
10552
  A starter test was created at \`test/example.test.ts\`. Review \`src/\` and create additional tests covering exported functions and edge cases.
10555
10553
  `);
10556
10554
  }
10557
- // src/commands/repo-init.ts
10555
+ // src/commands/repo/repo-init.ts
10558
10556
  function logDetectionSummary(ctx) {
10559
10557
  if (ctx.config.publishDocker) {
10560
10558
  const publishablePackages = detectContextDockerPackages(ctx).filter((pkg) => pkg.publish);
@@ -12105,7 +12103,7 @@ function parseListFlag(rawArgs, flag) {
12105
12103
  }
12106
12104
  return values.flatMap((value) => value.split(",")).map((value) => value.trim()).filter((value) => value.length > 0);
12107
12105
  }
12108
- // src/commands/repo-run-checks.ts
12106
+ // src/commands/repo/repo-run-checks.ts
12109
12107
  const CHECKS = [
12110
12108
  { name: "build" },
12111
12109
  { name: "typecheck" },
@@ -12492,7 +12490,7 @@ const WORKFLOW_DIR_PREFIXES = [".forgejo/workflows/", ".github/workflows/"];
12492
12490
  function isWorkflowDirPath(filePath) {
12493
12491
  return WORKFLOW_DIR_PREFIXES.some((prefix) => filePath.startsWith(prefix));
12494
12492
  }
12495
- // src/commands/workflow-apt-steps.ts
12493
+ // src/commands/repo/workflow-apt-steps.ts
12496
12494
  const APT_INSTALL = /\bapt(?:-get)?(?:\s+-\S+)*\s+install\b/g;
12497
12495
  const COMMAND_END = /&&|\|\||;|\|/;
12498
12496
  function workflowFiles(targetDir) {
@@ -12575,7 +12573,7 @@ function findWorkflowAptSteps(targetDir) {
12575
12573
  }
12576
12574
  return steps.toSorted((a, b) => a.file.localeCompare(b.file));
12577
12575
  }
12578
- // src/commands/sync-gates.ts
12576
+ // src/commands/repo/sync-gates.ts
12579
12577
  function runReleaseTargetGate(config, targetDir) {
12580
12578
  const file = releaseTargetConflict(config.stack, config.releaseStrategy, targetDir);
12581
12579
  if (!file) return false;
@@ -12802,7 +12800,7 @@ function runToolchainGate(targetDir) {
12802
12800
  if (!declared) return 0;
12803
12801
  return checkDeclaredToolsActive(targetDir, declared);
12804
12802
  }
12805
- // src/commands/repo-sync.ts
12803
+ // src/commands/repo/repo-sync.ts
12806
12804
  const rawLog$1 = (msg) => console.log(msg);
12807
12805
  const syncCommand = defineCommand({
12808
12806
  meta: {
@@ -13255,6 +13253,7 @@ const PrDetailSchema = z.object({
13255
13253
  draft: z.boolean(),
13256
13254
  merged: z.boolean(),
13257
13255
  mergeable: z.boolean().nullish(),
13256
+ merge_commit_sha: z.string().nullish(),
13258
13257
  state: z.string()
13259
13258
  });
13260
13259
  function parsePrDetailOrThrow(data) {
@@ -13262,6 +13261,10 @@ function parsePrDetailOrThrow(data) {
13262
13261
  if (!parsed.success) throw new UnexpectedError(`Unexpected PR detail response: ${parsed.error.message}`);
13263
13262
  return parsed.data;
13264
13263
  }
13264
+ const MERGE_COMMIT_SHA = /^[0-9a-f]{7,64}$/;
13265
+ function isMergeCommitSha(value) {
13266
+ return value !== void 0 && value !== null && MERGE_COMMIT_SHA.test(value);
13267
+ }
13265
13268
  function normalizePrDetail(data) {
13266
13269
  return {
13267
13270
  head: {
@@ -13277,6 +13280,7 @@ function normalizePrDetail(data) {
13277
13280
  draft: data.draft,
13278
13281
  merged: data.merged,
13279
13282
  mergeable: data.mergeable ?? null,
13283
+ mergeCommitSha: isMergeCommitSha(data.merge_commit_sha) ? data.merge_commit_sha : null,
13280
13284
  state: data.state
13281
13285
  };
13282
13286
  }
@@ -13321,6 +13325,21 @@ async function retargetPr(executor, conn, prNumber, base) {
13321
13325
  resource: `#${String(prNumber)}`
13322
13326
  });
13323
13327
  }
13328
+ async function reopenPr(executor, conn, prNumber) {
13329
+ const url = `${conn.serverUrl}/api/v1/repos/${conn.repository}/pulls/${String(prNumber)}`;
13330
+ const res = await executor.fetch(url, {
13331
+ method: "PATCH",
13332
+ headers: {
13333
+ Authorization: `token ${conn.token}`,
13334
+ "Content-Type": "application/json"
13335
+ },
13336
+ body: JSON.stringify({ state: "open" })
13337
+ }, { idempotent: true });
13338
+ if (!res.ok) await throwForgejoFailure(res, {
13339
+ verb: "reopen PR",
13340
+ resource: `#${String(prNumber)}`
13341
+ });
13342
+ }
13324
13343
  const PrContentSchema = z.object({
13325
13344
  title: z.string(),
13326
13345
  body: z.string().nullish()
@@ -14010,7 +14029,7 @@ async function configureGitIdentity(executor, platform, cwd, conn, signal = null
14010
14029
  email
14011
14030
  };
14012
14031
  }
14013
- // src/commands/release-changesets.ts
14032
+ // src/commands/release/release-changesets.ts
14014
14033
  const releaseForgejoCommand = defineCommand({
14015
14034
  meta: {
14016
14035
  name: "release:changesets",
@@ -14257,7 +14276,7 @@ function dispatchGitHub(options, executor) {
14257
14276
  inputs: options.inputs
14258
14277
  };
14259
14278
  }
14260
- // src/commands/release-trigger.ts
14279
+ // src/commands/release/release-trigger.ts
14261
14280
  const releaseTriggerCommand = defineCommand({
14262
14281
  meta: {
14263
14282
  name: "release:trigger",
@@ -15502,7 +15521,8 @@ function forgejoPrEditHost(fetcher, conn) {
15502
15521
  readLive: (number) => getPrEditState(fetcher, conn, number),
15503
15522
  branchExists: (name) => branchExists(fetcher, conn, name),
15504
15523
  setBase: (number, base) => retargetPr(fetcher, conn, number, base),
15505
- ready: (number, write) => updatePr(fetcher, conn, number, { title: write.title })
15524
+ ready: (number, write) => updatePr(fetcher, conn, number, { title: write.title }),
15525
+ reopen: (number) => reopenPr(fetcher, conn, number)
15506
15526
  };
15507
15527
  }
15508
15528
  // src/release/github-pr-host.ts
@@ -15754,6 +15774,15 @@ function githubPrEditHost(executor, cwd, repository) {
15754
15774
  ]);
15755
15775
  if (result.exitCode !== 0) throw new FatalError(`Failed to retarget PR #${String(number)}: ${result.stderr || result.stdout}`);
15756
15776
  },
15777
+ async reopen(number) {
15778
+ const result = await runGh$1(executor, cwd, [
15779
+ "pr",
15780
+ "reopen",
15781
+ String(number),
15782
+ ...target
15783
+ ]);
15784
+ if (result.exitCode !== 0) throw new FatalError(`Failed to reopen PR #${String(number)}: ${result.stderr || result.stdout}`);
15785
+ },
15757
15786
  async ready(number, write) {
15758
15787
  if (write.draft) {
15759
15788
  const result = await runGh$1(executor, cwd, [
@@ -20390,7 +20419,7 @@ async function readClosedIssueClaims(executor, options) {
20390
20419
  return null;
20391
20420
  }
20392
20421
  }
20393
- // src/commands/pr-create.ts
20422
+ // src/commands/pr/pr-create.ts
20394
20423
  const prCreateCommand = defineCommand({
20395
20424
  meta: {
20396
20425
  name: "pr:create",
@@ -20482,8 +20511,9 @@ function isOpen(live) {
20482
20511
  return live.state === "open" && live.merged === false;
20483
20512
  }
20484
20513
  function notOpenMessage(prNumber, live) {
20485
- const what = live.merged ? "merged" : live.state;
20486
- return `Pull request #${String(prNumber)} is ${what}, so it has no base or draft state left to change. Reopen it first if this work is still live.`;
20514
+ const number = `#${String(prNumber)}`;
20515
+ if (live.merged) return `Pull request ${number} is merged, so it has no base or draft state left to change.`;
20516
+ return `Pull request ${number} is ${live.state}, so it has no base or draft state left to change. Run \`pr:reopen ${String(prNumber)}\` first if this work is still live.`;
20487
20517
  }
20488
20518
  async function runPrRetarget(host, options) {
20489
20519
  const live = await host.readLive(options.number);
@@ -20579,8 +20609,47 @@ async function runPrReady(host, options) {
20579
20609
  dryRun: false
20580
20610
  };
20581
20611
  }
20612
+ async function runPrReopen(host, options) {
20613
+ const live = await host.readLive(options.number);
20614
+ if (live.merged === true) throw new FatalError(`Pull request #${String(options.number)} was merged, so there is nothing to reopen -- open a new pull request for further work.`);
20615
+ if (live.state === "open") return {
20616
+ action: "already-open",
20617
+ number: options.number,
20618
+ url: live.url,
20619
+ title: live.title,
20620
+ head: live.head,
20621
+ base: live.base,
20622
+ draft: live.draft,
20623
+ dryRun: options.dryRun
20624
+ };
20625
+ if (live.state !== "closed") throw new FatalError(`Pull request #${String(options.number)} reports the state "${live.state}", which this command has no rule for -- it reopens a pull request reported as closed, and guesses at no state it did not expect.`);
20626
+ if (options.dryRun) return {
20627
+ action: "would-reopen",
20628
+ number: options.number,
20629
+ url: live.url,
20630
+ title: live.title,
20631
+ head: live.head,
20632
+ base: live.base,
20633
+ draft: live.draft,
20634
+ dryRun: true
20635
+ };
20636
+ await host.reopen(options.number);
20637
+ const recheck = await host.readLive(options.number);
20638
+ if (!isOpen(recheck)) throw new FatalError(`Pull request #${String(options.number)} still reports \`${recheck.state}\` after the request to reopen it -- reopen it in the forge's web interface.`);
20639
+ return {
20640
+ action: "reopened",
20641
+ number: options.number,
20642
+ url: recheck.url,
20643
+ title: recheck.title,
20644
+ head: recheck.head,
20645
+ base: recheck.base,
20646
+ draft: recheck.draft,
20647
+ dryRun: false
20648
+ };
20649
+ }
20582
20650
  const PR_RETARGET_JSON_HELP = "Emit one JSON document: action (retargeted | unchanged | would-retarget), number, url, previousBase, base, head, mergeable (true | false | null, advice only), dryRun; a refusal is an error, never this document.";
20583
20651
  const PR_READY_JSON_HELP = "Emit one JSON document: action (readied | retitled | already-ready | would-ready | would-retitle), number, url, previousTitle, title, draft, dryRun; a refusal is an error, never this document.";
20652
+ const PR_REOPEN_JSON_HELP = "Emit one JSON document: action (reopened | already-open | would-reopen), number, url, title, head, base, draft, dryRun; a refusal is an error, never this document.";
20584
20653
  function mergeabilityLine(mergeable) {
20585
20654
  if (mergeable === true) return "Mergeability: mergeable.";
20586
20655
  if (mergeable === false) return "Mergeability: not mergeable -- advice, not a verdict.";
@@ -20603,6 +20672,16 @@ function renderPrReady(result) {
20603
20672
  if (result.action === "would-ready") return `Dry run: pull request ${number} would stop being a draft, reading "${result.title}".`;
20604
20673
  return `Dry run: pull request ${number} would read "${result.title}".`;
20605
20674
  }
20675
+ function renderPrReopen(result) {
20676
+ const number = `#${String(result.number)}`;
20677
+ if (result.action === "reopened") {
20678
+ const lines = [`Pull request ${number} is open again (head "${result.head}" -> "${result.base}").`];
20679
+ if (result.draft) lines.push(`It is still a draft -- run pr:ready ${String(result.number)} when it is ready for review.`);
20680
+ return lines.join("\n");
20681
+ }
20682
+ if (result.action === "already-open") return `Pull request ${number} is already open.`;
20683
+ return `Dry run: pull request ${number} would be reopened.`;
20684
+ }
20606
20685
  // ../forgejo/src/pr-number.ts
20607
20686
  function parsePrNumber(raw) {
20608
20687
  const value = Number(raw);
@@ -20610,13 +20689,22 @@ function parsePrNumber(raw) {
20610
20689
  return value;
20611
20690
  }
20612
20691
  // src/release/pr-edit-host.ts
20613
- function resolvePrEditHost(executor, cwd, repo) {
20692
+ function resolvePrEditTarget(executor, cwd, repo) {
20614
20693
  const resolved = resolveIssueTransport(executor, cwd, parseRepoTarget(repo));
20615
- if (resolved.target.hostname === "github.com") return githubPrEditHost(executor, cwd, resolved.target.repository);
20694
+ if (resolved.target.hostname === "github.com") return {
20695
+ host: githubPrEditHost(executor, cwd, resolved.target.repository),
20696
+ issues: resolved.api
20697
+ };
20616
20698
  if (resolved.conn === void 0) throw new UnexpectedError(`Resolved a non-github.com target (${resolved.target.hostname}) with no Forgejo connection.`);
20617
- return forgejoPrEditHost(executor, resolved.conn);
20699
+ return {
20700
+ host: forgejoPrEditHost(executor, resolved.conn),
20701
+ issues: resolved.api
20702
+ };
20618
20703
  }
20619
- // src/commands/pr-ready.ts
20704
+ function resolvePrEditHost(executor, cwd, repo) {
20705
+ return resolvePrEditTarget(executor, cwd, repo).host;
20706
+ }
20707
+ // src/commands/pr/pr-ready.ts
20620
20708
  const prReadyCommand = defineCommand({
20621
20709
  meta: {
20622
20710
  name: "pr:ready",
@@ -20660,7 +20748,49 @@ const prReadyCommand = defineCommand({
20660
20748
  out.text(renderPrReady(result));
20661
20749
  }
20662
20750
  });
20663
- // src/commands/pr-retarget.ts
20751
+ // src/commands/pr/pr-reopen.ts
20752
+ const prReopenCommand = defineCommand({
20753
+ meta: {
20754
+ name: "pr:reopen",
20755
+ description: "Reopen a closed, unmerged pull request and confirm the forge reports it open, on Forgejo or GitHub. An already-open pull request is reported without writing; a merged one, or an issue, is refused"
20756
+ },
20757
+ args: {
20758
+ number: {
20759
+ type: "positional",
20760
+ required: true,
20761
+ description: "Pull request number"
20762
+ },
20763
+ repo: {
20764
+ type: "string",
20765
+ description: "Repository URL (default: this repo)"
20766
+ },
20767
+ "dry-run": {
20768
+ type: "boolean",
20769
+ description: "Run every read and report, but do not write"
20770
+ },
20771
+ json: {
20772
+ type: "boolean",
20773
+ description: PR_REOPEN_JSON_HELP
20774
+ },
20775
+ verbose: {
20776
+ type: "boolean",
20777
+ description: "Emit detailed debug output"
20778
+ }
20779
+ },
20780
+ async run({ args }) {
20781
+ const out = createCliOutput(args.json === true);
20782
+ const { host, issues } = resolvePrEditTarget(createRealExecutor$1(), process.cwd(), args.repo ?? void 0);
20783
+ const number = parsePrNumber(args.number);
20784
+ if (!(await issues.get(number)).isPullRequest) throw new FatalError(`#${String(number)} is an issue, not a pull request -- pr:reopen refuses to write issue state. Use \`pnpm exec bst issue:reopen ${String(number)}\` to reopen it.`);
20785
+ const result = await runPrReopen(host, {
20786
+ number,
20787
+ dryRun: args["dry-run"] === true
20788
+ });
20789
+ out.json(result);
20790
+ out.text(renderPrReopen(result));
20791
+ }
20792
+ });
20793
+ // src/commands/pr/pr-retarget.ts
20664
20794
  const prRetargetCommand = defineCommand({
20665
20795
  meta: {
20666
20796
  name: "pr:retarget",
@@ -20707,7 +20837,7 @@ const prRetargetCommand = defineCommand({
20707
20837
  out.text(renderPrRetarget(result));
20708
20838
  }
20709
20839
  });
20710
- // src/commands/pr-update.ts
20840
+ // src/commands/pr/pr-update.ts
20711
20841
  const prUpdateCommand = defineCommand({
20712
20842
  meta: {
20713
20843
  name: "pr:update",
@@ -21007,7 +21137,7 @@ async function createPlatformRelease(executor, config, tag, version) {
21007
21137
  log$1.info(`Created GitHub release for ${tag}`);
21008
21138
  return true;
21009
21139
  }
21010
- // src/commands/release-simple.ts
21140
+ // src/commands/release/release-simple.ts
21011
21141
  const releaseSimpleCommand = defineCommand({
21012
21142
  meta: {
21013
21143
  name: "release:simple",
@@ -21095,7 +21225,7 @@ const releaseSimpleCommand = defineCommand({
21095
21225
  }
21096
21226
  }
21097
21227
  });
21098
- // src/commands/release-assets.ts
21228
+ // src/commands/release/release-assets.ts
21099
21229
  const releaseAssetsCommand = defineCommand({
21100
21230
  meta: {
21101
21231
  name: "release:assets",
@@ -21410,7 +21540,7 @@ const lintReportCommand = defineCommand({
21410
21540
  process.exitCode = exitCode;
21411
21541
  }
21412
21542
  });
21413
- // src/commands/publish-docker.ts
21543
+ // src/commands/docker/publish-docker.ts
21414
21544
  function requireDockerCredentials(registryHost) {
21415
21545
  const username = process.env["DOCKER_USERNAME"];
21416
21546
  const password = process.env["DOCKER_PASSWORD"];
@@ -21485,7 +21615,7 @@ const publishDockerCommand = defineCommand({
21485
21615
  runDockerPublish(createRealExecutor$1(), config);
21486
21616
  }
21487
21617
  });
21488
- // src/commands/docker-build.ts
21618
+ // src/commands/docker/docker-build.ts
21489
21619
  function detectSubpackage(cwd) {
21490
21620
  const parent = path.dirname(cwd);
21491
21621
  if (path.basename(parent) === "packages" && existsSync(path.join(parent, "..", "package.json"))) return {
@@ -21838,7 +21968,7 @@ function composePs(executor, config) {
21838
21968
  // src/docker-check/health.ts
21839
21969
  const DOCKER_RUN_START_FAILURE_EXIT_CODE = 125;
21840
21970
  const PROBE_TIMEOUT_SECONDS = "5";
21841
- const PROBE_IMAGE = "curlimages/curl:8.23.0@sha256:11e64e28c5f58c8d93ee95fcf22ac055f48b0bc440e0ce7d8013bbb5ad6aa8ac";
21971
+ const PROBE_IMAGE = "curlimages/curl:8.23.0@sha256:3fb7e13e5d179a845c97d78204f3f1064d1907037f26a3ebf91710571151fd93";
21842
21972
  function getContainerHealth(containers, serviceName) {
21843
21973
  return containers.find((c) => c.Service === serviceName)?.Health ?? "unknown";
21844
21974
  }
@@ -22094,7 +22224,7 @@ function deriveProjectName(repoName, env = process.env) {
22094
22224
  function sanitize(name) {
22095
22225
  return name.replace(/^@[^/]+\//, "").toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || "repo";
22096
22226
  }
22097
- // src/commands/docker-check.ts
22227
+ // src/commands/docker/docker-check.ts
22098
22228
  function toHttpHealthChecks(checks) {
22099
22229
  return checks.map((check) => ({
22100
22230
  name: check.name,
@@ -22219,7 +22349,7 @@ const dockerCheckCommand = defineCommand({
22219
22349
  }
22220
22350
  }
22221
22351
  });
22222
- // src/commands/docker-sweep.ts
22352
+ // src/commands/docker/docker-sweep.ts
22223
22353
  function parseMaxAgeHours(raw) {
22224
22354
  const value = Number(raw);
22225
22355
  if (raw.trim() === "" || !Number.isFinite(value) || value < 0) throw new FatalError(`--max-age must be a non-negative number of hours, got "${raw}"`);
@@ -23326,14 +23456,14 @@ function formatTimestamp(iso) {
23326
23456
  if (Number.isNaN(date.getTime())) return iso;
23327
23457
  return `${String(date.getUTCFullYear())}-${String(date.getUTCMonth() + 1).padStart(2, "0")}-${String(date.getUTCDate()).padStart(2, "0")}`;
23328
23458
  }
23329
- // src/commands/coverage-missing-summary.ts
23459
+ // src/commands/coverage-tracking/coverage-missing-summary.ts
23330
23460
  const COVERAGE_SUMMARY_FILE$3 = "coverage/coverage-summary.json";
23331
23461
  function missingSummaryMessage(targetDir) {
23332
23462
  const base = `${COVERAGE_SUMMARY_FILE$3} not found. Run \`pnpm test:coverage\` first, or add "json-summary" to your vitest reporters.`;
23333
23463
  const hint = diagnoseCheckScriptForwardingAt(targetDir);
23334
23464
  return hint ? `${base}\n\n${hint}` : base;
23335
23465
  }
23336
- // src/commands/coverage-summary.ts
23466
+ // src/commands/coverage-tracking/coverage-summary.ts
23337
23467
  const COVERAGE_SUMMARY_FILE$2 = "coverage/coverage-summary.json";
23338
23468
  function readSummary(targetDir) {
23339
23469
  const summaryPath = path.join(targetDir, COVERAGE_SUMMARY_FILE$2);
@@ -23397,7 +23527,7 @@ const coverageSummaryCommand = defineCommand({
23397
23527
  function serializeBaseline(baseline) {
23398
23528
  return JSON.stringify(baseline, null, 2) + "\n";
23399
23529
  }
23400
- // src/commands/coverage-check.ts
23530
+ // src/commands/coverage-tracking/coverage-check.ts
23401
23531
  const COVERAGE_SUMMARY_FILE$1 = "coverage/coverage-summary.json";
23402
23532
  const BASELINE_FILE$2 = "coverage-baseline.json";
23403
23533
  const MIGRATION_NOTICE = `${BASELINE_FILE$2} predates coverage.include scoping (no scope marker). Totals may have shifted because previously-untested files entered the denominator for the first time -- that is not necessarily a regression. This comparison is advisory only until the baseline is migrated: run \`pnpm test:coverage && pnpm exec bst coverage:check --update-baseline --reset\` once to adopt the honest, marked baseline. Normal gating resumes after that.`;
@@ -23502,7 +23632,7 @@ const coverageCheckCommand = defineCommand({
23502
23632
  if (!result.pass && !isLegacyBaseline) process.exitCode = 1;
23503
23633
  }
23504
23634
  });
23505
- // src/commands/coverage-record.ts
23635
+ // src/commands/coverage-tracking/coverage-record.ts
23506
23636
  const COVERAGE_SUMMARY_FILE = "coverage/coverage-summary.json";
23507
23637
  const coverageRecordCommand = defineCommand({
23508
23638
  meta: {
@@ -23572,7 +23702,7 @@ const coverageRecordCommand = defineCommand({
23572
23702
  });
23573
23703
  }
23574
23704
  });
23575
- // src/commands/coverage-status.ts
23705
+ // src/commands/coverage-tracking/coverage-status.ts
23576
23706
  const coverageStatusCommand = defineCommand({
23577
23707
  meta: {
23578
23708
  name: "coverage:status",
@@ -23618,7 +23748,7 @@ const coverageStatusCommand = defineCommand({
23618
23748
  out.text(formatTrendTable(trailing));
23619
23749
  }
23620
23750
  });
23621
- // src/codebase-health/baseline.ts
23751
+ // src/codebase-health/baseline/baseline.ts
23622
23752
  function serializeHealthBaseline(metrics, ceilings, sizeBudgets) {
23623
23753
  const ordered = {};
23624
23754
  for (const key of METRIC_KEYS) {
@@ -23640,7 +23770,7 @@ function writeHealthBaseline(targetDir, baseline) {
23640
23770
  const format = healthFileFormatter(targetDir);
23641
23771
  writeFileSync(path.join(targetDir, "health-baseline.json"), format("health-baseline.json", serializeHealthBaseline(baseline, baseline.moduleCeilings, baseline.sizeBudgets)));
23642
23772
  }
23643
- // src/codebase-health/exclude.ts
23773
+ // src/codebase-health/collect/exclude.ts
23644
23774
  function normalize(rel) {
23645
23775
  const posix = rel.replace(/\\/g, "/");
23646
23776
  return posix.startsWith("./") ? posix.slice(2) : posix;
@@ -23665,7 +23795,7 @@ function createExcludeMatcher(patterns) {
23665
23795
  return ancestors(normalized).some((dir) => isMatch(dir));
23666
23796
  };
23667
23797
  }
23668
- // src/codebase-health/exempt-match.ts
23798
+ // src/codebase-health/collect/exempt-match.ts
23669
23799
  function exemptKeyMatcher(key) {
23670
23800
  if (!picomatch.scan(key).isGlob) return (path) => path === key;
23671
23801
  const isMatch = picomatch(key, { dot: true });
@@ -23678,7 +23808,7 @@ function createExemptLookup(reasons) {
23678
23808
  }));
23679
23809
  return (path) => reasons[path] ?? globs.find((glob) => glob.matches(path))?.reason;
23680
23810
  }
23681
- // src/codebase-health/depcruise.ts
23811
+ // src/codebase-health/collect/depcruise.ts
23682
23812
  const DependencySchema = z.object({
23683
23813
  module: z.string(),
23684
23814
  resolved: z.string(),
@@ -23938,7 +24068,7 @@ function collectGraphDetails(executor, config, isExcluded = () => false, sourceL
23938
24068
  workspacePackages
23939
24069
  }) };
23940
24070
  }
23941
- // src/codebase-health/workspace-packages.ts
24071
+ // src/codebase-health/collect/workspace-packages.ts
23942
24072
  const PnpmWorkspaceSchema = z.object({ packages: z.array(z.string()).optional() });
23943
24073
  const RootManifestSchema = z.object({ workspaces: z.union([z.array(z.string()), z.object({ packages: z.array(z.string()) })]).optional() });
23944
24074
  const PackageNameSchema = z.object({ name: z.string() });
@@ -24032,7 +24162,7 @@ function listWorkspacePackageNames(executor) {
24032
24162
  }
24033
24163
  return names;
24034
24164
  }
24035
- // src/codebase-health/collect.ts
24165
+ // src/codebase-health/collect/collect.ts
24036
24166
  function buildCollectConfig(config, opts) {
24037
24167
  return {
24038
24168
  src: config.src,
@@ -24431,7 +24561,7 @@ function isFlatOrBetter(baseline, current, currentCeilings = {}, sizes = []) {
24431
24561
  });
24432
24562
  return metricsFlat && ceilingsFlat && sizesFlat;
24433
24563
  }
24434
- // src/codebase-health/raise.ts
24564
+ // src/codebase-health/baseline/raise.ts
24435
24565
  const SIZE_RAISE_FACTOR = 1.01;
24436
24566
  function sizeRaiseValue(measured) {
24437
24567
  return Math.floor(measured * SIZE_RAISE_FACTOR) + 1;
@@ -24820,7 +24950,7 @@ const CARRIED_RAISES_FIRST_LINE = "raises carried by this branch:";
24820
24950
  function formatCarriedRaises(raises) {
24821
24951
  return [CARRIED_RAISES_FIRST_LINE, ...raises.map((r) => ` ${r.leaf}: ${r.reference} -> ${r.current}`)].join("\n");
24822
24952
  }
24823
- // src/codebase-health/tighten.ts
24953
+ // src/codebase-health/baseline/tighten.ts
24824
24954
  const GRAPH_METRIC_KEYS = new Set(METRIC_KEYS.filter((key) => key !== "crowdedDirectories"));
24825
24955
  function isGraphMetric(key) {
24826
24956
  return GRAPH_METRIC_KEYS.has(key);
@@ -25002,7 +25132,7 @@ function baselineUpdateRefusal(attribution) {
25002
25132
  }
25003
25133
  return null;
25004
25134
  }
25005
- // src/codebase-health/base-checkout.ts
25135
+ // src/codebase-health/baseline/base-checkout.ts
25006
25136
  const TEMP_PREFIX = "bst-health-base-";
25007
25137
  function withMergeBaseCheckout(executor, targetDir, mergeBase, use) {
25008
25138
  const tmp = fs.mkdtempSync(path.join(os.tmpdir(), TEMP_PREFIX));
@@ -25091,7 +25221,7 @@ function linkRelative(link, target) {
25091
25221
  fs.symlinkSync(link, target);
25092
25222
  } catch (_error) {}
25093
25223
  }
25094
- // src/codebase-health/base-outliers.ts
25224
+ // src/codebase-health/baseline/base-outliers.ts
25095
25225
  function unavailable(reason) {
25096
25226
  return {
25097
25227
  status: "unavailable",
@@ -25120,7 +25250,7 @@ function measureBaseOutliers(opts) {
25120
25250
  return unavailable(describeError$1(error));
25121
25251
  }
25122
25252
  }
25123
- // src/codebase-health/size.ts
25253
+ // src/codebase-health/collect/size.ts
25124
25254
  function byteLength(absolute) {
25125
25255
  try {
25126
25256
  const stats = statSync(absolute);
@@ -25371,7 +25501,7 @@ function findStaleEntries(baseline, details, exempt) {
25371
25501
  }
25372
25502
  return stale;
25373
25503
  }
25374
- // src/commands/health-check.ts
25504
+ // src/commands/health/health-check.ts
25375
25505
  function assessSwitchOff(executor, targetDir, config, out) {
25376
25506
  const read = readTargetReference(executor, targetDir, out);
25377
25507
  if (read.kind === "unavailable") return void 0;
@@ -25597,7 +25727,7 @@ const healthCheckCommand = defineCommand({
25597
25727
  if (!verdictPasses || graphUnavailable !== void 0) process.exitCode = 1;
25598
25728
  }
25599
25729
  });
25600
- // src/commands/health-raise.ts
25730
+ // src/commands/health/health-raise.ts
25601
25731
  const JsonValueSchema = z.json();
25602
25732
  const TOOLING_FILE = ".tooling.json";
25603
25733
  function collectExemptPairs(rawArgs) {
@@ -25715,7 +25845,7 @@ function writePlan(targetDir, plan) {
25715
25845
  }
25716
25846
  return wrote;
25717
25847
  }
25718
- // src/commands/health-tighten.ts
25848
+ // src/commands/health/health-tighten.ts
25719
25849
  const BASELINE_FILE = "health-baseline.json";
25720
25850
  function describePlan(plan) {
25721
25851
  const lines = [];
@@ -25879,7 +26009,7 @@ function formatModuleReports(reports) {
25879
26009
  }
25880
26010
  return lines.join("\n");
25881
26011
  }
25882
- // src/commands/health-summary.ts
26012
+ // src/commands/health/health-summary.ts
25883
26013
  function readCoverageNote(targetDir) {
25884
26014
  const file = path.join(targetDir, "coverage-baseline.json");
25885
26015
  if (!existsSync(file)) return void 0;
@@ -25984,7 +26114,7 @@ const healthSummaryCommand = defineCommand({
25984
26114
  if (moduleReports !== void 0) out.text(formatModuleReports(moduleReports));
25985
26115
  }
25986
26116
  });
25987
- // src/codebase-health/history.ts
26117
+ // src/codebase-health/baseline/history.ts
25988
26118
  const HEALTH_HISTORY_FILE = "health-history.jsonl";
25989
26119
  function appendHealthRecord(executor, config, record) {
25990
26120
  return appendRecord(executor, {
@@ -25999,7 +26129,7 @@ function readHealthRecords(executor, config) {
25999
26129
  historyFile: HEALTH_HISTORY_FILE
26000
26130
  }, parseHealthHistoryLine);
26001
26131
  }
26002
- // src/commands/health-record.ts
26132
+ // src/commands/health/health-record.ts
26003
26133
  const healthRecordCommand = defineCommand({
26004
26134
  meta: {
26005
26135
  name: "health:record",
@@ -26074,7 +26204,7 @@ const healthRecordCommand = defineCommand({
26074
26204
  });
26075
26205
  }
26076
26206
  });
26077
- // src/commands/health-status.ts
26207
+ // src/commands/health/health-status.ts
26078
26208
  const healthStatusCommand = defineCommand({
26079
26209
  meta: {
26080
26210
  name: "health:status",
@@ -27433,7 +27563,7 @@ function formatReport(result) {
27433
27563
  lines.push(`[x] docs: ${String(fatal.length)} violation(s).`, "", ...group(fatal), "The plan-lifecycle guide (`.agent/guides/plan-lifecycle.md`) is the spec for all of this.", "Reminder: a doc's DIRECTORY is the source of truth for done-ness -- not its Status line, not its checkboxes.");
27434
27564
  return lines.join("\n");
27435
27565
  }
27436
- // src/commands/docs-check.ts
27566
+ // src/commands/docs/docs-check.ts
27437
27567
  function runDocsCheck(exec, config, opts) {
27438
27568
  const vc = { verbose: opts.verbose ?? false };
27439
27569
  if (!config.enabled) {
@@ -27574,7 +27704,7 @@ function listOpenDocs(exec, config, options = {}) {
27574
27704
  }
27575
27705
  return docs.toSorted(byPath);
27576
27706
  }
27577
- // src/commands/docs-list.ts
27707
+ // src/commands/docs/docs-list.ts
27578
27708
  function dayOf(iso) {
27579
27709
  if (iso === void 0) return "unknown";
27580
27710
  const day = iso.slice(0, 10);
@@ -27821,7 +27951,7 @@ function createRealRelocateExecutor(rootDir) {
27821
27951
  }
27822
27952
  };
27823
27953
  }
27824
- // src/commands/docs-delink.ts
27954
+ // src/commands/docs/docs-delink.ts
27825
27955
  const RETIRED_DIR_NAMES = /* @__PURE__ */ new Set(["retired", "completed"]);
27826
27956
  function assertRetiredDirs(dirs) {
27827
27957
  if (dirs.length === 0) throw new FatalError("docs:delink: at least one retired/ directory is required");
@@ -28017,7 +28147,7 @@ function applyRelocatePlan(exec, plan) {
28017
28147
  for (const move of plan.moves) if (move.status === "pending") exec.move(move.from, move.to);
28018
28148
  for (const rewrite of plan.rewrites) exec.writeFile(rewrite.file, rewrite.content);
28019
28149
  }
28020
- // src/commands/docs-relocate.ts
28150
+ // src/commands/docs/docs-relocate.ts
28021
28151
  function isExistingDirectory(exec, rel) {
28022
28152
  return exec.exists(rel) && exec.readFile(rel) === void 0;
28023
28153
  }
@@ -28116,7 +28246,7 @@ const docsRelocateCommand = defineCommand({
28116
28246
  function localToday(now) {
28117
28247
  return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`;
28118
28248
  }
28119
- // src/commands/docs-retire.ts
28249
+ // src/commands/docs/docs-retire.ts
28120
28250
  const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
28121
28251
  function validateRetireArgs(exec, src, opts) {
28122
28252
  if (!isRetireVerb(opts.status)) throw new FatalError(`docs:retire: unrecognized --status "${opts.status}" (expected one of: ${RETIRE_VERBS.join(", ")})`);
@@ -28466,7 +28596,7 @@ async function runIssueCreate(executor, options) {
28466
28596
  throw error;
28467
28597
  }
28468
28598
  }
28469
- // src/commands/issue-view.ts
28599
+ // src/commands/issue/issue-view.ts
28470
28600
  const issueViewCommand = defineCommand({
28471
28601
  meta: {
28472
28602
  name: "issue:view",
@@ -28505,7 +28635,7 @@ const issueViewCommand = defineCommand({
28505
28635
  log$1.info(formatIssue(view));
28506
28636
  }
28507
28637
  });
28508
- // src/commands/issue-list.ts
28638
+ // src/commands/issue/issue-list.ts
28509
28639
  const issueListCommand = defineCommand({
28510
28640
  meta: {
28511
28641
  name: "issue:list",
@@ -28558,7 +28688,7 @@ const issueListCommand = defineCommand({
28558
28688
  log$1.info(formatIssueList(result));
28559
28689
  }
28560
28690
  });
28561
- // src/commands/issue-comment.ts
28691
+ // src/commands/issue/issue-comment.ts
28562
28692
  const issueCommentCommand = defineCommand({
28563
28693
  meta: {
28564
28694
  name: "issue:comment",
@@ -28613,7 +28743,7 @@ const issueCommentCommand = defineCommand({
28613
28743
  log$1.info(formatIssueComment(result, args["dry-run"] === true));
28614
28744
  }
28615
28745
  });
28616
- // src/commands/issue-create.ts
28746
+ // src/commands/issue/issue-create.ts
28617
28747
  function collectLabelArgs(rawArgs) {
28618
28748
  return collectFlagValues(rawArgs, "--label");
28619
28749
  }
@@ -28694,7 +28824,7 @@ const issueCreateCommand = defineCommand({
28694
28824
  for (const line of formatIssueCreate(result, args.title, args["dry-run"] === true)) log$1.info(line);
28695
28825
  }
28696
28826
  });
28697
- // src/commands/issue-update.ts
28827
+ // src/commands/issue/issue-update.ts
28698
28828
  const issueUpdateCommand = defineCommand({
28699
28829
  meta: {
28700
28830
  name: "issue:update",
@@ -28877,7 +29007,7 @@ async function runIssueDownload(executor, options) {
28877
29007
  throw error;
28878
29008
  }
28879
29009
  }
28880
- // src/commands/issue-download.ts
29010
+ // src/commands/issue/issue-download.ts
28881
29011
  const issueDownloadCommand = defineCommand({
28882
29012
  meta: {
28883
29013
  name: "issue:download",
@@ -29027,7 +29157,7 @@ async function runIssueLabel(executor, options) {
29027
29157
  throw error;
29028
29158
  }
29029
29159
  }
29030
- // src/commands/issue-label.ts
29160
+ // src/commands/issue/issue-label.ts
29031
29161
  function defineIssueLabelCommand(action) {
29032
29162
  return defineCommand({
29033
29163
  meta: {
@@ -29106,7 +29236,7 @@ async function runIssueSetLabels(executor, options) {
29106
29236
  throw error;
29107
29237
  }
29108
29238
  }
29109
- // src/commands/issue-set-labels.ts
29239
+ // src/commands/issue/issue-set-labels.ts
29110
29240
  const issueSetLabelsCommand = defineCommand({
29111
29241
  meta: {
29112
29242
  name: "issue:set-labels",
@@ -29279,16 +29409,16 @@ async function runIssueState(executor, options) {
29279
29409
  file: "--comment-file"
29280
29410
  }));
29281
29411
  if (error instanceof PullRequestStateError) {
29282
- const ghAlternative = error.action === "close" ? "gh pr close" : "gh pr reopen";
29412
+ const advice = error.action === "close" ? `Run \`pnpm exec bst-fj pr:close ${String(error.number)}\` to close it; that bin installs with \`@bensandee/forgejo-cli\`. On GitHub, \`gh pr close ${String(error.number)}\`.` : `Run \`pnpm exec bst pr:reopen ${String(error.number)}\` to reopen it.`;
29283
29413
  throw new FatalError(describePullRequestState(error, {
29284
29414
  command: `issue:${error.action}`,
29285
- advice: `Use the forge UI, or \`${ghAlternative}\` on GitHub.`
29415
+ advice
29286
29416
  }));
29287
29417
  }
29288
29418
  throw error;
29289
29419
  }
29290
29420
  }
29291
- // src/commands/issue-state.ts
29421
+ // src/commands/issue/issue-state.ts
29292
29422
  function defineIssueStateCommand(action) {
29293
29423
  return defineCommand({
29294
29424
  meta: {
@@ -29351,7 +29481,7 @@ function defineIssueStateCommand(action) {
29351
29481
  }
29352
29482
  const issueCloseCommand = defineIssueStateCommand("close");
29353
29483
  const issueReopenCommand = defineIssueStateCommand("reopen");
29354
- // src/commands/findings-add.ts
29484
+ // src/commands/findings/findings-add.ts
29355
29485
  const SOURCE_RE = /^(pr|issue)#(\d+)$/;
29356
29486
  const ALLOWED_CLASSES = ["nit", "pre-existing"];
29357
29487
  function parseSource(source) {
@@ -29468,7 +29598,7 @@ const findingsAddCommand = defineCommand({
29468
29598
  if (result.createdLedgerDir) out.notice(`Created ${FINDINGS_DIR}/ -- the backlog sweep is now armed for this repo.`);
29469
29599
  }
29470
29600
  });
29471
- // src/commands/findings-list.ts
29601
+ // src/commands/findings/findings-list.ts
29472
29602
  const MS_PER_DAY = 864e5;
29473
29603
  function readFindingSummary(fullPath) {
29474
29604
  let body;
@@ -29551,7 +29681,7 @@ const findingsListCommand = defineCommand({
29551
29681
  out.text(renderText(result));
29552
29682
  }
29553
29683
  });
29554
- // src/commands/findings-resolve.ts
29684
+ // src/commands/findings/findings-resolve.ts
29555
29685
  function resolveFindingPath(rootDir, name) {
29556
29686
  const ledgerDir = path.join(rootDir, FINDINGS_DIR);
29557
29687
  const relative = name.includes("/") ? name : `${FINDINGS_DIR}/${name}`;
@@ -30127,7 +30257,7 @@ async function runCli(config) {
30127
30257
  // src/cli-main.ts
30128
30258
  setLogLevel(resolveLogLevel({}));
30129
30259
  setForgejoLogger(log$1);
30130
- const displayVersion = "0.104.0";
30260
+ const displayVersion = "0.105.0";
30131
30261
  const bstSubCommands = {
30132
30262
  "repo:sync": syncCommand,
30133
30263
  "checks:run": runChecksCommand,
@@ -30139,6 +30269,7 @@ const bstSubCommands = {
30139
30269
  "changesets:merge": releaseMergeCommand,
30140
30270
  "pr:create": prCreateCommand,
30141
30271
  "pr:ready": prReadyCommand,
30272
+ "pr:reopen": prReopenCommand,
30142
30273
  "pr:retarget": prRetargetCommand,
30143
30274
  "pr:update": prUpdateCommand,
30144
30275
  "release:simple": releaseSimpleCommand,