nightytidy 0.2.10 → 0.2.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightytidy",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Automated overnight codebase improvement through Claude Code",
5
5
  "license": "MIT",
6
6
  "author": "Dorian Spitz",
@@ -2,7 +2,7 @@ import { spawn } from 'node:child_process';
2
2
  import path from 'node:path';
3
3
  import { debug, warn, error as logError } from '../logger.js';
4
4
 
5
- const INIT_TIMEOUT_MS = 5 * 60_000; // 5 minutes — init should never take this long
5
+ const INIT_TIMEOUT_MS = 10 * 60_000; // 10 minutes — generous but not infinite
6
6
  const FINISH_TIMEOUT_MS = 10 * 60_000; // 10 minutes — finish includes report generation
7
7
 
8
8
  export class CliBridge {
@@ -533,6 +533,8 @@ export async function startAgent() {
533
533
  ? 'Initialization timed out — Claude Code may be unavailable. Restart the agent to retry.'
534
534
  : (initResult.parsed?.error || initResult.stderr || 'Unknown init error');
535
535
  info(` ✗ Init failed: ${errorMsg}`);
536
+ if (initResult.stdout) debug(` Init stdout: ${initResult.stdout.slice(-500)}`);
537
+ if (initResult.stderr) debug(` Init stderr: ${initResult.stderr.slice(-500)}`);
536
538
  wsServer.broadcast({ type: 'run-failed', runId: run.id, error: errorMsg });
537
539
  dispatchWithQueue('run_failed', {
538
540
  project: project.name,
package/src/checks.js CHANGED
@@ -203,18 +203,19 @@ async function checkClaudeAuthenticated() {
203
203
  async function getFreeBytesWindows(projectDir) {
204
204
  const driveLetter = projectDir.charAt(0).toUpperCase();
205
205
  // Try PowerShell first (wmic is deprecated on newer Windows)
206
+ // 10s timeout — PowerShell can hang on OneDrive/network drive systems
206
207
  const psResult = await runCommand('powershell', [
207
208
  '-NoProfile', '-Command',
208
209
  `(Get-PSDrive ${driveLetter}).Free`,
209
- ]);
210
+ ], { timeoutMs: 10_000 });
210
211
  const psMatch = psResult.stdout.trim().match(/^(\d+)$/);
211
212
  if (psResult.code === 0 && psMatch) {
212
213
  return parseInt(psMatch[1], 10);
213
214
  }
214
- // Fallback to wmic for older Windows
215
+ // Fallback to wmic for older Windows (also with timeout)
215
216
  const result = await runCommand('wmic', [
216
217
  'logicaldisk', 'where', `DeviceID='${driveLetter}:'`, 'get', 'FreeSpace',
217
- ]);
218
+ ], { timeoutMs: 10_000 });
218
219
  const match = result.stdout.match(/(\d+)/);
219
220
  return match ? parseInt(match[1], 10) : null;
220
221
  }