03eaa429ce
- C3: include command args in auto-slash-command dedup key - H2: track completed task summaries for ALL COMPLETE message - H9: increment tmux close retry count on re-mark - H8: detect stale MCP connections after disconnect+reconnect race - H8: guard disconnectedSessions growth for non-MCP sessions - C1: await tmux cleanup in plugin dispose lifecycle
29 lines
678 B
TypeScript
29 lines
678 B
TypeScript
import type { TrackedSession } from "./types"
|
|
|
|
export function createTrackedSession(params: {
|
|
sessionId: string
|
|
paneId: string
|
|
description: string
|
|
now?: Date
|
|
}): TrackedSession {
|
|
const now = params.now ?? new Date()
|
|
|
|
return {
|
|
sessionId: params.sessionId,
|
|
paneId: params.paneId,
|
|
description: params.description,
|
|
createdAt: now,
|
|
lastSeenAt: now,
|
|
closePending: false,
|
|
closeRetryCount: 0,
|
|
}
|
|
}
|
|
|
|
export function markTrackedSessionClosePending(tracked: TrackedSession): TrackedSession {
|
|
return {
|
|
...tracked,
|
|
closePending: true,
|
|
closeRetryCount: tracked.closePending ? tracked.closeRetryCount + 1 : tracked.closeRetryCount,
|
|
}
|
|
}
|