MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / statSessionFile

Function statSessionFile

desktop/terminal/manager.ts:231–251  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

229}
230
231export 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
253export async function closeTerminal(request: TerminalCloseRequest) {
254 const record = getTerminalSession(request.sessionId)

Callers

nothing calls this directly

Calls 2

getTerminalSessionFunction · 0.90
getPersistedSessionPathFunction · 0.90

Tested by

no test coverage detected