2026-05-15 08:50:23 +08:00
|
|
|
import { Layer, LayerMap } from "effect"
|
|
|
|
|
import { Location } from "./location"
|
|
|
|
|
import { Catalog } from "./catalog"
|
|
|
|
|
import { PluginBoot } from "./plugin/boot"
|
2026-05-30 12:06:08 +08:00
|
|
|
import { Policy } from "./policy"
|
|
|
|
|
import { Config } from "./config"
|
2026-05-31 07:40:30 +08:00
|
|
|
import { AgentV2 } from "./agent"
|
2026-05-15 08:50:23 +08:00
|
|
|
|
|
|
|
|
export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("@opencode/example/LocationServiceMap", {
|
2026-05-30 12:06:08 +08:00
|
|
|
lookup: (ref: Location.Ref) => {
|
2026-05-31 07:40:30 +08:00
|
|
|
const result = Layer.mergeAll(
|
|
|
|
|
Catalog.defaultLayer,
|
|
|
|
|
PluginBoot.defaultLayer,
|
|
|
|
|
Config.defaultLayer,
|
|
|
|
|
AgentV2.defaultLayer,
|
|
|
|
|
).pipe(Layer.provideMerge(Policy.defaultLayer), Layer.provideMerge(Location.defaultLayer(ref)))
|
2026-05-30 12:06:08 +08:00
|
|
|
return result
|
|
|
|
|
},
|
|
|
|
|
idleTimeToLive: "60 minutes",
|
2026-05-21 08:53:27 +08:00
|
|
|
dependencies: [],
|
2026-05-15 08:50:23 +08:00
|
|
|
}) {}
|