@mrsf/cli 0.7.0 → 0.7.1

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.d.ts CHANGED
@@ -48,6 +48,7 @@ export declare const fuzzySearch: typeof fuzzy.fuzzySearch;
48
48
  export declare const combinedScore: typeof fuzzy.combinedScore;
49
49
  export declare const isGitAvailable: typeof git.isGitAvailable;
50
50
  export declare const findRepoRoot: typeof git.findRepoRoot;
51
+ export declare const getGitUserName: typeof git.getGitUserName;
51
52
  export declare const getCurrentCommit: typeof git.getCurrentCommit;
52
53
  export declare const resolveCommit: typeof git.resolveCommit;
53
54
  export declare const isStale: typeof git.isStale;
package/dist/index.js CHANGED
@@ -53,6 +53,7 @@ export const combinedScore = fuzzy.combinedScore;
53
53
  // Git
54
54
  export const isGitAvailable = git.isGitAvailable;
55
55
  export const findRepoRoot = git.findRepoRoot;
56
+ export const getGitUserName = git.getGitUserName;
56
57
  export const getCurrentCommit = git.getCurrentCommit;
57
58
  export const resolveCommit = git.resolveCommit;
58
59
  export const isStale = git.isStale;
package/dist/lib/git.d.ts CHANGED
@@ -16,6 +16,13 @@ export declare function resetGitCache(): void;
16
16
  * Returns null if not in a Git repo.
17
17
  */
18
18
  export declare function findRepoRoot(cwd?: string): Promise<string | null>;
19
+ /**
20
+ * Read the repository-local Git author name.
21
+ *
22
+ * Only `.git/config` is considered; global Git identity is intentionally
23
+ * ignored so callers can distinguish repository identity from user defaults.
24
+ */
25
+ export declare function getGitUserName(repoRoot: string): Promise<string | null>;
19
26
  /**
20
27
  * Get the full HEAD commit SHA.
21
28
  */
package/dist/lib/git.js CHANGED
@@ -49,6 +49,24 @@ export async function findRepoRoot(cwd) {
49
49
  return null;
50
50
  }
51
51
  }
52
+ /**
53
+ * Read the repository-local Git author name.
54
+ *
55
+ * Only `.git/config` is considered; global Git identity is intentionally
56
+ * ignored so callers can distinguish repository identity from user defaults.
57
+ */
58
+ export async function getGitUserName(repoRoot) {
59
+ if (!(await isGitAvailable()))
60
+ return null;
61
+ try {
62
+ const { stdout } = await execFile("git", ["config", "--local", "--get", "user.name"], { cwd: repoRoot, timeout: GIT_TIMEOUT });
63
+ const name = stdout.trim();
64
+ return name || null;
65
+ }
66
+ catch {
67
+ return null;
68
+ }
69
+ }
52
70
  /**
53
71
  * Get the full HEAD commit SHA.
54
72
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrsf/cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "CLI and library for the Markdown Review Sidecar Format (MRSF)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",