dmux 2.0.0 → 2.2.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.
@@ -0,0 +1,88 @@
1
+ import { execSync } from 'child_process';
2
+ /**
3
+ * Detects the main/master branch name for the repository
4
+ */
5
+ export function getMainBranch() {
6
+ try {
7
+ // First try to get the default branch from origin
8
+ const originHead = execSync('git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null', {
9
+ encoding: 'utf8',
10
+ stdio: 'pipe'
11
+ }).trim();
12
+ if (originHead) {
13
+ // Extract branch name from refs/remotes/origin/main format
14
+ const match = originHead.match(/refs\/remotes\/origin\/(.+)/);
15
+ if (match) {
16
+ return match[1];
17
+ }
18
+ }
19
+ }
20
+ catch {
21
+ // Fallback if origin/HEAD is not set
22
+ }
23
+ try {
24
+ // Check if 'main' branch exists
25
+ execSync('git show-ref --verify --quiet refs/heads/main', { stdio: 'pipe' });
26
+ return 'main';
27
+ }
28
+ catch {
29
+ // main doesn't exist
30
+ }
31
+ try {
32
+ // Check if 'master' branch exists
33
+ execSync('git show-ref --verify --quiet refs/heads/master', { stdio: 'pipe' });
34
+ return 'master';
35
+ }
36
+ catch {
37
+ // master doesn't exist
38
+ }
39
+ // Last resort: get the initial branch
40
+ try {
41
+ const branches = execSync('git branch --list', { encoding: 'utf8', stdio: 'pipe' });
42
+ const match = branches.match(/^\* (.+)$/m);
43
+ if (match) {
44
+ return match[1].trim();
45
+ }
46
+ }
47
+ catch {
48
+ // Failed to get any branch
49
+ }
50
+ return 'main'; // Default fallback
51
+ }
52
+ /**
53
+ * Checks if there are uncommitted changes in the repository
54
+ */
55
+ export function hasUncommittedChanges(cwd) {
56
+ try {
57
+ const status = execSync('git status --porcelain', {
58
+ cwd,
59
+ encoding: 'utf8',
60
+ stdio: 'pipe'
61
+ });
62
+ return status.trim().length > 0;
63
+ }
64
+ catch {
65
+ return false;
66
+ }
67
+ }
68
+ /**
69
+ * Gets the list of conflicted files
70
+ */
71
+ export function getConflictedFiles(cwd) {
72
+ try {
73
+ const status = execSync('git status --porcelain', {
74
+ cwd,
75
+ encoding: 'utf8',
76
+ stdio: 'pipe'
77
+ });
78
+ return status
79
+ .split('\n')
80
+ .filter(line => line.startsWith('UU ') || line.startsWith('AA '))
81
+ .map(line => line.substring(3).trim())
82
+ .filter(Boolean);
83
+ }
84
+ catch {
85
+ return [];
86
+ }
87
+ }
88
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,IAAI,CAAC;QACH,kDAAkD;QAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,uDAAuD,EAAE;YACnF,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,MAAM;SACd,CAAC,CAAC,IAAI,EAAE,CAAC;QAEV,IAAI,UAAU,EAAE,CAAC;YACf,2DAA2D;YAC3D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;YAC9D,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,qCAAqC;IACvC,CAAC;IAED,IAAI,CAAC;QACH,gCAAgC;QAChC,QAAQ,CAAC,+CAA+C,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7E,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,qBAAqB;IACvB,CAAC;IAED,IAAI,CAAC;QACH,kCAAkC;QAClC,QAAQ,CAAC,iDAAiD,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/E,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,MAAM,C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AC,CAAC,IAAI,EAAE,CAAC;aACrC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dmux",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Tmux pane manager with AI agent integration for parallel development workflows",
5
5
  "type": "module",
6
6
  "author": "Justin Schroeder",