@jxtools/promptline 1.3.18 → 1.3.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxtools/promptline",
3
- "version": "1.3.18",
3
+ "version": "1.3.19",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "bin": {
@@ -109,6 +109,7 @@ if os.path.isfile(queue_file):
109
109
  with open(queue_file, "r") as f:
110
110
  data = json.load(f)
111
111
  data["lastActivity"] = now
112
+ data["closedAt"] = None
112
113
  if not data.get("sessionName"):
113
114
  data["sessionName"] = extract_session_name(transcript_path)
114
115
  if owner_pid is not None and owner_pid > 0:
@@ -82,6 +82,9 @@ function hasPendingWork(session: SessionQueue): boolean {
82
82
  }
83
83
 
84
84
  export function withComputedStatus(session: SessionQueue): SessionQueue & { status: SessionStatus } {
85
+ if (session.closedAt != null) {
86
+ return { ...session, status: 'idle' };
87
+ }
85
88
  const hasRunningPrompt = session.prompts.some(p => p.status === 'running');
86
89
  const isStale = msSinceLastActivity(session) > SESSION_ACTIVE_TIMEOUT_MS;
87
90
  const status: SessionStatus = (hasRunningPrompt || !isStale) ? 'active' : 'idle';
@@ -89,8 +92,8 @@ export function withComputedStatus(session: SessionQueue): SessionQueue & { stat
89
92
  }
90
93
 
91
94
  export function isSessionVisible(session: SessionQueue, now: number = Date.now()): boolean {
92
- if (hasPendingWork(session)) return true;
93
95
  if (session.closedAt != null) return false;
96
+ if (hasPendingWork(session)) return true;
94
97
  const msSinceStart = now - new Date(session.startedAt).getTime();
95
98
  return msSinceStart <= SESSION_ABANDONED_TIMEOUT_MS;
96
99
  }