refactor(core): separate out location node functionality and integrate into v2 (#34119)
This commit is contained in:
@@ -4,6 +4,7 @@ import fs from "fs/promises"
|
||||
import { fileURLToPath, pathToFileURL } from "url"
|
||||
import { Effect, Layer, Result, Schema } from "effect"
|
||||
import { LayerNode } from "@opencode-ai/core/effect/layer-node"
|
||||
import { LayerNodeTree } from "@opencode-ai/core/effect/layer-node"
|
||||
import { ToolRegistry } from "@/tool/registry"
|
||||
import { Tool } from "@/tool/tool"
|
||||
import { disposeAllInstances, TestInstance } from "../fixture/fixture"
|
||||
@@ -54,11 +55,17 @@ const replacements = [
|
||||
LayerNode.replace(RuntimeFlags.defaultLayer, RuntimeFlags.layer()),
|
||||
]
|
||||
|
||||
const it = testEffect(LayerNode.buildLayer(root, { replacements }))
|
||||
const it = testEffect(LayerNodeTree.compile(root, new Map(replacements.map((item) => [item.source, item.replacement]))))
|
||||
const withBrokenPlugin = testEffect(
|
||||
LayerNode.buildLayer(root, {
|
||||
replacements: [...replacements, LayerNode.replace(Plugin.layer, brokenPluginLayer)],
|
||||
}),
|
||||
LayerNodeTree.compile(
|
||||
root,
|
||||
new Map(
|
||||
[...replacements, LayerNode.replace(Plugin.layer, brokenPluginLayer)].map((item) => [
|
||||
item.source,
|
||||
item.replacement,
|
||||
]),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in New Issue
Block a user