@rotorsoft/gent 1.18.0 → 1.19.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
@@ -913,6 +913,27 @@ async function getAuthorInitials() {
913
913
  }
914
914
  return "dev";
915
915
  }
916
+ async function getRepoInfo() {
917
+ try {
918
+ const { stdout } = await execa2("git", [
919
+ "config",
920
+ "--get",
921
+ "remote.origin.url"
922
+ ]);
923
+ const url = stdout.trim();
924
+ const sshMatch = url.match(/git@github\.com:([^/]+)\/([^.]+)/);
925
+ if (sshMatch) {
926
+ return { owner: sshMatch[1], repo: sshMatch[2] };
927
+ }
928
+ const httpsMatch = url.match(/github\.com\/([^/]+)\/([^.]+)/);
929
+ if (httpsMatch) {
930
+ return { owner: httpsMatch[1], repo: httpsMatch[2] };
931
+ }
932
+ return null;
933
+ } catch {
934
+ return null;
935
+ }
936
+ }
916
937
  async function getCommitsSinceBase(base = "main") {
917
938
  try {
918
939
  const { stdout } = await execa2("git", [
@@ -2221,7 +2242,7 @@ import { homedir } from "os";
2221
2242
  // package.json
2222
2243
  var package_default = {
2223
2244
  name: "@rotorsoft/gent",
2224
- version: "1.18.0",
2245
+ version: "1.19.0",
2225
2246
  description: "AI-powered GitHub workflow CLI - leverage AI (Claude, Gemini, or Codex) to create tickets, implement features, and manage PRs",
2226
2247
  keywords: [
2227
2248
  "cli",
@@ -2671,7 +2692,8 @@ async function aggregateState() {
2671
2692
  reviewFeedback: [],
2672
2693
  hasActionableFeedback: false,
2673
2694
  hasUIChanges: false,
2674
- isPlaywrightAvailable: false
2695
+ isPlaywrightAvailable: false,
2696
+ hasValidRemote: false
2675
2697
  };
2676
2698
  }
2677
2699
  const config = loadConfig();
@@ -2689,11 +2711,12 @@ async function aggregateState() {
2689
2711
  };
2690
2712
  }
2691
2713
  const { isGhAuthenticated, isAIProviderAvailable } = envCache;
2692
- const [branch, isOnMain, uncommitted, baseBranch] = await Promise.all([
2714
+ const [branch, isOnMain, uncommitted, baseBranch, repoInfo] = await Promise.all([
2693
2715
  getCurrentBranch(),
2694
2716
  isOnMainBranch(),
2695
2717
  hasUncommittedChanges(),
2696
- getDefaultBranch()
2718
+ getDefaultBranch(),
2719
+ getRepoInfo()
2697
2720
  ]);
2698
2721
  const hasConfig = configExists();
2699
2722
  const hasProgress = progressExists(config);
@@ -2769,7 +2792,8 @@ async function aggregateState() {
2769
2792
  reviewFeedback,
2770
2793
  hasActionableFeedback,
2771
2794
  hasUIChanges: uiChanges,
2772
- isPlaywrightAvailable: playwrightAvailable
2795
+ isPlaywrightAvailable: playwrightAvailable,
2796
+ hasValidRemote: repoInfo !== null
2773
2797
  };
2774
2798
  }
2775
2799
 
@@ -2780,7 +2804,9 @@ function getAvailableActions(state) {
2780
2804
  actions.push({ id: "quit", label: "quit", shortcut: "q" });
2781
2805
  return actions;
2782
2806
  }
2783
- actions.push({ id: "create", label: "new", shortcut: "n" });
2807
+ if (state.hasValidRemote) {
2808
+ actions.push({ id: "create", label: "new", shortcut: "n" });
2809
+ }
2784
2810
  if (!state.isOnMain) {
2785
2811
  if (state.hasUncommittedChanges) {
2786
2812
  actions.push({ id: "commit", label: "commit", shortcut: "c" });
@@ -2788,7 +2814,7 @@ function getAvailableActions(state) {
2788
2814
  if (state.hasUnpushedCommits && state.commits.length > 0) {
2789
2815
  actions.push({ id: "push", label: "push", shortcut: "s" });
2790
2816
  }
2791
- if (!state.pr && state.commits.length > 0) {
2817
+ if (state.hasValidRemote && !state.pr && state.commits.length > 0) {
2792
2818
  actions.push({ id: "pr", label: "pr", shortcut: "p" });
2793
2819
  }
2794
2820
  if (state.issue && state.pr?.state !== "merged") {
@@ -3083,7 +3109,17 @@ function buildDashboardLines(state, actions, hint, refreshing, versionCheck) {
3083
3109
  out(row(chalk3.dim(" No commits"), w));
3084
3110
  }
3085
3111
  }
3086
- if (hint) {
3112
+ if (!state.hasValidRemote) {
3113
+ section("Hint");
3114
+ out(
3115
+ row(
3116
+ chalk3.yellow(
3117
+ "Add a GitHub remote to create tickets and pull requests"
3118
+ ),
3119
+ w
3120
+ )
3121
+ );
3122
+ } else if (hint) {
3087
3123
  section("Hint");
3088
3124
  out(row(chalk3.yellow(hint), w));
3089
3125
  }
@@ -4023,7 +4059,8 @@ async function tuiCommand() {
4023
4059
  reviewFeedback: [],
4024
4060
  hasActionableFeedback: false,
4025
4061
  hasUIChanges: false,
4026
- isPlaywrightAvailable: false
4062
+ isPlaywrightAvailable: false,
4063
+ hasValidRemote: true
4027
4064
  };
4028
4065
  let needsRefresh = true;
4029
4066
  let isFirstLoad = true;