chore: generate

This commit is contained in:
opencode-agent[bot]
2026-06-29 20:53:48 +00:00
parent fd213e6df6
commit 78235385dd
8 changed files with 11 additions and 39 deletions
+2 -1
View File
@@ -72,7 +72,8 @@ export function convertTool(mcpTool: MCPToolDef, client: Client, timeout?: numbe
.filter((text) => text.trim()) .filter((text) => text.trim())
.join("\n\n") || "MCP tool returned an error", .join("\n\n") || "MCP tool returned an error",
) )
if (result.content.length > 0 || result.structuredContent === undefined || result.structuredContent === null) return result if (result.content.length > 0 || result.structuredContent === undefined || result.structuredContent === null)
return result
return { return {
...result, ...result,
content: [{ type: "text" as const, text: JSON.stringify(result.structuredContent) }], content: [{ type: "text" as const, text: JSON.stringify(result.structuredContent) }],
@@ -44,5 +44,4 @@ describe("McpCatalog.convertTool", () => {
content: [{ type: "text", text: JSON.stringify(structuredContent) }], content: [{ type: "text", text: JSON.stringify(structuredContent) }],
}) })
}) })
}) })
@@ -44,14 +44,7 @@ const testStateLayer = Layer.effectDiscard(
const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true }) const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true })
const it = testEffect( const it = testEffect(Layer.mergeAll(testStateLayer, NodeHttpServer.layerTest, NodeServices.layer, workspaceLayer))
Layer.mergeAll(
testStateLayer,
NodeHttpServer.layerTest,
NodeServices.layer,
workspaceLayer,
),
)
const instanceContextTestLayer = Layer.mergeAll( const instanceContextTestLayer = Layer.mergeAll(
instanceContextLayer, instanceContextLayer,
@@ -49,14 +49,7 @@ const testStateLayer = Layer.effectDiscard(
const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true }) const workspaceLayer = workspaceLayerWithRuntimeFlags({ experimentalWorkspaces: true })
const it = testEffect( const it = testEffect(Layer.mergeAll(testStateLayer, NodeHttpServer.layerTest, NodeServices.layer, workspaceLayer))
Layer.mergeAll(
testStateLayer,
NodeHttpServer.layerTest,
NodeServices.layer,
workspaceLayer,
),
)
const instanceContextTestLayer = Layer.mergeAll( const instanceContextTestLayer = Layer.mergeAll(
instanceContextLayer, instanceContextLayer,
@@ -36,9 +36,7 @@ const appLayer = AppNodeBuilder.build(
LayerNode.group([FSUtil.node, CrossSpawnSpawner.node, InstanceStore.node, Database.node, SessionNs.node]), LayerNode.group([FSUtil.node, CrossSpawnSpawner.node, InstanceStore.node, Database.node, SessionNs.node]),
[[InstanceStore.bootstrapNode, noopBootstrapLayer]], [[InstanceStore.bootstrapNode, noopBootstrapLayer]],
) )
const it = testEffect( const it = testEffect(Layer.mergeAll(appLayer, httpApiLayer))
Layer.mergeAll(appLayer, httpApiLayer),
)
const original = { const original = {
OPENCODE_SERVER_PASSWORD: Flag.OPENCODE_SERVER_PASSWORD, OPENCODE_SERVER_PASSWORD: Flag.OPENCODE_SERVER_PASSWORD,
@@ -58,9 +58,7 @@ const httpApiLayer = servedRoutes.pipe(
Layer.provideMerge(NodeHttpServer.layerTest), Layer.provideMerge(NodeHttpServer.layerTest),
Layer.provideMerge(NodeServices.layer), Layer.provideMerge(NodeServices.layer),
) )
const it = testEffect( const it = testEffect(Layer.mergeAll(appLayer, httpApiLayer))
Layer.mergeAll(appLayer, httpApiLayer),
)
function pathFor(path: string, params: Record<string, string>) { function pathFor(path: string, params: Record<string, string>) {
return Object.entries(params).reduce((result, [key, value]) => result.replace(`:${key}`, value), path) return Object.entries(params).reduce((result, [key, value]) => result.replace(`:${key}`, value), path)
@@ -26,19 +26,10 @@ import { httpApiLayer, requestInDirectory } from "./httpapi-layer"
const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES const originalWorkspaces = Flag.OPENCODE_EXPERIMENTAL_WORKSPACES
const appLayer = AppNodeBuilder.build( const appLayer = AppNodeBuilder.build(
LayerNode.group([ LayerNode.group([Project.node, Session.node, Workspace.node, InstanceStore.node, Database.node, Ripgrep.node]),
Project.node,
Session.node,
Workspace.node,
InstanceStore.node,
Database.node,
Ripgrep.node,
]),
[[InstanceStore.bootstrapNode, InstanceBootstrap.node]], [[InstanceStore.bootstrapNode, InstanceBootstrap.node]],
) )
const it = testEffect( const it = testEffect(Layer.mergeAll(appLayer, httpApiLayer))
Layer.mergeAll(appLayer, httpApiLayer),
)
function request(path: string, directory: string, init: RequestInit = {}) { function request(path: string, directory: string, init: RequestInit = {}) {
return requestInDirectory(path, directory, init) return requestInDirectory(path, directory, init)
@@ -14,10 +14,9 @@ import { testEffect } from "../lib/effect"
import { RuntimeFlags } from "@/effect/runtime-flags" import { RuntimeFlags } from "@/effect/runtime-flags"
const layer = (experimentalWorkspaces: boolean) => const layer = (experimentalWorkspaces: boolean) =>
AppNodeBuilder.build( AppNodeBuilder.build(LayerNode.group([Database.node, SessionNs.node, SessionProjector.node]), [
LayerNode.group([Database.node, SessionNs.node, SessionProjector.node]), [RuntimeFlags.node, RuntimeFlags.layer({ experimentalWorkspaces })],
[[RuntimeFlags.node, RuntimeFlags.layer({ experimentalWorkspaces })]], ])
)
const it = testEffect(layer(false)) const it = testEffect(layer(false))
const itWorkspaces = testEffect(layer(true)) const itWorkspaces = testEffect(layer(true))