ai-cmds 0.4.1 → 0.4.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.
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as reviewCodeChangesCommand, c as DEFAULT_SCOPES, i as advancedReviewChangesCommand, l as defineConfig, n as createPRCommand, o as BUILT_IN_SETUP_OPTIONS, r as commitCommand, s as BUILT_IN_SCOPE_OPTIONS, t as reviewPRCommand } from "./review-pr-C3lBSGhM.js";
1
+ import { a as reviewCodeChangesCommand, c as DEFAULT_SCOPES, i as advancedReviewChangesCommand, l as defineConfig, n as createPRCommand, o as BUILT_IN_SETUP_OPTIONS, r as commitCommand, s as BUILT_IN_SCOPE_OPTIONS, t as reviewPRCommand } from "./review-pr-Czxxuepn.js";
2
2
 
3
3
  export { BUILT_IN_SCOPE_OPTIONS, BUILT_IN_SETUP_OPTIONS, DEFAULT_SCOPES, advancedReviewChangesCommand, commitCommand, createPRCommand, defineConfig, reviewCodeChangesCommand, reviewPRCommand };
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as reviewCodeChangesCommand, i as advancedReviewChangesCommand, n as createPRCommand, r as commitCommand, t as reviewPRCommand } from "./review-pr-C3lBSGhM.js";
2
+ import { a as reviewCodeChangesCommand, i as advancedReviewChangesCommand, n as createPRCommand, r as commitCommand, t as reviewPRCommand } from "./review-pr-Czxxuepn.js";
3
3
  import { createCLI } from "@ls-stack/cli";
4
4
 
5
5
  //#region src/main.ts
@@ -233,14 +233,19 @@ async function getLocalBranches() {
233
233
  ])).trim().split("\n").filter(Boolean).sort((a, b) => a.length - b.length);
234
234
  }
235
235
  async function getRepoInfo() {
236
- const remoteUrl = await getRemoteUrl();
237
- const sshMatch = remoteUrl.match(/git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/);
238
- const httpsMatch = remoteUrl.match(/https:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?$/);
239
- const match = sshMatch ?? httpsMatch;
240
- if (!match || !match[1] || !match[2]) throw new Error(`Could not parse GitHub repo from remote URL: ${remoteUrl}`);
236
+ const json = await runCmdSilentUnwrap([
237
+ "gh",
238
+ "repo",
239
+ "view",
240
+ "--json",
241
+ "owner,name"
242
+ ]);
243
+ const parsed = JSON.parse(json);
244
+ if (typeof parsed !== "object" || parsed === null || !("owner" in parsed) || !("name" in parsed)) throw new Error(`Unexpected gh repo view output: ${json}`);
245
+ const { owner, name } = parsed;
241
246
  return {
242
- owner: match[1],
243
- repo: match[2].replace(/\.git$/, "")
247
+ owner: owner.login,
248
+ repo: name
244
249
  };
245
250
  }
246
251
  async function getUnstagedDiff(options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-cmds",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist"