@theholocron/cli 5.0.0-alpha.407 → 5.0.0-alpha.409

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/README.md CHANGED
@@ -637,6 +637,7 @@ commands and the config are provider-neutral; Discord is the first provider.
637
637
  | `holocron doctor logs` | Does each Axiom dataset the setup ships logs to exist, and does the token reach it? Rows: `token is accepted` (a 401 fails), one `dataset for <service>` for the CLI (`HOLOCRON_AXIOM_DATASET`, resolved by the logger's own chain), Sentinel (`SENTINEL_AXIOM_DATASET`) and any other `dev.serve.logging.datasetVar` (a 404 fails and names the fix), `organization` (`HOLOCRON_AXIOM_ORG`, then `AXIOM_ORG`), and an `info` row per dataset with the `retentionDays` Axiom reports (or says it reported none). Reads through the optional `Logs.readDataset` / `Logs.checkToken`; never creates a dataset or prints a token. A name or token that cannot be read is a skip. Read-only |
638
638
  | `holocron doctor environments` | Do the deployment environments exist? The ones `repo setup` creates (`staging`, `production`, when an `environments` provider is configured) plus every environment `repo.secrets.environments` names. One row. A missing one fails; an extra one is never a problem; no provider with some named is a skip |
639
639
  | `holocron doctor project [--post [channel]]` | Does each board `providers.projects.boards` declares exist and match its template? One row per board, status list, field, view and automation rule; the board's extras and the items `project reconcile` would fix (no status, closed but not done, open blocker but not blocked, blocked without a blocker) are `info` rows, never a failure. A template file that does not read fails, naming the file. Read-only; `--post` shares the failing rows through the `notifications` bot. |
640
+ | `holocron doctor variable-owners` | Does a variable name live in more than one place? Reads the names (never a value) of the 1Password Environments the config names and of the GitHub Actions secrets and variables, and fails for a name two places hold, unless a `repo.secrets.sync` / `repo.variables.sync` entry made the copy, `doctor.sharedVariables` lists it, or both places are instances of one `githubApps` App. A bare name beside its prefixed one (`X`, `HOLOCRON_X`) is an `info` row; a place that cannot be read is a skip. Read-only |
640
641
  | `holocron doctor credentials` | Does the credentials environment exist, and does it hold every variable the configured plugins take? One row per variable and provider (`ok`, `fail` when missing, `skip` for an optional one not set), listing names only: it never reads a value, and says which spelling of the environment's name matched. |
641
642
  | `holocron doctor repo` | Do the repository settings `repo setup` writes match the config? One row per group the config declares: description and homepage, default branch and merge settings, topics, custom properties, team access, branch protection; labels and security settings are always checked. Read-only. Reads through optional `Source` methods (`getRepoInfo`, `getProperties`, `listLabels`, `listTeamAccess`, `getRulesetDetail`, `getSecurity`); a group that cannot be read is a skip, not a failure |
642
643
  | `holocron doctor dns` | Do the DNS records the config makes setup write exist, pointing where they should? The preview domain's apex and wildcard CNAMEs (Cloudflare), the docs host a wiki provider asks for, and the relay Worker's proxied placeholder; one row per zone. A missing record, another target or a missing proxy fails; an extra record never does. A record `ensureCustomDomain()` returns is not checked, because asking for it creates the domain |
@@ -929,8 +930,8 @@ the local override exists to exempt.
929
930
  `package bump-versions`, `package move-tag`, `sync github`, `repo upgrade node`,
930
931
  `repo upgrade deps`, `new plugin`, `auth`, `notifications setup`,
931
932
  `notifications channel add`, `notifications link`,
932
- `notifications sync-roles`, `doctor ci`, `doctor credentials`, `doctor dns`, `doctor environments`, `doctor monitoring`, `doctor notifications`, `doctor project`, `doctor repo`, `doctor secrets`, `doctor tokens`, `doctor variables`
933
- `notifications sync-roles`, `project reconcile`, `doctor ci`, `doctor credentials`, `doctor dns`, `doctor environments`, `doctor monitoring`, `doctor notifications`, `doctor repo`, `doctor secrets`, `doctor tokens`, `doctor variables`
933
+ `notifications sync-roles`, `doctor ci`, `doctor credentials`, `doctor dns`, `doctor environments`, `doctor monitoring`, `doctor notifications`, `doctor project`, `doctor repo`, `doctor secrets`, `doctor tokens`, `doctor variable-owners`, `doctor variables`
934
+ `notifications sync-roles`, `project reconcile`, `doctor ci`, `doctor credentials`, `doctor dns`, `doctor environments`, `doctor monitoring`, `doctor notifications`, `doctor repo`, `doctor secrets`, `doctor tokens`, `doctor variable-owners`, `doctor variables`
934
935
  - `src/commands/deep-checks/` — `DEEP_CHECKS`, the registry every `doctor <capability>` is
935
936
  listed in; the shared row renderer and `declaredVsActual` helper are in `@theholocron/kyber/ui`
936
937
  - `src/interactive-menu/` — the interactive fallback's Holocron data: `command-catalog`
package/dist/cli.mjs CHANGED
@@ -788,6 +788,7 @@ const COMMAND_CONTEXTS = {
788
788
  "doctor tokens": "workspace",
789
789
  "doctor monitoring": "workspace",
790
790
  "doctor variables": "workspace",
791
+ "doctor variable-owners": "workspace",
791
792
  "doctor ci": "repo-aware",
792
793
  probe: "workspace",
793
794
  provider: "workspace",
@@ -2108,6 +2109,13 @@ const doctorTokensEntry = {
2108
2109
  positionals: [],
2109
2110
  supportsDryRun: false
2110
2111
  };
2112
+ // src/commands/doctor-variable-owners/doctor-variable-owners.entry.ts
2113
+ const doctorVariableOwnersEntry = {
2114
+ name: "doctor variable-owners",
2115
+ description: "Flag a variable name that lives in more than one place: 1Password Environments and GitHub Actions (read-only, names only)",
2116
+ positionals: [],
2117
+ supportsDryRun: false
2118
+ };
2111
2119
  // src/commands/doctor-variables/doctor-variables.entry.ts
2112
2120
  const doctorVariablesEntry = {
2113
2121
  name: "doctor variables",
@@ -2635,6 +2643,7 @@ const registry = createCommandRegistry([
2635
2643
  doctorSecretsEntry,
2636
2644
  doctorTokensEntry,
2637
2645
  doctorVariablesEntry,
2646
+ doctorVariableOwnersEntry,
2638
2647
  doctorCiEntry,
2639
2648
  notificationsSetupEntry,
2640
2649
  notificationsCreateServerEntry,
@@ -10593,6 +10602,335 @@ const doctorSecretsCommand = {
10593
10602
  })).status === "fail") process.exitCode = 1;
10594
10603
  }
10595
10604
  };
