claude-issue-solver 1.8.1 → 1.8.3

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.
@@ -104,7 +104,7 @@ async function solveCommand(issueNumber) {
104
104
  (0, helpers_1.symlinkNodeModules)(projectRoot, worktreePath);
105
105
  setupSpinner.succeed('Worktree setup complete');
106
106
  }
107
- // Build the prompt for Claude
107
+ // Build the prompt for Claude and save to file (avoids shell escaping issues)
108
108
  const prompt = `Please solve this GitHub issue:
109
109
 
110
110
  ## Issue #${issueNumber}: ${issue.title}
@@ -118,6 +118,9 @@ Instructions:
118
118
  2. Implement the necessary changes
119
119
  3. Make sure to run tests if applicable
120
120
  4. When done, commit your changes with a descriptive message that references the issue`;
121
+ // Write prompt to a file to avoid shell escaping issues with backticks, <>, etc.
122
+ const promptFile = path.join(worktreePath, '.claude-prompt.txt');
123
+ fs.writeFileSync(promptFile, prompt);
121
124
  // Create runner script
122
125
  const runnerScript = path.join(worktreePath, '.claude-runner.sh');
123
126
  const runnerContent = `#!/bin/bash
@@ -203,8 +206,11 @@ while true; do
203
206
  done &
204
207
  WATCHER_PID=$!
205
208
 
206
- # Run Claude interactively
207
- claude --dangerously-skip-permissions "${prompt.replace(/"/g, '\\"').replace(/\n/g, '\\n')}"
209
+ # Run Claude interactively (read prompt from file to avoid shell escaping issues)
210
+ claude --dangerously-skip-permissions "$(cat '${promptFile}')"
211
+
212
+ # Clean up prompt file
213
+ rm -f '${promptFile}'
208
214
 
209
215
  # Kill the watcher
210
216
  kill $WATCHER_PID 2>/dev/null
@@ -136,12 +136,45 @@ function openInNewTerminal(script) {
136
136
  console.log(script);
137
137
  }
138
138
  }
139
+ /**
140
+ * Recursively find all .env* files in a directory
141
+ */
142
+ function findEnvFiles(dir, baseDir, results = []) {
143
+ const skipDirs = ['node_modules', '.git', 'dist', 'build', '.next', '.turbo'];
144
+ try {
145
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
146
+ for (const entry of entries) {
147
+ const fullPath = path.join(dir, entry.name);
148
+ if (entry.isDirectory()) {
149
+ if (!skipDirs.includes(entry.name)) {
150
+ findEnvFiles(fullPath, baseDir, results);
151
+ }
152
+ }
153
+ else if (entry.isFile() && entry.name.startsWith('.env')) {
154
+ // Store relative path from base directory
155
+ const relativePath = path.relative(baseDir, fullPath);
156
+ results.push(relativePath);
157
+ }
158
+ }
159
+ }
160
+ catch {
161
+ // Ignore permission errors or inaccessible directories
162
+ }
163
+ return results;
164
+ }
139
165
  function copyEnvFiles(from, to) {
140
- const envFiles = ['.env', '.env.local'];
141
- for (const file of envFiles) {
142
- const src = path.join(from, file);
143
- const dest = path.join(to, file);
144
- if (fs.existsSync(src) && !fs.existsSync(dest)) {
166
+ // Find all .env* files recursively
167
+ const envFiles = findEnvFiles(from, from);
168
+ for (const relativePath of envFiles) {
169
+ const src = path.join(from, relativePath);
170
+ const dest = path.join(to, relativePath);
171
+ // Create parent directory if it doesn't exist
172
+ const destDir = path.dirname(dest);
173
+ if (!fs.existsSync(destDir)) {
174
+ fs.mkdirSync(destDir, { recursive: true });
175
+ }
176
+ // Only copy if destination doesn't exist
177
+ if (!fs.existsSync(dest)) {
145
178
  fs.copyFileSync(src, dest);
146
179
  }
147
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-issue-solver",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "Automatically solve GitHub issues using Claude Code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {