(obj: Record<string, unknown>)
| 221 | } |
| 222 | |
| 223 | function formatSessionsList(obj: Record<string, unknown>): string { |
| 224 | const sessions = obj.sessions as Array<Record<string, unknown>> |
| 225 | const total = obj.total ?? sessions.length |
| 226 | const lines: string[] = [`${total} sessions:`] |
| 227 | |
| 228 | for (const s of sessions) { |
| 229 | const name = s.name ?? s.id |
| 230 | const platform = s.platform ? ` (${s.platform})` : '' |
| 231 | const msgCount = s.totalMessages ?? s.messageCount ?? '' |
| 232 | const members = s.totalMembers ?? s.memberCount ?? '' |
| 233 | const stats = msgCount ? ` — ${msgCount} msgs, ${members} members` : '' |
| 234 | lines.push(`- ${name}${platform}${stats} [${s.id}]`) |
| 235 | } |
| 236 | |
| 237 | return lines.join('\n') |
| 238 | } |
no outgoing calls
no test coverage detected