10605
+ // src/commands/doctor-variable-owners/name-index.ts
10606
+ /** Every name across the places, folded to upper case as GitHub does, with the places that hold it. */
10607
+ function nameIndex(sources) {
10608
+ const index = /* @__PURE__ */ new Map();
10609
+ for (const source of sources) for (const name of source.names) {
10610
+ const key = name.toUpperCase();
10611
+ const held = index.get(key) ?? {
10612
+ name,
10613
+ places: []
10614
+ };
10615
+ if (!held.places.includes(source)) held.places.push(source);
10616
+ index.set(key, held);
10617
+ }
10618
+ return index;
10619
+ }
10620
+ // src/commands/doctor-variable-owners/find-duplicates.ts
10621
+ /**
10622
+ * The names that live in more than one place, sorted by name. A name is left out when `shared` lists it (deliberate sharing),
10623
+ * and a GitHub copy is not counted when an Environment that holds the name fills it through a sync entry (`feeds`):
10624
+ * that is the one allowed path. Places of one group count once, so the instances of one App never clash.
10625
+ *
10626
+ * @param sources - What each place holds.
10627
+ * @param feeds - `repo.secrets.sync` and `repo.variables.sync`, as {@link SyncFeed}s.
10628
+ * @param shared - `doctor.sharedVariables`.
10629
+ */
10630
+ function findDuplicates(sources, feeds, shared) {
10631
+ const allowed = new Set(shared.map((name) => name.toUpperCase()));
10632
+ const found = [];
10633
+ for (const [key, holders] of [...nameIndex(sources)].sort(([a], [b]) => a < b ? -1 : 1)) {
10634
+ if (allowed.has(key)) continue;
10635
+ const filled = (place) => place.feed !== void 0 && feeds.some((feed) => feed.target === place.feed && (feed.keys === void 0 || feed.keys.some((k) => k.toUpperCase() === key)) && holders.places.some((other) => other.environment === feed.environment));
10636
+ const places = holders.places.filter((place) => !filled(place));
10637
+ if (new Set(places.map((place) => place.group)).size > 1) found.push({
10638
+ name: holders.name,
10639
+ places
10640
+ });
10641
+ }
10642
+ return found;
10643
+ }
10644
+ // src/commands/doctor-variable-owners/find-prefixed-pairs.ts
10645
+ /** The prefixes a name is renamed to: the organization's, then an application's own. */
10646
+ const PAIR_PREFIXES = [
10647
+ PREFIX,
10648
+ "SENTINEL",
10649
+ "COMLINK"
10650
+ ];
10651
+ /**
10652
+ * The bare names (`X`) that exist beside a prefixed one (`HOLOCRON_X`, `SENTINEL_X`, `COMLINK_X`) in any place. The
10653
+ * fallback is deliberate during a rename; a pair that outlives it is a leftover. Sorted by the bare name.
10654
+ */
10655
+ function findPrefixedPairs(sources) {
10656
+ const index = nameIndex(sources);
10657
+ const pairs = [];
10658
+ for (const [key, bare] of [...index].sort(([a], [b]) => a < b ? -1 : 1)) for (const prefix of PAIR_PREFIXES) {
10659
+ const prefixed = index.get(`${prefix}_${key}`);
10660
+ if (prefixed) pairs.push({
10661
+ bare,
10662
+ prefixed
10663
+ });
10664
+ }
10665
+ return pairs;
10666
+ }
10667
+ // src/commands/doctor-variable-owners/github-environments.ts
10668
+ /** The GitHub Environments whose secrets are listed: the ones `repo.secrets.environments` and a sync entry name. */
10669
+ function githubEnvironments(config, feeds) {
10670
+ const prefix = "secrets:env=";
10671
+ const fromSync = feeds.filter((f) => f.target.startsWith(prefix)).map((f) => f.target.slice(12));
10672
+ return [.../* @__PURE__ */ new Set([...Object.keys(config.repo?.secrets?.environments ?? {}), ...fromSync])];
10673
+ }
10674
+ // src/commands/doctor-variable-owners/owner-environments.ts
10675
+ /**
10676
+ * The Environments the config names: each `credentials` provider's, `githubApps[].environment`, `dev.environment`
10677
+ * and the one of every `repo.secrets.sync` and `repo.variables.sync` entry.
10678
+ */
10679
+ function ownerEnvironments(config) {
10680
+ const names = /* @__PURE__ */ new Set();
10681
+ const entry = config.providers.credentials;
10682
+ for (const tuple of entry?.tuples ?? []) names.add(credentialsEnvironment(tuple, config));
10683
+ const instances = new Set((config.githubApps ?? []).map((app) => app.environment));
10684
+ for (const environment of instances) names.add(environment);
10685
+ if (config.dev?.environment) names.add(config.dev.environment);
10686
+ for (const sync of [...config.repo?.secrets?.sync ?? [], ...config.repo?.variables?.sync ?? []]) names.add(sync.environment);
10687
+ return {
10688
+ names: [...names],
10689
+ instances
10690
+ };
10691
+ }
10692
+ // src/commands/doctor-variable-owners/read-environments.ts
10693
+ /**
10694
+ * Reads the variable names of each Environment through `Credentials.inspect`, which lists names without reading a
10695
+ * value. The first provider that can find the Environment answers. An Environment no provider can read is a skipped
10696
+ * row naming why, never a failure.
10697
+ *
10698
+ * @param names - The Environments to read.
10699
+ * @param instances - The Environments that are instances of one GitHub App: they share a group.
10700
+ * @param providers - The loaded `credentials` providers.
10701
+ * @param none - Why there is no provider, used when `providers` is empty.
10702
+ */
10703
+ async function readEnvironments(names, instances, providers, none) {
10704
+ const sources = [];
10705
+ const rows = [];
10706
+ const skip = (name, detail) => rows.push({
10707
+ id: `skip:env:${name}`,
10708
+ title: `Environment "${name}"`,
10709
+ status: "skip",
10710
+ detail,
10711
+ problems: []
10712
+ });
10713
+ for (const name of names) {
10714
+ if (providers.length === 0) {
10715
+ skip(name, none);
10716
+ continue;
10717
+ }
10718
+ const readers = providers.filter((p) => p.inspect !== void 0);
10719
+ if (readers.length === 0) {
10720
+ skip(name, "no `credentials` provider can list names without reading values");
10721
+ continue;
10722
+ }
10723
+ let why = "";
10724
+ let found = false;
10725
+ for (const provider of readers) try {
10726
+ const inspection = await provider.inspect(name);
10727
+ sources.push({
10728
+ label: `Environment "${name}"`,
10729
+ group: instances.has(name) ? "app instances" : `env:${name}`,
10730
+ names: inspection.names,
10731
+ environment: name
10732
+ });
10733
+ found = true;
10734
+ break;
10735
+ } catch (err) {
10736
+ why = `could not read it with ${provider.providerName}: ${describeError(err)}`;
10737
+ }
10738
+ if (!found) skip(name, why);
10739
+ }
10740
+ return {
10741
+ sources,
10742
+ rows
10743
+ };
10744
+ }
10745
+ // src/commands/doctor-variable-owners/feed-key.ts
10746
+ /** The key that says which GitHub place a sync entry fills: `secrets:repo`, `variables:org=acme`, `secrets:env=prod`. */
10747
+ function feedKey(kind, scope) {
10748
+ if (scope.kind === "repo") return `${kind}:repo`;
10749
+ return `${kind}:${scope.kind === "organization" ? "org" : "env"}=${scope.name}`;
10750
+ }
10751
+ // src/commands/doctor-variable-owners/read-github.ts
10752
+ /**
10753
+ * Reads the names of the Actions secrets (repository, organization and each Environment) and variables (repository and
10754
+ * organization) through the `secrets` and `source` providers. GitHub never returns a secret's value, and the variables'
10755
+ * values the provider returns are dropped at once. A place that cannot be read (no provider, the provider cannot
10756
+ * list it, no token, an error) is a skipped row with the reason, never a failure.
10757
+ */
10758
+ async function readGitHub(input) {
10759
+ const sources = [];
10760
+ const rows = [];
10761
+ const skip = (id, label, detail) => rows.push({
10762
+ id: `skip:${id}`,
10763
+ title: label,
10764
+ status: "skip",
10765
+ detail,
10766
+ problems: []
10767
+ });
10768
+ const read = async (id, label, feed, list) => {
10769
+ try {
10770
+ const names = await list();
10771
+ if ("skip" in names) skip(id, label, names.skip);
10772
+ else sources.push({
10773
+ label,
10774
+ group: `github:${feed}`,
10775
+ names,
10776
+ feed
10777
+ });
10778
+ } catch (err) {
10779
+ skip(id, label, missingTokenReason(err) ?? `could not read it: ${describeError(err)}`);
10780
+ }
10781
+ };
10782
+ const secrets = (scope) => async () => "why" in input.secrets ? { skip: input.secrets.why } : input.secrets.listSecrets(scope);
10783
+ const noOrg = "no organization: set `org` in the config or run inside a repository";
10784
+ const org = input.org;
10785
+ await read("repo-secrets", "repository secrets", feedKey("secrets", { kind: "repo" }), secrets({ kind: "repo" }));
10786
+ if (org === void 0) {
10787
+ skip("org-secrets", "organization secrets", noOrg);
10788
+ skip("org-variables", "organization variables", noOrg);
10789
+ } else {
10790
+ const scope = {
10791
+ kind: "organization",
10792
+ name: org
10793
+ };
10794
+ await read("org-secrets", "organization secrets", feedKey("secrets", scope), secrets(scope));
10795
+ }
10796
+ for (const name of input.environments) {
10797
+ const scope = {
10798
+ kind: "environment",
10799
+ name
10800
+ };
10801
+ await read(`env-secrets-${name}`, `${name} environment secrets`, feedKey("secrets", scope), secrets(scope));
10802
+ }
10803
+ const source = input.source;
10804
+ await read("repo-variables", "repository variables", feedKey("variables", { kind: "repo" }), async () => {
10805
+ if ("why" in source) return { skip: source.why };
10806
+ if (!source.listVariables) return { skip: "the `source` provider cannot list variables" };
10807
+ return Object.keys(await source.listVariables());
10808
+ });
10809
+ if (org !== void 0) await read("org-variables", "organization variables", feedKey("variables", {
10810
+ kind: "organization",
10811
+ name: org
10812
+ }), async () => {
10813
+ if ("why" in source) return { skip: source.why };
10814
+ if (!source.listOrgVariables) return { skip: "the `source` provider cannot list organization variables" };
10815
+ return Object.keys(await source.listOrgVariables(org));
10816
+ });
10817
+ return {
10818
+ sources,
10819
+ rows
10820
+ };
10821
+ }
10822
+ // src/commands/doctor-variable-owners/sync-feeds.ts
10823
+ /**
10824
+ * The Environments that fill GitHub places, from `repo.secrets.sync` and `repo.variables.sync`: the one allowed copy of
10825
+ * a name. An entry whose scope does not parse is left out (`doctor secrets` reports it).
10826
+ */
10827
+ function syncFeeds(config) {
10828
+ const feeds = [];
10829
+ const add = (kind, entries) => {
10830
+ for (const entry of entries) try {
10831
+ const target = feedKey(kind, parseScope(entry.scope ?? "repo"));
10832
+ feeds.push({
10833
+ environment: entry.environment,
10834
+ target,
10835
+ ...entry.keys ? { keys: entry.keys } : {}
10836
+ });
10837
+ } catch {}
10838
+ };
10839
+ add("secrets", config.repo?.secrets?.sync ?? []);
10840
+ add("variables", config.repo?.variables?.sync ?? []);
10841
+ return feeds;
10842
+ }
10843
+ // src/commands/doctor-variable-owners/doctor-variable-owners.ts
10844
+ /**
10845
+ * `holocron doctor variable-owners` — does a variable live in more than one place?
10846
+ *
10847
+ * Read-only, and names only: no value is read, printed, logged or kept. It gathers the variable names of every
10848
+ * 1Password Environment the config names (through `Credentials.inspect`) and of the GitHub Actions secrets and variables
10849
+ * (through the `secrets` and `source` providers), then reports a name that two places hold, one row per name (`fail`).
10850
+ * Not reported: the copy a `repo.secrets.sync` or `repo.variables.sync` entry makes (the one allowed path), a name
10851
+ * listed in `doctor.sharedVariables` (deliberate sharing), and the same name in the instances of one GitHub App
10852
+ * (`githubApps`). A bare name next to its prefixed spelling (`X` and `HOLOCRON_X`) is an `info` row, shown as skipped,
10853
+ * because the fallback is deliberate during a rename. A place that cannot be read is a skip with the reason.
10854
+ */
10855
+ async function runDoctorVariableOwners(input) {
10856
+ const print = input.print ?? ((line) => console.log(line));
10857
+ const logger = input.logger ?? getLogger();
10858
+ const loader = input.loader ?? new PluginLoader(input.loaded.resolved, input.context, void 0, { readCredentials: false });
10859
+ await loader.load();
10860
+ assertPluginsResolvable$1(loader, "doctor variable-owners");
10861
+ const config = input.loaded.resolved;
10862
+ const feeds = syncFeeds(config);
10863
+ const { names, instances } = ownerEnvironments(config);
10864
+ const org = input.context.org ?? (input.context.repo ?? config.repo?.name ?? "").split("/")[0];
10865
+ const failedToLoad = loader.loadFailures().filter((f) => f.key === "credentials").map((f) => f.provider);
10866
+ const environments = await readEnvironments(names, instances, loader.has("credentials") ? loader.get("credentials") : [], failedToLoad.length > 0 ? `a \`credentials\` provider failed to load (${failedToLoad.join(", ")})` : "no `credentials` provider is configured");
10867
+ const github = await readGitHub({
10868
+ secrets: loader.has("secrets") ? loader.get("secrets") : { why: whyMissing(loader, "secrets", "no `secrets` provider to read the secret names with") },
10869
+ source: loader.has("source") ? loader.get("source") : { why: whyMissing(loader, "source", "no `source` provider to read the variable names with") },
10870
+ org: org || void 0,
10871
+ environments: githubEnvironments(config, feeds)
10872
+ });
10873
+ const sources = [...environments.sources, ...github.sources];
10874
+ const rows = [...environments.rows, ...github.rows];
10875
+ const duplicates = findDuplicates(sources, feeds, config.doctor.sharedVariables ?? []);
10876
+ for (const { name, places } of duplicates) rows.push({
10877
+ id: `owners:${name}`,
10878
+ title: name,
10879
+ status: "fail",
10880
+ detail: `lives in ${places.length} places`,
10881
+ problems: places.map((place) => `held by ${place.label}`)
10882
+ });
10883
+ for (const { bare, prefixed } of findPrefixedPairs(sources)) rows.push({
10884
+ id: `pair:${bare.name}`,
10885
+ title: `${bare.name} and ${prefixed.name}`,
10886
+ status: "skip",
10887
+ detail: `info: both exist (${bare.name} in ${bare.places.map((p) => p.label).join(", ")}; ${prefixed.name} in ${prefixed.places.map((p) => p.label).join(", ")}). Fine during a rename; a leftover after it`,
10888
+ problems: []
10889
+ });
10890
+ if (duplicates.length === 0 && sources.length > 0) {
10891
+ const distinct = new Set(sources.flatMap((s) => s.names.map((n) => n.toUpperCase())));
10892
+ rows.push({
10893
+ id: "owners",
10894
+ title: "no variable lives in more than one place",
10895
+ status: "ok",
10896
+ detail: `${distinct.size} name(s) across ${sources.length} place(s) read`,
10897
+ problems: []
10898
+ });
10899
+ }
10900
+ printCheckRows(rows, print);
10901
+ const summary = summariseChecks(rows);
10902
+ printCheckSummary(summary, print);
10903
+ const status = summary.fail > 0 ? "fail" : summary.ok === 0 ? "skip" : "ok";
10904
+ logger.info({
10905
+ ...summary,
10906
+ status
10907
+ }, "doctor variable-owners");
10908
+ return {
10909
+ status,
10910
+ rows,
10911
+ summary,
10912
+ ...status === "skip" ? { reason: [...new Set(rows.map((r) => r.detail))].join("; ") } : {}
10913
+ };
10914
+ }
10915
+ // src/commands/doctor-variable-owners/doctor-variable-owners.command.ts
10916
+ const doctorVariableOwnersCommand = {
10917
+ command: "variable-owners",
10918
+ describe: "Flag a variable name that lives in more than one place: 1Password Environments and GitHub Actions (read-only, names only)",
10919
+ handler: async (argv) => {
10920
+ const tokens = tokenContext$1(argv.token);
10921
+ if (!tokens) return;
10922
+ const loaded = await loadConfig(argv.cwd);
10923
+ applyResolvedConfig(argv, loaded.resolved);
10924
+ if ((await runDoctorVariableOwners({
10925
+ loaded,
10926
+ context: {
10927
+ repoRoot: argv.cwd,
10928
+ ...tokens,
10929
+ org: resolveOrg(argv, loaded.resolved)
10930
+ }
10931
+ })).status === "fail") process.exitCode = 1;
10932
+ }
10933
+ };
10596
10934
  // src/commands/doctor-variables/sync-checks.ts
