feat(core): add location-scoped config loading

This commit is contained in:
Dax Raad
2026-05-27 16:27:46 -04:00
parent 5a5d981c4e
commit 9e556b0f6c
26 changed files with 727 additions and 195 deletions
+6 -4
View File
@@ -4,10 +4,12 @@ import { Catalog } from "./catalog"
import { PluginBoot } from "./plugin/boot"
export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("@opencode/example/LocationServiceMap", {
lookup: (ref: Location.Ref) =>
Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer).pipe(
Layer.provide([Layer.succeed(Location.Service, Location.Service.of(ref))]),
),
lookup: (ref: Location.Ref) => {
const result = Layer.mergeAll(Catalog.defaultLayer, PluginBoot.defaultLayer).pipe(
Layer.provideMerge(Location.defaultLayer(ref)),
)
return result
},
idleTimeToLive: "5 minutes",
dependencies: [],
}) {}