import { ToolBubble } from '../../../types/tool-bubble-class.js';
import type { BubbleContext } from '../../../types/bubble.js';
import { CredentialType, type BubbleName } from '@bubblelab/shared-schemas';
import { type AmazonShoppingToolParamsInput, type AmazonShoppingToolResult } from './amazon-shopping-tool.schema.js';
/**
 * Amazon Shopping Tool
 *
 * A tool bubble for automating Amazon shopping operations including
 * adding items to cart, viewing cart, and completing checkout.
 *
 * This tool uses the BrowserBase service bubble internally to
 * manage browser sessions with authenticated Amazon credentials.
 *
 * Features:
 * - Add products to cart by URL or ASIN
 * - View current cart contents and totals
 * - Complete checkout with saved payment methods
 * - Search for products
 * - Get detailed product information
 *
 * Required Credentials:
 * - AMAZON_CRED: Browser session credential with Amazon cookies
 *
 * Security:
 * - Uses BrowserBase cloud browsers (isolated)
 * - Credentials are encrypted at rest
 * - Session data is not persisted beyond operation
 */
export declare class AmazonShoppingTool<T extends AmazonShoppingToolParamsInput = AmazonShoppingToolParamsInput> extends ToolBubble<T, Extract<AmazonShoppingToolResult, {
    operation: T['operation'];
}>> {
    static readonly bubbleName: BubbleName;
    static readonly schema: import("zod").ZodDiscriminatedUnion<"operation", [import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"add_to_cart">;
        product_url: import("zod").ZodString;
        quantity: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "add_to_cart";
        quantity: number;
        product_url: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "add_to_cart";
        product_url: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        quantity?: number | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_cart">;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "get_cart";
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "get_cart";
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"checkout">;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "checkout";
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "checkout";
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"search">;
        query: import("zod").ZodString;
        max_results: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodNumber>>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "search";
        query: string;
        max_results: number;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "search";
        query: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        max_results?: number | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_product">;
        product_url: import("zod").ZodString;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "get_product";
        product_url: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "get_product";
        product_url: string;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"screenshot">;
        url: import("zod").ZodOptional<import("zod").ZodString>;
        full_page: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
        credentials: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodNativeEnum<typeof CredentialType>, import("zod").ZodString>>;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "screenshot";
        full_page: boolean;
        url?: string | undefined;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
    }, {
        operation: "screenshot";
        url?: string | undefined;
        credentials?: Partial<Record<CredentialType, string>> | undefined;
        full_page?: boolean | undefined;
    }>]>;
    static readonly resultSchema: import("zod").ZodDiscriminatedUnion<"operation", [import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"add_to_cart">;
        success: import("zod").ZodBoolean;
        message: import("zod").ZodOptional<import("zod").ZodString>;
        cart_count: import("zod").ZodOptional<import("zod").ZodNumber>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "add_to_cart";
        success: boolean;
        error: string;
        message?: string | undefined;
        cart_count?: number | undefined;
    }, {
        operation: "add_to_cart";
        success: boolean;
        error: string;
        message?: string | undefined;
        cart_count?: number | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_cart">;
        success: import("zod").ZodBoolean;
        items: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            asin: import("zod").ZodString;
            title: import("zod").ZodString;
            price: import("zod").ZodString;
            quantity: import("zod").ZodNumber;
            image: import("zod").ZodOptional<import("zod").ZodString>;
            url: import("zod").ZodOptional<import("zod").ZodString>;
        }, "strip", import("zod").ZodTypeAny, {
            title: string;
            price: string;
            quantity: number;
            asin: string;
            url?: string | undefined;
            image?: string | undefined;
        }, {
            title: string;
            price: string;
            quantity: number;
            asin: string;
            url?: string | undefined;
            image?: string | undefined;
        }>, "many">>;
        subtotal: import("zod").ZodOptional<import("zod").ZodString>;
        total_items: import("zod").ZodOptional<import("zod").ZodNumber>;
        screenshot_url: import("zod").ZodOptional<import("zod").ZodString>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "get_cart";
        success: boolean;
        error: string;
        items?: {
            title: string;
            price: string;
            quantity: number;
            asin: string;
            url?: string | undefined;
            image?: string | undefined;
        }[] | undefined;
        subtotal?: string | undefined;
        total_items?: number | undefined;
        screenshot_url?: string | undefined;
    }, {
        operation: "get_cart";
        success: boolean;
        error: string;
        items?: {
            title: string;
            price: string;
            quantity: number;
            asin: string;
            url?: string | undefined;
            image?: string | undefined;
        }[] | undefined;
        subtotal?: string | undefined;
        total_items?: number | undefined;
        screenshot_url?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"checkout">;
        success: import("zod").ZodBoolean;
        order_number: import("zod").ZodOptional<import("zod").ZodString>;
        estimated_delivery: import("zod").ZodOptional<import("zod").ZodString>;
        total: import("zod").ZodOptional<import("zod").ZodString>;
        subtotal: import("zod").ZodOptional<import("zod").ZodString>;
        shipping_cost: import("zod").ZodOptional<import("zod").ZodString>;
        tax: import("zod").ZodOptional<import("zod").ZodString>;
        shipping_address: import("zod").ZodOptional<import("zod").ZodString>;
        payment_method: import("zod").ZodOptional<import("zod").ZodString>;
        items: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            title: import("zod").ZodString;
            quantity: import("zod").ZodOptional<import("zod").ZodNumber>;
            price: import("zod").ZodOptional<import("zod").ZodString>;
        }, "strip", import("zod").ZodTypeAny, {
            title: string;
            price?: string | undefined;
            quantity?: number | undefined;
        }, {
            title: string;
            price?: string | undefined;
            quantity?: number | undefined;
        }>, "many">>;
        screenshot_url: import("zod").ZodOptional<import("zod").ZodString>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "checkout";
        success: boolean;
        error: string;
        items?: {
            title: string;
            price?: string | undefined;
            quantity?: number | undefined;
        }[] | undefined;
        total?: string | undefined;
        subtotal?: string | undefined;
        screenshot_url?: string | undefined;
        order_number?: string | undefined;
        estimated_delivery?: string | undefined;
        shipping_cost?: string | undefined;
        tax?: string | undefined;
        shipping_address?: string | undefined;
        payment_method?: string | undefined;
    }, {
        operation: "checkout";
        success: boolean;
        error: string;
        items?: {
            title: string;
            price?: string | undefined;
            quantity?: number | undefined;
        }[] | undefined;
        total?: string | undefined;
        subtotal?: string | undefined;
        screenshot_url?: string | undefined;
        order_number?: string | undefined;
        estimated_delivery?: string | undefined;
        shipping_cost?: string | undefined;
        tax?: string | undefined;
        shipping_address?: string | undefined;
        payment_method?: string | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"search">;
        success: import("zod").ZodBoolean;
        results: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
            asin: import("zod").ZodString;
            title: import("zod").ZodString;
            price: import("zod").ZodOptional<import("zod").ZodString>;
            rating: import("zod").ZodOptional<import("zod").ZodString>;
            reviews_count: import("zod").ZodOptional<import("zod").ZodString>;
            url: import("zod").ZodString;
            image: import("zod").ZodOptional<import("zod").ZodString>;
            prime: import("zod").ZodOptional<import("zod").ZodBoolean>;
        }, "strip", import("zod").ZodTypeAny, {
            title: string;
            url: string;
            asin: string;
            image?: string | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            prime?: boolean | undefined;
        }, {
            title: string;
            url: string;
            asin: string;
            image?: string | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            prime?: boolean | undefined;
        }>, "many">>;
        total_results: import("zod").ZodOptional<import("zod").ZodNumber>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "search";
        success: boolean;
        error: string;
        results?: {
            title: string;
            url: string;
            asin: string;
            image?: string | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            prime?: boolean | undefined;
        }[] | undefined;
        total_results?: number | undefined;
    }, {
        operation: "search";
        success: boolean;
        error: string;
        results?: {
            title: string;
            url: string;
            asin: string;
            image?: string | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            prime?: boolean | undefined;
        }[] | undefined;
        total_results?: number | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"get_product">;
        success: import("zod").ZodBoolean;
        product: import("zod").ZodOptional<import("zod").ZodObject<{
            asin: import("zod").ZodString;
            title: import("zod").ZodString;
            price: import("zod").ZodOptional<import("zod").ZodString>;
            rating: import("zod").ZodOptional<import("zod").ZodString>;
            reviews_count: import("zod").ZodOptional<import("zod").ZodString>;
            description: import("zod").ZodOptional<import("zod").ZodString>;
            features: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
            availability: import("zod").ZodOptional<import("zod").ZodString>;
            url: import("zod").ZodString;
            images: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
        }, "strip", import("zod").ZodTypeAny, {
            title: string;
            url: string;
            asin: string;
            description?: string | undefined;
            images?: string[] | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            features?: string[] | undefined;
            availability?: string | undefined;
        }, {
            title: string;
            url: string;
            asin: string;
            description?: string | undefined;
            images?: string[] | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            features?: string[] | undefined;
            availability?: string | undefined;
        }>>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "get_product";
        success: boolean;
        error: string;
        product?: {
            title: string;
            url: string;
            asin: string;
            description?: string | undefined;
            images?: string[] | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            features?: string[] | undefined;
            availability?: string | undefined;
        } | undefined;
    }, {
        operation: "get_product";
        success: boolean;
        error: string;
        product?: {
            title: string;
            url: string;
            asin: string;
            description?: string | undefined;
            images?: string[] | undefined;
            rating?: string | undefined;
            price?: string | undefined;
            reviews_count?: string | undefined;
            features?: string[] | undefined;
            availability?: string | undefined;
        } | undefined;
    }>, import("zod").ZodObject<{
        operation: import("zod").ZodLiteral<"screenshot">;
        success: import("zod").ZodBoolean;
        screenshot_url: import("zod").ZodOptional<import("zod").ZodString>;
        error: import("zod").ZodString;
    }, "strip", import("zod").ZodTypeAny, {
        operation: "screenshot";
        success: boolean;
        error: string;
        screenshot_url?: string | undefined;
    }, {
        operation: "screenshot";
        success: boolean;
        error: string;
        screenshot_url?: string | undefined;
    }>]>;
    static readonly shortDescription = "Amazon shopping automation - add to cart, view cart, checkout, search products";
    static readonly longDescription = "\n    Amazon Shopping Tool for automating shopping operations.\n\n    Features:\n    - Add products to cart by URL or ASIN\n    - View current cart contents and totals\n    - Complete checkout with saved payment methods\n    - Search for products on Amazon\n    - Get detailed product information\n\n    Required Credentials:\n    - AMAZON_CRED: Browser session credential (authenticate via browser session)\n\n    Note: Checkout requires saved payment and shipping information in Amazon account.\n    The tool operates using authenticated browser sessions to ensure security.\n  ";
    static readonly alias = "amazon";
    static readonly type = "tool";
    private sessionId;
    private contextId;
    private cookies;
    constructor(params?: T, context?: BubbleContext);
    /**
     * Choose the credential to use for Amazon operations
     * Returns AMAZON_CRED which contains contextId and cookies
     */
    protected chooseCredential(): string | undefined;
    /**
     * Parse the AMAZON_CRED to extract contextId and cookies
     * Credential is base64-encoded JSON to avoid escaping issues
     */
    private parseBrowserSessionData;
    /**
     * Extract ASIN from Amazon URL or return as-is if already an ASIN
     */
    private extractAsin;
    /**
     * Build Amazon product URL from ASIN
     */
    private buildProductUrl;
    /**
     * Start a browser session using BrowserBase
     * Extracts contextId and cookies from AMAZON_CRED and passes them explicitly
     */
    private startBrowserSession;
    /**
     * End the browser session
     */
    private endBrowserSession;
    /**
     * Navigate to a URL
     */
    private navigateTo;
    /**
     * Click an element
     */
    private clickElement;
    /**
     * Evaluate JavaScript in page
     */
    private evaluate;
    /**
     * Wait for selector
     */
    private waitForSelector;
    /**
     * Wait for navigation to complete
     */
    private waitForNavigation;
    /**
     * Take a screenshot and upload to Cloudflare R2
     * Returns the URL of the uploaded screenshot
     */
    private takeScreenshotAndUpload;
    performAction(): Promise<Extract<AmazonShoppingToolResult, {
        operation: T['operation'];
    }>>;
    /**
     * Add a product to cart
     */
    private addToCart;
    /**
     * Get cart contents
     */
    private getCart;
    /**
     * Get current page URL
     */
    private getCurrentUrl;
    /**
     * Complete checkout - uses same heuristics as amazon-cart-browserbase.ts
     */
    private checkout;
    /**
     * Save current DOM state to file for debugging
     * Only saves when DEBUG env var is set
     */
    private saveDebugState;
    /**
     * Search for products
     */
    private searchProducts;
    /**
     * Get product details
     */
    private getProduct;
    /**
     * Take a screenshot operation - navigate to URL if provided, then capture screenshot
     */
    private takeScreenshot;
}
//# sourceMappingURL=amazon-shopping-tool.d.ts.map