refactor(core): move models.dev into core (#27347)

This commit is contained in:
Dax 2026-05-13 20:58:24 -04:00 committed by GitHub
commit 16c457e712
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 345 additions and 153 deletions

View file

@ -5,6 +5,7 @@ import { produce, type Draft } from "immer"
import { ModelV2 } from "./model"
import { PluginV2 } from "./plugin"
import { ProviderV2 } from "./provider"
import { Instance } from "./instance"
type ProviderRecord = {
provider: ProviderV2.Info
@ -56,6 +57,7 @@ export class Service extends Context.Service<Service, Interface>()("@opencode/v2
export const layer = Layer.effect(
Service,
Effect.gen(function* () {
yield* Instance.Service
let records = HashMap.empty<ProviderV2.ID, ProviderRecord>()
let defaultModel: { providerID: ProviderV2.ID; modelID: ModelV2.ID } | undefined
const plugin = yield* PluginV2.Service