@dosu/cli 0.53.0-beta.11 → 0.53.0-beta.12

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.
Files changed (2) hide show
  1. package/bin/dosu.js +33 -15
  2. package/package.json +1 -1
package/bin/dosu.js CHANGED
@@ -5018,7 +5018,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
5018
5018
  function getVersionString() {
5019
5019
  return `v${VERSION}`;
5020
5020
  }
5021
- var VERSION = "0.53.0-beta.11", INSTALL_CHANNEL = "npm";
5021
+ var VERSION = "0.53.0-beta.12", INSTALL_CHANNEL = "npm";
5022
5022
 
5023
5023
  // src/debug/logger.ts
5024
5024
  import {
@@ -5712,12 +5712,34 @@ function answeredEcho(message, answer) {
5712
5712
  function optionLabel(option) {
5713
5713
  return option.label ?? String(option.value);
5714
5714
  }
5715
+ function viewport(count, cursor3, top, rows, chrome) {
5716
+ const visible = Math.min(count, Math.max(4, (rows ?? 24) - chrome));
5717
+ let next = top;
5718
+ if (cursor3 < next)
5719
+ next = cursor3;
5720
+ if (cursor3 >= next + visible)
5721
+ next = cursor3 - visible + 1;
5722
+ next = Math.max(0, Math.min(next, count - visible));
5723
+ return { top: next, visible, above: next, below: count - next - visible };
5724
+ }
5725
+ function moreAbove(n2) {
5726
+ return n2 > 0 ? [import_picocolors11.default.dim(` ↑ ${n2} more`)] : [];
5727
+ }
5728
+ function moreBelow(n2) {
5729
+ return n2 > 0 ? [import_picocolors11.default.dim(` ↓ ${n2} more`)] : [];
5730
+ }
5715
5731
  function select(opts, io = {}) {
5732
+ const { output } = resolveIO(io);
5716
5733
  let selected = 0;
5734
+ let top = 0;
5717
5735
  const labelWidth = Math.max(...opts.options.map((o2) => optionLabel(o2).length));
5718
5736
  return runInteractive({
5719
5737
  render() {
5720
- const rows = opts.options.map((option, index) => {
5738
+ const count = opts.options.length;
5739
+ const view = viewport(count, selected, top, output.rows, 8);
5740
+ top = view.top;
5741
+ const rows = opts.options.slice(top, top + view.visible).map((option, offset) => {
5742
+ const index = top + offset;
5721
5743
  const label = optionLabel(option).padEnd(labelWidth);
5722
5744
  const hint = option.hint ? ` ${import_picocolors11.default.dim(option.hint)}` : "";
5723
5745
  return index === selected ? `${brand(POINTER2)} ${import_picocolors11.default.bold(brand(label))}${hint}` : ` ${import_picocolors11.default.dim(label)}${hint}`;
@@ -5725,7 +5747,9 @@ function select(opts, io = {}) {
5725
5747
  return [
5726
5748
  import_picocolors11.default.bold(opts.message),
5727
5749
  "",
5750
+ ...moreAbove(view.above),
5728
5751
  ...rows,
5752
+ ...moreBelow(view.below),
5729
5753
  "",
5730
5754
  import_picocolors11.default.dim(`↑↓ move ${DOT} enter select ${DOT} esc cancel`)
5731
5755
  ];
@@ -5763,13 +5787,9 @@ function multiselect2(opts, io = {}) {
5763
5787
  return runInteractive({
5764
5788
  render() {
5765
5789
  const count = opts.options.length;
5766
- const visible = Math.min(count, Math.max(4, (output.rows ?? 24) - 9));
5767
- if (cursor3 < top)
5768
- top = cursor3;
5769
- if (cursor3 >= top + visible)
5770
- top = cursor3 - visible + 1;
5771
- top = Math.max(0, Math.min(top, count - visible));
5772
- const rows = opts.options.slice(top, top + visible).map((option, offset) => {
5790
+ const view = viewport(count, cursor3, top, output.rows, 9);
5791
+ top = view.top;
5792
+ const rows = opts.options.slice(top, top + view.visible).map((option, offset) => {
5773
5793
  const index = top + offset;
5774
5794
  const isPicked = picked.has(option.value);
5775
5795
  const box = isPicked ? brand(BOX_ON) : import_picocolors11.default.dim(BOX_OFF);
@@ -5778,15 +5798,13 @@ function multiselect2(opts, io = {}) {
5778
5798
  const suffix = status ? ` ${status}` : "";
5779
5799
  return index === cursor3 ? `${brand(POINTER2)} ${box} ${import_picocolors11.default.bold(brand(label))}${suffix}` : ` ${box} ${import_picocolors11.default.dim(label)}${suffix}`;
5780
5800
  });
5781
- const above = top;
5782
- const below = count - top - visible;
5783
5801
  const summary = opts.summary?.(pickedValues());
5784
5802
  return [
5785
5803
  import_picocolors11.default.bold(opts.message),
5786
5804
  "",
5787
- ...above > 0 ? [import_picocolors11.default.dim(` ↑ ${above} more`)] : [],
5805
+ ...moreAbove(view.above),
5788
5806
  ...rows,
5789
- ...below > 0 ? [import_picocolors11.default.dim(` ↓ ${below} more`)] : [],
5807
+ ...moreBelow(view.below),
5790
5808
  "",
5791
5809
  ...error ? [import_picocolors11.default.yellow(error)] : summary ? [import_picocolors11.default.dim(summary)] : [],
5792
5810
  import_picocolors11.default.dim(`↑↓ move ${DOT} space toggle ${DOT} a all ${DOT} enter confirm ${DOT} esc cancel`)
@@ -73519,7 +73537,7 @@ var init_settings = __esm(() => {
73519
73537
  });
73520
73538
 
73521
73539
  // src/telemetry/debug-id.ts
73522
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "fa7cf492-7aa5-180c-6475-6e2164756e21";
73540
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "acac034b-488b-746c-6475-6e2164756e21";
73523
73541
 
73524
73542
  // src/telemetry/telemetry.ts
73525
73543
  import { randomUUID as randomUUID4 } from "node:crypto";
@@ -84636,4 +84654,4 @@ execute().catch((err) => {
84636
84654
  process.exit(1);
84637
84655
  });
84638
84656
 
84639
- //# debugId=fa7cf492-7aa5-180c-6475-6e2164756e21
84657
+ //# debugId=acac034b-488b-746c-6475-6e2164756e21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/cli",
3
- "version": "0.53.0-beta.11",
3
+ "version": "0.53.0-beta.12",
4
4
  "type": "module",
5
5
  "description": "Dosu CLI - Manage MCP servers for AI tools",
6
6
  "license": "MIT",