mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 14:22:27 +00:00
Replace env-paths with xdg-basedir for better XDG compliance and cross-platform directory handling
🤖 Generated with opencode Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
@@ -95,13 +95,18 @@ export namespace Provider {
|
||||
const s = await state()
|
||||
if (s.sdk.has(providerID)) return s.sdk.get(providerID)!
|
||||
|
||||
const dir = path.join(Global.cache(), `node_modules`, `@ai-sdk`, providerID)
|
||||
const dir = path.join(
|
||||
Global.Path.cache,
|
||||
`node_modules`,
|
||||
`@ai-sdk`,
|
||||
providerID,
|
||||
)
|
||||
if (!(await Bun.file(path.join(dir, "package.json")).exists())) {
|
||||
log.info("installing", {
|
||||
providerID,
|
||||
})
|
||||
BunProc.run(["add", `@ai-sdk/${providerID}@alpha`], {
|
||||
cwd: Global.cache(),
|
||||
cwd: Global.Path.cache,
|
||||
})
|
||||
}
|
||||
const mod = await import(path.join(dir))
|
||||
|
||||
Reference in New Issue
Block a user