feat(shared): add connected-providers-cache for model availability (#1121)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com> Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -20,3 +20,28 @@ export function getDataDir(): string {
|
||||
export function getOpenCodeStorageDir(): string {
|
||||
return path.join(getDataDir(), "opencode", "storage")
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user-level cache directory.
|
||||
* Matches OpenCode's behavior via xdg-basedir:
|
||||
* - All platforms: XDG_CACHE_HOME or ~/.cache
|
||||
*/
|
||||
export function getCacheDir(): string {
|
||||
return process.env.XDG_CACHE_HOME ?? path.join(os.homedir(), ".cache")
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the oh-my-opencode cache directory.
|
||||
* All platforms: ~/.cache/oh-my-opencode
|
||||
*/
|
||||
export function getOmoOpenCodeCacheDir(): string {
|
||||
return path.join(getCacheDir(), "oh-my-opencode")
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the OpenCode cache directory (for reading OpenCode's cache).
|
||||
* All platforms: ~/.cache/opencode
|
||||
*/
|
||||
export function getOpenCodeCacheDir(): string {
|
||||
return path.join(getCacheDir(), "opencode")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user