mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
feat(paths): add resolveSessionsRoot as the one shared session-store root
Every surface that persists or lists sessions resolves one directory under the Harness home, so history is shared across working directories instead of scattered per project.
This commit is contained in:
@@ -52,6 +52,27 @@ export function resolveDshHome(configured?: string, env: Record<string, string |
|
||||
return resolve(expandHomePath(selected))
|
||||
}
|
||||
|
||||
/** Directory name for persisted session logs under the Harness home. */
|
||||
export const SESSIONS_DIR_NAME = 'sessions'
|
||||
|
||||
/**
|
||||
* Resolve the shared session-store root under the Harness home.
|
||||
*
|
||||
* Every surface that persists sessions resolves this one directory, so history
|
||||
* is shared across working directories instead of scattered per project. A
|
||||
* persistence backend may still partition inside it. Two surfaces resolving
|
||||
* different roots would silently split one user's history into disjoint stores,
|
||||
* so this is a single owned fact rather than a per-caller `join`.
|
||||
* @param configuredHome - explicit harness-home override, which has highest precedence.
|
||||
* @param env - environment mapping used to read `DSH_HOME`.
|
||||
* @returns the normalized absolute session-store root.
|
||||
*/
|
||||
export function resolveSessionsRoot(
|
||||
configuredHome?: string, env: Record<string, string | undefined> = process.env,
|
||||
): string {
|
||||
return join(resolveDshHome(configuredHome, env), SESSIONS_DIR_NAME)
|
||||
}
|
||||
|
||||
/**
|
||||
* Describe a resolved harness home symbolically for user-facing display.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user