fix issue with provider cache

This commit is contained in:
Dax Raad
2025-06-18 10:56:23 -04:00
parent 8f852b396f
commit b8bbee4718

View File

@@ -232,8 +232,8 @@ export namespace Provider {
const s = await state()
const existing = s.sdk.get(provider.id)
if (existing) return existing
const [pkg, version] = provider.npm ?? provider.id
const mod = await import(await BunProc.install(pkg, version))
const pkg = provider.npm ?? provider.id
const mod = await import(await BunProc.install(pkg, "latest"))
const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!]
const loaded = fn(s.providers[provider.id]?.options)
s.sdk.set(provider.id, loaded)