claude-issue-solver 1.43.4 → 1.43.6
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 +2 -1
- package/dist/utils/helpers.d.ts +1 -2
- package/dist/utils/helpers.js +5 -9
- package/dist/utils/helpers.test.js +11 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,7 +26,8 @@ const program = new commander_1.Command();
|
|
|
26
26
|
program
|
|
27
27
|
.name('claude-issue')
|
|
28
28
|
.description('Automatically solve GitHub issues using Claude Code')
|
|
29
|
-
.version(packageJson.version, '-v, --version', 'Show version number')
|
|
29
|
+
.version(packageJson.version, '-v, --version', 'Show version number')
|
|
30
|
+
.enablePositionalOptions(); // Required to prevent option conflicts between default command and subcommands
|
|
30
31
|
// Commands that skip requirements check
|
|
31
32
|
const skipRequirementsCommands = ['init'];
|
|
32
33
|
// Check requirements before any command (except init)
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ export declare function checkRequirements(): {
|
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* Generate AppleScript for opening a script in iTerm2.
|
|
8
|
-
*
|
|
9
|
-
* Sends 'n' first to dismiss any oh-my-zsh update prompts, then runs the script with bash.
|
|
8
|
+
* Creates a new window and runs the command directly to avoid session restoration issues.
|
|
10
9
|
*/
|
|
11
10
|
export declare function generateITermOpenScript(script: string): string;
|
|
12
11
|
/**
|
package/dist/utils/helpers.js
CHANGED
|
@@ -75,25 +75,21 @@ function checkRequirements() {
|
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Generate AppleScript for opening a script in iTerm2.
|
|
78
|
-
*
|
|
79
|
-
* Sends 'n' first to dismiss any oh-my-zsh update prompts, then runs the script with bash.
|
|
78
|
+
* Creates a new window and runs the command directly to avoid session restoration issues.
|
|
80
79
|
*/
|
|
81
80
|
function generateITermOpenScript(script) {
|
|
82
|
-
const escapedScript = script.replace(/"/g, '\\"');
|
|
81
|
+
const escapedScript = script.replace(/"/g, '\\"').replace(/'/g, '');
|
|
83
82
|
// Extract directory from script path to set as working directory
|
|
84
83
|
const scriptDir = path.dirname(script.replace(/'/g, ''));
|
|
85
84
|
const escapedDir = scriptDir.replace(/"/g, '\\"');
|
|
86
85
|
// cd to the script's directory first, so session path matches worktree
|
|
87
86
|
const bashCommand = `cd "${escapedDir}" && /bin/bash "${escapedScript}"`;
|
|
87
|
+
const escapedBashCommand = bashCommand.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
88
88
|
return `
|
|
89
89
|
tell application "iTerm"
|
|
90
90
|
activate
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
write text "n"
|
|
94
|
-
delay 0.3
|
|
95
|
-
write text "${bashCommand.replace(/"/g, '\\"')}"
|
|
96
|
-
end tell
|
|
91
|
+
-- Create a new window with a command to avoid session restoration issues
|
|
92
|
+
create window with default profile command "/bin/bash -c '${bashCommand.replace(/'/g, "'\\''")}'"
|
|
97
93
|
end tell
|
|
98
94
|
`;
|
|
99
95
|
}
|
|
@@ -26,16 +26,13 @@ const helpers_1 = require("./helpers");
|
|
|
26
26
|
(0, vitest_1.it)('should generate valid AppleScript for iTerm', () => {
|
|
27
27
|
const script = (0, helpers_1.generateITermOpenScript)('/path/to/script.sh');
|
|
28
28
|
(0, vitest_1.expect)(script).toContain('tell application "iTerm"');
|
|
29
|
-
(0, vitest_1.expect)(script).toContain('create window with default profile');
|
|
30
|
-
(0, vitest_1.expect)(script).toContain('write text');
|
|
29
|
+
(0, vitest_1.expect)(script).toContain('create window with default profile command');
|
|
31
30
|
});
|
|
32
|
-
(0, vitest_1.it)('should
|
|
33
|
-
const script = (0, helpers_1.generateITermOpenScript)('/path/to/script.sh');
|
|
34
|
-
(0, vitest_1.expect)(script).toContain('write text "n"');
|
|
35
|
-
});
|
|
36
|
-
(0, vitest_1.it)('should include delay after dismissing prompt', () => {
|
|
31
|
+
(0, vitest_1.it)('should use create window with command to avoid session restoration', () => {
|
|
37
32
|
const script = (0, helpers_1.generateITermOpenScript)('/path/to/script.sh');
|
|
38
|
-
|
|
33
|
+
// Should use command parameter to run directly without session restoration
|
|
34
|
+
(0, vitest_1.expect)(script).toContain('create window with default profile command');
|
|
35
|
+
(0, vitest_1.expect)(script).toContain('/bin/bash -c');
|
|
39
36
|
});
|
|
40
37
|
(0, vitest_1.it)('should use /bin/bash to run the script', () => {
|
|
41
38
|
const script = (0, helpers_1.generateITermOpenScript)('/path/to/script.sh');
|
|
@@ -82,16 +79,11 @@ const helpers_1 = require("./helpers");
|
|
|
82
79
|
});
|
|
83
80
|
});
|
|
84
81
|
(0, vitest_1.describe)('oh-my-zsh bypass behavior', () => {
|
|
85
|
-
(0, vitest_1.it)('iTerm script should
|
|
82
|
+
(0, vitest_1.it)('iTerm script should run command directly to avoid session restoration', () => {
|
|
86
83
|
const script = (0, helpers_1.generateITermOpenScript)('/test/script.sh');
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const commandIndex = lines.findIndex(line => line.includes('/bin/bash'));
|
|
91
|
-
// Dismissal should come before command
|
|
92
|
-
(0, vitest_1.expect)(dismissIndex).toBeGreaterThan(-1);
|
|
93
|
-
(0, vitest_1.expect)(commandIndex).toBeGreaterThan(-1);
|
|
94
|
-
(0, vitest_1.expect)(dismissIndex).toBeLessThan(commandIndex);
|
|
84
|
+
// Should use create window with command to avoid session restoration issues
|
|
85
|
+
(0, vitest_1.expect)(script).toContain('create window with default profile command');
|
|
86
|
+
(0, vitest_1.expect)(script).toContain('/bin/bash');
|
|
95
87
|
});
|
|
96
88
|
(0, vitest_1.it)('Terminal script should combine dismiss and command in single do script', () => {
|
|
97
89
|
const script = (0, helpers_1.generateTerminalOpenScript)('/test/script.sh');
|
|
@@ -102,8 +94,8 @@ const helpers_1 = require("./helpers");
|
|
|
102
94
|
(0, vitest_1.describe)('working directory for terminal closing', () => {
|
|
103
95
|
(0, vitest_1.it)('iTerm script should cd to script directory before running', () => {
|
|
104
96
|
const script = (0, helpers_1.generateITermOpenScript)('/path/to/worktree/.claude-runner.sh');
|
|
105
|
-
// Should cd to the script's directory
|
|
106
|
-
(0, vitest_1.expect)(script).toContain('cd
|
|
97
|
+
// Should cd to the script's directory
|
|
98
|
+
(0, vitest_1.expect)(script).toContain('cd "/path/to/worktree"');
|
|
107
99
|
(0, vitest_1.expect)(script).toContain('/bin/bash');
|
|
108
100
|
});
|
|
109
101
|
(0, vitest_1.it)('Terminal script should cd to script directory before running', () => {
|