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 extends ToolBubble> { 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>; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "add_to_cart"; quantity: number; product_url: string; credentials?: Partial> | undefined; }, { operation: "add_to_cart"; product_url: string; credentials?: Partial> | undefined; quantity?: number | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"get_cart">; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "get_cart"; credentials?: Partial> | undefined; }, { operation: "get_cart"; credentials?: Partial> | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"checkout">; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "checkout"; credentials?: Partial> | undefined; }, { operation: "checkout"; credentials?: Partial> | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"search">; query: import("zod").ZodString; max_results: import("zod").ZodDefault>; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { query: string; operation: "search"; max_results: number; credentials?: Partial> | undefined; }, { query: string; operation: "search"; credentials?: Partial> | 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").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "get_product"; product_url: string; credentials?: Partial> | undefined; }, { operation: "get_product"; product_url: string; credentials?: Partial> | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"screenshot">; url: import("zod").ZodOptional; full_page: import("zod").ZodDefault>; credentials: import("zod").ZodOptional, import("zod").ZodString>>; }, "strip", import("zod").ZodTypeAny, { operation: "screenshot"; full_page: boolean; credentials?: Partial> | undefined; url?: string | undefined; }, { operation: "screenshot"; credentials?: Partial> | undefined; url?: 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; cart_count: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "add_to_cart"; message?: string | undefined; cart_count?: number | undefined; }, { error: string; success: boolean; operation: "add_to_cart"; message?: string | undefined; cart_count?: number | undefined; }>, import("zod").ZodObject<{ operation: import("zod").ZodLiteral<"get_cart">; success: import("zod").ZodBoolean; items: import("zod").ZodOptional; url: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { title: string; price: string; quantity: number; asin: string; image?: string | undefined; url?: string | undefined; }, { title: string; price: string; quantity: number; asin: string; image?: string | undefined; url?: string | undefined; }>, "many">>; subtotal: import("zod").ZodOptional; total_items: import("zod").ZodOptional; screenshot_url: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "get_cart"; items?: { title: string; price: string; quantity: number; asin: string; image?: string | undefined; url?: string | undefined; }[] | undefined; subtotal?: string | undefined; total_items?: number | undefined; screenshot_url?: string | undefined; }, { error: string; success: boolean; operation: "get_cart"; items?: { title: string; price: string; quantity: number; asin: string; image?: string | undefined; url?: 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; estimated_delivery: import("zod").ZodOptional; total: import("zod").ZodOptional; subtotal: import("zod").ZodOptional; shipping_cost: import("zod").ZodOptional; tax: import("zod").ZodOptional; shipping_address: import("zod").ZodOptional; payment_method: import("zod").ZodOptional; items: import("zod").ZodOptional; price: import("zod").ZodOptional; }, "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; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "checkout"; 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; }, { error: string; success: boolean; operation: "checkout"; 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; rating: import("zod").ZodOptional; reviews_count: import("zod").ZodOptional; url: import("zod").ZodString; image: import("zod").ZodOptional; prime: import("zod").ZodOptional; }, "strip", import("zod").ZodTypeAny, { title: string; url: string; asin: string; image?: string | undefined; price?: string | undefined; rating?: string | undefined; reviews_count?: string | undefined; prime?: boolean | undefined; }, { title: string; url: string; asin: string; image?: string | undefined; price?: string | undefined; rating?: string | undefined; reviews_count?: string | undefined; prime?: boolean | undefined; }>, "many">>; total_results: import("zod").ZodOptional; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "search"; results?: { title: string; url: string; asin: string; image?: string | undefined; price?: string | undefined; rating?: string | undefined; reviews_count?: string | undefined; prime?: boolean | undefined; }[] | undefined; total_results?: number | undefined; }, { error: string; success: boolean; operation: "search"; results?: { title: string; url: string; asin: string; image?: string | undefined; price?: string | undefined; rating?: 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; rating: import("zod").ZodOptional; reviews_count: import("zod").ZodOptional; description: import("zod").ZodOptional; features: import("zod").ZodOptional>; availability: import("zod").ZodOptional; url: import("zod").ZodString; images: import("zod").ZodOptional>; }, "strip", import("zod").ZodTypeAny, { title: string; url: string; asin: string; description?: string | undefined; images?: string[] | undefined; price?: string | undefined; rating?: string | undefined; reviews_count?: string | undefined; features?: string[] | undefined; availability?: string | undefined; }, { title: string; url: string; asin: string; description?: string | undefined; images?: string[] | undefined; price?: string | undefined; rating?: string | undefined; reviews_count?: string | undefined; features?: string[] | undefined; availability?: string | undefined; }>>; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "get_product"; product?: { title: string; url: string; asin: string; description?: string | undefined; images?: string[] | undefined; price?: string | undefined; rating?: string | undefined; reviews_count?: string | undefined; features?: string[] | undefined; availability?: string | undefined; } | undefined; }, { error: string; success: boolean; operation: "get_product"; product?: { title: string; url: string; asin: string; description?: string | undefined; images?: string[] | undefined; price?: string | undefined; rating?: 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; error: import("zod").ZodString; }, "strip", import("zod").ZodTypeAny, { error: string; success: boolean; operation: "screenshot"; screenshot_url?: string | undefined; }, { error: string; success: boolean; operation: "screenshot"; 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>; /** * 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