@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 18 lines 780 Bytes
Raw
1 import * as Effect from "effect/Effect";
2
3 import * as McpInvocationContext from "../../McpInvocationContext.ts";
4 import * as McpToolAccess from "../../McpToolAccess.ts";
5 import * as McpToolExposure from "../../McpToolExposure.ts";
6 import { ToolSearchToolkit } from "./tools.ts";
7
8 export const layer = McpToolAccess.toLayer(ToolSearchToolkit, {
9 tool_search: McpToolAccess.readsAsCaller(({ query }) =>
10 Effect.gen(function* () {
11 const { thread } = yield* McpInvocationContext.McpInvocationContext.pipe(
12 Effect.flatMap((scope) => McpInvocationContext.requireThreadScope(scope, "tool_search")),
13 );
14 const exposure = yield* McpToolExposure.McpToolExposure;
15 return { tools: yield* exposure.search(thread.providerSessionId, query) };
16 }),
17 ),
18 });