@damper/cli 0.9.14 → 0.9.15
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/services/claude.js +22 -0
- package/package.json +1 -1
package/dist/services/claude.js
CHANGED
|
@@ -81,6 +81,25 @@ export function configureDamperMcp() {
|
|
|
81
81
|
// Write back
|
|
82
82
|
fs.writeFileSync(CLAUDE_SETTINGS_FILE, JSON.stringify(settings, null, 2));
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Send a notification when Claude finishes.
|
|
86
|
+
* - BEL: triggers terminal bell (Ghostty: sound + dock badge)
|
|
87
|
+
* - macOS notification: shows a system banner via osascript
|
|
88
|
+
*/
|
|
89
|
+
function notifySessionEnd(label) {
|
|
90
|
+
// Terminal bell — triggers Ghostty sound/badge, works in any terminal
|
|
91
|
+
if (process.stdout.isTTY) {
|
|
92
|
+
process.stdout.write('\x07');
|
|
93
|
+
}
|
|
94
|
+
// macOS desktop notification (fire-and-forget)
|
|
95
|
+
if (process.platform === 'darwin') {
|
|
96
|
+
const escaped = label.replace(/"/g, '\\"');
|
|
97
|
+
spawn('osascript', [
|
|
98
|
+
'-e',
|
|
99
|
+
`display notification "${escaped}" with title "Damper" sound name "Glass"`,
|
|
100
|
+
], { stdio: 'ignore', detached: true }).unref();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
84
103
|
/**
|
|
85
104
|
* Check if tmux is available
|
|
86
105
|
*/
|
|
@@ -229,6 +248,7 @@ export async function launchClaude(options) {
|
|
|
229
248
|
});
|
|
230
249
|
}
|
|
231
250
|
clearTerminalTitle();
|
|
251
|
+
notifySessionEnd(`Claude finished: ${taskLabel}`);
|
|
232
252
|
console.log(pc.dim('\n─────────────────────────────────────────\n'));
|
|
233
253
|
return { cwd, taskId, apiKey };
|
|
234
254
|
}
|
|
@@ -634,6 +654,7 @@ export async function launchClaudeForReview(options) {
|
|
|
634
654
|
});
|
|
635
655
|
}
|
|
636
656
|
clearTerminalTitle();
|
|
657
|
+
notifySessionEnd(`Review finished: ${reviewLabel}`);
|
|
637
658
|
}
|
|
638
659
|
/**
|
|
639
660
|
* Launch Claude to resolve merge conflicts
|
|
@@ -667,6 +688,7 @@ async function launchClaudeForMerge(options) {
|
|
|
667
688
|
});
|
|
668
689
|
}
|
|
669
690
|
clearTerminalTitle();
|
|
691
|
+
notifySessionEnd('Merge conflict resolution finished');
|
|
670
692
|
}
|
|
671
693
|
/**
|
|
672
694
|
* Check if Claude Code CLI is installed
|