feat(session-manager): add version-gated SDK read path for OpenCode beta

- Add SDK client injection via setStorageClient()

- Version-gate getMainSessions(), getAllSessions(), readSessionMessages(), readSessionTodos()

- Add comprehensive tests for SDK path (beta mode)

- Maintain backward compatibility with JSON fallback
This commit is contained in:
YeonGyu-Kim
2026-02-14 18:16:18 +09:00
parent 5eebef953b
commit b0944b7fd1
8 changed files with 720 additions and 10 deletions
+2
View File
@@ -1,11 +1,13 @@
import { existsSync, readdirSync } from "node:fs"
import { join } from "node:path"
import { getOpenCodeStorageDir } from "./data-path"
import { isSqliteBackend } from "./opencode-storage-detection"
const MESSAGE_STORAGE = join(getOpenCodeStorageDir(), "message")
export function getMessageDir(sessionID: string): string | null {
if (!sessionID.startsWith("ses_")) return null
if (isSqliteBackend()) return null
if (!existsSync(MESSAGE_STORAGE)) return null
const directPath = join(MESSAGE_STORAGE, sessionID)