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 TwitterUserSchema: z.ZodObject<{ id: z.ZodNullable; name: z.ZodNullable; userName: z.ZodNullable; description: z.ZodNullable; isVerified: z.ZodNullable; isBlueVerified: z.ZodNullable; profilePicture: z.ZodNullable; followers: z.ZodNullable; following: z.ZodNullable; tweetsCount: z.ZodNullable; url: z.ZodNullable; createdAt: z.ZodNullable; }, "strip", z.ZodTypeAny, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }>; declare const TwitterTweetSchema: z.ZodObject<{ id: z.ZodNullable; url: z.ZodNullable; text: z.ZodNullable; author: z.ZodNullable; name: z.ZodNullable; userName: z.ZodNullable; description: z.ZodNullable; isVerified: z.ZodNullable; isBlueVerified: z.ZodNullable; profilePicture: z.ZodNullable; followers: z.ZodNullable; following: z.ZodNullable; tweetsCount: z.ZodNullable; url: z.ZodNullable; createdAt: z.ZodNullable; }, "strip", z.ZodTypeAny, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }>>; createdAt: z.ZodNullable; stats: z.ZodNullable; replyCount: z.ZodNullable; likeCount: z.ZodNullable; quoteCount: z.ZodNullable; viewCount: z.ZodNullable; bookmarkCount: z.ZodNullable; }, "strip", z.ZodTypeAny, { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; }, { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; }>>; lang: z.ZodNullable; media: z.ZodNullable; url: z.ZodNullable; width: z.ZodNullable; height: z.ZodNullable; duration: z.ZodNullable; }, "strip", z.ZodTypeAny, { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }, { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }>, "many">>; entities: z.ZodNullable>; urls: z.ZodNullable>; mentions: z.ZodNullable>; }, "strip", z.ZodTypeAny, { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; }, { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; }>>; isRetweet: z.ZodNullable; isQuote: z.ZodNullable; isReply: z.ZodNullable; }, "strip", z.ZodTypeAny, { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }, { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }>; declare const TwitterToolParamsSchema: z.ZodObject<{ operation: z.ZodEnum<["scrapeProfile", "search", "scrapeUrl"]>; twitterHandles: z.ZodOptional>; searchTerms: z.ZodOptional>; startUrls: z.ZodOptional>; maxItems: z.ZodOptional>; sort: z.ZodOptional>; tweetLanguage: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "search" | "scrapeProfile" | "scrapeUrl"; sort?: "Top" | "Latest" | undefined; maxItems?: number | undefined; credentials?: Partial> | undefined; startUrls?: string[] | undefined; searchTerms?: string[] | undefined; twitterHandles?: string[] | undefined; tweetLanguage?: string | undefined; }, { operation: "search" | "scrapeProfile" | "scrapeUrl"; sort?: "Top" | "Latest" | undefined; maxItems?: number | undefined; credentials?: Partial> | undefined; startUrls?: string[] | undefined; searchTerms?: string[] | undefined; twitterHandles?: string[] | undefined; tweetLanguage?: string | undefined; }>; declare const TwitterToolResultSchema: z.ZodObject<{ operation: z.ZodEnum<["scrapeProfile", "search", "scrapeUrl"]>; tweets: z.ZodArray; url: z.ZodNullable; text: z.ZodNullable; author: z.ZodNullable; name: z.ZodNullable; userName: z.ZodNullable; description: z.ZodNullable; isVerified: z.ZodNullable; isBlueVerified: z.ZodNullable; profilePicture: z.ZodNullable; followers: z.ZodNullable; following: z.ZodNullable; tweetsCount: z.ZodNullable; url: z.ZodNullable; createdAt: z.ZodNullable; }, "strip", z.ZodTypeAny, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }>>; createdAt: z.ZodNullable; stats: z.ZodNullable; replyCount: z.ZodNullable; likeCount: z.ZodNullable; quoteCount: z.ZodNullable; viewCount: z.ZodNullable; bookmarkCount: z.ZodNullable; }, "strip", z.ZodTypeAny, { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; }, { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; }>>; lang: z.ZodNullable; media: z.ZodNullable; url: z.ZodNullable; width: z.ZodNullable; height: z.ZodNullable; duration: z.ZodNullable; }, "strip", z.ZodTypeAny, { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }, { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }>, "many">>; entities: z.ZodNullable>; urls: z.ZodNullable>; mentions: z.ZodNullable>; }, "strip", z.ZodTypeAny, { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; }, { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; }>>; isRetweet: z.ZodNullable; isQuote: z.ZodNullable; isReply: z.ZodNullable; }, "strip", z.ZodTypeAny, { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }, { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }>, "many">; totalTweets: z.ZodNumber; success: z.ZodBoolean; error: z.ZodString; }, "strip", z.ZodTypeAny, { error: string; success: boolean; operation: "search" | "scrapeProfile" | "scrapeUrl"; tweets: { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }[]; totalTweets: number; }, { error: string; success: boolean; operation: "search" | "scrapeProfile" | "scrapeUrl"; tweets: { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }[]; totalTweets: number; }>; type TwitterToolParams = z.output; type TwitterToolResult = z.output; type TwitterToolParamsInput = z.input; export type TwitterTweet = z.output; export type TwitterUser = z.output; export type TwitterOperationResult = Extract; /** * Generic Twitter/X scraping tool with unified interface * * This tool abstracts away the underlying scraping service (currently Apify) * and provides a simple, opinionated interface for Twitter data extraction. * * Supports three operations: * - scrapeProfile: Scrape user profiles and their tweets * - search: Search for tweets by keywords or hashtags * - scrapeUrl: Scrape specific Twitter URLs (tweets, profiles, searches, lists) * * Future versions can add support for other services (BrightData, custom scrapers) * while maintaining the same interface. */ export declare class TwitterTool extends ToolBubble { static readonly bubbleName: BubbleName; static readonly schema: z.ZodObject<{ operation: z.ZodEnum<["scrapeProfile", "search", "scrapeUrl"]>; twitterHandles: z.ZodOptional>; searchTerms: z.ZodOptional>; startUrls: z.ZodOptional>; maxItems: z.ZodOptional>; sort: z.ZodOptional>; tweetLanguage: z.ZodOptional; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { operation: "search" | "scrapeProfile" | "scrapeUrl"; sort?: "Top" | "Latest" | undefined; maxItems?: number | undefined; credentials?: Partial> | undefined; startUrls?: string[] | undefined; searchTerms?: string[] | undefined; twitterHandles?: string[] | undefined; tweetLanguage?: string | undefined; }, { operation: "search" | "scrapeProfile" | "scrapeUrl"; sort?: "Top" | "Latest" | undefined; maxItems?: number | undefined; credentials?: Partial> | undefined; startUrls?: string[] | undefined; searchTerms?: string[] | undefined; twitterHandles?: string[] | undefined; tweetLanguage?: string | undefined; }>; static readonly resultSchema: z.ZodObject<{ operation: z.ZodEnum<["scrapeProfile", "search", "scrapeUrl"]>; tweets: z.ZodArray; url: z.ZodNullable; text: z.ZodNullable; author: z.ZodNullable; name: z.ZodNullable; userName: z.ZodNullable; description: z.ZodNullable; isVerified: z.ZodNullable; isBlueVerified: z.ZodNullable; profilePicture: z.ZodNullable; followers: z.ZodNullable; following: z.ZodNullable; tweetsCount: z.ZodNullable; url: z.ZodNullable; createdAt: z.ZodNullable; }, "strip", z.ZodTypeAny, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }, { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; }>>; createdAt: z.ZodNullable; stats: z.ZodNullable; replyCount: z.ZodNullable; likeCount: z.ZodNullable; quoteCount: z.ZodNullable; viewCount: z.ZodNullable; bookmarkCount: z.ZodNullable; }, "strip", z.ZodTypeAny, { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; }, { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; }>>; lang: z.ZodNullable; media: z.ZodNullable; url: z.ZodNullable; width: z.ZodNullable; height: z.ZodNullable; duration: z.ZodNullable; }, "strip", z.ZodTypeAny, { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }, { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }>, "many">>; entities: z.ZodNullable>; urls: z.ZodNullable>; mentions: z.ZodNullable>; }, "strip", z.ZodTypeAny, { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; }, { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; }>>; isRetweet: z.ZodNullable; isQuote: z.ZodNullable; isReply: z.ZodNullable; }, "strip", z.ZodTypeAny, { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }, { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }>, "many">; totalTweets: z.ZodNumber; success: z.ZodBoolean; error: z.ZodString; }, "strip", z.ZodTypeAny, { error: string; success: boolean; operation: "search" | "scrapeProfile" | "scrapeUrl"; tweets: { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }[]; totalTweets: number; }, { error: string; success: boolean; operation: "search" | "scrapeProfile" | "scrapeUrl"; tweets: { stats: { viewCount: number | null; retweetCount: number | null; replyCount: number | null; likeCount: number | null; quoteCount: number | null; bookmarkCount: number | null; } | null; text: string | null; id: string | null; url: string | null; entities: { hashtags: string[] | null; mentions: string[] | null; urls: string[] | null; } | null; author: { description: string | null; name: string | null; id: string | null; url: string | null; following: number | null; userName: string | null; isVerified: boolean | null; isBlueVerified: boolean | null; profilePicture: string | null; followers: number | null; tweetsCount: number | null; createdAt: string | null; } | null; media: { duration: number | null; type: string | null; url: string | null; width: number | null; height: number | null; }[] | null; createdAt: string | null; lang: string | null; isRetweet: boolean | null; isQuote: boolean | null; isReply: boolean | null; }[]; totalTweets: number; }>; static readonly shortDescription = "Scrape Twitter/X profiles, tweets, and search results with a simple, unified interface."; static readonly longDescription = "\n Universal Twitter/X scraping tool that provides a simple, opinionated interface for extracting Twitter data.\n \n **OPERATIONS:**\n 1. **scrapeProfile**: Scrape user profiles and their tweets\n - Get tweets from specific user handles\n - Track influencer or brand accounts\n - Monitor user activity and engagement\n \n 2. **search**: Search for tweets by keywords or hashtags\n - Find tweets by search terms or hashtags\n - Monitor brand mentions and campaigns\n - Research trending topics and conversations\n - Supports advanced search syntax (see Twitter advanced search)\n \n 3. **scrapeUrl**: Scrape specific Twitter URLs\n - Scrape individual tweets, profiles, search results, or lists\n - Extract data from specific Twitter URLs\n - Useful for targeted data collection\n \n **WHEN TO USE THIS TOOL:**\n - **Any Twitter scraping task** - profiles, tweets, searches, engagement data\n - **Social media research** - influencer analysis, competitor monitoring\n - **Content gathering** - tweets, replies, retweets, engagement metrics\n - **Market research** - brand mentions, user sentiment on Twitter\n - **Trend analysis** - hashtag tracking, viral content discovery\n - **Real-time monitoring** - track conversations and mentions\n \n **DO NOT USE research-agent-tool or web-scrape-tool for Twitter** - This tool is specifically optimized for Twitter and provides:\n - Unified data format across all Twitter sources\n - Automatic service selection and optimization\n - Rate limiting and reliability handling\n - Clean, structured data ready for analysis\n \n **Simple Interface:**\n Just specify the operation and provide Twitter handles, search terms, or URLs to get back clean, structured data.\n The tool automatically handles:\n - Handle normalization (accepts handles with or without @)\n - Service selection (currently Apify, future: multiple sources)\n - Data transformation to unified format\n - Error handling and retries\n \n **What you get:**\n - Tweets with text, engagement stats, timestamps\n - Author information (for scrapeProfile operation)\n - Hashtags, mentions, and URLs\n - Media attachments\n - Language and metadata\n \n **Use cases:**\n - Influencer analysis and discovery\n - Brand monitoring and sentiment analysis\n - Competitor research on Twitter\n - Content strategy and trend analysis\n - Market research through Twitter data\n - Campaign performance tracking\n - Hashtag research and optimization\n - Real-time event monitoring\n \n The tool uses best-available services behind the scenes while maintaining a consistent, simple interface.\n "; static readonly alias = "twitter"; static readonly type = "tool"; constructor(params?: TwitterToolParamsInput, context?: BubbleContext); performAction(): Promise; /** * Create an error result */ private createErrorResult; /** * Handle scrapeProfile operation */ private handleScrapeProfile; /** * Handle search operation */ private handleSearch; /** * Handle scrapeUrl operation */ private handleScrapeUrl; /** * Scrape profiles using Apify service * This is the current implementation - future versions could add other services */ private scrapeWithApifyProfiles; /** * Search tweets using Apify service * This is the current implementation - future versions could add other services */ private scrapeWithApifySearch; /** * Scrape URLs using Apify service * This is the current implementation - future versions could add other services */ private scrapeWithApifyUrls; /** * Normalize Twitter handles (remove @ if present) */ private normalizeHandles; private transformTweets; } export {}; //# sourceMappingURL=twitter-tool.d.ts.map