fix(core): isolate location layer instances
This commit is contained in:
@@ -317,4 +317,8 @@ export const layer = Layer.effect(
|
||||
|
||||
const SMALL_MODEL_RE = /\b(nano|flash|lite|mini|haiku|small|fast)\b/
|
||||
|
||||
export const defaultLayer = layer.pipe(Layer.provide(EventV2.defaultLayer), Layer.provide(PluginV2.defaultLayer))
|
||||
export const defaultLayer = layer.pipe(
|
||||
Layer.provide(EventV2.defaultLayer),
|
||||
Layer.provide(PluginV2.defaultLayer),
|
||||
Layer.provide(Policy.defaultLayer),
|
||||
)
|
||||
|
||||
@@ -200,4 +200,8 @@ export const layer = Layer.effect(
|
||||
}),
|
||||
)
|
||||
|
||||
export const defaultLayer = layer.pipe(Layer.provide(AppFileSystem.defaultLayer), Layer.provide(Global.defaultLayer))
|
||||
export const defaultLayer = layer.pipe(
|
||||
Layer.provide(AppFileSystem.defaultLayer),
|
||||
Layer.provide(Global.defaultLayer),
|
||||
Layer.provide(Policy.defaultLayer),
|
||||
)
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user