Helper type to convert an array of tools (ClientTool | ServerTool)[] to a MessageToolSet. This maps each tool's name (as a literal type) to its MessageToolDefinition containing the input and output types.
ToolsToMessageToolSet: { [K in T[number]]: ExtractToolDefinition<K> }const myTool = tool(async (input: { a: number }) => 42, {
name: "myTool",
schema: z.object({ a: z.number() })
});
// Results in: { myTool: MessageToolDefinition<{ a: number }, number> }
type ToolSet = ToolsToMessageToolSet<readonly [typeof myTool]>;