(sessionId: string)
| 229 | } |
| 230 | |
| 231 | export async function statSessionFile(sessionId: string) { |
| 232 | const record = getTerminalSession(sessionId) |
| 233 | const persistedSessionPath = getPersistedSessionPath(record?.snapshot.sessionPath ?? null) |
| 234 | if (!persistedSessionPath) { |
| 235 | return null |
| 236 | } |
| 237 | |
| 238 | try { |
| 239 | const fileStat = await stat(persistedSessionPath) |
| 240 | if (!fileStat.isFile()) { |
| 241 | return null |
| 242 | } |
| 243 | |
| 244 | return { |
| 245 | mtimeMs: fileStat.mtimeMs, |
| 246 | size: fileStat.size, |
| 247 | } |
| 248 | } catch { |
| 249 | return null |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | export async function closeTerminal(request: TerminalCloseRequest) { |
| 254 | const record = getTerminalSession(request.sessionId) |
nothing calls this directly
no test coverage detected