refactor(opencode): bind instance bootstrap node (#34502)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
|
||||
import { makeGlobalNode } from "@opencode-ai/core/effect/app-node"
|
||||
import { Plugin } from "../plugin"
|
||||
import { Format } from "../format"
|
||||
import { LSP } from "@/lsp/lsp"
|
||||
@@ -62,7 +62,7 @@ export const defaultLayer: Layer.Layer<Service> = layer.pipe(
|
||||
]),
|
||||
)
|
||||
|
||||
export const node = LayerNode.make({
|
||||
export const node = makeGlobalNode({
|
||||
service: Service,
|
||||
layer: layer,
|
||||
deps: [Config.node, Format.node, LSP.node, Plugin.node, Project.node, ShareNext.node, Snapshot.node, Vcs.node],
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Effect, Layer } from "effect"
|
||||
import { InstanceStore } from "./instance-store"
|
||||
|
||||
export const layer = Layer.unwrap(
|
||||
Effect.promise(async () => {
|
||||
const { InstanceBootstrap } = await import("./bootstrap")
|
||||
return InstanceStore.defaultLayer.pipe(Layer.provide(InstanceBootstrap.defaultLayer))
|
||||
}),
|
||||
)
|
||||
|
||||
export * as InstanceLayer from "./instance-layer"
|
||||
@@ -1,4 +1,5 @@
|
||||
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
|
||||
import { makeGlobalNode, Node } from "@opencode-ai/core/effect/app-node"
|
||||
import { GlobalBus } from "@/bus/global"
|
||||
import { serviceUse } from "@opencode-ai/core/effect/service-use"
|
||||
import { WorkspaceContext } from "@/control-plane/workspace-context"
|
||||
@@ -8,7 +9,6 @@ import { FSUtil } from "@opencode-ai/core/fs-util"
|
||||
import { Context, Deferred, Duration, Effect, Exit, Layer, Scope } from "effect"
|
||||
import { type InstanceContext } from "./instance-context"
|
||||
import { InstanceBootstrap } from "./bootstrap-service"
|
||||
import { InstanceBootstrap as InstanceBootstrapGraph } from "./bootstrap"
|
||||
import * as Project from "./project"
|
||||
|
||||
export interface LoadInput {
|
||||
@@ -204,10 +204,12 @@ export const layer: Layer.Layer<Service, never, Project.Service | InstanceBootst
|
||||
|
||||
export const defaultLayer = layer.pipe(Layer.provide(Project.defaultLayer))
|
||||
|
||||
export const node = LayerNode.make({
|
||||
export const bootstrapNode = LayerNode.unbound(InstanceBootstrap.Service, Node.tags.values.global)
|
||||
|
||||
export const node = makeGlobalNode({
|
||||
service: Service,
|
||||
layer: layer,
|
||||
deps: [Project.node, InstanceBootstrapGraph.node],
|
||||
deps: [Project.node, bootstrapNode],
|
||||
})
|
||||
|
||||
export * as InstanceStore from "./instance-store"
|
||||
|
||||
Reference in New Issue
Block a user