import type { FlexibleSchema } from './schema';
import type { Context } from './types/context';
import { tool, type ProviderExecutedTool, type Tool } from './types/tool';
/**
* A provider-executed tool is a tool for which the provider executes the tool.
*/
export type ProviderExecutedToolFactory<
INPUT,
OUTPUT,
ARGS extends object,
CONTEXT extends Context = {},
> = (
options: ARGS & {
onInputStart?: Tool['onInputStart'];
onInputDelta?: Tool['onInputDelta'];
onInputAvailable?: Tool['onInputAvailable'];
},
) => ProviderExecutedTool;
export function createProviderExecutedToolFactory<
INPUT,
OUTPUT,
ARGS extends object,
CONTEXT extends Context = {},
>({
id,
inputSchema,
outputSchema,
supportsDeferredResults,
}: {
id: `${string}.${string}`;
inputSchema: FlexibleSchema;
outputSchema: FlexibleSchema