10597
10935
  /** Re-keys what GitHub holds by the spelling the config declares, since GitHub treats names as case-insensitive. */
10598
10936
  function bySpelling$1(declared, have) {
@@ -10944,6 +11282,19 @@ const DEEP_CHECKS = [
10944
11282
  };
10945
11283
  }
10946
11284
  },
11285
+ {
11286
+ name: "variable-owners",
11287
+ capability: "credentials",
11288
+ command: doctorVariableOwnersCommand,
11289
+ async run(input) {
11290
+ const report = await runDoctorVariableOwners(input);
11291
+ return {
11292
+ status: report.status,
11293
+ summary: report.summary,
11294
+ ...report.reason ? { reason: report.reason } : {}
11295
+ };
11296
+ }
11297
+ },
10947
11298
  {
10948
11299
  name: "ci",
10949
11300
  capability: "source",
@@ -21317,7 +21668,7 @@ async function runSetup(input) {
21317
21668
  const rootPackageJson = await readFile(join(input.context.repoRoot, "package.json"), "utf8").then((raw) => JSON.parse(raw)).catch(() => null);
21318
21669
  let workspacePackageJsons = [];
21319
21670
  try {
21320
- workspacePackageJsons = await readWorkspacePackageJsons(input.context.repoRoot, readWorkspacePackages(input.context.repoRoot));
21671
+ workspacePackageJsons = await readWorkspacePackageJsons(input.context.repoRoot, (input.workspacePackages ?? readWorkspacePackages)(input.context.repoRoot));
21321
21672
  } catch (err) {
21322
21673
  steps.push({
21323
21674
  capability: "errors",