refactor(core): support tiered layer nodes (#33937)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect } from "bun:test"
|
||||
import { Effect, Exit, Layer, Option } from "effect"
|
||||
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
|
||||
import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
|
||||
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
|
||||
import { httpClient } from "@opencode-ai/core/effect/layer-node-platform"
|
||||
import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
|
||||
@@ -35,7 +35,7 @@ const none = HttpClient.make(() => Effect.die("unexpected http call"))
|
||||
|
||||
function requestLayer(client: HttpClient.HttpClient) {
|
||||
return LayerNode.buildLayer(LayerNode.group([ShareNext.node, AccountRepo.node]), {
|
||||
replacements: [LayerNode.replace(httpClient, Layer.succeed(HttpClient.HttpClient, client))],
|
||||
replacements: [LayerNode.replace(FetchHttpClient.layer, Layer.succeed(HttpClient.HttpClient, client))],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -49,9 +49,7 @@ function integrationLayer(client: HttpClient.HttpClient) {
|
||||
AccountRepo.node,
|
||||
Database.node,
|
||||
]),
|
||||
{
|
||||
replacements: [LayerNode.replace(httpClient, Layer.succeed(HttpClient.HttpClient, client))],
|
||||
},
|
||||
{ replacements: [LayerNode.replace(FetchHttpClient.layer, Layer.succeed(HttpClient.HttpClient, client))] },
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user