claudemesh-cli 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -3560,7 +3560,12 @@ function enterFullScreen() {
3560
3560
  function exitFullScreen() {
3561
3561
  process.stdout.write(SHOW_CURSOR + CLEAR_SCREEN);
3562
3562
  }
3563
- async function menuSelect(items, prompt = "Choice") {
3563
+ async function menuSelect(itemsOrOpts, prompt = "Choice") {
3564
+ const items = Array.isArray(itemsOrOpts) ? itemsOrOpts : itemsOrOpts.items;
3565
+ const title = !Array.isArray(itemsOrOpts) ? itemsOrOpts.title : undefined;
3566
+ if (title)
3567
+ console.log(`
3568
+ ${title}`);
3564
3569
  items.forEach((item, i) => console.log(` ${bold(String(i + 1) + ")")} ${item}`));
3565
3570
  console.log("");
3566
3571
  const rl = createInterface2({ input: process.stdin, output: process.stdout });
@@ -3572,25 +3577,29 @@ async function menuSelect(items, prompt = "Choice") {
3572
3577
  });
3573
3578
  });
3574
3579
  }
3575
- async function textInput(prompt, defaultVal = "") {
3580
+ async function textInput(promptOrOpts, defaultVal = "") {
3581
+ const label = typeof promptOrOpts === "string" ? promptOrOpts : promptOrOpts.label;
3582
+ const placeholder = typeof promptOrOpts === "object" ? promptOrOpts.placeholder : undefined;
3576
3583
  const rl = createInterface2({ input: process.stdin, output: process.stdout });
3577
3584
  return new Promise((resolve) => {
3578
- const hint = defaultVal ? ` [${defaultVal}]` : "";
3579
- rl.question(` ${prompt}${hint}: `, (answer) => {
3585
+ const hint = placeholder ? ` (${placeholder})` : defaultVal ? ` [${defaultVal}]` : "";
3586
+ rl.question(` ${label}${hint}: `, (answer) => {
3580
3587
  rl.close();
3581
3588
  resolve(answer.trim() || defaultVal);
3582
3589
  });
3583
3590
  });
3584
3591
  }
3585
- async function confirmPrompt(prompt, defaultYes = true) {
3592
+ async function confirmPrompt(promptOrOpts, defaultYes = true) {
3593
+ const message = typeof promptOrOpts === "string" ? promptOrOpts : promptOrOpts.message;
3594
+ const defYes = typeof promptOrOpts === "object" && promptOrOpts.defaultYes !== undefined ? promptOrOpts.defaultYes : defaultYes;
3586
3595
  const rl = createInterface2({ input: process.stdin, output: process.stdout });
3587
- const hint = defaultYes ? "[Y/n]" : "[y/N]";
3596
+ const hint = defYes ? "[Y/n]" : "[y/N]";
3588
3597
  return new Promise((resolve) => {
3589
- rl.question(` ${prompt} ${hint}: `, (answer) => {
3598
+ rl.question(` ${message} ${hint}: `, (answer) => {
3590
3599
  rl.close();
3591
3600
  const a = answer.trim().toLowerCase();
3592
3601
  if (!a)
3593
- resolve(defaultYes);
3602
+ resolve(defYes);
3594
3603
  else
3595
3604
  resolve(a === "y" || a === "yes");
3596
3605
  });
@@ -10620,4 +10629,4 @@ main().catch((err) => {
10620
10629
  process.exit(EXIT.INTERNAL_ERROR);
10621
10630
  });
10622
10631
 
10623
- //# debugId=1E53C7F6AC10DB9F64756E2164756E21
10632
+ //# debugId=D5472AF3BE5E3D2564756E2164756E21