refactor(shared): consolidate 13+ getMessageDir copies into single shared function

This commit is contained in:
YeonGyu-Kim
2026-02-14 17:50:08 +09:00
parent e90734d6d9
commit c9c02e0525
21 changed files with 86 additions and 223 deletions
+4 -1
View File
@@ -1,8 +1,11 @@
import { existsSync, readdirSync } from "node:fs"
import { join } from "node:path"
import { MESSAGE_STORAGE } from "../tools/session-manager/constants"
import { getOpenCodeStorageDir } from "./data-path"
const MESSAGE_STORAGE = join(getOpenCodeStorageDir(), "message")
export function getMessageDir(sessionID: string): string | null {
if (!sessionID.startsWith("ses_")) return null
if (!existsSync(MESSAGE_STORAGE)) return null
const directPath = join(MESSAGE_STORAGE, sessionID)