mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-23 10:45:33 -04:00
cd3cca0006
Co-authored-by: Aiden Cline <rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import { Effect, Layer } from "effect"
|
|
import { Config } from "@opencode-ai/core/config"
|
|
import { Location } from "@opencode-ai/core/location"
|
|
import { MCP } from "@opencode-ai/core/mcp/index"
|
|
import { AbsolutePath } from "@opencode-ai/core/schema"
|
|
import { location } from "./location"
|
|
|
|
export const emptyMcpLayer = Layer.succeed(
|
|
MCP.Service,
|
|
MCP.Service.of({
|
|
servers: () => Effect.succeed([]),
|
|
add: () => Effect.die("unused mcp.add"),
|
|
connect: () => Effect.die("unused mcp.connect"),
|
|
disconnect: () => Effect.die("unused mcp.disconnect"),
|
|
remove: () => Effect.die("unused mcp.remove"),
|
|
tools: () => Effect.succeed([]),
|
|
callTool: () => Effect.die("unused mcp.callTool"),
|
|
instructions: () => Effect.succeed([]),
|
|
prompts: () => Effect.succeed([]),
|
|
prompt: () => Effect.succeed(undefined),
|
|
resourceCatalog: () => Effect.succeed(MCP.ResourceCatalog.make({ resources: [], templates: [] })),
|
|
readResource: () => Effect.succeed(undefined),
|
|
}),
|
|
)
|
|
|
|
export const emptyConfigLayer = Layer.succeed(Config.Service, Config.Service.of({ entries: () => Effect.succeed([]) }))
|
|
|
|
export const testLocationLayer = Layer.succeed(
|
|
Location.Service,
|
|
Location.Service.of(location({ directory: AbsolutePath.make(process.cwd()) })),
|
|
)
|