@threadbase-sh/streamer 1.44.3 → 1.44.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.
package/dist/cli.cjs CHANGED
@@ -147568,7 +147568,12 @@ function managedToResponse(s3, ptyAttached) {
147568
147568
  // the durable registry, so it is a previous run's session with no process
147569
147569
  // behind it — `resumable`, and `historical` rather than `managed`
147570
147570
  // (docs/plans/live-sessions-persistence-plan.md §4, Phase 1).
147571
- lifecycle: ptyAttached ? "attached" : s3.rehydrated ? "resumable" : s3.failureReason != null ? "failed" : "completed",
147571
+ // A session this run itself put on hold (grace timer, explicit hold_session,
147572
+ // idle reaper) is the other exception: the PTY is gone the same way an exit
147573
+ // leaves it gone, but the conversation is still resumable, not terminal —
147574
+ // `putOnHold` records that by leaving `statusSource: "shutdown"` (the only
147575
+ // place either runner sets it), so it is checked here alongside `rehydrated`.
147576
+ lifecycle: ptyAttached ? "attached" : s3.rehydrated || s3.statusSource === "shutdown" ? "resumable" : s3.failureReason != null ? "failed" : "completed",
147572
147577
  lifecycleSource: ptyAttached ? s3.reconciled ? "reconcile" : "spawn" : s3.rehydrated ? "reconcile" : "exit",
147573
147578
  // We own its PTY, so `status` is the authoritative signal — no inferred
147574
147579
  // `activity` is attached for managed sessions.
@@ -148422,7 +148427,14 @@ var StreamerServer = class {
148422
148427
  // even though the registry has one — the name only appeared after a
148423
148428
  // restart rebuilt the row as a stub. Guarded so a runner that has not
148424
148429
  // derived one yet cannot blank a name set by enrichResumedSessionAsync.
148425
- ...session.sessionName != null && { sessionName: session.sessionName }
148430
+ ...session.sessionName != null && { sessionName: session.sessionName },
148431
+ // Without mirroring this, SessionStore's copy is frozen at whatever
148432
+ // `addManaged` saw at spawn ("spawn") forever, because updateManaged
148433
+ // is a partial merge — so managedToResponse can never tell a
148434
+ // grace-timer/idle-reaper hold (statusSource "shutdown") apart from a
148435
+ // genuine process exit ("process-exit"), and reports both as
148436
+ // `lifecycle: "completed"`. See managedToResponse in session-store.ts.
148437
+ ...session.statusSource != null && { statusSource: session.statusSource }
148426
148438
  });
148427
148439
  this.managedSessionsRepo?.recordStatus(
148428
148440
  session.id,