@staff0rd/assist 0.522.0 → 0.522.2

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/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.522.0",
9
+ version: "0.522.2",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -32369,11 +32369,23 @@ function restoreAllSessions(spawner, sessions, notify2) {
32369
32369
 
32370
32370
  // src/commands/sessions/daemon/retrySession.ts
32371
32371
  function retrySession(session, clients, onStatusChange) {
32372
- const respawn = respawnThunk(session);
32373
- if (!respawn) return false;
32374
- if (session.status !== "done") session.pty?.kill();
32375
- respawnSession(session, respawn, "running", clients, onStatusChange);
32376
- daemonLog(`session ${session.id} retried: ${session.name}`);
32372
+ const spawn13 = respawnThunk(session);
32373
+ if (!spawn13) return false;
32374
+ const respawn = () => {
32375
+ respawnSession(session, spawn13, "running", clients, onStatusChange);
32376
+ daemonLog(`session ${session.id} retried: ${session.name}`);
32377
+ };
32378
+ const pty2 = session.pty;
32379
+ const alive = session.status === "running" || session.status === "waiting";
32380
+ if (pty2 && alive) {
32381
+ daemonLog(
32382
+ `session ${session.id} retry requested: killing running process tree, will respawn on exit`
32383
+ );
32384
+ session.pendingRestart = respawn;
32385
+ killPtyTree(pty2);
32386
+ } else {
32387
+ respawn();
32388
+ }
32377
32389
  return true;
32378
32390
  }
32379
32391
  function respawnThunk(session) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.522.0",
3
+ "version": "0.522.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {