refactor(shared): unify MESSAGE_STORAGE/PART_STORAGE constants into single source

- Create src/shared/opencode-storage-paths.ts with all 4 constants
- Update 4 previous declaration sites to import from shared file
- Update additional OPENCODE_STORAGE usages for consistency
- Re-export from src/shared/index.ts
- No duplicate constant declarations remain
This commit is contained in:
YeonGyu-Kim
2026-02-14 20:09:13 +09:00
parent 068831f79e
commit 4cf3bc431b
8 changed files with 33 additions and 24 deletions
+1 -3
View File
@@ -1,11 +1,9 @@
import { existsSync, readdirSync } from "node:fs"
import { join } from "node:path"
import { getOpenCodeStorageDir } from "./data-path"
import { MESSAGE_STORAGE } from "./opencode-storage-paths"
import { isSqliteBackend } from "./opencode-storage-detection"
import { log } from "./logger"
const MESSAGE_STORAGE = join(getOpenCodeStorageDir(), "message")
export function getMessageDir(sessionID: string): string | null {
if (!sessionID.startsWith("ses_")) return null
if (isSqliteBackend()) return null