refactor(opencode): bind instance bootstrap node (#34502)
This commit is contained in:
parent
9151af7045
commit
7a035d7fc0
26 changed files with 82 additions and 57 deletions
|
|
@ -9,6 +9,7 @@ import { HttpClient, HttpClientRequest, HttpClientResponse, HttpRouter, HttpServ
|
|||
import { layerWebSocketConstructorGlobal } from "effect/unstable/socket/Socket"
|
||||
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
|
||||
import { Flag } from "@opencode-ai/core/flag/flag"
|
||||
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
|
||||
import { Ripgrep } from "@opencode-ai/core/ripgrep"
|
||||
import { registerAdapter } from "../../src/control-plane/adapters"
|
||||
import type { WorkspaceAdapter } from "../../src/control-plane/types"
|
||||
|
|
@ -38,14 +39,14 @@ import { pollWithTimeout, testEffect } from "../lib/effect"
|
|||
|
||||
const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES
|
||||
const workspaceLayer = Workspace.defaultLayer.pipe(
|
||||
Layer.provide(InstanceStore.defaultLayer),
|
||||
Layer.provide(InstanceBootstrap.defaultLayer),
|
||||
Layer.provide(LayerNode.compile(InstanceStore.node, [[InstanceStore.bootstrapNode, InstanceBootstrap.node]])),
|
||||
)
|
||||
const instanceStoreLayer = InstanceStore.defaultLayer.pipe(
|
||||
Layer.provide(
|
||||
const instanceStoreLayer = LayerNode.compile(InstanceStore.node, [
|
||||
[
|
||||
InstanceStore.bootstrapNode,
|
||||
Layer.succeed(InstanceBootstrapService.Service, InstanceBootstrapService.Service.of({ run: Effect.void })),
|
||||
),
|
||||
)
|
||||
],
|
||||
])
|
||||
const servedRoutes: Layer.Layer<never, Config.ConfigError, HttpServer.HttpServer> = HttpRouter.serve(
|
||||
HttpApiApp.routes,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue