fix(core): isolate location layer instances
This commit is contained in:
parent
aa86a20b1d
commit
0269d6f5de
4 changed files with 65 additions and 9 deletions
|
|
@ -2,18 +2,16 @@ import { Layer, LayerMap } from "effect"
|
|||
import { Location } from "./location"
|
||||
import { Catalog } from "./catalog"
|
||||
import { PluginBoot } from "./plugin/boot"
|
||||
import { Policy } from "./policy"
|
||||
import { Config } from "./config"
|
||||
import { AgentV2 } from "./agent"
|
||||
|
||||
export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("@opencode/example/LocationServiceMap", {
|
||||
lookup: (ref: Location.Ref) => {
|
||||
const result = Layer.mergeAll(
|
||||
Catalog.defaultLayer,
|
||||
PluginBoot.defaultLayer,
|
||||
Config.defaultLayer,
|
||||
AgentV2.defaultLayer,
|
||||
).pipe(Layer.provideMerge(Policy.defaultLayer), Layer.provideMerge(Location.defaultLayer(ref)))
|
||||
const result = Layer.fresh(
|
||||
Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer, Config.defaultLayer, AgentV2.defaultLayer).pipe(
|
||||
Layer.provideMerge(Location.defaultLayer(ref)),
|
||||
),
|
||||
)
|
||||
return result
|
||||
},
|
||||
idleTimeToLive: "60 minutes",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue