nightytidy 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/agent/index.js +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nightytidy",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Automated overnight codebase improvement through Claude Code",
5
5
  "license": "MIT",
6
6
  "author": "Dorian Spitz",
@@ -483,6 +483,10 @@ export async function startAgent() {
483
483
 
484
484
  const project = projectManager.getProject(run.projectId);
485
485
  if (!project) {
486
+ dispatchWithQueue('run_failed', {
487
+ projectId: run.projectId,
488
+ run: { id: run.id },
489
+ }, []);
486
490
  runQueue.completeCurrent({ success: false });
487
491
  processQueue();
488
492
  return;
@@ -502,6 +506,11 @@ export async function startAgent() {
502
506
  if (!initResult.success) {
503
507
  info(` ✗ Init failed: ${initResult.stderr}`);
504
508
  wsServer.broadcast({ type: 'run-failed', runId: run.id, error: initResult.stderr });
509
+ dispatchWithQueue('run_failed', {
510
+ project: project.name,
511
+ projectId: project.id,
512
+ run: { id: run.id },
513
+ }, project.webhooks);
505
514
  runQueue.completeCurrent({ success: false });
506
515
  processQueue();
507
516
  return;
@@ -719,8 +728,14 @@ export async function startAgent() {
719
728
  activeBridge.kill();
720
729
  activeBridge = null;
721
730
  }
731
+ const project = projectManager.getProject(current.projectId);
722
732
  runQueue.completeCurrent({ success: false });
723
733
  wsServer.broadcast({ type: 'run-failed', runId: msg.runId, error: 'Stopped by user' });
734
+ dispatchWithQueue('run_failed', {
735
+ project: project?.name,
736
+ projectId: current.projectId,
737
+ run: { id: msg.runId },
738
+ }, project?.webhooks || []);
724
739
  reply({ type: 'run-failed', runId: msg.runId, error: 'Stopped by user' });
725
740
  processQueue();
726
741
  } else {