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:
justsisyphus
2026-01-26 11:53:41 +09:00
committed by GitHub
parent da416b362b
commit 3a79b8761b
10 changed files with 747 additions and 67 deletions
+25
View File
@@ -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")
}