@rotorsoft/gent 1.15.2 → 1.15.3

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/index.js CHANGED
@@ -2221,7 +2221,7 @@ import { homedir } from "os";
2221
2221
  // package.json
2222
2222
  var package_default = {
2223
2223
  name: "@rotorsoft/gent",
2224
- version: "1.15.2",
2224
+ version: "1.15.3",
2225
2225
  description: "AI-powered GitHub workflow CLI - leverage AI (Claude, Gemini, or Codex) to create tickets, implement features, and manage PRs",
2226
2226
  keywords: [
2227
2227
  "cli",
@@ -2797,6 +2797,23 @@ function getAvailableActions(state) {
2797
2797
  import chalk3 from "chalk";
2798
2798
  var stripAnsi = (str) => str.replace(/\x1b\[[0-9;]*m/g, "");
2799
2799
  var visibleLen = (str) => stripAnsi(str).length;
2800
+ function truncateAnsi(text, max) {
2801
+ if (visibleLen(text) <= max) return text;
2802
+ let visible = 0;
2803
+ let i = 0;
2804
+ while (i < text.length && visible < max - 1) {
2805
+ if (text[i] === "\x1B") {
2806
+ const end = text.indexOf("m", i);
2807
+ if (end !== -1) {
2808
+ i = end + 1;
2809
+ continue;
2810
+ }
2811
+ }
2812
+ visible++;
2813
+ i++;
2814
+ }
2815
+ return text.slice(0, i) + "\x1B[0m\u2026";
2816
+ }
2800
2817
  function termWidth() {
2801
2818
  return Math.min(process.stdout.columns || 80, 90);
2802
2819
  }
@@ -2836,8 +2853,9 @@ function botRow(w) {
2836
2853
  }
2837
2854
  function row(text, w) {
2838
2855
  const inner = w - 4;
2839
- const pad = Math.max(0, inner - visibleLen(text));
2840
- return chalk3.dim("\u2502") + " " + text + " ".repeat(pad) + " " + chalk3.dim("\u2502");
2856
+ const fitted = truncateAnsi(text, inner);
2857
+ const pad = Math.max(0, inner - visibleLen(fitted));
2858
+ return chalk3.dim("\u2502") + " " + fitted + " ".repeat(pad) + " " + chalk3.dim("\u2502");
2841
2859
  }
2842
2860
  function workflowBadge(status) {
2843
2861
  switch (status) {
@@ -2953,12 +2971,12 @@ function buildDashboardLines(state, actions, hint, refreshing) {
2953
2971
  if (state.issue) {
2954
2972
  out(
2955
2973
  row(
2956
- chalk3.cyan(`#${state.issue.number}`) + " " + chalk3.bold(truncate(state.issue.title, descMax - 6)),
2974
+ chalk3.dim("\xB7 ") + chalk3.cyan(`#${state.issue.number}`) + " " + chalk3.bold(state.issue.title),
2957
2975
  w
2958
2976
  )
2959
2977
  );
2960
2978
  const desc = extractDescription(state.issue.body, descMax);
2961
- if (desc) out(row(chalk3.dim(desc), w));
2979
+ if (desc) out(row(" " + chalk3.dim(desc), w));
2962
2980
  const tags = [];
2963
2981
  if (state.workflowStatus !== "none")
2964
2982
  tags.push(workflowBadge(state.workflowStatus));
@@ -2966,13 +2984,13 @@ function buildDashboardLines(state, actions, hint, refreshing) {
2966
2984
  const l = state.issue.labels.find((x) => x.startsWith(prefix));
2967
2985
  if (l) tags.push(chalk3.dim(l));
2968
2986
  }
2969
- if (tags.length) out(row(tags.join(" "), w));
2987
+ if (tags.length) out(row(" " + tags.join(" "), w));
2970
2988
  } else {
2971
- out(row(chalk3.dim("No linked issue"), w));
2989
+ out(row(chalk3.dim(" No linked issue"), w));
2972
2990
  }
2973
2991
  }
2974
2992
  section("Branch");
2975
- let branchLine = chalk3.magenta(state.branch);
2993
+ let branchLine = chalk3.dim("\xB7 ") + chalk3.magenta(state.branch);
2976
2994
  if (state.isOnMain && !state.hasUncommittedChanges) {
2977
2995
  branchLine += chalk3.dim(" \xB7 ready to start new work");
2978
2996
  }
@@ -2985,15 +3003,20 @@ function buildDashboardLines(state, actions, hint, refreshing) {
2985
3003
  if (!state.hasUncommittedChanges && !state.hasUnpushedCommits && state.commits.length > 0) {
2986
3004
  bits.push(chalk3.green("\u25CF synced"));
2987
3005
  }
2988
- if (bits.length) out(row(bits.join(chalk3.dim(" \xB7 ")), w));
3006
+ if (bits.length) out(row(" " + bits.join(chalk3.dim(" \xB7 ")), w));
2989
3007
  if (state.pr || !state.isOnMain) {
2990
3008
  section("Pull Request");
2991
3009
  if (state.pr) {
2992
- const titleText = state.pr.title ? " " + truncate(state.pr.title, descMax - 12) : "";
2993
- out(row(chalk3.cyan(`#${state.pr.number}`) + titleText, w));
3010
+ const titleText = state.pr.title ? " " + state.pr.title : "";
2994
3011
  out(
2995
3012
  row(
2996
- prBadge(state.pr.state, state.pr.isDraft) + reviewBadge(state.pr.reviewDecision),
3013
+ chalk3.dim("\xB7 ") + chalk3.cyan(`#${state.pr.number}`) + titleText,
3014
+ w
3015
+ )
3016
+ );
3017
+ out(
3018
+ row(
3019
+ " " + prBadge(state.pr.state, state.pr.isDraft) + reviewBadge(state.pr.reviewDecision),
2997
3020
  w
2998
3021
  )
2999
3022
  );
@@ -3001,7 +3024,7 @@ function buildDashboardLines(state, actions, hint, refreshing) {
3001
3024
  const n = state.reviewFeedback.length;
3002
3025
  out(
3003
3026
  row(
3004
- chalk3.yellow(`${n} actionable comment${n !== 1 ? "s" : ""} pending`),
3027
+ " " + chalk3.yellow(`${n} actionable comment${n !== 1 ? "s" : ""} pending`),
3005
3028
  w
3006
3029
  )
3007
3030
  );
@@ -3009,14 +3032,14 @@ function buildDashboardLines(state, actions, hint, refreshing) {
3009
3032
  if (state.hasUIChanges && state.isPlaywrightAvailable && state.config.video.enabled && state.pr.state === "open") {
3010
3033
  out(
3011
3034
  row(
3012
- chalk3.cyan("UI changes detected") + chalk3.dim(" \xB7 video capture available"),
3035
+ " " + chalk3.cyan("UI changes detected") + chalk3.dim(" \xB7 video capture available"),
3013
3036
  w
3014
3037
  )
3015
3038
  );
3016
3039
  }
3017
- out(row(chalk3.dim(state.pr.url), w));
3040
+ out(row(" " + chalk3.dim(state.pr.url), w));
3018
3041
  } else {
3019
- out(row(chalk3.dim("No PR created"), w));
3042
+ out(row(chalk3.dim(" No PR created"), w));
3020
3043
  }
3021
3044
  }
3022
3045
  if (state.commits.length > 0 || !state.isOnMain) {
@@ -3024,13 +3047,13 @@ function buildDashboardLines(state, actions, hint, refreshing) {
3024
3047
  if (state.commits.length > 0) {
3025
3048
  const max = 6;
3026
3049
  for (const c of state.commits.slice(0, max)) {
3027
- out(row(c.substring(0, w - 5), w));
3050
+ out(row(chalk3.dim("\xB7 ") + c, w));
3028
3051
  }
3029
3052
  if (state.commits.length > max) {
3030
- out(row(chalk3.dim(`\u2026 and ${state.commits.length - max} more`), w));
3053
+ out(row(chalk3.dim(` \u2026 and ${state.commits.length - max} more`), w));
3031
3054
  }
3032
3055
  } else {
3033
- out(row(chalk3.dim("No commits"), w));
3056
+ out(row(chalk3.dim(" No commits"), w));
3034
3057
  }
3035
3058
  }
3036
3059
  if (hint) {
@@ -3071,23 +3094,6 @@ function modalDivRow(w) {
3071
3094
  function modalBotRow(w) {
3072
3095
  return chalk4.bold("\u2514" + "\u2500".repeat(w - 2) + "\u2518");
3073
3096
  }
3074
- function truncateAnsi(text, max) {
3075
- if (visibleLen(text) <= max) return text;
3076
- let visible = 0;
3077
- let i = 0;
3078
- while (i < text.length && visible < max - 1) {
3079
- if (text[i] === "\x1B") {
3080
- const end = text.indexOf("m", i);
3081
- if (end !== -1) {
3082
- i = end + 1;
3083
- continue;
3084
- }
3085
- }
3086
- visible++;
3087
- i++;
3088
- }
3089
- return text.slice(0, i) + "\x1B[0m\u2026";
3090
- }
3091
3097
  function modalRow(text, w) {
3092
3098
  const inner = w - 4;
3093
3099
  const fitted = truncateAnsi(text, inner);
@@ -3122,9 +3128,10 @@ function buildSelectContent(items, selectedIndex, maxWidth) {
3122
3128
  } else {
3123
3129
  const isSelected = selectableIdx === selectedIndex;
3124
3130
  const prefix = isSelected ? chalk4.cyan.bold("> ") : " ";
3125
- const label = item.name.length > maxWidth - 2 ? item.name.slice(0, maxWidth - 3) + "\u2026" : item.name;
3131
+ const bullet = chalk4.dim("\xB7 ");
3132
+ const label = truncateAnsi(item.name, maxWidth - 4);
3126
3133
  lines.push(
3127
- prefix + (isSelected ? chalk4.bold(label) : label)
3134
+ prefix + bullet + (isSelected ? chalk4.bold(label) : label)
3128
3135
  );
3129
3136
  selectableIdx++;
3130
3137
  }