import * as react_jsx_runtime from 'react/jsx-runtime';

/**
 * A client-side tool handler — receives the AI's tool call args and returns a result.
 * The result is sent back to the model so it can continue the conversation.
 */
type PageAIClientTool = (args: any) => Promise<{
    success: boolean;
    message?: string;
}>;
/**
 * Configuration registered by a page to provide AI context and capabilities.
 * Any component in the tree can call useRegisterPageAIContext with this config.
 */
interface PageAIContextConfig {
    /**
     * Identifier for the current route/page (e.g. "blog-post", "ui-builder-edit-page").
     * Shown as a badge in the chat header.
     */
    routeName: string;
    /**
     * Human-readable description of the current page and its content.
     * Injected into the AI system prompt so it understands what the user is looking at.
     * Capped at 8,000 characters server-side.
     */
    pageDescription: string;
    /**
     * Optional suggested prompts shown as quick-action chips in the chat empty state.
     * These augment (not replace) any static suggestions configured in plugin overrides.
     */
    suggestions?: string[];
    /**
     * Client-side tool handlers keyed by tool name.
     * When the AI calls a tool by this name, the handler is invoked with the tool args.
     * The result is sent back to the model via addToolResult.
     *
     * Tool schemas must be registered server-side via enablePageTools + clientToolSchemas
     * in aiChatBackendPlugin (built-in tools like fillBlogForm are pre-registered).
     */
    clientTools?: Record<string, PageAIClientTool>;
}
/**
 * Provider that enables route-aware AI context across the app.
 *
 * Place this at the root layout — above all StackProviders — so it spans
 * both your main app tree and any chat modals rendered as parallel/intercept routes.
 *
 * @example
 * // app/layout.tsx
 * import { PageAIContextProvider } from "@btst/stack/plugins/ai-chat/client/context"
 *
 * export default function RootLayout({ children }) {
 *   return <PageAIContextProvider>{children}</PageAIContextProvider>
 * }
 */
declare function PageAIContextProvider({ children, }: {
    children: React.ReactNode;
}): react_jsx_runtime.JSX.Element;
/**
 * Register page AI context from any component.
 * The registration is cleaned up automatically when the component unmounts.
 *
 * Pass `null` to conditionally disable context (e.g. while data is loading).
 *
 * @example
 * // Blog post page
 * useRegisterPageAIContext(post ? {
 *   routeName: "blog-post",
 *   pageDescription: `Blog post: "${post.title}"\n\n${post.content?.slice(0, 16000)}`,
 *   suggestions: ["Summarize this post", "What are the key takeaways?"],
 * } : null)
 */
declare function useRegisterPageAIContext(config: PageAIContextConfig | null): void;
/**
 * Read the currently active page AI context.
 * Returns null when no page has registered context, or when PageAIContextProvider
 * is not in the tree.
 *
 * Used internally by ChatInterface to inject context into requests.
 */
declare function usePageAIContext(): PageAIContextConfig | null;

export { PageAIContextProvider, usePageAIContext, useRegisterPageAIContext };
export type { PageAIClientTool, PageAIContextConfig };
