@theholocron/cli 5.0.0-alpha.229 → 5.0.0-alpha.230

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/cli.mjs CHANGED
@@ -7126,7 +7126,8 @@ async function runProbeCommand(input) {
7126
7126
  const groups = new Map(loader.probes());
7127
7127
  groups.set(CORE_PROVIDER, coreProbes(loader));
7128
7128
  if (!input.provider) {
7129
- for (const line of listProbes(groups)) print(line);
7129
+ if (input.pick) await input.pick(groups);
7130
+ else for (const line of listProbes(groups)) print(line);
7130
7131
  return { status: "listed" };
7131
7132
  }
7132
7133
  const probes = groups.get(input.provider);
@@ -12748,6 +12749,28 @@ async function launchMenu(entries, parentArgv, pickMessage, nonInteractiveMessag
12748
12749
  process.exitCode = await spawnChild(buildChildArgv(picked, positionals, forReal, parentArgv), secretEnv(forReal));
12749
12750
  }
12750
12751
  //#endregion
12752
+ //#region src/interactive-menu/probe-menu-entries/probe-menu-entries.ts
12753
+ /**
12754
+ * One menu entry per probe, grouped under its provider (`probe sentry integrations`), for the menu `holocron probe`
12755
+ * opens on a terminal. Built from the loaded plugins, so the menu always shows exactly the probes that exist. A probe
12756
+ * that changes things offers a dry-run preview first; one that only reads has nothing to preview.
12757
+ */
12758
+ function buildProbeMenuEntries(groups) {
12759
+ const entries = [];
12760
+ for (const [provider, probes] of [...groups].sort(([a], [b]) => a.localeCompare(b))) for (const [name, probe] of Object.entries(probes).sort(([a], [b]) => a.localeCompare(b))) entries.push({
12761
+ name: `probe ${provider} ${name}`,
12762
+ description: probe.writes ? `${probe.summary} (changes things)` : probe.summary,
12763
+ positionals: [],
12764
+ supportsDryRun: probe.writes,
12765
+ spawnArgs: [
12766
+ "probe",
12767
+ provider,
12768
+ name
12769
+ ]
12770
+ });
12771
+ return entries;
12772
+ }
12773
+ //#endregion
12751
12774
  //#region src/interactive-menu/run-menu-entries/run-menu-entries.ts
12752
12775
  /**
12753
12776
  * This repo's own resolved task manifest, filtered to what's actually
@@ -13773,7 +13796,8 @@ try {
13773
13796
  ...argv.provider ? { provider: argv.provider } : {},
13774
13797
  ...argv.probe ? { probe: argv.probe } : {},
13775
13798
  dryRun: argv.dryRun,
13776
- yes: argv.yes
13799
+ yes: argv.yes,
13800
+ ...process.stdin.isTTY ? { pick: (groups) => launchMenu(buildProbeMenuEntries(groups), argv, "probe — choose a provider:", "Run `holocron probe` to list the probes.", ["probe"]) } : {}
13777
13801
  })).status === "fail") process.exitCode = 1;
13778
13802
  }).command("secrets", "Set secrets and sync vault environments", (g) => g.command("set [name] [value]", "Set a single secret via the configured `secrets` capability", (y) => y.positional("name", {
13779
13803
  type: "string",