import { z } from 'zod'; import { ToolBubble } from '../../types/tool-bubble-class.js'; import type { BubbleContext } from '../../types/bubble.js'; import { CredentialType, type BubbleName } from '@bubblelab/shared-schemas'; declare const RedditPostSchema: z.ZodObject<{ title: z.ZodString; url: z.ZodString; author: z.ZodString; score: z.ZodNumber; numComments: z.ZodNumber; createdUtc: z.ZodNumber; postUrl: z.ZodString; selftext: z.ZodString; subreddit: z.ZodString; postHint: z.ZodOptional>; isSelf: z.ZodBoolean; thumbnail: z.ZodOptional; domain: z.ZodOptional; flair: z.ZodOptional; }, "strip", z.ZodTypeAny, { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }, { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }>; declare const RedditScrapeToolParamsSchema: z.ZodObject<{ subreddit: z.ZodPipeline, z.ZodString>; limit: z.ZodDefault; sort: z.ZodDefault>; timeFilter: z.ZodOptional>; filterToday: z.ZodDefault; includeStickied: z.ZodDefault; minScore: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { sort: "new" | "hot" | "top" | "rising"; limit: number; subreddit: string; filterToday: boolean; includeStickied: boolean; credentials?: Partial> | undefined; timeFilter?: "year" | "month" | "day" | "hour" | "all" | "week" | undefined; minScore?: number | undefined; }, { subreddit: string; sort?: "new" | "hot" | "top" | "rising" | undefined; credentials?: Partial> | undefined; limit?: number | undefined; timeFilter?: "year" | "month" | "day" | "hour" | "all" | "week" | undefined; filterToday?: boolean | undefined; includeStickied?: boolean | undefined; minScore?: number | undefined; }>; declare const RedditScrapeToolResultSchema: z.ZodObject<{ posts: z.ZodArray>; isSelf: z.ZodBoolean; thumbnail: z.ZodOptional; domain: z.ZodOptional; flair: z.ZodOptional; }, "strip", z.ZodTypeAny, { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }, { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }>, "many">; metadata: z.ZodObject<{ subreddit: z.ZodString; requestedLimit: z.ZodNumber; actualCount: z.ZodNumber; filteredCount: z.ZodNumber; sort: z.ZodString; timeFilter: z.ZodOptional; scrapedAt: z.ZodString; apiEndpoint: z.ZodString; }, "strip", z.ZodTypeAny, { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }, { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }>; success: z.ZodBoolean; error: z.ZodString; }, "strip", z.ZodTypeAny, { error: string; success: boolean; metadata: { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }; posts: { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }[]; }, { error: string; success: boolean; metadata: { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }; posts: { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }[]; }>; type RedditScrapeToolParams = z.output; type RedditScrapeToolResult = z.output; type RedditScrapeToolParamsInput = z.input; type RedditPost = z.output; export declare class RedditScrapeTool extends ToolBubble { static readonly bubbleName: BubbleName; static readonly schema: z.ZodObject<{ subreddit: z.ZodPipeline, z.ZodString>; limit: z.ZodDefault; sort: z.ZodDefault>; timeFilter: z.ZodOptional>; filterToday: z.ZodDefault; includeStickied: z.ZodDefault; minScore: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { sort: "new" | "hot" | "top" | "rising"; limit: number; subreddit: string; filterToday: boolean; includeStickied: boolean; credentials?: Partial> | undefined; timeFilter?: "year" | "month" | "day" | "hour" | "all" | "week" | undefined; minScore?: number | undefined; }, { subreddit: string; sort?: "new" | "hot" | "top" | "rising" | undefined; credentials?: Partial> | undefined; limit?: number | undefined; timeFilter?: "year" | "month" | "day" | "hour" | "all" | "week" | undefined; filterToday?: boolean | undefined; includeStickied?: boolean | undefined; minScore?: number | undefined; }>; static readonly resultSchema: z.ZodObject<{ posts: z.ZodArray>; isSelf: z.ZodBoolean; thumbnail: z.ZodOptional; domain: z.ZodOptional; flair: z.ZodOptional; }, "strip", z.ZodTypeAny, { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }, { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }>, "many">; metadata: z.ZodObject<{ subreddit: z.ZodString; requestedLimit: z.ZodNumber; actualCount: z.ZodNumber; filteredCount: z.ZodNumber; sort: z.ZodString; timeFilter: z.ZodOptional; scrapedAt: z.ZodString; apiEndpoint: z.ZodString; }, "strip", z.ZodTypeAny, { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }, { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }>; success: z.ZodBoolean; error: z.ZodString; }, "strip", z.ZodTypeAny, { error: string; success: boolean; metadata: { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }; posts: { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }[]; }, { error: string; success: boolean; metadata: { sort: string; scrapedAt: string; subreddit: string; requestedLimit: number; actualCount: number; filteredCount: number; apiEndpoint: string; timeFilter?: string | undefined; }; posts: { title: string; url: string; score: number; author: string; numComments: number; createdUtc: number; postUrl: string; selftext: string; subreddit: string; isSelf: boolean; thumbnail?: string | undefined; domain?: string | undefined; postHint?: string | null | undefined; flair?: string | undefined; }[]; }>; static readonly shortDescription = "Scrapes posts from any Reddit subreddit with flexible filtering and sorting options"; static readonly longDescription = "\n A specialized tool for scraping Reddit posts from any subreddit with comprehensive filtering and sorting capabilities.\n \n \uD83D\uDD25 Core Features:\n - Scrape posts from any public subreddit\n - Multiple sorting options (hot, new, top, rising)\n - Flexible post limits (1-1000 posts with pagination)\n - Time-based filtering for top posts\n - Today-only filtering option\n - Score-based filtering\n - Stickied post inclusion/exclusion\n \n \uD83D\uDCCA Post Data Extracted:\n - Title, author, and content\n - Upvote scores and comment counts\n - Creation timestamps and permalinks\n - Post types (text vs link posts)\n - External URLs and domains\n - Thumbnails and flairs\n - Comprehensive metadata\n \n \uD83C\uDFAF Use Cases:\n - Monitor specific subreddits for trends\n - Gather posts for content analysis\n - Track community engagement metrics\n - Feed Reddit data into other workflows\n - Research subreddit activity patterns\n - Content aggregation and curation\n \n \u26A1 Technical Features:\n - Uses Reddit's official JSON API\n - No authentication required for public posts\n - Respects Reddit's rate limiting\n - Handles large subreddits efficiently\n - Robust error handling and validation\n - Clean, structured data output\n \n Perfect for integration with AI agents, data analysis workflows, and content monitoring systems.\n "; static readonly alias = "reddit"; static readonly type = "tool"; constructor(params?: RedditScrapeToolParamsInput, context?: BubbleContext); performAction(context?: BubbleContext): Promise; /** * Build the Reddit JSON API URL with optional pagination */ private buildRedditApiUrl; /** * Fetch posts with pagination support (up to 1000 posts) * Makes multiple requests if needed, using the 'after' parameter for pagination */ private fetchPostsWithPagination; /** * Get a random user agent to avoid being blocked */ private getRandomUserAgent; /** * Fetch data from Reddit's JSON API via HttpBubble (wall-clock timeout via AbortController). */ private fetchRedditData; /** * Parse Reddit JSON response into standardized post objects */ private parseRedditResponse; /** * Apply various filters to the posts */ private applyFilters; } export type { RedditPost, RedditScrapeToolParams, RedditScrapeToolResult }; //# sourceMappingURL=reddit-scrape-tool.d.ts.map