fix(opencode): keep plugin pty environment route local
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
export * as PluginPtyEnvironment from "./pty-environment"
|
||||
|
||||
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
|
||||
import { PtyEnvironment } from "@opencode-ai/server/pty-environment"
|
||||
import { Effect, Layer } from "effect"
|
||||
import { InstanceStore } from "@/project/instance-store"
|
||||
import { Plugin } from "."
|
||||
|
||||
const layer = Layer.effect(
|
||||
export const layer = Layer.effect(
|
||||
PtyEnvironment.Service,
|
||||
Effect.gen(function* () {
|
||||
const plugin = yield* Plugin.Service
|
||||
@@ -23,5 +22,3 @@ const layer = Layer.effect(
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
export const node = LayerNode.make({ service: PtyEnvironment.Service, layer, deps: [Plugin.node, InstanceStore.node] })
|
||||
|
||||
@@ -102,7 +102,6 @@ import { handlers } from "@opencode-ai/server/handlers"
|
||||
import { locationServiceMapLayer } from "@opencode-ai/core/location-services"
|
||||
import { layer as locationLayer } from "@opencode-ai/server/location"
|
||||
import { sessionLocationLayer } from "@opencode-ai/server/middleware/session-location"
|
||||
import { PtyEnvironment } from "@opencode-ai/server/pty-environment"
|
||||
import { schemaErrorLayer as v2SchemaErrorLayer } from "@opencode-ai/server/middleware/schema-error"
|
||||
import { workspaceHandlers } from "./handlers/workspace"
|
||||
import { instanceContextLayer } from "./middleware/instance-context"
|
||||
@@ -175,6 +174,7 @@ const instanceRoutes = instanceApiRoutes.pipe(
|
||||
)
|
||||
const serverRoutes = HttpApiBuilder.layer(Api).pipe(
|
||||
Layer.provide(handlers),
|
||||
Layer.provide(PluginPtyEnvironment.layer),
|
||||
Layer.provide([serverHttpApiAuthLayer, v2SchemaErrorLayer]),
|
||||
)
|
||||
|
||||
@@ -264,7 +264,6 @@ const app = LayerNode.group([
|
||||
ProjectV2.node,
|
||||
ProjectCopy.node,
|
||||
PtyTicket.node,
|
||||
PluginPtyEnvironment.node,
|
||||
])
|
||||
|
||||
export function createRoutes(
|
||||
@@ -293,7 +292,6 @@ export function createRoutes(
|
||||
|
||||
Layer.provide(sessionLocationLayer),
|
||||
Layer.provide(locationLayer),
|
||||
Layer.provide(PtyEnvironment.layer),
|
||||
Layer.provide(
|
||||
SessionV2.defaultLayer.pipe(
|
||||
Layer.provide(SessionExecutionLocal.defaultLayer),
|
||||
|
||||
Reference in New Issue
Block a user