claude-issue-solver 1.43.0 → 1.43.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.
@@ -79,58 +79,39 @@ function generateITermCloseScript(patterns) {
79
79
  return `
80
80
  tell application "iTerm"
81
81
  set windowsToClose to {}
82
- set sessionsToClose to {}
83
82
 
84
- -- First pass: collect windows and sessions to close
83
+ -- First pass: collect windows to close (by name or by session working directory)
85
84
  repeat with w in windows
86
85
  try
87
86
  set windowName to name of w
88
87
  set windowId to id of w
89
- ${escapedPatterns.map((p) => `if windowName contains "${p}" then set end of windowsToClose to windowId`).join('\n ')}
90
- end try
88
+ set shouldClose to false
91
89
 
92
- -- Check tabs and sessions - match by name OR working directory path
93
- repeat with t in tabs of w
94
- repeat with s in sessions of t
95
- try
96
- set sessionName to name of s
97
- set sessionPath to ""
98
- try
99
- set sessionPath to path of s
100
- end try
101
- set sessionId to unique id of s
102
- -- Match by session name
103
- ${escapedPatterns.map((p) => `if sessionName contains "${p}" then set end of sessionsToClose to {windowId, sessionId}`).join('\n ')}
104
- -- Match by working directory path (more reliable)
105
- ${escapedPatterns.map((p) => `if sessionPath contains "${p}" then set end of sessionsToClose to {windowId, sessionId}`).join('\n ')}
106
- end try
107
- end repeat
108
- end repeat
109
- end repeat
90
+ -- Match by window name
91
+ ${escapedPatterns.map((p) => `if windowName contains "${p}" then set shouldClose to true`).join('\n ')}
110
92
 
111
- -- Second pass: close sessions first (from windows not being fully closed)
112
- repeat with sessionInfo in sessionsToClose
113
- try
114
- set targetWindowId to item 1 of sessionInfo
115
- set targetSessionId to item 2 of sessionInfo
116
- -- Only close session if its window isn't being closed entirely
117
- if windowsToClose does not contain targetWindowId then
118
- repeat with w in windows
119
- if id of w is targetWindowId then
120
- repeat with t in tabs of w
121
- repeat with s in sessions of t
122
- if unique id of s is targetSessionId then
123
- close s
124
- end if
125
- end repeat
126
- end repeat
127
- end if
93
+ -- Match by session working directory path (more reliable)
94
+ if not shouldClose then
95
+ repeat with t in tabs of w
96
+ repeat with s in sessions of t
97
+ try
98
+ set sessionPath to ""
99
+ try
100
+ set sessionPath to path of s
101
+ end try
102
+ ${escapedPatterns.map((p) => `if sessionPath contains "${p}" then set shouldClose to true`).join('\n ')}
103
+ end try
104
+ end repeat
128
105
  end repeat
129
106
  end if
107
+
108
+ if shouldClose and windowsToClose does not contain windowId then
109
+ set end of windowsToClose to windowId
110
+ end if
130
111
  end try
131
112
  end repeat
132
113
 
133
- -- Third pass: close entire windows
114
+ -- Second pass: close windows
134
115
  repeat with targetWindowId in windowsToClose
135
116
  try
136
117
  repeat with w in windows
@@ -62,7 +62,6 @@ const terminal_1 = require("./terminal");
62
62
  (0, vitest_1.expect)(script).toContain('project-issue-42');
63
63
  (0, vitest_1.expect)(script).toContain('Issue #42');
64
64
  (0, vitest_1.expect)(script).toContain('windowsToClose');
65
- (0, vitest_1.expect)(script).toContain('sessionsToClose');
66
65
  });
67
66
  (0, vitest_1.it)('should escape double quotes in patterns', () => {
68
67
  const patterns = ['Issue "quoted"'];
@@ -72,12 +71,10 @@ const terminal_1 = require("./terminal");
72
71
  (0, vitest_1.it)('should use two-pass approach for closing', () => {
73
72
  const patterns = ['test'];
74
73
  const script = (0, terminal_1.generateITermCloseScript)(patterns);
75
- // First pass collects
74
+ // First pass collects windows to close
76
75
  (0, vitest_1.expect)(script).toContain('First pass: collect');
77
- // Second pass closes sessions
78
- (0, vitest_1.expect)(script).toContain('Second pass: close sessions');
79
- // Third pass closes windows
80
- (0, vitest_1.expect)(script).toContain('Third pass: close entire windows');
76
+ // Second pass closes windows
77
+ (0, vitest_1.expect)(script).toContain('Second pass: close windows');
81
78
  });
82
79
  (0, vitest_1.it)('should match by session working directory path', () => {
83
80
  const patterns = ['/Users/test/worktree'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-issue-solver",
3
- "version": "1.43.0",
3
+ "version": "1.43.1",
4
4
  "description": "Automatically solve GitHub issues using Claude Code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {