{"version":3,"file":"search.mjs","names":[],"sources":["../../src/actions/search.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const ExaSearchInput: z.ZodTypeAny = z.object({\n  type: z.enum([\"auto\", \"fast\", \"instant\", \"deep-lite\", \"deep\", \"deep-reasoning\"]).default(\"auto\").describe(\"Types of search available in Exa.\").optional(),\n  query: z.string().describe(\"The search query string.\"),\n  category: z.enum([\"company\", \"people\", \"research paper\", \"news\", \"personal site\", \"financial report\"]).describe(\"Data categories for focused search in Exa.\").optional(),\n  contents: z.object({\n  text: z.union([z.boolean(), z.object({\n  verbosity: z.enum([\"compact\", \"standard\", \"full\"]).nullable().optional(),\n  maxCharacters: z.number().int().nullable().optional(),\n  excludeSections: z.array(z.enum([\"header\", \"navigation\", \"banner\", \"body\", \"sidebar\", \"footer\", \"metadata\"])).nullable().optional(),\n  includeHtmlTags: z.boolean().nullable().optional(),\n  includeSections: z.array(z.enum([\"header\", \"navigation\", \"banner\", \"body\", \"sidebar\", \"footer\", \"metadata\"])).nullable().optional(),\n}).describe(\"Options for text content extraction.\")]).optional(),\n  extras: z.object({\n  links: z.number().int().default(0).describe(\"Number of links to extract from the page.\").optional(),\n  imageLinks: z.number().int().default(0).describe(\"Number of image links to extract from the page.\").optional(),\n}).describe(\"Options for extracting extra information.\").optional(),\n  summary: z.union([z.boolean(), z.object({\n  query: z.string().nullable().optional(),\n  schema: z.record(z.string(), z.unknown()).describe(\"Flexible model for JSON schema objects.\").nullable().optional(),\n}).describe(\"Options for summary generation.\")]).optional(),\n  subpages: z.number().int().default(0).describe(\"Number of subpages to crawl per result.\").optional(),\n  highlights: z.union([z.boolean(), z.object({\n  query: z.string().nullable().optional(),\n  maxCharacters: z.number().int().nullable().optional(),\n}).describe(\"Options for highlights extraction.\")]).optional(),\n  maxAgeHours: z.number().int().describe(\"Maximum age of cached content in hours. 0 = always live, -1 = never live.\").optional(),\n  subpageTarget: z.union([z.string(), z.array(z.string())]).optional(),\n  livecrawlTimeout: z.number().int().default(10000).describe(\"Timeout in milliseconds for live crawling.\").optional(),\n}).describe(\"Options for per-result content retrieval, saving a separate /contents round-trip.\").optional(),\n  compliance: z.string().describe(\"Enterprise-only compliance mode. Currently only 'hipaa'.\").optional(),\n  moderation: z.boolean().default(false).describe(\"Enable content moderation to filter unsafe content.\").optional(),\n  numResults: z.number().int().default(10).describe(\"Desired number of search results. Must be between 1 and 100 (inclusive). Defaults to 10. No pagination is available; larger values increase latency without guaranteeing better coverage.\").optional(),\n  excludeText: z.array(z.string()).describe(\"A list containing exactly one phrase (up to 5 words) that must NOT be present in the webpage text. Only one phrase is allowed per request. Example: ['outdated information'] (correct) vs ['outdated', 'wrong'] (incorrect - API will reject multiple phrases).\").optional(),\n  includeText: z.array(z.string()).describe(\"A list containing exactly one phrase (up to 5 words) that must be present in the webpage text. Only one phrase is allowed per request. Example: ['machine learning applications'] (correct) vs ['machine', 'learning'] (incorrect - API will reject multiple phrases).\").optional(),\n  outputSchema: z.record(z.string(), z.unknown()).describe(\"Flexible model for JSON schema objects.\").optional(),\n  systemPrompt: z.string().describe(\"Instructions guiding synthesized output / search planning for deep variants.\").optional(),\n  userLocation: z.string().describe(\"Two-letter ISO country code of the user (e.g., 'US').\").optional(),\n  excludeDomains: z.array(z.string()).describe(\"MUTUALLY EXCLUSIVE WITH includeDomains - provide ONLY ONE of includeDomains or excludeDomains, never both. A list of domain names to specifically exclude from the search results (max 1200). Must be valid domain names containing at least one dot (e.g., 'example.com', 'www.example.com' are valid). Supports subdomain wildcards (e.g., '*.amazon.com') and path filtering (e.g., 'example.com/path'). Must be without protocol (e.g., 'example.com' not 'https://example.com') and without angle brackets.\").optional(),\n  includeDomains: z.array(z.string()).describe(\"MUTUALLY EXCLUSIVE WITH excludeDomains - provide ONLY ONE of includeDomains or excludeDomains, never both. A list of domain names to specifically include in the search results (max 1200). Must be valid domain names containing at least one dot (e.g., 'example.com', 'www.example.com' are valid). Supports subdomain wildcards (e.g., '*.substack.com') and path filtering (e.g., 'example.com/blog'). Must be without protocol (e.g., 'example.com' not 'https://example.com') and without angle brackets.\").optional(),\n  endPublishedDate: z.string().describe(\"Filters results to include only those published before this ISO 8601 date. NOTE: This filter is NOT supported when category='company' and will be ignored.\").optional(),\n  additionalQueries: z.array(z.string()).describe(\"Extra query variations for deep-search variants only.\").optional(),\n  startPublishedDate: z.string().describe(\"Filters results to include only those published after this ISO 8601 date. NOTE: This filter is NOT supported when category='company' and will be ignored.\").optional(),\n}).describe(\"Parameters for an Exa search query, enabling filtering and customization of results.\");\nconst ExaSearch_StructuredOutputContentSchema: z.ZodTypeAny = z.record(z.string(), z.unknown()).describe(\"Structured synthesized output matching the user-provided outputSchema.\");\nconst ExaSearch_OutputCitationSchema: z.ZodTypeAny = z.object({\n  url: z.string().describe(\"URL of the source.\").optional(),\n  title: z.string().describe(\"Title of the source.\").optional(),\n}).describe(\"Citation source for synthesized output grounding.\");\nconst ExaSearch_OutputGroundingSchema: z.ZodTypeAny = z.object({\n  field: z.string().describe(\"Output field path grounded by these citations.\").optional(),\n  citations: z.array(ExaSearch_OutputCitationSchema).describe(\"Sources grounding this output field.\").optional(),\n  confidence: z.enum([\"low\", \"medium\", \"high\"]).describe(\"Confidence score for this grounded output field.\").optional(),\n}).describe(\"Grounding information for synthesized output.\");\nconst ExaSearch_SynthesizedOutputSchema: z.ZodTypeAny = z.object({\n  content: z.union([z.string(), ExaSearch_StructuredOutputContentSchema]).optional(),\n  grounding: z.array(ExaSearch_OutputGroundingSchema).describe(\"Field-level citations and confidence scores.\").optional(),\n}).describe(\"Synthesized output when outputSchema is provided.\");\nconst ExaSearch_ExtrasResultSchema: z.ZodTypeAny = z.object({\n  links: z.array(z.string()).describe(\"List of extracted links.\").optional(),\n  imageLinks: z.array(z.string()).describe(\"List of extracted image links.\").optional(),\n}).describe(\"Extra information extracted from a search result.\");\nconst ExaSearch_SearchResultSchema: z.ZodTypeAny = z.lazy((): z.ZodTypeAny => z.object({\n  id: z.string().describe(\"Unique identifier for the search result.\").optional(),\n  url: z.string().describe(\"URL of the search result.\").optional(),\n  text: z.string().describe(\"Extracted text content from the search result webpage (if available).\").optional(),\n  image: z.string().describe(\"URL of an image associated with the search result (if available).\").optional(),\n  score: z.number().describe(\"Relevance score of the search result, indicating how well it matches the query.\").optional(),\n  title: z.string().describe(\"Title of the search result.\").optional(),\n  author: z.string().describe(\"Author of the search result (if available).\").optional(),\n  extras: ExaSearch_ExtrasResultSchema.nullable().optional(),\n  favicon: z.string().describe(\"URL of the favicon for the website of the search result (if available).\").optional(),\n  summary: z.string().describe(\"A concise summary of the search result's content (if available).\").optional(),\n  subpages: z.array((ExaSearch_SearchResultSchema as z.ZodTypeAny)).describe(\"List of subpages or related links found within the search result (if available).\").optional(),\n  highlights: z.array(z.string()).describe(\"List of highlighted text snippets from the search result that match the query.\").optional(),\n  publishedDate: z.string().describe(\"Publication date of the search result (if available).\").optional(),\n}).describe(\"Represents an individual item from Exa search results, potentially including extracted text or highlights.\")) as z.ZodTypeAny;\nconst ExaSearch_CostBreakdownSchema: z.ZodTypeAny = z.object({\n  cost: z.number().describe(\"Cost for this operation.\").optional(),\n  count: z.number().int().describe(\"Number of operations.\").optional(),\n  operation: z.string().describe(\"Type of operation.\").optional(),\n}).describe(\"Cost breakdown by operation type.\");\nconst ExaSearch_CostDollarsSchema: z.ZodTypeAny = z.object({\n  total: z.number().describe(\"Total dollar cost.\").optional(),\n  breakDown: z.array(ExaSearch_CostBreakdownSchema).describe(\"Breakdown of costs by operation.\").optional(),\n}).describe(\"Cost information for the request.\");\nexport const ExaSearchOutput: z.ZodTypeAny = z.object({\n  output: ExaSearch_SynthesizedOutputSchema.nullable().optional(),\n  results: z.array((ExaSearch_SearchResultSchema as z.ZodTypeAny)).describe(\"A list of `SearchResult` objects, each representing an individual item found by the search.\"),\n  requestId: z.string().describe(\"A unique identifier for this specific search request.\"),\n  searchType: z.string().describe(\"For auto searches, indicates which search type was selected.\").optional(),\n  costDollars: ExaSearch_CostDollarsSchema.nullable().optional(),\n  composio_execution_message: z.string().describe(\"Message from Composio explaining any modifications made to the request parameters during execution.\").optional(),\n}).describe(\"Contains Exa search results, including found documents and search metadata.\");\n\nexport const exaSearch = action(\"EXA_SEARCH\", {\n  slug: \"exa-search\",\n  name: \"Search\",\n  description: \"Web search via the Exa engine. Returns ranked results with optional per-result text/highlights/summary (set the nested `contents` object). For agent workflows prefer `contents.highlights=true` — 10× fewer tokens than full text. Pick `type` by latency tier: `instant`~250 ms · `fast`~450 ms · `auto`~1 s (default) · `deep-lite` ~4 s · `deep` 4–15 s · `deep-reasoning` 12–40 s. `includeDomains` and `excludeDomains` are mutually exclusive (max 1200 each). For `category=company` or `category=people`, date filters / `excludeDomains` are NOT supported and will 400.\",\n  input: ExaSearchInput,\n  output: ExaSearchOutput,\n});\n"],"mappings":";;;AAIA,MAAa,iBAA+B,EAAE,OAAO;CACnD,MAAM,EAAE,KAAK;EAAC;EAAQ;EAAQ;EAAW;EAAa;EAAQ;CAAgB,CAAC,EAAE,QAAQ,MAAM,EAAE,SAAS,mCAAmC,EAAE,SAAS;CACxJ,OAAO,EAAE,OAAO,EAAE,SAAS,0BAA0B;CACrD,UAAU,EAAE,KAAK;EAAC;EAAW;EAAU;EAAkB;EAAQ;EAAiB;CAAkB,CAAC,EAAE,SAAS,4CAA4C,EAAE,SAAS;CACvK,UAAU,EAAE,OAAO;EACnB,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,EAAE,OAAO;GACrC,WAAW,EAAE,KAAK;IAAC;IAAW;IAAY;GAAM,CAAC,EAAE,SAAS,EAAE,SAAS;GACvE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;GACpD,iBAAiB,EAAE,MAAM,EAAE,KAAK;IAAC;IAAU;IAAc;IAAU;IAAQ;IAAW;IAAU;GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS;GAClI,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS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