import { Accessor } from "solid-js"; import { AnyClientTool, InferredClientContext, RegisterWebMCPToolsOptions, SubscribeWebMCPToolsOptions } from "@tanstack/ai-client"; //#region src/use-web-mcp-tools.d.ts /** Options for {@link useRegisterWebMCPTools}. */ type UseRegisterWebMCPToolsOptions, TContext = InferredClientContext> = Omit, 'signal'> & { /** Receives an asynchronous registration error. */ onError?: (error: unknown) => void; }; /** @deprecated Use `UseRegisterWebMCPToolsOptions`. Removed in 1.0.0. */ type UseWebMCPToolsOptions, TContext = InferredClientContext> = UseRegisterWebMCPToolsOptions; type UseRegisterWebMCPToolsArguments, TContext> = {} extends UseRegisterWebMCPToolsOptions ? [options?: UseRegisterWebMCPToolsOptions] : [options: UseRegisterWebMCPToolsOptions]; /** * Registers executable client tools with WebMCP for the current Solid owner. * * The owner cleanup removes every tool registered by this call. * * @param tools - The executable client tools to expose through WebMCP. * @param options - Runtime context, per-tool options, and error handling. * * @example * ```ts * useRegisterWebMCPTools([searchProducts]) * ``` */ declare function useRegisterWebMCPTools, TContext = InferredClientContext>(tools: TTools, ...[options]: UseRegisterWebMCPToolsArguments): void; /** * @deprecated Use `useRegisterWebMCPTools`. Removed in 1.0.0. * @alias */ declare const useWebMCPTools: typeof useRegisterWebMCPTools; /** Options for {@link usePageWebMCPTools}. */ type UsePageWebMCPToolsOptions = Omit; /** * Returns the WebMCP tools on the page as client tools for `useChat`. * * The accessor starts empty and updates when the page registers or removes a * tool. The owner cleanup stops the updates. Unsupported browsers and server * rendering keep an empty array. * * @param options - A filter that skips tools, and an error callback. * * @example * ```tsx * const pageTools = usePageWebMCPTools({ * filter: (tool) => tool.origin === location.origin, * }) * const chat = useChat({ * connection, * get tools() { * return pageTools() * }, * }) * ``` */ declare function usePageWebMCPTools(options?: UsePageWebMCPToolsOptions): Accessor>; //#endregion export { UsePageWebMCPToolsOptions, UseRegisterWebMCPToolsOptions, UseWebMCPToolsOptions, usePageWebMCPTools, useRegisterWebMCPTools, useWebMCPTools }; //# sourceMappingURL=use-web-mcp-tools.d.ts.map