import type { Tool } from './tool'; /** * A tool that is guaranteed to expose an execute function. */ export type ExecutableTool = TOOL & { execute: NonNullable; }; /** * Checks whether a tool exposes an execute function. */ export function isExecutableTool( tool: TOOL | undefined, ): tool is ExecutableTool { return tool != null && typeof tool.execute === 'function'; }