mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-17 12:42:17 +00:00
12 lines
539 B
TypeScript
12 lines
539 B
TypeScript
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",
|
|
}) {}
|