interactive.tsからsummary/runSelector/runSessionReader/selectorUtilsを分離し、 run session参照をrouting層からinstructMode層に移動。instructBranchで新タスク 作成の代わりに既存タスクのrequeueを使用する方式に変更。worktree確認プロンプトを 廃止し常時有効化。
24 lines
505 B
TypeScript
24 lines
505 B
TypeScript
/**
|
|
* Shared process-level helpers.
|
|
*/
|
|
|
|
export function isProcessAlive(ownerPid: number): boolean {
|
|
try {
|
|
process.kill(ownerPid, 0);
|
|
return true;
|
|
} catch (err) {
|
|
const nodeErr = err as NodeJS.ErrnoException;
|
|
if (nodeErr.code === 'ESRCH') {
|
|
return false;
|
|
}
|
|
if (nodeErr.code === 'EPERM') {
|
|
return true;
|
|
}
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
export function isStaleRunningTask(ownerPid: number | undefined): boolean {
|
|
return ownerPid == null || !isProcessAlive(ownerPid);
|
|
}
|