refactor(tmux-subagent): split manager and decision-engine into focused modules
Extract session lifecycle, polling, grid planning, and event handling: - polling.ts: session polling controller with stability detection - event-handlers.ts: session created/deleted handlers - grid-planning.ts, spawn-action-decider.ts, spawn-target-finder.ts - session-status-parser.ts, session-message-count.ts - cleanup.ts, polling-constants.ts, tmux-grid-constants.ts
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
type SessionStatus = { type: string }
|
||||
|
||||
export function parseSessionStatusMap(data: unknown): Record<string, SessionStatus> {
|
||||
if (typeof data !== "object" || data === null) return {}
|
||||
const record = data as Record<string, unknown>
|
||||
|
||||
const result: Record<string, SessionStatus> = {}
|
||||
for (const [sessionId, value] of Object.entries(record)) {
|
||||
if (typeof value !== "object" || value === null) continue
|
||||
const valueRecord = value as Record<string, unknown>
|
||||
const type = valueRecord["type"]
|
||||
if (typeof type !== "string") continue
|
||||
result[sessionId] = { type }
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user