@goodandready/dsh-voice 0.9.21 → 0.9.22
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/lib/updater.js +8 -1
- package/package.json +1 -1
package/lib/updater.js
CHANGED
|
@@ -197,13 +197,15 @@ export function isProcessAlive(pid) {
|
|
|
197
197
|
export function checkProfileLock(profileDir) {
|
|
198
198
|
const lockPath = resolve(profileDir, 'package.json.lock');
|
|
199
199
|
if (!existsSync(lockPath)) return { locked: false };
|
|
200
|
+
let initialStat;
|
|
201
|
+
try { initialStat = statSync(lockPath); } catch { return { locked: false }; }
|
|
200
202
|
const pid = readLockPid(lockPath);
|
|
201
203
|
if (pid !== null) {
|
|
202
204
|
if (isProcessAlive(pid)) {
|
|
203
205
|
return { locked: true, pid };
|
|
204
206
|
}
|
|
205
207
|
// Stale lock: PID is not running.
|
|
206
|
-
// Verify before unlinking: re-check PID to ensure a concurrent live successor
|
|
208
|
+
// Verify before unlinking: re-check PID and stat to ensure a concurrent live successor
|
|
207
209
|
// was not written during the check (#205).
|
|
208
210
|
try {
|
|
209
211
|
const p1 = readLockPid(lockPath);
|
|
@@ -212,6 +214,11 @@ export function checkProfileLock(profileDir) {
|
|
|
212
214
|
if (p2 !== null && isProcessAlive(p2)) return { locked: true, pid: p2 };
|
|
213
215
|
const p3 = readLockPid(lockPath);
|
|
214
216
|
if (p3 !== null && isProcessAlive(p3)) return { locked: true, pid: p3 };
|
|
217
|
+
const currentStat = statSync(lockPath);
|
|
218
|
+
if (currentStat.mtimeMs !== initialStat.mtimeMs || currentStat.size !== initialStat.size) {
|
|
219
|
+
const live = readLockPid(lockPath);
|
|
220
|
+
if (live !== null && isProcessAlive(live)) return { locked: true, pid: live };
|
|
221
|
+
}
|
|
215
222
|
if (p1 === pid && p2 === pid && p3 === pid) {
|
|
216
223
|
unlinkSync(lockPath);
|
|
217
224
|
return { locked: false, cleanedStale: true };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-voice",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.22",
|
|
4
4
|
"description": "Voice input for DeepSeek Harness: dictation chunked by pauses and voice messages, each with its own provider fallback chain (Deepgram, Groq, HuggingFace, local whisper.cpp, plus any OpenAI-compatible API of your own).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|