2026-05-15 08:50:23 +08:00
|
|
|
import { Layer, LayerMap } from "effect"
|
|
|
|
|
import { Location } from "./location"
|
2026-05-31 09:08:38 +08:00
|
|
|
import { Policy } from "./policy"
|
2026-05-30 12:06:08 +08:00
|
|
|
import { Config } from "./config"
|
2026-05-31 09:08:38 +08:00
|
|
|
import { PluginV2 } from "./plugin"
|
|
|
|
|
import { Catalog } from "./catalog"
|
2026-05-31 07:40:30 +08:00
|
|
|
import { AgentV2 } from "./agent"
|
2026-05-31 09:08:38 +08:00
|
|
|
import { PluginBoot } from "./plugin/boot"
|
|
|
|
|
import { Project } from "./project"
|
|
|
|
|
import { EventV2 } from "./event"
|
|
|
|
|
import { Auth } from "./auth"
|
|
|
|
|
import { Npm } from "./npm"
|
|
|
|
|
import { ModelsDev } from "./models-dev"
|
|
|
|
|
import { AppFileSystem } from "./filesystem"
|
|
|
|
|
import { Global } from "./global"
|
2026-06-02 09:32:50 +08:00
|
|
|
import { Database } from "./database/database"
|
|
|
|
|
import { PermissionV2 } from "./permission"
|
|
|
|
|
import { PermissionSaved } from "./permission/saved"
|
|
|
|
|
import { SessionV2 } from "./session"
|
2026-06-02 13:38:56 +08:00
|
|
|
import { LocationFileSystem } from "./location-filesystem"
|
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 09:08:38 +08:00
|
|
|
const location = Location.layer(ref)
|
|
|
|
|
return Layer.mergeAll(
|
|
|
|
|
location,
|
|
|
|
|
Policy.locationLayer,
|
|
|
|
|
Config.locationLayer,
|
|
|
|
|
PluginV2.locationLayer,
|
|
|
|
|
Catalog.locationLayer,
|
|
|
|
|
AgentV2.locationLayer,
|
|
|
|
|
PluginBoot.locationLayer,
|
2026-06-02 09:32:50 +08:00
|
|
|
PermissionV2.locationLayer,
|
2026-06-02 13:38:56 +08:00
|
|
|
LocationFileSystem.locationLayer,
|
2026-05-31 09:08:38 +08:00
|
|
|
).pipe(Layer.provideMerge(location), Layer.fresh)
|
2026-05-30 12:06:08 +08:00
|
|
|
},
|
|
|
|
|
idleTimeToLive: "60 minutes",
|
2026-05-31 09:08:38 +08:00
|
|
|
dependencies: [
|
|
|
|
|
Project.defaultLayer,
|
|
|
|
|
EventV2.defaultLayer,
|
|
|
|
|
Auth.defaultLayer,
|
|
|
|
|
Npm.defaultLayer,
|
|
|
|
|
ModelsDev.defaultLayer,
|
|
|
|
|
AppFileSystem.defaultLayer,
|
|
|
|
|
Global.defaultLayer,
|
2026-06-02 09:32:50 +08:00
|
|
|
Database.defaultLayer,
|
|
|
|
|
SessionV2.defaultLayer,
|
|
|
|
|
PermissionSaved.defaultLayer,
|
2026-05-31 09:08:38 +08:00
|
|
|
],
|
2026-05-15 08:50:23 +08:00
|
|
|
}) {}
|