@rotorsoft/gent 1.14.2 → 1.15.0

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
@@ -2150,7 +2150,7 @@ import { homedir } from "os";
2150
2150
  // package.json
2151
2151
  var package_default = {
2152
2152
  name: "@rotorsoft/gent",
2153
- version: "1.14.2",
2153
+ version: "1.15.0",
2154
2154
  description: "AI-powered GitHub workflow CLI - leverage AI (Claude, Gemini, or Codex) to create tickets, implement features, and manage PRs",
2155
2155
  keywords: [
2156
2156
  "cli",
@@ -2703,6 +2703,7 @@ function getAvailableActions(state) {
2703
2703
  if (state.isOnMain) {
2704
2704
  actions.push({ id: "create", label: "new", shortcut: "n" });
2705
2705
  actions.push({ id: "list", label: "list", shortcut: "l" });
2706
+ actions.push({ id: "refresh", label: "refresh", shortcut: "f" });
2706
2707
  actions.push({ id: "switch-provider", label: "ai", shortcut: "a" });
2707
2708
  actions.push({ id: "quit", label: "quit", shortcut: "q" });
2708
2709
  return actions;
@@ -2719,10 +2720,8 @@ function getAvailableActions(state) {
2719
2720
  if (state.issue && state.pr?.state !== "merged") {
2720
2721
  actions.push({ id: "run", label: "run", shortcut: "u" });
2721
2722
  }
2722
- if (state.pr && (state.pr.state === "merged" || state.pr.state === "closed")) {
2723
- actions.push({ id: "checkout-main", label: "main", shortcut: "m" });
2724
- }
2725
2723
  actions.push({ id: "list", label: "list", shortcut: "l" });
2724
+ actions.push({ id: "refresh", label: "refresh", shortcut: "f" });
2726
2725
  actions.push({ id: "switch-provider", label: "ai", shortcut: "a" });
2727
2726
  actions.push({ id: "quit", label: "quit", shortcut: "q" });
2728
2727
  return actions;
@@ -3446,8 +3445,7 @@ async function executeAction(actionId, state, dashboardLines) {
3446
3445
  case "switch-provider":
3447
3446
  await handleSwitchProvider(state, dashboardLines);
3448
3447
  return SKIP_REFRESH;
3449
- case "checkout-main":
3450
- await handleCheckoutMain(dashboardLines);
3448
+ case "refresh":
3451
3449
  return CONTINUE;
3452
3450
  default:
3453
3451
  return SKIP_REFRESH;
@@ -3625,21 +3623,12 @@ async function handleSwitchProvider(state, dashboardLines) {
3625
3623
  setRuntimeProvider(provider);
3626
3624
  state.config.ai.provider = provider;
3627
3625
  }
3628
- async function handleCheckoutMain(dashboardLines) {
3629
- try {
3630
- showStatus("Switching", "Switching to main...", dashboardLines);
3631
- await execa4("git", ["checkout", "main"]);
3632
- await execa4("git", ["pull"]);
3633
- } catch (error) {
3634
- logger.error(`Checkout failed: ${error}`);
3635
- }
3636
- }
3637
3626
  async function handleList(dashboardLines) {
3638
3627
  try {
3639
3628
  showStatus("Loading", "Fetching tickets...", dashboardLines);
3640
3629
  const config = loadConfig();
3641
3630
  const workflowLabels = getWorkflowLabels(config);
3642
- const [inProgress, ready, prs, localBranches] = await Promise.all([
3631
+ const [inProgress, ready, prs, localBranches, dirty] = await Promise.all([
3643
3632
  listIssues({
3644
3633
  labels: [workflowLabels.inProgress],
3645
3634
  state: "open",
@@ -3651,7 +3640,8 @@ async function handleList(dashboardLines) {
3651
3640
  limit: 20
3652
3641
  }),
3653
3642
  listOpenPrs(30),
3654
- listLocalBranches()
3643
+ listLocalBranches(),
3644
+ hasUncommittedChanges()
3655
3645
  ]);
3656
3646
  sortByPriority(inProgress);
3657
3647
  sortByPriority(ready);
@@ -3659,8 +3649,16 @@ async function handleList(dashboardLines) {
3659
3649
  const currentBranch = await getCurrentBranch();
3660
3650
  const defaultBranch = await getDefaultBranch();
3661
3651
  const items = [];
3662
- const mainLabel = defaultBranch + (currentBranch === defaultBranch ? " (current)" : "");
3663
- items.push({ name: mainLabel, value: "__main__" });
3652
+ const isMain = currentBranch === defaultBranch;
3653
+ const mainLabel = defaultBranch + (isMain ? " (current)" : "");
3654
+ if (dirty && !isMain) {
3655
+ items.push({
3656
+ name: `${mainLabel} (disabled - uncommitted changes)`,
3657
+ value: "__main_disabled__"
3658
+ });
3659
+ } else {
3660
+ items.push({ name: mainLabel, value: "__main__" });
3661
+ }
3664
3662
  const inProgressChoices = choices.filter(
3665
3663
  (c) => c.category === "in-progress"
3666
3664
  );
@@ -3693,28 +3691,23 @@ async function handleList(dashboardLines) {
3693
3691
  });
3694
3692
  }
3695
3693
  }
3696
- if (choices.length === 0) {
3697
- showStatus("List", "No tickets found", dashboardLines);
3698
- await new Promise((r) => setTimeout(r, 1500));
3699
- return false;
3700
- }
3701
3694
  const selected = await showSelect({
3702
3695
  title: "Switch Ticket",
3703
3696
  items,
3704
3697
  dashboardLines
3705
3698
  });
3706
3699
  if (!selected) return false;
3700
+ if (selected === "__main_disabled__") {
3701
+ showStatus(
3702
+ "Uncommitted Changes",
3703
+ "Commit or stash changes before switching to main",
3704
+ dashboardLines
3705
+ );
3706
+ await new Promise((r) => setTimeout(r, 2e3));
3707
+ return false;
3708
+ }
3707
3709
  if (selected === "__main__") {
3708
3710
  if (currentBranch === defaultBranch) return false;
3709
- const dirty2 = await hasUncommittedChanges();
3710
- if (dirty2) {
3711
- const ok = await showConfirm({
3712
- title: "Uncommitted Changes",
3713
- message: "You have uncommitted changes. Continue?",
3714
- dashboardLines
3715
- });
3716
- if (!ok) return false;
3717
- }
3718
3711
  showStatus("Switching", `Switching to ${defaultBranch}...`, dashboardLines);
3719
3712
  await checkoutBranch(defaultBranch);
3720
3713
  return true;
@@ -3722,7 +3715,6 @@ async function handleList(dashboardLines) {
3722
3715
  const issueNumber = parseInt(selected, 10);
3723
3716
  const ticket = choices.find((c) => c.issueNumber === issueNumber);
3724
3717
  if (!ticket) return false;
3725
- const dirty = await hasUncommittedChanges();
3726
3718
  if (dirty) {
3727
3719
  const ok = await showConfirm({
3728
3720
  title: "Uncommitted Changes",