refactor(core): move models.dev into core (#27347)
This commit is contained in:
parent
9818c9e8d0
commit
16c457e712
68 changed files with 345 additions and 153 deletions
12
packages/core/src/instance-layer.ts
Normal file
12
packages/core/src/instance-layer.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { Layer, LayerMap } from "effect"
|
||||
import { Instance } from "./instance"
|
||||
import { Catalog } from "./catalog"
|
||||
import { PluginBoot } from "./plugin/boot"
|
||||
|
||||
export class InstanceServiceMap extends LayerMap.Service<InstanceServiceMap>()("@opencode/example/InstanceServiceMap", {
|
||||
lookup: (ref: Instance.Ref) => {
|
||||
const instance = Layer.succeed(Instance.Service, Instance.Service.of(ref))
|
||||
return Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer).pipe(Layer.provide(instance))
|
||||
},
|
||||
idleTimeToLive: "5 minutes",
|
||||
}) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue