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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user