import { z } from "zod/v4" export type ToolContext = { sessionID: string messageID: string agent: string abort: AbortSignal } export function tool( input: (zod: typeof z) => { description: string args: Args execute: (args: z.infer>, ctx: ToolContext) => Promise }, ) { return input(z) } export type ToolDefinition = ReturnType